nx_srcreach_gate.nx
buildroot/runtime/nx_srcreach_gate.nx
about
nx_srcreach_gate.nx -- THE GATE FOR THE SOURCE REGISTRY READER AND THE PACE BUDGET (/compare/researchreach RR1, RR3).
IN-PROCESS ON PURPOSE. It imports nx_srcreg_lib and calls sr_classify and sr_pace directly rather than forking a
deployed elf, for three reasons: it is deterministic (no network, no host in the loop, so it cannot flake), it is
fast enough to sit on a roster, and it is MUTATION-SENSITIVE -- a change to the classifier or the budget arithmetic
shows up here immediately, which is what makes nx_gate_bite able to say anything about it at all.
WHY THIS GATE EXISTS: nx_srcreach decides which of the estate's declared research sources are usable and how many
outbound requests a sweep may spend. A reader that silently drops a row it cannot parse under-reports coverage in
the FLATTERING direction, and a budget that understates its cost is how an array gets hammered. Both failures are
quiet, so both need a gate that fires rather than a habit that remembers.
EVERY BAD CLASS IS PLANTED AND EVERY PLANT MUST BE CAUGHT, and the POSITIVE CONTROL is the half that matters most:
a clean registry must read entirely OK. A classifier that refused everything would pass every planted-defect tooth
while being useless, so the clean-reads-clean teeth are what separate a working ruler from a broken one.
THE BUDGET IS ASSERTED AGAINST HAND-COMPUTED VALUES with gv_check_eq, so the number tested and the number printed
are the same expression and cannot drift apart.
Fixtures are assembled at RUNTIME in this gate's own /tmp directory, never shared with a production beat.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_srcreg_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
| 24 | const SRG_DIR: *u8 = "/tmp/nx_srcreach_gate" |
| 25 | const SRG_CLEAN: *u8 = "/tmp/nx_srcreach_gate/clean.conf" |
| 26 | const SRG_DIRTY: *u8 = "/tmp/nx_srcreach_gate/dirty.conf" |
| 27 | const SRG_DIRMODE: i64 = 0x1ed |
| 28 | const SRG_FILEMODE: i64 = 0x1a4 |
| 29 | const SRG_I64: i64 = 8 |
| 30 | const SRG_SLOTS: i64 = 64 |
| 31 | const SRG_BUDGET_SLOTS: i64 = 4 |
| 33 | const SRG_B_REQUESTS: i64 = 0 |
| 34 | const SRG_B_LONGEST: i64 = 1 |
| 35 | const SRG_B_TOTAL: i64 = 2 |
| 39 | const SRG_CLEAN_BODY: *u8 = "src|a|preprint|atom-api|https://a.example|3000|none|open|clean\nsrc|b|index|rest-json|https://b.example|1000|none|cc0|clean\nsrc|c|registry|oai-pmh|https://c.example|5000|none|open|clean\n" |
| 41 | const SRG_DIRTY_BODY: *u8 = "src|a|preprint|atom-api|https://a.example|3000|none|open|clean\nsrc|b|index|rest-json|https://b.example|1000|none|cc0|clean\nsrc|c|registry|oai-pmh|https://c.example|5000|none|open|clean\nsrc|k|WIDGET|rest-json|https://d.example|2000|none|open|planted bad kind\nsrc|p|forge|carrier-pigeon|https://e.example|2000|none|open|planted bad proto\nsrc|z|index|html|https://f.example|soon|none|open|planted bad pace\nsrc|f|index|html|https://g.example\n" |
| 42 | const SRG_CLEAN_ROWS: i64 = 3 |
| 43 | const SRG_DIRTY_ROWS: i64 = 7 |
| 44 | const SRG_REQS: i64 = 4 |
| 46 | const SRG_EXP_REQUESTS: i64 = 12 |
| 48 | const SRG_EXP_LONGEST: i64 = 20000 |
| 50 | const SRG_EXP_TOTAL: i64 = 36000 |
functions
| 52 | func srg_write(path: *u8, data: *u8) -> i64 |
| 64 | func srg_pace(st: *i64, pace: *i64, nrows: i64, reqs: i64, out: *i64) -> i64 |
| 82 | func main(argc: i64, argv: *i64) -> i64 |