code wiki / _hdl_build / nx_adoptdelta_gate.nx

nx_adoptdelta_gate.nx

buildroot/runtime/_hdl_build/nx_adoptdelta_gate.nx

12149 B176 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_sovjson_lib.nx nx_gate_verdict.nx nx_tool_run.nx nx_adoptdelta_gate.nx

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

main 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 ↻ sys_mmap ↻ sj_cat sj_allow_path sys_mmap ↻ sys_openat_rd sys_read sys_close sj_le sj_col sj_lit_eq sys_mkdir ag_wr sys_openat_wr sys_write ↻ sys_close ↻ sys_unlinkat gv_check gv_puts ↻ ag_run sys_mmap ↻

structs

none

consts

28const AG_MODE_644: i64 = 420
29const AG_MODE_755: i64 = 493
30const AG_PATH: i64 = 512
31const AG_FIX: i64 = 65536
32const AG_OUT: i64 = 1048576
33const AG_EXIT_SKIP: i64 = 3
34const AG_RC_REFUSE: i64 = 3

functions

36func ag_wr(path: *u8, buf: *u8, n: i64) -> i64
43func ag_run(subj: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, out: *u8, cl: *i64) -> i64
called by 1: main calls 2: sys_mmaptr_run_capture
54func main(argc: i64, argv: *i64) -> i64