code wiki / _hdl_build / nx_api_contract.nx
nx_api_contract.nx
buildroot/runtime/_hdl_build/nx_api_contract.nx
about
nx_api_contract.nx -- API-CONTRACT REGRESSION GUARD (operator: "build the capabilities to prevent things
like this" -- a sibling mgmt-API redeploy silently DROPPED /api/promote 404, breaking organ deploys for
EVERY session; enforces CLAUDE rule-19 API contract stability). Data-driven: a canonical manifest of
critical routes (knowledge/registry/api_critical_routes.tsv) is the CONTRACT; the cron probe
(nx_api_contract_probe.sh, via sovereign nx_https_get) writes the live VERDICT to knowledge/status/
api_contract.log. THIS organ is the agent/MCP surface: it reports the contract + the last supervised
verdict so a session can check contract integrity BEFORE trusting a deploy.
nx_api_contract check [manifest] [verdictlog] (JSON: routes + last verdict + status)
license_tier: ORIGINAL No hw writes (Rule 26). 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
| 11 | const AC_MAGIC_4096: i64 = 4096 |
| 13 | const AC_CAP: i64 = 262144 |
| 14 | const AC_TAB: i64 = 9 |
| 15 | const AC_NL: i64 = 10 |
| 16 | const AC_HASH: i64 = 35 |
| 17 | const AC_STDERR: i64 = 2 |
| 18 | const AC_SPAN: i64 = 16 |
| 19 | const AC_EXIT_USAGE: i64 = 2 |
functions
| 21 | func ac_werr(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(AC_STDERR, s, n); return 0 } |
| 22 | func ac_vlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 23 | func ac_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { d[o] = s[i]; o = o + 1; i = i + 1 } return o } |
| 24 | func ac_catn(d: *u8, o: i64, v: i64) -> i64 { let t: *u8 = sys_mmap(28); var m: i64 = v; if m < 0 { m = 0 } 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 { d[o] = t[k-1-i]; o = o + 1; i = i + 1 } return o } |
| 25 | func ac_cat_esc(d: *u8, o: i64, q: *u8, s: i64, e: i64) -> i64 { var i: i64 = s; while i < e { var c: i64 = q[i] as i64; if c == 34 { c = 39 } if c == 92 { c = 47 } if c < 32 { c = 32 } d[o] = c as u8; o = o + 1; i = i + 1 } return o } |
| 26 | func ac_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 35 | func ac_starts(buf: *u8, n: i64, lit: *u8) -> i64 { var i: i64 = 0; while lit[i] != (0 as u8) { if i >= n { return 0 } if buf[i] != lit[i] { return 0 } i = i + 1 } return 1 } called by 1: main |
| 36 | func ac_le(q: *u8, i: i64, n: i64) -> i64 { var e: i64 = i; var s: i64 = 1; while s == 1 { if e >= n { s = 0 } else { if q[e] == (AC_NL as u8) { s = 0 } else { e = e + 1 } } } return e } |
| 37 | func ac_col(q: *u8, ls: i64, le: i64, c: i64, out: *i64) -> i64 |
| 53 | func ac_is_word(c: i64) -> i64 { if c >= 97 { if c <= 122 { return 1 } } if c == 95 { return 1 } return 0 } called by 1: ac_contains_token |
| 57 | func ac_contains_token(hay: *u8, hn: i64, needle: *u8) -> i64 |
| 76 | func ac_run_capture(elf: *u8, a1: *u8, a2: *u8, outfile: *u8) -> i64 |
| 92 | func ac_write_log(path: *u8, s: *u8, n: i64) -> i64 |
| 103 | func ac_do_probe(mpath: *u8, vpath: *u8) -> i64 |
| 173 | func main(argc: i64, argv: *i64) -> i64 |