code wiki / _hdl_build / nx_prim_gap.nx
nx_prim_gap.nx
buildroot/runtime/_hdl_build/nx_prim_gap.nx
about
nx_prim_gap.nx -- prim lane F783 (the meet-in-the-middle COLLISION: missing-primitive detector).
Takes required-capability tokens as argv (intent->capabilities decomposition is the AGENT-SEAT's
judgment -- an LLM/operator over MCP, per sovereign doctrine, NOT baked into a no-float organ). For each
required capability it searches the F781 registry (prim_registry.json) and, if 0 primitives match, raises
a MISSING-PRIMITIVE EXCEPTION with a structural spec -- the operator's 'architectural alarm'. Matching is
over each primitive's VALUE fields (id + domain + capabilities + title + output + signature values), NEVER
the JSON key names -- so a query that is a substring of a key (sign<-signature) cannot false-HAVE and hide
a real gap. READ-ONLY; result to stdout + atomic out-file. Filing the gaps is the caller's deliberate act.
nx_prim_gap <req-capability> [<req> ...]
exit: 0 all-satisfied | 3 GAPS-FOUND (>=1 missing = the alarm) | 4 registry unreadable | 2 usage.
license_tier: ORIGINAL expect_exit: 0
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 13 | const K_MAGIC_2048: i64 = 2048 |
| 14 | const K_MAGIC_262100: i64 = 262100 |
| 15 | const K_MAGIC_4090: i64 = 4090 |
| 16 | const K_MAGIC_1048576: i64 = 1048576 |
| 17 | const K_MAGIC_4096: i64 = 4096 |
functions
| 19 | func pg_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 20 | func pg_b(rep: *u8, pos: i64, s: *u8) -> i64 { var p: i64 = pos; var i: i64 = 0; while s[i] != (0 as u8) { if p < K_MAGIC_262100 { rep[p] = s[i]; p = p + 1 } i = i + 1 } return p } called by 1: main |
| 21 | func pg_bn(rep: *u8, pos: i64, v: i64) -> i64 { var p: i64 = pos; var m: i64 = v; if m < 0 { if p < K_MAGIC_262100 { rep[p] = 45 as u8; p = p + 1 } m = 0 - m } let t: *u8 = sys_mmap(28); var k: i64 = 0; if m == 0 { t[0] = 48 as u8; k = 1 } while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } var i: i64 = 0; while i < k { if p < K_MAGIC_262100 { rep[p] = t[k - 1 - i]; p = p + 1 } i = i + 1 } return p } |
| 22 | func pg_q(rep: *u8, pos: i64) -> i64 { var p: i64 = pos; if p < K_MAGIC_262100 { rep[p] = 34 as u8; p = p + 1 } return p } called by 1: main |
| 23 | func pg_je(rep: *u8, pos: i64, src: *u8, s: i64, e: i64) -> i64 called by 1: main |
| 36 | func pg_reads(path: *u8, buf: *u8, cap: i64) -> i64 |
| 45 | func pg_has(buf: *u8, s: i64, e: i64, pat: *u8, pl: i64) -> i64 called by 1: main |
| 57 | func pg_off(buf: *u8, s: i64, e: i64, pat: *u8, pl: i64) -> i64 |
| 69 | func pg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: main |
| 70 | func pg_id(buf: *u8, ostart: i64, ce: i64, out: *u8) -> i64 called by 1: main |
| 78 | func pg_appendval(hs: *u8, hp: i64, buf: *u8, os: i64, ce: i64, key: *u8, klen: i64) -> i64 |
| 107 | func main(argc: i64, argv: *i64) -> i64 |