Crisis Management System
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The Crisis Management System within the TAMV MD-X4 ecosystem is a critical infrastructure component designed for automated detection, instant rollback, and auditable recovery of system state during incidents. It serves as a failsafe mechanism that ensures system integrity against fraud, data breaches, and general system failures. The system is deeply integrated with the BookPI compliance framework and the Anubis Security sentinel, providing a triple rollback capability encompassing data, configuration, and application state.
Sources: src/components/crisis/CrisisPanel.tsx:112-115, PLAN-TAMV-MODULAR.md:148-150
This system operates under the jurisdiction of the DAO-Seguridad, which defines which modules require execution within Trusted Execution Environments (TEE) and sets the frequency of security audits. It functions as a "Break Glass" protocol, transitioning the system into a controlled recovery mode when high-severity incidents are triggered.
Sources: PLAN-TAMV-MODULAR.md:162-166, src/components/crisis/CrisisPanel.tsx:82-85
Architecture and Components
The system architecture is divided into frontend reporting interfaces, backend edge functions for health monitoring, and database procedures for executing rollbacks.
Frontend Management Interface
The primary user interface is the CrisisPanel, which allows authorized personnel to report incidents and monitor the recovery history.
- Incident Reporting: Users can manually trigger a crisis by selecting a type (e.g., fraud, breach), setting a severity level, and describing affected resources.
- Crisis Logs: A real-time history of incidents, displaying severity, execution status of rollbacks, and resolution status.
Sources: src/components/crisis/CrisisPanel.tsx:24-43, src/components/crisis/CrisisPanel.tsx:142-146
Automated Monitoring and Fusion Core
The tamv-fusion-core edge function serves as an automated orchestrator. It performs parallel health checks across critical routes and database tables.
The Fusion Core checks critical tables such as profiles, posts, crisis_logs, and tcep_wallets to identify anomalies.
Sources: supabase/functions/tamv-fusion-core/index.ts:1-75
Recovery Protocol
The system follows a five-step recovery lifecycle:
- Detección Automática: Anubis Sentinel detects anomalies.
- Freeze & Snapshot: Immediate system freezing and state snapshot creation.
- Triple Rollback: Reversion of data, configuration, and application state.
- Registro BookPI: Legal evidence logging with hashing and DOI.
- Recovery & Audit: Verified recovery and exportable audit logs.
Sources: src/components/crisis/CrisisPanel.tsx:210-255
Data Model and API Integration
The system utilizes specialized database tables and RPC (Remote Procedure Call) functions to manage state.
Key Data Structures
| Field | Type | Description |
|---|---|---|
crisis_type | String | Type of incident (fraud, data_breach, system_failure, user_report) |
severity | Number (1-10) | Impact level of the crisis |
description | Text | Detailed account of the incident |
affected_resources | Array | List of resources (e.g., transaction IDs, user IDs) impacted |
rollback_executed | Boolean | Confirmation if the system reverted to a previous state |
resolved | Boolean | Indicates if the crisis has been mitigated |
Sources: src/components/crisis/CrisisPanel.tsx:24-30, src/components/crisis/CrisisPanel.tsx:173-180
Crisis Rollback Logic
The core recovery logic is triggered via the trigger_crisis_rollback RPC function.
Incident Classification
The system categorizes incidents to determine the appropriate rollback response.
| Type | Label | Icon | Severity Priority |
|---|---|---|---|
fraud | Fraude Detectado | AlertTriangle | Critical |
data_breach | Brecha de Datos | Shield | Critical |
system_failure | Fallo del Sistema | Activity | High |
user_report | Reporte de Usuario | FileWarning | Medium/Low |
Sources: src/components/crisis/CrisisPanel.tsx:24-29
Maintenance and Auditing
The system requires continuous maintenance as outlined in the TAMV Modular Plan.
- MSR Registry: Every crisis event generates a SHA-256 evidence hash stored in
msr_eventsfor auditability. - Stress Testing: The system is subjected to internal stress tests to measure UI performance under high-frequency event generation.
- CI/CD Integration: Architecture checks ensure no "hidden economy" logic exists without UI transparency, preventing unlogged financial crises.
Sources: supabase/functions/tamv-fusion-core/index.ts:113-125, TASKS-TAMV-MODULAR.md:73-77, eslint-plugin-tamv/index.js:340-350
Conclusion
The Crisis Management System is a cornerstone of the TAMV "Civilizatory" infrastructure, providing a robust defense-in-depth strategy. By combining automated monitoring via the Fusion Core with manual intervention capabilities and a mathematically verifiable audit trail via BookPI, it ensures that the ecosystem remains resilient and sovereign even under adverse conditions.
Sources: README_TAMV_COMPLETO.md:144-150, PLAN-TAMV-MODULAR.md:10-20