code wiki / _hdl_build / nx_heartbeat_str.nx
nx_heartbeat_str.nx
buildroot/runtime/_hdl_build/nx_heartbeat_str.nx
about
nx_heartbeat_str.nx -- WMS LIVE-2: STRING-KEYED heartbeats + registry-sourced monitoring.
module: nishi-core.wms.heartbeat_str
capability: CORE_COMPUTE (auto-monitor every registered workstream from the SSOT)
WHAT THIS CLOSES: M1 (nx_heartbeat_monitor) keys heartbeats by INTEGER ws, but the R1 registry
keys workstreams by STRING id ("T-WS-A") -- the int/string seam that blocked LIVE-2 (and showed up
at R9). Operator decision 2026-06-14: STRING-KEYED heartbeats, eliminating the seam. A stream now
beats under its REGISTRY id, and hbm_scan_registry sources the monitored set straight from ws:ids,
so EVERY registered empire is auto-covered with NO bridge/fabricated mapping.
ADDITIVE (rule 19): the integer hb_* in nx_heartbeat_monitor are UNTOUCHED -- existing callers
(the LIVE-1 conductor, the M1 gate) keep working. This is a new, parallel string-keyed capability.
REUSE (rule 15): the locked single-write framing (fa_append/fa_cat/fa_catn, WMS-R0b), the HBX
2-anchor wellformed discipline (M1), and registry enumeration (ws_manifest_p, R1). The only new
machinery is a STRING field extractor (token up to the next space) + string compare -- M1's
wsl_field parses ints, which can't carry a string id. Sovereign: nx_syscalls + nx_framed_append +
nx_workstream_store. license_tier: ORIGINAL
dependencies 3 imports · 11 importers
diagram shows first 10 each side; +0 more imports, +1 more importers in the complete lists below.
imports: nx_syscalls.nxnx_framed_append.nxnx_workstream_store.nx
imported by: nx_heartbeat_registry_gate.nxnx_media_ws_register.nxnx_pm_sclass.nxnx_pm_sclass_converge_gate.nxnx_pm_sclass_loop.nxnx_project_ws_register.nxnx_sclass_dispatch_gate.nxnx_sclass_flow03_gate.nxnx_survey_ws_register.nxnx_ws_board.nxnx_ws_board_live_gate.nx
structs
| none |
consts
| 24 | const HBS_RECCAP: i64 = 256 |
| 25 | const HBS_ALIVE: i64 = 0 // beating within threshold |
| 26 | const HBS_STALLED: i64 = 1 // last beat older than threshold (the crash signal) |
| 27 | const HBS_UNKNOWN: i64 = 2 // registered but never beaten |
functions
| 29 | func hbs_streq(a: *u8, b: *u8) -> i64 |
| 37 | func hbs_at(b: *u8, pos: i64, le: i64, pat: *u8, plen: i64) -> i64 |
| 45 | func hbs_wellformed(b: *u8, ls: i64, le: i64) -> i64 |
| 62 | func hbs_field_str(b: *u8, ls: i64, le: i64, key: *u8, klen: i64, out: *u8) -> i64 |
| 81 | func hbs_field_int(b: *u8, ls: i64, le: i64, key: *u8, klen: i64) -> i64 |
| 101 | func hb_beat_s_at(path: *u8, ws_str: *u8, epoch: i64, seq: i64, actor: i64) -> i64 |
| 114 | func hb_beat_s(path: *u8, ws_str: *u8, seq: i64) -> i64 |
| 121 | func hb_last_beat_s(path: *u8, ws_str: *u8) -> i64 |
| 152 | func hbm_scan_registry(hbpath: *u8, prefix: *u8, now: i64, threshold: i64, called by 4: mainmainmainmain calls 5: sys_mmapws_manifest_phb_last_beat_ssys_read_filehbs_wellformed |