code wiki / _hdl_build / nx_ttrust_lattice.nx

nx_ttrust_lattice.nx source

↩ module page · 29 lines · 2152 B

1// nx_ttrust_lattice.nx -- TRUSTING-TRUST defense coverage model across the full L0..L7 lattice (operator 2// thread "+ nishi-trusting-trust-defense"). Turns the prose "L1-L4 is the remaining void" into a measured, 3// gated fact. A layer may claim SOVEREIGN-ACTIVE defense ONLY if it has a live mechanism -- a claim of an 4// active defense with NO mechanism is the false-defense LIAR-KILL (the system refuses to credit itself a 5// defense it doesn't have, the trusting-trust discipline turned inward). NO fabricated coverage. Pure logic; 6// the lattice is DATA (knowledge/registry/ttrust_lattice.tsv). license_tier: ORIGINAL 7// Composes nx_infra_control (the L3-L4 hosts) + nx_host_attest (the L2-L4 behavioral-attestation mechanism). 8import "nx_syscalls.nx" 9 10// defense status per layer 11const DS_GAP: i64 = 0 // no live sovereign defense (the void) 12const DS_INDUSTRY_PARTIAL: i64 = 1 // a concept/partial defense; not yet full-sovereign 13const DS_SOVEREIGN_ACTIVE: i64 = 2 // a live sovereign mechanism defends this layer today 14 15// THE LIAR-KILL: a layer that claims SOVEREIGN-ACTIVE but has NO live mechanism is a false-defense claim -- 16// the system refusing to credit itself a defense it cannot DO. returns 1 if it lies. 17func tl_false_defense(status: i64, has_mechanism: i64) -> i64 { if status == DS_SOVEREIGN_ACTIVE { if has_mechanism == 0 { return 1 } } return 0 } 18 19// is this layer actively (sovereignly) defended? 20func tl_is_sovereign(status: i64) -> i64 { if status == DS_SOVEREIGN_ACTIVE { return 1 } return 0 } 21 22// is this layer an undefended GAP (part of the honest void)? 23func tl_is_gap(status: i64) -> i64 { if status == DS_GAP { return 1 } return 0 } 24 25// per-layer claim is CLEAN iff it makes no false-defense claim (gaps are honest, allowed-but-counted). 26func tl_clean(status: i64, has_mechanism: i64) -> i64 { if tl_false_defense(status, has_mechanism) == 1 { return 0 } return 1 } 27 28// sovereign-defense coverage in permil (sovereign-active layers / total). honest, no fabrication. 29func tl_coverage_permil(sovereign_layers: i64, total: i64) -> i64 { if total == 0 { return 0 } return (sovereign_layers * 1000) / total }