nx_srcreach.nx
buildroot/runtime/nx_srcreach.nx
about
nx_srcreach.nx -- THE SOURCE REGISTRY READER AND THE PACE BUDGET, for /compare/researchreach rungs RR1 and RR3.
Operator 2026-09-06: "we need to measure and make sure we never have any unreachable data whether by search or api
we need to be able to gather it all" and "a regular cadence for all domains without smashing our nas resources".
nx_srcreach load <conf> -- read and classify the registry, print the partition
nx_srcreach plan <conf> <reqs_per_source> <max_requests> -- ALSO print the request budget, and REFUSE over the ceiling
WHY plan PRINTS BEFORE IT WOULD FETCH: a sweep that cannot state its own request count is a load incident waiting to
happen. The budget is computed and announced with NO network touched, so the decision to go wide is made on an
arithmetic a person can check rather than discovered from the array afterwards.
RR2 LANDED 2026-09-06 AND THE PROBE IS REAL. An earlier draft of this header explained why the probe entry point was
deliberately absent; that note is retired because the capability now exists rather than the name. It COMPOSES the
estate's fetcher over sovereign TLS instead of re-implementing a client, probes into ONE fixed scratch name so a
forty-source sweep leaves one file rather than forty mirrors, paces per host, and reports a partition over EVERY row.
A HISTORICAL NOTE WORTH KEEPING: while that paragraph existed, nx_domain_admit reported rule-disagree wordboundary=1
declared=0 against this very file -- the naive scan found the symbol inside the comment explaining its absence, which
is the estate's own prose-is-source-bytes trap firing on the organ that documents it.
BITE-PROVEN LOCALLY 2026-09-06 on a fixture assembled at runtime with FOUR planted defects: each fired, each was
NAMED by its key, and the partition summed (rows=6 ok=2 bad_fields=1 bad_kind=1 bad_proto=1 bad_pace=1 sum=6,
verdict=REFUSED exit=1). The POSITIVE CONTROL is the one that matters most: a clean three-row registry read
rows=3 ok=3 sum=3 verdict=OK exit=0, so this is not a guard that refuses everything and passes every absence test.
The budget was proven in both directions too: 3 sources x 10 requests = 30 planned, ceiling 100 -> OK exit 0,
ceiling 20 -> REFUSED-OVER-CEILING exit 1 with nothing fetched.
exit: 0 OK | 1 REFUSED (a bad row, a partition that does not reconcile, or a budget over the ceiling) | 2 usage |
3 NO-REGISTRY (unreadable or no src rows)
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_srcreg_lib.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
| 35 | const SRC_STDOUT: i64 = 1 |
| 36 | const SRC_NUM_CAP: i64 = 24 |
| 37 | const SRC_ARG_VERB: i64 = 1 |
| 38 | const SRC_ARG_CONF: i64 = 2 |
| 39 | const SRC_ARG_REQS: i64 = 3 |
| 40 | const SRC_ARG_CEIL: i64 = 4 |
| 41 | const SRC_ARG_MAXPROBE: i64 = 5 |
| 42 | const SRC_DASH: i64 = 45 |
| 44 | const SRC_B_REQUESTS: i64 = 0 |
| 45 | const SRC_B_LONGEST_MS: i64 = 1 |
| 46 | const SRC_B_TOTAL_MS: i64 = 2 |
| 47 | const SRC_B_N: i64 = 3 |
| 110 | const SRP_REACHABLE: i64 = 0 |
| 111 | const SRP_RATELIMITED: i64 = 1 |
| 112 | const SRP_AUTH: i64 = 2 |
| 113 | const SRP_NOTFOUND: i64 = 3 |
| 114 | const SRP_OTHER: i64 = 4 |
| 115 | const SRP_TRANSPORT: i64 = 5 |
| 116 | const SRP_UNPROBED: i64 = 6 |
| 117 | const SRP_N: i64 = 7 |
| 118 | const SRP_FETCHER: *u8 = "nx_research_fetch.elf" |
| 119 | const SRP_PROBE_NAME: *u8 = "srcreach_probe.tmp" |
| 120 | const SRP_CAP: i64 = 65536 |
| 121 | const SRP_URLCAP: i64 = 1024 |
| 122 | const SRP_TIMEOUT_MS: i64 = 45000 |
| 123 | const SRP_ARGV_SLOTS: i64 = 32 |
functions
| 49 | func src_w(s: *u8) -> i64 |
| 52 | func src_wn(v: i64) -> i64 |
| 65 | func src_wspan(buf: *u8, off: i64, len: i64) -> i64 |
| 77 | func sr_pace(st: *i64, pace: *i64, nrows: i64, reqs_per_source: i64, out: *i64) -> i64 called by 1: main |
| 125 | func srp_name(s: i64) -> *u8 called by 1: sr_probe |
| 138 | func srp_remedy(s: i64) -> *u8 called by 1: sr_probe |
| 149 | func sr_copy_span(buf: *u8, off: i64, len: i64, dst: *u8, cap: i64) -> i64 called by 1: sr_probe |
| 161 | func sr_probe_classify(out: *u8, n: i64) -> i64 |
| 173 | func sr_probe(buf: *u8, n: i64, off: *i64, st: *i64, pace: *i64, rows: i64, limit: i64, pst: *i64, pc: *i64) -> i64 called by 1: main calls 11: sys_mmapsr_line_endsr_fieldsr_copy_spantr_run_capture_tosr_probe_classify+5 |
| 224 | func srp_partition_sum(pc: *i64) -> i64 called by 1: main |
| 231 | func main(argc: i64, argv: *i64) -> i64 |