code wiki / (root) / nx_security_census_lib.nx

nx_security_census_lib.nx

buildroot/runtime/nx_security_census_lib.nx

2550 B52 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind librarytopic security
docsdependenciesstructsconstsfunctions

about

nx_security_census_lib.nx -- PURE core for the SECURITY maturity census. NO main (a lib), so the census organ AND its gate import the SAME measured core and can never diverge -- the nx_ecomat_lib pattern. It carries three things the rest of the census composes on: 1. sc_have(path) -- HAVE iff a real sovereign organ opens on disk (auditor discipline, no false-green; existence != full correctness -> the per-organ gate is the ratchet). Same oracle nx_adversarial_census uses. 2. sc_weight(crit) -- WEAKEST-LINK weighting: a critical control counts SC_CRIT_W(3)x, standard 1x, so a missing CRITICAL control drags the grade hard. Encodes the "security = weakest link" maturity principle mechanically (a research-grade primitive that is BUILT-BUT-UNWIRED does not defend the live path, and must not read as coverage). 3. sc_permil(hw,tw)-- have_weight*1000/total_weight (0 if none). THE number the ecosystem-maturity rollup live-derives the `security` domain grade from. license_tier: ORIGINAL

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_security_census_lib.nx nx_security_census.nx nx_security_census_gate.nx

imports: nx_syscalls.nx

imported by: nx_security_census.nxnx_security_census_gate.nx

structs

none

consts

18const SC_SURF_WIRE: i64 = 0 // over the wire: transport, auth, crypto
19const SC_SURF_NET: i64 = 1 // in the network: host, lateral movement, tenancy
20const SC_SURF_DEV: i64 = 2 // on the device: firmware, boot, supply chain
21const SC_SURF_AI: i64 = 3 // ai-operational: the agents
24const SC_CRIT_W: i64 = 3

functions

26func sc_surf_name(s: i64) -> *u8
called by 1: sc_ax
35func sc_have(path: *u8) -> i64
called by 2: sc_axmain calls 2: sys_openat_rdsys_close
43func sc_weight(crit: i64) -> i64
called by 2: sc_axmain
49func sc_permil(have_w: i64, total_w: i64) -> i64
called by 2: mainmain