code wiki / _hdl_build / nx_seatresume_gate.nx

nx_seatresume_gate.nx

buildroot/runtime/_hdl_build/nx_seatresume_gate.nx

20543 B299 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_seatresume_gate.nx -- referee for nx_seat resume_map (DM2 crash-resume map, /compare/devmgmt). Fixtures are ASSEMBLED AT RUNTIME under /tmp/nx_seatresume_gate/<epoch>/ (never the live population, never a source-embedded pattern -- the detector-finds-its-own-fixture trap), unique per run so the gate is idempotent by construction. It forks the DEPLOYED subject elf (argv override for staged or local builds) and judges only the subject's OUTPUT -- the same evidence a coordinator would read. Teeth carry their strength in their NAME (gate law E7); both refusal directions are covered: a mapper that misses a planted in-flight write fails the detection teeth, and a mapper that flags EVERYTHING fails the clean-session neg-control (the guard-that-refuses-everything trap). license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_gate_verdict.nx nx_tool_run.nx nx_syscalls.nx nx_seatresume_gate.nx

imports: nx_gate_verdict.nxnx_tool_run.nxnx_syscalls.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_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real sys_mkdir sys_mmap ↻ gv_cat gv_catn sys_mmap ↻ sys_munmap gt_path2 gv_cat ↻ sys_openat_wr sys_write ↻ gt_slen sys_close gt_wf sys_openat_wr ↻ sys_write ↻ sys_close ↻ sys_utimensat

structs

none

consts

14const GT_MODE_FILE: i64 = 0x1a4 // 0644, the estate's ST_MODE_RW spelling
15const GT_MODE_DIR: i64 = 0x1ed // 0755 for fixture dirs
16const GT_CAP: i64 = 262144 // capture buffer; the fixture report measures <20KB, tooth asserts TR_FIT so a silent cut cannot pass
17const GT_TIMEOUT_MS: i64 = 30000 // mirrors the subject's own ST_FORK_TIMEOUT_MS bounded-exec rationale
18const GT_WIN_HALF: i64 = 3600 // explicit fixture window half-width = the subject's ST_STALE_SEC/2; only needs to exceed the write-to-run gap
19const GT_OLD_OFFSET: i64 = 100000 // pushes old1 outside BOTH the explicit window and latest-mode span (ST_STALE_SEC=7200) by >10x
20const GT_NULPAD: i64 = 32 // NUL-fill length for the truncated-final-line fixture (real crashes measured 1700..26911B of garbage; any NUL run without a parseable type reproduces the class)
21const GT_PATH: i64 = 4096 // PATH_MAX
22const GT_ARGV: i64 = 96 // argv cell array: 12 slots x 8
23const GT_NUMBUF: i64 = 32 // one decimal epoch string
25const GT_JWIN: i64 = 60 // journal-leg test window width (s): narrow enough that the fixture's own span brackets it, so COVERS/PARTIAL are decided by the fixture, not by wall-clock drift
26const GT_JSEED: i64 = 3600 // how far back the fixture's span-min frame sits; only needs to precede the window start
27const GT_JBUF: i64 = 4096 // journal fixture build buffer; the fixtures below measure a few hundred bytes

functions

29func gt_slen(s: *u8) -> i64 { var sl_n: i64 = 0; while s[sl_n] != (0 as u8) { sl_n = sl_n + 1 } return sl_n }
called by 1: main
33func gt_frame(buf: *u8, off: i64, ts: i64, ws: *u8, tool: *u8, note: *u8) -> i64
called by 1: main calls 2: gv_catngv_cat
50func gt_wf(path: *u8, content: *u8) -> i64
60func gt_path2(dst: *u8, a: *u8, b: *u8) -> i64
called by 1: main calls 1: gv_cat
67func main(argc: i64, argv: *i64) -> i64