code wiki / _hdl_build / nx_gateorder_lib.nx
nx_gateorder_lib.nx
buildroot/runtime/_hdl_build/nx_gateorder_lib.nx
about
nx_gateorder_lib.nx -- pure classifier for GATE VERDICT-EMIT INTEGRITY.
WHY (found 2026-07-31 in my OWN gate, then swept): a gate that writes its verdict BEFORE its last
tooth runs is a FALSE-GREEN GENERATOR. ctr is read early, so a FAILING late tooth is still recorded
GREEN -- and the rollup / honesty gate / evidence audit read the LOG, not stdout, so the regression is
invisible to every ruler while the gate screams RED to a terminal nobody watches. It is the inverse of
"a guard placed after the act it guards": A RECORD WRITTEN BEFORE THE WORK IT RECORDS.
The sweep that found this was a shell script in /tmp. A finding that is not wired into a standing
instrument decays -- which is this session's own repeated lesson -- so the classifier lives here as a
PURE function over a file buffer, gate-reachable, and the walker is a separate organ.
â CLASSIFY, NEVER ASSUME. UNKNOWN is a first-class verdict: my first detector missed a gate whose tooth
helper was named `ceg_t` and flagged a CLEAN gate as defective. AN AUDIT TOOL WITH AN INCOMPLETE
PATTERN ACCUSES THE INNOCENT, so a file whose teeth cannot be located is reported UNKNOWN, never GUILTY.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 1 imports · 5 importers
imports: nx_syscalls.nx
imported by: nx_capgraph_selfcheck.nxnx_evclass_route.nxnx_gateorder.nxnx_gateorder_gate.nxnx_gateverify.nx
structs
| none |
consts
| 19 | const GO_NOEMIT: i64 = 0 |
| 20 | const GO_EARLY: i64 = 1 |
| 21 | const GO_LATE: i64 = 2 |
| 22 | const GO_UNKNOWN: i64 = 3 |
functions
| 24 | func go_strlen(s: *u8) -> i64 |
| 30 | func go_puts(s: *u8) |
| 34 | func go_puti(x: i64) |
| 60 | func go_kv(k: *u8, x: i64) |
| 67 | func go_match_at(buf: *u8, at: i64, n: i64, pat: *u8) -> i64 |
| 80 | func go_first(buf: *u8, n: i64, pat: *u8) -> i64 |
| 95 | func go_last_tooth(buf: *u8, n: i64) -> i64 calls 1: go_match_at |
| 111 | func go_emit_off(buf: *u8, n: i64) -> i64 |
| 134 | func go_classify(buf: *u8, n: i64) -> i64 |
| 140 | func go_class_name(c: i64) -> *u8 |
| 149 | func go_gate_log(path: *u8, tag: *u8, passed: i64, total: i64) |
| 196 | func go_is_digit(c: i64) -> i64 called by 1: go_last_ratio |
| 202 | func go_last_ratio(buf: *u8, n: i64, out: *i64) -> i64 |
| 253 | func go_kv_num(buf: *u8, n: i64, key: *u8) -> i64 |
| 285 | func go_ends_gate_nx(name: *u8) -> i64 |