nx_shard_validator.nx
buildroot/runtime/nx_shard_validator.nx
about
nx_shard_validator.nx -- per-decl structural validator.
Reads a JSONL shard (one decl per line) and verifies EVERY row:
1. row starts with '{' and ends with '}'
2. row contains "source":"<kind>" field
3. row contains "kind":<int> field
4. row contains "name":"<ident>" field
5. name is non-empty, ASCII, no control chars / whitespace inside
6. kind is in {1, 2}
Emits per-violation FAIL line + aggregate counters. Exits non-zero
if ANY row fails. This is the actual "per-decl smoke" the previous
scale-only smoke conflated -- per honest-hard-verdict cardinal.
genealogy_id: substrate_per_decl_validator_2026_05_14
lineage_id: honest_per_decl_smoke
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_runtime.nxnx_tier.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
| 27 | const K_MAGIC_1000000: i64 = 1000000 |
functions
| 31 | func nx_sv_find(buf: *u8, p: nx_int, end: nx_int, pat: *u8, pat_len: nx_int) -> nx_int |
| 48 | func nx_sv_validate_row(buf: *u8, lo: nx_int, hi: nx_int) -> nx_int |
| 96 | func main() -> nx_exit |