code wiki / (root) / nx_provcheck.nx

nx_provcheck.nx

buildroot/runtime/nx_provcheck.nx

5601 B111 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_provcheck.nx -- ASK THE ARTIFACT WHAT IT WAS BUILT FROM, THEN ASK THE TREE (2026-08-07). This is the question the treecanon manifest exists to approximate, answered from facts instead: "is the deployed binary built from the sources that are in the tree right now?" The manifest answers a DIFFERENT question and answers it backwards. It is generated from the LAPTOP mirror, pushed to the NAS, and used to judge the NAS tree -- while edits land on the NAS through nx_fs_write and builds compile FROM the NAS. So it compares truth against a stale copy of a mirror and reports truth as a fork. Measured 2026-08-07: four different hashes for one header inside ten minutes, builds blocked by my own newer edit, and a manifest push that lost a file-lock race and simply did not land. Every one of those is the architecture, not a bug in the guards. ★★★★★★A MANIFEST IS A CLAIM ABOUT A TREE AT A PAST INSTANT; A CLOSURE HASH IS A FACT ABOUT THE BINARY IN YOUR HAND. `<target>.provenance` records the closure the build actually read; this recomputes the closure from the tree as it stands and compares. No push, no watermark, no census, nothing that can go stale between the write and the read, and no second tree required to have an opinion. VERDICTS -- each its own bucket because each has a different remedy: CURRENT recorded closure == tree closure. The artifact IS its sources. DRIFTED they differ. Something in the import closure changed since the build. UNRECORDED the sidecar has no closure_sha256 (built before this existed, or by the async path). *NOT A FAILURE AND NOT A PASS* -- it is "I could not look", and it must never be reported as either. A guard that turns absence into a verdict is the one that gets switched off after it lies once. NOSIDECAR no .provenance at all. nx_provcheck <target> [root] root default "." (run from the buildroot's parent) exit 0 CURRENT | 1 DRIFTED | 2 UNRECORDED/NOSIDECAR | 3 usage license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 2 imports · 0 importers

nx_tool_run.nx nx_buildecho.nx nx_provcheck.nx

imports: nx_tool_run.nxnx_buildecho.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main pe pcat pp be_after_hex 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 psame64

structs

none

consts

33const PC_CAP: i64 = 262144
34const PC_TMO: i64 = 90000

functions

36func pp(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 1: main
37func pe(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(2,s,n); return 0 }
called by 1: main
38func pcat(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
39func psame64(a: *u8, b: *u8) -> i64 { var i: i64=0; while i<64 { if a[i]!=b[i] { return 0 } i=i+1 } return 1 }
called by 1: main
41func main(argc: i64, argv: *i64) -> i64