nx_plane_check.nx
buildroot/runtime/nx_plane_check.nx
about
nx_plane_check.nx -- VERIFY the TSV<->NXR1 bridge against REAL production plane data, READ-ONLY.
WHY THIS EXISTS AND WHY IT COMES BEFORE ANY WRITE: seq1369 shipped the bridge with a gate built on
SYNTHETIC fixtures. Fixtures prove the code does what I thought; they cannot prove real rows survive it.
Before a single production plane is rewritten, every row of that plane must be shown to make the round
trip tsv -> NXR1 -> tsv BYTE-IDENTICAL. This organ does exactly that and WRITES NOTHING.
FAIL-CLOSED, and specifically against the VACUOUS-VERIFY TRAP: an empty or unreadable plane exits 4
rather than reporting "0 mismatches, all good". Zero rows checked is not a pass. This is the same trap
the TSV-retirement law already warns about (rowset-identical AND NON-EMPTY).
COVERAGE IS REPORTED, NOT ASSUMED: it loads via sts_load_honest, whose flags expose that the q:n count
key can be LOWER than the rows actually present (measured on debt-: q:n said 125 while 629 segments held
734+ rows). If rows exist beyond the declared count, this exits 5 -- the rows it checked were fine, but
the plane was not fully SEEN, and a partial check must never be presented as a complete one.
EXIT: 0 all rows byte-identical and plane fully seen · 2 usage · 3 mismatch · 4 empty/unreadable
5 clean so far but coverage incomplete (rows beyond the declared count)
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 2 imports · 0 importers
imports: nx_record_tsv.nxnx_store_seed_lib.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
| 23 | const PC_CAP: i64 = 16777216 // 16MiB. NOT a fix -- a postponement, and deliberately far above the |
| 27 | const PC_RECCAP: i64 = 131072 |
| 28 | const PC_OUTCAP: i64 = 131072 |
| 29 | const PC_MSGCAP: i64 = 4096 |
| 30 | const PC_TYPECAP: i64 = 512 |
| 31 | const PC_FLAGS: i64 = 64 |
| 32 | const PC_NL: i64 = 10 |
| 33 | const PC_CH_I: i64 = 105 // 'i' in a typespec means this column is an integer |
| 34 | const PC_STDOUT: i64 = 1 |
| 35 | const PC_EXIT_USAGE: i64 = 2 |
| 36 | const PC_EXIT_MISMATCH: i64 = 3 |
| 37 | const PC_EXIT_EMPTY: i64 = 4 |
| 38 | const PC_EXIT_COVERAGE: i64 = 5 |
| 39 | const PC_EXIT_TRUNCATED: i64 = 6 |
| 40 | const PC_MAXSHOW: i64 = 5 // per-row detail lines shown before summarising |
functions
| 42 | func pc_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: main |
| 43 | func pc_cat(d: *u8, off: i64, s: *u8) -> i64 called by 1: main |
| 48 | func pc_emit(b: *u8, n: i64) -> i64 { sys_write(PC_STDOUT, b, n); return 0 } called by 1: main |
| 50 | func main(argc: i64, argv: *i64) -> i64 |