code wiki / _hdl_build / nx_collision_watchdog_gate.nx
nx_collision_watchdog_gate.nx
buildroot/runtime/_hdl_build/nx_collision_watchdog_gate.nx
about
nx_collision_watchdog_gate.nx -- WMS-M3 REFEREE: proves the collision/regression/floater WATCHDOG
raises all three failure classes correctly AND routes a known issue NAMED via recall, with the
MANDATORY negative controls (clean log + grounded ladder + novel input -> no false alarm / honest
UNKNOWN) and tampers (proving detection is real, not constant).
NO-FALSE-GREEN discipline (the law):
POSITIVE (must raise):
T1 torn-detect : an injected torn buffer (two heads on one line) -> cw_count_torn >= 1
T2 floating-detect : a synthetic lineage with node F parents "-" (not the spore) -> floating==1
T3 red-detect : a buffer with a "verdict=RED" line -> cw_count_red >= 1
T4 known-issue ROUTE: seed a hermetic catalogue with a WD-SEGV / SIGSEGV signature; feed a
diagnostic embedding SIGSEGV -> cw_route == KI_HIT AND outid == "WD-SEGV"
(NAMED, not UNKNOWN -- proves recall + routing are wired in).
NEGATIVE CONTROL (must NOT false-alarm / honest UNKNOWN):
T5 clean-log : a clean buffer (every line one head+one tail, no verdict=RED) ->
cw_count_torn==0 AND cw_count_red==0 (detector is not constant-positive)
T6 grounded-ladder : synthetic lineage where every node traces to the spore -> floating==0
T7 novel-input : a diagnostic with NO catalogued signature -> cw_route==KI_UNKNOWN,
outid filled "UNKNOWN" (genuinely novel stays legal -- no rubber-stamp)
TAMPER (proves matches are real, not constants):
T8 torn-tamper : repair the injected torn line (one head/one tail) -> cw_count_torn==0
T9 recall-tamper : corrupt the signature byte (SIGSEXV) -> cw_route==KI_UNKNOWN
GREEN iff passes==9. Evidence -> knowledge/status/collision_watchdog.log via the locked atomic
fa_appendz (the gate eats its own dogfood) AND a UNIQUE scratch path (epoch+pid) so concurrent
self-runs never collide. Flat pass-tally (avoids the LM-002 deep-nest landmine). exit 0 GREEN / 1 RED.
HERMETIC: every fixture is an in-memory buffer or a hermetic store prefix (knowledge/store/kiwdgate-)
seeded idempotently -- the gate never asserts on production state. Sovereign: only the named nx
organs + raw syscalls. license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_collision_watchdog.nxnx_seg_store.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
| 35 | const CWG_LOG: *u8 = "knowledge/status/collision_watchdog.log" |
| 36 | const KIWD_PREFIX: *u8 = "knowledge/store/kiwdgate-" |
functions
| 38 | func g_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 39 | func g_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 40 | func g_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 46 | func g_row(name: *u8, pass: i64) -> i64 |
| 53 | func g_streq_store(key: *u8, val: *u8) -> i64 |
| 67 | func g_node(idbase: i64, parbase: i64, r: i64, id: *u8, par: *u8) -> i64 |
| 73 | func main() -> i64 |