pumuki 6.3.8 → 6.3.10

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,6 +1,6 @@
1
1
  # Pumuki AST Intelligence Framework
2
2
 
3
- [![Version](https://img.shields.io/badge/version-6.3.7-1d4ed8)](package.json)
3
+ [![Version](https://img.shields.io/npm/v/pumuki?color=1d4ed8)](https://www.npmjs.com/package/pumuki)
4
4
  [![License](https://img.shields.io/badge/license-MIT-16a34a)](LICENSE)
5
5
  [![Build](https://github.com/SwiftEnProfundidad/ast-intelligence-hooks/actions/workflows/ci.yml/badge.svg)](https://github.com/SwiftEnProfundidad/ast-intelligence-hooks/actions/workflows/ci.yml)
6
6
  [![Node](https://img.shields.io/badge/node-%3E%3D18-0ea5e9)](package.json)
@@ -8,49 +8,51 @@
8
8
 
9
9
  <img src="assets/logo.png" alt="Pumuki" width="100%" />
10
10
 
11
- Enterprise governance for AI-assisted code delivery.
11
+ Deterministic governance for AI-assisted software delivery.
12
12
 
13
- Pumuki turns code changes into traceable and reproducible decisions:
13
+ Pumuki converts code changes into traceable, reproducible decisions:
14
14
 
15
15
  `Facts -> Rules -> Gate -> ai_evidence v2.1`
16
16
 
17
- This gives enterprise teams one deterministic source of truth to decide what is blocked, what is warned, and why, both locally and in CI.
18
-
19
- ## Table of contents
20
-
21
- - [Why Pumuki](#why-pumuki)
22
- - [Quick Start](#quick-start)
23
- - [Automated vs Manual Operations](#automated-vs-manual-operations)
24
- - [Software Lifecycle](#software-lifecycle)
25
- - [Command Reference](#command-reference)
26
- - [MCP: JSON Installation and Configuration](#mcp-json-installation-and-configuration)
27
- - [Architecture and Design Philosophy](#architecture-and-design-philosophy)
17
+ ## Table of Contents
18
+
19
+ - [Overview](#overview)
20
+ - [Capabilities](#capabilities)
21
+ - [Quick Start for Consumer Repositories](#quick-start-for-consumer-repositories)
22
+ - [Lifecycle Commands](#lifecycle-commands)
23
+ - [Gate Commands](#gate-commands)
24
+ - [Architecture and Policy Model](#architecture-and-policy-model)
25
+ - [MCP Evidence Context Server (Optional)](#mcp-evidence-context-server-optional)
26
+ - [Framework Development (This Repository)](#framework-development-this-repository)
27
+ - [Deterministic Validation Suite](#deterministic-validation-suite)
28
+ - [Troubleshooting](#troubleshooting)
28
29
  - [Contributing and Support](#contributing-and-support)
29
30
  - [References](#references)
30
31
 
31
- ## Why Pumuki
32
+ ## Overview
33
+
34
+ Pumuki is a provider-agnostic framework for enforcing deterministic quality gates across multi-platform repositories.
32
35
 
33
- ### Real problem in large teams
36
+ It is designed for enterprise teams that need:
34
37
 
35
- - Inconsistent quality checks between local and CI.
36
- - Hard-to-audit technical decisions.
37
- - Configuration drift across platforms.
38
- - Operational incidents without reproducible evidence.
38
+ - consistent gate behavior across local and CI,
39
+ - auditable decisions backed by deterministic evidence,
40
+ - versioned and lockable rule packs,
41
+ - operational runbooks for incidents and rollout management.
39
42
 
40
- ### What Pumuki solves
43
+ Canonical npm package name: `pumuki`.
41
44
 
42
- - Stage-aware gate policies (`PRE_COMMIT`, `PRE_PUSH`, `CI`).
43
- - Versioned and locked rule bundles (`skills.lock.json`).
44
- - Deterministic evidence contract (`.ai_evidence.json`).
45
- - Operational runbooks for triage, closure, and handoff.
45
+ Legacy package `pumuki-ast-hooks` is deprecated and frozen at `6.3.7`.
46
46
 
47
- ### Where it fits best
47
+ ## Capabilities
48
48
 
49
- - Multi-platform repositories (`ios`, `backend`, `frontend`, `android`).
50
- - Teams with compliance/audit requirements.
51
- - High-change environments with AI-assisted development.
49
+ - Stage-aware gate policies: `PRE_COMMIT`, `PRE_PUSH`, `CI`.
50
+ - Multi-platform detection and combined evaluation: iOS, Backend, Frontend, Android.
51
+ - Rules + overrides with locked baseline semantics.
52
+ - Deterministic evidence (`.ai_evidence.json`) for machine and human workflows.
53
+ - Optional read-only MCP evidence server for agent consumption.
52
54
 
53
- ## Quick Start
55
+ ## Quick Start for Consumer Repositories
54
56
 
55
57
  ### Prerequisites
56
58
 
@@ -58,308 +60,195 @@ This gives enterprise teams one deterministic source of truth to decide what is
58
60
  - `npm >= 9.0.0`
59
61
  - `git`
60
62
 
61
- ### Installation
63
+ ### 1) Install
62
64
 
63
65
  ```bash
64
- git clone https://github.com/SwiftEnProfundidad/ast-intelligence-hooks.git
65
- cd ast-intelligence-hooks
66
- npm ci
66
+ npm install --save-exact pumuki
67
67
  ```
68
68
 
69
- ### Minimal verification
69
+ ### 2) Install managed hooks in your repository
70
+
71
+ Run from the target repository root:
70
72
 
71
73
  ```bash
72
- npm run typecheck
73
- npm run test:deterministic
74
- npm run validation:package-manifest
74
+ npx pumuki install
75
75
  ```
76
76
 
77
- ### First run
77
+ ### 3) Verify lifecycle status
78
78
 
79
79
  ```bash
80
- npm run framework:menu
80
+ npx pumuki doctor
81
+ npx pumuki status
81
82
  ```
82
83
 
83
- ## Automated vs Manual Operations
84
-
85
- ### Automated path (default)
86
-
87
- The core lifecycle is automated:
88
-
89
- - facts extraction,
90
- - rules evaluation,
91
- - stage-aware gate decision,
92
- - `ai_evidence v2.1` generation,
93
- - CI workflow execution.
94
-
95
- ### Manual path (intentional)
96
-
97
- `validation:*` commands are operational controls for:
98
-
99
- - triage,
100
- - closure,
101
- - handoff,
102
- - adapter diagnostics,
103
- - rollout guardrails.
104
-
105
- Examples:
106
-
107
- - `validation:consumer-startup-triage`
108
- - `validation:phase5-execution-closure`
109
- - `validation:phase8:*`
110
- - `validation:adapter-*`
84
+ ### 4) Run stage gates manually (optional)
111
85
 
112
- Practical rule:
86
+ ```bash
87
+ npx pumuki-pre-commit
88
+ npx pumuki-pre-push
89
+ npx pumuki-ci
90
+ ```
113
91
 
114
- - normal development: automated pipeline + tests,
115
- - incident/rollout handling: manual runbook commands.
92
+ ### 5) Expected outputs
116
93
 
117
- ## Software Lifecycle
94
+ - Gate exit code: `0` (allow) or `1` (block).
95
+ - Deterministic evidence file: `.ai_evidence.json`.
118
96
 
119
- ### Consumer package install (enterprise UX)
97
+ ### Update and remove
120
98
 
121
99
  ```bash
122
- npm install --save-exact pumuki
123
100
  npm update pumuki
124
- npm uninstall pumuki
125
- ```
126
-
127
- `npm upgrade pumuki` is also supported as an alias to update in npm environments where `upgrade` is mapped.
101
+ npx pumuki update --latest
128
102
 
129
- ### Installation (fresh setup)
130
-
131
- ```bash
132
- npm ci
133
- npm run typecheck
134
- npm run test:deterministic
135
- npm run skills:lock:check
103
+ npx --yes pumuki remove
136
104
  ```
137
105
 
138
- ### Upgrade
106
+ `pumuki remove` performs managed uninstall + artifact purge in one command.
139
107
 
140
- ```bash
141
- git pull
142
- npm ci
143
- npm run skills:lock:check
144
- npm run validation:docs-hygiene
145
- npm run test:deterministic
146
- ```
108
+ ## Lifecycle Commands
147
109
 
148
- ### Uninstall (local cleanup)
110
+ The `pumuki` binary provides repository lifecycle operations:
149
111
 
150
- ```bash
151
- rm -rf node_modules
152
- rm -rf .audit-reports
153
- ```
154
-
155
- If legacy guards are active:
156
-
157
- ```bash
158
- npm run ast:guard:stop
159
- ```
112
+ | Command | Purpose |
113
+ | --- | --- |
114
+ | `pumuki install` | Install managed `pre-commit` and `pre-push` hook blocks |
115
+ | `pumuki uninstall --purge-artifacts` | Remove managed hooks and purge known artifacts |
116
+ | `pumuki remove` | One-command cleanup + package uninstall in consumer repos |
117
+ | `pumuki update --latest` | Update package and re-apply managed hooks |
118
+ | `pumuki doctor` | Safety checks (hook drift, tracked `node_modules`, lifecycle state) |
119
+ | `pumuki status` | Current lifecycle snapshot |
160
120
 
161
- For consumer repositories using the package:
121
+ `pumuki remove` is dependency-safe by design: it never deletes non-Pumuki third-party dependencies.
162
122
 
163
- ```bash
164
- npx --yes pumuki remove
165
- ```
123
+ ## Gate Commands
166
124
 
167
- This command also prunes orphan `node_modules/.package-lock.json` residue when no installed modules remain.
125
+ Dedicated gate binaries are available:
168
126
 
169
- ### Dependency conflict troubleshooting
127
+ | Binary | Stage |
128
+ | --- | --- |
129
+ | `pumuki-pre-commit` | `PRE_COMMIT` |
130
+ | `pumuki-pre-push` | `PRE_PUSH` |
131
+ | `pumuki-ci` | `CI` |
170
132
 
171
- | Symptom | Typical root cause | Recommended action |
172
- | --- | --- | --- |
173
- | local differs from CI | skills lock drift | `npm run skills:lock:check` |
174
- | `tsx` fails to start | incompatible Node runtime | upgrade to `Node >= 18` |
175
- | upgrade regressions | inconsistent lockfile/modules | `rm -rf node_modules package-lock.json && npm install` |
176
- | noisy docs/artifacts | stale `.audit-reports` outputs | `npm run validation:clean-artifacts -- --dry-run` |
133
+ ## Architecture and Policy Model
177
134
 
178
- ## Command Reference
135
+ ### Deterministic pipeline
179
136
 
180
- Flag forwarding pattern:
137
+ `Facts -> Rules -> Gate -> ai_evidence v2.1`
181
138
 
182
- ```bash
183
- npm run <script> -- <flags>
184
- ```
139
+ - Facts are extracted from staged files or commit ranges.
140
+ - Rules are evaluated with platform-aware packs and project overrides.
141
+ - Gate applies stage policy thresholds.
142
+ - Evidence is generated as deterministic, machine-readable contract.
185
143
 
186
- ### Core, CLI, and framework
144
+ ### Default stage policies
187
145
 
188
- | Command | Description | Example |
189
- | --- | --- | --- |
190
- | `npm run install-hooks` | Install managed Pumuki hooks (`pre-commit`, `pre-push`) | `npm run install-hooks` |
191
- | `npm run check-version` | Print lifecycle/runtime status | `npm run check-version` |
192
- | `npm run pumuki:install` | Install managed hooks in current Git repo | `npm run pumuki:install` |
193
- | `npm run pumuki:uninstall` | Uninstall managed hooks and purge untracked Pumuki artifacts | `npm run pumuki:uninstall` |
194
- | `npm run pumuki:remove` | One-command cleanup + package removal from consumer repo | `npm run pumuki:remove` |
195
- | `npm run pumuki:update` | Update Pumuki dependency to latest and re-apply hooks | `npm run pumuki:update` |
196
- | `npm run pumuki:doctor` | Enterprise baseline safety checks (tracked `node_modules`, hook/state drift) | `npm run pumuki:doctor` |
197
- | `npm run pumuki:status` | Lifecycle status snapshot | `npm run pumuki:status` |
198
- | `npm run audit` | Run AST CLI | `npm run audit -- --help` |
199
- | `npm run ast` | AST CLI alias | `npm run ast -- --help` |
200
- | `npm run framework:menu` | Launch interactive operations menu | `npm run framework:menu` |
201
- | `npm run mcp:evidence` | Start read-only MCP evidence server | `npm run mcp:evidence` |
202
- | `npm run violations` | Violations CLI | `npm run violations -- --help` |
203
- | `npm run violations:list` | List violations | `npm run violations:list` |
204
- | `npm run violations:show` | Show one violation | `npm run violations:show -- <id>` |
205
- | `npm run violations:summary` | Aggregated violations summary | `npm run violations:summary` |
206
- | `npm run violations:top` | Top violations view | `npm run violations:top` |
207
-
208
- ### Quality and testing
209
-
210
- | Command | Description | Example |
211
- | --- | --- | --- |
212
- | `npm run typecheck` | TypeScript check without emit | `npm run typecheck` |
213
- | `npm run test` | Main Jest test suite | `npm run test` |
214
- | `npm run test:evidence` | Evidence-specific tests | `npm run test:evidence` |
215
- | `npm run test:mcp` | MCP tests | `npm run test:mcp` |
216
- | `npm run test:heuristics` | AST heuristics tests | `npm run test:heuristics` |
217
- | `npm run test:stage-gates` | Stage policy/gate tests | `npm run test:stage-gates` |
218
- | `npm run test:deterministic` | Recommended deterministic baseline | `npm run test:deterministic` |
219
- | `npm run validation:package-manifest` | Validate package manifest contract | `npm run validation:package-manifest` |
220
- | `npm run validation:package-smoke` | Blocking package smoke test | `npm run validation:package-smoke` |
221
- | `npm run validation:package-smoke:minimal` | Minimal package smoke test | `npm run validation:package-smoke:minimal` |
222
- | `npm run validation:lifecycle-smoke` | Lifecycle smoke check (`install -> run -> uninstall` clean round-trip) | `npm run validation:lifecycle-smoke` |
223
- | `npm run validation:docs-hygiene` | Documentation guardrail checks | `npm run validation:docs-hygiene` |
224
- | `npm run validation:clean-artifacts -- --dry-run` | Simulated artifact cleanup | `npm run validation:clean-artifacts -- --dry-run` |
225
- | `npm run skills:compile` | Compile skills lock | `npm run skills:compile` |
226
- | `npm run skills:lock:check` | Verify skills lock freshness | `npm run skills:lock:check` |
227
-
228
- ### Consumer diagnostics and support
229
-
230
- | Command | Main flags | Example |
146
+ | Stage | Block on or above | Warn on or above |
231
147
  | --- | --- | --- |
232
- | `validation:consumer-ci-artifacts` | `--repo --limit --out` | `npm run validation:consumer-ci-artifacts -- --repo <owner>/<repo> --limit 20 --out .audit-reports/consumer-triage/consumer-ci-artifacts-report.md` |
233
- | `validation:consumer-ci-auth-check` | `--repo --out` | `npm run validation:consumer-ci-auth-check -- --repo <owner>/<repo> --out .audit-reports/consumer-triage/consumer-ci-auth-check.md` |
234
- | `validation:consumer-workflow-lint` | `--repo-path --actionlint-bin --out` | `npm run validation:consumer-workflow-lint -- --repo-path /path/repo --actionlint-bin /tmp/actionlint --out .audit-reports/consumer-triage/consumer-workflow-lint-report.md` |
235
- | `validation:consumer-support-bundle` | `--repo --limit --out` | `npm run validation:consumer-support-bundle -- --repo <owner>/<repo> --limit 20 --out .audit-reports/consumer-triage/consumer-startup-failure-support-bundle.md` |
236
- | `validation:consumer-support-ticket-draft` | `--repo --support-bundle --auth-report --out` | `npm run validation:consumer-support-ticket-draft -- --repo <owner>/<repo> --support-bundle .audit-reports/consumer-triage/consumer-startup-failure-support-bundle.md --auth-report .audit-reports/consumer-triage/consumer-ci-auth-check.md --out .audit-reports/consumer-triage/consumer-support-ticket-draft.md` |
237
- | `validation:consumer-startup-unblock-status` | `--repo --support-bundle --auth-report --workflow-lint-report --out` | `npm run validation:consumer-startup-unblock-status -- --repo <owner>/<repo> --support-bundle .audit-reports/consumer-triage/consumer-startup-failure-support-bundle.md --auth-report .audit-reports/consumer-triage/consumer-ci-auth-check.md --workflow-lint-report .audit-reports/consumer-triage/consumer-workflow-lint-report.md --out .audit-reports/consumer-triage/consumer-startup-unblock-status.md` |
238
- | `validation:consumer-startup-triage` | `--repo --out-dir [--skip-workflow-lint]` | `npm run validation:consumer-startup-triage -- --repo SwiftEnProfundidad/pumuki-actions-healthcheck-temp --out-dir .audit-reports/consumer-triage-temp --skip-workflow-lint` |
148
+ | `PRE_COMMIT` | `CRITICAL` | `ERROR` |
149
+ | `PRE_PUSH` | `ERROR` | `WARN` |
150
+ | `CI` | `ERROR` | `WARN` |
239
151
 
240
- ### Phase 5 (closure and handoff)
152
+ ### Platform detection selectors
241
153
 
242
- | Command | Main flags | Example |
243
- | --- | --- | --- |
244
- | `validation:phase5-blockers-readiness` | `--consumer-triage-report --out [--require-adapter-report --adapter-report]` | `npm run validation:phase5-blockers-readiness -- --consumer-triage-report .audit-reports/consumer-triage/consumer-startup-triage-report.md --out .audit-reports/phase5/phase5-blockers-readiness.md` |
245
- | `validation:phase5-execution-closure-status` | `--phase5-blockers-report --consumer-unblock-report --out` | `npm run validation:phase5-execution-closure-status -- --phase5-blockers-report .audit-reports/phase5/phase5-blockers-readiness.md --consumer-unblock-report .audit-reports/consumer-triage/consumer-startup-unblock-status.md --out .audit-reports/phase5/phase5-execution-closure-status.md` |
246
- | `validation:phase5-execution-closure` | `--repo --out-dir [--mock-consumer] [--skip-workflow-lint] [--skip-auth-preflight]` | `npm run validation:phase5-execution-closure -- --repo SwiftEnProfundidad/pumuki-actions-healthcheck-temp --out-dir .audit-reports/phase5 --mock-consumer` |
247
- | `validation:phase5-external-handoff` | `--repo [--require-mock-ab-report] [--require-artifact-urls] [--artifact-url] [--out]` | `npm run validation:phase5-external-handoff -- --repo SwiftEnProfundidad/pumuki-actions-healthcheck-temp --require-mock-ab-report` |
248
- | `validation:phase5-latest:refresh` | shell script | `npm run validation:phase5-latest:refresh` |
249
- | `validation:phase5-latest:sync-docs` | shell script | `npm run validation:phase5-latest:sync-docs` |
250
- | `validation:phase5-latest:ready-check` | shell script | `npm run validation:phase5-latest:ready-check` |
251
- | `validation:phase5-post-support:refresh` | shell script | `npm run validation:phase5-post-support:refresh` |
252
-
253
- ### Phase 8 (operations, anti-loop, status)
254
-
255
- | Command | Main flags | Example |
256
- | --- | --- | --- |
257
- | `validation:phase8:resume-after-billing` | shell script | `npm run validation:phase8:resume-after-billing` |
258
- | `validation:phase8:next-step` | shell script | `npm run validation:phase8:next-step` |
259
- | `validation:phase8:doctor` | shell script | `npm run validation:phase8:doctor` |
260
- | `validation:phase8:autopilot` | shell script | `npm run validation:phase8:autopilot` |
261
- | `validation:phase8:status-pack` | shell script | `npm run validation:phase8:status-pack` |
262
- | `validation:phase8:tick` | shell script | `npm run validation:phase8:tick` |
263
- | `validation:phase8:loop-guard` | shell script | `npm run validation:phase8:loop-guard` |
264
- | `validation:phase8:loop-guard-coverage` | shell script | `npm run validation:phase8:loop-guard-coverage` |
265
- | `validation:phase8:mark-followup-state` | `<ticket_id> <posted_by> <POSTED_WAITING_REPLY|SUPPORT_REPLIED> [posted_at] [reply_at] [summary]` | `npm run validation:phase8:mark-followup-state -- 4077449 juancarlosmerlosalbarracin POSTED_WAITING_REPLY` |
266
- | `validation:phase8:mark-followup-posted-now` | `<posted_by> [ticket_id] [posted_at]` | `npm run validation:phase8:mark-followup-posted-now -- juancarlosmerlosalbarracin 4077449` |
267
- | `validation:phase8:mark-followup-replied-now` | `<posted_by> <summary> [ticket_id] [posted_at] [reply_at]` | `npm run validation:phase8:mark-followup-replied-now -- juancarlosmerlosalbarracin "support replied" 4077449` |
268
- | `validation:phase8:ready-handoff` | shell script | `npm run validation:phase8:ready-handoff` |
269
- | `validation:phase8:close-ready` | shell script | `npm run validation:phase8:close-ready` |
270
-
271
- ### Adapter readiness and legacy compatibility
272
-
273
- | Command | Description |
154
+ | Platform | Detection selector |
274
155
  | --- | --- |
275
- | `validation:adapter-session-status` | Build adapter session status report |
276
- | `validation:adapter-real-session-report` | Build adapter real-session report |
277
- | `validation:adapter-readiness` | Build final adapter readiness report |
278
- | `validate:adapter-hooks-local` | Validate legacy local adapter runtime |
279
- | `print:adapter-hooks-config` | Print legacy adapter hook config |
280
- | `install:adapter-hooks-config` | Install legacy adapter hook config |
281
- | `verify:adapter-hooks-runtime` | Verify legacy adapter runtime |
282
- | `assess:adapter-hooks-session` | Assess legacy adapter session |
283
- | `assess:adapter-hooks-session:any` | Assess legacy adapter session including simulated events |
156
+ | iOS | `*.swift` |
157
+ | Backend | `apps/backend/**/*.ts` |
158
+ | Frontend | `apps/frontend/**/*.{ts,tsx,js,jsx}` and `apps/web/**/*.{ts,tsx,js,jsx}` |
159
+ | Android | `*.kt`, `*.kts` |
284
160
 
285
- ## MCP: JSON Installation and Configuration
161
+ ## MCP Evidence Context Server (Optional)
286
162
 
287
- ### Is MCP mandatory to use Pumuki?
163
+ MCP is optional. Pumuki core does not depend on MCP.
288
164
 
289
- No.
165
+ ### Consumer repository usage
290
166
 
291
- - Pumuki core does not require MCP JSON registration.
292
- - MCP is optional and only needed for external MCP/agent clients.
293
-
294
- ### MCP JSON example
167
+ Use the published binary from npm:
295
168
 
296
169
  ```json
297
170
  {
298
171
  "mcpServers": {
299
172
  "pumuki-evidence": {
300
- "command": "npm",
301
- "args": ["run", "mcp:evidence"],
302
- "cwd": "/absolute/path/to/ast-intelligence-hooks"
173
+ "command": "npx",
174
+ "args": ["--yes", "pumuki-mcp-evidence"],
175
+ "cwd": "/absolute/path/to/your-consumer-repo"
303
176
  }
304
177
  }
305
178
  }
306
179
  ```
307
180
 
308
- Start locally:
181
+ ### Framework repository usage
182
+
183
+ If you are developing this framework locally:
309
184
 
310
185
  ```bash
311
186
  npm run mcp:evidence
312
187
  ```
313
188
 
314
- ## Architecture and Design Philosophy
189
+ ## Framework Development (This Repository)
315
190
 
316
- ### Deterministic architecture
191
+ Use this path only when working on Pumuki itself (not as a consumer).
317
192
 
318
- `Facts -> Rules -> Gate -> ai_evidence v2.1`
319
-
320
- This deterministic flow is the backbone of reproducibility and governance.
321
-
322
- ### Stage-aware policy model
193
+ ```bash
194
+ git clone https://github.com/SwiftEnProfundidad/ast-intelligence-hooks.git
195
+ cd ast-intelligence-hooks
196
+ npm ci
197
+ ```
323
198
 
324
- Each stage has an explicit tolerance profile:
199
+ Recommended maintainer baseline:
325
200
 
326
- - `PRE_COMMIT`: immediate developer feedback,
327
- - `PRE_PUSH`: stronger repository-level protection,
328
- - `CI`: strict release-grade enforcement.
201
+ ```bash
202
+ npm run typecheck
203
+ npm run test
204
+ npm run test:deterministic
205
+ npm run validation:package-manifest
206
+ npm run skills:lock:check
207
+ ```
329
208
 
330
- ### Platform-aware by default
209
+ Operational menu:
331
210
 
332
- Pumuki detects platform scope and applies relevant packs:
211
+ ```bash
212
+ npm run framework:menu
213
+ ```
333
214
 
334
- - iOS,
335
- - Backend,
336
- - Frontend,
337
- - Android.
215
+ ## Deterministic Validation Suite
338
216
 
339
- ### Rule-pack governance
217
+ Core validation commands used by maintainers:
340
218
 
341
- - Rule packs are versioned.
342
- - Skills bundles are locked.
343
- - Drift detection is first-class.
219
+ | Command | Purpose |
220
+ | --- | --- |
221
+ | `npm run test:deterministic` | Evidence + MCP + heuristics deterministic baseline |
222
+ | `npm run validation:package-manifest` | Package contract and publish guardrails |
223
+ | `npm run validation:package-smoke` | Blocking install/lifecycle smoke in temp consumer |
224
+ | `npm run validation:package-smoke:minimal` | Minimal smoke path |
225
+ | `npm run validation:lifecycle-smoke` | Lifecycle round-trip check |
226
+ | `npm run validation:docs-hygiene` | Documentation governance checks |
227
+ | `npm run validation:clean-artifacts -- --dry-run` | Preview cleanup of generated artifacts |
344
228
 
345
- ### Evidence-first operations
229
+ ## Troubleshooting
346
230
 
347
- Operational decisions are backed by deterministic artifacts, not tribal memory.
231
+ | Symptom | Typical cause | Action |
232
+ | --- | --- | --- |
233
+ | Gate behaves differently in local and CI | Skills lock or policy drift | `npm run skills:lock:check` |
234
+ | `tsx` runtime errors | Unsupported Node runtime | Upgrade to `Node >= 18` |
235
+ | Upgrade side effects | Inconsistent modules/lockfile state | `rm -rf node_modules package-lock.json && npm install` |
236
+ | Consumer repo still has artifacts after tests | Lifecycle was not removed | `npx --yes pumuki remove` |
348
237
 
349
238
  ## Contributing and Support
350
239
 
351
240
  ### Contributing
352
241
 
353
242
  1. Branch from `develop`.
354
- 2. Keep changes scoped and deterministic.
355
- 3. Update docs/runbooks when behavior changes.
356
- 4. Open a PR with clear context and impact.
243
+ 2. Keep changes deterministic and scoped.
244
+ 3. Update docs and runbooks when behavior changes.
245
+ 4. Open PR with impact, risk, and verification notes.
357
246
 
358
- ### Issues and support
247
+ ### Support
359
248
 
360
- - Bug reports: open a GitHub issue with reproducible context.
361
- - Operational incidents: use `docs/validation/*` runbooks and artifacts.
362
- - Architecture questions: start from `docs/ARCHITECTURE.md` and `docs/evidence-v2.1.md`.
249
+ - Product and bug issues: GitHub issues.
250
+ - Operational incidents: `docs/validation/*` runbooks.
251
+ - Architecture references: `docs/ARCHITECTURE.md` and `docs/evidence-v2.1.md`.
363
252
 
364
253
  ## References
365
254
 
package/VERSION CHANGED
@@ -1 +1 @@
1
- v6.3.3
1
+ v6.3.10
@@ -148,7 +148,17 @@ Estado consolidado del refactor con seguimiento de tareas y evidencia del avance
148
148
  - ✅ Completar `pumuki-mock-consumer` con escenarios reproducibles multi-plataforma (`clean`, `violations`, `mixed`) y script de aplicación de escenarios.
149
149
  - ✅ Unificar iOS del mock exclusivamente bajo `apps/ios/` (eliminando duplicación `ios/`) para mantener estructura homogénea `apps/*`.
150
150
  - ✅ Migrar nombre canónico del paquete a `pumuki` y alinear comandos enterprise cortos (`npm install/update/uninstall pumuki`) con documentación y validaciones.
151
- - 🚧 Ejecutar matriz E2E completa en `pumuki-mock-consumer` (`install -> pre-commit/pre-push/ci -> remove`) sobre escenarios `clean`, `violations` y `mixed`.
151
+ - Publicar `pumuki@6.3.8` en npm y alinear tags de distribución (`latest` y `next`) a la misma versión.
152
+ - ✅ Marcar `pumuki-ast-hooks` como paquete npm legacy/deprecado y documentar migración explícita en `README.md`.
153
+ - ✅ Corregir `Quick Start` del `README.md` para consumo real por npm (`pumuki`) y comandos ejecutables de lifecycle/gates.
154
+ - ✅ Auditar `README.md` con criterios enterprise (profesionalismo, claridad, estructura y completitud) y generar backlog de mejoras priorizado.
155
+ - ✅ Reescribir `README.md` de forma integral con estándar enterprise (audiencia consumer/framework separada, comandos reales y estructura consistente).
156
+ - ✅ Publicar `pumuki@6.3.9` en npm (tags `latest` y `next`) para reflejar la documentación enterprise reescrita.
157
+ - ✅ Ejecutar matriz E2E completa en `pumuki-mock-consumer` (`install -> pre-commit/pre-push/ci -> remove`) sobre escenarios `clean`, `violations` y `mixed`.
158
+ - ✅ Endurecer `pumuki-mock-consumer` con fixtures multiarchivo por plataforma y runner único `npm run pumuki:matrix`.
159
+ - ✅ Endurecer `pumuki remove` para podar residuos vacíos de `node_modules` sin borrar dependencias reales de terceros.
160
+ - ✅ Restringir poda de vacíos en `node_modules` a repos sin dependencias externas declaradas (seguridad enterprise reforzada).
161
+ - 🚧 Integrar MCP en `pumuki-mock-consumer` y validar consumo real de `ai_evidence` desde cliente MCP externo.
152
162
 
153
163
  ## Notas
154
164
  - Estrategia obligatoria: commits atómicos por tarea.
@@ -7,6 +7,8 @@ export type ConsumerDependencySource = 'dependencies' | 'devDependencies' | 'non
7
7
  type ConsumerPackageJson = {
8
8
  dependencies?: Record<string, string>;
9
9
  devDependencies?: Record<string, string>;
10
+ optionalDependencies?: Record<string, string>;
11
+ peerDependencies?: Record<string, string>;
10
12
  };
11
13
 
12
14
  const readPackageJson = (repoRoot: string): ConsumerPackageJson => {
@@ -46,3 +48,23 @@ export const resolveCurrentPumukiDependency = (repoRoot: string): {
46
48
  source: 'none',
47
49
  };
48
50
  };
51
+
52
+ export const hasDeclaredDependenciesBeyondPumuki = (repoRoot: string): boolean => {
53
+ const pkg = readPackageJson(repoRoot);
54
+ const pumukiPackage = getCurrentPumukiPackageName();
55
+ const ignoredPackages = new Set([pumukiPackage, 'pumuki-ast-hooks']);
56
+
57
+ const hasExternalDependency = (section?: Record<string, string>): boolean => {
58
+ if (!section) {
59
+ return false;
60
+ }
61
+ return Object.keys(section).some((dependencyName) => !ignoredPackages.has(dependencyName));
62
+ };
63
+
64
+ return (
65
+ hasExternalDependency(pkg.dependencies) ||
66
+ hasExternalDependency(pkg.devDependencies) ||
67
+ hasExternalDependency(pkg.optionalDependencies) ||
68
+ hasExternalDependency(pkg.peerDependencies)
69
+ );
70
+ };
@@ -1,6 +1,9 @@
1
1
  import { existsSync, readdirSync, rmSync, unlinkSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
- import { resolveCurrentPumukiDependency } from './consumerPackage';
3
+ import {
4
+ hasDeclaredDependenciesBeyondPumuki,
5
+ resolveCurrentPumukiDependency,
6
+ } from './consumerPackage';
4
7
  import { LifecycleGitService, type ILifecycleGitService } from './gitService';
5
8
  import { LifecycleNpmService, type ILifecycleNpmService } from './npmService';
6
9
  import { getCurrentPumukiPackageName } from './packageInfo';
@@ -13,12 +16,38 @@ export type LifecycleRemoveResult = {
13
16
  removedArtifacts: ReadonlyArray<string>;
14
17
  };
15
18
 
16
- const cleanupNodeModulesIfOnlyLockfile = (repoRoot: string): void => {
19
+ const pruneEmptyNodeModulesDirectories = (directoryPath: string): boolean => {
20
+ const entries = readdirSync(directoryPath, { withFileTypes: true });
21
+
22
+ for (const entry of entries) {
23
+ if (!entry.isDirectory()) {
24
+ continue;
25
+ }
26
+ const childPath = join(directoryPath, entry.name);
27
+ const childIsEmpty = pruneEmptyNodeModulesDirectories(childPath);
28
+ if (childIsEmpty) {
29
+ rmSync(childPath, { recursive: true, force: true });
30
+ }
31
+ }
32
+
33
+ return readdirSync(directoryPath).length === 0;
34
+ };
35
+
36
+ const cleanupNodeModulesIfOnlyLockfile = (
37
+ repoRoot: string,
38
+ options?: {
39
+ allowPruneEmptyDirectories?: boolean;
40
+ }
41
+ ): void => {
17
42
  const nodeModulesPath = join(repoRoot, 'node_modules');
18
43
  if (!existsSync(nodeModulesPath)) {
19
44
  return;
20
45
  }
21
46
 
47
+ if (options?.allowPruneEmptyDirectories === true) {
48
+ pruneEmptyNodeModulesDirectories(nodeModulesPath);
49
+ }
50
+
22
51
  const entries = readdirSync(nodeModulesPath, { withFileTypes: true });
23
52
  if (entries.length === 0) {
24
53
  rmSync(nodeModulesPath, { recursive: true, force: true });
@@ -71,10 +100,13 @@ export const runLifecycleRemove = (params?: {
71
100
  });
72
101
 
73
102
  const currentDependency = resolveCurrentPumukiDependency(repoRoot);
103
+ const hasExternalDependencies = hasDeclaredDependenciesBeyondPumuki(repoRoot);
74
104
  const packageName = getCurrentPumukiPackageName();
75
105
 
76
106
  if (currentDependency.source === 'none') {
77
- cleanupNodeModulesIfOnlyLockfile(repoRoot);
107
+ cleanupNodeModulesIfOnlyLockfile(repoRoot, {
108
+ allowPruneEmptyDirectories: !hasExternalDependencies,
109
+ });
78
110
  return {
79
111
  repoRoot,
80
112
  packageRemoved: false,
@@ -84,7 +116,9 @@ export const runLifecycleRemove = (params?: {
84
116
  }
85
117
 
86
118
  npm.runNpm(['uninstall', packageName], repoRoot);
87
- cleanupNodeModulesIfOnlyLockfile(repoRoot);
119
+ cleanupNodeModulesIfOnlyLockfile(repoRoot, {
120
+ allowPruneEmptyDirectories: !hasExternalDependencies,
121
+ });
88
122
 
89
123
  return {
90
124
  repoRoot,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki",
3
- "version": "6.3.8",
3
+ "version": "6.3.10",
4
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.",
5
5
  "main": "index.js",
6
6
  "bin": {