code wiki / (root) / nx_compare_regen.nx

nx_compare_regen.nx

buildroot/runtime/nx_compare_regen.nx

12056 B170 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic compare
docsdependenciesstructsconstsfunctions

about

nx_compare_regen.nx -- ON-NAS regeneration of the whole Nishi Compare publish surface (operator 2026-07-09: "no frozen snapshots"). Re-MEASURES every matrix domain against the synced source tree (buildroot/runtime), GATE-CHECKED: for each artifact the generator's liar-kill gate must exit 0 FIRST -- a RED measurement is NEVER published (fail-closed). Then emits json+html per domain + the hub index json/html + the in-code OpenAPI, and hot-swaps each into the LIVE docroot via write-.new + sys_renameat (atomic; a concurrent reader never tears). Because nx_compare_serve reads the SAME docroot files, MCP tools/call and public REST update together, single source. argv: [1]=buildroot dir (default "buildroot"), [2]=docroot prefix (default "../sites/nishifamily/compare/", i.e. the live docroot relative to buildroot). The MCP allowlist row PINS these args (caller argv ignored) so a tools/call caller cannot redirect writes. Targets must already exist (this regenerates, never scaffolds). license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_tool_run.nx nx_compare_regen.nx

imports: nx_tool_run.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main w sys_chdir sys_mmap rg_read sys_read scopy rg_run tr_run_capture sys_mmap ↻ sys_pipe2 sys_fork sys_close sys_dup3 sys_execve_clean sys_close ↻ sys_execve sys_exit sys_read ↻ sys_wait4 wait_exit_code rg_scaffold scopy ↻ sys_mkdir rg_emit rg_run ↻ w ↻ rg_write_atomic scopy ↻ sys_openat_wr sys_renameat wn w ↻ sys_mkdir ↻ wn ↻

structs

none

consts

12const K_MAGIC_1048576: i64 = 1048576
13const K_MAGIC_4096: i64 = 4096
14const K_MAGIC_2000: i64 = 2000

functions

16func 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 }
called by 3: wnrg_emitmain
17func wn(fd: i64, v: i64) -> i64
called by 2: rg_emitmain calls 1: w
23func 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 }
24func rg_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 1: sys_read
31func rg_write_atomic(path: *u8, buf: *u8, n: i64) -> i64
45func rg_scaffold(droot: *u8, dom: *u8) -> i64
called by 1: main calls 2: scopysys_mkdir
52func rg_run(elf: *u8, a1: *u8, a2: *u8, out: *u8, cap: i64, outlen: *i64) -> i64
called by 2: rg_emitmain calls 1: tr_run_capture
62func rg_emit(elf: *u8, a1: *u8, mode: *u8, firstbyte: i64, minbytes: i64, target: *u8, out: *u8, cap: i64) -> i64
called by 1: main calls 4: rg_runwrg_write_atomicwn
73func main(argc: i64, argv: *i64) -> i64