code wiki / (root) / nx_clockjobs_gate.nx

nx_clockjobs_gate.nx

buildroot/runtime/nx_clockjobs_gate.nx

8178 B179 linesdepth 3pulls 3 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 2 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_clockjobs_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.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 sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close gv_ctr sys_mmap ↻ gv_head gv_puts sys_write ↻ gv_check gv_puts ↻ gv_verdict gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻ sys_munmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real gv_cat sys_write ↻ sys_close ↻ sys_munmap ↻ sys_exit cj_pn cj_p ↻

structs

none

consts

28const CJ_MAXJOBS: i64 = 128
29const CJ_REG: *u8 = "clock_jobs.tsv" as *u8
30const CJ_TAB: i64 = 9
31const CJ_NL: i64 = 10

functions

33func 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
34func 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
35func cj_pn(v: i64) -> i64
called by 1: main calls 3: cj_psys_mmapsys_write
50func cj_all_digits(buf: *u8, lo: i64, hi: i64) -> i64
called by 1: main
64func cj_val(buf: *u8, lo: i64, hi: i64) -> i64
called by 1: main
71func main() -> i64