AtlatestRepositoryfolio
1
;;; Prints one line per DISTINCT node kind the pressure manuscript exercises.2
;;;3
;;; The gate derives the frozen vocabulary independently, from the4
;;; `define-struct` lines in `src/folio/doc/model.sgl`, and requires every kind5
;;; to appear here. Neither side hardcodes the list, so adding a record to the6
;;; model without putting it in the manuscript fails the gate instead of quietly7
;;; shipping an unexercised node.8
;;;9
;;; This is the "enumerate, do not sample" requirement made mechanical: a10
;;; vocabulary property asserted from the members someone happened to think of11
;;; is how SD-P3 broke `example`.12
(import (sigil core) (sigil fs) (sigil syntax) (folio doc))14
(load "test/fixtures/folio-pressure.sgl")16
(define (heads-of events)17
(map (lambda (e) (if (pair? e) (car e) e)) events))18
(define (add-unique x seen) (if (memq x seen) seen (cons x seen)))19
(define all-heads20
(let loop ((xs (append (heads-of (folio-events pressure-project))21
(heads-of (folio-events pressure-note))))22
(seen '()))23
(if (null? xs) (reverse seen) (loop (cdr xs) (add-unique (car xs) seen)))))25
(for-each (lambda (h)26
(display (string-append "F1A_KIND " (symbol->string h)))27
(newline))28
all-heads)29
(display (string-append "F1A_COVERAGE_PROBE kinds=" (number->string (length all-heads))))30
(newline)