nx_drift_watch.nx
buildroot/runtime/nx_drift_watch.nx
about
nx_drift_watch.nx -- STANDING deploy-drift guardrail (zero-Claude, cron-run; arch-board 06:20 precedent).
The F-004 stale serve AND the compare-generator drifts both accumulated SILENTLY -- nothing watched for
"deployed binary lags its source" (esp. after a compiler/toolchain change, which staleness-flags EVERY
pre-fix binary). This daily check reads a data-driven watch-list and, per target, rebuilds it --build-only
and byte-compares to the deployed buildroot/_offc/<t>.elf (the SAME logic as nx_stale_check, INLINED to
stay single-nest -- a double-nested fork of nx_stale_check-of-nx_sov_build_run fails builds). Stub-trap
guarded (fresh<<deployed => AMBIGUOUS, not STALE). Logs verdicts + a tally to knowledge/status/drift_watch.log.
nx_drift_watch [listpath] [broot] list default knowledge/registry/drift_watch.list ; broot default buildroot
Exit 0 always (a guardrail never fails the fleet); the LOG carries the verdict. license_tier: ORIGINAL
dependencies 1 imports · 0 importers
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
structs
| none |
consts
| 11 | const K_MAGIC_4096: i64 = 4096 |
| 12 | const K_MAGIC_65536: i64 = 65536 |
| 13 | const K_MAGIC_65535: i64 = 65535 |
| 14 | const K_MAGIC_8388608: i64 = 8388608 |
functions
| 16 | 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 } |
| 17 | func wn(fd: i64, v: i64) -> i64 { var m: i64=v; if m<0{w(fd,"-" as *u8);m=0-m} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} let o: *u8=sys_mmap(28); var i: i64=0; while i<k{o[i]=t[k-1-i];i=i+1} sys_write(fd,o,k); return 0 } |
| 18 | func d_cat(dst: *u8, off: i64, src: *u8) -> i64 { var o: i64=off; var j: i64=0; while src[j]!=(0 as u8){dst[o]=src[j];o=o+1;j=j+1} return o } called by 1: d_check |
| 19 | func d_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 26 | func d_check(tgt: *u8, out: *u8, ocap: i64, ol: *i64, fb: *u8, db: *u8, fcap: i64, sz: *i64) -> i64 |
| 50 | func main(argc: i64, argv: *i64) -> i64 |