code wiki / (root) / nx_source_health_probe.nx

nx_source_health_probe.nx

buildroot/runtime/nx_source_health_probe.nx

8347 B199 linesdepth 21pulls 151 transitivereach 0 importersview sourcekind probetopic source
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_https_fetch_follow.nx nx_antibot.nx nx_source_health.nx nx_source_health_probe.nx

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

main sys_write 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 ↻ shp_streq sys_now_realtime_ms sys_mmap ↻ sys_clock_gettime_real sh_lookup sh_load_tbl sys_mmap ↻ sh_load_tbl_into sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close sh_hash sh_ld sh_should_skip sh_verdict_str shp_host_of nx_trust_store_load_from_c sys_mmap ↻

structs

none

consts

27const SHP_CERTDATA: *u8 = "data/mozilla_certdata.txt"
28const SHP_CERT_MAXCERTS: i64 = 512
29const SHP_CERT_BUFCAP: i64 = 4194304 // 4 MiB scratch for the CA bundle parse (matches nx_4chan)
30const SHP_RESP_CAP: i64 = 1048576 // 1 MiB: a health probe needs the head + a wall body, not a media payload
31const SHP_REDIRECTS: i64 = 6
32const SHP_HOST_CAP: i64 = 256
33const SHP_STATUS_SLOT: i64 = 8
81const SHP_HTTP_ERR_FLOOR: i64 = 400 // wall-classify ONLY a hard-block status; a clean or challenged 2xx is reachable = UP

functions

37func shp_host_of(url: *u8, out: *u8, cap: i64) -> i64
called by 1: main
71func shp_streq(a: *u8, b: *u8) -> i64
called by 1: main
86func shp_body_start(buf: *u8, n: i64) -> i64
called by 1: main
99func main(argc: i64, argv: *i64) -> i64
193func shp_wnum(x: i64)