code wiki / _hdl_build / nx_debtconfirm.nx

nx_debtconfirm.nx

buildroot/runtime/_hdl_build/nx_debtconfirm.nx

13706 B271 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_debtconfirm.nx -- THE MECHANICAL DEBT-CLOSURE CONFIRMER (2026-07-31, ws=d001-b). WHY: the debt ledger fills ~5x faster than a seat drains it (open 1523->1586 in one session, +31 filed vs +6 eaten per 25min). Hand-draining cannot converge. nx_debtlive scan already names 356 rows CITED by a fix site, but its check verb correctly says "confirm by ARTIFACT before eating". THIS is that confirmer. I FIRST CLAIMED THIS COULD NOT BE MECHANIZED ("it needs judgement about which string proves a fix"). THAT WAS WRONG: debt rows carry STRUCTURED evidence -- sha256, byte counts, gate names -- so a ladder verifies them with no judgement at all. This organ is the correction. ---------------- THE ASYMMETRY, MEASURED, AND THE WHOLE REASON THIS ORGAN IS SUBTLE ---------------- Debt 1785471390 cites sha256 d7f1316d.. / 35043B for nx_adopt. The LIVE nx_adopt.elf measures sha256 5018513b.. / 36030B -- MISMATCH, because the organ was REBUILT after the row was filed. Yet the fix IS present (calling nx_adopt returns the full report the row said was EMPTY). => A SHA/BYTE CITATION IS A STRONG POSITIVE AND A WEAK NEGATIVE. MATCH => CONFIRMED (definitively that build is live) MISMATCH => INCONCLUSIVE. **NEVER "REFUTED".** A confirmer that read mismatch as "unfixed" would emit FALSE NEGATIVES on every rebuilt organ, i.e. on most of the corpus. Same family as the banked law BINARY GREP IS VALID ONE WAY ONLY. ---------------- HARD CONSTRAINTS (non-negotiable, enforced by construction) ---------------- 1. READ-ONLY. This organ NEVER eats a row and NEVER writes outside its own stdout. A bug here can only MIS-REPORT, never mark an unfixed problem solved. That is why it was safe to build at all. 2. TERNARY verdicts. There is NO refuted rung: absence of evidence is INSUFFICIENT, never a denial. 3. It COMPOSES nx_filehash rather than reimplementing sha256 (rule 15) -- one hasher, one truth. usage: nx_debtconfirm check <organ.elf> [expect-sha|-] [expect-bytes|-] nx_debtconfirm selftest exit 0=CONFIRMED 6=INCONCLUSIVE 7=INSUFFICIENT 2=usage 4=I/O license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_estr.nx nx_tool_run.nx nx_debtconfirm.nx

imports: nx_syscalls.nxnx_estr.nxnx_tool_run.nx

imported by: nobody (leaf or entry point)

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

main es_puts sys_write es_len sys_exit dc_at es_len ↻ dc_selftest sys_mmap es_puts ↻ es_len ↻ dc_t es_puts ↻ dc_field_eq dc_find es_len ↻ dc_at ↻ es_len ↻ dc_find ↻ dc_has_remainder dc_find ↻ es_putn sys_mmap ↻ sys_write ↻ dc_scope sys_mmap ↻ sys_openat_rd es_puts ↻ sys_read sys_close dc_has_remainder ↻ dc_check sys_mmap ↻ dc_hash sys_mmap ↻ tr_run_capture_to tr_run_capture sys_mmap ↻ sys_pipe2 sys_fork

structs

none

consts

35const DC_CAP: i64 = 65536
36const DC_SLOT: i64 = 64
37const DC_HASHER: *u8 = "nx_filehash.elf"
38const DC_HASH_MS: i64 = 60000
39const DC_USAGE: i64 = 2
40const DC_IOERR: i64 = 4
41const DC_INCONCL: i64 = 6
42const DC_INSUFF: i64 = 7

functions

44func dc_at(buf: *u8, n: i64, i: i64, s: *u8, sl: i64) -> i64
called by 2: dc_findmain
54func dc_find(buf: *u8, n: i64, s: *u8) -> i64
65func dc_field_eq(buf: *u8, n: i64, key: *u8, want: *u8) -> i64
called by 2: dc_checkdc_selftest calls 2: dc_findes_len
81func dc_hash(path: *u8, out: *u8) -> i64
called by 1: dc_check calls 2: sys_mmaptr_run_capture_to
93func dc_check(elf: *u8, wsha: *u8, wbytes: *u8) -> i64
146func dc_has_remainder(buf: *u8, n: i64) -> i64
called by 2: dc_scopedc_selftest calls 1: dc_find
170func dc_scope(path: *u8) -> i64
199func dc_t(got: i64, want: i64, name: *u8, pass: *i64, tot: *i64) -> i64
called by 1: dc_selftest calls 1: es_puts
208func dc_selftest() -> i64
241func main(argc: i64, argv: *i64) -> i64