code wiki / (root) / nx_compare_beat.nx

nx_compare_beat.nx

buildroot/runtime/nx_compare_beat.nx

13074 B270 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic compare
docsdependenciesstructsconstsfunctions

about

nx_compare_beat.nx -- THE CLOCK BEAT for the whole /compare surface (2026-08-08). WHY THIS EXISTS. /compare had NO beat. The hub sat 2.6 days stale (generated_unix 1786014355 while the domain artifacts regenerated fine) because nx_compare_regen SKIPS the hub whenever buildroot/knowledge/compare/registry is absent -- and that registry is only ever kept at nishihost/knowledge/compare/registry. The skip does NOT increment fails, so the run still printed "verdict=GREEN" while serving a stale index. (STAR)A SKIP THAT DOES NOT COUNT AS A FAILURE IS A GREEN THAT MEANS NOTHING. WHAT IT DOES. Argless, because the clock execve's its organ with an EMPTY argv: 1. refresh buildroot/knowledge/compare/registry FROM the nishihost SSOT, atomically (tmp+rename) 2. fork the EXISTING nx_compare_regen.elf buildroot ../sites/nishifamily/compare/ (path RESOLVED) WHY THE REFRESH IS THE WHOLE POINT. nx_compare_regen deliberately refuses to emit the hub from a possibly-stale buildroot snapshot ("it is multi-session contended on the laptop; regenerating from a stale snapshot would clobber parallel additions"). That objection is REAL, and this does not waive it -- it answers it: a copy taken one syscall before the run cannot be stale. The registry is itself SELF-ASSEMBLED from the live hub + the local *.matrix union, so it is derived state, not a hand list. This is exactly what feedback-nas-is-hub-laptop-is-worker prescribes: "if a regen SKIPS a surface because the registry isn't synced here, the fix is to make the registry + assembler live on the NAS". COMPOSES, NEVER RE-IMPLEMENTS. The generator stays nx_swcompare_hub and the installer stays nx_compare_regen: this organ adds a caller, not a second ruler. Domains AND hub come from one pass. FAILS CLOSED. An unreadable or EMPTY SSOT refuses (exit 2) rather than publishing an empty hub -- (STAR)REFUSE TO CALL AN EMPTY WORLD GREEN. A failed copy refuses (exit 3) WITHOUT running the regen, so a half-written registry can never reach the emitter. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_compare_beat.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 cb_w sys_write sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close sys_exit ↻ sys_openat_wr sys_write ↻ sys_close ↻ sys_renameat cb_wn cb_w ↻ sys_mmap ↻ sys_write ↻ cb_exists sys_openat_rd ↻ sys_close ↻ cb_stamp_started sys_openat_wr ↻ cb_wfd

structs

none

consts

32const CB_SSOT: *u8 = "knowledge/compare/registry"
33const CB_TMP: *u8 = "buildroot/knowledge/compare/registry.nxnew"
34const CB_DST: *u8 = "buildroot/knowledge/compare/registry"
39const CB_REGEN_A: *u8 = "nx_compare_regen.elf"
40const CB_REGEN_B: *u8 = "_offc/nx_compare_regen.elf"
41const CB_FLEET_A: *u8 = "nx_compare_rank_fleet.elf" // PR4: the fleet ranker forked after every GREEN regen
42const CB_FLEET_B: *u8 = "_offc/nx_compare_rank_fleet.elf"
43const CB_ROOT: *u8 = "buildroot"
44const CB_OUT: *u8 = "../sites/nishifamily/compare/"
45const CB_PATHENV: *u8 = "PATH=/usr/bin:/bin"
51const CB_STAMP: *u8 = "knowledge/status/compare_beat.stamp"
53const CB_MODE0644: i64 = 420 // 0644
54const CB_ARGVCAP: i64 = 64
55const CB_ENVPCAP: i64 = 16
56const CB_STCAP: i64 = 16
57const CB_NUMCAP: i64 = 24
58const CB_EXITSHIFT: i64 = 8
59const CB_EXITMASK: i64 = 255

functions

61func cb_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: cb_wnmain calls 1: sys_write
63func cb_exists(p: *u8) -> i64 { let fd: i64 = sys_openat_rd(p); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: main calls 2: sys_openat_rdsys_close
65func cb_wfd(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 2: cb_stamp_startedcb_stamp calls 1: sys_write
67func cb_nfd(fd: i64, v: i64) -> i64
99func cb_stamp_started() -> i64
111func cb_stamp(code: i64) -> i64
126func cb_wn(v: i64) -> i64
called by 1: main calls 3: cb_wsys_mmapsys_write
140func main() -> i64