nx_compare_beat.nx
buildroot/runtime/nx_compare_beat.nx
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
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
| 32 | const CB_SSOT: *u8 = "knowledge/compare/registry" |
| 33 | const CB_TMP: *u8 = "buildroot/knowledge/compare/registry.nxnew" |
| 34 | const CB_DST: *u8 = "buildroot/knowledge/compare/registry" |
| 39 | const CB_REGEN_A: *u8 = "nx_compare_regen.elf" |
| 40 | const CB_REGEN_B: *u8 = "_offc/nx_compare_regen.elf" |
| 41 | const CB_FLEET_A: *u8 = "nx_compare_rank_fleet.elf" // PR4: the fleet ranker forked after every GREEN regen |
| 42 | const CB_FLEET_B: *u8 = "_offc/nx_compare_rank_fleet.elf" |
| 43 | const CB_ROOT: *u8 = "buildroot" |
| 44 | const CB_OUT: *u8 = "../sites/nishifamily/compare/" |
| 45 | const CB_PATHENV: *u8 = "PATH=/usr/bin:/bin" |
| 51 | const CB_STAMP: *u8 = "knowledge/status/compare_beat.stamp" |
| 53 | const CB_MODE0644: i64 = 420 // 0644 |
| 54 | const CB_ARGVCAP: i64 = 64 |
| 55 | const CB_ENVPCAP: i64 = 16 |
| 56 | const CB_STCAP: i64 = 16 |
| 57 | const CB_NUMCAP: i64 = 24 |
| 58 | const CB_EXITSHIFT: i64 = 8 |
| 59 | const CB_EXITMASK: i64 = 255 |
functions
| 61 | func 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 } |
| 63 | func cb_exists(p: *u8) -> i64 { let fd: i64 = sys_openat_rd(p); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 65 | func 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 } |
| 67 | func cb_nfd(fd: i64, v: i64) -> i64 |
| 99 | func cb_stamp_started() -> i64 |
| 111 | func cb_stamp(code: i64) -> i64 |
| 126 | func cb_wn(v: i64) -> i64 |
| 140 | func main() -> i64 |