1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
;;; Copyright (c) 2026 Nicholas Vermeulen
;;; SPDX-License-Identifier: AGPL-3.0-or-later
;; proc-test.lisp — golden for the Phase A multi-process seam (proc-eval).
;; A child runs a FULL, separate rusty interpreter; parent and child share
;; nothing but bytes over pipes. Deterministic: every result and error string
;; is timing-independent, and the one timeout case asserts the OUTCOME (a
;; killed child) rather than a duration.
;; A plain computation comes back as (ok <printed-result>).
;; The child is a full rusty — the stdlib (range/apply) is present.
;; A child that RAISES is data, not a parent crash: (error <stderr> <code>).
;; A child that never terminates is killed at the deadline: (timeout).
;; (spin) is tail-recursive, so TCO loops it forever — only the kill ends it.
;; Real memory isolation: a child mutating its OWN global cannot reach ours.
;; Effect honesty: proc-eval is surfaced by the SAME walker pkg-effects uses,
;; so a package that spawns subprocesses admits it.
;; A non-string program is refused as an error, never a crash.
;; Env-scrubbing: the child runs on a clean-slate environment — it does NOT
;; inherit the parent's secrets/config. run_tests.sh exports PROC_SANDBOX_SENTINEL
;; to the PARENT for this run; the child must still read it as empty. (HOME/PATH
;; are re-injected so the child's own std bootstrap and tools still work.)
;; ── Phase B: replay-verified records ─────────────────────────────────────
;; A recorded run re-executes to the same result — replay IS the audit.
; sum 1..10 = 55
;; Tamper the recorded RESULT — replay catches it (proves the check bites,
;; and that a self-consistent record is the only thing replay can vouch for).