code wiki / _hdl_build / nx_workstream_registry_gate.nx

nx_workstream_registry_gate.nx

buildroot/runtime/_hdl_build/nx_workstream_registry_gate.nx

8810 B183 linesdepth 4pulls 4 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 3 imports · 0 importers

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

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

main wrg_seed_one wrg_streq_store sys_mmap ss_get sys_mmap ↻ ss_scan sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn ss_scan_seglist ss_len sys_mmap ↻ ss_cat ss_readall ss_r32 wrg_len ss_begin ss_begin_cap sys_mmap ↻ ss_add ss_add2 ss_w32 ss_len ↻ wrg_len ↻ ws_seg_next ss_next_segid sys_mmap ↻ ss_cat ↻ ss_readall ↻ ss_segid_ok ss_commit ss_segid_ok ↻ sys_mmap ↻ ss_cat ↻ ss_catn sys_mmap ↻ sys_write ss_write_seg ss_segid_ok ↻

structs

none

consts

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

functions

29func 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 }
called by 2: wrg_rowmain calls 1: sys_write
30func wrg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
33func wrg_streq(a: *u8, b: *u8) -> i64
called by 2: wrg_in_idsmain
44func wrg_streq_store(key: *u8, val: *u8) -> i64
called by 1: wrg_seed_one calls 3: sys_mmapss_getwrg_len
57func wrg_row(fd: i64, name: *u8, pass: i64) -> i64
called by 1: main calls 1: wrg_w
64func wrg_seed_one(key: *u8, val: *u8) -> i64
73func wrg_in_ids(ids_out: *i64, cnt: i64, tok: *u8) -> i64
called by 1: main calls 1: wrg_streq
82func main() -> i64