code wiki / (root) / nx_clockjob.nx

nx_clockjob.nx

buildroot/runtime/nx_clockjob.nx

34211 B559 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_clockjob.nx -- THE MISSING PRODUCER for the clock's desired-state plane (2026-08-06). WHY THIS EXISTS. A sibling seat made clk_merge_store RECONCILE knowledge/store/clockjobs- toward desired state ("clockjobs- is now DESIRED STATE, not an append-only inbox") -- so re-periodding a clock job is finally SUPPORTED. But NOTHING COULD WRITE THAT PLANE: nx_clockjobs.nx is a LIBRARY with no main(), it is not in tool_allowlist.conf so it cannot even be cap-minted, and nx_store_put emits a FIXED 9-FIELD row that projects garbage onto this 3-column grammar (a prior attempt left a row NEUTRALIZED at interval 99999999). The live plane still carries the scar: row q:7 reads "600<TAB>nx_segguard.sh" with NO NAME AT ALL -- a half-written row that the dispatcher's MALFORMED-ROW guard now has to skip on every single window. (STAR)A RECONCILER WITH NO PRODUCER IS A CONSUMER WITH NOTHING TO CONSUME -- shipping the desired-state half without a writer leaves the registry exactly as unfixable as before, while LOOKING fixed. (STAR)THE ABSENCE OF A SANCTIONED WRITER DOES NOT STOP WRITES, IT ONLY MAKES THEM MALFORMED. nx_clockjob put <name> <interval-secs> <organ> Grammar is EXACTLY the dispatcher's: name<TAB>interval<TAB>organ. Validated at the boundary so the q:7 class cannot recur: no empty field, no embedded tab, interval must be a positive integer. Append is sts_append_fast_locked (the O(1) locked path) -- last declaration wins at reconcile time. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_store_seed_lib.nx nx_clock_caps.nx nx_clockjob.nx

imports: nx_syscalls.nxnx_store_seed_lib.nxnx_clock_caps.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main cj_err sys_write sys_exit cj_streq cj_dump cj_dump2 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 ss_open_cached ssc_init ssc_sig_of ssc_streq ss_open ssc_retire_handle sts_mm ↻ ss_hget

structs

none

consts

22const CJ_PREFIX: *u8 = "knowledge/store/clockjobs-"
23const CJ_ROWCAP: i64 = CLK_CMD_CAP // THE SAME const the dispatcher's CLK_NAMEW slot is derived
26const CJ_TAB: i64 = 9
88const CJ_LIVE_PREFIX: *u8 = "knowledge/store/clocksched-"
89const CJ_NAMECAP: i64 = 256
90const CJ_NL: i64 = 10 // mirrors this file's own CJ_TAB convention (a local byte-name, not a second ruler)
165const CJ_TOMB: *u8 = "__TOMB__"

functions

28func cj_out(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
34func cj_err(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(2,s,n); sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
35func cj_cat(dst: *u8, o: i64, s: *u8) -> i64 { var x: i64=o; var i: i64=0; while s[i]!=(0 as u8){dst[x]=s[i];x=x+1;i=i+1} return x }
36func cj_num(dst: *u8, o: i64, v: i64) -> i64 { var x: i64=o; var mm: i64=v; if mm==0{dst[x]=48 as u8;return x+1} let t:*u8=sys_mmap(24); var k:i64=0; while mm>0{t[k]=(48+(mm%10)) as u8;mm=mm/10;k=k+1} var j:i64=0; while j<k{dst[x]=t[k-1-j];x=x+1;j=j+1} return x }
called by 4: cj_dump2cj_dupescj_getmain calls 1: sys_mmap
37func cj_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
38func cj_tabfree(s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ if s[i]==(CJ_TAB as u8){return 0} i=i+1 } return 1 }
called by 1: main
39func cj_atoi(s: *u8) -> i64 {
called by 1: main
62func cj_first_token(src: *u8, dst: *u8, cap: i64) -> i64 {
called by 1: cj_resolves
74func cj_resolves(org: *u8) -> i64 {
105func cj_streq(a: *u8, b: *u8) -> i64 {
113func cj_eol(buf: *u8, n: i64, i: i64) -> i64 {
123func cj_rowname(buf: *u8, s: i64, e: i64, out: *u8, cap: i64) -> i64 {
169func cj_rowfield1(buf: *u8, s: i64, e: i64, out: *u8, cap: i64) -> i64 {
called by 1: cj_scan
198func cj_scan(buf: *u8, n: i64, want: *u8, na: *u8, nb: *u8, tp: *i64) -> i64 {
221func cj_dump2(prefix: *u8, tombsrc: *u8, label: *u8, show: i64) -> i64 {
307func cj_dump(prefix: *u8, label: *u8, show: i64) -> i64 { return cj_dump2(prefix, 0 as *u8, label, show) }
called by 1: main calls 1: cj_dump2
310func cj_dupes(prefix: *u8) -> i64 {
387func cj_get(prefix: *u8, label: *u8, want: *u8) -> i64 {
435func main(argc: i64, argv: *i64) -> i64 {