nx_stalesweep.nx
buildroot/runtime/nx_stalesweep.nx
about
nx_stalesweep.nx -- SOVEREIGN replacement for nx_stale_sweep.cron.sh (2026-08-07).
WHAT IT MEASURES: an organ whose LIVE elf is older than its buildroot SOURCE is a stale mirror -- the
class that was previously found by injury (Jul-19 clock elf; argecho 81h) rather than measured.
THE PROPERTY THAT MUST SURVIVE THE PORT, and it is the reason this file exists rather than a swap:
the script files ONE ROLLUP debt with CONSTANT text, never one row per stale organ. Its own comment
names the debt that taught it: 1785525470, `a beat that files one row per instance converts a metric
into a backlog`.
(STAR)A RECURRING BEAT THAT FILES ONE ROW PER INSTANCE CONVERTS A METRIC INTO A BACKLOG -- FILE ONE
ROLLUP ROW WITH CONSTANT TEXT AND KEEP THE INSTANCE LIST IN A REGENERATED FILE.
The ledger row is the POINTER; knowledge/status/stale_mirror.worklist is the TRUTH.
TWO MORE PROPERTIES A CARELESS PORT WOULD DESTROY:
- SOURCE RESOLUTION ORDER. Prefer buildroot/runtime/_hdl_build/<b>.nx, and only then
buildroot/runtime/<b>.nx. buildrun compiles the _hdl_build twin when BOTH exist, so checking the
runtime twin would verify the WRONG elf and report a stale mirror that is not stale.
- THE DOCTRINE SENTENCE. source-newer is AMBIGUOUS (pending upgrade vs uncommitted WIP), so the debt
says TRIAGE and explicitly forbids blanket-rebuild. Drop that line and this beat stops being a
triage signal and becomes a rebuild trigger that ships half-work.
nx_stalesweep [stale-hours] (no args on the clock; conf then 72)
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
| 25 | const SS_MAGIC_3600: i64 = 3600 |
| 26 | const SS_MAGIC_1024: i64 = 1024 |
| 28 | const SS_CONF: *u8 = "knowledge/status/stalesweep.conf" |
| 29 | const SS_WORKTMP: *u8 = "knowledge/status/.stale_mirror.worklist.tmp" |
| 30 | const SS_WORKLIST: *u8 = "knowledge/status/stale_mirror.worklist" |
| 31 | const SS_HDL: *u8 = "buildroot/runtime/_hdl_build/" |
| 32 | const SS_RT: *u8 = "buildroot/runtime/" |
| 33 | const SS_DEBT: *u8 = "/volume1/homes/elderwesto/nishihost/nx_debt.elf" |
| 34 | const SS_DIRBUF: i64 = 262144 |
| 35 | const SS_NAMEW: i64 = 256 |
| 36 | const SS_MAXELF: i64 = 4096 |
| 37 | const SS_MODE: i64 = 0x1a4 |
| 38 | const SS_DEF_TH: i64 = 72 |
| 39 | const SS_STATBUF: i64 = 256 |
| 40 | const SS_MTIME_OFF: i64 = 88 |
| 41 | const SS_OUTCAP: i64 = 1048576 |
functions
| 43 | func ss_o(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 44 | func ss_cat(d: *u8, o: i64, s: *u8) -> i64 { var x: i64=o; var i: i64=0; while s[i]!=(0 as u8){d[x]=s[i];x=x+1;i=i+1} return x } called by 1: main |
| 45 | func ss_num(d: *u8, o: i64, v: i64) -> i64 { var x: i64=o; var mm: i64=v; if mm<0{d[x]=45 as u8;x=x+1;mm=0-mm} if mm==0{d[x]=48 as u8;return x+1} let t:*u8=sys_mmap(24); var k:i64=0; while mm>0{t[k]=(48+(mm%10)) as u8;mm=mm/10;k=k+1} var j:i64=0; while j<k{d[x]=t[k-1-j];x=x+1;j=j+1} return x } |
| 46 | func ss_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 47 | func ss_slot(b: *u8, i: i64) -> *u8 { return ((b as i64) + i*SS_NAMEW) as *u8 } called by 1: main |
| 48 | func ss_atoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ if s[i]<(48 as u8){return v} if s[i]>(57 as u8){return v} v=v*10+((s[i]-(48 as u8)) as i64); i=i+1 } return v } called by 1: main |
| 49 | func ss_opendir(p: *u8) -> i64 { return __syscall(257, 0-100, p as i64, 0x10000, 0, 0, 0) } called by 1: main |
| 55 | func ss_mtime(path: *u8) -> i64 |
| 62 | func ss_ends_elf(nm: *u8) -> i64 |
| 72 | func main(argc: i64, argv: *i64) -> i64 |