code wiki / _hdl_build / nx_debtconfirm.nx
nx_debtconfirm.nx
buildroot/runtime/_hdl_build/nx_debtconfirm.nx
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
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
structs
| none |
consts
| 35 | const DC_CAP: i64 = 65536 |
| 36 | const DC_SLOT: i64 = 64 |
| 37 | const DC_HASHER: *u8 = "nx_filehash.elf" |
| 38 | const DC_HASH_MS: i64 = 60000 |
| 39 | const DC_USAGE: i64 = 2 |
| 40 | const DC_IOERR: i64 = 4 |
| 41 | const DC_INCONCL: i64 = 6 |
| 42 | const DC_INSUFF: i64 = 7 |
functions
| 44 | func dc_at(buf: *u8, n: i64, i: i64, s: *u8, sl: i64) -> i64 |
| 54 | func dc_find(buf: *u8, n: i64, s: *u8) -> i64 |
| 65 | func dc_field_eq(buf: *u8, n: i64, key: *u8, want: *u8) -> i64 |
| 81 | func dc_hash(path: *u8, out: *u8) -> i64 |
| 93 | func dc_check(elf: *u8, wsha: *u8, wbytes: *u8) -> i64 |
| 146 | func dc_has_remainder(buf: *u8, n: i64) -> i64 |
| 170 | func dc_scope(path: *u8) -> i64 |
| 199 | func dc_t(got: i64, want: i64, name: *u8, pass: *i64, tot: *i64) -> i64 |
| 208 | func dc_selftest() -> i64 |
| 241 | func main(argc: i64, argv: *i64) -> i64 |