@ingcrea/aumic-puf 3.2.1 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/MANIFEST.es.md +12 -12
- package/MANIFEST.md +12 -12
- package/README.es.md +32 -18
- package/README.md +32 -18
- package/dist/cli/index.d.ts +3 -3
- package/dist/cli/index.js +62 -21
- package/dist/cli/index.js.map +1 -1
- package/dist/core/auto-sanador.d.ts +34 -0
- package/dist/core/auto-sanador.d.ts.map +1 -0
- package/dist/core/auto-sanador.js +257 -0
- package/dist/core/auto-sanador.js.map +1 -0
- package/dist/core/centinela-watch.d.ts +20 -0
- package/dist/core/centinela-watch.d.ts.map +1 -0
- package/dist/core/centinela-watch.js +168 -0
- package/dist/core/centinela-watch.js.map +1 -0
- package/dist/core/evaluador-caos.d.ts +11 -0
- package/dist/core/evaluador-caos.d.ts.map +1 -0
- package/dist/core/evaluador-caos.js +102 -0
- package/dist/core/evaluador-caos.js.map +1 -0
- package/dist/core/evaluador-mutacion.d.ts +16 -0
- package/dist/core/evaluador-mutacion.d.ts.map +1 -0
- package/dist/core/evaluador-mutacion.js +106 -0
- package/dist/core/evaluador-mutacion.js.map +1 -0
- package/dist/core/orquestador.d.ts.map +1 -1
- package/dist/core/orquestador.js +13 -1
- package/dist/core/orquestador.js.map +1 -1
- package/dist/core/servidor-mcp.d.ts +13 -0
- package/dist/core/servidor-mcp.d.ts.map +1 -0
- package/dist/core/servidor-mcp.js +192 -0
- package/dist/core/servidor-mcp.js.map +1 -0
- package/dist/core/types.d.ts +3 -3
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +3 -1
- package/dist/core/types.js.map +1 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -630,7 +630,7 @@ state the exclusion of warranty; and each file should have at least
|
|
|
630
630
|
the "copyright" line and a pointer to where the full notice is found.
|
|
631
631
|
|
|
632
632
|
<one line to give the program's name and a brief idea of what it does.>
|
|
633
|
-
Copyright (C)
|
|
633
|
+
Copyright (C) 2026 Ingeniería Creativa
|
|
634
634
|
|
|
635
635
|
This program is free software: you can redistribute it and/or modify
|
|
636
636
|
it under the terms of the GNU Affero General Public License as published
|
package/MANIFEST.es.md
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
<img src="https://img.shields.io/badge/version-7.0.0-crimson?style=flat-square" alt="Versión 7.0.0">
|
|
5
5
|
<img src="https://img.shields.io/badge/naturaleza-Estandar%20de%20Ingenieria%20Pura-38bdf8?style=flat-square" alt="Naturaleza">
|
|
6
|
-
<img src="https://img.shields.io/badge/suite-PUF--
|
|
6
|
+
<img src="https://img.shields.io/badge/suite-PUF--25%20Aseguramiento-gold?style=flat-square" alt="PUF-25">
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
9
|
> 🌐 **Navegación:** 🇲🇽 [Leer en Español](./MANIFEST.es.md) | 🇺🇸 [Read in English](./MANIFEST.md) | 📖 [README (ES)](./README.es.md) | 📖 [README (EN)](./README.md) | 🌌 [Estándar AUM-IC 7](https://github.com/ingcrea/aum-ic)
|
|
10
10
|
|
|
11
|
-
Este documento rige el **Paradigma de Universos Multidimensionales de Ingeniería Creativa (Estándar AUM-IC 7)** y su correspondencia operativa con la matriz de
|
|
11
|
+
Este documento rige el **Paradigma de Universos Multidimensionales de Ingeniería Creativa (Estándar AUM-IC 7)** y su correspondencia operativa con la matriz de 25 compuertas del **Protocolo Universal contra Fallos (PUF-25)**.
|
|
12
12
|
|
|
13
13
|
No es una convención arbitraria de directorios ni una sugerencia cosmética: es un marco riguroso de arquitectura, física fractal e ingeniería de software concebido para satisfacer de forma nativa los estándares internacionales de calidad de producto (**ISO/IEC 25010**), seguridad de la información (**ISO 27001**), testabilidad (**ISO 29119**) y accesibilidad web (**ISO 40500 / WCAG 2.2**).
|
|
14
14
|
|
|
@@ -49,9 +49,9 @@ Todo sistema en producción debe operar bajo 7 leyes dinámicas que rigen el flu
|
|
|
49
49
|
1. **Materia Oscura (Estado Global):** La gravedad invisible. La información global de la aplicación (Zustand, Redux, Daemons de memoria) unifica a los organismos sin acoplarlos de forma directa (*Prop Drilling* prohibido).
|
|
50
50
|
2. **Horizonte de Eventos (Seguridad Perimetral):** Frontera impenetrable. Aplica Content Security Policy (CSP), Rate Limiting estricto, challenge anti-bots y validación criptográfica de firmas JWT. Todo payload sin firma válida es repelido en el middleware.
|
|
51
51
|
3. **Campo Magnético (ORM y Sanitización):** Protege el núcleo del sistema contra radiación cósmica (inyecciones SQL y ataques XSS). Queda prohibido el SQL en texto plano sin parametrizar. La materia no se destruye arbitrariamente: se exige el **Borrado Lógico (Soft Deletes)** y el control estricto de esquemas mediante migraciones declarativas.
|
|
52
|
-
4. **El Colisionador de Hadrones (Ciclo Cerrado de Calidad PUF-
|
|
52
|
+
4. **El Colisionador de Hadrones (Ciclo Cerrado de Calidad PUF-25):** El caos no entra a producción. Antes de un release, el código debe superar la matriz de 25 compuertas de aseguramiento (**G0 a G24**), auditando desde la codificación de bytes hasta contratos de API, pruebas de mutación (G23) y resiliencia ante caos (G24).
|
|
53
53
|
5. **Agujeros de Gusano (Caché y Arquitectura Offline-First):** Supera la latencia de la red. Despliega bases de datos locales incrustadas (SQLite, Realm) en clientes Desktop/Mobile o clústeres Redis en la nube, garantizando que el sistema opere y facture aun en condiciones de desconexión.
|
|
54
|
-
6. **La Malla Cósmica (Resiliencia Distribuida):** Implementación obligatoria de **Circuit Breakers** para aislar servicios externos caídos y bucles exponenciales de reconexión (**Exponential Backoff**) para revivir enlaces a bases de datos de forma autónoma.
|
|
54
|
+
6. **La Malla Cósmica (Resiliencia Distribuida):** Implementación obligatoria de **Circuit Breakers (G24)** para aislar servicios externos caídos y bucles exponenciales de reconexión (**Exponential Backoff**) para revivir enlaces a bases de datos de forma autónoma.
|
|
55
55
|
7. **Radiación Cósmica de Fondo (Observabilidad Forense y RUM):** Toda interacción deja una huella digital determinista. Telemetría de usuario real (RUM), captura de excepciones de runtime globales, monitoreo de 404s y despacho inmediato de alertas al centro de comando.
|
|
56
56
|
|
|
57
57
|
---
|
|
@@ -78,28 +78,28 @@ Un asteroide obedece las mismas leyes fundamentales que una galaxia; sin embargo
|
|
|
78
78
|
|
|
79
79
|
---
|
|
80
80
|
|
|
81
|
-
## MATRIZ DE CORRESPONDENCIA: AUM-IC 7 vs. PUF-
|
|
81
|
+
## MATRIZ DE CORRESPONDENCIA: AUM-IC 7 vs. PUF-25
|
|
82
82
|
|
|
83
|
-
| Fuerza Cósmica AUM-IC | Compuertas PUF-
|
|
83
|
+
| Fuerza Cósmica AUM-IC | Compuertas PUF-25 que la Certifican | Objetivo Operativo |
|
|
84
84
|
| :--- | :--- | :--- |
|
|
85
85
|
| **Higiene Fundamental** | **`G0`**, **`G8`**, **`G22`** | Codificación UTF-8 pura, saltos LF, erradicación de mojibake y balanceo universal de delimitadores. |
|
|
86
|
-
| **Colisionador de Hadrones** | **`G2`**, **`G3`**, **`G5`**, **`G6`** | Ciclo rojo/verde de tests, snapshots SHA-256 de reversión
|
|
86
|
+
| **Colisionador de Hadrones** | **`G2`**, **`G3`**, **`G5`**, **`G6`**, **`G23`** | Ciclo rojo/verde de tests, snapshots SHA-256 de reversión, rigor estático y resistencia a mutaciones lógicas. |
|
|
87
87
|
| **Campo Magnético** | **`G4`**, **`G19`**, **`G21`** | Refactor limpio, cero inyecciones SQL, erradicación de secretos y compliance estricto WordPress/WooCommerce. |
|
|
88
88
|
| **Horizonte de Eventos** | **`G9`**, **`G17`**, **`G20`** | Permisos POSIX restrictivos, consistencia de licencias y aislamiento de entornos (cero localhost en producción). |
|
|
89
89
|
| **Gravedad Cero y Estructura** | **`G1`**, **`G11`**, **`G18`** | Desacoplamiento de hilos UI, cero robo de foco (`CREATE_NO_WINDOW`) y coexistencia limpia de motores CSS. |
|
|
90
|
-
| **Malla Cósmica y
|
|
90
|
+
| **Malla Cósmica y Resiliencia** | **`G12`**, **`G13`**, **`G14`**, **`G24`** | Cero enlaces 404, erradicación de botones zombies, contratos API y tolerancia a caos de red (Circuit Breakers). |
|
|
91
91
|
| **Radiación de Fondo** | **`G7`**, **`G10`**, **`G15`**, **`G16`** | Registro ADR en `BITACORA.md`, purga de cachés corruptas, pruebas E2E y Core Web Vitals. |
|
|
92
92
|
|
|
93
93
|
---
|
|
94
94
|
|
|
95
95
|
## GLOSARIO TÁCTICO: EL PORQUÉ DE LAS REGLAS
|
|
96
96
|
|
|
97
|
-
* **¿Por qué
|
|
98
|
-
|
|
97
|
+
* **¿Por qué auditar la Resistencia a Mutaciones (G23)?**
|
|
98
|
+
Una suite con 100% de cobertura que no falla cuando un operador se invierte es una ilusión de seguridad. G23 verifica que las aserciones validen lógica de estado real y no existan tests complacientes.
|
|
99
|
+
* **¿Por qué inyectar Caos y Disyuntores de Red (G24)?**
|
|
100
|
+
En un sistema distribuido, las caídas no son una excepción sino una certeza matemática. G24 audita que el cliente no se quede bloqueado indefinidamente esperando una respuesta de red, forzando timeouts y disyuntores.
|
|
99
101
|
* **¿Por qué capturar Checkpoints inmutables con SHA-256 (G3)?**
|
|
100
102
|
Toda modificación de código sin respaldo verificado introduce riesgo de entropía irreversible. Un checkpoint criptográfico asegura que cualquier intento fallido de reparación pueda colapsarse y revertirse al estado exacto previo al fallo.
|
|
101
|
-
* **¿Por qué destruir listeners y desacoplar temporizadores (G1 y G11)?**
|
|
102
|
-
Un proceso en segundo plano, worker o websocket que no se destruye explícitamente se convierte en un objeto errante que consume memoria RAM de forma indefinida (Memory Leak), provocando bloqueos en el sistema operativo y degradando la ergonomía del usuario.
|
|
103
103
|
|
|
104
104
|
---
|
|
105
105
|
|
package/MANIFEST.md
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
<img src="https://img.shields.io/badge/version-7.0.0-crimson?style=flat-square" alt="Version 7.0.0">
|
|
5
5
|
<img src="https://img.shields.io/badge/nature-Pure%20Engineering%20Standard-38bdf8?style=flat-square" alt="Nature">
|
|
6
|
-
<img src="https://img.shields.io/badge/suite-PUF--
|
|
6
|
+
<img src="https://img.shields.io/badge/suite-PUF--25%20Assurance-gold?style=flat-square" alt="PUF-25">
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
9
|
> 🌐 **Navigation:** 🇺🇸 [Read in English](./MANIFEST.md) | 🇲🇽 [Leer en Español](./MANIFEST.es.md) | 📖 [README (EN)](./README.md) | 📖 [README (ES)](./README.es.md) | 🌌 [AUM-IC 7 Standard](https://github.com/ingcrea/aum-ic)
|
|
10
10
|
|
|
11
|
-
This document governs the **Multidimensional Universe Architecture Paradigm (AUM-IC 7 Standard)** and its operational correspondence with the
|
|
11
|
+
This document governs the **Multidimensional Universe Architecture Paradigm (AUM-IC 7 Standard)** and its operational correspondence with the 25-gate matrix of the **Universal Failure Prevention Protocol (PUF-25)**.
|
|
12
12
|
|
|
13
13
|
It is neither an arbitrary folder recommendation nor a cosmetic convention: it is a deterministic framework of architecture, fractal symmetry, and software physics engineered to inherently satisfy international product quality (**ISO/IEC 25010**), information security (**ISO 27001**), testability (**ISO 29119**), and web accessibility standards (**ISO 40500 / WCAG 2.2**).
|
|
14
14
|
|
|
@@ -49,9 +49,9 @@ Every production system must enforce 7 dynamic laws governing data flow and runt
|
|
|
49
49
|
1. **Dark Matter (Global State):** The invisible gravitational bond. Global application state (Zustand, Redux, background memory daemons) connects organisms without toxic coupling (*Prop Drilling is strictly forbidden*).
|
|
50
50
|
2. **Event Horizon (Perimeter Security):** The impenetrable boundary. Enforces strict Content Security Policy (CSP), rate limiting, bot challenges, and cryptographic JWT verification. Any payload lacking a valid spectral signature is rejected at the middleware gateway.
|
|
51
51
|
3. **Magnetic Field (ORM & Sanitization):** Shields the system core against cosmic radiation (SQL Injections and XSS attacks). Raw unparameterized SQL strings are banned. Matter cannot be arbitrarily destroyed: **Soft Deletes** and declarative schema migrations are mandatory.
|
|
52
|
-
4. **The Hadron Collider (PUF-
|
|
52
|
+
4. **The Hadron Collider (PUF-25 Closed-Loop Assurance):** Chaos does not enter production. Prior to any release, code must clear the 25-gate matrix (**G0 to G24**), auditing everything from raw byte hygiene to API contracts, mutation testing resilience (G23), and chaos fault injection (G24).
|
|
53
53
|
5. **Wormholes (Cache & Offline-First Architecture):** Defeats network latency. Employs embedded local databases (SQLite, Realm) in desktop/mobile apps or distributed Redis clusters in cloud backends, guaranteeing uninterrupted operation and transactional capability during network dropouts.
|
|
54
|
-
6. **The Cosmic Web (Distributed Resilience):** Implements **Circuit Breakers** to isolate failing upstream dependencies and **Exponential Backoff Reconnect Loops** to revive degraded database connections autonomously.
|
|
54
|
+
6. **The Cosmic Web (Distributed Resilience):** Implements **Circuit Breakers (G24)** to isolate failing upstream dependencies and **Exponential Backoff Reconnect Loops** to revive degraded database connections autonomously.
|
|
55
55
|
7. **Cosmic Microwave Background (Forensic Observability & RUM):** Every user action leaves a forensic signature. Real User Monitoring (RUM), global runtime exception traps, 404 tracking, and immediate alerting dispatch to the incident response center.
|
|
56
56
|
|
|
57
57
|
---
|
|
@@ -78,28 +78,28 @@ An asteroid obeys the exact same gravitational laws as a galaxy; however, archit
|
|
|
78
78
|
|
|
79
79
|
---
|
|
80
80
|
|
|
81
|
-
## MAPPING MATRIX: AUM-IC 7 vs. PUF-
|
|
81
|
+
## MAPPING MATRIX: AUM-IC 7 vs. PUF-25
|
|
82
82
|
|
|
83
|
-
| Cosmic Force (AUM-IC) | Certifying PUF-
|
|
83
|
+
| Cosmic Force (AUM-IC) | Certifying PUF-25 Gates | Operational Objective |
|
|
84
84
|
| :--- | :--- | :--- |
|
|
85
85
|
| **Fundamental Hygiene** | **`G0`**, **`G8`**, **`G22`** | Pure UTF-8 encoding, LF line endings, mojibake eradication, and universal delimiter balance. |
|
|
86
|
-
| **Hadron Collider** | **`G2`**, **`G3`**, **`G5`**, **`G6`** | Red/Green test cycle, SHA-256 rollback snapshots,
|
|
86
|
+
| **Hadron Collider** | **`G2`**, **`G3`**, **`G5`**, **`G6`**, **`G23`** | Red/Green test cycle, SHA-256 rollback snapshots, strict static analysis, and mutation test resilience. |
|
|
87
87
|
| **Magnetic Field** | **`G4`**, **`G19`**, **`G21`** | Pure logic refactor, zero SQL injection, secret purge, and WordPress/WooCommerce compliance. |
|
|
88
88
|
| **Event Horizon** | **`G9`**, **`G17`**, **`G20`** | POSIX permissions, license integrity, and environment isolation (zero localhost in production). |
|
|
89
89
|
| **Zero Gravity & Layout** | **`G1`**, **`G11`**, **`G18`** | UI thread decoupling, zero-focus stealing (`CREATE_NO_WINDOW`), and clean styling engine consistency. |
|
|
90
|
-
| **Cosmic Web &
|
|
90
|
+
| **Cosmic Web & Resilience** | **`G12`**, **`G13`**, **`G14`**, **`G24`** | Dead link eradication (no 404s), zombie UI action removal, HTTP contracts, and chaos fault isolation. |
|
|
91
91
|
| **Background Radiation** | **`G7`**, **`G10`**, **`G15`**, **`G16`** | ADR logging in `BITACORA.md`, stale cache flushes, E2E validation, and Core Web Vitals audit. |
|
|
92
92
|
|
|
93
93
|
---
|
|
94
94
|
|
|
95
95
|
## TACTICAL GLOSSARY: THE "WHY" BEHIND THE RULES
|
|
96
96
|
|
|
97
|
-
* **Why
|
|
98
|
-
|
|
97
|
+
* **Why audit Mutation Testing Resilience (G23)?**
|
|
98
|
+
High test coverage with empty or tautological assertions is a dangerous illusion. G23 enforces that assertions genuinely evaluate state deviations, ensuring mutants are actively killed.
|
|
99
|
+
* **Why audit Chaos Fault Injection and Circuit Breakers (G24)?**
|
|
100
|
+
In distributed software, remote API and database delays are mathematically inevitable. G24 verifies that network queries include timeouts and circuit breakers, preventing whole-system lockups.
|
|
99
101
|
* **Why capture immutable SHA-256 checkpoints (G3)?**
|
|
100
102
|
Modifying code without verified checkpoints introduces irreversible entropy. An atomic cryptographic snapshot guarantees that any failed remediation step can be immediately collapsed and restored.
|
|
101
|
-
* **Why terminate listeners and decouple UI timers (G1 and G11)?**
|
|
102
|
-
Background daemons or WebSockets left running without lifecycle bounds become rogue objects leaking memory RAM indefinitely, causing system freezing and ruining desktop ergonomics.
|
|
103
103
|
|
|
104
104
|
---
|
|
105
105
|
|
package/README.es.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# AUM-IC PUF — Protocolo Universal contra Fallos (PUF-
|
|
1
|
+
# AUM-IC PUF — Protocolo Universal contra Fallos (PUF-25)
|
|
2
2
|
|
|
3
3
|
[](LICENSE)
|
|
4
4
|
[](https://github.com/ingcrea/aum-ic)
|
|
5
|
-
[](https://www.npmjs.com/package/@ingcrea/aumic-puf)
|
|
6
6
|
|
|
7
7
|
> 🌐 **Navegación:** 🇲🇽 [Leer en Español](./README.es.md) | 🇺🇸 [Read in English](./README.md) | 📜 [Manifiesto (ES)](./MANIFEST.es.md) | 📜 [Manifesto (EN)](./MANIFEST.md) | 🌌 [Estándar AUM-IC 7](https://github.com/ingcrea/aum-ic)
|
|
8
8
|
|
|
9
|
-
Suite oficial de aseguramiento determinista de calidad y orquestador multi-lenguaje de
|
|
9
|
+
Suite oficial de aseguramiento determinista de calidad y orquestador multi-lenguaje de 25 compuertas (G0 a G24) bajo el estándar **AUM-IC 7:2026**, diseñado y mantenido por **Ingeniería Creativa (IngCrea)**.
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -16,16 +16,20 @@ El Protocolo Universal contra Fallos (PUF) no es un linter superficial ni una co
|
|
|
16
16
|
|
|
17
17
|
Opera de forma agnóstica a través de adaptadores especializados para **Rust, TypeScript/JavaScript, Astro, Next.js, Python, PHP, Java/JVM, C#, C/C++, Flutter/Dart y Shell**, garantizando cumplimiento riguroso con normativas internacionales de fiabilidad (**ISO/IEC 25010**), seguridad de la información (**ISO 27001**) y testabilidad (**ISO 29119**).
|
|
18
18
|
|
|
19
|
-
### Características Clave del Motor v3.
|
|
19
|
+
### Características Clave del Motor v3.4.0
|
|
20
20
|
|
|
21
|
-
* **
|
|
21
|
+
* **Auto-Sanador Quirúrgico (`puf sanar` / `puf fix`):** Remediación determinista automatizada de anomalías en G0, G8, G17, G20 y G22, asegurando respaldos inmutables G3 previos con hash SHA-256 antes de cada mutación.
|
|
22
|
+
* **Modo Centinela Dual (`puf watch`):** Vigilancia reactiva en caliente que reporta en consola ANSI y despacha notificaciones Toast nativas en el sistema operativo sin robar foco de ventana (cumplimiento ergonómico G11).
|
|
23
|
+
* **Servidor MCP Nativo (`puf serve` / `puf mcp`):** Protocolo Model Context Protocol por stdio (JSON-RPC) para integración directa con asistentes de IA (Antigravity, Claude, Cursor) sin latencia de subprocesos.
|
|
24
|
+
* **Snapshot VFS en Memoria (`LectorArbolProyecto`):** Mapeo virtual del sistema de archivos con caché volátil estructurado. Permite que las 25 compuertas analicen el repositorio de forma concurrente sin provocar saturación de I/O en disco.
|
|
22
25
|
* **Persistencia Forense Indexada (`RepositorioSqliteAudit`):** Almacenamiento nativo en SQLite (`.aumic/puf_audit.sqlite`) de cada ejecución, registrando métricas de latencia, violaciones detectadas y telemetría histórica con tiempos de consulta inferiores a 20 ms.
|
|
26
|
+
* **Testing Avanzado Integrado:** Incorpora pruebas de resistencia a mutaciones (G23) e inyección de caos con validación de disyuntores de red (G24).
|
|
23
27
|
* **Perfiles Dinámicos de Auditoría (`--profile`):** Flexibilidad de inspección según el ciclo de entrega (`enterprise`, `mvp`, `dev`, `security`).
|
|
24
28
|
* **Zero-Black-Box Telemetry:** Reportes forenses interactivos en HTML (`puf-report.html`) con diagramas SVG gauge, tarjetas KPI de impacto y trazabilidad exacta de archivo y línea.
|
|
25
29
|
|
|
26
30
|
---
|
|
27
31
|
|
|
28
|
-
## Matriz Exhaustiva de las
|
|
32
|
+
## Matriz Exhaustiva de las 25 Compuertas de Calidad (G0 a G24)
|
|
29
33
|
|
|
30
34
|
### G0: Higiene Forense Anti-Entropía y Codificación Pura (In-Process Sanitizer)
|
|
31
35
|
* **Para qué sirve:** Garantiza que ningún byte corrupto, BOM invisible o secuencia de caracteres rotos ingrese al flujo de desarrollo.
|
|
@@ -37,7 +41,7 @@ Opera de forma agnóstica a través de adaptadores especializados para **Rust, T
|
|
|
37
41
|
|
|
38
42
|
### G2: Test de Reproducción — Fase Roja (Reproduction Test-First)
|
|
39
43
|
* **Para qué sirve:** Erradica correcciones a ciegas y asunciones subjetivas al resolver anomalías.
|
|
40
|
-
* **Qué hace:** Exige la existencia o creación previa de una prueba automatizada (unitaria, funcional o
|
|
44
|
+
* **Qué hace:** Exige la existencia o creación previa de una prueba automatizada (unitaria, funcional o basada en propiedades) que replique con fidelidad el defecto reportado. El motor verifica que el test falle inequívocamente contra el código base actual (*Estado Rojo*) antes de permitir cualquier mutación de lógica.
|
|
41
45
|
|
|
42
46
|
### G3: Checkpoint Inmutable de Estado (State Snapshot Guard)
|
|
43
47
|
* **Para qué sirve:** Otorga inmunidad frente a pérdidas de código o regresiones destructivas durante una reparación.
|
|
@@ -137,6 +141,16 @@ Opera de forma agnóstica a través de adaptadores especializados para **Rust, T
|
|
|
137
141
|
* Audita la integridad de archivos JSON (detectando comas faltantes o trailing commas no permitidas).
|
|
138
142
|
* Evalúa el balanceo perfecto de delimitadores (`{ }`, `[ ]`, `( )`), ignorando inteligentemente literales de cadenas, comentarios y expresiones regulares para reportar la línea precisa de cualquier desbalance.
|
|
139
143
|
|
|
144
|
+
### G23: Resistencia a Mutaciones y Aserciones Vacías (Mutation Resilience Guard)
|
|
145
|
+
* **Para qué sirve:** Erradica el falso confort de suites con 100% de cobertura que no tienen capacidad real de atrapar fallos lógicos.
|
|
146
|
+
* **Qué hace:** Audita la efectividad de las pruebas evaluando si las aserciones son vacías, complacientes o tautológicas (`expect(true).toBe(true)`). Comprueba que los tests sometan el código a validaciones de estado reales que fallen obligatoriamente si un operador lógico, aritmético o de bifurcación es alterado en la lógica intervenida.
|
|
147
|
+
|
|
148
|
+
### G24: Inyección de Caos, Disyuntores y Auto-Sanación (Chaos & Fault Injection Guard)
|
|
149
|
+
* **Para qué sirve:** Garantiza que la aplicación sobreviva a la latencia extrema, micro-cortes y caídas de servicios externos sin colapsar el sistema operativo ni el proceso principal.
|
|
150
|
+
* **Qué hace:** Inspecciona la arquitectura de transporte HTTP y conexiones a bases de datos en busca de vulnerabilidades ante fallas de red:
|
|
151
|
+
* Detecta invocaciones cliente sin timeouts explícitos ni señales de aborto (`AbortController`).
|
|
152
|
+
* Verifica la implementación de **Disyuntores (Circuit Breakers)** y bucles de reintento con retroceso exponencial (**Exponential Backoff**) para aislar dependencias degradadas y permitir la auto-recuperación sin intervención humana.
|
|
153
|
+
|
|
140
154
|
---
|
|
141
155
|
|
|
142
156
|
## Perfiles Dinámicos de Auditoría (`--profile`)
|
|
@@ -145,10 +159,10 @@ Para optimizar pipelines de integración continua o verificaciones rápidas ante
|
|
|
145
159
|
|
|
146
160
|
| Perfil | Compuertas Evaluadas | Caso de Uso |
|
|
147
161
|
| :--- | :--- | :--- |
|
|
148
|
-
| **`enterprise`** *(Predeterminado)* | **G0 a
|
|
162
|
+
| **`enterprise`** *(Predeterminado)* | **G0 a G24 (25 compuertas)** | Certificación integral obligatoria previa a releases y despliegues productivos. |
|
|
149
163
|
| **`mvp`** | `G0`, `G4`, `G6`, `G8`, `G22` | Verificación ágil de prototipos rápidos: higiene, lógica limpia, tipado estricto y sintaxis. |
|
|
150
164
|
| **`dev`** | `G0`, `G4`, `G6`, `G8`, `G22` | Ciclo de desarrollo local ultrarrápido sin bloqueos por suites accesorias. |
|
|
151
|
-
| **`security`** | `G0`, `G8`, `G9`, `G17`, `G19`, `G20` | Auditoría de ciberseguridad, permisos POSIX, blindaje legal, topología y
|
|
165
|
+
| **`security`** | `G0`, `G8`, `G9`, `G17`, `G19`, `G20`, `G24` | Auditoría de ciberseguridad, permisos POSIX, blindaje legal, topología, cero inyecciones y resiliencia ante caos. |
|
|
152
166
|
|
|
153
167
|
---
|
|
154
168
|
|
|
@@ -168,7 +182,7 @@ npx @ingcrea/aumic-puf auditar
|
|
|
168
182
|
|
|
169
183
|
#### 1. Auditoría Completa de la Matriz (Enterprise)
|
|
170
184
|
```bash
|
|
171
|
-
# Audita las
|
|
185
|
+
# Audita las 25 compuertas de calidad concurrentemente en el directorio actual
|
|
172
186
|
puf auditar
|
|
173
187
|
|
|
174
188
|
# Ejecución fail-fast (aborta de inmediato al primer fallo detectado)
|
|
@@ -180,7 +194,7 @@ puf auditar --fast
|
|
|
180
194
|
# Auditoría rápida para entornos de desarrollo local
|
|
181
195
|
puf auditar --profile=dev
|
|
182
196
|
|
|
183
|
-
# Auditoría estricta de seguridad perimetral
|
|
197
|
+
# Auditoría estricta de seguridad perimetral y resiliencia
|
|
184
198
|
puf auditar --profile=security
|
|
185
199
|
|
|
186
200
|
# Auditoría ligera de entrega rápida (MVP)
|
|
@@ -189,20 +203,20 @@ puf auditar --profile=mvp
|
|
|
189
203
|
|
|
190
204
|
#### 3. Auditoría Focalizada por Compuertas
|
|
191
205
|
```bash
|
|
192
|
-
# Evalúa
|
|
193
|
-
puf auditar -g
|
|
206
|
+
# Evalúa mutaciones, resiliencia ante caos y compliance WordPress
|
|
207
|
+
puf auditar -g G21,G23,G24
|
|
194
208
|
|
|
195
|
-
# Evalúa
|
|
196
|
-
puf auditar -g
|
|
209
|
+
# Evalúa higiene forense y sintaxis universal
|
|
210
|
+
puf auditar -g G0,G8,G22
|
|
197
211
|
```
|
|
198
212
|
|
|
199
213
|
#### 4. Gestión de Incidentes y Reversión Atómica
|
|
200
214
|
```bash
|
|
201
215
|
# Inicia un incidente (genera andamio de test G2 y captura checkpoint inmutable G3)
|
|
202
|
-
puf iniciar INC-
|
|
216
|
+
puf iniciar INC-105 "Blindaje de resiliencia en pasarela" src/checkout.ts
|
|
203
217
|
|
|
204
218
|
# Reversión de emergencia a partir del checkpoint SHA-256 en caso de error
|
|
205
|
-
puf revertir INC-
|
|
219
|
+
puf revertir INC-105 src/checkout.ts
|
|
206
220
|
```
|
|
207
221
|
|
|
208
222
|
#### 5. Blindaje de Repositorio Git (Pre-commit Hook)
|
|
@@ -228,7 +242,7 @@ puf --version
|
|
|
228
242
|
El repositorio incluye la plantilla oficial [`puf-github-action.yml`](puf-github-action.yml). Para blindar cualquier repositorio en GitHub:
|
|
229
243
|
|
|
230
244
|
```yaml
|
|
231
|
-
name: Certificación AUM-IC PUF-
|
|
245
|
+
name: Certificación AUM-IC PUF-25
|
|
232
246
|
on: [push, pull_request]
|
|
233
247
|
|
|
234
248
|
jobs:
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# AUM-IC PUF — Universal Failure Prevention Protocol (PUF-
|
|
1
|
+
# AUM-IC PUF — Universal Failure Prevention Protocol (PUF-25)
|
|
2
2
|
|
|
3
3
|
[](LICENSE)
|
|
4
4
|
[](https://github.com/ingcrea/aum-ic)
|
|
5
|
-
[](https://www.npmjs.com/package/@ingcrea/aumic-puf)
|
|
6
6
|
|
|
7
7
|
> 🌐 **Navigation:** 🇺🇸 [Read in English](./README.md) | 🇲🇽 [Leer en Español](./README.es.md) | 📜 [Manifesto (EN)](./MANIFEST.md) | 📜 [Manifiesto (ES)](./MANIFEST.es.md) | 🌌 [AUM-IC 7 Standard](https://github.com/ingcrea/aum-ic)
|
|
8
8
|
|
|
9
|
-
Official deterministic quality assurance engine and
|
|
9
|
+
Official deterministic quality assurance engine and 25-gate universal multi-language orchestrator (G0 to G24) implementing the **AUM-IC 7:2026 Standard**, engineered and maintained by **Ingeniería Creativa (IngCrea)**.
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -16,16 +16,20 @@ The Universal Failure Prevention Protocol (PUF) is not a surface-level linter or
|
|
|
16
16
|
|
|
17
17
|
Operating agnostically via specialized language adapters for **Rust, TypeScript/JavaScript, Astro, Next.js, Python, PHP, Java/JVM, C#, C/C++, Flutter/Dart, and Shell**, it enforces compliance with international reliability (**ISO/IEC 25010**), information security (**ISO 27001**), and testability (**ISO 29119**) benchmarks.
|
|
18
18
|
|
|
19
|
-
### Key Engine Features in v3.
|
|
19
|
+
### Key Engine Features in v3.4.0
|
|
20
20
|
|
|
21
|
-
* **
|
|
21
|
+
* **Deterministic Surgical Auto-Fix (`puf sanar` / `puf fix`):** Automated deterministic resolution for G0, G8, G17, G20, and G22 violations, creating immutable G3 checkpoints with SHA-256 hashes prior to mutating files.
|
|
22
|
+
* **Dual Watch Sentinel (`puf watch`):** Reactive filesystem listener reporting both in ANSI terminal and native non-intrusive OS toast notifications (G11 ergonomic compliance).
|
|
23
|
+
* **Native MCP Server (`puf serve` / `puf mcp`):** Built-in Model Context Protocol server over stdio (JSON-RPC) enabling seamless, zero-latency integration with AI agents (Antigravity, Claude, Cursor).
|
|
24
|
+
* **In-Memory VFS Snapshot (`LectorArbolProyecto`):** Structured volatile filesystem snapshot caching. Enables all 25 gates to evaluate project structure and code concurrently with zero disk I/O bottleneck.
|
|
22
25
|
* **Indexed Forensic Persistence (`RepositorioSqliteAudit`):** Native SQLite engine persistence (`.aumic/puf_audit.sqlite`) recording execution latency, identified infractions, and historical audit telemetry with sub-20ms query overhead.
|
|
26
|
+
* **Integrated Advanced Testing:** Incorporates Mutation Resilience Verification (G23) and Chaos Fault Injection with Circuit Breaker inspection (G24).
|
|
23
27
|
* **Dynamic Audit Profiles (`--profile`):** Adaptable gate execution matching pipeline requirements (`enterprise`, `mvp`, `dev`, `security`).
|
|
24
28
|
* **Zero-Black-Box Telemetry:** Comprehensive HTML forensic dashboard (`puf-report.html`) complete with SVG compliance gauges, key impact KPI tiles, and pinpointed line-by-line violation reports.
|
|
25
29
|
|
|
26
30
|
---
|
|
27
31
|
|
|
28
|
-
## Comprehensive Matrix of Quality Gates (G0 to
|
|
32
|
+
## Comprehensive Matrix of Quality Gates (G0 to G24)
|
|
29
33
|
|
|
30
34
|
### G0: Forensic Anti-Entropy & Encoding Hygiene (In-Process Sanitizer)
|
|
31
35
|
* **Purpose:** Ensures zero corrupted bytes, phantom BOM markers, or invalid character sequences enter development streams.
|
|
@@ -37,7 +41,7 @@ Operating agnostically via specialized language adapters for **Rust, TypeScript/
|
|
|
37
41
|
|
|
38
42
|
### G2: Reproduction Test-First — Red Phase (Reproduction Test-First)
|
|
39
43
|
* **Purpose:** Prevents guesswork and subjective speculation during defect resolution.
|
|
40
|
-
* **What it does:** Mandates the presence or authoring of an automated test (unit, integration, or
|
|
44
|
+
* **What it does:** Mandates the presence or authoring of an automated test (unit, integration, or property-based) faithfully reproducing the reported flaw. Verifies that the test unmistakably fails against the current codebase (*Red State*) before any production code modification is allowed.
|
|
41
45
|
|
|
42
46
|
### G3: Immutable State Checkpoint (State Snapshot Guard)
|
|
43
47
|
* **Purpose:** Delivers immunity against destructive regressions or data loss during bug mitigation.
|
|
@@ -137,6 +141,16 @@ Operating agnostically via specialized language adapters for **Rust, TypeScript/
|
|
|
137
141
|
* Audits JSON integrity (detecting unescaped structures, missing commas, or trailing commas).
|
|
138
142
|
* Evaluates perfect bracket balance (`{ }`, `[ ]`, `( )`), smartly ignoring strings, inline comments, and regular expression literals to pinpoint the exact line of any imbalance.
|
|
139
143
|
|
|
144
|
+
### G23: Mutation Resilience & Assertions Verification (Mutation Resilience Guard)
|
|
145
|
+
* **Purpose:** Eradicates the illusion of safety provided by high coverage test suites lacking assertion power.
|
|
146
|
+
* **What it does:** Audits test effectiveness by detecting vacuous, complacently passed, or tautological assertions (`expect(true).toBe(true)`). Verifies that tests enforce genuine state contracts capable of catching mutant logic deviations if operators are inverted in production code.
|
|
147
|
+
|
|
148
|
+
### G24: Chaos Fault Injection & Circuit Breakers (Chaos & Fault Injection Guard)
|
|
149
|
+
* **Purpose:** Ensures distributed microservices and database clients survive high network latency and intermittent outages without process deadlock.
|
|
150
|
+
* **What it does:** Audits client HTTP transport and database connections for resilience engineering patterns:
|
|
151
|
+
* Detects unbound fetch calls lacking abort timeouts or explicit `AbortController` signals.
|
|
152
|
+
* Validates the integration of **Circuit Breakers** and **Exponential Backoff Reconnect Loops** to isolate degraded downstream dependencies without human intervention.
|
|
153
|
+
|
|
140
154
|
---
|
|
141
155
|
|
|
142
156
|
## Dynamic Audit Profiles (`--profile`)
|
|
@@ -145,10 +159,10 @@ To accelerate continuous integration pipelines and local pre-commit cycles, PUF
|
|
|
145
159
|
|
|
146
160
|
| Profile | Evaluated Gates | Primary Use Case |
|
|
147
161
|
| :--- | :--- | :--- |
|
|
148
|
-
| **`enterprise`** *(Default)* | **G0 through
|
|
162
|
+
| **`enterprise`** *(Default)* | **G0 through G24 (All 25 Gates)** | Complete gate certification required prior to production release or distribution. |
|
|
149
163
|
| **`mvp`** | `G0`, `G4`, `G6`, `G8`, `G22` | Rapid proof-of-concept audit: forensic hygiene, pure logic, strict static checks, and syntax. |
|
|
150
164
|
| **`dev`** | `G0`, `G4`, `G6`, `G8`, `G22` | Lightning-fast local development loop without external dependency overhead. |
|
|
151
|
-
| **`security`** | `G0`, `G8`, `G9`, `G17`, `G19`, `G20` |
|
|
165
|
+
| **`security`** | `G0`, `G8`, `G9`, `G17`, `G19`, `G20`, `G24` | Dedicated security, secret hygiene, topology, and network resilience audit. |
|
|
152
166
|
|
|
153
167
|
---
|
|
154
168
|
|
|
@@ -168,7 +182,7 @@ npx @ingcrea/aumic-puf auditar
|
|
|
168
182
|
|
|
169
183
|
#### 1. Full Matrix Audit (Enterprise)
|
|
170
184
|
```bash
|
|
171
|
-
# Concurrently evaluates all
|
|
185
|
+
# Concurrently evaluates all 25 quality gates across the current directory
|
|
172
186
|
puf auditar
|
|
173
187
|
|
|
174
188
|
# Fail-fast execution (immediately halts upon encountering the first failure)
|
|
@@ -180,7 +194,7 @@ puf auditar --fast
|
|
|
180
194
|
# Fast local development check
|
|
181
195
|
puf auditar --profile=dev
|
|
182
196
|
|
|
183
|
-
# Dedicated security shield audit
|
|
197
|
+
# Dedicated security shield and resilience audit
|
|
184
198
|
puf auditar --profile=security
|
|
185
199
|
|
|
186
200
|
# Rapid prototype audit
|
|
@@ -189,20 +203,20 @@ puf auditar --profile=mvp
|
|
|
189
203
|
|
|
190
204
|
#### 3. Granular Gate Targeting
|
|
191
205
|
```bash
|
|
192
|
-
# Run only
|
|
193
|
-
puf auditar -g
|
|
206
|
+
# Run only mutation tests, chaos injection, and WordPress compliance
|
|
207
|
+
puf auditar -g G21,G23,G24
|
|
194
208
|
|
|
195
|
-
# Run
|
|
196
|
-
puf auditar -g
|
|
209
|
+
# Run encoding hygiene, POSIX squasher, and universal syntax guard
|
|
210
|
+
puf auditar -g G0,G8,G22
|
|
197
211
|
```
|
|
198
212
|
|
|
199
213
|
#### 4. Incident Workflow & Rollback
|
|
200
214
|
```bash
|
|
201
215
|
# Initialize incident (generates G2 test harness and creates G3 immutable state snapshot)
|
|
202
|
-
puf iniciar INC-
|
|
216
|
+
puf iniciar INC-105 "Resilience hardening in gateway" src/checkout.ts
|
|
203
217
|
|
|
204
218
|
# Lossless rollback to SHA-256 pre-mutation state
|
|
205
|
-
puf revertir INC-
|
|
219
|
+
puf revertir INC-105 src/checkout.ts
|
|
206
220
|
```
|
|
207
221
|
|
|
208
222
|
#### 5. Git Pre-Commit Hook Integration
|
|
@@ -228,7 +242,7 @@ puf --version
|
|
|
228
242
|
The repository packages an official workflow template [`puf-github-action.yml`](puf-github-action.yml). To integrate into any GitHub repository:
|
|
229
243
|
|
|
230
244
|
```yaml
|
|
231
|
-
name: AUM-IC PUF-
|
|
245
|
+
name: AUM-IC PUF-25 Certification
|
|
232
246
|
on: [push, pull_request]
|
|
233
247
|
|
|
234
248
|
jobs:
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* @file index.ts
|
|
4
|
-
* @description Punto de entrada CLI interactivo y
|
|
5
|
-
* Soporta selector de compuerta única (-g / --gate), generación de reporte HTML forense
|
|
6
|
-
*
|
|
4
|
+
* @description Punto de entrada CLI interactivo, centinela y servidor MCP para `puf` / `aumic-puf`.
|
|
5
|
+
* Soporta selector de compuerta única (-g / --gate), perfiles, generación de reporte HTML forense,
|
|
6
|
+
* modo de vigilancia reactiva (watch), auto-remediación (sanar/fix) y servidor MCP nativo.
|
|
7
7
|
* Estándar AUM-IC 7:2026.
|
|
8
8
|
*/
|
|
9
9
|
export {};
|
package/dist/cli/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
/**
|
|
4
4
|
* @file index.ts
|
|
5
|
-
* @description Punto de entrada CLI interactivo y
|
|
6
|
-
* Soporta selector de compuerta única (-g / --gate), generación de reporte HTML forense
|
|
7
|
-
*
|
|
5
|
+
* @description Punto de entrada CLI interactivo, centinela y servidor MCP para `puf` / `aumic-puf`.
|
|
6
|
+
* Soporta selector de compuerta única (-g / --gate), perfiles, generación de reporte HTML forense,
|
|
7
|
+
* modo de vigilancia reactiva (watch), auto-remediación (sanar/fix) y servidor MCP nativo.
|
|
8
8
|
* Estándar AUM-IC 7:2026.
|
|
9
9
|
*/
|
|
10
10
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -47,27 +47,35 @@ const guardian_git_js_1 = require("../hooks/guardian-git.js");
|
|
|
47
47
|
const generador_reporte_html_js_1 = require("../core/generador-reporte-html.js");
|
|
48
48
|
const interfaz_js_1 = require("./interfaz.js");
|
|
49
49
|
const types_js_1 = require("../core/types.js");
|
|
50
|
+
const auto_sanador_js_1 = require("../core/auto-sanador.js");
|
|
51
|
+
const centinela_watch_js_1 = require("../core/centinela-watch.js");
|
|
52
|
+
const servidor_mcp_js_1 = require("../core/servidor-mcp.js");
|
|
50
53
|
async function main() {
|
|
51
54
|
const argumentos = process.argv.slice(2);
|
|
52
55
|
const comando = argumentos[0]?.toLowerCase();
|
|
53
56
|
const directorioActual = process.env['PUF_TARGET_DIR'] || process.cwd();
|
|
54
57
|
const orquestador = new orquestador_js_1.OrquestadorPUF15(directorioActual);
|
|
55
58
|
if (comando === '-v' || comando === '--version' || comando === 'version') {
|
|
56
|
-
console.log('v3.
|
|
59
|
+
console.log('v3.4.0');
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
// Subcomando de Servidor MCP Nativo (stdio)
|
|
63
|
+
if (comando === 'serve' || comando === 'mcp' || argumentos.includes('--mcp')) {
|
|
64
|
+
servidor_mcp_js_1.ServidorMcpPuf.iniciar(directorioActual);
|
|
57
65
|
return;
|
|
58
66
|
}
|
|
59
67
|
switch (comando) {
|
|
60
68
|
case 'iniciar':
|
|
61
69
|
case 'init': {
|
|
62
70
|
const idIncidente = argumentos[1];
|
|
63
|
-
const descripcion = argumentos[2] || 'Resolucion metodica de fallo bajo PUF-
|
|
71
|
+
const descripcion = argumentos[2] || 'Resolucion metodica de fallo bajo PUF-25';
|
|
64
72
|
const archivos = argumentos.slice(3).filter((a) => typeof a === 'string');
|
|
65
73
|
if (!idIncidente) {
|
|
66
74
|
console.error('Uso: puf iniciar <ID-INCIDENTE> [DESCRIPCION] [ARCHIVOS...]');
|
|
67
75
|
process.exit(1);
|
|
68
76
|
}
|
|
69
77
|
interfaz_js_1.InterfazConsola.mostrarBanner();
|
|
70
|
-
console.log('[PUF-
|
|
78
|
+
console.log('[PUF-25]: Inicializando incidente ' + idIncidente + '...');
|
|
71
79
|
const res = await orquestador.inicializarIncidente({
|
|
72
80
|
idIncidente,
|
|
73
81
|
descripcionFallo: descripcion,
|
|
@@ -78,15 +86,48 @@ async function main() {
|
|
|
78
86
|
res.respaldosCreados.forEach((r) => console.log(' - ' + r));
|
|
79
87
|
break;
|
|
80
88
|
}
|
|
89
|
+
case 'sanar':
|
|
90
|
+
case 'fix': {
|
|
91
|
+
interfaz_js_1.InterfazConsola.mostrarBanner();
|
|
92
|
+
const compuertasArgs = argumentos.slice(1).map(c => c.toUpperCase().replace(/^--?G?/, 'G'));
|
|
93
|
+
console.log(`\x1b[36m⚡ [AUTO-SANADOR DETERMINISTA]:\x1b[0m Iniciando protocolo de reparación quirúrgica...`);
|
|
94
|
+
const sanaciones = await auto_sanador_js_1.AutoSanador.sanar(directorioActual, compuertasArgs.length > 0 ? compuertasArgs : undefined);
|
|
95
|
+
let totalReparaciones = 0;
|
|
96
|
+
sanaciones.forEach(s => {
|
|
97
|
+
totalReparaciones += s.reparacionesAplicadas;
|
|
98
|
+
const color = s.reparacionesAplicadas > 0 ? '\x1b[32m✔' : '\x1b[90m-';
|
|
99
|
+
console.log(`${color} [${s.compuerta}]:\x1b[0m ${s.detalle}`);
|
|
100
|
+
if (s.archivosModificados.length > 0) {
|
|
101
|
+
s.archivosModificados.forEach(a => console.log(` \x1b[33m↳ modificado:\x1b[0m ${a}`));
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
console.log(`\n\x1b[32m✔ Sanación completada:\x1b[0m ${totalReparaciones} anomalías corregidas con respaldos G3 atómicos.\n`);
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
case 'watch':
|
|
108
|
+
case 'centinela': {
|
|
109
|
+
let perfilWatch = 'dev';
|
|
110
|
+
let usarToast = true;
|
|
111
|
+
for (const arg of argumentos.slice(1)) {
|
|
112
|
+
if (arg.startsWith('--profile=')) {
|
|
113
|
+
const p = arg.split('=')[1]?.toLowerCase();
|
|
114
|
+
if (types_js_1.COMPUERTAS_POR_PERFIL[p])
|
|
115
|
+
perfilWatch = p;
|
|
116
|
+
}
|
|
117
|
+
else if (arg === '--no-toast') {
|
|
118
|
+
usarToast = false;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
centinela_watch_js_1.CentinelaWatch.iniciar(directorioActual, perfilWatch, usarToast);
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
81
124
|
case 'auditar':
|
|
82
125
|
case 'verificar':
|
|
83
126
|
case 'audit':
|
|
84
127
|
case 'verify': {
|
|
85
128
|
const failFast = argumentos.includes('--fast') || argumentos.includes('--fail-fast');
|
|
86
129
|
const sinReporte = argumentos.includes('--no-html');
|
|
87
|
-
// Extracción de compuertas específicas con -g o --gate
|
|
88
130
|
const compuertasAFiltrar = [];
|
|
89
|
-
// Extraccion de perfil con --profile=<mvp|dev|security|enterprise>
|
|
90
131
|
let perfilSeleccionado = 'enterprise';
|
|
91
132
|
for (let i = 0; i < argumentos.length; i++) {
|
|
92
133
|
const arg = argumentos[i];
|
|
@@ -133,7 +174,6 @@ async function main() {
|
|
|
133
174
|
});
|
|
134
175
|
}
|
|
135
176
|
}
|
|
136
|
-
// Parsea ruta de reporte HTML si se especifica con --html o --reporte
|
|
137
177
|
let rutaReportePersonalizada;
|
|
138
178
|
for (let i = 0; i < argumentos.length; i++) {
|
|
139
179
|
const arg = argumentos[i];
|
|
@@ -147,7 +187,6 @@ async function main() {
|
|
|
147
187
|
rutaReportePersonalizada = arg.split('=')[1];
|
|
148
188
|
}
|
|
149
189
|
}
|
|
150
|
-
// Filtra banderas para obtener idIncidente y archivos
|
|
151
190
|
const argumentosLimpios = argumentos.filter((a, idx) => {
|
|
152
191
|
if (!a)
|
|
153
192
|
return false;
|
|
@@ -183,7 +222,6 @@ async function main() {
|
|
|
183
222
|
},
|
|
184
223
|
});
|
|
185
224
|
interfaz_js_1.InterfazConsola.renderizarResultado(resultado);
|
|
186
|
-
// Generación automática del reporte HTML forense salvo que se use --no-html
|
|
187
225
|
if (!sinReporte) {
|
|
188
226
|
try {
|
|
189
227
|
const rutaHtml = rutaReportePersonalizada || path.join(directorioActual, 'puf-report.html');
|
|
@@ -208,7 +246,7 @@ async function main() {
|
|
|
208
246
|
process.exit(1);
|
|
209
247
|
}
|
|
210
248
|
interfaz_js_1.InterfazConsola.mostrarBanner();
|
|
211
|
-
console.log('[PUF-
|
|
249
|
+
console.log('[PUF-25]: Solicitando reversion atomica G3...');
|
|
212
250
|
const resRollback = await orquestador.revertir(idIncidente, nombreArchivo);
|
|
213
251
|
if (!resRollback.exitoso) {
|
|
214
252
|
console.error('✗ ' + resRollback.mensaje);
|
|
@@ -220,7 +258,7 @@ async function main() {
|
|
|
220
258
|
case 'hook':
|
|
221
259
|
case 'instalar-hook': {
|
|
222
260
|
interfaz_js_1.InterfazConsola.mostrarBanner();
|
|
223
|
-
console.log('[PUF-
|
|
261
|
+
console.log('[PUF-25]: Instalando interceptor forense Git...');
|
|
224
262
|
const resHook = await guardian_git_js_1.GuardianGitHook.instalar(directorioActual);
|
|
225
263
|
if (!resHook.exitoso) {
|
|
226
264
|
console.error('✗ ' + resHook.mensaje);
|
|
@@ -232,7 +270,7 @@ async function main() {
|
|
|
232
270
|
case 'guard': {
|
|
233
271
|
const resGuard = await guardian_git_js_1.GuardianGitHook.verificarStaged(directorioActual);
|
|
234
272
|
if (!resGuard.exitoso) {
|
|
235
|
-
console.error('✗ [INTERCEPTOR PUF-
|
|
273
|
+
console.error('✗ [INTERCEPTOR PUF-25 DENEGO EL COMMIT AGPL-3.0]:');
|
|
236
274
|
resGuard.errores.forEach((e) => console.error(e));
|
|
237
275
|
process.exit(1);
|
|
238
276
|
}
|
|
@@ -242,18 +280,21 @@ async function main() {
|
|
|
242
280
|
default: {
|
|
243
281
|
interfaz_js_1.InterfazConsola.mostrarBanner();
|
|
244
282
|
console.log('Uso:\n' +
|
|
245
|
-
' puf
|
|
246
|
-
' puf
|
|
247
|
-
' puf
|
|
248
|
-
' puf
|
|
249
|
-
' puf
|
|
250
|
-
' puf -
|
|
283
|
+
' puf auditar [ID-INCIDENTE] [--profile=mvp] Evalua la suite (--profile=mvp|dev|security|enterprise)\n' +
|
|
284
|
+
' puf sanar [COMPUERTAS...] Ejecuta auto-remediacion quirurgica (alias: puf fix)\n' +
|
|
285
|
+
' puf watch [--profile=dev] [--no-toast] Modo centinela con notificacion dual consola + Toast SO\n' +
|
|
286
|
+
' puf serve Inicia el servidor MCP nativo (Model Context Protocol stdio)\n' +
|
|
287
|
+
' puf iniciar <ID-INCIDENTE> [DESCRIPCION] [ARCHIVOS...] Genera andamio test (G2) y checkpoints (G3)\n' +
|
|
288
|
+
' puf revertir <ID-INCIDENTE> <ARCHIVO> Restaura atomicamente el archivo previo al fallo\n' +
|
|
289
|
+
' puf instalar-hook Instala el guardian de Git en .git/hooks/pre-commit\n' +
|
|
290
|
+
' puf guard Valida que los cambios en staged no violen G4 o G7\n' +
|
|
291
|
+
' puf -v, --version Muestra la version actual instalada\n');
|
|
251
292
|
break;
|
|
252
293
|
}
|
|
253
294
|
}
|
|
254
295
|
}
|
|
255
296
|
main().catch((error) => {
|
|
256
|
-
console.error('[PUF
|
|
297
|
+
console.error('[PUF ERROR FATAL]: ' + error.message);
|
|
257
298
|
process.exit(1);
|
|
258
299
|
});
|
|
259
300
|
//# sourceMappingURL=index.js.map
|