nx_clock_caps.nx source
↩ module page · 26 lines · 2348 B
1// nx_clock_caps.nx -- THE ONE COMMAND-SLOT CAP for the clock plane, shared by BOTH ends:
2// * nx_clockjob (the WRITER) derives CJ_ROWCAP from CLK_CMD_CAP (longest row `put` admits)
3// * nx_clock_sched (the READER/DISPATCHER) derives CLK_NAMEW from CLK_CMD_CAP (the per-slot width every
4// load/merge/save copy loop bounds at)
5// WHY ONE CONST (2026-08-22): the writer admitted rows up to 1024 bytes while the reader's slot was a
6// hand-mirrored 128, so every command longer than 127 bytes was committed INTACT to the DESIRED plane
7// (clockjobs-) and then SILENTLY CUT at merge into the LIVE plane (clocksched-). Measured on the live
8// store 2026-08-22: 7 of 103 jobs executed truncated argv -- the gateroster beat ran with deadline 1800
9// (ms) instead of 180000, admit appended to knowledge/gateroster.c instead of knowledge/gateroster.conf,
10// alertscore/refusalshape self-baselined to kno and knowledge/stat. TWO SPELLINGS OF ONE CAP IS
11// COORDINATION BY DISCIPLINE; ONE IMPORTED CONST MAKES DISAGREEMENT IMPOSSIBLE BY CONSTRUCTION.
12// DERIVATION, so neither number is magic:
13// CLK_CMD_CAP = 1024: the writer's whole-row bound (name TAB interval TAB organ, refused at >= CAP-2).
14// A single field of an admitted row is therefore <= CAP-2-3 (1-byte name, 2 tabs, 1-digit interval)
15// = 1019 bytes < CLK_CMD_CAP, so a slot of CLK_CMD_CAP bytes (NUL included) holds ANY field an
16// admitted row can carry -- the reader cannot truncate what the writer admits, BY ARITHMETIC.
17// 1024 is CJ_ROWCAP's established value (2026-08-06); raising it here raises BOTH ends together.
18// CLK_ARGV_MAX = 64: dispatcher argv vector bound. The live registry's widest command is 18 tokens
19// (gateadjudicate, 402 bytes); 64 is >=3.5x headroom, the same named-headroom shape as
20// CLK_MAXJOBS's 4x. The bound is NAMED and its exceedance ANNOUNCES (clk_split_argv prints
21// ARGV-OVERFLOW with the job name and the dropped count) -- never silent. The by-construction
22// alternative (CLK_CMD_CAP/2 + 2 = 514, the arithmetic max of space-split tokens in an admitted
23// command) costs one extra page per dispatch; adopt it if an announced overflow is ever seen live.
24// license_tier: ORIGINAL No hw writes (Rule 26).
25const CLK_CMD_CAP: i64 = 1024
26const CLK_ARGV_MAX: i64 = 64