pumuki 6.3.375 → 6.3.377

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/README.md CHANGED
@@ -1,390 +1,612 @@
1
1
  # Pumuki
2
2
 
3
- <img src="assets/logo.png" alt="Pumuki" width="100%" />
3
+ <p align="center">
4
+ <img src="assets/logo_banner.png" alt="Pumuki" width="100%" />
5
+ </p>
4
6
 
5
- [![npm version](https://img.shields.io/npm/v/pumuki?color=1d4ed8)](https://www.npmjs.com/package/pumuki)
6
- [![CI](https://github.com/SwiftEnProfundidad/ast-intelligence-hooks/actions/workflows/ci.yml/badge.svg)](https://github.com/SwiftEnProfundidad/ast-intelligence-hooks/actions/workflows/ci.yml)
7
- [![License](https://img.shields.io/badge/license-MIT-16a34a)](LICENSE)
7
+ <p align="center">
8
+ <a href="https://www.npmjs.com/package/pumuki"><img src="https://img.shields.io/npm/v/pumuki?color=1d4ed8" alt="npm version" /></a>
9
+ <a href="https://github.com/SwiftEnProfundidad/ast-intelligence-hooks/actions/workflows/ci.yml"><img src="https://github.com/SwiftEnProfundidad/ast-intelligence-hooks/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
10
+ <img src="https://img.shields.io/node/v/pumuki" alt="Node.js version" />
11
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-16a34a" alt="License: MIT" /></a>
12
+ </p>
8
13
 
9
- Enterprise governance framework for AI-assisted software delivery.
14
+ Pumuki is an enterprise governance framework for AI-assisted software delivery.
10
15
 
11
- Pumuki gives engineering teams one deterministic execution model across local development, hooks, and CI:
16
+ It turns repository rules, SDD/OpenSpec workflow, Git hooks, AST intelligence, skills contracts, evidence, notifications, an interactive menu and optional MCP servers into one deterministic delivery contract:
12
17
 
13
- `Facts -> Rules -> Gate -> .ai_evidence.json (v2.1)`
18
+ ```text
19
+ Facts -> Rules -> Gate -> Evidence
20
+ ```
14
21
 
15
- ## Qué NO es Pumuki
22
+ Pumuki is built for teams that need AI agents and humans to follow the same engineering law: know the active change, evaluate the real diff, block unsafe delivery, explain the reason in developer language, and leave auditable evidence.
16
23
 
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**.
24
+ Current maturity: **advanced beta**. The framework is already useful for governed internal adoption and consumer-repository rollout, but the project is still evolving quickly.
20
25
 
21
- ## Who This README Is For
26
+ ## Contents
22
27
 
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) |
28
+ - [Why Pumuki Exists](#why-pumuki-exists)
29
+ - [What Pumuki Does](#what-pumuki-does)
30
+ - [Architecture](#architecture)
31
+ - [Quick Start](#quick-start)
32
+ - [Installation](#installation)
33
+ - [Uninstallation and Upgrade](#uninstallation-and-upgrade)
34
+ - [Command Reference](#command-reference)
35
+ - [Git Hooks and CI](#git-hooks-and-ci)
36
+ - [SDD and OpenSpec](#sdd-and-openspec)
37
+ - [Session Continuity and AI Window Handoff](#session-continuity-and-ai-window-handoff)
38
+ - [AST Intelligence and Rule Packs](#ast-intelligence-and-rule-packs)
39
+ - [Evidence](#evidence)
40
+ - [Menu and Notifications](#menu-and-notifications)
41
+ - [MCP and Agent Adapters](#mcp-and-agent-adapters)
42
+ - [Enterprise Operations](#enterprise-operations)
43
+ - [Adoption Models](#adoption-models)
44
+ - [Troubleshooting](#troubleshooting)
45
+ - [Documentation](#documentation)
46
+ - [Contributing](#contributing)
47
+ - [License](#license)
28
48
 
29
- ## Rutas de adopción
49
+ ## Why Pumuki Exists
30
50
 
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.
51
+ AI-assisted development increases delivery speed, but it also increases the risk of ungoverned changes: skipped tests, missing specs, vague evidence, mixed commits, stale repo context, unsafe hooks, and rules that live only in documentation.
32
52
 
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). |
53
+ Pumuki makes those rules executable.
38
54
 
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).
55
+ It is designed to answer operational questions before a change enters the repository:
40
56
 
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).
57
+ | Question | Pumuki answer |
58
+ |---|---|
59
+ | What is being changed? | Git scope, SDD context and repository facts. |
60
+ | Which rules apply? | Platform rule packs, skills contracts, policy-as-code and project overrides. |
61
+ | Can this change proceed? | Deterministic gate decision per stage. |
62
+ | Why was it blocked? | Developer-facing cause, file, rule and remediation. |
63
+ | What evidence remains? | `.ai_evidence.json` v2.1 plus optional MCP/telemetry access. |
42
64
 
43
- ## Comandos esenciales
65
+ Pumuki does not replace product tests, code review, domain acceptance criteria or security review. It enforces the delivery contract around them.
44
66
 
45
- Cinco entradas que cubren el 80 % del día a día en un consumidor; el detalle está en los enlaces.
67
+ ## What Pumuki Does
46
68
 
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.
69
+ Pumuki provides a governed delivery surface for modern repositories:
52
70
 
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).
71
+ | Capability | What it provides |
72
+ |---|---|
73
+ | Git lifecycle | Managed `pre-commit` and `pre-push` hooks, with chained `PRE_WRITE` by default. |
74
+ | Stage gates | `PRE_WRITE`, `PRE_COMMIT`, `PRE_PUSH` and `CI` policies with deterministic semantics. |
75
+ | Full audit | `pumuki audit` for tracked-repository evaluation outside a hook. |
76
+ | SDD/OpenSpec | Change sessions, validation, evidence sync and state sync. |
77
+ | Session continuity | Repo-owned context, SDD state, evidence and MCP resources so a new AI window can resume from facts instead of chat memory. |
78
+ | AST intelligence | Rule-backed findings for iOS, Android, backend, frontend and generic TypeScript patterns. |
79
+ | Skills contracts | Compiled rules from enterprise skills, with coverage checks and missing-detector protection. |
80
+ | Evidence | Stable `.ai_evidence.json` v2.1 snapshots for auditability and automation. |
81
+ | Developer UX | Interactive menu, clear blocking messages, terminal output and system notifications. |
82
+ | MCP | Optional evidence and enterprise MCP servers over HTTP or stdio. |
83
+ | Adapters | Provider-agnostic adapter scaffolding for Codex, Claude, Cursor, Windsurf and Opencode. |
84
+ | Policy-as-code | Optional signed stage-policy contract under `.pumuki/policy-as-code.json`. |
85
+ | Telemetry | Optional JSONL and OTLP export for enterprise observability. |
86
+ | Brownfield control | Scope-aware gates that avoid blocking a slice for unrelated historical debt. |
87
+
88
+ ## Architecture
89
+
90
+ <p align="center">
91
+ <img src="assets/readme/pumuki-governance-flow.svg" alt="Pumuki governance flow" width="100%" />
92
+ </p>
93
+
94
+ Pumuki keeps product decisions deterministic by separating domain logic from integrations:
95
+
96
+ | Layer | Responsibility |
97
+ |---|---|
98
+ | `core/*` | Facts, rules, rule presets and gate decision model. |
99
+ | `integrations/*` | Git scopes, stage policies, evidence, SDD, MCP, notifications and lifecycle adapters. |
100
+ | `bin/*` | Public CLI binaries published by npm. |
101
+ | `docs/*` | Product documentation, operation guides, MCP contracts and rule-pack references. |
102
+ | `vendor/skills/*` | Vendored enterprise skill contracts consumed by the rules compiler. |
103
+
104
+ Core pipeline:
105
+
106
+ ```text
107
+ Git scope / repo state
108
+ -> fact extraction
109
+ -> platform detection
110
+ -> rule-pack and skills loading
111
+ -> stage policy evaluation
112
+ -> gate decision
113
+ -> evidence, notification and optional MCP/telemetry output
114
+ ```
54
115
 
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).
116
+ Pumuki is IDE-agnostic at baseline. Git hooks, gates, lifecycle, evidence and policy enforcement do not require Cursor, Codex, Claude or any other IDE. IDE/client files are opt-in adapter output.
56
117
 
57
- ## 5-Minute Quick Start (Consumer)
118
+ ## Quick Start
58
119
 
59
120
  Prerequisites:
60
121
 
61
- - Node.js `>= 18`
62
- - npm `>= 9`
122
+ - Node.js `>=18`
123
+ - npm `>=9`
63
124
  - Git repository
64
125
 
65
- Install and bootstrap:
126
+ Install Pumuki in a consumer repository:
66
127
 
67
128
  ```bash
68
129
  npm install --save-exact pumuki
69
- npx --yes pumuki bootstrap --enterprise --agent=codex
70
- npx --yes pumuki status
71
- npx --yes pumuki doctor --json
130
+ npx --yes pumuki bootstrap --enterprise
131
+ npx --yes pumuki status --json
132
+ npx --yes pumuki doctor --deep --json
72
133
  ```
73
134
 
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):
135
+ After bootstrap, the normal developer path is intentionally small:
77
136
 
78
137
  ```bash
79
- npx --yes pumuki install --with-mcp --agent=codex
80
- npx --yes pumuki doctor --deep --json
138
+ git add <files>
139
+ git commit
140
+ git push
81
141
  ```
82
142
 
83
- OpenSpec/SDD baseline:
143
+ Managed hooks run the required Pumuki lifecycle automatically. Teams only reach for explicit commands when they need setup, diagnostics, CI wiring, SDD evidence, MCP servers or operational recovery.
144
+
145
+ Open a governed SDD change session when the repository requires explicit SDD/OpenSpec control:
84
146
 
85
147
  ```bash
86
148
  npx --yes pumuki sdd status
87
- mkdir -p openspec/changes/<change-id>
88
149
  npx --yes pumuki sdd session --open --change=<change-id>
89
- npx --yes pumuki sdd validate --stage=PRE_COMMIT
150
+ npx --yes pumuki sdd validate --stage=PRE_COMMIT --json
90
151
  ```
91
152
 
92
- Optional loop runner session (local, deterministic):
153
+ Run a full tracked-repository audit only for diagnostics or governance reporting:
93
154
 
94
155
  ```bash
95
- npx --yes pumuki loop run --objective="stabilize gate before commit" --max-attempts=3 --json
96
- npx --yes pumuki loop list --json
156
+ npx --yes pumuki audit --json
157
+ npx --yes pumuki audit --stage=CI --engine --json
97
158
  ```
98
159
 
99
- Run local gates:
160
+ ## Installation
161
+
162
+ ### Consumer Repository
163
+
164
+ Recommended enterprise path:
100
165
 
101
166
  ```bash
102
- npx --yes --package pumuki@latest pumuki-pre-write
103
- npx --yes --package pumuki@latest pumuki-pre-commit
167
+ npm install --save-exact pumuki
168
+ npx --yes pumuki bootstrap --enterprise
104
169
  ```
105
170
 
106
- Run push/CI gates (requires proper git context):
171
+ What the bootstrap path does:
172
+
173
+ - installs managed Git hooks;
174
+ - configures lifecycle state;
175
+ - creates `.pumuki/adapter.json` when missing;
176
+ - prepares OpenSpec/SDD baseline where applicable;
177
+ - initializes evidence when missing;
178
+ - runs deep diagnostics.
179
+
180
+ The package `postinstall` runs a baseline `pumuki install` in Git repositories unless disabled. That baseline is IDE-agnostic: hooks, lifecycle and `.pumuki/adapter.json` are the default product surface.
181
+
182
+ Useful postinstall controls:
183
+
184
+ | Variable | Effect |
185
+ |---|---|
186
+ | `PUMUKI_SKIP_POSTINSTALL=1` | Disable postinstall bootstrap. |
187
+ | `PUMUKI_POSTINSTALL_WITH_MCP=1` | Include MCP wiring during postinstall. |
188
+ | `PUMUKI_POSTINSTALL_MCP_AGENT=<agent>` | Select optional adapter/client wiring for postinstall. |
189
+ | `PUMUKI_SKIP_CHAINED_PRE_WRITE=1` | Skip chained `PRE_WRITE` inside managed hooks. |
190
+
191
+ ### Framework Repository
192
+
193
+ For maintainers of this repository:
107
194
 
108
195
  ```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
196
+ git clone https://github.com/SwiftEnProfundidad/ast-intelligence-hooks.git
197
+ cd ast-intelligence-hooks
198
+ npm ci
199
+ npm run -s typecheck
200
+ npm run -s test:deterministic
112
201
  ```
113
202
 
114
- Expected behavior:
203
+ ## Uninstallation and Upgrade
115
204
 
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).
205
+ Plain npm removal only removes the dependency. It does not remove managed lifecycle state.
119
206
 
120
- Version drift quick check:
207
+ | Goal | Command |
208
+ |---|---|
209
+ | Remove managed hooks and purge runtime artifacts | `npx --yes pumuki uninstall --purge-artifacts` |
210
+ | Remove lifecycle and dependency from package manifests | `npx --yes pumuki remove` |
211
+ | Update to latest package and reapply hooks | `npx --yes pumuki update --latest` |
212
+ | Standard npm dependency removal only | `npm uninstall pumuki` |
121
213
 
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:
214
+ Recommended upgrade check:
125
215
 
126
216
  ```bash
127
- node ./node_modules/pumuki/bin/pumuki.js install
217
+ npm install --save-exact pumuki@latest
218
+ npx --yes pumuki status --json
219
+ npx --yes pumuki doctor --deep --json
220
+ npx --yes pumuki policy reconcile --strict --json
128
221
  ```
129
222
 
130
- ## Why Pumuki
223
+ If `status` or `doctor` reports version drift, use the `alignmentCommand` printed in the JSON payload.
224
+
225
+ ## Command Reference
226
+
227
+ The main lifecycle binary is `pumuki`. This section is an operator reference, not the expected daily developer workflow. The intended enterprise path is progressive disclosure:
228
+
229
+ 1. `bootstrap` once per repository.
230
+ 2. work through normal Git operations.
231
+ 3. let managed hooks, CI and policy decide automatically.
232
+ 4. use explicit commands only for diagnostics, evidence, adapters, SDD operations or automation.
233
+
234
+ ```text
235
+ pumuki --version | -v
236
+ pumuki bootstrap [--enterprise] [--agent=<name>] [--json]
237
+ pumuki install [--with-mcp] [--agent=<name>]
238
+ pumuki uninstall [--purge-artifacts]
239
+ pumuki remove
240
+ pumuki update [--latest|--spec=<package-spec>]
241
+ pumuki doctor [--remote-checks] [--deep] [--parity] [--json]
242
+ pumuki audit [--stage=PRE_WRITE|PRE_COMMIT|PRE_PUSH|CI] [--engine] [--json]
243
+ pumuki status [--json] [--remote-checks]
244
+ pumuki menu
245
+ pumuki watch [--stage=<stage>] [--scope=<scope>] [--once] [--json]
246
+ pumuki loop run --objective=<text> [--max-attempts=<n>] [--json]
247
+ pumuki adapter install --agent=<name> [--dry-run] [--json]
248
+ pumuki analytics hotspots report [--top=<n>] [--since-days=<n>] [--json]
249
+ pumuki analytics hotspots diagnose [--json]
250
+ pumuki policy reconcile [--strict] [--apply] [--json]
251
+ pumuki context init|status|repair [--json]
252
+ pumuki sdd status|validate|session|sync-docs|sync|learn|auto-sync|evidence|state-sync
253
+ ```
131
254
 
132
- Modern teams need fast feedback with strict governance. Pumuki combines:
255
+ Published binaries:
133
256
 
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.
257
+ | Binary | Purpose |
258
+ |---|---|
259
+ | `pumuki` | Main lifecycle CLI. |
260
+ | `pumuki-framework`, `pumuki-ast-hooks`, `ast-hooks` | Interactive framework/menu entrypoints. |
261
+ | `pumuki-pre-write` | PRE_WRITE gate and SDD policy surface. |
262
+ | `pumuki-pre-commit` | PRE_COMMIT hook runner. |
263
+ | `pumuki-pre-push` | PRE_PUSH hook runner. |
264
+ | `pumuki-ci` | CI gate runner. |
265
+ | `pumuki-mcp-evidence` | Evidence MCP HTTP server. |
266
+ | `pumuki-mcp-enterprise` | Enterprise MCP HTTP server. |
267
+ | `pumuki-mcp-evidence-stdio` | Evidence MCP stdio bridge. |
268
+ | `pumuki-mcp-enterprise-stdio` | Enterprise MCP stdio bridge. |
140
269
 
141
- ## Enterprise Execution Model
270
+ Detailed command documentation:
142
271
 
143
- Each execution follows the same pipeline:
272
+ - [Installation Guide](docs/product/INSTALLATION.md)
273
+ - [Usage Guide](docs/product/USAGE.md)
274
+ - [API Reference](docs/product/API_REFERENCE.md)
275
+ - [Operator Playbook](PUMUKI.md)
144
276
 
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.
277
+ ## Git Hooks and CI
149
278
 
150
- Rules resolution order:
279
+ Pumuki evaluates different scopes per stage:
151
280
 
152
- 1. Core rules (embedded package snapshot).
153
- 2. Repo rules (`skills.lock.json`), optional.
154
- 3. Custom rules (`.pumuki/custom-rules.json`), optional.
281
+ | Stage | Typical trigger | Scope | Purpose |
282
+ |---|---|---|---|
283
+ | `PRE_WRITE` | Before hook execution or explicit guard | Active write/session context | Prevent unmanaged agent work and invalid SDD state. |
284
+ | `PRE_COMMIT` | `pre-commit` | `git diff --cached` | Protect the atomic commit. |
285
+ | `PRE_PUSH` | `pre-push` | `upstream..HEAD` | Protect outgoing branch range. |
286
+ | `CI` | CI job | CI base range | Repeat the same governance outside the laptop. |
287
+ | `audit` | Manual CLI | Git tracked files | Diagnose the full tracked repository. |
155
288
 
156
- Conflict policy:
289
+ Managed `pre-commit` and `pre-push` hooks run `pumuki-pre-write` first by default, then the stage runner. Use `PUMUKI_SKIP_CHAINED_PRE_WRITE=1` only for explicit operational exceptions.
157
290
 
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.
291
+ CI entrypoint:
161
292
 
162
- Rule modes:
293
+ ```bash
294
+ npx --yes --package pumuki@latest pumuki-ci
295
+ ```
163
296
 
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).
297
+ When GitHub Actions quota or remote CI is not available, this repository uses local validation as the operational merge bar:
166
298
 
167
- ## Core Capabilities
299
+ ```bash
300
+ npm run -s validation:local-merge-bar
301
+ ```
168
302
 
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.
303
+ ## SDD and OpenSpec
179
304
 
180
- ## Policy-as-Code (Enterprise)
305
+ Pumuki supports a mandatory SDD/OpenSpec delivery workflow for enterprise repositories.
181
306
 
182
- Pumuki supports a signed and versioned stage-policy contract at:
307
+ Common commands:
183
308
 
184
- - `.pumuki/policy-as-code.json`
309
+ ```bash
310
+ npx --yes pumuki sdd status --json
311
+ npx --yes pumuki sdd session --open --change=<change-id> --json
312
+ npx --yes pumuki sdd session --refresh --ttl-minutes=90 --json
313
+ npx --yes pumuki sdd validate --stage=PRE_WRITE --json
314
+ npx --yes pumuki sdd evidence --scenario-id=<id> --test-command='<command>' --test-status=passed --json
315
+ npx --yes pumuki sdd state-sync --scenario-id=<id> --status=done --dry-run --json
316
+ ```
317
+
318
+ Stage aliases:
319
+
320
+ | Alias | Stage |
321
+ |---|---|
322
+ | `RED` | `PRE_WRITE` |
323
+ | `GREEN` | `PRE_COMMIT` |
324
+ | `REFACTOR` | `PRE_PUSH` |
325
+ | `CLOSE` | `CI` |
185
326
 
186
- Minimal contract:
327
+ OpenSpec is resolved from the checked repository, not from a random global binary on `PATH`. Install or bootstrap Pumuki inside the repository so local and CI behavior match.
187
328
 
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
- }
329
+ ## Session Continuity and AI Window Handoff
330
+
331
+ Pumuki is designed for AI-assisted work where the chat window, IDE session or CLI agent can change before the repository work is finished.
332
+
333
+ It does not claim to preserve private conversational memory from a vendor window. Instead, it externalizes the operational context that matters into repository-owned, auditable state:
334
+
335
+ | Context surface | What it preserves |
336
+ |---|---|
337
+ | `.pumuki/context/context.json` | Local context contract for the repository and the instruction that an AI agent must stop if the context cannot be read or validated. |
338
+ | `pumuki context init|status|repair` | Initialize, validate or repair the local context gate before edits, audits, commits or pushes. |
339
+ | SDD/OpenSpec session state | Active change id, session validity and stage validation through `pumuki sdd status`, `session` and `validate`. |
340
+ | `.ai_evidence.json` v2.1 | Last gate snapshot, findings, platform detection, rule provenance, severity breakdown and operational hints. |
341
+ | Managed hooks and receipts | PRE_WRITE/PRE_COMMIT/PRE_PUSH/CI decisions, MCP receipt freshness and evidence age. |
342
+ | MCP resources | Provider-agnostic resources such as `context://active`, `sdd://status`, `sdd://active-change`, `gitflow://state` and `evidence://status`. |
343
+
344
+ This makes a new AI window resumable from facts:
345
+
346
+ ```bash
347
+ npx --yes pumuki status --json
348
+ npx --yes pumuki context status --json
349
+ npx --yes pumuki sdd status --json
350
+ npx --yes pumuki doctor --deep --json
199
351
  ```
200
352
 
201
- Runtime behavior:
353
+ For MCP-capable clients, the same pattern is available through read-only context resources and evidence endpoints before an agent edits files. The expected agent behavior is conservative: if context, evidence or SDD state is missing or invalid, the agent should downgrade to diagnosis and report a blocker instead of mutating production code.
354
+
355
+ In practice, Pumuki turns "remember what we were doing" into a repository contract: current branch, lifecycle health, active SDD change, latest evidence, blocking findings, remediation and policy provenance are recoverable without trusting the transient memory of one AI session.
202
356
 
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`).
357
+ ## AST Intelligence and Rule Packs
207
358
 
208
- Operational fallback:
359
+ Pumuki detects active platforms and loads rule packs for the real repository shape:
209
360
 
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.
361
+ | Platform | Coverage area |
362
+ |---|---|
363
+ | iOS | Swift, SwiftUI, Swift Testing, concurrency, architecture and security patterns. |
364
+ | Android | Kotlin, Compose, DI, lifecycle, architecture and Android-specific risk patterns. |
365
+ | Backend | TypeScript/NestJS, DTO validation, controllers, DI, error handling, persistence and security patterns. |
366
+ | Frontend | TypeScript/React/Next.js, JSX accessibility, API routes, UI safety and browser risk patterns. |
367
+ | Generic | Cross-platform TypeScript, process, filesystem, dynamic code execution and security signals. |
212
368
 
213
- ## Telemetry Export (Enterprise)
369
+ Current baseline families:
214
370
 
215
- Pumuki can export structured gate telemetry with a stable event schema (`telemetry_event_v1`) for SIEM/observability pipelines.
371
+ - `iosEnterpriseRuleSet`
372
+ - `backendRuleSet`
373
+ - `frontendRuleSet`
374
+ - `androidRuleSet`
375
+ - `astHeuristicsRuleSet`
376
+ - compiled skills bundles from `skills.lock.json`
216
377
 
217
- Default behavior remains unchanged: telemetry export is disabled unless explicitly configured.
378
+ Rule-pack documentation:
218
379
 
219
- Enable one or both outputs:
380
+ - [Rule Packs Overview](docs/rule-packs/README.md)
381
+ - [iOS Rule Pack](docs/rule-packs/ios.md)
382
+ - [Android Rule Pack](docs/rule-packs/android.md)
383
+ - [Backend Rule Pack](docs/rule-packs/backend.md)
384
+ - [Frontend Rule Pack](docs/rule-packs/frontend.md)
385
+ - [AST Heuristics Rule Pack](docs/rule-packs/heuristics.md)
220
386
 
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`)
387
+ AST intelligence is not a promise that every guideline can be enforced as code. Pumuki distinguishes runtime-code rules, process rules, positive recommendations and rules that still require study, so the gate does not create false confidence.
225
388
 
226
- Example:
389
+ ## Evidence
227
390
 
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
- ```
391
+ Pumuki writes deterministic evidence to `.ai_evidence.json` using the v2.1 contract.
392
+
393
+ Evidence can include:
394
+
395
+ - stage and policy metadata;
396
+ - gate outcome;
397
+ - findings and blocking causes;
398
+ - loaded rulesets and content hashes;
399
+ - detected platforms;
400
+ - skills coverage;
401
+ - SDD/OpenSpec state;
402
+ - operational hints;
403
+ - ledger and snapshot metadata.
234
404
 
235
- Each event captures deterministic stage/outcome/policy/repo context per gate execution.
405
+ Reference:
236
406
 
237
- ## Framework Maintainer Flow (This Repo)
407
+ - [AI Evidence v2.1 Contract](docs/mcp/ai-evidence-v2.1-contract.md)
408
+ - [Evidence API](docs/product/API_REFERENCE.md#evidence-api)
238
409
 
239
- Use this only when working in the Pumuki framework repository itself:
410
+ ## Menu and Notifications
411
+
412
+ Pumuki includes an interactive menu for local developer operation.
413
+
414
+ Framework repository:
240
415
 
241
416
  ```bash
242
417
  npm run framework:menu
243
- PUMUKI_MENU_UI_V2=1 npm run framework:menu
244
418
  PUMUKI_MENU_MODE=advanced npm run framework:menu
245
419
  ```
246
420
 
247
- Skills engine operations:
421
+ Consumer repository:
248
422
 
249
423
  ```bash
250
- npm run skills:compile
251
- npm run skills:lock:check
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>
424
+ npx --yes --package pumuki@latest pumuki-framework
254
425
  ```
255
426
 
256
- Adapter scaffolding:
427
+ Screenshots from the consumer menu:
257
428
 
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
- ```
429
+ | Consumer menu | Blocked pre-flight | Final summary |
430
+ |---|---|---|
431
+ | ![Consumer menu](assets/readme/menu-option1/01-menu-consumer-v2.png) | ![Pre-flight block](assets/readme/menu-option1/02-option1-preflight-block.png) | ![Final block](assets/readme/menu-option1/03-option1-final-summary-block.png) |
432
+
433
+ Notification channels include terminal output, stderr mirrors for relevant blocking events and optional system notifications. Blocking messages are expected to explain:
434
+
435
+ 1. blocking cause;
436
+ 2. concrete rule or skill;
437
+ 3. file and line when available;
438
+ 4. missing condition;
439
+ 5. direct remediation.
440
+
441
+ Extended walkthrough:
442
+
443
+ - [Framework Menu Consumer Walkthrough](docs/operations/framework-menu-consumer-walkthrough.md)
263
444
 
264
- Operational matrix/canary:
445
+ ## MCP and Agent Adapters
446
+
447
+ MCP is optional. Git hooks and gates do not depend on MCP.
448
+
449
+ Pumuki publishes two MCP server families:
450
+
451
+ | Server | Purpose |
452
+ |---|---|
453
+ | `pumuki-mcp-evidence` | Read-only evidence context over HTTP. |
454
+ | `pumuki-mcp-enterprise` | Enterprise repository state, resources and safe tools over HTTP. |
455
+ | `pumuki-mcp-evidence-stdio` | Evidence resources over MCP stdio. |
456
+ | `pumuki-mcp-enterprise-stdio` | Enterprise resources/tools over MCP stdio. |
457
+
458
+ The enterprise server exposes repository-state resources used for session continuity, including `context://active`, `gitflow://state`, `sdd://status`, `sdd://active-change` and `evidence://status`. The evidence server exposes compact and paginated evidence views so agents can load only the facts they need before acting.
459
+
460
+ Consumer quick start:
265
461
 
266
462
  ```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));"
463
+ npx --yes --package pumuki@latest pumuki-mcp-evidence
464
+ npx --yes --package pumuki@latest pumuki-mcp-enterprise
465
+ npx --yes --package pumuki@latest pumuki-mcp-enterprise-stdio
269
466
  ```
270
467
 
271
- Legacy parity report (strict comparator):
468
+ Adapter scaffolding:
272
469
 
273
470
  ```bash
274
- node --import tsx scripts/build-legacy-parity-report.ts --legacy=<legacy-evidence-path> --enterprise=<enterprise-evidence-path> --out=<output-path>
471
+ npx --yes pumuki adapter install --agent=repo --dry-run --json
472
+ npx --yes pumuki adapter install --agent=<agent> --json
473
+ npx --yes pumuki adapter install --agent=cursor --dry-run --json
275
474
  ```
276
475
 
277
- ## Command Paths
476
+ Supported adapter targets include `repo`, `cursor`, `claude`, `codex`, `windsurf` and `opencode`. These are opt-in client adapters; the managed Git hooks, gates, lifecycle, evidence and `.pumuki/adapter.json` baseline remain AI-agent, CLI and IDE agnostic.
278
477
 
279
- Use these docs instead of treating `README.md` as the full command manual:
478
+ References:
280
479
 
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`
480
+ - [MCP Servers](docs/mcp/mcp-servers-overview.md)
481
+ - [Evidence Context Server](docs/mcp/evidence-context-server.md)
482
+ - [Agent Context Consumption](docs/mcp/agent-context-consumption.md)
289
483
 
290
- ## Menu Walkthrough and Screenshots
484
+ ## Enterprise Operations
291
485
 
292
- ### Capture 1 Consumer Menu (v2)
486
+ Pumuki includes enterprise-oriented controls for teams that need governed rollout across multiple repositories.
293
487
 
294
- ![Consumer Menu v2](assets/readme/menu-option1/01-menu-consumer-v2.png)
488
+ | Area | Capability |
489
+ |---|---|
490
+ | Policy-as-code | `.pumuki/policy-as-code.json` with stage signatures and strict validation. |
491
+ | Telemetry | Optional JSONL and OTLP export for gate telemetry. |
492
+ | Version drift | `status` and `doctor` expose effective/runtime/lifecycle/package alignment. |
493
+ | Adapter health | Deep diagnostics for hook and MCP wiring. |
494
+ | Worktree hygiene | Guardrails for pending changes and atomic delivery. |
495
+ | Consumer rollout | Package smoke, installed-bin smoke and consumer support tooling. |
496
+ | Operations policy | SLO/SLA, severity model, incident response and rollback expectations. |
295
497
 
296
- ### Capture 2 — Option 1 Pre-flight (BLOCK context)
498
+ Operational references:
297
499
 
298
- ![Option 1 Pre-flight Block](assets/readme/menu-option1/02-option1-preflight-block.png)
500
+ - [Configuration](docs/product/CONFIGURATION.md)
501
+ - [Production Operations Policy](docs/operations/production-operations-policy.md)
502
+ - [Validation Runbooks](docs/validation/README.md)
503
+ - [Release Notes](docs/operations/RELEASE_NOTES.md)
504
+ - [Changelog](CHANGELOG.md)
299
505
 
300
- ### Capture 3 — Option 1 Final Summary (BLOCK)
506
+ ## Adoption Models
301
507
 
302
- ![Option 1 Final Summary Block](assets/readme/menu-option1/03-option1-final-summary-block.png)
508
+ | Context | Recommended path |
509
+ |---|---|
510
+ | Greenfield repository | Install Pumuki early, enable SDD/OpenSpec, commit through hooks from day one. |
511
+ | Brownfield repository | Start with scoped hooks and audits; fix active-slice debt before historical debt. |
512
+ | AI-enabled team | Treat `AGENTS.md` and skills as the human contract, and Pumuki as executable enforcement. |
513
+ | Multi-platform monorepo | Pin platforms when needed and let rule packs activate by detected scope. |
514
+ | Enterprise rollout | Pilot in one consumer, validate `doctor/status/hooks`, then repin controlled repositories. |
515
+
516
+ Suggested rollout checklist:
517
+
518
+ 1. Install exact package version.
519
+ 2. Run `pumuki bootstrap --enterprise`.
520
+ 3. Verify `status` and `doctor`.
521
+ 4. Open an SDD session for a real change.
522
+ 5. Run `PRE_WRITE` and `PRE_COMMIT`.
523
+ 6. Validate menu and notification output.
524
+ 7. Add CI gate when the local contract is stable.
525
+ 8. Document local exceptions in the consumer repository.
303
526
 
304
- ### Capture 4 — Option 1 Pre-flight (PASS scenario)
527
+ ## Troubleshooting
305
528
 
306
- ![Option 1 Pre-flight Pass Scenario](assets/readme/menu-option1/04-option1-preflight-pass.png)
529
+ | Symptom | Likely cause | Action |
530
+ |---|---|---|
531
+ | `SDD_SESSION_MISSING` | No active SDD session. | Run `pumuki sdd session --open --change=<change-id>`. |
532
+ | `SDD_SESSION_INVALID` | Session does not match current change or expired. | Run `pumuki sdd session --refresh --ttl-minutes=90`. |
533
+ | `OPENSPEC_MISSING` | Repo-local OpenSpec binary is missing. | Run `pumuki bootstrap --enterprise` or install the required package in the repo. |
534
+ | PRE_PUSH blocks due to missing upstream | Branch has no tracking ref. | Run `git push --set-upstream origin <branch>`. |
535
+ | Version drift in `doctor` | Package/runtime/lifecycle versions differ. | Use the printed `alignmentCommand`. |
536
+ | Hook blocks unrelated brownfield debt | Scope classification may be wrong. | Capture command, staged files and JSON output; open an issue. |
537
+ | `.ai_evidence.json` changes during docs-only work | Evidence refresh behavior is active. | Review the diff and stage only when the evidence belongs to the slice. |
538
+ | MCP port conflict | Another instance is running. | Use `PUMUKI_ENTERPRISE_MCP_PORT=0` for dynamic port allocation. |
539
+
540
+ Bug report template:
541
+
542
+ ```text
543
+ Repository:
544
+ Branch:
545
+ Pumuki version:
546
+ Command:
547
+ Expected result:
548
+ Actual result:
549
+ Staged files:
550
+ Relevant output:
551
+ Evidence file present:
552
+ ```
307
553
 
308
- ### Capture 5 — Option 1 Final Summary (PASS)
554
+ ## Documentation
309
555
 
310
- ![Option 1 Final Summary Pass](assets/readme/menu-option1/05-option1-final-summary-pass.png)
556
+ Start here:
311
557
 
312
- ### Capture 6 — Menu Status After PASS Run
558
+ - [Operator Playbook](PUMUKI.md)
559
+ - [Documentation Index](docs/README.md)
560
+ - [Installation](docs/product/INSTALLATION.md)
561
+ - [Usage](docs/product/USAGE.md)
562
+ - [Architecture](docs/product/ARCHITECTURE.md)
563
+ - [Configuration](docs/product/CONFIGURATION.md)
564
+ - [API Reference](docs/product/API_REFERENCE.md)
565
+ - [Testing](docs/product/TESTING.md)
566
+ - [MCP Servers](docs/mcp/mcp-servers-overview.md)
567
+ - [Rule Packs](docs/rule-packs/README.md)
568
+ - [Governance Standards](docs/governance/CODE_STANDARDS.md)
569
+ - [Contributing](docs/governance/CONTRIBUTING.md)
313
570
 
314
- ![Menu After Pass Run](assets/readme/menu-option1/06-menu-after-run-pass.png)
571
+ Optional training hub:
315
572
 
316
- Extended annotated walkthrough:
573
+ - [Pumuki course in Stack My Architecture](https://stack-my-architecture-hub.vercel.app/pumuki/)
317
574
 
318
- - `docs/operations/framework-menu-consumer-walkthrough.md`
575
+ ## Contributing
319
576
 
320
- ## Enterprise Operations Baseline
577
+ For high-quality contributions:
321
578
 
322
- Pumuki production SaaS operation baseline is defined in:
579
+ 1. Read [Contributing](docs/governance/CONTRIBUTING.md) and [Code Standards](docs/governance/CODE_STANDARDS.md).
580
+ 2. Work on a dedicated branch.
581
+ 3. Keep each change atomic.
582
+ 4. Add focused regression coverage for behavior changes.
583
+ 5. Run the relevant local validation commands.
584
+ 6. Open a PR with problem, approach and evidence.
323
585
 
324
- - `docs/operations/production-operations-policy.md`
586
+ Maintainer validation commands:
325
587
 
326
- Highlights:
588
+ ```bash
589
+ npm run -s typecheck
590
+ npm run -s test:deterministic
591
+ npm run -s validation:package-manifest
592
+ npm run -s smoke:pumuki-surface
593
+ ```
327
594
 
328
- - Minimum SLO/SLA targets for ingestion availability, latency, freshness, and isolation.
329
- - Severity model (`SEV1/SEV2/SEV3`) with response and RCA expectations.
330
- - Mandatory controls for tenant/repo isolation, auth policy, idempotency, and auditing.
331
- - Go-live checklist and rollback requirements.
595
+ For release-grade validation in this repository:
332
596
 
333
- ## Troubleshooting
597
+ ```bash
598
+ npm run -s validation:local-merge-bar
599
+ npm publish --dry-run --access public
600
+ ```
334
601
 
335
- - `OpenSpec change "<id>" not found`: ensure `openspec/changes/<id>` exists before opening session.
336
- - `SDD_SESSION_MISSING`: open and validate session first.
337
- - `pre-push blocked: branch has no upstream`: run `git push --set-upstream origin <branch>`.
338
- - `Missing required argument --repo` / `--repo-path`: pass required flags for validation scripts.
339
- - Legacy parity report usage requires `--legacy=<path>` and `--enterprise=<path>` (equals form).
340
- - If menu v2 rendering fails, Pumuki falls back to classic UI.
341
-
342
- ## Documentation Index
343
-
344
- - Installation: `docs/product/INSTALLATION.md`
345
- - Usage: `docs/product/USAGE.md`
346
- - Backlog tooling quick nav (incluye snippet terminal): `docs/product/USAGE.md#backlog-tooling`
347
- - Backlog reasons shared module: `docs/product/USAGE.md#backlog-reasons`
348
- - Testing: `docs/product/TESTING.md`
349
- - API reference: `docs/product/API_REFERENCE.md`
350
- - Architecture: `docs/product/ARCHITECTURE.md`
351
- - Configuration: `docs/product/CONFIGURATION.md`
352
- - Code standards: `docs/governance/CODE_STANDARDS.md`
353
- - Branch protection: `docs/governance/BRANCH_PROTECTION_GUIDE.md`
354
- - MCP servers: `docs/mcp/mcp-servers-overview.md`
355
- - MCP evidence server: `docs/mcp/evidence-context-server.md`
356
- - MCP consumption: `docs/mcp/agent-context-consumption.md`
357
- - Evidence schema v2.1: `docs/mcp/ai-evidence-v2.1-contract.md`
358
- - Operations policy (SLA/SLO): `docs/operations/production-operations-policy.md`
359
- - Release notes: `docs/operations/RELEASE_NOTES.md`
360
- - Changelog: `CHANGELOG.md`
361
-
362
- ## Collaboration
363
-
364
- Contributions are welcome. For high-quality collaboration:
365
-
366
- 1. Read `docs/governance/CONTRIBUTING.md` and `docs/governance/CODE_STANDARDS.md`.
367
- 2. Create a dedicated branch per change.
368
- 3. Keep scope focused and include deterministic evidence when relevant.
369
- 4. Before opening a PR, run at least:
370
- - `npm run typecheck`
371
- - `npm run -s test:backlog-tooling`
372
- - `npm run test:operational-memory`
373
- - `npm run test:saas-ingestion`
374
- 5. Open a PR with clear problem statement, approach, and validation evidence.
602
+ Publishing to npm is a separate release operation and may require registry auth/MFA handling.
375
603
 
376
604
  ## Support and Security
377
605
 
378
- - Functional/usage issues: open a GitHub issue with reproducible steps.
379
- - Enterprise diagnostics: include generated reports from `.audit-reports` when applicable.
380
- - Security-sensitive findings: use GitHub Security Advisories for coordinated disclosure.
606
+ - Functional issues: use [GitHub Issues](https://github.com/SwiftEnProfundidad/ast-intelligence-hooks/issues).
607
+ - Security-sensitive issues: use GitHub Security Advisories or coordinated private disclosure.
608
+ - Enterprise diagnostics: attach command output and evidence excerpts, but never include secrets.
381
609
 
382
610
  ## License
383
611
 
384
- MIT. See `LICENSE`.
385
-
386
- ## If Pumuki Helped You
387
-
388
- If this project was useful for your team, please consider leaving a GitHub star:
389
-
390
- [Star Pumuki on GitHub](https://github.com/SwiftEnProfundidad/ast-intelligence-hooks)
612
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,71 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="1600" height="760" viewBox="0 0 1600 760" role="img" aria-label="Pumuki governance flow">
2
+ <defs>
3
+ <style>
4
+ .bg { fill: #0b0f14; }
5
+ .panel { fill: #111827; stroke: #263244; stroke-width: 2; }
6
+ .box { fill: #0f172a; stroke: #38bdf8; stroke-width: 2; }
7
+ .box2 { fill: #102118; stroke: #34d399; stroke-width: 2; }
8
+ .box3 { fill: #221a10; stroke: #f59e0b; stroke-width: 2; }
9
+ .title { fill: #f8fafc; font: 700 42px ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
10
+ .sub { fill: #93c5fd; font: 600 24px ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
11
+ .h { fill: #e5e7eb; font: 700 23px ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
12
+ .t { fill: #cbd5e1; font: 18px ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
13
+ .muted { fill: #94a3b8; font: 16px ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
14
+ .arrow { stroke: #64748b; stroke-width: 4; fill: none; marker-end: url(#arrowhead); }
15
+ </style>
16
+ <marker id="arrowhead" markerWidth="10" markerHeight="8" refX="9" refY="4" orient="auto">
17
+ <path d="M 0 0 L 10 4 L 0 8 z" fill="#64748b" />
18
+ </marker>
19
+ </defs>
20
+
21
+ <rect class="bg" width="1600" height="760" rx="28" />
22
+ <rect class="panel" x="44" y="44" width="1512" height="672" rx="24" />
23
+
24
+ <text class="title" x="90" y="116">Pumuki Enterprise Governance Flow</text>
25
+ <text class="sub" x="90" y="158">One deterministic contract for humans, AI agents, hooks and CI</text>
26
+
27
+ <rect class="box" x="90" y="230" width="260" height="128" rx="16" />
28
+ <text class="h" x="118" y="274">1. Facts</text>
29
+ <text class="t" x="118" y="310">Git scope</text>
30
+ <text class="t" x="118" y="338">Repo state</text>
31
+
32
+ <rect class="box" x="440" y="230" width="260" height="128" rx="16" />
33
+ <text class="h" x="468" y="274">2. Rules</text>
34
+ <text class="t" x="468" y="310">Skills</text>
35
+ <text class="t" x="468" y="338">Rule packs</text>
36
+
37
+ <rect class="box3" x="790" y="230" width="260" height="128" rx="16" />
38
+ <text class="h" x="818" y="274">3. Gate</text>
39
+ <text class="t" x="818" y="310">PASS / WARN / BLOCK</text>
40
+ <text class="t" x="818" y="338">Stage policy</text>
41
+
42
+ <rect class="box2" x="1140" y="230" width="260" height="128" rx="16" />
43
+ <text class="h" x="1168" y="274">4. Evidence</text>
44
+ <text class="t" x="1168" y="310">ai_evidence v2.1</text>
45
+ <text class="t" x="1168" y="338">Traceable output</text>
46
+
47
+ <path class="arrow" d="M 355 294 L 430 294" />
48
+ <path class="arrow" d="M 705 294 L 780 294" />
49
+ <path class="arrow" d="M 1055 294 L 1130 294" />
50
+
51
+ <rect class="box" x="150" y="470" width="330" height="120" rx="16" />
52
+ <text class="h" x="178" y="512">Delivery surfaces</text>
53
+ <text class="t" x="178" y="548">PRE_WRITE, PRE_COMMIT</text>
54
+ <text class="t" x="178" y="576">PRE_PUSH, CI, audit</text>
55
+
56
+ <rect class="box2" x="635" y="470" width="330" height="120" rx="16" />
57
+ <text class="h" x="663" y="512">Developer UX</text>
58
+ <text class="t" x="663" y="548">Menu, notifications</text>
59
+ <text class="t" x="663" y="576">Actionable remediation</text>
60
+
61
+ <rect class="box" x="1120" y="470" width="330" height="120" rx="16" />
62
+ <text class="h" x="1148" y="512">Automation</text>
63
+ <text class="t" x="1148" y="548">MCP, adapters</text>
64
+ <text class="t" x="1148" y="576">Telemetry, diagnostics</text>
65
+
66
+ <path class="arrow" d="M 920 364 L 920 414 L 315 414 L 315 460" />
67
+ <path class="arrow" d="M 1270 364 L 1270 414 L 800 414 L 800 460" />
68
+ <path class="arrow" d="M 1270 364 L 1285 414 L 1285 460" />
69
+
70
+ <text class="muted" x="90" y="660">Baseline is IDE-agnostic. Client-specific adapters are opt-in.</text>
71
+ </svg>
@@ -235,6 +235,109 @@ const STUDY_BEFORE_DETECTOR_RULE_IDS = new Set<string>([
235
235
  const requiresStudyBeforeDetector = (rule: SkillsCompiledRule): boolean =>
236
236
  STUDY_BEFORE_DETECTOR_RULE_IDS.has(rule.id);
237
237
 
238
+ const IOS_POSITIVE_CODE_GUIDANCE_PATTERNS: ReadonlyArray<RegExp> = [
239
+ /\basyncsequence\b/,
240
+ /\basyncstream\b/,
241
+ /\bcopy[-\s]on[-\s]write\b/,
242
+ /\bequatable[-\s]hashable\b/,
243
+ /\bnil[-\s]coalescing\b/,
244
+ /\bnumberformatter\b/,
245
+ /\boperators[-\s]map[-\s]filter[-\s]flatmap\b/,
246
+ /\boptional[-\s]chaining\b/,
247
+ /\bresult[-\s]builders?\b/,
248
+ /\bcustom[-\s]view[-\s]modifiers?\b.*\breutilizar\b/,
249
+ /\bdeclarativo\b.*\bui\b/,
250
+ /\bequatable[-\s]views?\b/,
251
+ /\bextensions?\b.*\bagrupar\b.*\bfuncionalidad\b/,
252
+ /\bfactory[-\s]pattern\b/,
253
+ /\bif[-\s]let\b.*\bunwrap\b/,
254
+ /\binmutabilidad\b.*\blet\b.*\bvar\b/,
255
+ /\bmark\b.*\borganizar\b.*\bco[-\s]?digo\b/,
256
+ /\bmemoization\b/,
257
+ /\bmvvm\b.*\b(viewmodel|swiftui|combine)\b/,
258
+ /\bpage[-\s]object[-\s]pattern\b/,
259
+ /\bpreferencekeys?\b/,
260
+ /\bpreferences\b.*\bchild[-\s]parent\b/,
261
+ /\bprotocol[-\s]extensions?\b/,
262
+ /\bprotocols[-\s]over[-\s]inheritance\b/,
263
+ /\bpublished\b.*\bviewmodels?\b.*\bbinding\b/,
264
+ /\bstruct\b.*\bclass\b.*\bidentity\b/,
265
+ /\buse[-\s]cases?\b.*\b[A-Za-z0-9_]*usecase\b/,
266
+ /\bviewmodels?[-\s]por[-\s]pantalla\b/,
267
+ /\bviewmodifiers?[-\s]nativos?\b/,
268
+ /\bviewthatfits\b/,
269
+ /\bviper\b.*\boverkill\b/,
270
+ ];
271
+
272
+ const IOS_AUDITED_POSITIVE_LANGUAGE_GUIDANCE_PATTERNS: ReadonlyArray<RegExp> = [
273
+ /\basyncsequence\b/,
274
+ /\basyncstream\b/,
275
+ /\bcopy[-\s]on[-\s]write\b/,
276
+ /\bequatable[-\s]hashable\b/,
277
+ /\bnil[-\s]coalescing\b/,
278
+ /\bnumberformatter\b/,
279
+ /\boperators[-\s]map[-\s]filter[-\s]flatmap\b/,
280
+ /\boptional[-\s]chaining\b/,
281
+ /\bpublishers[-\s]asyncsequence\b/,
282
+ /\bresult[-\s]builders?\b/,
283
+ ];
284
+
285
+ const IOS_AUDITED_POSITIVE_ARCHITECTURE_STYLE_GUIDANCE_PATTERNS: ReadonlyArray<RegExp> = [
286
+ /\bcustom[-\s]view[-\s]modifiers?\b.*\breutilizar\b/,
287
+ /\bdeclarativo\b.*\bui\b/,
288
+ /\bequatable[-\s]views?\b/,
289
+ /\bextensions?\b.*\bagrupar\b.*\bfuncionalidad\b/,
290
+ /\bfactory[-\s]pattern\b/,
291
+ /\bif[-\s]let\b.*\bunwrap\b/,
292
+ /\binmutabilidad\b.*\blet\b.*\bvar\b/,
293
+ /\bmark\b.*\borganizar\b.*\bco[-\s]?digo\b/,
294
+ /\bmemoization\b/,
295
+ /\bmvvm\b.*\b(viewmodel|swiftui|combine)\b/,
296
+ /\bpage[-\s]object[-\s]pattern\b/,
297
+ /\bpreferencekeys?\b/,
298
+ /\bpreferences\b.*\bchild[-\s]parent\b/,
299
+ /\bprotocol[-\s]extensions?\b/,
300
+ /\bprotocols[-\s]over[-\s]inheritance\b/,
301
+ /\bpublished\b.*\bviewmodels?\b.*\bbinding\b/,
302
+ /\bstruct\b.*\bclass\b.*\bidentity\b/,
303
+ /\buse[-\s]cases?\b.*\b[A-Za-z0-9_]*usecase\b/,
304
+ /\bviewmodels?[-\s]por[-\s]pantalla\b/,
305
+ /\bviewmodifiers?[-\s]nativos?\b/,
306
+ /\bviewthatfits\b/,
307
+ /\bviper\b.*\boverkill\b/,
308
+ ];
309
+
310
+ const isAuditedIosPositiveLanguageGuidance = (rule: SkillsCompiledRule): boolean => {
311
+ if (rule.platform !== 'ios') {
312
+ return false;
313
+ }
314
+
315
+ const haystack = normalizeText(`${rule.id} ${rule.description} ${rule.sourceSkill}`);
316
+ return IOS_AUDITED_POSITIVE_LANGUAGE_GUIDANCE_PATTERNS.some((pattern) => pattern.test(haystack));
317
+ };
318
+
319
+ const isAuditedIosPositiveArchitectureStyleGuidance = (rule: SkillsCompiledRule): boolean => {
320
+ if (rule.platform !== 'ios') {
321
+ return false;
322
+ }
323
+
324
+ const haystack = normalizeText(`${rule.id} ${rule.description} ${rule.sourceSkill}`);
325
+ return IOS_AUDITED_POSITIVE_ARCHITECTURE_STYLE_GUIDANCE_PATTERNS.some((pattern) => pattern.test(haystack));
326
+ };
327
+
328
+ const requiresIosPositiveCodeGuidanceAudit = (rule: SkillsCompiledRule): boolean => {
329
+ if (rule.platform !== 'ios') {
330
+ return false;
331
+ }
332
+
333
+ if (normalizeText(rule.id).includes('-md-')) {
334
+ return false;
335
+ }
336
+
337
+ const haystack = normalizeText(`${rule.id} ${rule.description} ${rule.sourceSkill}`);
338
+ return IOS_POSITIVE_CODE_GUIDANCE_PATTERNS.some((pattern) => pattern.test(haystack));
339
+ };
340
+
238
341
  const isNonCodeRule = (rule: SkillsCompiledRule): boolean => {
239
342
  const haystack = normalizeText(`${rule.id} ${rule.description} ${rule.sourceSkill}`);
240
343
  return NON_CODE_RULE_PATTERNS.some((pattern) => pattern.test(haystack));
@@ -317,6 +420,36 @@ const classifyRule = (rule: SkillsCompiledRule): ClassifiedSkillsRule => {
317
420
  };
318
421
  }
319
422
 
423
+ if (isAuditedIosPositiveLanguageGuidance(rule) || isAuditedIosPositiveArchitectureStyleGuidance(rule)) {
424
+ return {
425
+ ruleId: rule.id,
426
+ platform: rule.platform,
427
+ sourceSkill: rule.sourceSkill,
428
+ sourcePath: rule.sourcePath,
429
+ evaluationMode,
430
+ severity: rule.severity,
431
+ status: 'NO_ES_REGLA_DE_CODIGO',
432
+ reason:
433
+ 'Audited iOS positive guidance; absence is not a safe runtime violation and related negative patterns must be enforced by specific detectors.',
434
+ astNodeIds,
435
+ };
436
+ }
437
+
438
+ if (requiresIosPositiveCodeGuidanceAudit(rule)) {
439
+ return {
440
+ ruleId: rule.id,
441
+ platform: rule.platform,
442
+ sourceSkill: rule.sourceSkill,
443
+ sourcePath: rule.sourcePath,
444
+ evaluationMode,
445
+ severity: rule.severity,
446
+ status: 'REQUIERE_ESTUDIO',
447
+ reason:
448
+ 'iOS positive code guidance needs explicit audit before classifying it as non-runtime or implementing a detector.',
449
+ astNodeIds,
450
+ };
451
+ }
452
+
320
453
  if (isNonCodeRule(rule)) {
321
454
  return {
322
455
  ruleId: rule.id,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pumuki",
3
- "version": "6.3.375",
4
- "description": "Enterprise-grade AST Intelligence System with multi-platform support (iOS, Android, Backend, Frontend) and Feature-First + DDD + Clean Architecture enforcement. Includes dynamic violations API for intelligent querying.",
3
+ "version": "6.3.377",
4
+ "description": "Enterprise governance framework for AI-assisted software delivery with Git hooks, SDD/OpenSpec, AST intelligence, evidence, MCP and multi-platform rule enforcement.",
5
5
  "main": "index.js",
6
6
  "bin": {
7
7
  "pumuki": "bin/pumuki.js",
@@ -184,7 +184,14 @@
184
184
  "kotlin",
185
185
  "react",
186
186
  "nextjs",
187
- "nestjs"
187
+ "nestjs",
188
+ "ai-governance",
189
+ "ai-assisted-development",
190
+ "software-delivery",
191
+ "sdd",
192
+ "openspec",
193
+ "mcp",
194
+ "evidence"
188
195
  ],
189
196
  "author": {
190
197
  "name": "Juan Carlos Merlos Albarracín",