nx_synthroom_gate.nx
buildroot/runtime/nx_synthroom_gate.nx
about
nx_synthroom_gate.nx -- GATE for the room protocol (nx_synthroom_lib, /compare/synthroom rung SR1).
THE LOAD-BEARING TEETH ARE T8 AND T9: the SAME log replayed twice yields BYTE-IDENTICAL intent streams,
and the intent count is a PARTITION of the log (one row per event, none skipped). Everything else here
checks a shape; those two check the contract the board promises.
The neg-controls are the wire's three rules made falsifiable: a duplicate nonce is REFUSED (never
double-applied), an unknown verb is REFUSED on the way in, a corrupt row is REFUSED on the way out with
its index, and a menu without a fallback is REFUSED before the first tip.
The lib is exercised IN-PROCESS so a mutation bite reaches it; the fixture lives under /tmp/<gate>/
created at SETUP (a teardown does not run when a run crashes) and the log is unlinked at setup so the
gate is idempotent -- a gate that is not idempotent reports on its first run and lies about every run
after. The comment character is CONSTRUCTED (SR_CH_HASH) because a literal hash inside a string is an
nx_cc lexer trap.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_synthroom_lib.nxnx_gate_verdict.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 20 | const SG_DIR: *u8 = "/tmp/nx_synthroom_gate" as *u8 |
| 21 | const SG_MENU: *u8 = "/tmp/nx_synthroom_gate/menu.conf" as *u8 |
| 22 | const SG_BADMENU: *u8 = "/tmp/nx_synthroom_gate/menu_nofallback.conf" as *u8 |
| 23 | const SG_LOG: *u8 = "/tmp/nx_synthroom_gate/room.log" as *u8 |
| 24 | const SG_BADLOG: *u8 = "/tmp/nx_synthroom_gate/corrupt.log" as *u8 |
| 25 | const SG_ROWS: i64 = 16 |
| 26 | const SG_WORD: i64 = 8 |
| 27 | const SG_OUT: i64 = 16384 |
| 28 | const SG_TS: i64 = 1787840000 |
| 30 | const SG_MENU_ROWS: i64 = 3 |
| 31 | const SG_TIP_TOP: i64 = 500 |
| 32 | const SG_TIP_MID: i64 = 120 |
| 33 | const SG_TIP_LOW: i64 = 25 |
| 34 | const SG_TIP_UNDER: i64 = 3 |
| 36 | const SG_EVENTS: i64 = 7 |
functions
| 38 | func sg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 41 | func sg_put(path: *u8, body: *u8) -> i64 |
| 51 | func sg_bufeq(a: *u8, an: i64, b: *u8, bn: i64) -> i64 called by 1: main |
| 58 | func sg_append(nonce: *u8, verb: *u8, actor: *u8, a1: *u8, a2: *u8, line: *u8, scratch: *u8, lp: *i64) -> i64 |
| 62 | func main() -> i64 |