code wiki / (root) / nx_fetch_any_gate.nx

nx_fetch_any_gate.nx

buildroot/runtime/nx_fetch_any_gate.nx

6809 B114 linesdepth 23pulls 153 transitivereach 0 importersview sourcekind gate/prooftopic fetch
docsdependenciesstructsconstsfunctions

about

nx_fetch_any_gate.nx -- teeth for the intelligent fetch dispatcher (operator 2026-07-14: researcher/census/ adversary/critic must "not get errors and return nothing without informing the user"). ADVERSARY DISCIPLINE: the classifier is LAW only if it discriminates a REAL page from the exact thing that fools a naive fetcher -- a Cloudflare 200-OK CHALLENGE page. Gates fa_status / fa_challenge / fa_is_real / fa_body_off / fa_to_body. license_tier: ORIGINAL D001 MIGRATION 2026-09-01 (/compare/mediaingest). This gate had no elf, and the reason was not neglect: /api/promote REFUSES a gate that rolls its own verdict, because nothing outside can read its outcome -- nx_gate_green cannot judge it and it records no harness.jrnl frame, so flake and erosion stay invisible. The teeth here were already good (13 of them, with a real adversary case), which is precisely why the refusal was expensive: a well-designed gate that cannot be promoted proves nothing at all. EVERY SUBJECT, ORDER AND ASSERTION IS UNCHANGED. Only the verdict machinery moved onto nx_gate_verdict: gv_ctr/gv_check make declared == executed by construction (the hand-rolled pass/tot incremented both from the same line, so a tooth that stopped running lowered nothing and still read GREEN), and gv_verdict puts the outcome in the exit code where the judge can reach it. The four teeth that assert a REFUSAL are renamed neg-control-* so the L2 census can SEE them -- they always were negative controls, and were invisible purely by naming.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_fetch_any.nx nx_gate_verdict.nx nx_fetch_any_gate.nx

imports: nx_syscalls.nxnx_fetch_any.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_head gv_puts sys_write gv_ctr 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 ↻ g_slen gv_check gv_puts ↻ fa_status nx_http_resp_status_code nx_http_resp_is_digit fa_challenge fa_has fa_find fa_slen fa_is_real fa_challenge ↻ fa_body_off fa_find ↻ sys_mmap ↻ fa_to_body fa_body_off ↻ gv_verdict gv_note_bare_rate gv_bare_rate

structs

none

consts

24const G_B: i64 = 66 // 'B' -- the first byte of BODYSTART, so the body-offset teeth assert a byte we chose
25const G_HTTP_OK: i64 = 200
26const G_HTTP_FORBIDDEN: i64 = 403
27const G_HTTP_ERR: i64 = 500
28const G_TINY_LEN: i64 = 2
29const G_CPCAP: i64 = 4096

functions

22func g_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
31func main() -> i64