code wiki / (root) / nx_synthroom_gate.nx

nx_synthroom_gate.nx

buildroot/runtime/nx_synthroom_gate.nx

11160 B196 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_synthroom_lib.nx nx_gate_verdict.nx nx_synthroom_gate.nx

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

main gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ sys_mkdir sys_unlinkat sys_mmap ↻ sr_cat sg_put sys_openat_wr sg_slen sys_write ↻ sys_close gv_need gv_puts ↻ sr_menu_load sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close ↻ sr_menu_parse

structs

none

consts

20const SG_DIR: *u8 = "/tmp/nx_synthroom_gate" as *u8
21const SG_MENU: *u8 = "/tmp/nx_synthroom_gate/menu.conf" as *u8
22const SG_BADMENU: *u8 = "/tmp/nx_synthroom_gate/menu_nofallback.conf" as *u8
23const SG_LOG: *u8 = "/tmp/nx_synthroom_gate/room.log" as *u8
24const SG_BADLOG: *u8 = "/tmp/nx_synthroom_gate/corrupt.log" as *u8
25const SG_ROWS: i64 = 16
26const SG_WORD: i64 = 8
27const SG_OUT: i64 = 16384
28const SG_TS: i64 = 1787840000
30const SG_MENU_ROWS: i64 = 3
31const SG_TIP_TOP: i64 = 500
32const SG_TIP_MID: i64 = 120
33const SG_TIP_LOW: i64 = 25
34const SG_TIP_UNDER: i64 = 3
36const SG_EVENTS: i64 = 7

functions

38func sg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: sg_putmain
41func sg_put(path: *u8, body: *u8) -> i64
51func sg_bufeq(a: *u8, an: i64, b: *u8, bn: i64) -> i64
called by 1: main
58func sg_append(nonce: *u8, verb: *u8, actor: *u8, a1: *u8, a2: *u8, line: *u8, scratch: *u8, lp: *i64) -> i64
called by 1: main calls 1: sr_event_append
62func main() -> i64