code wiki / _hdl_build / nx_cron_watch.nx

nx_cron_watch.nx

buildroot/runtime/_hdl_build/nx_cron_watch.nx

9411 B162 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_cron_watch.nx -- CRON/AUTOMATION FRESHNESS SUPERVISOR (operator: "prevent things like this... supervised"; the next silent-failure class after API-contract drift + lib drift = a scheduled job that SILENTLY STOPS FIRING, e.g. seq22 team_pulse died unnoticed). SOTA = the dead-man's-switch / heartbeat model (Healthchecks.io "expected period + grace time", Cronitor, Dead Man's Snitch): a job pings on its schedule; a check-in missed beyond a grace window -> STALE/alert. Sovereign twist: the heartbeat is each job's own evidence-log `ts=<epoch>` (no external SaaS; evidence-layer native). Data-driven (rule 11): knowledge/registry/cron_heartbeats.tsv rows name<TAB>heartbeat-file<TAB>ts-marker<TAB>max-age-secs<TAB>remediation. max-age = expected-interval + grace. age = now - ts. age>max-age -> STALE. missing ts -> STALE (never fired). nx_cron_watch check [manifest] (JSON: per watch fresh/stale + age + verdict GREEN/STALE-DETECTED) license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_cron_watch.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 sys_mmap cw_read sys_openat_rd sys_lseek sys_read sys_close cw_werr sys_write sys_exit sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real cw_cat cw_catn sys_mmap ↻ cw_le cw_col cw_cstr cw_atoi_span cw_num_after cw_cat_esc sys_write ↻

structs

none

consts

13const CW_CAP: i64 = 262144
14const CW_TAB: i64 = 9
15const CW_NL: i64 = 10
16const CW_HASH: i64 = 35
17const CW_STDERR: i64 = 2
18const CW_SPAN: i64 = 16
19const CW_EXIT_USAGE: i64 = 2

functions

21func cw_werr(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(CW_STDERR, s, n); return 0 }
called by 1: main calls 1: sys_write
22func cw_vlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
23func cw_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { d[o] = s[i]; o = o + 1; i = i + 1 } return o }
called by 1: main
24func cw_catn(d: *u8, o: i64, v: i64) -> i64 { let t: *u8 = sys_mmap(28); var m: i64 = v; if m < 0 { d[o] = 45 as u8; o = o + 1; m = 0 - m } 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 } var i: i64 = 0; while i < k { d[o] = t[k-1-i]; o = o + 1; i = i + 1 } return o }
called by 1: main calls 1: sys_mmap
25func cw_cat_esc(d: *u8, o: i64, q: *u8, s: i64, e: i64) -> i64 { var i: i64 = s; while i < e { var c: i64 = q[i] as i64; if c == 34 { c = 39 } if c == 92 { c = 47 } if c < 32 { c = 32 } d[o] = c as u8; o = o + 1; i = i + 1 } return o }
called by 1: main
33func cw_read(path: *u8, buf: *u8, cap: i64) -> i64
45func cw_num_after(buf: *u8, n: i64, marker: *u8) -> i64
called by 1: main
75func cw_le(q: *u8, i: i64, n: i64) -> i64 { var e: i64 = i; var s: i64 = 1; while s == 1 { if e >= n { s = 0 } else { if q[e] == (CW_NL as u8) { s = 0 } else { e = e + 1 } } } return e }
called by 1: main
76func cw_col(q: *u8, ls: i64, le: i64, c: i64, out: *i64) -> i64
called by 1: main
92func cw_cstr(q: *u8, s: i64, e: i64, dst: *u8) -> i64 { var i: i64 = 0; while s + i < e { dst[i] = q[s+i]; i = i + 1 } dst[i] = 0 as u8; return i }
called by 1: main
93func cw_atoi_span(q: *u8, s: i64, e: i64) -> i64 { var v: i64 = 0; var i: i64 = s; while i < e { let c: i64 = q[i] as i64; if c >= 48 { if c <= 57 { v = v * 10 + (c - 48) } } i = i + 1 } return v }
called by 1: main
94func main(argc: i64, argv: *i64) -> i64