nx_source_health_probe.nx
buildroot/runtime/nx_source_health_probe.nx
about
nx_source_health_probe.nx -- the BOUNDED PROBE half of /compare/mediaingest R1 (source health pre-flight).
The reusable decision, persistence, skip and no-reprobe logic all live in nx_source_health.nx (sh_preflight),
gate-proven by nx_source_health_gate 12/12 with planted numbers and no network. THIS file is the thin driver
that produces those numbers from a REAL remote host: it composes the shipped Chrome-hello fetch
(nx_https_fetch_follow_chrome -- the one that gets past anti-bot RSTs and follows redirects, giving both the
body and the HTTP status) and the shipped bot-wall classifier (nx_antibot abt_classify), times the round-trip,
and hands the outcome to sh_preflight, which classifies UP / SLOW / DEAD(null-routed) / WALLED and PERSISTS it.
The flagship case -- a null-routed CDN (Coomer, April 2026) -- is a connect that never completes: the fetch
returns no bytes and status 0, so connect_ok=0 and the verdict is DEAD, skipped with its reason, before any
item is queued against it.
USAGE
nx_source_health_probe <url> probe the host, classify, persist, print the verdict row
nx_source_health_probe check <host> read the persisted verdict (the cheap row the queue reads); prints skip=0|1
A url begins with 'h' (http...) so it can never collide with the literal verb `check`.
EXIT CODES (each is the verdict, so a caller can branch on it without parsing):
0 UP 1 SLOW 2 DEAD 3 WALLED 4 UNKNOWN(could not load trust store / usage)
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 6 imports · 0 importers
imports: nx_syscalls.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_https_fetch_follow.nxnx_antibot.nxnx_source_health.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
| 27 | const SHP_CERTDATA: *u8 = "data/mozilla_certdata.txt" |
| 28 | const SHP_CERT_MAXCERTS: i64 = 512 |
| 29 | const SHP_CERT_BUFCAP: i64 = 4194304 // 4 MiB scratch for the CA bundle parse (matches nx_4chan) |
| 30 | const SHP_RESP_CAP: i64 = 1048576 // 1 MiB: a health probe needs the head + a wall body, not a media payload |
| 31 | const SHP_REDIRECTS: i64 = 6 |
| 32 | const SHP_HOST_CAP: i64 = 256 |
| 33 | const SHP_STATUS_SLOT: i64 = 8 |
| 81 | const SHP_HTTP_ERR_FLOOR: i64 = 400 // wall-classify ONLY a hard-block status; a clean or challenged 2xx is reachable = UP |
functions
| 37 | func shp_host_of(url: *u8, out: *u8, cap: i64) -> i64 called by 1: main |
| 71 | func shp_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 86 | func shp_body_start(buf: *u8, n: i64) -> i64 called by 1: main |
| 99 | func main(argc: i64, argv: *i64) -> i64 |
| 193 | func shp_wnum(x: i64) |