nx_importcensus_gate.nx
buildroot/runtime/nx_importcensus_gate.nx
about
nx_importcensus_gate.nx -- referee for nx_importcensus (2026-08-23, compare CE2).
END-TO-END: forks the DEPLOYED ./nx_importcensus.elf against the LIVE eco-graph store into a /tmp/<gate>/
fixture path (never the production artifact -- a gate must not share its fixture with a production beat),
then reads the artifact back the way a board does: rows first, the stamped LAST line by position.
Teeth, both directions where a classifier is involved:
T1 precondition the store loads (the organ's own exit 3 -> gv_need -> SKIP, never RED)
T2 exit 0 with a receipt naming the artifact
T3 the last line is the canonical stamp (# asof=...) with a non-zero asof
T4 partition: has_nonval + val_only + orphan == rows (declared) and rows == nodes (a partition is a claim)
T5 positive control: nx_syscalls.nx (the god node every organ imports) has importers > 0 AND importers_nonval > 0
T6 anti-vacuity of the validation filter: gates import nx_gate_verdict.nx, so importers_nonval < importers there
T7 neg-control: a fabricated basename is ABSENT from the rows (no row invents a node)
T8 invariant over EVERY row: importers_nonval <= importers (a count exceeding its superset is a parser defect)
T9 the rows are the FULL population: counted rows == nodes declared (no silent cap)
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
| 20 | const IG_CAP: i64 = 65536 // the organ's receipt is one line; this announces if it ever fills |
| 21 | const IG_FIX_DIR: *u8 = "/tmp/nx_importcensus_gate" |
| 22 | const IG_FIX_OUT: *u8 = "/tmp/nx_importcensus_gate/importers.tsv" |
| 23 | const IG_STORE: *u8 = "knowledge/store/ecograph_full" |
| 24 | const IG_RC_UNOBSERVABLE: i64 = 3 // the organ's declared exit for an unreadable store |
functions
| 26 | func ig_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 27 | func ig_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 } |
| 29 | func ig_digits(b: *u8, i: i64) -> i64 |
| 42 | func ig_kv(line: *u8, key: *u8) -> i64 |
| 52 | func ig_row(b: *u8, n: i64, name: *u8) -> i64 |
| 69 | func ig_field(b: *u8, r: i64, f: i64) -> i64 |
| 80 | func main(argc: i64, argv: *i64) -> i64 |