code wiki / _hdl_build / nx_workstream_registry_neg.nx

nx_workstream_registry_neg.nx

buildroot/runtime/_hdl_build/nx_workstream_registry_neg.nx

5812 B124 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tooltopic workstream
docsdependenciesstructsconstsfunctions

about

nx_workstream_registry_neg.nx -- NEGATIVE-CONTROL PROOF for WMS-R1 (companion to the gate). Proves the gate's audit/neg-control machinery can ACTUALLY detect failure -- a GREEN with no working neg-control is INVALID (no-false-green law). It exercises ws_audit_complete + ws_get on two CONTRASTING hermetic stores and asserts they give DIFFERENT, correct answers: N1 complete-store-audits-0 : a store whose ws:ids ids ALL have committed segments -> audit==0. (If the audit were a constant non-zero, this FAILS -> proves the gate's T3/T5 contrast is real, not a rigged constant.) N2 missing-store-audits-1 : the SAME store + one id appended to ws:ids with NO segment -> audit==1 and that id is reported. (If the audit were a constant 0, this FAILS -> proves a lost segment is genuinely caught.) N3 false-hit-would-fail : ws_get of a never-registered id returns WS_UNKNOWN, and a committed id returns WS_FOUND -> the two are DISTINGUISHED (a ws_get that always returned 1 would collapse them). GREEN only if N1 .. N3 hold: audit returns DIFFERENT answers for complete vs missing, and get distinguishes present vs absent. 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_neg.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 sys_mmap wrn_seed_one wrn_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 wrn_len ss_begin ss_begin_cap sys_mmap ↻ ss_add ss_add2 ss_w32 ss_len ↻ wrn_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

structs

none

consts

22const WRN_LOG: *u8 = "knowledge/status/workstream_registry_gate.log"
23const NEGC_PREFIX: *u8 = "knowledge/store/wsnegc-" // complete store (every id has a segment)
24const NEGM_PREFIX: *u8 = "knowledge/store/wsnegm-" // missing store (one id has NO segment)

functions

26func wrn_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: wrn_rowmain calls 1: sys_write
27func wrn_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
29func wrn_streq(a: *u8, b: *u8) -> i64
called by 1: wrn_in_ids
36func wrn_streq_store(prefix: *u8, key: *u8, val: *u8) -> i64
called by 1: wrn_seed_one calls 3: sys_mmapss_getwrn_len
49func wrn_seed_one(prefix: *u8, key: *u8, val: *u8) -> i64
57func wrn_in_ids(ids_out: *i64, cnt: i64, tok: *u8) -> i64
called by 1: main calls 1: wrn_streq
63func wrn_row(fd: i64, name: *u8, pass: i64) -> i64
called by 1: main calls 1: wrn_w
69func main() -> i64