code wiki / _hdl_build / nx_cron_watch.nx

nx_cron_watch.nx

buildroot/runtime/_hdl_build/nx_cron_watch.nx

27337 B454 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tooltopic cron
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 2 imports · 0 importers

nx_syscalls.nx nx_store_seed_lib.nx nx_cron_watch.nx

imports: nx_syscalls.nxnx_store_seed_lib.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 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 ↻ cw_read sys_openat_rd sys_lseek sys_read sys_close cw_werr sys_write ↻ sys_exit ↻ cw_manifest sts_load sts_gen_note sts_pfxhash ss_max_segid sys_mmap ↻ ss_cat ss_readall sys_openat_rd ↻ sys_lseek ↻ sys_mmap ↻ sys_read ↻ sys_close ↻ ss_segid_ok ss_open_cached ssc_init

structs

none

consts

16const CW_CAP: i64 = 262144
17const CW_TAB: i64 = 9
18const CW_NL: i64 = 10
19const CW_HASH: i64 = 35
20const CW_STDERR: i64 = 2
21const CW_SPAN: i64 = 16
22const CW_EXIT_USAGE: i64 = 2
170const CW_MARKCAP: i64 = 256

functions

24func 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
25func cw_vlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
26func 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
27func 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
28func 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
36func cw_read(path: *u8, buf: *u8, cap: i64) -> i64
48func cw_num_after(buf: *u8, n: i64, marker: *u8) -> i64
called by 1: main
78func 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 2: cw_row_declaresmain
79func cw_col(q: *u8, ls: i64, le: i64, c: i64, out: *i64) -> i64
called by 1: main
95func 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
96func 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
97func cw_p(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 1: main calls 1: sys_write
98func cw_pn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
109func cw_has(q: *u8, n: i64, ned: *u8, nl: i64) -> i64
called by 2: cw_row_declaresmain
125func cw_token(q: *u8, ls: i64, le: i64, dst: *u8) -> i64
called by 1: main
162func cw_manifest(out: *u8, cap: i64, srcout: *i64) -> i64
called by 1: main calls 2: sts_loadcw_read
174func cw_tok_after(hay: *u8, hn: i64, key: *u8, out: *u8, cap: i64) -> i64
called by 1: main
206func cw_row_declares(man: *u8, mn: i64, needle: *u8, nl: i64) -> i64
called by 1: main calls 2: cw_lecw_has
217func main(argc: i64, argv: *i64) -> i64