code wiki / (root) / nx_srcreach.nx

nx_srcreach.nx

buildroot/runtime/nx_srcreach.nx

19528 B369 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_srcreg_lib.nx nx_tool_run.nx nx_srcreach.nx

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

main src_w sys_write sr_slen sr_span_eq sr_slen ↻ sr_slen ↻ sr_atoi_span sr_is_digit 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 ↻ sr_load sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close src_wn sys_mmap ↻ src_w ↻ sr_count_rows sr_line_end sr_line_starts sr_classify sys_mmap ↻

structs

none

consts

35const SRC_STDOUT: i64 = 1
36const SRC_NUM_CAP: i64 = 24
37const SRC_ARG_VERB: i64 = 1
38const SRC_ARG_CONF: i64 = 2
39const SRC_ARG_REQS: i64 = 3
40const SRC_ARG_CEIL: i64 = 4
41const SRC_ARG_MAXPROBE: i64 = 5
42const SRC_DASH: i64 = 45
44const SRC_B_REQUESTS: i64 = 0
45const SRC_B_LONGEST_MS: i64 = 1
46const SRC_B_TOTAL_MS: i64 = 2
47const SRC_B_N: i64 = 3
110const SRP_REACHABLE: i64 = 0
111const SRP_RATELIMITED: i64 = 1
112const SRP_AUTH: i64 = 2
113const SRP_NOTFOUND: i64 = 3
114const SRP_OTHER: i64 = 4
115const SRP_TRANSPORT: i64 = 5
116const SRP_UNPROBED: i64 = 6
117const SRP_N: i64 = 7
118const SRP_FETCHER: *u8 = "nx_research_fetch.elf"
119const SRP_PROBE_NAME: *u8 = "srcreach_probe.tmp"
120const SRP_CAP: i64 = 65536
121const SRP_URLCAP: i64 = 1024
122const SRP_TIMEOUT_MS: i64 = 45000
123const SRP_ARGV_SLOTS: i64 = 32

functions

49func src_w(s: *u8) -> i64
called by 3: src_wnsr_probemain calls 2: sys_writesr_slen
52func src_wn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsrc_w
65func src_wspan(buf: *u8, off: i64, len: i64) -> i64
called by 2: sr_probemain calls 1: sys_write
77func sr_pace(st: *i64, pace: *i64, nrows: i64, reqs_per_source: i64, out: *i64) -> i64
called by 1: main
125func srp_name(s: i64) -> *u8
called by 1: sr_probe
138func srp_remedy(s: i64) -> *u8
called by 1: sr_probe
149func sr_copy_span(buf: *u8, off: i64, len: i64, dst: *u8, cap: i64) -> i64
called by 1: sr_probe
161func sr_probe_classify(out: *u8, n: i64) -> i64
called by 1: sr_probe calls 1: tr_contains
173func sr_probe(buf: *u8, n: i64, off: *i64, st: *i64, pace: *i64, rows: i64, limit: i64, pst: *i64, pc: *i64) -> i64
224func srp_partition_sum(pc: *i64) -> i64
called by 1: main
231func main(argc: i64, argv: *i64) -> i64