nx_bright_rewrite_gate.nx
buildroot/runtime/nx_bright_rewrite_gate.nx
about
nx_bright_rewrite_gate.nx -- the referee for nx_bright_rewrite_lib (search R0l, 2026-09-16): the remote engine
door, the idempotent re-run, the per-split lease and the split verdict, driven IN-PROCESS on a /tmp fixture
tree (no model, no network peer: the engine under test is 127.0.0.1:1, a port nothing listens on, so the
ENGINE-DOWN path is reached for real and never a passthrough row is manufactured from it).
Scratch lives in /tmp/nx_bright_rewrite_gate/ (fixture-ratchet law), created at setup, and every fixture file
is truncate-written or unlinked first so the gate is idempotent run after run.
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_bright_rewrite_lib.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
| 11 | const BG_DIR: *u8 = "/tmp/nx_bright_rewrite_gate" as *u8 |
| 12 | const BG_ROOT: *u8 = "/tmp/nx_bright_rewrite_gate/root" as *u8 |
| 13 | const BG_LEASE_ROOT: *u8 = "/tmp/nx_bright_rewrite_gate/lease/" as *u8 |
| 14 | const BG_OUT: *u8 = "gatefix" as *u8 |
| 15 | const BG_MODE_DIR: i64 = 493 |
| 16 | const BG_CAP: i64 = 65536 |
| 17 | const BG_ENGINE_DEAD: *u8 = "127.0.0.1:1" as *u8 |
| 18 | const BG_TTL: i64 = 60 // a crashed gate run frees its own fixture lease within a minute |
| 20 | const BG_ORACLE_TOK_PRED: i64 = 301 |
| 21 | const BG_ORACLE_PRED_MS: i64 = 2210 |
| 22 | const BG_PERMIL_ONE: i64 = 1000 |
| 23 | const BG_PERMIL_ZERO: i64 = 0 |
functions
| 25 | func bg_mkdir(p: *u8) -> i64 { return sys_mkdir(p, BG_MODE_DIR) } called by 1: main |
| 26 | func bg_write(p: *u8, s: *u8) -> i64 |
| 33 | func bg_exists(p: *u8) -> i64 { let fd: i64 = sys_openat_rd(p); if fd < 0 { return 0 } sys_close(fd); return 1 } called by 1: main |
| 34 | func bg_rm(p: *u8) -> i64 { return sys_unlinkat(p) } called by 1: main |
| 36 | func bg_crlf(dst: *u8, o: i64) -> i64 { dst[o] = 13 as u8; dst[o + 1] = 10 as u8; return o + 2 } called by 1: bg_http |
| 37 | func bg_http(dst: *u8, code: i64, body: *u8) -> i64 |
| 46 | func bg_split_path(dst: *u8, split: *u8, tail: *u8) -> i64 { return br_path(dst, BG_ROOT, split, tail) } |
| 48 | func main(argc: i64, argv: *i64) -> i64 |