code wiki / (root) / nx_clockjobs_gate.nx

nx_clockjobs_gate.nx

buildroot/runtime/nx_clockjobs_gate.nx

10052 B198 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_clockjobs_gate.nx -- is the scheduler's registry WELL-FORMED, or is it carrying silent no-ops? WHY THIS EXISTS (debt 1785601721). clk_load in nx_clock_sched.nx parses clock_jobs.tsv with NO validation of any kind. Every failure mode below is silent -- the row becomes a "job" that dispatches nothing, forever, and no instrument reports it: * fewer than 4 tab fields -> organ = "" -> dispatch is a no-op, scheduled for eternity * non-digit chars in a number -> SKIPPED, so an interval of "3o0" parses as 30 (wrong cadence, plausible value, no error) -- the silent-coercion class * interval = 0 -> a job that is always due * rows past CLK_MAXJOBS -> SILENTLY DROPPED (the truncating-cap class: the registry says one thing, the scheduler runs another) A MALFORMED ROW MUST BE REFUSED AT ADMISSION, NOT PARSED INTO A SILENT NO-OP AT DISPATCH. This gate is the DETECTION half of that: it cannot stop a bad write, but it makes one impossible to miss. The admission half (a validating writer) is the next rung and is deliberately separate -- a reader-side guard that is honest about being read-only beats a writer swap rushed under a live scheduler. SCOPE, STATED HONESTLY: this validates the REGISTRY FILE. It does NOT prove the named organ exists on disk, and it does NOT prove a job ever dispatched -- fail=0 is not evidence that a beat moved what it names. Those are separate claims and separate gates. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_store_seed_lib.nx nx_clockjobs_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.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 cj_p cj_len sys_write 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 ↻ sts_load_fit sts_mm sys_mmap ↻ sts_werr sys_write ↻ sys_exit ↻ 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

29const CJ_MAXJOBS: i64 = 128
41const CJ_PLANE: *u8 = "knowledge/store/clocksched-" as *u8
42const CJ_TAB: i64 = 9
43const CJ_NL: i64 = 10

functions

45func cj_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: cj_p
46func cj_p(s: *u8) -> i64 { let n: i64 = cj_len(s); sys_write(1, s, n); return 0 }
called by 2: cj_pnmain calls 2: cj_lensys_write
47func cj_pn(v: i64) -> i64
called by 1: main calls 3: cj_psys_mmapsys_write
62func cj_all_digits(buf: *u8, lo: i64, hi: i64) -> i64
called by 1: main
76func cj_val(buf: *u8, lo: i64, hi: i64) -> i64
called by 1: main
83func main() -> i64