code wiki / (root) / nx_mfrow.nx

nx_mfrow.nx

buildroot/runtime/nx_mfrow.nx

13023 B239 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_mfrow.nx -- UPDATE ONE ROW OF A TREECANON MANIFEST, AND NOTHING ELSE. WHY THIS EXISTS, measured 2026-08-16. The treecanon family has a generator (nx_treediff, nx_treehash), two comparers (nx_treediverge, nx_hashdiverge) and a gate that refuses (nx_treecanon_gate). It has NO surgical write. So when ONE file is converged across trees, the only sanctioned way to record it is to REGENERATE THE WHOLE MANIFEST -- and the record is explicit that a whole-tree regeneration while a sibling is mid-edit is the one action that blesses unreviewed bytes at scale. Measured the same day: nx_treediverge reports 2,154 divergent paths, so that precondition is not merely risky, it is UNMET. The result was a converged file that could not be recorded, and therefore an organ that could not be rebuilt: nx_sov_build_run, laptop and NAS byte-identical, still refused by the canon gate. ★A FAMILY WITH NO SURGICAL WRITE TURNS EVERY CORRECTION INTO A WHOLE-TREE REGENERATION, SO THE ONLY SAFE-SIZED FIX IS THE ONE NOBODY CAN MAKE. SCOPE, deliberately narrow: one row, named by its relpath, in a manifest whose other bytes are untouched. It does not scan a tree, does not compute a hash, and cannot invent a row. Recording a convergence someone else proved is a DIFFERENT act from deciding one, and only the first belongs here. license_tier: ORIGINAL Writes ONE named file, atomically. No hw writes (Rule 26). expect_exit: 0

dependencies 2 imports · 0 importers

nx_gate_verdict.nx nx_tool_run.nx nx_mfrow.nx

imports: nx_gate_verdict.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 mfr_selftest gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ mfr_slen mfr_apply mfr_w mfr_row_is mfr_slen ↻ mfr_spaces mfr_put mfr_n gv_check gv_puts ↻ mfr_eq tr_contains gv_verdict gv_note_bare_rate gv_bare_rate gv_at gv_obj_has_n gv_at ↻ gv_puts ↻

structs

none

consts

22const MFR_SP: i64 = 32
23const MFR_NL: i64 = 10
24const MFR_HEADROOM: i64 = 256 // output = input + this; a rewritten row can only grow by its own field widths

functions

26func mfr_w(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: mfr_applymain
27func mfr_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
28func mfr_n(v: i64) -> i64
called by 1: mfr_apply
41func mfr_eq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 }
called by 1: mfr_selftest
46func mfr_row_is(buf: *u8, s: i64, e: i64, rel: *u8) -> i64
called by 1: mfr_apply calls 1: mfr_slen
57func mfr_spaces(buf: *u8, s: i64, e: i64) -> i64
called by 1: mfr_apply
64func mfr_put(dst: *u8, o: i64, s: *u8) -> i64
called by 1: mfr_apply
73func mfr_apply(path: *u8, rel: *u8, newsize: *u8, newhash: *u8) -> i64
161func mfr_selftest() -> i64
219func main(argc: i64, argv: *i64) -> i64