code wiki / _hdl_build / nx_proxy_route_gate.nx
nx_proxy_route_gate.nx
buildroot/runtime/_hdl_build/nx_proxy_route_gate.nx
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
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
structs
| none |
consts
| 22 | const PG_NUM_SCRATCH: i64 = 24 |
| 23 | const PG_ASCII_ZERO: i64 = 48 |
| 24 | const PG_B10: i64 = 10 |
| 25 | const PG_FIX_BYTES: i64 = 512 |
| 26 | const PG_LINES_CAP: i64 = 8 |
| 27 | const PG_LINES_BYTES: i64 = 64 |
| 28 | const PG_BOX_BYTES: i64 = 8 |
| 30 | const PG_FIX_PORT_SEARCH: i64 = 18456 |
| 31 | const PG_FIX_TMO_SEARCH: i64 = 45 |
| 32 | const PG_FIX_TMO_API: i64 = 30 |
| 33 | const PG_FIX_TMO_BAD_ROWS: i64 = 2 |
| 34 | const PG_FIX_TMO_ROWS: i64 = 3 |
| 35 | const PG_FIX_LINE_ONE: i64 = 1 |
| 36 | const PG_FIX_LINE_TWO: i64 = 2 |
| 40 | const PG_MARK_TAB: i64 = 124 |
| 41 | const PG_MARK_CR: i64 = 126 |
| 42 | const PG_BYTE_TAB: i64 = 9 |
| 43 | const PG_BYTE_CR: i64 = 13 |
| 46 | const PG_TOK_OMITTED: i64 = 0 |
| 49 | const PG_VOCAB_SPELLINGS: i64 = 4 |
| 50 | const PG_BAD_ROWS: i64 = 5 |
| 51 | const PG_BAD_OFFENDERS: i64 = 2 |
| 52 | const PG_BAD_LINE_A: i64 = 3 |
| 53 | const PG_BAD_LINE_B: i64 = 6 |
| 54 | const PG_CLEAN_ROWS: i64 = 4 |
| 55 | const PG_CAP_ONE: i64 = 1 |
| 56 | const PG_FIX_PORT_A: i64 = 9001 |
| 59 | const PG_FIX_PORT_GALLERY: i64 = 18190 |
| 60 | const PG_FIX_PORT_GEN: i64 = 18794 |
| 61 | const PG_FIX_PORT_TORRENT: i64 = 18793 |
| 62 | const PG_FIX_PORT_API: i64 = 9000 |
| 63 | const PG_FIX_PORT_APIV2: i64 = 9002 |
| 64 | const PG_FIX_PORT_WILD: i64 = 8000 |
| 65 | const PG_FIX_PORT_EXACT: i64 = 8001 |
| 66 | const PG_FIX_PORT_TAB: i64 = 9100 |
| 67 | const PG_FIX_PORT_CRLF: i64 = 9101 |
functions
| 69 | func g_putn(v: i64) -> i64 |
| 80 | func g_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: main |
| 86 | func gq(label: *u8, got: i64, want: i64, ctr: *i64) -> i64 |
| 99 | func g_fixbytes(src: *u8, dst: *u8) -> i64 called by 1: main |
| 111 | func main() -> i64 |