code wiki / _hdl_build / nx_contentdiff_gate.nx
nx_contentdiff_gate.nx
buildroot/runtime/_hdl_build/nx_contentdiff_gate.nx
about
nx_contentdiff_gate.nx -- THE REFEREE FOR THE PROMOTE CAPABILITY RULER.
WHY IT EXISTS: nx_contentdiff_lib is the arithmetic behind BOTH the hand-run oracle (nx_contentdiff)
AND the staging guard inside md_promote_staged, i.e. it decides whether a promote is allowed to destroy
printable content. On 2026-09-03 a census found it had NO GATE ANYWHERE -- the ruler that judges every
promote in the estate was itself unjudged, so every property it claims rested on the fact that nobody
had seen it misbehave. ★A GREEN THAT NEVER HAD A CORRESPONDING RED IS UNVERIFIED, and here there was
not even a green: there was no test.
It proves the properties the promote decision actually rests on:
* the loss measure is CORRECT on constructed subset / superset / identical / disjoint inputs;
* it is FAIL-CLOSED -- an empty or unreadable candidate is TOTAL loss, never clean (the direction that
matters, because the flattering failure here silently blesses a broken artifact);
* the SYMMETRY class names all four outcomes, so a rename cannot read as a removal;
* the SOURCE-PATH partition is narrow enough that it cannot swallow real content, and it RECONCILES.
license_tier: ORIGINAL Read-only. No hw writes (Rule 26). expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_contentdiff_lib.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_BUF: i64 = 4096 |
| 22 | const CG_MINLEN: i64 = 6 |
| 23 | const CG_NUL: i64 = 0 |
functions
| 26 | func cg_run(b: *u8, off: i64, s: *u8) -> i64 called by 1: main |
| 34 | func cg_prm() -> *i64 |
| 42 | func main(argc: i64, argv: *i64) -> i64 |