code wiki / _hdl_build / nx_api_contract.nx

nx_api_contract.nx

buildroot/runtime/_hdl_build/nx_api_contract.nx

11974 B230 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic api
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_api_contract.nx

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

main ac_starts ac_vlen ac_do_probe sys_mmap ac_run_capture sys_fork sys_openat_wr sys_dup3 sys_mmap ↻ sys_execve sys_exit sys_wait4 sys_write sys_exit ↻ ac_read sys_openat_rd sys_read sys_close ac_cat ac_le ac_col ac_contains_token ac_vlen ↻ ac_is_word ac_cat_esc ac_catn sys_mmap ↻ ac_write_log sys_openat_wr ↻ sys_write ↻ sys_close ↻ ac_werr sys_write ↻ sys_exit ↻ sys_mmap ↻ ac_read ↻ ac_cat ↻ ac_le ↻ ac_col ↻

structs

none

consts

11const AC_MAGIC_4096: i64 = 4096
13const AC_CAP: i64 = 262144
14const AC_TAB: i64 = 9
15const AC_NL: i64 = 10
16const AC_HASH: i64 = 35
17const AC_STDERR: i64 = 2
18const AC_SPAN: i64 = 16
19const AC_EXIT_USAGE: i64 = 2

functions

21func 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 }
called by 1: main calls 1: sys_write
22func ac_vlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
23func 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 }
called by 2: ac_do_probemain
24func 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 }
called by 2: ac_do_probemain calls 1: sys_mmap
25func 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 }
called by 2: ac_do_probemain
26func ac_read(path: *u8, buf: *u8, cap: i64) -> i64
35func 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
36func 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 }
called by 2: ac_do_probemain
37func ac_col(q: *u8, ls: i64, le: i64, c: i64, out: *i64) -> i64
called by 2: ac_do_probemain
53func 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
57func ac_contains_token(hay: *u8, hn: i64, needle: *u8) -> i64
called by 1: ac_do_probe calls 2: ac_vlenac_is_word
76func ac_run_capture(elf: *u8, a1: *u8, a2: *u8, outfile: *u8) -> i64
92func ac_write_log(path: *u8, s: *u8, n: i64) -> i64
103func ac_do_probe(mpath: *u8, vpath: *u8) -> i64
173func main(argc: i64, argv: *i64) -> i64