code wiki / _hdl_build / nx_infra_control.nx

nx_infra_control.nx

buildroot/runtime/_hdl_build/nx_infra_control.nx

2715 B38 linesdepth 2pulls 2 transitivereach 5 importersview sourcekind librarytopic infra
docsdependenciesstructsconstsfunctions

about

nx_infra_control.nx -- sovereign INFRA-HOST control posture model (operator: "sovereign control of NAS / router / west-server"). Operationalizes the Trusting-Trust defense at the infra layer: a host is NOT trusted by NAME ("I am the NAS") but by BEHAVIOR matching spec, and a claim of sovereign control is REFUSED unless the control path is actually sovereign (not vendor DSM / router firmware / 3rd-party OpenSSH). Pure logic; the census is DATA (knowledge/registry/infra_hosts.tsv); the gate proves it with a liar-kill (a false-sovereign claim is caught). NO fabricated exceed -- vendor-dependence today is the honest BEHIND. license_tier: ORIGINAL Composes the trust-by-behavior law + the sovereign nx_ssh_client.

dependencies 1 imports · 3 importers

nx_syscalls.nx nx_infra_control.nx nx_host_attest.nx nx_infra_control_test.nx nx_infra_reconcile.nx

imports: nx_syscalls.nx

imported by: nx_host_attest.nxnx_infra_control_test.nxnx_infra_reconcile.nx

structs

none

consts

11const TP_NAME_TRUSTED: i64 = 1 // trusted because it claims an identity (the Thompson danger)
12const TP_BEHAVIOR_ATTESTED: i64 = 2 // trusted only by proving behavior matches spec
15const CP_VENDOR: i64 = 0 // DSM / router web UI / vendor firmware -- NOT operator-fixable
16const CP_OPENSSH: i64 = 1 // 3rd-party OpenSSH transport -- better, still not operator-owned
17const CP_SOVEREIGN: i64 = 2 // nx_ssh_client / sovereign organ -- operator-owned bits-up
20const SC_NONE: i64 = 0
21const SC_PARTIAL: i64 = 1 // sovereign organ can reach/recon; vendor still owns config/firmware
22const SC_FULL: i64 = 2 // driven end-to-end by sovereign organs, no vendor trust-root

functions

25func ic_is_sovereign(cp: i64) -> i64 { if cp == CP_SOVEREIGN { return 1 } return 0 }
called by 1: main
29func ic_false_sovereign(sc: i64, cp: i64) -> i64 { if sc == SC_FULL { if cp != CP_SOVEREIGN { return 1 } } return 0 }
32func ic_gap(tp: i64) -> i64 { if tp == TP_NAME_TRUSTED { return 1 } return 0 }
called by 1: main
35func ic_posture_clean(sc: i64, cp: i64) -> i64 { if ic_false_sovereign(sc, cp) == 1 { return 0 } return 1 }
called by 1: main calls 1: ic_false_sovereign
38func ic_coverage_permil(sovereign_hosts: i64, total: i64) -> i64 { if total == 0 { return 0 } return (sovereign_hosts * 1000) / total }
called by 1: main