nx_clockjobs_gate.nx
buildroot/runtime/nx_clockjobs_gate.nx
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
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
structs
| none |
consts
| 28 | const CJ_MAXJOBS: i64 = 128 |
| 29 | const CJ_REG: *u8 = "clock_jobs.tsv" as *u8 |
| 30 | const CJ_TAB: i64 = 9 |
| 31 | const CJ_NL: i64 = 10 |
functions
| 33 | func 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 |
| 34 | func cj_p(s: *u8) -> i64 { let n: i64 = cj_len(s); sys_write(1, s, n); return 0 } |
| 35 | func cj_pn(v: i64) -> i64 |
| 50 | func cj_all_digits(buf: *u8, lo: i64, hi: i64) -> i64 called by 1: main |
| 64 | func cj_val(buf: *u8, lo: i64, hi: i64) -> i64 called by 1: main |
| 71 | func main() -> i64 |