code wiki / _hdl_build / nx_vault_census.nx
nx_vault_census.nx source
↩ module page · 30 lines · 2082 B
1// nx_vault_census.nx -- HONEST capability audit model: our sovereign Vault vs HashiCorp Vault (operator:
2// "audit our capabilities ... our own hashicorp nishi version of their vault"). Pure logic over the DATA
3// census (knowledge/registry/vault_capability_census.tsv). A feature may be credited HAVE/HAVE-GATED ONLY
4// with cited evidence -- a HAVE claim with NO evidence is the false-have LIAR-KILL (the system refuses to
5// credit itself a capability it can't show). NO fabricated coverage; GAP/FLAGGED/BLOCKED are honest.
6// license_tier: ORIGINAL Composes the infra-control custody (the vault holds the NAS/router/west-server creds).
7import "nx_syscalls.nx"
8
9// capability status (ordinal; HAVE-class = built-and-evidenced)
10const VS_GAP: i64 = 0 // absent
11const VS_PARTIAL: i64 = 1 // registered / partial
12const VS_HAVE: i64 = 2 // built, evidence
13const VS_HAVE_GATED: i64 = 3 // built + re-runnable gate GREEN
14const VS_FLAGGED: i64 = 4 // honestly named; needs hardware (not a software gap)
15const VS_BLOCKED: i64 = 5 // attempted; on a filed defect
16
17// is this feature genuinely a "have" (built + evidenced)? FLAGGED/BLOCKED are NOT haves.
18func vc_is_have(status: i64) -> i64 { if status == VS_HAVE { return 1 } if status == VS_HAVE_GATED { return 1 } return 0 }
19
20// is this an honest GAP (absent)?
21func vc_is_gap(status: i64) -> i64 { if status == VS_GAP { return 1 } return 0 }
22
23// THE LIAR-KILL: a feature credited as a HAVE but with NO cited evidence is a false-have claim.
24func vc_false_have(status: i64, has_evidence: i64) -> i64 { if vc_is_have(status) == 1 { if has_evidence == 0 { return 1 } } return 0 }
25
26// is this row CLEAN (no false-have claim)? gaps/flagged/blocked are honest, allowed-but-counted.
27func vc_clean(status: i64, has_evidence: i64) -> i64 { if vc_false_have(status, has_evidence) == 1 { return 0 } return 1 }
28
29// capability coverage in permil (have-class features / total). honest, no fabrication.
30func vc_coverage_permil(have: i64, total: i64) -> i64 { if total == 0 { return 0 } return (have * 1000) / total }