pumuki 6.3.170 → 6.3.171
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/CHANGELOG.md +0 -44
- package/README.md +342 -161
- package/VERSION +1 -1
- package/core/facts/detectors/text/ios.test.ts +0 -36
- package/core/facts/detectors/text/ios.ts +0 -24
- package/core/facts/detectors/typescript/index.ts +18 -40
- package/core/facts/extractHeuristicFacts.ts +0 -1
- package/docs/operations/RELEASE_NOTES.md +0 -6
- package/integrations/config/coreSkillsLock.ts +1 -11
- package/integrations/config/skillsRuleSet.ts +1 -0
- package/integrations/git/stageRunners.ts +0 -20
- package/integrations/lifecycle/audit.ts +35 -5
- package/integrations/lifecycle/bootstrapManifest.ts +2 -12
- package/integrations/lifecycle/governanceObservationSnapshot.ts +5 -2
- package/integrations/lifecycle/install.ts +0 -21
- package/integrations/mcp/alignedPlatformGate.ts +2 -6
- package/integrations/mcp/evidenceStdioServer.cli.ts +33 -76
- package/package.json +2 -2
- package/assets/readme/current/01-menu-consumer-real.png +0 -0
- package/assets/readme/current/02-option1-audit-block-real.png +0 -0
- package/assets/readme/current/03-option5-pattern-checks-real.png +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,50 +6,6 @@ This project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
-
## [6.3.170] - 2026-05-07
|
|
10
|
-
|
|
11
|
-
### Fixed
|
|
12
|
-
|
|
13
|
-
- **npm README entrypoint:** published package metadata now uses the real premium README with current menu/audit captures, explicit hook/CI enforcement boundaries, MCP stdio binary names, and clear AUTO vs DECLARATIVE skills coverage.
|
|
14
|
-
- **Release typecheck:** restored `npm run typecheck` on the published line by tightening TypeScript detector node typing and null-safe lifecycle/MCP helpers without changing detector semantics.
|
|
15
|
-
|
|
16
|
-
## [6.3.169] - 2026-05-06
|
|
17
|
-
|
|
18
|
-
### Fixed
|
|
19
|
-
|
|
20
|
-
- **Tracked evidence working-tree hygiene:** successful `pumuki-pre-commit` now restores tracked `.ai_evidence.json` from `HEAD` when the file was not staged at hook start, preventing pre-commit frameworks from failing with “files were modified by this hook” while still excluding evidence from code commits.
|
|
21
|
-
|
|
22
|
-
## [6.3.168] - 2026-05-06
|
|
23
|
-
|
|
24
|
-
### Fixed
|
|
25
|
-
|
|
26
|
-
- **Tracked evidence commit hygiene:** `pumuki-pre-commit` now respects tracked `.ai_evidence.json` when it was not staged by the developer before a successful code commit. Documentation-only commits still restore evidence drift, and `PUMUKI_PRE_COMMIT_ALWAYS_RESTAGE_TRACKED_EVIDENCE=1` preserves the previous forced restage behavior.
|
|
27
|
-
|
|
28
|
-
## [6.3.167] - 2026-05-06
|
|
29
|
-
|
|
30
|
-
### Fixed
|
|
31
|
-
|
|
32
|
-
- **MCP evidence stdio strict backend gate:** the MCP bridge now uses explicit JSON-RPC constants and requires adapter-provided evidence env vars instead of production defaults, keeping `PRE_PUSH` fail-closed without false backend blockers.
|
|
33
|
-
|
|
34
|
-
## [6.3.166] - 2026-05-06
|
|
35
|
-
|
|
36
|
-
### Fixed
|
|
37
|
-
|
|
38
|
-
- **Backend heuristic false positives:** JSON-RPC protocol codes and MCP listener resolution no longer trigger backend hardcoded config or magic-number blockers during `PRE_PUSH`.
|
|
39
|
-
|
|
40
|
-
## [6.3.165] - 2026-05-06
|
|
41
|
-
|
|
42
|
-
### Fixed
|
|
43
|
-
|
|
44
|
-
- **MCP evidence stdio PRE_PUSH:** los defaults de host, ruta, puerto y timeout quedan nombrados como constantes para cumplir reglas backend de configuración y evitar bloqueos del hook al publicar ramas de release.
|
|
45
|
-
|
|
46
|
-
## [6.3.164] - 2026-05-06
|
|
47
|
-
|
|
48
|
-
### Fixed
|
|
49
|
-
|
|
50
|
-
- **PUMUKI-INC-130 XCTest helpers brownfield:** `trackForMemoryLeaks`/factory helpers that import `XCTest` but do not define `XCTestCase` suites or `test...` methods no longer trigger `skills.ios.critical-test-quality`.
|
|
51
|
-
- **Skills runtime enforcement:** declarative skill registry rules stay visible in coverage metadata without being counted as missing runtime AST detectors; AUTO rules without detector mapping still fail closed.
|
|
52
|
-
|
|
53
9
|
## [6.3.143] - 2026-05-05
|
|
54
10
|
|
|
55
11
|
### Fixed
|
package/README.md
CHANGED
|
@@ -1,213 +1,394 @@
|
|
|
1
1
|
# Pumuki
|
|
2
2
|
|
|
3
|
-
<img src="assets/
|
|
3
|
+
<img src="assets/logo.png" alt="Pumuki" width="100%" />
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/pumuki)
|
|
6
6
|
[](https://github.com/SwiftEnProfundidad/ast-intelligence-hooks/actions/workflows/ci.yml)
|
|
7
7
|
[](LICENSE)
|
|
8
8
|
|
|
9
|
-
Enterprise
|
|
9
|
+
Enterprise governance framework for AI-assisted software delivery.
|
|
10
10
|
|
|
11
|
-
Pumuki
|
|
12
|
-
repository state, skills, and SDD evidence into facts; evaluates AST-backed
|
|
13
|
-
rules by stage; blocks or allows work; and writes auditable evidence that humans,
|
|
14
|
-
hooks, CI, and agents can inspect.
|
|
11
|
+
Pumuki gives engineering teams one deterministic execution model across local development, hooks, and CI:
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
`Facts -> Rules -> Gate -> .ai_evidence.json (v2.1)`
|
|
14
|
+
|
|
15
|
+
## Qué NO es Pumuki
|
|
16
|
+
|
|
17
|
+
- **No** es el producto de negocio de tu repositorio (la app, el marketplace, el servicio que entregas a usuarios): es **gobernanza y contrato de entrega** sobre el código.
|
|
18
|
+
- **No** sustituye tests de dominio, contratos de API ni E2E: el gate ayuda a **cumplir políticas y evidencias**; la calidad funcional la define tu equipo con pruebas y criterios de aceptación.
|
|
19
|
+
- **No** garantiza por sí solo “un producto excelente”: sin reglas de equipo, revisión humana y criterios claros, solo obtienes **cumplimiento de lo que configuraste**.
|
|
20
|
+
|
|
21
|
+
## Who This README Is For
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
| Profile | Use this path first |
|
|
24
|
+
|---|---|
|
|
25
|
+
| Consumer repository team | [5-Minute Quick Start (Consumer)](#5-minute-quick-start-consumer) |
|
|
26
|
+
| Framework maintainers (this repo) | [Framework Maintainer Flow](#framework-maintainer-flow-this-repo) |
|
|
27
|
+
| Platform/architecture owners | [Enterprise Operations Baseline](#enterprise-operations-baseline) |
|
|
21
28
|
|
|
22
|
-
|
|
23
|
-
CLI, menu UI, and MCP surfaces. The hard enforcement path remains Git hooks and
|
|
24
|
-
CI; CLI, menu, and MCP expose the same product state, stage runners, and
|
|
25
|
-
diagnostic contract for operation:
|
|
29
|
+
## Rutas de adopción
|
|
26
30
|
|
|
27
|
-
|
|
28
|
-
| --- | --- |
|
|
29
|
-
| Git hook governance | Managed `pre-commit` and `pre-push` hooks run the same stage gate engine exposed by the CLI runners. Managed hooks chain `pumuki-pre-write` first unless explicitly disabled with `PUMUKI_SKIP_CHAINED_PRE_WRITE=1`. |
|
|
30
|
-
| AST Intelligence | Rules are evaluated from extracted facts and AST/text nodes, not from a README promise. Findings include severity, rule id, stage, file, line, and remediation context. |
|
|
31
|
-
| Skills enforcement | iOS, Android, backend, frontend, and common governance skills are compiled into deterministic rule coverage. AUTO rules block through detectors; declarative rules remain visible as contracts and are not silently claimed as semantic enforcement. |
|
|
32
|
-
| Evidence contract | `.ai_evidence.json` records stage, outcome, policy metadata, rule coverage, findings, and operational hints for follow-up automation. |
|
|
33
|
-
| SDD/OpenSpec flow | Enterprise repos can require SDD sessions, change folders, and stage validation before writes, commits, pushes, or CI. |
|
|
34
|
-
| Agent-ready context | `.pumuki/adapter.json` and MCP stdio commands (`pumuki-mcp-enterprise-stdio`, `pumuki-mcp-evidence-stdio`) expose the same product truth to Codex, Claude, Cursor, Windsurf, OpenCode, and other clients without making the baseline IDE-dependent. |
|
|
31
|
+
Elige un perfil y profundiza en los enlaces; **no** repite aquí reglas largas (skills, GitFlow, políticas) — están en `AGENTS.md` y en la documentación enlazada.
|
|
35
32
|
|
|
36
|
-
|
|
33
|
+
| Perfil | Qué instalar / arrancar | Stages habituales | Opcional típico |
|
|
34
|
+
|--------|-------------------------|-------------------|-----------------|
|
|
35
|
+
| **Mínimo** | `npm install --save-exact pumuki` (en repos Git el `postinstall` ejecuta baseline `pumuki install`; `--with-mcp --agent=repo` es opt-in con `PUMUKI_POSTINSTALL_WITH_MCP=1` o `PUMUKI_POSTINSTALL_MCP_AGENT=repo`). | Hooks Git: **PRE_COMMIT**, **PRE_PUSH**; cadena **PRE_WRITE** cuando el hook lo encadena (según versión y config). | Evidencia [`.ai_evidence.json` v2.1](docs/mcp/ai-evidence-v2.1-contract.md); reglas core embebidas. |
|
|
36
|
+
| **Estándar** | Lo anterior + flujo **OpenSpec/SDD** bajo `openspec/` según tu política. | Lo anterior + validación SDD por stage (`pumuki sdd validate --stage=…`). | Sesiones SDD, cambios versionados bajo `openspec/changes/`. |
|
|
37
|
+
| **Enterprise completo** | `pumuki bootstrap --enterprise` (o equivalente documentado) + `skills.lock.json` / reglas custom / [policy-as-code](docs/product/CONFIGURATION.md) donde aplique. | Lo anterior + **CI** (`pumuki-ci`) y comprobaciones de alineación (`doctor`, parity). | [Skills / MCP](docs/mcp/mcp-servers-overview.md), `pumuki doctor --parity`, notificaciones, [hard mode](docs/product/CONFIGURATION.md). |
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
fixture containing a real TypeScript file with `any` and `console.log`. They are
|
|
40
|
-
not mockups.
|
|
39
|
+
Referencias canónicas (profundizar aquí): [Instalación](docs/product/INSTALLATION.md), [Uso y gates](docs/product/USAGE.md), [Configuración](docs/product/CONFIGURATION.md), [AGENTS.md](AGENTS.md) (contrato agentes/skills/GitFlow en repos que lo adopten), [índice de documentación](docs/README.md).
|
|
41
40
|
|
|
42
|
-
|
|
41
|
+
Formación opcional (curso **Pumuki** dentro del hub *Stack My Architecture*): [https://stack-my-architecture-hub.vercel.app/pumuki/](https://stack-my-architecture-hub.vercel.app/pumuki/) · seguimiento de la iniciativa en [docs/tracking/plan-curso-pumuki-stack-my-architecture.md](docs/tracking/plan-curso-pumuki-stack-my-architecture.md).
|
|
43
42
|
|
|
44
|
-
|
|
43
|
+
## Comandos esenciales
|
|
45
44
|
|
|
46
|
-
|
|
45
|
+
Cinco entradas que cubren el 80 % del día a día en un consumidor; el detalle está en los enlaces.
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
[
|
|
50
|
-
|
|
47
|
+
1. **`npx pumuki doctor --json`** — Versión efectiva, drift, lifecycle, parity y avisos (p. ej. `pathExecutionHazard`). Detalle: [API_REFERENCE](docs/product/API_REFERENCE.md), [USAGE](docs/product/USAGE.md).
|
|
48
|
+
2. **`npx pumuki status --json`** — Estado resumido del menú/lifecycle y alineación de versión. Detalle: [USAGE](docs/product/USAGE.md).
|
|
49
|
+
3. **`npx pumuki install`** (o deja que el `postinstall` lo ejecute en Git) — Hooks y lifecycle en el repo. Detalle: [INSTALLATION](docs/product/INSTALLATION.md).
|
|
50
|
+
4. **Gates locales** — `npx pumuki-pre-write`, `npx pumuki-pre-commit` (y `pumuki-pre-push` cuando toque push). Detalle: [USAGE](docs/product/USAGE.md), [Troubleshooting (USAGE)](docs/product/USAGE.md#troubleshooting).
|
|
51
|
+
5. **SDD por stage (enterprise)** — `npx pumuki sdd validate --stage=PRE_COMMIT` (u otro stage). Detalle: [USAGE](docs/product/USAGE.md), [INSTALLATION](docs/product/INSTALLATION.md#troubleshooting) si falla el bootstrap.
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
**Desarrollo en este repo (sin depender de GitHub Actions):** barra mínima antes de merge o publicar — `npm run -s validation:local-merge-bar` (`typecheck` + smoke de superficie CLI + `npm test`). Detalle del smoke: [docs/validation/README.md](docs/validation/README.md).
|
|
53
54
|
|
|
54
|
-
|
|
55
|
+
Si algo bloquea o el mensaje no es claro: [Troubleshooting](#troubleshooting) (más abajo en este README), [USAGE § Troubleshooting](docs/product/USAGE.md#troubleshooting) y [GitHub Issues](https://github.com/SwiftEnProfundidad/ast-intelligence-hooks/issues).
|
|
56
|
+
|
|
57
|
+
## 5-Minute Quick Start (Consumer)
|
|
58
|
+
|
|
59
|
+
Prerequisites:
|
|
55
60
|
|
|
56
61
|
- Node.js `>= 18`
|
|
57
62
|
- npm `>= 9`
|
|
58
|
-
-
|
|
63
|
+
- Git repository
|
|
59
64
|
|
|
60
|
-
Install
|
|
65
|
+
Install and bootstrap:
|
|
61
66
|
|
|
62
67
|
```bash
|
|
63
|
-
npm install --save-
|
|
64
|
-
npx --yes pumuki
|
|
68
|
+
npm install --save-exact pumuki
|
|
69
|
+
npx --yes pumuki bootstrap --enterprise --agent=codex
|
|
70
|
+
npx --yes pumuki status
|
|
65
71
|
npx --yes pumuki doctor --json
|
|
66
|
-
npx --yes pumuki audit --stage=PRE_COMMIT --json
|
|
67
72
|
```
|
|
68
73
|
|
|
69
|
-
|
|
74
|
+
Desde **6.3.63**, `npm install` en la raíz de un repo **Git** dispara un `postinstall` que ejecuta baseline **`pumuki install`** (hooks `pre-commit` / `pre-push`, lifecycle, merge de **`.pumuki/adapter.json`** con comandos MCP stdio, sin rutas de IDE salvo opt-in). El wiring MCP no va activado por defecto; para activarlo en postinstall usa `PUMUKI_POSTINSTALL_WITH_MCP=1` o `PUMUKI_POSTINSTALL_MCP_AGENT=repo/cursor/claude/codex`. **Pumuki no depende de ningún IDE** para el baseline. Opt-out del postinstall: `PUMUKI_SKIP_POSTINSTALL=1`. Ficheros de IDE en postinstall: `PUMUKI_POSTINSTALL_MCP_AGENT=cursor|claude|codex` o comando manual / `bootstrap`. Desde **6.3.68**, cada hook gestionado ejecuta **`pumuki-pre-write` antes** de `pumuki-pre-commit` / `pumuki-pre-push` (stage **PRE_WRITE** vía Git). Saltar solo PRE_WRITE en hooks: `PUMUKI_SKIP_CHAINED_PRE_WRITE=1`. Desde **6.3.69**, esos mismos hooks aplican también **git-flow en ramas protegidas** (`GITFLOW_PROTECTED_BRANCH`) e **higiene de worktree** (`PUMUKI_PREWRITE_WORKTREE_*` / códigos `EVIDENCE_PREWRITE_WORKTREE_*`) cuando la evidencia es válida; el **modal macOS** de bloqueo (Desactivar / Silenciar 30 min / Mantener activas) queda **activo por defecto** si las notificaciones están habilitadas (`"blockedDialogEnabled": false` o `PUMUKI_MACOS_BLOCKED_DIALOG=0` para apagarlo). Desactivar el postinstall: `PUMUKI_SKIP_POSTINSTALL=1`. En CI suele saltarse solo (`CI=true`). En **6.3.64+**, las notificaciones del sistema en plataformas sin banner nativo se reflejan en **stderr** por defecto (`PUMUKI_DISABLE_STDERR_NOTIFICATIONS=1` para silenciarlas). En **6.3.69+**, un `gate.blocked` en macOS también deja una copia en **stderr** por defecto (`PUMUKI_DISABLE_GATE_BLOCKED_STDERR_MIRROR=1` para desactivar solo eso). Desde **6.3.70**, si **`.ai_evidence.json` está versionado** y **PRE_PUSH** no bloquea, ese archivo **no se reescribe** en el push (compatibilidad con **pre-commit** como hook de **pre-push**); para forzar escritura: `PUMUKI_PRE_PUSH_ALWAYS_WRITE_TRACKED_EVIDENCE=1`. Con modal de bloqueo activo, el panel interactivo prioriza foco/clics y se evita el banner duplicado.
|
|
75
|
+
|
|
76
|
+
Fallback (equivalent in pasos separados):
|
|
70
77
|
|
|
71
78
|
```bash
|
|
72
|
-
npx --yes pumuki-
|
|
73
|
-
npx --yes pumuki
|
|
74
|
-
npx --yes pumuki-pre-push
|
|
75
|
-
npx --yes pumuki-ci
|
|
79
|
+
npx --yes pumuki install --with-mcp --agent=codex
|
|
80
|
+
npx --yes pumuki doctor --deep --json
|
|
76
81
|
```
|
|
77
82
|
|
|
78
|
-
|
|
79
|
-
manually is useful for diagnostics, but the full signal depends on a real branch
|
|
80
|
-
and pre-push context.
|
|
81
|
-
|
|
82
|
-
Bootstrap an enterprise repo with SDD/OpenSpec and agent context:
|
|
83
|
+
OpenSpec/SDD baseline:
|
|
83
84
|
|
|
84
85
|
```bash
|
|
85
|
-
npx --yes pumuki
|
|
86
|
+
npx --yes pumuki sdd status
|
|
87
|
+
mkdir -p openspec/changes/<change-id>
|
|
86
88
|
npx --yes pumuki sdd session --open --change=<change-id>
|
|
87
|
-
npx --yes pumuki sdd validate --stage=
|
|
88
|
-
npx --yes pumuki policy reconcile --strict --apply --json
|
|
89
|
+
npx --yes pumuki sdd validate --stage=PRE_COMMIT
|
|
89
90
|
```
|
|
90
91
|
|
|
91
|
-
|
|
92
|
+
Optional loop runner session (local, deterministic):
|
|
92
93
|
|
|
93
94
|
```bash
|
|
94
|
-
npx --yes pumuki
|
|
95
|
-
npx --yes pumuki
|
|
96
|
-
|
|
95
|
+
npx --yes pumuki loop run --objective="stabilize gate before commit" --max-attempts=3 --json
|
|
96
|
+
npx --yes pumuki loop list --json
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Run local gates:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npx --yes --package pumuki@latest pumuki-pre-write
|
|
103
|
+
npx --yes --package pumuki@latest pumuki-pre-commit
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Run push/CI gates (requires proper git context):
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
git push --set-upstream origin <branch>
|
|
110
|
+
npx --yes --package pumuki@latest pumuki-pre-push
|
|
111
|
+
npx --yes --package pumuki@latest pumuki-ci
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Expected behavior:
|
|
115
|
+
|
|
116
|
+
- `PRE_WRITE` and `PRE_COMMIT`: should pass when SDD session is valid and rules are satisfied.
|
|
117
|
+
- `PRE_PUSH`: blocks if branch has no upstream tracking reference.
|
|
118
|
+
- `CI`: requires a valid diff range context (not `HEAD..HEAD` with ambiguous range).
|
|
119
|
+
|
|
120
|
+
Version drift quick check:
|
|
121
|
+
|
|
122
|
+
- `status --json` and `doctor --json` expose `version.effective`, `version.runtime`, `version.consumerInstalled`, `version.lifecycleInstalled`, `version.driftWarning`, `version.alignmentCommand`, `version.pathExecutionHazard`, `version.pathExecutionWarning`, and `version.pathExecutionWorkaroundCommand`.
|
|
123
|
+
- If `driftWarning` is not `null`, prefer the exact command already exposed in `version.alignmentCommand`.
|
|
124
|
+
- If `pathExecutionHazard` is `true`, avoid `npx/npm exec` for the install step and use the safe local workaround reported by Pumuki, for example:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
node ./node_modules/pumuki/bin/pumuki.js install
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Why Pumuki
|
|
131
|
+
|
|
132
|
+
Modern teams need fast feedback with strict governance. Pumuki combines:
|
|
133
|
+
|
|
134
|
+
- Deterministic enforcement per stage (`PRE_WRITE`, `PRE_COMMIT`, `PRE_PUSH`, `CI`).
|
|
135
|
+
- A single evidence contract (`.ai_evidence.json`, v2.1) for auditability and automation.
|
|
136
|
+
- Multi-platform governance (iOS, Android, Backend, Frontend).
|
|
137
|
+
- Unified skills engine with deterministic precedence (`core -> repo -> custom`).
|
|
138
|
+
- Mandatory OpenSpec/SDD checks for enterprise change control.
|
|
139
|
+
- Unified CLI plus optional MCP servers for agent-driven workflows.
|
|
140
|
+
|
|
141
|
+
## Enterprise Execution Model
|
|
142
|
+
|
|
143
|
+
Each execution follows the same pipeline:
|
|
144
|
+
|
|
145
|
+
1. Facts extraction from staged/range/repo scope.
|
|
146
|
+
2. Rule evaluation by platform and stage policy.
|
|
147
|
+
3. Gate decision (`PASS`, `WARN`, `BLOCK`) with deterministic thresholds.
|
|
148
|
+
4. Evidence emission (`.ai_evidence.json`) with findings, metadata, and coverage telemetry.
|
|
149
|
+
|
|
150
|
+
Rules resolution order:
|
|
151
|
+
|
|
152
|
+
1. Core rules (embedded package snapshot).
|
|
153
|
+
2. Repo rules (`skills.lock.json`), optional.
|
|
154
|
+
3. Custom rules (`.pumuki/custom-rules.json`), optional.
|
|
155
|
+
|
|
156
|
+
Conflict policy:
|
|
157
|
+
|
|
158
|
+
- `custom > repo > core` (last writer wins by `ruleId`).
|
|
159
|
+
- Platform rules activate only for detected platforms.
|
|
160
|
+
- `generic/text` rules remain available as cross-platform governance guards.
|
|
161
|
+
|
|
162
|
+
Rule modes:
|
|
163
|
+
|
|
164
|
+
- `AUTO`: mapped to deterministic detectors/heuristics.
|
|
165
|
+
- `DECLARATIVE`: valid only when explicitly declared in lock/custom payload (no silent fallback for rules extracted from skills markdown).
|
|
166
|
+
|
|
167
|
+
## Core Capabilities
|
|
168
|
+
|
|
169
|
+
1. Deterministic stage gates with consistent exit semantics.
|
|
170
|
+
2. Evidence v2.1 with rules coverage enforcement and stable ordering.
|
|
171
|
+
3. Unified skills rules engine (core + repo + custom).
|
|
172
|
+
4. Unified AI gate behavior across CLI and MCP surfaces.
|
|
173
|
+
5. Mandatory OpenSpec/SDD policy checks.
|
|
174
|
+
6. Interactive menu UX (consumer + advanced modes).
|
|
175
|
+
7. Hard mode policy hardening (`.pumuki/hard-mode.json` + env overrides).
|
|
176
|
+
8. Lifecycle commands for install/update/diagnostics/teardown.
|
|
177
|
+
9. Provider-agnostic adapter scaffolding (`codex`, `claude`, `cursor`, `windsurf`, `opencode`).
|
|
178
|
+
10. Optional MCP servers for evidence and enterprise context.
|
|
179
|
+
|
|
180
|
+
## Policy-as-Code (Enterprise)
|
|
181
|
+
|
|
182
|
+
Pumuki supports a signed and versioned stage-policy contract at:
|
|
183
|
+
|
|
184
|
+
- `.pumuki/policy-as-code.json`
|
|
185
|
+
|
|
186
|
+
Minimal contract:
|
|
187
|
+
|
|
188
|
+
```json
|
|
189
|
+
{
|
|
190
|
+
"version": "1.0",
|
|
191
|
+
"source": "default",
|
|
192
|
+
"expires_at": "2026-12-31T23:59:59.000Z",
|
|
193
|
+
"signatures": {
|
|
194
|
+
"PRE_COMMIT": "<sha256-hex>",
|
|
195
|
+
"PRE_PUSH": "<sha256-hex>",
|
|
196
|
+
"CI": "<sha256-hex>"
|
|
197
|
+
}
|
|
198
|
+
}
|
|
97
199
|
```
|
|
98
200
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
counted as semantic AST enforcement unless a detector exists.
|
|
137
|
-
- Unsupported or incomplete active-rule coverage can fail closed under strict
|
|
138
|
-
enterprise policy, because false confidence is worse than a noisy block.
|
|
139
|
-
|
|
140
|
-
`enterprise-operating-system` is the operating contract skill for project mode,
|
|
141
|
-
tracking, evidence, GitFlow, and STOP/GO discipline. It is shipped as a skill
|
|
142
|
-
contract, not as a per-file detector bundle.
|
|
143
|
-
|
|
144
|
-
## Evidence And Adapters
|
|
145
|
-
|
|
146
|
-
Pumuki writes and reads `.ai_evidence.json` as the shared audit artifact for:
|
|
147
|
-
|
|
148
|
-
- gate outcome (`ALLOW`, `WARN`, `BLOCK`)
|
|
149
|
-
- stage and policy metadata
|
|
150
|
-
- finding counts by severity
|
|
151
|
-
- rule ids, file paths, line numbers, and categories
|
|
152
|
-
- active skill coverage
|
|
153
|
-
- operational hints and next actions
|
|
154
|
-
|
|
155
|
-
When repository safety checks pass, `pumuki install` keeps the baseline
|
|
156
|
-
IDE-agnostic. Pumuki installs managed Git hooks and ensures
|
|
157
|
-
`.pumuki/adapter.json` with canonical commands for MCP stdio and agent clients.
|
|
158
|
-
IDE-specific files such as `.cursor/mcp.json` remain opt-in.
|
|
159
|
-
|
|
160
|
-
## Command Map
|
|
161
|
-
|
|
162
|
-
| Command | Purpose |
|
|
163
|
-
| --- | --- |
|
|
164
|
-
| `pumuki status --json` | Fast repository, lifecycle, version, and governance snapshot. |
|
|
165
|
-
| `pumuki doctor --json` | Deeper diagnostics for install drift, hook state, parity, and hazards. |
|
|
166
|
-
| `pumuki audit --stage=<stage> --json` | Run AST/rule analysis for a selected stage or scope. |
|
|
167
|
-
| `pumuki install` | Install or reconcile the managed baseline in a Git repository. |
|
|
168
|
-
| `pumuki bootstrap --enterprise` | Bootstrap enterprise SDD, policy, adapter, and lifecycle context. |
|
|
169
|
-
| `pumuki sdd validate --stage=<stage>` | Validate SDD/OpenSpec policy for the stage. |
|
|
170
|
-
| `pumuki policy reconcile --strict --apply` | Reconcile policy state and evidence expectations. |
|
|
171
|
-
| `pumuki-pre-write` | Stage runner for write-time governance. |
|
|
172
|
-
| `pumuki-pre-commit` | Stage runner for commit-time governance. |
|
|
173
|
-
| `pumuki-pre-push` | Stage runner for push-time governance. |
|
|
174
|
-
| `pumuki-ci` | CI runner for the same enterprise gate contract. |
|
|
175
|
-
| `pumuki-framework` / `ast-hooks` | Interactive terminal menu for operators and maintainers. |
|
|
176
|
-
|
|
177
|
-
## What Pumuki Is Not
|
|
178
|
-
|
|
179
|
-
Pumuki is not the business product in your repository. It does not replace unit
|
|
180
|
-
tests, domain acceptance tests, API contracts, threat modeling, or human review.
|
|
181
|
-
It enforces the governance contract that the repository declares and the rules
|
|
182
|
-
that Pumuki can prove through facts, AST Intelligence, skills, and evidence.
|
|
183
|
-
|
|
184
|
-
It is also not IDE magic. MCP servers and adapter files give agents a canonical
|
|
185
|
-
way to ask for context and gate state, but Git hooks and CI remain the hard
|
|
186
|
-
enforcement path.
|
|
187
|
-
|
|
188
|
-
## Documentation
|
|
189
|
-
|
|
190
|
-
- [Installation](docs/product/INSTALLATION.md)
|
|
191
|
-
- [Usage](docs/product/USAGE.md)
|
|
192
|
-
- [Configuration](docs/product/CONFIGURATION.md)
|
|
193
|
-
- [API reference](docs/product/API_REFERENCE.md)
|
|
194
|
-
- [MCP servers](docs/mcp/mcp-servers-overview.md)
|
|
195
|
-
- [Evidence v2.1 contract](docs/mcp/ai-evidence-v2.1-contract.md)
|
|
196
|
-
- [Validation index](docs/validation/README.md)
|
|
197
|
-
- [Documentation index](docs/README.md)
|
|
198
|
-
|
|
199
|
-
## Maintainer Flow
|
|
201
|
+
Runtime behavior:
|
|
202
|
+
|
|
203
|
+
- If the contract is missing, Pumuki computes deterministic local metadata and still emits `policy_version`, `policy_signature`, and `policy_source`.
|
|
204
|
+
- If present, the contract is validated against active runtime policy for source/stage/signature.
|
|
205
|
+
- Validation states are emitted as `valid`, `invalid`, `expired`, or `unknown-source`.
|
|
206
|
+
- `PUMUKI_POLICY_STRICT=1` turns non-valid states into blocking findings (`governance.policy-as-code.invalid`).
|
|
207
|
+
|
|
208
|
+
Operational fallback:
|
|
209
|
+
|
|
210
|
+
- Keep strict mode disabled while bootstrapping a repo without a canonical contract.
|
|
211
|
+
- Enable strict mode once contract generation/signatures are part of your baseline pipeline.
|
|
212
|
+
|
|
213
|
+
## Telemetry Export (Enterprise)
|
|
214
|
+
|
|
215
|
+
Pumuki can export structured gate telemetry with a stable event schema (`telemetry_event_v1`) for SIEM/observability pipelines.
|
|
216
|
+
|
|
217
|
+
Default behavior remains unchanged: telemetry export is disabled unless explicitly configured.
|
|
218
|
+
|
|
219
|
+
Enable one or both outputs:
|
|
220
|
+
|
|
221
|
+
- `PUMUKI_TELEMETRY_JSONL_PATH`: local JSONL target (absolute or repo-relative path)
|
|
222
|
+
- `PUMUKI_TELEMETRY_OTEL_ENDPOINT`: OTLP HTTP logs endpoint (`/v1/logs`)
|
|
223
|
+
- `PUMUKI_TELEMETRY_OTEL_SERVICE_NAME`: optional OTel service name (default: `pumuki`)
|
|
224
|
+
- `PUMUKI_TELEMETRY_OTEL_TIMEOUT_MS`: optional OTel timeout in ms (default: `1500`)
|
|
225
|
+
|
|
226
|
+
Example:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
export PUMUKI_TELEMETRY_JSONL_PATH=".pumuki/artifacts/gate-telemetry.jsonl"
|
|
230
|
+
export PUMUKI_TELEMETRY_OTEL_ENDPOINT="https://otel.example/v1/logs"
|
|
231
|
+
export PUMUKI_TELEMETRY_OTEL_SERVICE_NAME="pumuki-enterprise"
|
|
232
|
+
npx --yes --package pumuki@latest pumuki-pre-commit
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Each event captures deterministic stage/outcome/policy/repo context per gate execution.
|
|
236
|
+
|
|
237
|
+
## Framework Maintainer Flow (This Repo)
|
|
200
238
|
|
|
201
239
|
Use this only when working in the Pumuki framework repository itself:
|
|
202
240
|
|
|
203
241
|
```bash
|
|
204
242
|
npm run framework:menu
|
|
243
|
+
PUMUKI_MENU_UI_V2=1 npm run framework:menu
|
|
205
244
|
PUMUKI_MENU_MODE=advanced npm run framework:menu
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Skills engine operations:
|
|
248
|
+
|
|
249
|
+
```bash
|
|
206
250
|
npm run skills:compile
|
|
207
251
|
npm run skills:lock:check
|
|
208
|
-
npm run
|
|
209
|
-
npm
|
|
252
|
+
npm run skills:import:custom
|
|
253
|
+
npm run skills:import:custom -- --source <absolute-path-to-SKILL.md> --source <second-absolute-path-to-SKILL.md>
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Adapter scaffolding:
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
npx --yes pumuki adapter install --agent=codex --dry-run
|
|
260
|
+
npx --yes pumuki adapter install --agent=cursor
|
|
261
|
+
npm run adapter:install -- --agent=claude
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Operational matrix/canary:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
node --import tsx -e "const mod = await import('./scripts/framework-menu-matrix-runner-lib.ts'); const report = await mod.default.runConsumerMenuMatrix({ repoRoot: process.cwd() }); console.log(JSON.stringify(report, null, 2));"
|
|
268
|
+
node --import tsx -e "const mod = await import('./scripts/framework-menu-matrix-canary-lib.ts'); const report = await mod.default.runConsumerMenuCanary({ repoRoot: process.cwd() }); console.log(JSON.stringify(report, null, 2));"
|
|
210
269
|
```
|
|
211
270
|
|
|
212
|
-
|
|
213
|
-
|
|
271
|
+
Legacy parity report (strict comparator):
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
node --import tsx scripts/build-legacy-parity-report.ts --legacy=<legacy-evidence-path> --enterprise=<enterprise-evidence-path> --out=<output-path>
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## Command Paths
|
|
278
|
+
|
|
279
|
+
Use these docs instead of treating `README.md` as the full command manual:
|
|
280
|
+
|
|
281
|
+
- Installation and bootstrap:
|
|
282
|
+
- `docs/product/INSTALLATION.md`
|
|
283
|
+
- Daily usage, gates, menu, lifecycle, SDD and troubleshooting:
|
|
284
|
+
- `docs/product/USAGE.md`
|
|
285
|
+
- Operator-focused short playbook:
|
|
286
|
+
- `PUMUKI.md`
|
|
287
|
+
- Validation runbooks and framework-only diagnostics:
|
|
288
|
+
- `docs/validation/README.md`
|
|
289
|
+
|
|
290
|
+
## Menu Walkthrough and Screenshots
|
|
291
|
+
|
|
292
|
+
### Capture 1 — Consumer Menu (archived v2)
|
|
293
|
+
|
|
294
|
+

|
|
295
|
+
|
|
296
|
+
Canonical consumer legacy reference:
|
|
297
|
+
|
|
298
|
+
- Git tag `v0-legacy-last`, `scripts/hooks-system/infrastructure/shell/orchestrators/audit-orchestrator.sh`
|
|
299
|
+
|
|
300
|
+
### Capture 2 — Archived v2 Full-Audit Pre-flight (BLOCK context)
|
|
301
|
+
|
|
302
|
+

|
|
303
|
+
|
|
304
|
+
### Capture 3 — Archived v2 Full-Audit Final Summary (BLOCK)
|
|
305
|
+
|
|
306
|
+

|
|
307
|
+
|
|
308
|
+
### Capture 4 — Archived v2 Full-Audit Pre-flight (PASS scenario)
|
|
309
|
+
|
|
310
|
+

|
|
311
|
+
|
|
312
|
+
### Capture 5 — Archived v2 Full-Audit Final Summary (PASS)
|
|
313
|
+
|
|
314
|
+

|
|
315
|
+
|
|
316
|
+
### Capture 6 — Menu Status After PASS Run
|
|
317
|
+
|
|
318
|
+

|
|
319
|
+
|
|
320
|
+
Extended annotated walkthrough:
|
|
321
|
+
|
|
322
|
+
- `docs/operations/framework-menu-consumer-walkthrough.md`
|
|
323
|
+
|
|
324
|
+
## Enterprise Operations Baseline
|
|
325
|
+
|
|
326
|
+
Pumuki production SaaS operation baseline is defined in:
|
|
327
|
+
|
|
328
|
+
- `docs/operations/production-operations-policy.md`
|
|
329
|
+
|
|
330
|
+
Highlights:
|
|
331
|
+
|
|
332
|
+
- Minimum SLO/SLA targets for ingestion availability, latency, freshness, and isolation.
|
|
333
|
+
- Severity model (`SEV1/SEV2/SEV3`) with response and RCA expectations.
|
|
334
|
+
- Mandatory controls for tenant/repo isolation, auth policy, idempotency, and auditing.
|
|
335
|
+
- Go-live checklist and rollback requirements.
|
|
336
|
+
|
|
337
|
+
## Troubleshooting
|
|
338
|
+
|
|
339
|
+
- `OpenSpec change "<id>" not found`: ensure `openspec/changes/<id>` exists before opening session.
|
|
340
|
+
- `SDD_SESSION_MISSING`: open and validate session first.
|
|
341
|
+
- `pre-push blocked: branch has no upstream`: run `git push --set-upstream origin <branch>`.
|
|
342
|
+
- `Missing required argument --repo` / `--repo-path`: pass required flags for validation scripts.
|
|
343
|
+
- Legacy parity report usage requires `--legacy=<path>` and `--enterprise=<path>` (equals form).
|
|
344
|
+
- If menu v2 rendering fails, Pumuki falls back to classic UI.
|
|
345
|
+
|
|
346
|
+
## Documentation Index
|
|
347
|
+
|
|
348
|
+
- Installation: `docs/product/INSTALLATION.md`
|
|
349
|
+
- Usage: `docs/product/USAGE.md`
|
|
350
|
+
- Backlog tooling quick nav (incluye snippet terminal): `docs/product/USAGE.md#backlog-tooling`
|
|
351
|
+
- Backlog reasons shared module: `docs/product/USAGE.md#backlog-reasons`
|
|
352
|
+
- Testing: `docs/product/TESTING.md`
|
|
353
|
+
- API reference: `docs/product/API_REFERENCE.md`
|
|
354
|
+
- Architecture: `docs/product/ARCHITECTURE.md`
|
|
355
|
+
- Configuration: `docs/product/CONFIGURATION.md`
|
|
356
|
+
- Code standards: `docs/governance/CODE_STANDARDS.md`
|
|
357
|
+
- Branch protection: `docs/governance/BRANCH_PROTECTION_GUIDE.md`
|
|
358
|
+
- MCP servers: `docs/mcp/mcp-servers-overview.md`
|
|
359
|
+
- MCP evidence server: `docs/mcp/evidence-context-server.md`
|
|
360
|
+
- MCP consumption: `docs/mcp/agent-context-consumption.md`
|
|
361
|
+
- Evidence schema v2.1: `docs/mcp/ai-evidence-v2.1-contract.md`
|
|
362
|
+
- Operations policy (SLA/SLO): `docs/operations/production-operations-policy.md`
|
|
363
|
+
- Release notes: `docs/operations/RELEASE_NOTES.md`
|
|
364
|
+
- Changelog: `CHANGELOG.md`
|
|
365
|
+
|
|
366
|
+
## Collaboration
|
|
367
|
+
|
|
368
|
+
Contributions are welcome. For high-quality collaboration:
|
|
369
|
+
|
|
370
|
+
1. Read `docs/governance/CONTRIBUTING.md` and `docs/governance/CODE_STANDARDS.md`.
|
|
371
|
+
2. Create a dedicated branch per change.
|
|
372
|
+
3. Keep scope focused and include deterministic evidence when relevant.
|
|
373
|
+
4. Before opening a PR, run at least:
|
|
374
|
+
- `npm run typecheck`
|
|
375
|
+
- `npm run -s test:backlog-tooling`
|
|
376
|
+
- `npm run test:operational-memory`
|
|
377
|
+
- `npm run test:saas-ingestion`
|
|
378
|
+
5. Open a PR with clear problem statement, approach, and validation evidence.
|
|
379
|
+
|
|
380
|
+
## Support and Security
|
|
381
|
+
|
|
382
|
+
- Functional/usage issues: open a GitHub issue with reproducible steps.
|
|
383
|
+
- Enterprise diagnostics: include generated reports from `.audit-reports` when applicable.
|
|
384
|
+
- Security-sensitive findings: use GitHub Security Advisories for coordinated disclosure.
|
|
385
|
+
|
|
386
|
+
## License
|
|
387
|
+
|
|
388
|
+
MIT. See `LICENSE`.
|
|
389
|
+
|
|
390
|
+
## If Pumuki Helped You
|
|
391
|
+
|
|
392
|
+
If this project was useful for your team, please consider leaving a GitHub star:
|
|
393
|
+
|
|
394
|
+
[Star Pumuki on GitHub](https://github.com/SwiftEnProfundidad/ast-intelligence-hooks)
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
v6.3.
|
|
1
|
+
v6.3.171
|
|
@@ -683,46 +683,10 @@ func trackForMemoryLeaks(_ instance: AnyObject, file: StaticString = #filePath,
|
|
|
683
683
|
addTeardownBlock { _ = instance }
|
|
684
684
|
}
|
|
685
685
|
`;
|
|
686
|
-
const ruralGoHelperSource = `
|
|
687
|
-
import XCTest
|
|
688
|
-
|
|
689
|
-
final class WeakReference<T: AnyObject> {
|
|
690
|
-
weak var value: T?
|
|
691
|
-
|
|
692
|
-
init(_ value: T) {
|
|
693
|
-
self.value = value
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
func trackForMemoryLeaks(
|
|
698
|
-
_ instance: AnyObject,
|
|
699
|
-
testCase: XCTestCase,
|
|
700
|
-
file: StaticString = #filePath,
|
|
701
|
-
line: UInt = #line
|
|
702
|
-
) {
|
|
703
|
-
nonisolated(unsafe) let reference = makeSUT(instance)
|
|
704
|
-
testCase.addTeardownBlock {
|
|
705
|
-
XCTAssertNil(
|
|
706
|
-
reference.value,
|
|
707
|
-
"Instance should have been deallocated. Potential memory leak.",
|
|
708
|
-
file: file,
|
|
709
|
-
line: line
|
|
710
|
-
)
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
private func makeSUT<T: AnyObject>(_ instance: T) -> WeakReference<T> {
|
|
715
|
-
WeakReference(instance)
|
|
716
|
-
}
|
|
717
|
-
`;
|
|
718
686
|
|
|
719
687
|
assert.equal(hasSwiftLegacyXCTestImportUsage(helperSource), false);
|
|
720
688
|
assert.equal(hasSwiftModernizableXCTestSuiteUsage(helperSource), false);
|
|
721
689
|
assert.equal(hasSwiftXCTestAssertionUsage(helperSource), false);
|
|
722
|
-
assert.equal(hasSwiftLegacyXCTestImportUsage(ruralGoHelperSource), false);
|
|
723
|
-
assert.equal(hasSwiftModernizableXCTestSuiteUsage(ruralGoHelperSource), false);
|
|
724
|
-
assert.equal(hasSwiftXCTestAssertionUsage(ruralGoHelperSource), false);
|
|
725
|
-
assert.equal(hasSwiftXCTUnwrapUsage(ruralGoHelperSource), false);
|
|
726
690
|
});
|
|
727
691
|
|
|
728
692
|
test('hasSwiftXCTUnwrapUsage detecta XCTUnwrap real y evita strings', () => {
|