code wiki / _hdl_build / nx_heartbeat_registry_gate.nx
nx_heartbeat_registry_gate.nx
buildroot/runtime/_hdl_build/nx_heartbeat_registry_gate.nx
about
nx_heartbeat_registry_gate.nx -- the REFEREE for WMS LIVE-2 (registry-sourced string-keyed monitor).
Proves hbm_scan_registry auto-monitors EVERY registered workstream from the R1 SSOT (no hardcoded
id list, no int/string bridge), with correct per-stream liveness AND a mandatory negative control:
setup: seed a fresh registry ws:ids = {HB-A, HB-B, HB-C, HB-D}; beat HB-A & HB-B FRESH, HB-C STALE
(old beat), leave HB-D NEVER beaten; append one TORN heartbeat line.
T1 coverage : scan returns nids == 4 -- every registered stream was sourced from ws:ids.
T2 alive : HB-A and HB-B (beaten within threshold) read HBS_ALIVE.
T3 stalled(NEG): HB-C (beaten long ago) reads HBS_STALLED -- a crashed stream surfaces, the
detector is NOT a constant-ALIVE.
T4 unknown(NEG): HB-D (registered but NEVER beaten) reads HBS_UNKNOWN -- the monitor never
fabricates liveness for a stream it has no beat for.
T5 torn-flag : the corrupt line is FLAGGED (flagged>=1), never silently dropped.
GREEN(0) iff T1..T5. Fresh /tmp artifacts per run (disposable). Self-log via fa_appendz.
Sovereign: nx_heartbeat_str + nx_workstream_store + nx_framed_append + nx_syscalls.
license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_heartbeat_str.nxnx_workstream_store.nxnx_framed_append.nxnx_syscalls.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
| 22 | const HBR_LOG: *u8 = "knowledge/status/heartbeat_registry_gate.log" |
| 23 | const HBR_REC: i64 = 256 |
functions
| 25 | func so(s: *u8) -> i64 |
| 31 | func son(v: i64) -> i64 |
| 44 | func hr_cat(dst: *u8, off: i64, s: *u8) -> i64 |
| 49 | func hr_catn(dst: *u8, off: i64, v: i64) -> i64 |
| 60 | func hr_path(out: *u8, tag: *u8, epoch: i64, suffix: *u8) -> i64 |
| 70 | func hr_rawline(path: *u8, s: *u8) -> i64 |
| 80 | func find_verdict(out_ids: *i64, verdicts: *i64, n: i64, id: *u8) -> i64 |
| 89 | func main() -> i64 |