code wiki / (root) / nx_abortive.nx

nx_abortive.nx

buildroot/runtime/nx_abortive.nx

11970 B295 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_abortive.nx -- compromised-cell self-termination state machine (Tier-1 immune). Biology: bacterial abortive-infection (Abi) systems are altruistic suicide mechanisms. When a phage infects a bacterium that has an Abi system, the cell kills itself BEFORE the phage can replicate + spread to neighbors. The colony survives because the infected cell took the phage down with it. In multicellular organisms, the analogous mechanism is apoptosis -- programmed cell death of compromised, mutated, or virally-infected cells, recycled cleanly by macrophages without inflammation. Substrate equivalent: a cell that detects internal compromise (failed self-attestation, ransomware-pattern via nx_immune, sustained PAMP hits, BMS-firmware-out-of-spec, etc.) terminates itself BEFORE it can spread the compromise to peers via nx_hypha EXCHANGE_*. The germline data persists per soma/germline doctrine; the cell can be regenerated cleanly via nx_regenerate from sovereign source. Per META-CARDINAL feedback-unified-immune-architecture-three-tier: nx_abortive is the safe-shutdown primitive in the cell layer; nx_lysis is the substrate's external selective-neutralization toolkit; nx_prune is the operator-confirmed quarantine of contaminated soma. All three compose; nx_abortive is the cell's own self-honest mechanism. State machine (sealed): HEALTHY -- no compromise indicators FLAGGED -- one+ indicator surfaced, awaiting corroboration QUARANTINED -- cell stopped accepting new work; existing work drains TERMINATING -- shutdown sequence active TERMINATED -- cell stopped; germline preserved Transitions: HEALTHY -> FLAGGED (one indicator) HEALTHY -> QUARANTINED (two+ corroborated indicators) FLAGGED -> QUARANTINED (corroboration) FLAGGED -> HEALTHY (false positive cleared) QUARANTINED -> TERMINATING (drain complete OR explicit abort) TERMINATING -> TERMINATED (germline preserved + cell stopped)

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_tier.nx nx_abortive.nx nx_abortive_test.nx

imports: nx_syscalls.nxnx_tier.nx

imported by: nx_abortive_test.nx

structs

119struct NxCellAbortiveState

consts

81const NX_AB_HEALTHY: nx_int = 0
82const NX_AB_FLAGGED: nx_int = 1
83const NX_AB_QUARANTINED: nx_int = 2
84const NX_AB_TERMINATING: nx_int = 3
85const NX_AB_TERMINATED: nx_int = 4
86const NX_AB_INVALID: nx_int = 99
87const NX_AB_N_STATES: nx_int = 5
93const NX_AB_TRG_NONE: nx_int = 0
94const NX_AB_TRG_PAMP_HIT: nx_int = 1
95const NX_AB_TRG_CRISPR_HIT: nx_int = 2
96const NX_AB_TRG_METHYL_FAIL: nx_int = 3
97const NX_AB_TRG_RANSOMWARE_CONFIRMED: nx_int = 4 // emergency
98const NX_AB_TRG_OPERATOR_REQUEST: nx_int = 5
99const NX_AB_TRG_BMS_OUT_OF_SPEC: nx_int = 6
100const NX_AB_TRG_FALSE_POSITIVE_CLEAR: nx_int = 7 // revert to HEALTHY
101const NX_AB_TRG_DRAIN_COMPLETE: nx_int = 8
102const NX_AB_TRG_GERMLINE_FLUSHED: nx_int = 9
103const NX_AB_TRG_N_TRIGGERS: nx_int = 10
107const NX_AB_OK: nx_int = 0
108const NX_AB_REJECTED_INVALID_TRANSITION: nx_int = 1
109const NX_AB_REJECTED_OPERATOR_REQUIRED: nx_int = 2
110const NX_AB_N_VERDICTS: nx_int = 3
128const NX_AB_CELL_BYTES: nx_int = 40

functions

132func nx_ab_state_is_valid(s: nx_int) -> nx_int
140func nx_ab_trigger_is_valid(t: nx_int) -> nx_int
152func nx_ab_state_accepts_work(s: nx_int) -> nx_int
called by 1: main
163func nx_ab_state_is_terminal(s: nx_int) -> nx_int
called by 1: main
170func nx_ab_cell_new(cell_id: nx_int) -> *NxCellAbortiveState
called by 1: main calls 1: sys_mmap
187func _ab_transition_allowed(from: nx_int, to: nx_int) -> nx_int
called by 1: nx_ab_transition
219func _ab_trigger_is_emergency(t: nx_int) -> nx_int
232func _ab_transition_requires_operator(from: nx_int,
255func nx_ab_transition(c: *NxCellAbortiveState,
292func nx_ab_germline_invariant_holds(c: *NxCellAbortiveState) -> nx_int
called by 1: main