code wiki / _hdl_build / nx_lostset_gate.nx
nx_lostset_gate.nx
buildroot/runtime/_hdl_build/nx_lostset_gate.nx
about
nx_lostset_gate.nx -- THE REFEREE for nx_registrymine `lostset` (DM3, devmgmt rung).
END-TO-END: it forks the DEPLOYED subject elf, so what it grades is the artifact callers actually
run, not a re-compiled copy of the source. Pass the subject path as argv[1] to grade a candidate.
WHY EACH TOOTH EXISTS -- every one of these is a way this miner could report a confident wrong
answer, and three of them are defects that were REAL in the input before the miner was written:
* the harness ships `deferred_tools_delta` attachments that LIST tool names as structural JSON,
so a bare-prefix scan counts listed-but-never-called tools as execution evidence;
* prose in a tool result can DISCUSS mcpMeta, so a naive needle counts a memory note as a fork;
* a resumed session replays earlier records, so a per-file count double-counts one call.
A tooth that only ever sees correct data has not been shown to fire, so the fixture carries the
bad case and the good case AT ONCE and the gate asserts they are told apart -- two runs that each
isolate one signal do not prove discrimination between them.
FIXTURES ARE ASSEMBLED AT RUNTIME under /tmp/nx_lostset_gate/ and never in a production tree: a
gate that shares its scratch with a live path reports on the FIXTURE, not on the code (measured
estate-wide, the gate_fixture ratchet). Idempotent: every fixture file is opened O_TRUNC, so the
second run grades the same bytes as the first.
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
| 25 | const LG_MODE_644: i64 = 420 // rw-r--r-- |
| 26 | const LG_MODE_755: i64 = 493 // rwxr-xr-x for the scratch dirs |
| 27 | const LG_PATH: i64 = 512 |
| 28 | const LG_FIX: i64 = 65536 // one fixture transcript |
| 29 | const LG_OUT: i64 = 1048576 // subject stdout capture |
| 30 | const LG_EXIT_SKIP: i64 = 3 // "I could not look" -- never an acquittal |
| 31 | const LG_RC_REFUSE: i64 = 3 // the subject's own refusal exit code |
functions
| 33 | func lg_wr(path: *u8, buf: *u8, n: i64) -> i64 |
| 40 | func lg_run(subj: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, out: *u8, cl: *i64) -> i64 |
| 50 | func lg_has(out: *u8, n: i64, lit: *u8) -> i64 { return tr_contains(out, n, lit) } |
| 52 | func main(argc: i64, argv: *i64) -> i64 |