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, "measurement" -> the existing
maturity/measurement.json resource, investment -> maturity/investment.json, else -> <domain>/api.json.
Additive command: bindings <domain> returns a public-policy-checked artifact manifest.
No recomputation here: nx_compare_regen, nx_sota_status and nx_tokroi own their respective reports.
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 2 imports · 1 importers
imports: nx_syscalls.nxnx_compare_openapi.nx
imported by: nx_compare_bindings_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 12 | const CS_SIGNED_I64_MAX: i64 = 9223372036854775807 |
functions
| 14 | 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 } |
| 15 | 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 } |
| 16 | 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 } |
| 17 | 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 } |
| 18 | func san_ok(s: *u8) -> i64 |
| 24 | func err_json(code: *u8, dom: *u8) -> i64 |
| 33 | func cs_complete(path: *u8, size: *i64) -> *u8 called by 3: maincs_publiccs_bindings calls 6: sys_openat_rdsys_lseeksys_closesys_mmapcgo_readsys_munmap |
| 48 | func cs_public(domain: *u8) -> i64 |
| 58 | func cs_bindings(argc: i64, argv: *i64) -> i64 |
| 102 | func main(argc: i64, argv: *i64) -> i64 |