code wiki / _hdl_build / nx_lostset_gate.nx

nx_lostset_gate.nx

buildroot/runtime/_hdl_build/nx_lostset_gate.nx

17368 B208 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_sovjson_lib.nx nx_gate_verdict.nx nx_tool_run.nx nx_lostset_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 lg_wr sys_openat_wr sys_write ↻ sys_close ↻ sys_unlinkat gv_check gv_puts ↻ lg_run sys_mmap ↻

structs

none

consts

25const LG_MODE_644: i64 = 420 // rw-r--r--
26const LG_MODE_755: i64 = 493 // rwxr-xr-x for the scratch dirs
27const LG_PATH: i64 = 512
28const LG_FIX: i64 = 65536 // one fixture transcript
29const LG_OUT: i64 = 1048576 // subject stdout capture
30const LG_EXIT_SKIP: i64 = 3 // "I could not look" -- never an acquittal
31const LG_RC_REFUSE: i64 = 3 // the subject's own refusal exit code

functions

33func lg_wr(path: *u8, buf: *u8, n: i64) -> i64
40func lg_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
50func lg_has(out: *u8, n: i64, lit: *u8) -> i64 { return tr_contains(out, n, lit) }
called by 1: main calls 1: tr_contains
52func main(argc: i64, argv: *i64) -> i64