AtlatestRepositoryfolio
1
#lang folio/doc2
@(import (sigil fs))3
@(define (witness-sentinel name)4
(write-file-string5
(string-append (or (getenv "F1B_WITNESS_DIR") "/tmp") "/f1b-witness-" name)6
"TRIPPED"))7
@(display "F1B-WITNESS-EXPR-RAN\n")8
@(witness-sentinel "expr")9
@(define (tripwire-command . body)10
(display "F1B-WITNESS-COMMAND-RAN\n")11
(witness-sentinel "command")12
body)13
@(define (midprose-command . body)14
(display "F1B-WITNESS-MIDPROSE-COMMAND-RAN\n")15
(witness-sentinel "midprose-command")16
'())17
@(define-syntax macro-tripwire18
(syntax-rules ()19
((_ body ...)20
(begin (display "F1B-WITNESS-MACRO-RAN\n")21
(witness-sentinel "macro")22
body ...))))23
@note["topics/f1b-witness" title: "No-execution witness" tags: '("folio")]25
@p{This manuscript exists to prove the no-execution detector can SEE execution.26
Under @code{#lang sigil/doc} every channel below must trip; under27
@code{#lang folio/doc} the manuscript must be REFUSED at read time and none of28
them may trip. The gate runs both in the same arm, so an all-empty result cannot29
be mistaken for a clean one.}31
@tripwire-command{An author-defined command whose body runs only under32
evaluation.}34
Bare prose, deliberately NOT wrapped in a paragraph command. The attempt below35
sits MID-LINE and that is the whole point: a command or expression at the START36
of a line is at a BLOCK boundary, where lowering demands it produce document37
nodes. Inline expression @(begin (display "F1B-WITNESS-MIDPROSE-RAN\n") (witness-sentinel "midprose") '()) sits here, and inline command @midprose-command{author command} sits here, so SD-P3's fold is exercised rather than assumed.39
@(macro-tripwire (display "F1B-WITNESS-MACRO-USE-RAN\n")40
'())42
@code["sigil"]{@(display "F1B-WITNESS-CODE-BODY-RAN\n")}44
@end note