code wiki / _hdl_build / nx_heartbeat_str.nx

nx_heartbeat_str.nx

buildroot/runtime/_hdl_build/nx_heartbeat_str.nx

8159 B203 linesdepth 4pulls 5 transitivereach 14 importersview sourcekind librarytopic heartbeat
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_framed_append.nx nx_workstream_store.nx nx_heartbeat_str.nx nx_heartbeat_registry_gate.nx nx_media_ws_register.nx nx_pm_sclass.nx nx_pm_sclass_converge_gate.nx nx_pm_sclass_loop.nx nx_project_ws_register.nx nx_sclass_dispatch_gate.nx nx_sclass_flow03_gate.nx nx_survey_ws_register.nx nx_ws_board.nx

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

24const HBS_RECCAP: i64 = 256
25const HBS_ALIVE: i64 = 0 // beating within threshold
26const HBS_STALLED: i64 = 1 // last beat older than threshold (the crash signal)
27const HBS_UNKNOWN: i64 = 2 // registered but never beaten

functions

29func hbs_streq(a: *u8, b: *u8) -> i64
37func hbs_at(b: *u8, pos: i64, le: i64, pat: *u8, plen: i64) -> i64
45func hbs_wellformed(b: *u8, ls: i64, le: i64) -> i64
62func hbs_field_str(b: *u8, ls: i64, le: i64, key: *u8, klen: i64, out: *u8) -> i64
called by 1: hb_last_beat_s calls 1: hbs_at
81func hbs_field_int(b: *u8, ls: i64, le: i64, key: *u8, klen: i64) -> i64
called by 2: hb_last_beat_scv_parse calls 1: hbs_at
101func hb_beat_s_at(path: *u8, ws_str: *u8, epoch: i64, seq: i64, actor: i64) -> i64
114func hb_beat_s(path: *u8, ws_str: *u8, seq: i64) -> i64
121func hb_last_beat_s(path: *u8, ws_str: *u8) -> i64
152func hbm_scan_registry(hbpath: *u8, prefix: *u8, now: i64, threshold: i64,