AtlatestRepositoryfolio
1
#lang sigil/doc2
@(import (sigil fs) (sigil process))3
@(define (witness-sentinel name)4
(write-file-string5
(string-append (or (getenv "F2A_WITNESS_DIR") "/tmp") "/f2a-witness-" name)6
"TRIPPED"))7
@(display "F2A-WITNESS-EXPR-RAN\n")8
@(witness-sentinel "expr")9
@(define (tripwire-command . body)10
;; An author-defined command. A command at block position receives11
;; already-lowered block children, so this returns them rather than12
;; re-wrapping them.13
(display "F2A-WITNESS-COMMAND-RAN\n")14
(witness-sentinel "command")15
body)16
@(define (midprose-command . body)17
;; POSITION CLASS 5 of 5, the one Fable named. An author command at a18
;; NON-BOUNDARY position folds into the enclosing bare-prose run (SD-P3), and19
;; no tripwire had ever sat there.20
(display "F2A-WITNESS-MIDPROSE-COMMAND-RAN\n")21
(witness-sentinel "midprose-command")22
;; `author-normalize` accepts a document node or a proper LIST (which it23
;; flattens) and nothing else -- a bare string is refused. An empty list24
;; splices to nothing and is legal at every position.25
'())26
@(define (argument-tripwire-command status-keyword status-value . body)27
;; CHANNEL 3. The point of this command is not its body -- it is that its28
;; `status:` ARGUMENT is an expression. Reading a field value out of argument29
;; syntax is the one way F2a could newly execute author code, and SD-P4's own30
;; witness fixture has no argument-position attempt at all, so its31
;; stdout-marker witness cannot see this shape by construction.32
(display "F2A-WITNESS-ARG-COMMAND-RAN\n")33
body)34
@(define-syntax macro-tripwire35
(syntax-rules ()36
((_ body ...)37
(begin (display "F2A-WITNESS-MACRO-RAN\n")38
(witness-sentinel "macro")39
body ...))))40
@article["F2a no-execution witness" authors: '("F2a")]42
@p{This manuscript exists to prove the no-execution detector can SEE execution.43
Passive inspection must trip none of its channels; evaluating the same file44
through the real @code{#lang} path must trip all of them, and the gate arm runs45
both in the same breath so an all-empty result cannot be mistaken for a clean46
one.}48
@tripwire-command{An author-defined command whose body runs only under49
evaluation.}51
@argument-tripwire-command[status: (begin (display "F2A-WITNESS-ARG-RAN\n")52
(witness-sentinel "argument")53
'ready)]{54
@p{The argument above is an ordinary Sigil expression sitting in a keyword55
field. A passive inspector reads it as DATA with @code{syntax->datum}; anything56
that evaluates it instead trips this channel.}57
}59
@(macro-tripwire (display "F2A-WITNESS-MACRO-USE-RAN\n")60
;; the macro's expansion must end in a proper list of61
;; document nodes, or lowering refuses it AFTER every62
;; tripwire has already fired -- which would leave the63
;; positive control passing on a run that also errored.64
'())66
Bare prose, deliberately NOT wrapped in a paragraph command. BOTH ATTEMPTS BELOW67
SIT MID-LINE, and that is the whole point: a command or expression at the START68
of a line is at a BLOCK boundary, where lowering demands it produce document69
nodes. The first version of this fixture put them there and proved only that a70
block-position expression runs. Inline expression @(begin (display "F2A-WITNESS-MIDPROSE-RAN\n") (witness-sentinel "midprose") '()) sits here, and inline command @midprose-command{author command} sits here. Under evaluation both fold into71
this paragraph run; in the passive tree both are ordinary flat siblings, which is72
why the passive side sees them at all and why the tripwire has to be HERE rather73
than assumed covered by the block-position one.75
@code["sigil"]{@(display "F2A-WITNESS-CODE-BODY-RAN\n")}77
@end article