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

9806 B238 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic conductor
docsdependenciesstructsconstsfunctions

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

nx_heartbeat_monitor.nx nx_framed_append.nx nx_syscalls.nx nx_conductor_live_wms_gate.nx

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

main sys_openat_append sys_openat_wr sys_close spawn_all sys_mmap sys_fork good_worker sys_mmap ↻ fa_cat fa_catn sys_mmap ↻ fa_appendz fa_append sys_mmap ↻ sys_openat_append ↻ sys_flock fa_write_all sys_write sys_close ↻ fa_len bad_worker sys_openat_append ↻ sys_write ↻ bad_num sys_mmap ↻ sys_write ↻ sys_close ↻ sys_exit sys_wait4 sys_mmap ↻ count_torn sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ↻ slice_count

structs

none

consts

23const NWORKERS: i64 = 16
24const NRECS: i64 = 200
25const RECCAP: i64 = 256
26const CLG_LOG: *u8 = "knowledge/status/conductor_live_wms_gate.log"
27const GOODP: *u8 = "/tmp/clg_good.log\x00" as *u8
28const BADP: *u8 = "/tmp/clg_bad.log\x00" as *u8

functions

32func gp(fd: i64, s: *u8) -> i64
called by 1: main calls 1: sys_write
38func gn(fd: i64, v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
53func good_worker(wid: i64) -> i64
69func bad_num(fd: i64, v: i64) -> i64
called by 1: bad_worker calls 2: sys_mmapsys_write
83func bad_worker(wid: i64) -> i64
101func spawn_all(which: i64) -> i64
121func slice_count(hay: *u8, a: i64, b: i64, pat: *u8, pl: i64) -> i64
called by 1: count_torn
136func count_torn(path: *u8, outs: *i64) -> i64
167func main() -> i64