code wiki / _hdl_build / nx_workstream_registry_gate.nx

nx_workstream_registry_gate.nx

buildroot/runtime/_hdl_build/nx_workstream_registry_gate.nx

9355 B191 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic workstream
docsdependenciesstructsconstsfunctions

about

nx_workstream_registry_gate.nx -- THE REFEREE for WMS-R1 (the workstream-registry SSOT). Structural twin of nx_recall_or_red_gate: just as that proves every SEEN failure is RECALLED, THIS proves the registry is a COMPLETE, content-addressed SSOT -- every enumerated workstream is retrievable, and a lost/never-committed segment is reported MISSING (never a silent gap). A regression that lets the audit silently pass over a missing stream turns this gate RED. HERMETIC: the gate seeds its OWN test store (knowledge/store/wsgate-) with controlled T-* fixtures (NOT production claims), so enumerate/audit run over MULTIPLE rows (a real DATA-driven walk, not one hardcoded branch). Assertions (flat pass-tally, avoids the LM-002 deep-nested-if landmine): T1 register-and-enumerate : ws_manifest(wsgate-) returns exactly 3 ids = T-WS1/T-WS2/T-WS3 T2 get-correctness : ws_get_p(ws:T-WS2) -> 1, empire field == E-GAME (round-trip) T3 audit-complete-clean : ws_audit_complete_p == 0 on a complete store (audit passes clean) T4 NEG-CONTROL : ws_get_p(ws:T-NEVER-REGISTERED) -> WS_UNKNOWN(-1), honest UNKNOWN (no false hit -- twin of recall-gate T4 no-rubber-stamp) T5 TAMPER (lost segment) : append id T-WS4 to ws:ids WITHOUT committing ws:T-WS4 (a removed/ torn/lost segment) -> audit returns >=1 AND T-WS4 in missing_out (the gap is reported LOUDLY -- the durability proof) T6 PRODUCTION audit : against the live ws- prefix, ws_audit_complete()==0 and ws_manifest() count >= 12 (RED if the production seed is dropped) GREEN only if T1 .. T6 all hold. Evidence -> knowledge/status/workstream_registry_gate.log. license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_workstream_store.nx nx_seg_store.nx nx_syscalls.nx nx_gate_verdict.nx nx_workstream_registry_gate.nx

imports: nx_workstream_store.nxnx_seg_store.nxnx_syscalls.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

structs

none

consts

27const WRG_LOG: *u8 = "knowledge/status/workstream_registry_gate.log"
28const WSGATE_PREFIX: *u8 = "knowledge/store/wsgate-"

functions

30func wrg_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
31func wrg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
34func wrg_streq(a: *u8, b: *u8) -> i64
45func wrg_streq_store(key: *u8, val: *u8) -> i64
58func wrg_row(fd: i64, name: *u8, pass: i64) -> i64
65func wrg_seed_one(key: *u8, val: *u8) -> i64
74func wrg_in_ids(ids_out: *i64, cnt: i64, tok: *u8) -> i64
83func main() -> i64