nx_compare_serve.nx
buildroot/runtime/nx_compare_serve.nx
about
nx_compare_serve.nx -- fork-exec backend for the `nishi_compare` MCP tool. v2 SINGLE-SOURCE: serves the EXACT
file the public REST endpoint serves (sites/nishifamily/compare/... relative to the tools-API CWD = nishihost)
-- there is NO second copy to drift (operator 2026-07-09: no frozen snapshots). Domain map: "index" -> the
comparison index api.json, "openapi" -> the OpenAPI 3.1 contract, else -> <domain>/api.json. No re-measurement
here (measurement happens in nx_compare_regen against the buildroot source tree, gate-checked); this serves the
latest gate-GREEN generation. SECURITY: the caller-supplied domain is sanitized to [a-z]{1,40} ONLY -> no path
traversal / injection. Absent file -> structured JSON error envelope. 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
| 9 | const K_MAGIC_1048576: i64 = 1048576 |
functions
| 11 | func 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 } |
| 12 | func wc(fd: i64, code: i64) -> i64 { let t: *u8 = sys_mmap(2); t[0] = code as u8; sys_write(fd, t, 1); return 0 } |
| 13 | func scopy(dst: *u8, doff: i64, src: *u8) -> i64 { var i: i64 = 0; while src[i] != (0 as u8) { dst[doff+i] = src[i]; i = i + 1 } return doff + i } called by 1: main |
| 14 | func streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] != (0 as u8) { if a[i] != b[i] { return 0 } i = i + 1 } if b[i] != (0 as u8) { return 0 } return 1 } called by 1: main |
| 15 | func san_ok(s: *u8) -> i64 called by 1: main |
| 21 | func err_json(code: *u8, dom: *u8) -> i64 |
| 29 | func main(argc: i64, argv: *i64) -> i64 |