code wiki / _hdl_build / nx_adoptdelta_gate.nx
nx_adoptdelta_gate.nx
buildroot/runtime/_hdl_build/nx_adoptdelta_gate.nx
about
nx_adoptdelta_gate.nx -- THE REFEREE for nx_deltaclass `adoptdelta` (DM7, devmgmt rung).
END-TO-END: forks the DEPLOYED nx_deltaclass elf, so it grades the artifact callers run.
The accept rule this enforces, verbatim from devmgmt.plan: "two consecutive beats emit deltas whose
arithmetic reconciles against the underlying logs, and any row whose reference is REF-FOSSIL is
excluded from the promotable delta rather than counted in it."
The fixture is built so that a WRONG emitter cannot pass by luck. It carries, in one log:
* two PRODUCTION rows whose every class delta is a different number, so a transposed column shows;
* a GATE-FIXTURE row (reg= names another registry) with wildly different values BETWEEN them --
an emitter that grades it as a beat gets visibly wrong deltas, which is the real hazard: the
live log genuinely contains a `distinct=6` fixture census between two `distinct=963` sweeps;
* a LEGACY row with no reg= at all -- UNKNOWN-PROVENANCE is its own bucket, and folding it into
either side is the "unrecognised value falls into a known bucket" defect;
* a PRODUCTION row whose own classes do not sum, which must be COUNTED as malformed rather than
silently averaged in;
* a `xstale=999` decoy immediately before the real ` stale=3`, because a key read by substring
rather than at a token boundary reports a different column under the right name -- a confident
wrong answer, the hardest kind to notice.
Fixtures live under /tmp/nx_adoptdelta_gate/ and are rewritten O_TRUNC on every run (idempotent);
a gate that shares scratch with a production path grades the fixture, not the code.
license_tier: ORIGINAL Read-only outside /tmp. No hw writes (Rule 26).
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_sovjson_lib.nxnx_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
structs
| none |
consts
| 28 | const AG_MODE_644: i64 = 420 |
| 29 | const AG_MODE_755: i64 = 493 |
| 30 | const AG_PATH: i64 = 512 |
| 31 | const AG_FIX: i64 = 65536 |
| 32 | const AG_OUT: i64 = 1048576 |
| 33 | const AG_EXIT_SKIP: i64 = 3 |
| 34 | const AG_RC_REFUSE: i64 = 3 |
functions
| 36 | func ag_wr(path: *u8, buf: *u8, n: i64) -> i64 |
| 43 | func ag_run(subj: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, out: *u8, cl: *i64) -> i64 |
| 54 | func main(argc: i64, argv: *i64) -> i64 |