code wiki / _hdl_build / nx_evidence_beat.nx

nx_evidence_beat.nx

buildroot/runtime/_hdl_build/nx_evidence_beat.nx

14981 B274 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic evidence
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_artifact_root.nx nx_evidence_beat.nx

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

main sys_now_realtime_sec sys_mmap sys_clock_gettime_real sys_mmap ↻ eb_read sys_openat_rd sys_read sys_close eb_num_after w sys_write wn sys_mmap ↻ sys_write ↻ ar_resolve ar_resolve_with ar_exists sys_openat_rd ↻ sys_close ↻ sys_mmap ↻ ar_read sys_openat_rd ↻ sys_read ↻ sys_close ↻ sys_exit sys_openat_rd ↻ sys_getdents64 dirent_reclen eb_cat eb_catn eb_run2 sys_fork sys_openat_wr sys_dup3 sys_mmap ↻ sys_execve sys_exit ↻ sys_wait4 sys_close ↻

structs

none

consts

30const EB_MAGIC_4096: i64 = 4096
31const EB_MAGIC_4095: i64 = 4095
32const EB_MAGIC_604800: i64 = 604800
33const EB_MAGIC_1024: i64 = 1024
35const EB_DEF_MAXWORK: i64 = 3

functions

37func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
38func 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 }
called by 1: main calls 2: sys_mmapsys_write
39func 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 }
called by 1: main calls 1: sys_write
40func 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 }
called by 1: main calls 2: sys_mmapsys_write
42func eb_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
54func eb_num_after(buf: *u8, n: i64, key: *u8, kl: i64) -> i64
called by 1: main
72func eb_cat(dst: *u8, off: i64, s: *u8) -> i64
called by 1: main
78func eb_catn(dst: *u8, off: i64, domain: *u8, dl: i64) -> i64
called by 1: main
86func eb_run2(elf: *u8, a1: *u8, a2: *u8, outpath: *u8) -> i64
107func main(argc: i64, argv: *i64) -> i64