nx_fetch_any.nx
buildroot/runtime/nx_fetch_any.nx
about
nx_fetch_any.nx -- EAT THE FETCH DEBT (operator 2026-07-14): the ONE intelligent fetch DISPATCHER the
researcher / census / adversary / critic route through, so they "use and switch and be intelligent about"
the ~200 fetch organs "as we gather information so we dont get errors and return nothing without informing
the user." Rule-15 DRY: this does NOT add a new fetcher -- it COMPOSES the proven primitives into ONE
classify->cascade->always-inform entry point.
THE TWO SILENT FAILURES THIS KILLS (both proven live this session):
* SILENT-EMPTY : a handshake/host failure returned 0 and the researcher banked NOTHING, with no record.
* SILENT-BAD : nx_https_fetch_follow_best returns a Cloudflare 403 CHALLENGE PAGE with n>0, and the old
rf_fetch_bank banked that challenge HTML as if it were real research (garbage in the corpus).
THE CONTRACT (what "informing the user" means mechanically):
nx_fetch_any ALWAYS writes a human-readable per-strategy attempts log into `att` (never left empty), and
returns the byte count of a VERIFIED-REAL page (2xx, non-challenge, >= FA_MIN_BYTES) or 0. On 0 the caller
MUST surface `att` (rf_fetch_bank banks it as <name>.fail) -- absence becomes DATA, never silence.
THE CASCADE (each rung a real, existing, gated primitive):
S1 nx_https_fetch_follow_best -- sovereign TLS-1.3 (2 hellos) -> TLS-1.2, redirects, cookie-jar+age-gate
S2 nx_https_get_spoof -- real Firefox UA + browser Accept (+ cf_clearance cookie when supplied);
beats UA-gating and Cloudflare walls the raw sovereign JA3 does not.
(v2 rungs, wired next: nx_http_fetch plaintext:80 for HTTP-only hosts; nx_browser_fetch meta-refresh/JS.)
100% sovereign (own TLS, nx_cc->nxasm, no curl/wget/gcc). license_tier: ORIGINAL
dependencies 6 imports · 4 importers
imports: nx_syscalls.nxnx_csprng.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_https_fetch_follow.nxnx_https_get_spoof.nx
imported by: nx_fetch_any_gate.nxnx_nist_ingest.nxnx_nvd_ingest.nxnx_research_engine.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 30 | const FA_MAGIC_4194304: i64 = 4194304 |
| 31 | const FA_MAGIC_8388608: i64 = 8388608 |
| 32 | const FA_MAGIC_8192: i64 = 8192 |
| 35 | const FA_MIN_BYTES: i64 = 256 |
functions
| 37 | func fa_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 38 | func fa_putn(v: i64) -> i64 |
| 47 | func fa_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: fa_has |
| 50 | func fa_find(hay: *u8, hl: i64, needle: *u8, nl: i64) -> i64 |
| 62 | func fa_has(hay: *u8, hl: i64, lit: *u8) -> i64 |
| 68 | func fa_status(buf: *u8, n: i64) -> i64 |
| 82 | func fa_challenge(buf: *u8, n: i64) -> i64 |
| 94 | func fa_is_real(status: i64, buf: *u8, n: i64) -> i64 |
| 103 | func fa_body_off(buf: *u8, n: i64) -> i64 |
| 111 | func fa_to_body(buf: *u8, n: i64) -> i64 |
| 120 | func fa_log(att: *u8, off: i64, cap: i64, s: *u8) -> i64 called by 1: nx_fetch_any |
| 126 | func fa_logn(att: *u8, off: i64, cap: i64, v: i64) -> i64 |
| 141 | func nx_fetch_any(url: *u8, store: *TrustStore, out: *u8, out_cap: i64, max_hops: i64, out_status: *i64, called by 3: mainmainrf_fetch_bank calls 9: fa_logfa_lognfa_is_realfa_challengesys_mmapnx_csprng_fill+3 |
| 185 | func main(argc: i64, argv: *i64) -> i64 |