code wiki / _hdl_build / nx_evidence_beat.nx
nx_evidence_beat.nx
buildroot/runtime/_hdl_build/nx_evidence_beat.nx
about
nx_evidence_beat.nx -- THE CADENCE. Closes the seq1433 half that turns this workstream from a one-shot
into an actual loop.
★WHY THIS IS THE KEYSTONE, NOT A CHORE. Everything built this session expires on purpose: evstamps carry
an epoch and are refused past the TTL, bite records likewise. That expiry is the whole point -- a verdict
that outlives its evidence is the defect this workstream opened by fixing. But expiry without RENEWAL is
just a slower way to reach zero: within one TTL every domain silently falls back to UNPROVEN and the
board returns to exactly the state it started in. A measurement you never repeat is a measurement you
will eventually be lying about.
WHAT IT DOES, per invocation:
for each domain declaring executable evidence (knowledge/compare/<d>.gates)
* if its evstamp is missing or older than the REFRESH threshold -> re-run nx_swcompare_evidence <d>
* if any of its declared gates lacks a fresh bite record -> re-run nx_bite_sweep <d>
★REFRESH AT HALF THE TTL, not at expiry. Renewing only once a record has already died guarantees a window
in which the board reads UNPROVEN for domains that are fine -- the instrument would manufacture its own
false negatives on a timer. Half-life renewal means a single missed beat is survivable.
★BOUNDED WORK BY CONSTRUCTION. Each refresh forks real gates and, for a sweep, rebuilds source repeatedly;
an unbounded beat would run for hours and get killed mid-flight, leaving a mutated tree behind. maxwork
caps the number of refreshes per invocation and the beat reports what it DEFERRED rather than silently
truncating -- a cadence that hides its own backlog is how "green" drifts away from "current".
usage: nx_evidence_beat [maxwork] [--dry] (CWD = nxc2 root)
exit 0 = nothing overdue, or all attempted work succeeded · 1 = a refresh failed · 2 = usage
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_artifact_root.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
| 30 | const EB_MAGIC_4096: i64 = 4096 |
| 31 | const EB_MAGIC_4095: i64 = 4095 |
| 32 | const EB_MAGIC_604800: i64 = 604800 |
| 33 | const EB_MAGIC_1024: i64 = 1024 |
| 35 | const EB_DEF_MAXWORK: i64 = 3 |
functions
| 37 | func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 38 | func wn(v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} let b: *u8=sys_mmap(28); var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } |
| 39 | func wf(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 40 | func wnf(fd: i64, v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} let b: *u8=sys_mmap(28); var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(fd,b,k); return 0 } |
| 42 | func eb_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 54 | func eb_num_after(buf: *u8, n: i64, key: *u8, kl: i64) -> i64 called by 1: main |
| 72 | func eb_cat(dst: *u8, off: i64, s: *u8) -> i64 called by 1: main |
| 78 | func eb_catn(dst: *u8, off: i64, domain: *u8, dl: i64) -> i64 called by 1: main |
| 86 | func eb_run2(elf: *u8, a1: *u8, a2: *u8, outpath: *u8) -> i64 |
| 107 | func main(argc: i64, argv: *i64) -> i64 |