nx_replyreserve.nx
buildroot/runtime/nx_replyreserve.nx
about
nx_replyreserve.nx -- CLI for the reply-reserve calibrator (lane E, 2026-08-25). Thin main; the ruler is
nx_replyreserve_lib.rr_derive and the quantile machinery is nx_loadceil_lib, so nx_replyreserve_gate
composes both in-process on planted buffers.
nx_replyreserve [report|apply|beat] [logpath]
beat (DEFAULT) Derive and print, then apply ONLY if replyreserve-auto-apply is 1 in the conf.
report READ-ONLY. Derive and print; never touches the conf.
apply Explicit operator action: rewrite knowledge/edge_window.conf when a ratchet is due.
WHY THE DEFAULT IS THE WRITING VERB, deliberately and against least-surprise: the clocksched plane's
organ column is a BARE PATH -- every live row is `<name> <interval> <elf>` with no argv -- so the clock
forks this organ with no arguments. If the bare invocation were the read-only one, the beat would be
structurally inert and this organ could never arm itself no matter how long it ran, which is the whole
point of building it. Safety does not come from which verb is default; it comes from the conf switch
(replyreserve-auto-apply), the bounded envelope [floor_ms, cap_ms], the refusal that keeps the current
value, and the journal line every application writes. `report` is one word away for a read-only look.
exit 0 RATCHET(-ready or applied) / 1 HOLD (conf already carries the measured value) / 2 UNREADABLE /
3 INSUFFICIENT-HISTORY (abstain) / 4 REFUSED-OUT-OF-BOUNDS (current value KEPT).
HOLD and RATCHET are both successes; they are distinct codes so a beat can tell "changed" from "already
right", and INSUFFICIENT is distinct from UNREADABLE so a blind axis never reads as a healthy one.
THE LOG IS READ FROM ITS TAIL, NOT ITS HEAD, and that is load-bearing rather than an optimisation:
actlog.jrnl is append-only and 30 MB, reply_ms= has only existed since the 2026-08-23 build, so every
sample lives in the last few KB. A capped read from offset 0 returns 4 MB of history that predates the
field entirely and yields ZERO samples -- an abstention for the wrong reason, from an organ that could
then never arm itself no matter how long it ran. Coverage is printed either way.
license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_replyreserve_lib.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
| 32 | const RR_OUTCAP: i64 = 32768 |
functions
| 34 | func rrw(fd: i64, s: *u8) -> i64 { let n: i64 = lc_slen(s); if n > 0 { sys_write(fd, s, n) } return 0 } called by 1: rro |
| 35 | func rro(s: *u8) -> i64 { return rrw(1, s) } |
| 36 | func rrn(v0: i64) -> i64 |
| 44 | func rr_word(v: i64) -> *u8 |
| 54 | func rr_status_write(out: *i64, verdict: i64, applied: i64, epoch: i64, whole: i64, size: i64) -> i64 |
| 86 | func rr_jrnl_append(oldv: i64, newv: i64, n: i64, epoch: i64) -> i64 |
| 102 | func rr_publish(path: *u8, tmp: *u8, b: *u8, n: i64) -> i64 called by 1: main |
| 112 | func main(argc: i64, argv: *i64) -> i64 |