@ingcrea/aumic-puf 3.2.0 → 3.2.1
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/MANIFEST.es.md +68 -134
- package/MANIFEST.md +85 -43
- package/README.es.md +205 -203
- package/README.md +208 -204
- package/dist/cli/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,254 +1,258 @@
|
|
|
1
|
-
# AUM-IC PUF —
|
|
1
|
+
# AUM-IC PUF — Universal Failure Prevention Protocol (PUF-23)
|
|
2
2
|
|
|
3
|
-
[](LICENSE)
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
## Matriz de 23 Compuertas de Calidad (G0 - G22)
|
|
9
|
+
Official deterministic quality assurance engine and 23-gate universal multi-language orchestrator (G0 to G22) implementing the **AUM-IC 7:2026 Standard**, engineered and maintained by **Ingeniería Creativa (IngCrea)**.
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
- **Alcance:** Diagnóstico in-process de mojibake, entropía de caracteres, saltos CRLF y codificación UTF-8 pura.
|
|
11
|
+
---
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
- **Alcance:** Analizar el flujo completo de ejecución, ciclo de vida de la UI y desacoplamiento de hilos pesados.
|
|
13
|
+
## Engine Philosophy and Architecture
|
|
18
14
|
|
|
19
|
-
|
|
20
|
-
- **Alcance:** Escribir y verificar test automatizado previo a tocar código de lógica (*Red State*).
|
|
15
|
+
The Universal Failure Prevention Protocol (PUF) is not a surface-level linter or a disjointed set of scripts. It is a **closed-loop deterministic audit engine** engineered to eradicate software entropy before code ever reaches production.
|
|
21
16
|
|
|
22
|
-
|
|
23
|
-
- **Alcance:** Respaldos atómicos con hash SHA-256 en `checkpoints/` para permitir reversión instantánea.
|
|
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.
|
|
24
18
|
|
|
25
|
-
###
|
|
26
|
-
- **Alcance:** Erradicación de causa raíz, cero código muerto y prohibición de atributos `style="..."` inline.
|
|
19
|
+
### Key Engine Features in v3.2.1
|
|
27
20
|
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
* **In-Memory VFS Snapshot (`LectorArbolProyecto`):** Structured volatile filesystem snapshot caching. Enables multiple gates to evaluate project structure and code concurrently with zero disk I/O bottleneck.
|
|
22
|
+
* **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.
|
|
23
|
+
* **Dynamic Audit Profiles (`--profile`):** Adaptable gate execution matching pipeline requirements (`enterprise`, `mvp`, `dev`, `security`).
|
|
24
|
+
* **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.
|
|
30
25
|
|
|
31
|
-
|
|
32
|
-
- **Alcance:** Compiladores y linters en modo estricto (Rust, TypeScript, Python, PHP, Java, C#, C++, Swift, etc.).
|
|
26
|
+
---
|
|
33
27
|
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
## Comprehensive Matrix of Quality Gates (G0 to G22)
|
|
29
|
+
|
|
30
|
+
### G0: Forensic Anti-Entropy & Encoding Hygiene (In-Process Sanitizer)
|
|
31
|
+
* **Purpose:** Ensures zero corrupted bytes, phantom BOM markers, or invalid character sequences enter development streams.
|
|
32
|
+
* **What it does:** Runs in-process memory diagnostics via `aumic-sanitizer`, auditing that 100% of codebase files maintain **pure UTF-8 without BOM** and POSIX Unix **LF (`\n`)** line breaks. Automatically purges mojibake artifacts and prevents cross-platform runtime discrepancies.
|
|
33
|
+
|
|
34
|
+
### G1: Behavior & Boundary Mapping and UI Loop Isolation (Behavior & Boundary Mapping)
|
|
35
|
+
* **Purpose:** Fortifies runtime state integrity and prevents UI starvation or application lockups.
|
|
36
|
+
* **What it does:** Scans input contracts, signatures, and edge cases (`null`, `undefined`, `None`, empty strings, and numerical overflows). Strictly enforces that **no heavy disk I/O, synchronous commands, or network queries** run inside graphical UI timers or event callbacks (`slint::Timer`, `setInterval`, `requestAnimationFrame`), requiring delegation to detached asynchronous tasks or atomic memory caches.
|
|
37
|
+
|
|
38
|
+
### G2: Reproduction Test-First — Red Phase (Reproduction Test-First)
|
|
39
|
+
* **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 CLI-driven) 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
|
+
|
|
42
|
+
### G3: Immutable State Checkpoint (State Snapshot Guard)
|
|
43
|
+
* **Purpose:** Delivers immunity against destructive regressions or data loss during bug mitigation.
|
|
44
|
+
* **What it does:** Generates an atomic timestamped backup inside `checkpoints/` (`<file>.bak_YYYYMMDDHHMMSS`) hashing its state with SHA-256. Enables instant, lossless rollbacks via `puf revertir` if a fix deviates from expectations.
|
|
45
|
+
|
|
46
|
+
### G4: Pure Logic Refactor & Zero Inline CSS (Pure Logic Refactor)
|
|
47
|
+
* **Purpose:** Guarantees root-cause remediation without quick hacks, dead code, or coupled styling debt.
|
|
48
|
+
* **What it does:** Verifies that the patch addresses the root architectural flaw without producing side effects. Enforces clean-code practices per language (forbids unjustified `unwrap()` in Rust favoring `Result`/`Option`; mandates `declare(strict_types=1);` in PHP; separates frontmatter from JSX in Astro). Strictly bans inline `style="..."` attributes across HTML, JSX, PHP, or Astro, enforcing modular `.css` or `.scss` stylesheets.
|
|
49
|
+
|
|
50
|
+
### G5: Test Validation & Non-Regression — Green Phase (Green State & Non-Regression)
|
|
51
|
+
* **Purpose:** Mathematically validates defect resolution without adjacent module regressions.
|
|
52
|
+
* **What it does:** Re-executes the automated test introduced in G2, validating 100% passing assertions (*Green State*). Concurrently executes perimetral test suites to ensure zero pre-existing system behaviors were degraded.
|
|
53
|
+
|
|
54
|
+
### G6: Strict Static Analysis, Typing & Compiler Rigor (Static Gate Multi-Ecosystem)
|
|
55
|
+
* **Purpose:** Zero tolerance for compiler warnings, implicit types, and build-time slips.
|
|
56
|
+
* **What it does:** Executes official language toolchains under maximum rigor:
|
|
57
|
+
* **TypeScript / Astro:** `npx astro check`, `npx tsc --noEmit`, and zero ESLint warnings tolerated.
|
|
58
|
+
* **Rust:** `cargo check` and `cargo clippy -- -D warnings`.
|
|
59
|
+
* **Python:** `mypy --strict` and `ruff check`.
|
|
60
|
+
* **PHP:** `php -l` and `phpstan analyse --level=max`.
|
|
61
|
+
* **Java / JVM:** Validation across Maven (`mvn test-compile`), Gradle, or `javac`.
|
|
62
|
+
* **C# / .NET:** `dotnet build /warnaserror`.
|
|
63
|
+
|
|
64
|
+
### G7: Semantic Architecture Documentation & ADR Logging (Intent & Architecture Decision)
|
|
65
|
+
* **Purpose:** Safeguards technical memory and the rationale underlying design choices.
|
|
66
|
+
* **What it does:** Audits code comments for design intent beyond syntactic operation. Validates the existence and updates of `BITACORA.md` in the project root adhering to the canonical format:
|
|
67
|
+
```text
|
|
68
|
+
[Timestamp] | Context | Decision | Consequence
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### G8: POSIX Squasher & Character Sanitization (POSIX Squasher)
|
|
72
|
+
* **Purpose:** Prevents build breaks, noisy git diffs, and unexecutable scripts across Linux/Docker environments.
|
|
73
|
+
* **What it does:** Sweeps all repository files in memory, squashing Windows CRLF (`\r\n`) line endings into POSIX Unix LF (`\n`) and wiping out non-compliant character artifacts.
|
|
74
|
+
|
|
75
|
+
### G9: Operational Integrity, File Permissions & Zero-Trust Secrets (Ops Shield)
|
|
76
|
+
* **Purpose:** Shields infrastructure against exposed credentials and risky filesystem permissions.
|
|
77
|
+
* **What it does:** Inspects filesystem security modes (enforcing `644` for general files, `755` for directories/executables, and `600` for private credentials). Scans for hardcoded tokens, passwords, database credentials, or API keys in plaintext, forcing storage via environment variables or secret vaults.
|
|
78
|
+
|
|
79
|
+
### G10: Ephemeral State Flush & Cache Invalidation (State Flush)
|
|
80
|
+
* **Purpose:** Guarantees clients and developers consume fresh code, removing stale compilation artifacts.
|
|
81
|
+
* **What it does:** Locates and purges build trees and local caches (`.next`, `.turbo`, `dist`, `target`, `__pycache__`, `.phpunit.cache`, `storage/framework/cache`), dispatching graceful worker restart notifications (PM2, Systemd, Gunicorn) as required.
|
|
82
|
+
|
|
83
|
+
### G11: OS Ergonomics & Zero-Focus Stealing (Zero-Focus Stealing Guard)
|
|
84
|
+
* **Purpose:** Prevents user distraction and jarring command prompt flickers in native environments.
|
|
85
|
+
* **What it does:** In Windows desktop stacks, enforces that all native subprocess calls (`Command::new`, `powershell`, `cmd`, `exec`) supply `creation_flags(0x08000000)` (`CREATE_NO_WINDOW`), eliminating intrusive black console popups. Audits that repeated privilege lookups leverage atomic lazy caches (`AtomicU8` / `OnceLock`).
|
|
86
|
+
|
|
87
|
+
### G12: Living Routes Topology & Dead Link Sweeper (Living Routes Gate)
|
|
88
|
+
* **Purpose:** Eliminates 404 pages and dead local references prior to production deployment.
|
|
89
|
+
* **What it does:** Scans web markup and templates (`.astro`, `.tsx`, `.jsx`, `.vue`, `.html`, `.php`), extracting `href`, `src`, `to`, and `action` parameters. Confirms that all relative local references resolve directly to physical assets on the filesystem.
|
|
90
|
+
|
|
91
|
+
### G13: Living UI Actions Graph & Zombie Eradication (Living UI Actions Gate)
|
|
92
|
+
* **Purpose:** Ensures interactive interface elements are functionally wired rather than purely decorative.
|
|
93
|
+
* **What it does:** Statically evaluates UI code detecting zombie handlers (`onClick=""`, `onClick={undefined}`, `on:click=""`, `@click=""`, buttons missing actionable event bindings). Every control must lead to state mutation, API dispatch, modal presentation, or active user feedback.
|
|
94
|
+
|
|
95
|
+
### G14: HTTP Contract Traceability & Living Endpoints (Living API Contract Gate)
|
|
96
|
+
* **Purpose:** Prevents discrepancies between client-side requests and registered backend routes.
|
|
97
|
+
* **What it does:** Tracks client HTTP invocations (`fetch(...)`, `axios.get/post/...`, `ky`), asserting that no unmapped endpoints, deprecated APIs, or broken relative routes are queried.
|
|
98
|
+
|
|
99
|
+
### G15: Headless E2E Crawler & Runtime Exceptions (Headless Handshake Gate)
|
|
100
|
+
* **Purpose:** Catches silent runtime crashes, unresponsive UI flows, and unhandled console errors.
|
|
101
|
+
* **What it does:** Verifies the presence of E2E suites (Playwright `playwright.config.ts` or Cypress `cypress.config.ts`). If found, ensures deterministic invocation; if absent, flags the gate as `omitida` (skipped) with actionable recommendations without halting build certification.
|
|
102
|
+
|
|
103
|
+
### G16: Visual Quality, Core Web Vitals & Web Audit (Lighthouse / CWV Guard)
|
|
104
|
+
* **Purpose:** Enforces competitive search engine indexing and responsive, stutter-free user experiences.
|
|
105
|
+
* **What it does:** Measures Core Web Vitals (LCP - Largest Contentful Paint, CLS - Cumulative Layout Shift, INP - Interaction to Next Paint), accessibility compliance (a11y), SEO architecture, and best practices. Enforces a minimum aggregate score of 70/100 from local audits (`aumic-live-report.json`) or live browser telemetry.
|
|
106
|
+
|
|
107
|
+
### G17: Intellectual Property, License Integrity & Dependency Safety (IP & License Guard)
|
|
108
|
+
* **Purpose:** Protects corporate software ownership and defends against open-source licensing infractions.
|
|
109
|
+
* **What it does:** Validates alignment between package manifests (`package.json`, `Cargo.toml`, `composer.json`) and physical license files (`LICENSE`, `LICENSE.md`, `LICENSE-DOCS`). Purges unresolved license template placeholders (e.g. `<year>`, `<owner>`), checks third-party license compatibility, and provides non-blocking advisory modes for private client codebases.
|
|
110
|
+
|
|
111
|
+
### G18: Style Engine Consistency & Antipattern Eradication (Style Engine Consistency)
|
|
112
|
+
* **Purpose:** Maintains stylesheet predictability and avoids catastrophic layout engine collisions.
|
|
113
|
+
* **What it does:** Detects mutually antagonistic styling frameworks (such as bundling Tailwind CSS and Bootstrap together). Audits stylesheet specificity debt, flagging projects where `!important` declarations exceed acceptable tolerance thresholds (maximum 5 justified usages).
|
|
114
|
+
|
|
115
|
+
### G19: Attack Surface Shield & Zero Injection (Zero-Injection & Attack Surface Guard)
|
|
116
|
+
* **Purpose:** Neutralizes common attack vectors and blocks credential exposure or database intrusion.
|
|
117
|
+
* **What it does:** Inspects repository files ensuring no uncommitted database dumps (`dump.sql`, `backup.sql`), dangerous diagnostics (`phpinfo.php`, `xmlrpc.php`), or SSH private keys are exposed. Verifies `.env` files are strictly tracked inside `.gitignore`, and audits SQL execution against direct string concatenation, demanding parameterized queries or typed Query Builders.
|
|
118
|
+
|
|
119
|
+
### G20: Environment Topology & Zero Cross-Contamination (Topology Guard)
|
|
120
|
+
* **Purpose:** Prevents staging leaks and hardcoded developmental URLs in production releases.
|
|
121
|
+
* **What it does:** Sweeps source files for hardcoded developmental endpoints (`http://localhost`, `127.0.0.1`), requiring full decoupling through dedicated environment variables configured per target infrastructure (`dev`, `staging`, `prod`).
|
|
122
|
+
|
|
123
|
+
### G21: Official WordPress & WooCommerce Compliance (WPCS & WC Guidelines Guard)
|
|
124
|
+
* **Purpose:** Enforces secure, HPOS-ready, and resilient coding standards in WordPress and WooCommerce ecosystems.
|
|
125
|
+
* **What it does:** Activates automatically upon detecting WordPress/PHP codebases, running specialized inspection rules:
|
|
126
|
+
* **`WP-SEC-01` (Sanitization & Nonces):** Requires sanitization of superglobals (`$_GET`, `$_POST`, `$_REQUEST`) and CSRF defense via `check_admin_referer()` / `wp_verify_nonce()`.
|
|
127
|
+
* **`WP-SEC-02` (Prepared Queries):** Prohibits raw `$wpdb` queries missing `$wpdb->prepare()`.
|
|
128
|
+
* **`WC-HPOS-01` (Mandatory CRUD Orders):** Forbids direct `wp_postmeta` access for order management, enforcing canonical `WC_Order` CRUD methods (`$order->get_id()`, `$order->get_meta()`, `$order->update_meta_data()`, `$order->save()`).
|
|
129
|
+
* **`WC-CORE-01` (Deprecated Properties):** Flags legacy WooCommerce properties (such as accessing `$order->id` directly).
|
|
130
|
+
* **`WP-ROBUST-OPT-01` (Empty Coalesce Guard):** Detects fragile usage of the null coalescing operator `??` over configuration arrays where empty strings (`''`) bypass fallback defaults.
|
|
131
|
+
* **`WP-CIRCUIT-BREAKER-01` (Hardcoded Flags):** Identifies static boolean flags that silently obstruct transactional or payment processing pipelines.
|
|
132
|
+
|
|
133
|
+
### G22: Universal Syntax, Delimiter & Balance Guard (Universal Syntax Guard)
|
|
134
|
+
* **Purpose:** Diagnoses subtle syntax errors in milliseconds across diverse languages without external compilers.
|
|
135
|
+
* **What it does:** Fast in-memory parsing engine covering PHP, CSS/SCSS, JSON, JavaScript, TypeScript, and Java:
|
|
136
|
+
* Spots missing semicolons (`;`) in PHP instructions and CSS/SCSS property declarations.
|
|
137
|
+
* Audits JSON integrity (detecting unescaped structures, missing commas, or trailing commas).
|
|
138
|
+
* Evaluates perfect bracket balance (`{ }`, `[ ]`, `( )`), smartly ignoring strings, inline comments, and regular expression literals to pinpoint the exact line of any imbalance.
|
|
36
139
|
|
|
37
|
-
|
|
38
|
-
- **Alcance:** Blindaje de bytes LF puros y UTF-8 estricto sin BOM.
|
|
140
|
+
---
|
|
39
141
|
|
|
40
|
-
|
|
41
|
-
- **Alcance:** Permisos POSIX (644/755) y cero credenciales en texto plano.
|
|
142
|
+
## Dynamic Audit Profiles (`--profile`)
|
|
42
143
|
|
|
43
|
-
|
|
44
|
-
- **Alcance:** Purga de cachés de compilación (.next, .turbo, target, __pycache__, .phpunit.cache).
|
|
144
|
+
To accelerate continuous integration pipelines and local pre-commit cycles, PUF provides four specialized execution profiles:
|
|
45
145
|
|
|
46
|
-
|
|
47
|
-
|
|
146
|
+
| Profile | Evaluated Gates | Primary Use Case |
|
|
147
|
+
| :--- | :--- | :--- |
|
|
148
|
+
| **`enterprise`** *(Default)* | **G0 through G22 (All 23 Gates)** | Complete gate certification required prior to production release or distribution. |
|
|
149
|
+
| **`mvp`** | `G0`, `G4`, `G6`, `G8`, `G22` | Rapid proof-of-concept audit: forensic hygiene, pure logic, strict static checks, and syntax. |
|
|
150
|
+
| **`dev`** | `G0`, `G4`, `G6`, `G8`, `G22` | Lightning-fast local development loop without external dependency overhead. |
|
|
151
|
+
| **`security`** | `G0`, `G8`, `G9`, `G17`, `G19`, `G20` | Specialized audit for infrastructure, file permissions, secret hygiene, topology, and injections. |
|
|
48
152
|
|
|
49
|
-
|
|
50
|
-
- **Alcance:** Detección de enlaces y destinos locales rotos en código web.
|
|
153
|
+
---
|
|
51
154
|
|
|
52
|
-
|
|
53
|
-
- **Alcance:** Erradicación de botones decorativos o handlers de eventos inertes.
|
|
155
|
+
## Command Line Interface Manual (`puf` / `aumic-puf`)
|
|
54
156
|
|
|
55
|
-
###
|
|
56
|
-
- **Alcance:** Detección estática de contratos HTTP rotos o paths huérfanos.
|
|
157
|
+
### Installation
|
|
57
158
|
|
|
58
|
-
|
|
59
|
-
|
|
159
|
+
```bash
|
|
160
|
+
# Global installation from npm
|
|
161
|
+
npm install -g @ingcrea/aumic-puf
|
|
60
162
|
|
|
61
|
-
|
|
62
|
-
-
|
|
163
|
+
# Or direct zero-install execution via npx
|
|
164
|
+
npx @ingcrea/aumic-puf auditar
|
|
165
|
+
```
|
|
63
166
|
|
|
64
|
-
###
|
|
65
|
-
- **Alcance:** Consistencia entre manifiestos (`package.json`, `Cargo.toml`) y archivos `LICENSE`, titularidad y copyright.
|
|
167
|
+
### Operational Commands
|
|
66
168
|
|
|
67
|
-
|
|
68
|
-
|
|
169
|
+
#### 1. Full Matrix Audit (Enterprise)
|
|
170
|
+
```bash
|
|
171
|
+
# Concurrently evaluates all 23 quality gates across the current directory
|
|
172
|
+
puf auditar
|
|
69
173
|
|
|
70
|
-
|
|
71
|
-
|
|
174
|
+
# Fail-fast execution (immediately halts upon encountering the first failure)
|
|
175
|
+
puf auditar --fast
|
|
176
|
+
```
|
|
72
177
|
|
|
73
|
-
|
|
74
|
-
|
|
178
|
+
#### 2. Dynamic Profile Auditing
|
|
179
|
+
```bash
|
|
180
|
+
# Fast local development check
|
|
181
|
+
puf auditar --profile=dev
|
|
75
182
|
|
|
76
|
-
|
|
77
|
-
|
|
183
|
+
# Dedicated security shield audit
|
|
184
|
+
puf auditar --profile=security
|
|
78
185
|
|
|
79
|
-
|
|
80
|
-
|
|
186
|
+
# Rapid prototype audit
|
|
187
|
+
puf auditar --profile=mvp
|
|
188
|
+
```
|
|
81
189
|
|
|
82
|
-
|
|
190
|
+
#### 3. Granular Gate Targeting
|
|
191
|
+
```bash
|
|
192
|
+
# Run only encoding hygiene, WordPress compliance, and syntax checking
|
|
193
|
+
puf auditar -g G0,G21,G22
|
|
83
194
|
|
|
84
|
-
|
|
195
|
+
# Run security, attack surface, and environment topology gates
|
|
196
|
+
puf auditar -g G9,G19,G20
|
|
197
|
+
```
|
|
85
198
|
|
|
199
|
+
#### 4. Incident Workflow & Rollback
|
|
86
200
|
```bash
|
|
87
|
-
#
|
|
88
|
-
|
|
201
|
+
# Initialize incident (generates G2 test harness and creates G3 immutable state snapshot)
|
|
202
|
+
puf iniciar INC-104 "Payment gateway calculation fix" src/checkout.ts
|
|
89
203
|
|
|
90
|
-
#
|
|
91
|
-
puf
|
|
204
|
+
# Lossless rollback to SHA-256 pre-mutation state
|
|
205
|
+
puf revertir INC-104 src/checkout.ts
|
|
206
|
+
```
|
|
92
207
|
|
|
93
|
-
|
|
94
|
-
|
|
208
|
+
#### 5. Git Pre-Commit Hook Integration
|
|
209
|
+
```bash
|
|
210
|
+
# Installs native git hook at .git/hooks/pre-commit
|
|
211
|
+
puf instalar-hook
|
|
95
212
|
|
|
96
|
-
#
|
|
97
|
-
puf
|
|
213
|
+
# Git staged check: blocks commit if G4 (dead code/inline CSS) or G7 (ADR) are violated
|
|
214
|
+
puf guard
|
|
215
|
+
```
|
|
98
216
|
|
|
99
|
-
|
|
217
|
+
#### 6. Version Inquiry
|
|
218
|
+
```bash
|
|
100
219
|
puf -v
|
|
220
|
+
# or
|
|
221
|
+
puf --version
|
|
101
222
|
```
|
|
102
223
|
|
|
103
|
-
### 1. G1: Mapeo de Comportamientos y Limites (Behavior & Boundary Mapping)
|
|
104
|
-
- **Alcance:** Analizar el flujo completo de ejecucion y ciclo de vida de la UI.
|
|
105
|
-
- **Acciones:**
|
|
106
|
-
- Identificar entradas, tipos, contratos, mutaciones y salidas esperadas.
|
|
107
|
-
- Definir formalmente casos de borde: valores nulos (`None`, `null`, `Option::None`), cadenas vacias, desbordamientos numericos, condiciones de carrera/concurrencia y accesos no autenticados.
|
|
108
|
-
- **Aislamiento del Bucle de UI:** Prohibido disparar I/O pesado, comandos o procesos sincronos dentro de temporizadores o callbacks de interfaz grafica (`slint::Timer`, `setInterval`, `requestAnimationFrame`). Deben delegarse a tareas de fondo asincronas o cachearse atomicamente.
|
|
109
|
-
|
|
110
|
-
### 2. G2: Test de Reproduccion -- Fase Roja (Reproduction Test-First)
|
|
111
|
-
- **Alcance:** Probar y demostrar empiricamente el defecto antes de tocar una sola linea de logica.
|
|
112
|
-
- **Acciones:**
|
|
113
|
-
- Escribir un test automatizado (unitario, integracion o CLI determinista) que replique la falla reportada con fidelidad.
|
|
114
|
-
- Ejecutar el test y confirmar que falle contra el codigo actual (*Red State*).
|
|
115
|
-
|
|
116
|
-
### 3. G3: Checkpoint Inmutable (State Snapshot)
|
|
117
|
-
- **Alcance:** Blindaje de rollback y preservacion de estado pre-mutacion.
|
|
118
|
-
- **Acciones:**
|
|
119
|
-
- Generar un respaldo atomico timestamped en `checkpoints/` (`<archivo>.bak_YYYYMMDDHHMMSS`).
|
|
120
|
-
- Registrar hash SHA-256 para permitir reversion instantanea sin perdida de informacion.
|
|
121
|
-
|
|
122
|
-
### 4. G4: Reparacion Focalizada y Refactorizacion Limpia (Pure Logic Refactor)
|
|
123
|
-
- **Alcance:** Correccion quirurgica de la causa raiz.
|
|
124
|
-
- **Acciones:**
|
|
125
|
-
- Atacar la causa raiz sin parches superficiales. Cero codigo muerto, cero dependencias circulares.
|
|
126
|
-
- Cumplir principios de codigo limpio del stack correspondiente:
|
|
127
|
-
- **Rust:** Cero `unwrap()` no justificado; manejo exhaustivo con `Result` / `Option`.
|
|
128
|
-
- **Astro:** Componentes puros, separacion de logica frontmatter y JSX estatico/reactivo.
|
|
129
|
-
- **Python:** Tipado estricto (Type hints), PEP 8, manejo explicito de excepciones.
|
|
130
|
-
- **PHP:** POO fuertemente tipada, `declare(strict_types=1);`, inyeccion de dependencias.
|
|
131
|
-
- **Prohibicion Absoluta de CSS Inline:** Queda terminantemente prohibido inyectar `style="..."` en HTML/PHP/JSX/Astro. Si existen estilos inline preexistentes, refactorizarlos a archivos `.css`/`.scss`.
|
|
132
|
-
|
|
133
|
-
### 5. G5: Validacion de Test y No-Regresion -- Fase Verde (Green State & Non-Regression)
|
|
134
|
-
- **Alcance:** Verificacion de solucion completa y estabilidad perimetral.
|
|
135
|
-
- **Acciones:**
|
|
136
|
-
- Reejecutar el test de G2 y validar el 100% de aserciones aprobadas (*Green State*).
|
|
137
|
-
- Ejecutar la suite de pruebas perimetral/completa para certificar cero regresiones colaterales.
|
|
138
|
-
|
|
139
|
-
### 6. G6: Analisis Estatico, Tipado y Compilador Estricto (Static Gate)
|
|
140
|
-
- **Alcance:** Tolerancia cero a advertencias del compilador o linters.
|
|
141
|
-
- **Acciones:**
|
|
142
|
-
- Ejecutar compilador y analisis estatico en modo estricto segun el stack:
|
|
143
|
-
- **Rust:** `cargo clippy -- -D warnings` y `cargo check`.
|
|
144
|
-
- **Astro / TypeScript:** `npx astro check` y `npx eslint`.
|
|
145
|
-
- **Python:** `ruff check` y `mypy --strict`.
|
|
146
|
-
- **PHP:** `php -l` y `phpstan analyse --level=max`.
|
|
147
|
-
- Cero advertencias o errores tolerados.
|
|
148
|
-
|
|
149
|
-
### 7. G7: Documentacion Semantica y Registro ADR (Intent & Architecture Decision)
|
|
150
|
-
- **Alcance:** Memoria tecnica e intencion arquitectonica.
|
|
151
|
-
- **Acciones:**
|
|
152
|
-
- Explicar en comentarios de codigo el *por que* de la decision y no solo el *que hace*.
|
|
153
|
-
- Registrar en `BITACORA.md` de la raiz del proyecto bajo el formato estricto:
|
|
154
|
-
```
|
|
155
|
-
[Timestamp] | Contexto | Decision | Consecuencia
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### 8. G8: Aplanadora POSIX y Sanitizacion Anti-Mojibake (aumic-sanitizer)
|
|
159
|
-
- **Alcance:** Integridad de codificacion y terminacion de linea.
|
|
160
|
-
- **Acciones:**
|
|
161
|
-
- Barrer los archivos con `node C:\Users\NexoRemoto\Proyectos\aumic-sanitizer\dist\index.js audit .`
|
|
162
|
-
- Purgar caracteres Mojibake forzando UTF-8 puro sin BOM.
|
|
163
|
-
- Aplanar y forzar saltos de linea Unix LF (`\n`), erradicando Windows CRLF (`\r\n`).
|
|
164
|
-
|
|
165
|
-
### 9. G9: Integridad Operativa, Permisos y Secretos Zero-Trust (Ops Shield)
|
|
166
|
-
- **Alcance:** Blindaje de infraestructura y seguridad de credenciales.
|
|
167
|
-
- **Acciones:**
|
|
168
|
-
- Verificar permisos restrictivos en sistema de archivos (`chmod 644` archivos / `755` directorios, llaves SSH `600`).
|
|
169
|
-
- Cero credenciales, tokens o contrasenas en texto plano. Gestionar accesos via variables de entorno seguras o `SECRETOS.py`.
|
|
170
|
-
|
|
171
|
-
### 10. G10: Invalidacion y Purga de Estado Efimero (State Flush)
|
|
172
|
-
- **Alcance:** Consumo garantizado del codigo fresco en runtime.
|
|
173
|
-
- **Acciones:**
|
|
174
|
-
- Purgar deterministamente cache de objetos (Redis, Memcached, Opcache, `.next`, `dist`).
|
|
175
|
-
- Reiniciar workers (Gunicorn, Systemd, SSR Node, PM2) para garantizar que los clientes consuman el codigo validado.
|
|
176
|
-
|
|
177
|
-
### 11. G11: Blindaje de Ergonomia del SO, Foco de Ventanas y Aislamiento UI (OS & Desktop Ergonomics Gate)
|
|
178
|
-
- **Alcance:** Experiencia de usuario inmaculada, ausencia total de robo de foco.
|
|
179
|
-
- **Acciones:**
|
|
180
|
-
- **Inmunidad al Robo de Foco (Zero-Focus Stealing):** Toda invocacion de subprocesos en Windows (`Command::new`, `powershell`, `cmd`) DEBE incorporar `.creation_flags(0x08000000)` (`CREATE_NO_WINDOW`).
|
|
181
|
-
- **Zero-Ghost Processes:** Al cerrar la aplicacion, no deben quedar procesos huerfanos consumiendo CPU.
|
|
182
|
-
- **Cache de Consultas de Privilegios:** Usar cache atomico perezoso (`AtomicU8` / `OnceLock`), evitando invocaciones repetidas en bucles.
|
|
183
|
-
|
|
184
224
|
---
|
|
185
225
|
|
|
186
|
-
|
|
187
|
-
- **Alcance:** Integridad de navegacion sin pantallas 404 ni rutas huerfanas en Web (Astro, React, Next, Vue), Mobile (Flutter) y Desktop (Slint, C#/WPF, Tauri).
|
|
188
|
-
- **Acciones:**
|
|
189
|
-
- Escanear los archivos HTML/JSX/Astro/PHP afectados con el metodo `auditarRutasVivas()` del adaptador.
|
|
190
|
-
- Detectar atributos `href`, `src`, `to`, `action` que apunten a rutas locales que no existen en el filesystem.
|
|
191
|
-
- Cero enlaces rotos hacia destinos locales inexistentes. Toda ruta relativa debe resolverse a un archivo real.
|
|
192
|
-
- El orquestador informa la lista exacta: `archivo.astro -> "/ruta/inexistente" (no existe en filesystem)`.
|
|
193
|
-
- **Solo aplica a extensiones web:** `.astro`, `.jsx`, `.tsx`, `.html`, `.php`, `.vue`, `.svelte`.
|
|
194
|
-
|
|
195
|
-
### 13. G13: Grafo de Interactividad & Erradicacion Zombie (Living UI Actions Gate)
|
|
196
|
-
- **Alcance:** Cero botones decorativos, pseudoelementos inertes o acciones no conectadas.
|
|
197
|
-
- **Acciones:**
|
|
198
|
-
- Escanear los archivos web afectados con el metodo `auditarInteractividad()` del adaptador.
|
|
199
|
-
- Detectar patrones de handler inerte: `onClick=""`, `onClick={undefined}`, `on:click=""`, `@click=""`.
|
|
200
|
-
- Todo control interactivo debe resolver en un evento real (API call, modal, mutacion de estado o feedback visual).
|
|
201
|
-
- El orquestador reporta exactamente que archivo y linea contiene el handler zombie.
|
|
202
|
-
- **Solo aplica a extensiones web:** `.astro`, `.jsx`, `.tsx`, `.html`, `.php`, `.vue`, `.svelte`.
|
|
203
|
-
|
|
204
|
-
### 14. G14: Traza de Contratos HTTP & Endpoints Vivos (Living API Contract Gate)
|
|
205
|
-
- **Alcance:** Consistencia granular entre las llamadas del cliente y los controladores declarados en el backend.
|
|
206
|
-
- **Acciones:**
|
|
207
|
-
- Analizar los archivos afectados buscando llamadas `fetch(...)` o `axios.get/post/...` con rutas hardcodeadas locales (no `/api/`, no variables de entorno `${}`).
|
|
208
|
-
- Cero llamadas HTTP a paths huerfanos o inexistentes detectados estaticamente.
|
|
209
|
-
- Si se detectan inconsistencias, listar exactamente el archivo y el endpoint problematico.
|
|
210
|
-
|
|
211
|
-
### 15. G15: Headless E2E Crawler & Runtime Exceptions (Headless Handshake Gate)
|
|
212
|
-
- **Alcance:** Deteccion de errores silenciosos, excepciones de runtime y bloqueos de interfaz.
|
|
213
|
-
- **Acciones:**
|
|
214
|
-
- Verificar si existe suite E2E (Playwright `playwright.config.ts`, Cypress `cypress.config.ts`) en la raiz del proyecto.
|
|
215
|
-
- Si existe: marcar como **APROBADA** e instruir al Jefe Maestro a ejecutarla manualmente para certificacion completa.
|
|
216
|
-
- Si NO existe: marcar como **OMITIDA** (no bloquea certificacion) con recomendacion de configurar Playwright.
|
|
217
|
-
- **G15 OMITIDA no es un fallo:** `todasAprobadas` acepta tanto `aprobada` como `omitida`.
|
|
226
|
+
## Continuous Integration (GitHub Actions)
|
|
218
227
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
## Reglas Inviolables de Ejecucion
|
|
222
|
-
|
|
223
|
-
1. **Cero Complacencia:** No dejar tareas a medias ni usar marcadores vacios (`// el resto del codigo aqui`).
|
|
224
|
-
2. **Determinismo Tecnico:** Todo entregable debe ser determinista, verificado en consola y listo para produccion.
|
|
225
|
-
3. **Reporte por Compuerta:** Reportar siempre el estado de cada compuerta (G1 a G15) con su respectiva evidencia.
|
|
226
|
-
4. **G15 es OMITIDA, no RECHAZADA:** Si no hay suite E2E, G15 se omite sin bloquear la certificacion.
|
|
227
|
-
5. **G12 y G13 aplican solo a archivos web:** Para proyectos Rust/Python/Shell sin frontend, estas compuertas se aprueban automaticamente por ausencia de extensiones web en los archivos afectados.
|
|
228
|
+
The repository packages an official workflow template [`puf-github-action.yml`](puf-github-action.yml). To integrate into any GitHub repository:
|
|
228
229
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
# Inicializar incidente (crea andamio G2 + checkpoints G3)
|
|
233
|
-
puf iniciar INC-042 "Descripcion del fallo" src/archivo.ts
|
|
230
|
+
```yaml
|
|
231
|
+
name: AUM-IC PUF-23 Certification
|
|
232
|
+
on: [push, pull_request]
|
|
234
233
|
|
|
235
|
-
|
|
236
|
-
puf
|
|
234
|
+
jobs:
|
|
235
|
+
puf-audit:
|
|
236
|
+
runs-on: ubuntu-latest
|
|
237
|
+
steps:
|
|
238
|
+
- name: Checkout Repository
|
|
239
|
+
uses: actions/checkout@v4
|
|
237
240
|
|
|
238
|
-
|
|
239
|
-
|
|
241
|
+
- name: Setup Node.js
|
|
242
|
+
uses: actions/setup-node@v4
|
|
243
|
+
with:
|
|
244
|
+
node-version: 22
|
|
240
245
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
# Instalar guardian de Git (pre-commit hook)
|
|
245
|
-
puf instalar-hook
|
|
246
|
+
- name: Run PUF Audit
|
|
247
|
+
run: npx @ingcrea/aumic-puf auditar --profile=enterprise --fast
|
|
246
248
|
```
|
|
247
249
|
|
|
248
|
-
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## License & Intellectual Property
|
|
249
253
|
|
|
250
|
-
|
|
254
|
+
Distributed under the **GNU Affero General Public License v3.0 (AGPL-3.0)**. Refer to [LICENSE](LICENSE) for full licensing terms, freedoms, and legal provisions.
|
|
251
255
|
|
|
252
256
|
---
|
|
253
257
|
|
|
254
|
-
**[Ingeniería Creativa](https://ingcrea.com)** | [
|
|
258
|
+
**[Ingeniería Creativa (IngCrea)](https://ingcrea.com)** | [AUM-IC 7:2026 Standard](https://github.com/ingcrea/aum-ic)
|
package/dist/cli/index.js
CHANGED
|
@@ -53,7 +53,7 @@ async function main() {
|
|
|
53
53
|
const directorioActual = process.env['PUF_TARGET_DIR'] || process.cwd();
|
|
54
54
|
const orquestador = new orquestador_js_1.OrquestadorPUF15(directorioActual);
|
|
55
55
|
if (comando === '-v' || comando === '--version' || comando === 'version') {
|
|
56
|
-
console.log('v3.2.
|
|
56
|
+
console.log('v3.2.1');
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
switch (comando) {
|
package/package.json
CHANGED