AtlatestRepositoryfolio

folio / tree / testf1b-witness-load.sgl

1;;; F1b -- load ONE manuscript, in a fresh process, and report what happened.
2;;;
3;;; WHY ONE MANUSCRIPT PER PROCESS. The no-execution claim is about ABSENCE:
4;;; that no tripwire fired. If several manuscripts were loaded into one process,
5;;; a marker printed by the positive control and a marker printed by the
6;;; manuscript under test would be indistinguishable in the same stdout, and a
7;;; sentinel written by either would sit in the same directory. The gate
8;;; therefore runs this file once per fixture with its own `F1B_WITNESS_DIR`, so
9;;; "no marker" is a fact about one process and one manuscript.
10;;;
11;;; TWO DETECTION CHANNELS, as F2a established: stdout markers AND filesystem
12;;; sentinels. Two channels because a single one that silently stopped working
13;;; would report the absence this arm exists to assert -- and the absence would
14;;; be indistinguishable from success.
15;;;
16;;; The outcome line is printed on BOTH paths, refused and loaded alike, so the
17;;; gate never has to infer what happened from an exit code. A gate that reads
18;;; only an exit status cannot tell "refused as designed" from "the harness
19;;; could not run".
20(import (sigil core) (sigil fs) (folio doc))
22(define fixture
23 (let ((v (getenv "F1B_WITNESS_FIXTURE")))
24 (if (and (string? v) (> (string-length v) 0))
25 v
26 (error "F1B_WITNESS_FIXTURE is unset; this harness refuses to report an absence it did not look for"))))
28;; The message is captured here rather than left to propagate, because the
29;; `#lang` load path DISCARDS a reader's exception message
30;; (`compiler.c:530-532` reads the C-level `vm->error_message`, which is empty
31;; for a Scheme-level raise). What survives to this handler is therefore the
32;; compiler's wrapper text, not folio's refusal wording -- which is exactly why
33;; `test/gate-f1b.sh` asserts the WORDING through a direct `read-language-source`
34;; call in a different arm, and asserts only OCCURRENCE here.
35(define outcome
36 (guard (exn (else (string-append "REFUSED " (exception-message exn))))
37 (load fixture)
38 "LOADED"))
40(display "F1B_WITNESS_OUTCOME ")
41(display outcome)
42(newline)