code wiki / _hdl_build / nx_workstream_registry_neg.nx
nx_workstream_registry_neg.nx
buildroot/runtime/_hdl_build/nx_workstream_registry_neg.nx
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
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
| 22 | const WRN_LOG: *u8 = "knowledge/status/workstream_registry_gate.log" |
| 23 | const NEGC_PREFIX: *u8 = "knowledge/store/wsnegc-" // complete store (every id has a segment) |
| 24 | const NEGM_PREFIX: *u8 = "knowledge/store/wsnegm-" // missing store (one id has NO segment) |
functions
| 26 | func 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 } |
| 27 | func wrn_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 29 | func wrn_streq(a: *u8, b: *u8) -> i64 called by 1: wrn_in_ids |
| 36 | func wrn_streq_store(prefix: *u8, key: *u8, val: *u8) -> i64 |
| 49 | func wrn_seed_one(prefix: *u8, key: *u8, val: *u8) -> i64 |
| 57 | func wrn_in_ids(ids_out: *i64, cnt: i64, tok: *u8) -> i64 |
| 63 | func wrn_row(fd: i64, name: *u8, pass: i64) -> i64 |
| 69 | func main() -> i64 |