code wiki / _hdl_build / nx_heartbeat_registry_gate.nx

nx_heartbeat_registry_gate.nx

buildroot/runtime/_hdl_build/nx_heartbeat_registry_gate.nx

7092 B169 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic heartbeat
docsdependenciesstructsconstsfunctions

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

nx_heartbeat_str.nx nx_workstream_store.nx nx_framed_append.nx nx_syscalls.nx nx_heartbeat_registry_gate.nx

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

main sys_now_realtime_sec sys_mmap sys_clock_gettime_real sys_mmap ↻ hr_path hr_cat hr_catn sys_mmap ↻ ws_put_p sys_mmap ↻ ws_len ss_get sys_mmap ↻ ss_scan sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn sys_mmap ↻ ss_cat ss_readall sys_munmap ss_scan_seglist ss_len sys_mmap ↻ ss_cat ↻ ss_readall ↻ ss_r32 ss_begin ss_begin_cap sys_mmap ↻ ss_add ss_add2 ss_w32 ss_len ↻ ws_seg_next ss_next_segid sys_mmap ↻ ss_cat ↻ ss_readall ↻

structs

none

consts

22const HBR_LOG: *u8 = "knowledge/status/heartbeat_registry_gate.log"
23const HBR_REC: i64 = 256

functions

25func so(s: *u8) -> i64
called by 1: main calls 1: sys_write
31func son(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
44func hr_cat(dst: *u8, off: i64, s: *u8) -> i64
called by 2: hr_pathmain
49func hr_catn(dst: *u8, off: i64, v: i64) -> i64
called by 2: hr_pathmain calls 1: sys_mmap
60func hr_path(out: *u8, tag: *u8, epoch: i64, suffix: *u8) -> i64
called by 1: main calls 2: hr_cathr_catn
70func hr_rawline(path: *u8, s: *u8) -> i64
80func find_verdict(out_ids: *i64, verdicts: *i64, n: i64, id: *u8) -> i64
called by 1: main calls 1: hbs_streq
89func main() -> i64