code wiki / _hdl_build / nx_conductor_live_wms_gate.nx
nx_conductor_live_wms_gate.nx
buildroot/runtime/_hdl_build/nx_conductor_live_wms_gate.nx
about
nx_conductor_live_wms_gate.nx -- the REFEREE for WMS LIVE-1 + LIVE-3 (conductor adoption).
LIVE-1 (conductor heartbeat): the live conductor now beats "HBX ws=1 ... END" each loop iteration
via a single locked fa_appendz (cl_hb_beat). This lane proves that heartbeat is M1-detectable:
a freshly-beaten conductor ws reads HB_ALIVE, and a conductor that stopped beating (aged beat)
reads HB_STALLED -- so a REAL crash surfaces, not just a test channel. (NEG side: STALLED proves
the detector isn't a constant-ALIVE.)
LIVE-3 (event-log torn-write kill): cl_event was 8 sequential sys_write calls to one O_APPEND fd;
it is now ONE assembled locked fa_appendz. GOOD lane = 16 workers emit the migrated cl_event shape
concurrently -> ZERO torn lines, all present. BAD lane (mandatory NEG-CONTROL) = the SAME records
emitted the OLD multi-write way -> concurrent interleave -> torn lines MUST appear. TAMPER: an
oversized record is REJECTED (-2).
A cl_event line is WELL-FORMED iff it starts "beat=" AND contains exactly one "beat=" head AND
exactly one " ms=" field token -- any interleaving duplicates/breaks those. GREEN(0) iff: good_torn==0
AND good_lines==N*NRECS AND bad_torn>0 AND tamper==-2 AND conductor ALIVE AND crashed STALLED.
Sovereign: nx_heartbeat_monitor + nx_framed_append + nx_syscalls.
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_heartbeat_monitor.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
| 23 | const NWORKERS: i64 = 16 |
| 24 | const NRECS: i64 = 200 |
| 25 | const RECCAP: i64 = 256 |
| 26 | const CLG_LOG: *u8 = "knowledge/status/conductor_live_wms_gate.log" |
| 27 | const GOODP: *u8 = "/tmp/clg_good.log\x00" as *u8 |
| 28 | const BADP: *u8 = "/tmp/clg_bad.log\x00" as *u8 |
functions
| 32 | func gp(fd: i64, s: *u8) -> i64 |
| 38 | func gn(fd: i64, v: i64) -> i64 |
| 53 | func good_worker(wid: i64) -> i64 |
| 69 | func bad_num(fd: i64, v: i64) -> i64 |
| 83 | func bad_worker(wid: i64) -> i64 |
| 101 | func spawn_all(which: i64) -> i64 |
| 121 | func slice_count(hay: *u8, a: i64, b: i64, pat: *u8, pl: i64) -> i64 called by 1: count_torn |
| 136 | func count_torn(path: *u8, outs: *i64) -> i64 |
| 167 | func main() -> i64 |