code wiki / _hdl_build / nx_workstream_registry_gate.nx
nx_workstream_registry_gate.nx
buildroot/runtime/_hdl_build/nx_workstream_registry_gate.nx
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 3 imports · 0 importers
imports: nx_workstream_store.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
| 26 | const WRG_LOG: *u8 = "knowledge/status/workstream_registry_gate.log" |
| 27 | const WSGATE_PREFIX: *u8 = "knowledge/store/wsgate-" |
functions
| 29 | func 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 } |
| 30 | func wrg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 33 | func wrg_streq(a: *u8, b: *u8) -> i64 |
| 44 | func wrg_streq_store(key: *u8, val: *u8) -> i64 |
| 57 | func wrg_row(fd: i64, name: *u8, pass: i64) -> i64 |
| 64 | func wrg_seed_one(key: *u8, val: *u8) -> i64 |
| 73 | func wrg_in_ids(ids_out: *i64, cnt: i64, tok: *u8) -> i64 |
| 82 | func main() -> i64 |