code wiki / (root) / nx_http_client_gate.nx

nx_http_client_gate.nx

buildroot/runtime/nx_http_client_gate.nx

18979 B286 linesdepth 21pulls 151 transitivereach 0 importersview sourcekind gate/prooftopic http
docsdependenciesstructsconstsfunctions

about

nx_http_client_gate.nx -- THE REQUEST BUILDER EVERY ESTATE FETCH CROSSES HAD NO GATE AT ALL. Measured 2026-09-03 with nx_catalog: nx_http_client_gate and nx_httpclient_gate both ABSENT -- "no source, no binary, nothing promoted". nx_http_client.nx is imported by nx_https_get_complete, which is imported by nx_https_get, which is what nx_research_fetch and every sovereign fetch ride. An unguarded builder on that path is the widest ungated surface in the fetch lane. WHAT IT PROVES. On 2026-09-03 hc_put_hints was added so the request carries the Chrome client hints and fetch-metadata that match the Chrome-JA3 ClientHello we ALREADY pay for (nx_tls13_chrome_session). The measured cause: fab.com (Cloudflare) answers 403 to the UA-alone profile and 200 to the full profile OVER THE SAME TLS STACK. So the risk this gate exists to hold down is NOT "did we add the headers" -- it is the COHERENCE of the identity we present: * a Chrome UA whose version disagrees with its own sec-ch-ua version is a MISMATCH, and a mismatch is the exact signal anti-bot scoring hunts. T5 compares the two NUMBERS and emits both, so the bar is readable from outside instead of living in a tooth name. * HC_UA_BOT must NEVER acquire Chrome hints. An honest crawler identity that ships sec-ch-ua is no longer honest, and that is a promise to site operators, not a preference. T6/T7 are neg-controls. * a caller that declared its OWN User-Agent must not be contradicted (the 2026-08-25 duplicate-header lesson: THE CALLER WINS). T8 is the neg-control for that. NON-VACUITY. T1-T4 alone would pass for an implementation that emitted the header block to EVERY identity -- which is precisely the honesty regression. The three neg-controls are what make the forward teeth mean anything, and they are named neg-control- so nx_gatelaw_gate's L2 census can see them (a control nobody can find is a control nobody maintains). BITE-PROVEN 2026-09-03 (laptop, admission refused the NAS build): removing the hc_put_hints call site takes it 16/16 GREEN exit 0 -> 11/16 RED exit 1 with exactly the 5 forward teeth failing and all three neg-controls still passing (they assert ABSENCE, which the mutant preserves -- correct discrimination, not vacuity). Restore verified byte-identical, sha256 1952206f85deae97667635964936a64fcabfc5328c47b00bd365805694d4c75e. license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_http_client.nx nx_https_fetch_lib.nx nx_http_client_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_http_client.nxnx_https_fetch_lib.nx

imported by: nobody (leaf or entry point)

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

main 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 ↻ gv_plan_new sys_mmap ↻ gv_plan_name_eq gv_head gv_puts sys_write ↻ sys_mmap ↻ hc_set_identity gv_plan_check gv_plan_take gv_plan_name_eq ↻ gv_check gv_puts ↻ hg_has hg_find hg_num_after hg_find ↻ hg_count _gc_slen hf_header_block_valid hf_header_redirect_same_or hg_resolve _gc_slen ↻

structs

none

consts

38const HG_RETIRED_URL_SCRATCH_BYTES: i64=4096
39const HG_ABSENT: i64 = 0 - 1
40const HG_DIGIT_0: i64 = 48
41const HG_DIGIT_9: i64 = 57
42const HG_SCAN_SLACK: i64 = 16

functions

48func hg_find(buf: *u8, n: i64, pat: *u8) -> i64
called by 2: hg_hashg_num_after
65func hg_has(buf: *u8, n: i64, pat: *u8) -> i64
called by 1: main calls 1: hg_find
70func hg_count(buf: *u8, n: i64, pat: *u8) -> i64
called by 1: main
89func hg_num_after(buf: *u8, n: i64, pat: *u8) -> i64
called by 1: main calls 1: hg_find
118func hg_resolve(base: *u8,ref: *u8,want: *u8) -> i64
130func main() -> i64