nx_recovery.nx
buildroot/runtime/nx_recovery.nx
about
nx_recovery.nx -- recovery procedure invocation.
When nx_health_check fires RED + nx_health_should_trigger_recovery
returns 1, the substrate fires nx_recovery_execute. Recovery
sequences a series of mitigations:
1. Pause new cell admission
2. nx_lysis on any confirmed-hostile xenocells
3. nx_promote any cells in ABORTIVE state
4. nx_aerobic mark stale resources for decomposition
5. Write a RED-triggered book entry (severity=ALERT)
6. Notify operator (via book unseen-alerts count)
Per [[feedback-captain-moroni-doctrine]]: recovery is DEFENSIVE.
We never attack back. We restore substrate function for the user.
Composes:
nx_health_check -- supplies the RED verdict that triggers
nx_lysis -- selective foreign-entity neutralization
nx_promote -- failover from compromised to backup cell
nx_aerobic -- decompose stale resources cleanly
nx_book -- RED transition logged as ALERT entry
dependencies 2 imports · 2 importers
imports: nx_syscalls.nxnx_tier.nx
imported by: nx_audit_compose_test.nxnx_recovery_test.nx
structs
| 43 | struct NxRecoverySession |
consts
| 26 | const NX_RC_OK: nx_int = 0 |
| 27 | const NX_RC_ERR_BAD_PHASE: nx_int = 1 |
| 28 | const NX_RC_ERR_NOT_TRIGGERED: nx_int = 2 |
| 32 | const NX_RP_NOT_STARTED: nx_int = 0 |
| 33 | const NX_RP_PAUSE_ADMISSION: nx_int = 1 |
| 34 | const NX_RP_LYSE_HOSTILE: nx_int = 2 |
| 35 | const NX_RP_PROMOTE_BACKUPS: nx_int = 3 |
| 36 | const NX_RP_DECOMPOSE_STALE: nx_int = 4 |
| 37 | const NX_RP_NOTIFY_OPERATOR: nx_int = 5 |
| 38 | const NX_RP_COMPLETE: nx_int = 6 |
| 39 | const NX_RP_N_PHASES: nx_int = 7 |
functions
| 53 | func nx_rp_is_valid(p: nx_int) -> nx_int called by 1: main |
| 59 | func nx_recovery_new(session_id: nx_int, now_us: nx_size) -> *NxRecoverySession |
| 78 | func nx_recovery_advance(r: *NxRecoverySession, now_us: nx_size) -> nx_int |
| 89 | func nx_recovery_record_lysed(r: *NxRecoverySession, n: nx_int) -> nx_int |
| 95 | func nx_recovery_record_promoted(r: *NxRecoverySession, n: nx_int) -> nx_int |
| 101 | func nx_recovery_record_composted(r: *NxRecoverySession, n: nx_int) -> nx_int |
| 107 | func nx_recovery_phase(r: *NxRecoverySession) -> nx_int called by 1: main |
| 111 | func nx_recovery_is_complete(r: *NxRecoverySession) -> nx_int |
| 116 | func nx_recovery_duration_us(r: *NxRecoverySession) -> nx_size called by 1: main |
| 127 | func nx_recovery_run_full(r: *NxRecoverySession, |