code wiki / _hdl_build / nx_collision_watchdog_gate.nx

nx_collision_watchdog_gate.nx

buildroot/runtime/_hdl_build/nx_collision_watchdog_gate.nx

13811 B271 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic collision
docsdependenciesstructsconstsfunctions

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

nx_collision_watchdog.nx nx_seg_store.nx nx_syscalls.nx nx_collision_watchdog_gate.nx

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

main sys_mmap ss_begin ss_begin_cap sys_mmap ↻ g_streq_store sys_mmap ↻ ss_get sys_mmap ↻ ss_scan sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn sys_mmap ↻ ss_cat ss_readall sys_munmap ss_scan_seglist ss_len sys_mmap ↻ ss_cat ↻ ss_readall ↻ ss_r32 g_len ss_add ss_add2 ss_w32 ss_len ↻ g_len ↻ ss_commit ss_segid_ok sys_mmap ↻ ss_cat ↻ ss_catn sys_mmap ↻ sys_write ss_write_seg ss_segid_ok ↻ sys_mmap ↻ ss_cat ↻

structs

none

consts

35const CWG_LOG: *u8 = "knowledge/status/collision_watchdog.log"
36const KIWD_PREFIX: *u8 = "knowledge/store/kiwdgate-"

functions

38func 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 }
called by 2: g_rowmain calls 1: sys_write
39func g_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: g_streq_storemain
40func g_streq(a: *u8, b: *u8) -> i64
called by 1: main
46func g_row(name: *u8, pass: i64) -> i64
called by 1: main calls 1: g_w
53func g_streq_store(key: *u8, val: *u8) -> i64
called by 1: main calls 3: sys_mmapss_getg_len
67func g_node(idbase: i64, parbase: i64, r: i64, id: *u8, par: *u8) -> i64
called by 1: main calls 1: rt_set
73func main() -> i64