code wiki / (root) / nx_closurehash_gate.nx

nx_closurehash_gate.nx

buildroot/runtime/nx_closurehash_gate.nx

9963 B206 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_closurehash_gate.nx -- PROVE nx_closurehash ACTUALLY READS THE CLOSURE (2026-08-07). The organ claims something strong: that its one hash covers every source the compiler will read. That claim has an obvious trivial-wrong implementation -- hash ONLY the target file and print a number -- and such a fake would pass every naive test: it resolves, it is deterministic, it emits 64 hex chars. *A TEST THAT THE TRIVIAL WRONG IMPLEMENTATION ALSO PASSES MEASURES NOTHING.* T3 is the tooth that decides it: mutate ONE BYTE of a TRANSITIVE dependency (depth 2, never named by the target) and require the closure hash to CHANGE. A target-only hasher cannot pass that, and neither can a one-level hasher. Fixtures are built on disk under /tmp so the walk is exercised for real -- a fixture held in memory would test the parser and skip the resolver, which is where the last two defects actually were (a scanner matching its own source text, and a resolver blind to a third search path). nx_closurehash_gate [elf] elf default ./_build/nx_closurehash.sov.elf license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 2 imports · 0 importers

nx_tool_run.nx nx_gate_verdict.nx nx_closurehash_gate.nx

imports: nx_tool_run.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 cg_exists cgp cgcat cgwrite tr_run_capture_to tr_run_capture_tr tr_run_capture_core tr_run_capture_core_owned tr_run_capture_core_eviden sys_mmap_shared tr_clock_ms sys_munmap sys_pipe2 sys_fork sys_close sys_default_signal sys_bind_parent_lifetime sys_exit sys_setpgid tr_capture_redirect sys_chdir sys_close_inherited sys_execve tr_exec_failed tr_watchdog_start tr_capture_stop tr_reap tr_evidence_wait tr_drain_until_owned tr_observe_exit nx_kill wait_status_rc cg_num_after cg_sha cgn cgp ↻ cg_same gv_ctr sys_mmap

structs

none

consts

21const CG_ROOT: *u8 = "/tmp/chgate"
22const CG_RT: *u8 = "/tmp/chgate/runtime"
23const CG_CAP: i64 = 65536
24const CG_MODE: i64 = 493

functions

26func cgp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 2: cgnmain
27func cgn(v: i64) -> i64
called by 1: main calls 1: cgp
40func cgwrite(path: *u8, body: *u8) -> i64
called by 1: main
49func cgcat(d: *u8, o: i64, s: *u8) -> i64 { var x: i64=o; var i: i64=0; while s[i]!=(0 as u8){d[x]=s[i];x=x+1;i=i+1} return x }
called by 1: main
52func cg_sha(buf: *u8, n: i64, out: *u8) -> i64
called by 1: main
70func cg_num_after(buf: *u8, n: i64, key: *u8) -> i64
called by 1: main
93func cg_same(a: *u8, b: *u8) -> i64
called by 1: main
100func cg_exists(p: *u8) -> i64
called by 1: main
108func main(argc: i64, argv: *i64) -> i64