nx_abortive.nx
buildroot/runtime/nx_abortive.nx
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
imports: nx_syscalls.nxnx_tier.nx
imported by: nx_abortive_test.nx
structs
| 119 | struct NxCellAbortiveState |
consts
| 81 | const NX_AB_HEALTHY: nx_int = 0 |
| 82 | const NX_AB_FLAGGED: nx_int = 1 |
| 83 | const NX_AB_QUARANTINED: nx_int = 2 |
| 84 | const NX_AB_TERMINATING: nx_int = 3 |
| 85 | const NX_AB_TERMINATED: nx_int = 4 |
| 86 | const NX_AB_INVALID: nx_int = 99 |
| 87 | const NX_AB_N_STATES: nx_int = 5 |
| 93 | const NX_AB_TRG_NONE: nx_int = 0 |
| 94 | const NX_AB_TRG_PAMP_HIT: nx_int = 1 |
| 95 | const NX_AB_TRG_CRISPR_HIT: nx_int = 2 |
| 96 | const NX_AB_TRG_METHYL_FAIL: nx_int = 3 |
| 97 | const NX_AB_TRG_RANSOMWARE_CONFIRMED: nx_int = 4 // emergency |
| 98 | const NX_AB_TRG_OPERATOR_REQUEST: nx_int = 5 |
| 99 | const NX_AB_TRG_BMS_OUT_OF_SPEC: nx_int = 6 |
| 100 | const NX_AB_TRG_FALSE_POSITIVE_CLEAR: nx_int = 7 // revert to HEALTHY |
| 101 | const NX_AB_TRG_DRAIN_COMPLETE: nx_int = 8 |
| 102 | const NX_AB_TRG_GERMLINE_FLUSHED: nx_int = 9 |
| 103 | const NX_AB_TRG_N_TRIGGERS: nx_int = 10 |
| 107 | const NX_AB_OK: nx_int = 0 |
| 108 | const NX_AB_REJECTED_INVALID_TRANSITION: nx_int = 1 |
| 109 | const NX_AB_REJECTED_OPERATOR_REQUIRED: nx_int = 2 |
| 110 | const NX_AB_N_VERDICTS: nx_int = 3 |
| 128 | const NX_AB_CELL_BYTES: nx_int = 40 |
functions
| 132 | func nx_ab_state_is_valid(s: nx_int) -> nx_int |
| 140 | func nx_ab_trigger_is_valid(t: nx_int) -> nx_int |
| 152 | func nx_ab_state_accepts_work(s: nx_int) -> nx_int called by 1: main |
| 163 | func nx_ab_state_is_terminal(s: nx_int) -> nx_int called by 1: main |
| 170 | func nx_ab_cell_new(cell_id: nx_int) -> *NxCellAbortiveState |
| 187 | func _ab_transition_allowed(from: nx_int, to: nx_int) -> nx_int called by 1: nx_ab_transition |
| 219 | func _ab_trigger_is_emergency(t: nx_int) -> nx_int called by 1: _ab_transition_requires_operator |
| 232 | func _ab_transition_requires_operator(from: nx_int, |
| 255 | func nx_ab_transition(c: *NxCellAbortiveState, |
| 292 | func nx_ab_germline_invariant_holds(c: *NxCellAbortiveState) -> nx_int called by 1: main |