code wiki / _hdl_build / nx_proxy_route_gate.nx

nx_proxy_route_gate.nx

buildroot/runtime/_hdl_build/nx_proxy_route_gate.nx

19579 B306 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_proxy_route_gate.nx -- sovereign gate for the data-driven proxy route table (nx_proxy_route.nx). Proves the boundary guard (/gen != /generated), longest-prefix wins, exact-host beats '*', wildcard fallback, mode parsing, and that unknown host/path return MISS (0). 2026-08-21 (/compare/trafficsafety ITEM 1) -- THE FAIL-CLOSED MODE PARSE. pr_mode used to return the PERMISSIVE mode for any token it did not recognise, so a mistyped `gated` downgraded a fail-closed route with no diagnostic. Two families of tooth are required and NEITHER alone is evidence: * NEG-CONTROLS -- an unrecognised token must resolve to PR_MODE_GATED, never PR_MODE_BUFFERED. * POSITIVE CONTROLS -- every documented word, AND the legal omitted token, must still resolve to itself. A GUARD THAT REFUSES EVERYTHING PASSES EVERY NEGATIVE TEST, so the positive half is what makes the negative half mean anything. The R-teeth below are the UNCHANGED originals and are load-bearing for a second reason: the row tokenizer was extracted out of pr_lookup into pr_row_toks so the matcher and the validator share ONE walker, and those teeth are the equivalence proof that the extraction changed no behaviour. expect_exit: 0 license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_gate_emit_lib.nx nx_proxy_route.nx nx_gate_verdict.nx nx_proxy_route_gate.nx

imports: nx_syscalls.nxnx_gate_emit_lib.nxnx_proxy_route.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_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_head gv_puts sys_write ↻ g_len sys_mmap ↻ pr_lookup sys_mmap ↻ pr_lookup_tmo sys_mmap ↻ pr_row_toks pr_ieq pr_lower pr_path_pref pr_parse_u pr_mode pr_word pr_strlen pr_parse_tmo pr_tmo_known pr_tmo_prefixed pr_lower ↻ pr_parse_u ↻ gq

structs

none

consts

22const PG_NUM_SCRATCH: i64 = 24
23const PG_ASCII_ZERO: i64 = 48
24const PG_B10: i64 = 10
25const PG_FIX_BYTES: i64 = 512
26const PG_LINES_CAP: i64 = 8
27const PG_LINES_BYTES: i64 = 64
28const PG_BOX_BYTES: i64 = 8
30const PG_FIX_PORT_SEARCH: i64 = 18456
31const PG_FIX_TMO_SEARCH: i64 = 45
32const PG_FIX_TMO_API: i64 = 30
33const PG_FIX_TMO_BAD_ROWS: i64 = 2
34const PG_FIX_TMO_ROWS: i64 = 3
35const PG_FIX_LINE_ONE: i64 = 1
36const PG_FIX_LINE_TWO: i64 = 2
40const PG_MARK_TAB: i64 = 124
41const PG_MARK_CR: i64 = 126
42const PG_BYTE_TAB: i64 = 9
43const PG_BYTE_CR: i64 = 13
46const PG_TOK_OMITTED: i64 = 0
49const PG_VOCAB_SPELLINGS: i64 = 4
50const PG_BAD_ROWS: i64 = 5
51const PG_BAD_OFFENDERS: i64 = 2
52const PG_BAD_LINE_A: i64 = 3
53const PG_BAD_LINE_B: i64 = 6
54const PG_CLEAN_ROWS: i64 = 4
55const PG_CAP_ONE: i64 = 1
56const PG_FIX_PORT_A: i64 = 9001
59const PG_FIX_PORT_GALLERY: i64 = 18190
60const PG_FIX_PORT_GEN: i64 = 18794
61const PG_FIX_PORT_TORRENT: i64 = 18793
62const PG_FIX_PORT_API: i64 = 9000
63const PG_FIX_PORT_APIV2: i64 = 9002
64const PG_FIX_PORT_WILD: i64 = 8000
65const PG_FIX_PORT_EXACT: i64 = 8001
66const PG_FIX_PORT_TAB: i64 = 9100
67const PG_FIX_PORT_CRLF: i64 = 9101

functions

69func g_putn(v: i64) -> i64
called by 2: gqmain calls 2: sys_writesys_mmap
80func g_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
86func gq(label: *u8, got: i64, want: i64, ctr: *i64) -> i64
called by 1: main calls 3: gv_checkg_putsg_putn
99func g_fixbytes(src: *u8, dst: *u8) -> i64
called by 1: main
111func main() -> i64