nx_paced_fetch_gate.nx
buildroot/runtime/nx_paced_fetch_gate.nx
about
nx_paced_fetch_gate.nx -- GATE for nx_paced_fetch (the capture path's ONE pacing hook, /compare/mediaingest R0).
No network: both fixture hosts live under the reserved .invalid TLD and nothing is ever fetched. Every decision
under test is nx_crawl_pace's own arithmetic (its policy has its own gate); this gate proves the HOOK's
composition around it -- host extraction, the wait actually served on the clock, the burst form's discriminator,
the decay, and that a throttle on one host never touches another. The pace table is PERSISTENT and shared with
production, so both fixture hosts are reset at setup and teardown (the same self-isolation nx_crawl_pace_gate
established on 2026-08-02). license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_crawl_pace.nxnx_paced_fetch.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
structs
| none |
consts
| 13 | const G_URL_A: *u8 = "https://pf-fixture-a.invalid/seg/001.ts?tok=1" |
| 14 | const G_URL_B: *u8 = "https://pf-fixture-b.invalid/x" |
| 15 | const G_URL_HOSTPORT: *u8 = "https://cdn.example.invalid:8443/a/b?x=1#f" |
| 16 | const G_URL_TINY: *u8 = "http://h/p" |
| 17 | const G_URL_NOSCHEME: *u8 = "no-scheme-here/path" |
| 18 | const G_HOST_LEN_CDN: i64 = 19 // strlen("cdn.example.invalid") -- the port and path must NOT be part of the host |
| 19 | const G_HOST_LEN_TINY: i64 = 1 |
| 20 | const G_RA_S: i64 = 2 // the planted Retry-After: short enough to sleep through in a gate, long enough that a wait of 0 cannot pass by accident |
| 21 | const G_MS: i64 = 1000 |
| 22 | const G_HTTP_429: i64 = 429 |
| 23 | const G_HTTP_200: i64 = 200 |
| 24 | const G_CLOCK_TOLERANCE_PERMIL: i64 = 900 // the sleep must serve at least 900 permil of the wait it reported (scheduler jitter on a loaded box, never a shortfall by design) |
| 25 | const G_PERMIL: i64 = 1000 |
| 26 | const G_HOST_CAP: i64 = 512 |
| 27 | const G_SLOTS: i64 = 4096 // PACE_SLOTS -- the open-addressed pace table's fixed slot count (nx_crawl_pace) |
| 28 | const G_REC: i64 = 40 // PACE_REC -- one pace record's byte width; hash is its first 8 bytes |
functions
| 30 | func main() -> i64 |