nx_execsurface_gate.nx
buildroot/runtime/nx_execsurface_gate.nx
about
nx_execsurface_gate.nx -- referee for nx_execsurface (2026-08-23, compare CE2).
END-TO-END: forks the DEPLOYED ./nx_execsurface.elf into a /tmp/<gate>/ fixture path (never the production
artifact), reads the rows back the way the shared classifier does, and checks BOTH directions of the
surface rule: a program the clock demonstrably runs is credited, a program only MENTIONED is not.
T1 precondition the organ did not exit 3 UNOBSERVABLE (gv_need -> SKIP, never RED)
T2 exit 0 and the receipt names the artifact
T3 the last line is the canonical stamp (# asof=...) with a non-zero asof
T4 partition on_surface + ref_only + dark == organs (a partition is a claim)
T5 full population: counted rows == organs declared, and == an INDEPENDENT count of *.elf at . and _offc/
T6 positive control: a program the live clocksched- plane names (read here, FULL prefix, never bare)
has clock=1 and first_surface=clock
T7 neg-control: a fabricated name has no row
T8 anti-vacuity of the 2-hop rule: at least one row is credited fork:<caller> AND that caller's own row is
on a surface; at least one row is ref:<caller> AND that caller's own row is NOT on a surface
(both directions present in the real population, so the rule demonstrably discriminates)
T9 every clock-credited row's name really appears in the plane (no credit without a plane token)
T10 plan expansion (2026-09-17): the first live clock row that runs nx_plan_run.elf <id> names a plan whose
first tool has a census row on a surface (first_surface plan, or a direct surface); the pre-change census
is the planted known-bad: it reads that tool REGISTERED-DARK and this tooth goes RED against it
T11 a "../<x>.elf literal credits a fork (the regen-forked gapmap)
T12 EVERY ROSTER CONF (2026-09-18): every gate row of every conf a live clock row runs through nx_gate_roster_run beat,
whatever journal that beat writes, that has a census row reads roster=1. The confs and rows are re-derived HERE by an
independent reading (the runner's grammar written again, never the organ's lib), so the organ cannot vouch for itself.
T13 the other rosters: the same over the confs OTHER than the runner's default (the heavy and the slow rosters). The
pre-change census is the planted known-bad: it read one conf by name, so those gates read roster=0 and T13 goes RED.
T14/T15 two methods, one answer: the organ's receipt counts the same beats, and the same beats writing ANOTHER journal
(credited too: the close ruler reads each of them from its own journal), as the gate's own reading of the plane.
license_tier: ORIGINAL expect_exit: 0 GREEN | 1 RED | 3 SKIP
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_tool_run.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
| 33 | const EG_CAP: i64 = 65536 |
| 34 | const EG_PLANE_CAP: i64 = 1048576 |
| 35 | const EG_FIX_DIR: *u8 = "/tmp/nx_execsurface_gate" |
| 36 | const EG_FIX_OUT: *u8 = "/tmp/nx_execsurface_gate/execsurface.tsv" |
| 37 | const EG_RC_UNOBSERVABLE: i64 = 3 |
| 38 | const EG_DIRBUF: i64 = 131072 |
| 157 | const EG_ROSTER_DEFAULT: *u8 = "knowledge/gateroster.conf" // what the runner's beat reads when it names no conf |
| 158 | const EG_ROSTER_JRNL: *u8 = "knowledge/status/gateroster.jrnl" // the production journal: what the beat writes when it names none |
| 159 | const EG_NOT_A_BEAT: i64 = 0 - 1 |
| 160 | const EG_BEAT_ELF: *u8 = "nx_gate_roster_run.elf beat" |
| 161 | const EG_BEAT_BARE: *u8 = "nx_gate_roster_run beat" |
functions
| 40 | func eg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 41 | func eg_starts(s: *u8, p: *u8) -> i64 { var i: i64 = 0; while p[i] != (0 as u8) { if s[i] != p[i] { return 0 } i = i + 1 } return 1 } |
| 42 | func eg_ends(s: *u8, sfx: *u8) -> i64 |
| 50 | func eg_digits(b: *u8, i: i64) -> i64 called by 1: eg_kv |
| 62 | func eg_kv(line: *u8, key: *u8) -> i64 |
| 72 | func eg_row(b: *u8, n: i64, name: *u8) -> i64 |
| 89 | func eg_field(b: *u8, n: i64, r: i64, f: i64, out: *u8, cap: i64) -> i64 |
| 104 | func eg_on_surface(b: *u8, n: i64, r: i64) -> i64 |
| 121 | func eg_find_in(b: *u8, s: i64, e: i64, lit: *u8) -> i64 |
| 133 | func eg_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; var p: i64 = o; while s[i] != (0 as u8) { d[p] = s[i]; p = p + 1; i = i + 1 } d[p] = 0 as u8; return p } called by 1: main |
| 134 | func eg_count_elfs(dir: *u8) -> i64 |
| 163 | func eg_isid(c: i64) -> i64 called by 1: eg_roster_check |
| 173 | func eg_sep(c: i64) -> i64 { if c == 32 { return 1 } if c == 9 { return 1 } if c == 13 { return 1 } return 0 } called by 1: eg_beat_conf |
| 177 | func eg_beat_conf(p: *u8, s: i64, e: i64, co: *i64) -> i64 |
| 202 | func eg_seen(seen: *u8, sn: i64, path: *u8) -> i64 |
| 215 | func eg_roster_check(b: *u8, datalen: i64, conf: *u8, cnt: *i64) -> i64 |
| 253 | func main(argc: i64, argv: *i64) -> i64 |