nx_closurehash_gate.nx
buildroot/runtime/nx_closurehash_gate.nx
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
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
structs
| none |
consts
| 21 | const CG_ROOT: *u8 = "/tmp/chgate" |
| 22 | const CG_RT: *u8 = "/tmp/chgate/runtime" |
| 23 | const CG_CAP: i64 = 65536 |
| 24 | const CG_MODE: i64 = 493 |
functions
| 26 | func cgp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 27 | func cgn(v: i64) -> i64 |
| 40 | func cgwrite(path: *u8, body: *u8) -> i64 called by 1: main |
| 49 | func 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 |
| 52 | func cg_sha(buf: *u8, n: i64, out: *u8) -> i64 called by 1: main |
| 70 | func cg_num_after(buf: *u8, n: i64, key: *u8) -> i64 called by 1: main |
| 93 | func cg_same(a: *u8, b: *u8) -> i64 called by 1: main |
| 100 | func cg_exists(p: *u8) -> i64 called by 1: main |
| 108 | func main(argc: i64, argv: *i64) -> i64 |