code wiki / (root) / nx_reclaim.nx

nx_reclaim.nx

buildroot/runtime/nx_reclaim.nx

12878 B316 linesdepth 7pulls 14 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_reclaim.nx -- composed reclamation operation. Per [[feedback-reclamation-doctrine-captain-moroni]]: the operation that turns commodity hardware (Intel ME / AMD PSP / baseband / vendor BMC) into substrate that's safe for chosen niches while hostile components remain visible+contained. THIS IS THE BRIDGE PRIMITIVE between the optimization-layer work (nx_organism / nx_symbiote / nx_treaty / nx_budget / nx_homeostasis) and the sovereignty-doctrine work (nx_attest_silicon / nx_xenocell / the 8 reclamation mitigations / the immune tier-1 primitives queued). nx_reclaim COMPOSES THEM. Given a hardware target, it: 1. Calls nx_attest_silicon to learn the chip's threat surface and applied mitigations -> computes effective trust ceiling 2. Instantiates an nx_xenocell for each known hostile component 3. Registers the xenocell with the caller-supplied organism so its observed consumption gets counted into host pressure 4. Computes a safety envelope: what's safe-for-this-chip (gameplay/content/dev) vs unsafe (secrets/identity/PII) 5. Returns the envelope so the caller can decide what cells to run on this host AND what cells to refuse Per the Captain Moroni discipline: we don't ABANDON commodity hardware (that would cede ground to vendors who profit from helplessness). We RECLAIM it for chosen niches by applying every available mitigation + making every adversarial action visible. Composes: nx_attest_silicon -- chip threat surface lookup nx_xenocell -- hostile component wrapping nx_organism -- ecosystem registration nx_budget -- per-niche budget caps from trust ceiling nx_evict_journal -- reclamation events logged V1 ships the synchronous composition. V2 will add ongoing- monitoring loops that re-evaluate the envelope when mitigations change (e.g., user disables an egress filter -> trust ceiling drops -> sovereignty-critical cells refused mid-session).

dependencies 8 imports · 2 importers

nx_syscalls.nx nx_tier.nx nx_budget.nx nx_attention_class.nx nx_evict_journal.nx nx_attest_silicon.nx nx_xenocell.nx nx_organism.nx nx_reclaim.nx nx_reclaim_test.nx nx_sovereign_compose_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_budget.nxnx_attention_class.nxnx_evict_journal.nxnx_attest_silicon.nxnx_xenocell.nxnx_organism.nx

imported by: nx_reclaim_test.nxnx_sovereign_compose_test.nx

structs

104struct NxSafetyEnvelope

consts

73const NX_RC_OK: nx_int = 0
74const NX_RC_ERR_BAD_CHIP: nx_int = 1
75const NX_RC_ERR_ORGANISM_FULL: nx_int = 2
76const NX_RC_ERR_UNSAFE_FOR_NICHE: nx_int = 3
83const NX_NICHE_GAMEPLAY: nx_int = 0
84const NX_NICHE_CONTENT_CREATION: nx_int = 1
85const NX_NICHE_DEV: nx_int = 2
86const NX_NICHE_BROWSING: nx_int = 3
87const NX_NICHE_FAMILY_COMMS: nx_int = 4
88const NX_NICHE_IDENTITY: nx_int = 5 // signing, master secrets
89const NX_NICHE_HEALTH_PII: nx_int = 6 // medical records, biometrics
90const NX_NICHE_FINANCIAL: nx_int = 7
91const NX_NICHE_N_NICHES: nx_int = 8

functions

122func nx_niche_is_valid(n: nx_int) -> nx_int
called by 1: main
135func _reclaim_safe_for_niche(trust_q10: nx_int, niche: nx_int) -> nx_int
called by 1: nx_reclaim
178func _reclaim_spawn_xenocell_for_surface(chip_family: nx_int,
called by 1: nx_reclaim calls 1: nx_xenocell_new
211func nx_reclaim(chip_family: nx_int,
306func nx_reclaim_can_run_niche(env: *NxSafetyEnvelope, niche: nx_int) -> nx_int
called by 2: mainmain