pumuki 6.3.17 → 6.3.19

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.
Files changed (222) hide show
  1. package/README.md +217 -182
  2. package/VERSION +1 -1
  3. package/assets/benchmarks/c021-baseline-precommit-v001-baseline.json +145 -0
  4. package/assets/benchmarks/c021-baseline-precommit-v001.json +7679 -0
  5. package/assets/benchmarks/c022-baseline-precommit-v001-baseline.json +101 -0
  6. package/assets/benchmarks/c022-baseline-precommit-v001.json +4121 -0
  7. package/assets/benchmarks/c023-hotspots-mvp-t0-v001-baseline.json +2532 -0
  8. package/assets/benchmarks/c023-hotspots-mvp-t0-v001.json +2532 -0
  9. package/assets/benchmarks/legacy-baseline-precommit-v012.json +367 -0
  10. package/assets/readme/menu-option1/01-menu-consumer-v2.png +0 -0
  11. package/assets/readme/menu-option1/02-option1-preflight-block.png +0 -0
  12. package/assets/readme/menu-option1/03-option1-final-summary-block.png +0 -0
  13. package/assets/readme/menu-option1/04-option1-preflight-pass.png +0 -0
  14. package/assets/readme/menu-option1/05-option1-final-summary-pass.png +0 -0
  15. package/assets/readme/menu-option1/06-menu-after-run-pass.png +0 -0
  16. package/core/facts/HeuristicFact.ts +1 -0
  17. package/core/facts/detectors/browser/index.test.ts +48 -0
  18. package/core/facts/detectors/browser/index.ts +74 -56
  19. package/core/facts/detectors/contract.test.ts +29 -0
  20. package/core/facts/detectors/contract.ts +63 -0
  21. package/core/facts/detectors/process/core.test.ts +64 -0
  22. package/core/facts/detectors/process/core.ts +130 -103
  23. package/core/facts/detectors/process/shell.test.ts +49 -0
  24. package/core/facts/detectors/process/shell.ts +163 -149
  25. package/core/facts/detectors/process/spawn.test.ts +49 -0
  26. package/core/facts/detectors/process/spawn.ts +68 -106
  27. package/core/facts/detectors/security/index.ts +21 -2
  28. package/core/facts/detectors/security/securityCredentials.test.ts +68 -0
  29. package/core/facts/detectors/security/securityCredentials.ts +182 -160
  30. package/core/facts/detectors/security/securityCrypto.test.ts +48 -0
  31. package/core/facts/detectors/security/securityCrypto.ts +97 -79
  32. package/core/facts/detectors/security/securityJwt.test.ts +67 -0
  33. package/core/facts/detectors/security/securityJwt.ts +128 -110
  34. package/core/facts/detectors/security/securityTls.test.ts +35 -0
  35. package/core/facts/detectors/security/securityTls.ts +89 -77
  36. package/core/facts/detectors/typescript/index.test.ts +383 -0
  37. package/core/facts/detectors/typescript/index.ts +415 -11
  38. package/core/facts/detectors/utils/astHelpers.test.ts +43 -1
  39. package/core/facts/detectors/utils/astHelpers.ts +57 -2
  40. package/core/facts/extractHeuristicFacts.ts +286 -5
  41. package/core/gate/evaluateRules.test.ts +95 -0
  42. package/core/gate/evaluateRules.ts +173 -7
  43. package/core/rules/presets/astHeuristicsRuleSet.test.ts +3 -0
  44. package/core/rules/presets/astHeuristicsRuleSet.ts +2 -0
  45. package/core/rules/presets/heuristics/commonLegacy.ts +138 -0
  46. package/core/rules/presets/heuristics/typescript.ts +18 -0
  47. package/core/utils/stableStringify.ts +1 -1
  48. package/docs/API_REFERENCE.md +71 -1
  49. package/docs/CONFIGURATION.md +50 -0
  50. package/docs/INSTALLATION.md +3 -0
  51. package/docs/OPERATIONS.md +74 -0
  52. package/docs/README.md +15 -6
  53. package/docs/README_MENU_WALKTHROUGH.md +65 -0
  54. package/docs/REFRACTOR_PROGRESS.md +1303 -118
  55. package/docs/RELEASE_NOTES.md +29 -0
  56. package/docs/TESTING.md +13 -0
  57. package/docs/USAGE.md +154 -2
  58. package/docs/evidence-v2.1.md +40 -1
  59. package/docs/validation/README.md +19 -60
  60. package/docs/validation/c022-phase-acceptance-contract.md +172 -0
  61. package/docs/validation/detection-audit-baseline.md +60 -0
  62. package/integrations/config/compileSkillsLock.ts +22 -4
  63. package/integrations/config/coreSkillsLock.ts +30 -0
  64. package/integrations/config/heuristics.test.ts +28 -1
  65. package/integrations/config/heuristics.ts +5 -1
  66. package/integrations/config/loadProjectRules.ts +1 -1
  67. package/integrations/config/skillsCompilerTemplates.ts +54 -0
  68. package/integrations/config/skillsCustomRules.ts +369 -0
  69. package/integrations/config/skillsDetectorRegistry.ts +155 -0
  70. package/integrations/config/skillsEffectiveLock.ts +140 -0
  71. package/integrations/config/skillsLock.ts +31 -4
  72. package/integrations/config/skillsMarkdownRules.ts +348 -0
  73. package/integrations/config/skillsPolicy.ts +3 -3
  74. package/integrations/config/skillsRuleSet.ts +349 -56
  75. package/integrations/config/skillsSources.ts +1 -1
  76. package/integrations/evidence/buildEvidence.ts +101 -1
  77. package/integrations/evidence/evaluationMetrics.ts +46 -0
  78. package/integrations/evidence/platformSummary.test.ts +143 -0
  79. package/integrations/evidence/platformSummary.ts +185 -0
  80. package/integrations/evidence/repoState.ts +7 -4
  81. package/integrations/evidence/rulesCoverage.ts +110 -0
  82. package/integrations/evidence/schema.test.ts +40 -0
  83. package/integrations/evidence/schema.ts +49 -0
  84. package/integrations/evidence/writeEvidence.test.ts +152 -0
  85. package/integrations/evidence/writeEvidence.ts +113 -8
  86. package/integrations/gate/evaluateAiGate.ts +140 -0
  87. package/integrations/gate/stagePolicies.ts +53 -184
  88. package/integrations/git/GitService.ts +89 -2
  89. package/integrations/git/collectFileChurnOwnership.ts +206 -0
  90. package/integrations/git/composeFileTechnicalRiskSignals.ts +239 -0
  91. package/integrations/git/evaluateStagedIOS.ts +4 -4
  92. package/integrations/git/findingTraceability.ts +18 -8
  93. package/integrations/git/index.ts +3 -0
  94. package/integrations/git/rankFileHotspots.ts +165 -0
  95. package/integrations/git/resolveGitRefs.ts +2 -2
  96. package/integrations/git/runCliCommand.ts +3 -3
  97. package/integrations/git/runPlatformGate.ts +322 -29
  98. package/integrations/git/runPlatformGateEvaluation.ts +125 -2
  99. package/integrations/git/runPlatformGateEvidence.ts +23 -0
  100. package/integrations/git/runPlatformGateFacts.ts +42 -0
  101. package/integrations/git/runPlatformGateOutput.ts +40 -2
  102. package/integrations/git/stageRunners.ts +73 -12
  103. package/integrations/lifecycle/adapter.ts +1 -1
  104. package/integrations/lifecycle/analyticsHotspots.ts +128 -0
  105. package/integrations/lifecycle/artifacts.ts +3 -3
  106. package/integrations/lifecycle/cli.ts +521 -65
  107. package/integrations/lifecycle/doctor.ts +1 -1
  108. package/integrations/lifecycle/gitService.ts +19 -15
  109. package/integrations/lifecycle/index.ts +141 -0
  110. package/integrations/lifecycle/install.ts +3 -0
  111. package/integrations/lifecycle/npmService.ts +2 -2
  112. package/integrations/lifecycle/operationalMemoryContract.ts +427 -0
  113. package/integrations/lifecycle/operationalMemorySignals.ts +305 -0
  114. package/integrations/lifecycle/operationalMemorySnapshot.ts +151 -0
  115. package/integrations/lifecycle/remove.ts +1 -1
  116. package/integrations/lifecycle/saasEnterpriseAnalytics.ts +179 -0
  117. package/integrations/lifecycle/saasFederation.ts +318 -0
  118. package/integrations/lifecycle/saasIngestionAudit.ts +136 -0
  119. package/integrations/lifecycle/saasIngestionAuth.ts +115 -0
  120. package/integrations/lifecycle/saasIngestionBuilder.ts +56 -0
  121. package/integrations/lifecycle/saasIngestionContract.ts +419 -0
  122. package/integrations/lifecycle/saasIngestionGovernance.ts +205 -0
  123. package/integrations/lifecycle/saasIngestionIdempotency.ts +25 -0
  124. package/integrations/lifecycle/saasIngestionMetrics.ts +181 -0
  125. package/integrations/lifecycle/saasIngestionTransport.ts +359 -0
  126. package/integrations/lifecycle/state.ts +21 -21
  127. package/integrations/lifecycle/status.ts +1 -1
  128. package/integrations/lifecycle/update.ts +3 -1
  129. package/integrations/mcp/aiGateCheck.ts +43 -0
  130. package/integrations/mcp/enterpriseServer.ts +13 -20
  131. package/integrations/mcp/evidencePayloadCollectionsPaging.ts +7 -5
  132. package/integrations/mcp/evidencePayloadConfig.ts +3 -3
  133. package/integrations/notifications/emitAuditSummaryNotification.ts +135 -0
  134. package/integrations/platform/detectAndroid.ts +1 -4
  135. package/integrations/platform/detectBackend.ts +18 -1
  136. package/integrations/platform/detectFrontend.ts +23 -8
  137. package/integrations/platform/detectPlatforms.ts +38 -1
  138. package/integrations/sdd/openSpecCli.ts +3 -3
  139. package/integrations/sdd/policy.ts +2 -2
  140. package/integrations/sdd/sessionStore.ts +19 -19
  141. package/integrations/sdd/types.ts +1 -1
  142. package/integrations/tdd/contract.ts +160 -0
  143. package/integrations/tdd/enforcement.ts +335 -0
  144. package/integrations/tdd/index.ts +6 -0
  145. package/integrations/tdd/scope.ts +184 -0
  146. package/integrations/tdd/types.ts +33 -0
  147. package/integrations/tdd/waiver.ts +111 -0
  148. package/package.json +28 -21
  149. package/scripts/adapter-real-session-git-lib.ts +2 -2
  150. package/scripts/adapter-session-status-command-lib.ts +2 -2
  151. package/scripts/adapter-session-status-hook-log-filter-lib.ts +36 -10
  152. package/scripts/adapter-session-status-log-utils-lib.ts +40 -5
  153. package/scripts/adapter-session-status-writes-log-filter-lib.ts +13 -3
  154. package/scripts/adapters/install-agent-config.ts +1 -1
  155. package/scripts/build-adapter-readiness.ts +2 -2
  156. package/scripts/build-adapter-real-session-report.ts +2 -2
  157. package/scripts/build-consumer-startup-triage-runner-lib.ts +2 -2
  158. package/scripts/build-consumer-startup-triage.ts +2 -2
  159. package/scripts/build-consumer-startup-unblock-status.ts +2 -2
  160. package/scripts/build-consumer-support-ticket-draft.ts +2 -2
  161. package/scripts/build-legacy-parity-report.ts +78 -0
  162. package/scripts/build-mock-consumer-ab-report.ts +4 -3
  163. package/scripts/build-mock-consumer-startup-triage.ts +2 -2
  164. package/scripts/build-phase5-blockers-readiness.ts +2 -2
  165. package/scripts/build-phase5-execution-closure-status.ts +2 -2
  166. package/scripts/build-phase5-external-handoff.ts +2 -2
  167. package/scripts/c020-benchmark-lib.ts +86 -0
  168. package/scripts/check-package-manifest.ts +116 -19
  169. package/scripts/clean-validation-artifacts.ts +2 -2
  170. package/scripts/collect-consumer-ci-artifacts-gh-command-lib.ts +2 -2
  171. package/scripts/consumer-ci-auth-check-contract.ts +2 -1
  172. package/scripts/consumer-ci-auth-check-gh-lib.ts +2 -2
  173. package/scripts/consumer-support-bundle-contract.ts +5 -1
  174. package/scripts/consumer-support-bundle-gh-command-lib.ts +2 -2
  175. package/scripts/consumer-workflow-lint-command-lib.ts +2 -2
  176. package/scripts/framework-menu-action-contract.ts +3 -0
  177. package/scripts/framework-menu-actions-diagnostics-maintenance-lib.ts +26 -2
  178. package/scripts/framework-menu-actions-gates-stage-lib.ts +15 -0
  179. package/scripts/framework-menu-advanced-view-lib.ts +136 -0
  180. package/scripts/framework-menu-builders-maintenance.ts +4 -0
  181. package/scripts/framework-menu-builders.ts +1 -0
  182. package/scripts/framework-menu-consumer-actions-lib.ts +74 -0
  183. package/scripts/framework-menu-consumer-preflight-lib.ts +230 -0
  184. package/scripts/framework-menu-consumer-runtime-lib.ts +233 -0
  185. package/scripts/framework-menu-evidence-summary-lib.ts +258 -0
  186. package/scripts/framework-menu-gate-lib.ts +98 -0
  187. package/scripts/framework-menu-layout-lib.ts +116 -0
  188. package/scripts/framework-menu-legacy-audit-lib.ts +1229 -0
  189. package/scripts/framework-menu-legibility-lib.ts +92 -0
  190. package/scripts/framework-menu-matrix-baseline-lib.ts +107 -0
  191. package/scripts/framework-menu-matrix-canary-lib.ts +260 -0
  192. package/scripts/framework-menu-matrix-evidence-lib.ts +67 -0
  193. package/scripts/framework-menu-matrix-runner-lib.ts +99 -0
  194. package/scripts/framework-menu-prompts.ts +19 -0
  195. package/scripts/framework-menu-rule-coverage-diagnostics-lib.ts +213 -0
  196. package/scripts/framework-menu-runner-git-lib.ts +2 -2
  197. package/scripts/framework-menu-runner-process-lib.ts +3 -3
  198. package/scripts/framework-menu-runners-validation-custom-rules-lib.ts +11 -0
  199. package/scripts/framework-menu-runners-validation-hardmode-lib.ts +38 -4
  200. package/scripts/framework-menu-runners-validation-notifications-lib.ts +20 -0
  201. package/scripts/framework-menu-runners-validation-rule-coverage-lib.ts +18 -0
  202. package/scripts/framework-menu-runners-validation.ts +3 -0
  203. package/scripts/framework-menu-runners.ts +2 -0
  204. package/scripts/framework-menu-skills-lib.ts +3 -2
  205. package/scripts/framework-menu-system-notifications-lib.ts +191 -0
  206. package/scripts/framework-menu-ui-components-lib.ts +220 -0
  207. package/scripts/framework-menu-ui-version-lib.ts +6 -0
  208. package/scripts/framework-menu.ts +75 -79
  209. package/scripts/gitflow-cli-lib.ts +263 -0
  210. package/scripts/gitflow.ts +7 -0
  211. package/scripts/import-custom-skills.ts +74 -0
  212. package/scripts/legacy-parity-report-lib.ts +406 -0
  213. package/scripts/package-install-smoke-command-lib.ts +2 -2
  214. package/scripts/package-manifest-lib.ts +1 -0
  215. package/scripts/phase5-execution-closure-runner-exec-command-lib.ts +2 -2
  216. package/scripts/run-c020-benchmark.ts +154 -0
  217. package/scripts/run-phase5-execution-closure.ts +2 -2
  218. package/skills.lock.json +8874 -175
  219. package/docs/validation/adapter-hook-runtime-local-report.md +0 -45
  220. package/docs/validation/adapter-real-session-report-template.md +0 -63
  221. package/docs/validation/consumer-ci-startup-failure-playbook.md +0 -181
  222. package/docs/validation/github-support-ticket-template-startup-failure.md +0 -84
package/README.md CHANGED
@@ -1,162 +1,165 @@
1
1
  # Pumuki
2
2
 
3
+ ![Pumuki](assets/logo.png)
4
+
3
5
  [![npm version](https://img.shields.io/npm/v/pumuki?color=1d4ed8)](https://www.npmjs.com/package/pumuki)
4
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)
5
7
  [![License](https://img.shields.io/badge/license-MIT-16a34a)](LICENSE)
6
8
 
7
9
  Enterprise governance framework for AI-assisted software delivery.
8
10
 
9
- Pumuki enforces deterministic decisions across local hooks, PRE_WRITE guardrails, and CI using one execution model:
11
+ Pumuki gives engineering teams one deterministic execution model across local development, hooks, and CI:
10
12
 
11
- `Facts -> Rules -> Gate -> ai_evidence v2.1`
13
+ `Facts -> Rules -> Gate -> .ai_evidence.json (v2.1)`
12
14
 
13
- ## What Pumuki Solves
15
+ ## Who This README Is For
14
16
 
15
- Pumuki gives teams a single operational contract for AI-era code quality:
17
+ | Profile | Use this path first |
18
+ |---|---|
19
+ | Consumer repository team | [5-Minute Quick Start (Consumer)](#5-minute-quick-start-consumer) |
20
+ | Framework maintainers (this repo) | [Framework Maintainer Flow](#framework-maintainer-flow-this-repo) |
21
+ | Platform/architecture owners | [Enterprise Operations Baseline](#enterprise-operations-baseline) |
16
22
 
17
- - Deterministic gate decisions with auditable evidence.
18
- - Unified stage model: `PRE_WRITE`, `PRE_COMMIT`, `PRE_PUSH`, `CI`.
19
- - Multi-platform rule evaluation (iOS, Android, Backend, Frontend).
20
- - Mandatory OpenSpec/SDD policy enforcement.
21
- - Optional MCP runtime for agent integrations.
23
+ ## 5-Minute Quick Start (Consumer)
22
24
 
23
- ## Core Capabilities
25
+ Prerequisites:
24
26
 
25
- ### 1) Deterministic Gate + Evidence
27
+ - Node.js `>= 18`
28
+ - npm `>= 9`
29
+ - Git repository
26
30
 
27
- Every stage can emit `.ai_evidence.json` with stable structure (`version: 2.1`) including:
31
+ Install and bootstrap:
28
32
 
29
- - `snapshot` (stage/outcome/findings)
30
- - `ledger` (persistent open violations)
31
- - `rulesets` and `platforms`
32
- - `sdd_metrics`
33
- - `repo_state` (`git` + lifecycle + optional hard mode state)
33
+ ```bash
34
+ npm install --save-exact pumuki
35
+ npx --yes pumuki install
36
+ npx --yes pumuki doctor
37
+ npx --yes pumuki status
38
+ ```
34
39
 
35
- Reference: `docs/evidence-v2.1.md`.
40
+ OpenSpec/SDD baseline:
36
41
 
37
- ### 2) Unified AI Gate for PRE_WRITE/MCP
42
+ ```bash
43
+ npx --yes pumuki sdd status
44
+ mkdir -p openspec/changes/<change-id>
45
+ npx --yes pumuki sdd session --open --change=<change-id>
46
+ npx --yes pumuki sdd validate --stage=PRE_COMMIT
47
+ ```
38
48
 
39
- The same AI gate evaluator is shared across CLI and MCP:
49
+ Run local gates:
40
50
 
41
- - stale/missing/invalid evidence detection
42
- - blocked evidence gate status detection
43
- - protected branch guardrail (`main/master/develop/dev`)
44
- - policy trace visibility (`default`, `skills.policy`, `hard-mode`)
51
+ ```bash
52
+ npx --yes pumuki-pre-write
53
+ npx --yes pumuki-pre-commit
54
+ ```
45
55
 
46
- Reference: `integrations/gate/evaluateAiGate.ts`.
56
+ Run push/CI gates (requires proper git context):
47
57
 
48
- ### 3) Mandatory OpenSpec + SDD Policy
58
+ ```bash
59
+ git push --set-upstream origin <branch>
60
+ npx --yes pumuki-pre-push
61
+ npx --yes pumuki-ci
62
+ ```
49
63
 
50
- Pumuki enforces OpenSpec/SDD as first-class guardrails:
64
+ Expected behavior:
51
65
 
52
- - `PRE_WRITE`: OpenSpec installed/project/session valid.
53
- - `PRE_COMMIT`, `PRE_PUSH`, `CI`: valid session + stage validation.
54
- - Blocking SDD findings are traceable via `source: "sdd-policy"`.
66
+ - `PRE_WRITE` and `PRE_COMMIT`: should pass when SDD session is valid and rules are satisfied.
67
+ - `PRE_PUSH`: blocks if branch has no upstream tracking reference.
68
+ - `CI`: requires a valid diff range context (not `HEAD..HEAD` with ambiguous range).
55
69
 
56
- ### 4) Lifecycle and Enterprise Safety
70
+ ## Why Pumuki
57
71
 
58
- Managed lifecycle commands (`install/update/uninstall/remove`) include:
72
+ Modern teams need fast feedback with strict governance. Pumuki combines:
59
73
 
60
- - hook management (`pre-commit`, `pre-push`)
61
- - OpenSpec bootstrap/migration
62
- - deterministic evidence bootstrap
63
- - safety block when tracked files exist under `node_modules/`
74
+ - Deterministic enforcement per stage (`PRE_WRITE`, `PRE_COMMIT`, `PRE_PUSH`, `CI`).
75
+ - A single evidence contract (`.ai_evidence.json`, v2.1) for auditability and automation.
76
+ - Multi-platform governance (iOS, Android, Backend, Frontend).
77
+ - Unified skills engine with deterministic precedence (`core -> repo -> custom`).
78
+ - Mandatory OpenSpec/SDD checks for enterprise change control.
79
+ - Unified CLI plus optional MCP servers for agent-driven workflows.
64
80
 
65
- ### 5) Adapter Scaffolding (IDE/Agent)
81
+ ## Enterprise Execution Model
66
82
 
67
- Provider-agnostic adapter scaffolding for consumer repositories:
83
+ Each execution follows the same pipeline:
68
84
 
69
- - `codex`
70
- - `claude`
71
- - `cursor`
72
- - `windsurf`
73
- - `opencode`
85
+ 1. Facts extraction from staged/range/repo scope.
86
+ 2. Rule evaluation by platform and stage policy.
87
+ 3. Gate decision (`PASS`, `WARN`, `BLOCK`) with deterministic thresholds.
88
+ 4. Evidence emission (`.ai_evidence.json`) with findings, metadata, and coverage telemetry.
74
89
 
75
- ## Quick Start (Consumer Repository)
90
+ Rules resolution order:
76
91
 
77
- Prerequisites:
92
+ 1. Core rules (embedded package snapshot).
93
+ 2. Repo rules (`skills.lock.json`), optional.
94
+ 3. Custom rules (`.pumuki/custom-rules.json`), optional.
78
95
 
79
- - `Node.js >= 18`
80
- - `npm >= 9`
81
- - `git`
96
+ Conflict policy:
82
97
 
83
- ### 1) Install package
98
+ - `custom > repo > core` (last writer wins by `ruleId`).
99
+ - Platform rules activate only for detected platforms.
100
+ - `generic/text` rules remain available as cross-platform governance guards.
84
101
 
85
- ```bash
86
- npm install --save-exact pumuki
87
- ```
102
+ Rule modes:
88
103
 
89
- ### 2) Install managed lifecycle + bootstrap
104
+ - `AUTO`: mapped to deterministic detectors/heuristics.
105
+ - `DECLARATIVE`: valid only when explicitly declared in lock/custom payload (no silent fallback for rules extracted from skills markdown).
90
106
 
91
- ```bash
92
- npx --yes pumuki install
93
- ```
107
+ ## Core Capabilities
94
108
 
95
- ### 3) Verify environment
109
+ 1. Deterministic stage gates with consistent exit semantics.
110
+ 2. Evidence v2.1 with rules coverage enforcement and stable ordering.
111
+ 3. Unified skills rules engine (core + repo + custom).
112
+ 4. Unified AI gate behavior across CLI and MCP surfaces.
113
+ 5. Mandatory OpenSpec/SDD policy checks.
114
+ 6. Interactive menu UX (consumer + advanced modes).
115
+ 7. Hard mode policy hardening (`.pumuki/hard-mode.json` + env overrides).
116
+ 8. Lifecycle commands for install/update/diagnostics/teardown.
117
+ 9. Provider-agnostic adapter scaffolding (`codex`, `claude`, `cursor`, `windsurf`, `opencode`).
118
+ 10. Optional MCP servers for evidence and enterprise context.
96
119
 
97
- ```bash
98
- npx --yes pumuki doctor
99
- npx --yes pumuki status
100
- npx --yes pumuki sdd status
101
- ```
120
+ ## Framework Maintainer Flow (This Repo)
102
121
 
103
- ### 4) Open an SDD session
122
+ Use this only when working in the Pumuki framework repository itself:
104
123
 
105
124
  ```bash
106
- npx --yes pumuki sdd session --open --change=<change-id>
125
+ npm run framework:menu
126
+ PUMUKI_MENU_UI_V2=1 npm run framework:menu
127
+ PUMUKI_MENU_MODE=advanced npm run framework:menu
107
128
  ```
108
129
 
109
- ### 5) Run gates
130
+ Skills engine operations:
110
131
 
111
132
  ```bash
112
- npx --yes pumuki-pre-write
113
- npx --yes pumuki-pre-commit
114
- npx --yes pumuki-pre-push
115
- npx --yes pumuki-ci
133
+ npm run skills:compile
134
+ npm run skills:lock:check
135
+ npm run skills:import:custom
136
+ npm run skills:import:custom -- --source <absolute-path-to-SKILL.md> --source <second-absolute-path-to-SKILL.md>
116
137
  ```
117
138
 
118
- ## Hard Mode (Policy Hardening)
119
-
120
- Pumuki supports hard-mode policy resolution via `.pumuki/hard-mode.json`.
121
-
122
- Example:
139
+ Adapter scaffolding:
123
140
 
124
- ```json
125
- {
126
- "enabled": true,
127
- "profile": "critical-high"
128
- }
141
+ ```bash
142
+ npx --yes pumuki adapter install --agent=codex --dry-run
143
+ npx --yes pumuki adapter install --agent=cursor
144
+ npm run adapter:install -- --agent=claude
129
145
  ```
130
146
 
131
- Current profile support:
132
-
133
- - `critical-high`
134
-
135
- Environment overrides:
147
+ Operational matrix/canary:
136
148
 
137
- - `PUMUKI_HARD_MODE` (`true|false|1|0|on|off`)
138
- - `PUMUKI_HARD_MODE_PROFILE` (`critical-high`)
139
-
140
- Runtime traceability:
141
-
142
- - policy trace is exposed in AI Gate outputs
143
- - hard mode state is captured in `repo_state.lifecycle.hard_mode`
144
-
145
- ## PRE_WRITE Contract
149
+ ```bash
150
+ 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));"
151
+ 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));"
152
+ ```
146
153
 
147
- For deterministic pre-write integrations:
154
+ Legacy parity report (strict comparator):
148
155
 
149
156
  ```bash
150
- npx --yes pumuki sdd validate --stage=PRE_WRITE --json
157
+ node --import tsx scripts/build-legacy-parity-report.ts --legacy=<legacy-evidence-path> --enterprise=<enterprise-evidence-path> --out=<output-path>
151
158
  ```
152
159
 
153
- Returns a chained envelope with:
154
-
155
- - `sdd`
156
- - `ai_gate`
157
- - `telemetry.chain = "pumuki->ai_gate->ai_evidence"`
160
+ ## Command Reference
158
161
 
159
- ## Lifecycle Commands
162
+ ### Lifecycle (Consumer)
160
163
 
161
164
  ```bash
162
165
  npx --yes pumuki install
@@ -167,125 +170,157 @@ npx --yes pumuki doctor
167
170
  npx --yes pumuki status
168
171
  ```
169
172
 
170
- Important:
171
-
172
- - `pumuki remove` is the full teardown path (hooks + artifacts + dependency cleanup logic).
173
- - `npm uninstall pumuki` only removes dependency entries.
174
-
175
- ## Adapter Commands
173
+ ### SDD / OpenSpec (Consumer)
176
174
 
177
175
  ```bash
178
- npx --yes pumuki adapter install --agent=codex --dry-run
179
- npx --yes pumuki adapter install --agent=cursor
180
- npm run adapter:install -- --agent=claude
176
+ npx --yes pumuki sdd status
177
+ npx --yes pumuki sdd session --open --change=<change-id>
178
+ npx --yes pumuki sdd session --refresh
179
+ npx --yes pumuki sdd session --close
180
+ npx --yes pumuki sdd validate --stage=PRE_COMMIT
181
181
  ```
182
182
 
183
- ## MCP Servers (Optional)
184
-
185
- Pumuki core does not depend on MCP, but MCP is available for external agents.
186
-
187
- Evidence MCP:
183
+ ### Stage Gates (Consumer)
188
184
 
189
185
  ```bash
190
- npx --yes pumuki-mcp-evidence
186
+ npx --yes pumuki-pre-write
187
+ npx --yes pumuki-pre-commit
188
+ npx --yes pumuki-pre-push
189
+ npx --yes pumuki-ci
191
190
  ```
192
191
 
193
- Enterprise MCP:
192
+ ### MCP Servers (Optional, Long-Running)
194
193
 
195
194
  ```bash
195
+ npx --yes pumuki-mcp-evidence
196
196
  npx --yes pumuki-mcp-enterprise
197
197
  ```
198
198
 
199
- References:
199
+ ## Validation and Diagnostics (Framework-Only)
200
200
 
201
- - `docs/MCP_EVIDENCE_CONTEXT_SERVER.md`
202
- - `docs/MCP_SERVERS.md`
203
- - `docs/MCP_AGENT_CONTEXT_CONSUMPTION.md`
204
-
205
- ## Framework Repository (This Repo)
201
+ These commands are for maintainers and may require additional arguments, external repo context, or authenticated GitHub access.
206
202
 
207
203
  ```bash
208
- git clone https://github.com/SwiftEnProfundidad/ast-intelligence-hooks.git
209
- cd ast-intelligence-hooks
210
- npm ci
204
+ npm run validation:consumer-ci-artifacts -- --repo <owner/repo>
205
+ npm run validation:consumer-ci-auth-check -- --repo <owner/repo>
206
+ npm run validation:consumer-workflow-lint -- --repo-path <absolute-path-to-consumer-repo>
207
+ npm run validation:consumer-support-bundle -- --repo <owner/repo>
208
+ npm run validation:consumer-support-ticket-draft
209
+ npm run validation:consumer-startup-unblock-status
210
+ npm run validation:consumer-startup-triage -- --repo <owner/repo> --skip-workflow-lint
211
+ npm run validation:mock-consumer-ab-report
212
+ npm run validation:adapter-readiness
213
+ npm run validation:adapter-session-status
214
+ npm run validation:adapter-real-session-report
215
+ npm run validation:phase5-blockers-readiness
216
+ npm run validation:phase5-execution-closure-status
217
+ npm run validation:phase5-execution-closure -- --repo <owner/repo> --skip-workflow-lint
218
+ npm run validation:phase5-external-handoff
219
+ npm run validation:clean-artifacts
211
220
  ```
212
221
 
213
- Recommended baseline:
222
+ Important:
214
223
 
215
- ```bash
216
- npm run typecheck
217
- npm run test
218
- npm run test:deterministic
219
- npm run validation:package-manifest
220
- npm run skills:lock:check
221
- ```
224
+ - Several validation scripts intentionally return non-zero when verdict is `BLOCKED`, `PENDING`, or `MISSING_INPUTS`.
225
+ - Non-zero in these scripts is often diagnostic output, not a runtime crash.
226
+ - `validation:consumer-support-ticket-draft` expects an existing support bundle generated by `validation:consumer-support-bundle`.
227
+ - If workflow lint is required in your flow, provide `--repo-path` and `--actionlint-bin`; otherwise use `--skip-workflow-lint`.
222
228
 
223
- Interactive menu:
229
+ ## Menu Walkthrough and Screenshots
224
230
 
225
- ```bash
226
- npm run framework:menu
227
- ```
231
+ ### Capture 1 — Consumer Menu (v2)
228
232
 
229
- Consumer repositories typically run:
233
+ ![Consumer Menu v2](assets/readme/menu-option1/01-menu-consumer-v2.png)
230
234
 
231
- ```bash
232
- npx --yes pumuki-framework
233
- ```
235
+ ### Capture 2 — Option 1 Pre-flight (BLOCK context)
234
236
 
235
- ## Published Binaries
237
+ ![Option 1 Pre-flight Block](assets/readme/menu-option1/02-option1-preflight-block.png)
236
238
 
237
- - `pumuki`
238
- - `pumuki-framework`
239
- - `pumuki-pre-write`
240
- - `pumuki-pre-commit`
241
- - `pumuki-pre-push`
242
- - `pumuki-ci`
243
- - `pumuki-mcp-evidence`
244
- - `pumuki-mcp-enterprise`
239
+ ### Capture 3 — Option 1 Final Summary (BLOCK)
245
240
 
246
- ## Troubleshooting
241
+ ![Option 1 Final Summary Block](assets/readme/menu-option1/03-option1-final-summary-block.png)
247
242
 
248
- Hook/lifecycle drift:
243
+ ### Capture 4 — Option 1 Pre-flight (PASS scenario)
249
244
 
250
- ```bash
251
- npx --yes pumuki doctor
252
- npx --yes pumuki status
253
- ```
245
+ ![Option 1 Pre-flight Pass Scenario](assets/readme/menu-option1/04-option1-preflight-pass.png)
254
246
 
255
- Missing upstream for `PRE_PUSH`:
247
+ ### Capture 5 — Option 1 Final Summary (PASS)
256
248
 
257
- ```bash
258
- git push --set-upstream origin <branch>
259
- ```
249
+ ![Option 1 Final Summary Pass](assets/readme/menu-option1/05-option1-final-summary-pass.png)
260
250
 
261
- Emergency SDD bypass (incident-only):
251
+ ### Capture 6 — Menu Status After PASS Run
262
252
 
263
- ```bash
264
- PUMUKI_SDD_BYPASS=1 npx --yes pumuki sdd validate --stage=PRE_COMMIT
265
- ```
253
+ ![Menu After Pass Run](assets/readme/menu-option1/06-menu-after-run-pass.png)
254
+
255
+ Extended annotated walkthrough:
266
256
 
267
- ## Documentation Map
257
+ - `docs/README_MENU_WALKTHROUGH.md`
268
258
 
269
- Primary index: `docs/README.md`
259
+ ## Enterprise Operations Baseline
270
260
 
271
- Core docs:
261
+ Pumuki production SaaS operation baseline is defined in:
272
262
 
273
- - `docs/ARCHITECTURE.md`
274
- - `docs/INSTALLATION.md`
275
- - `docs/USAGE.md`
276
- - `docs/CONFIGURATION.md`
277
- - `docs/API_REFERENCE.md`
278
- - `docs/evidence-v2.1.md`
279
- - `docs/MCP_SERVERS.md`
280
- - `docs/MCP_EVIDENCE_CONTEXT_SERVER.md`
281
- - `docs/validation/README.md`
263
+ - `docs/OPERATIONS.md`
282
264
 
283
- Contributor docs:
265
+ Highlights:
284
266
 
285
- - `docs/CONTRIBUTING.md`
286
- - `docs/CODE_STANDARDS.md`
287
- - `CHANGELOG.md`
267
+ - Minimum SLO/SLA targets for ingestion availability, latency, freshness, and isolation.
268
+ - Severity model (`SEV1/SEV2/SEV3`) with response and RCA expectations.
269
+ - Mandatory controls for tenant/repo isolation, auth policy, idempotency, and auditing.
270
+ - Go-live checklist and rollback requirements.
271
+
272
+ ## Troubleshooting
273
+
274
+ - `OpenSpec change "<id>" not found`: ensure `openspec/changes/<id>` exists before opening session.
275
+ - `SDD_SESSION_MISSING`: open and validate session first.
276
+ - `pre-push blocked: branch has no upstream`: run `git push --set-upstream origin <branch>`.
277
+ - `Missing required argument --repo` / `--repo-path`: pass required flags for validation scripts.
278
+ - Legacy parity report usage requires `--legacy=<path>` and `--enterprise=<path>` (equals form).
279
+ - If menu v2 rendering fails, Pumuki falls back to classic UI.
280
+
281
+ ## Documentation Index
282
+
283
+ - Installation: `docs/INSTALLATION.md`
284
+ - Usage: `docs/USAGE.md`
285
+ - Testing: `docs/TESTING.md`
286
+ - API reference: `docs/API_REFERENCE.md`
287
+ - Architecture: `docs/ARCHITECTURE.md`
288
+ - Configuration: `docs/CONFIGURATION.md`
289
+ - Code standards: `docs/CODE_STANDARDS.md`
290
+ - Branch protection: `docs/BRANCH_PROTECTION_GUIDE.md`
291
+ - MCP servers: `docs/MCP_SERVERS.md`
292
+ - MCP evidence server: `docs/MCP_EVIDENCE_CONTEXT_SERVER.md`
293
+ - MCP consumption: `docs/MCP_AGENT_CONTEXT_CONSUMPTION.md`
294
+ - Evidence schema v2.1: `docs/evidence-v2.1.md`
295
+ - Operations policy (SLA/SLO): `docs/OPERATIONS.md`
296
+ - Release notes: `docs/RELEASE_NOTES.md`
297
+ - Changelog: `CHANGELOG.md`
298
+
299
+ ## Collaboration
300
+
301
+ Contributions are welcome. For high-quality collaboration:
302
+
303
+ 1. Read `docs/CONTRIBUTING.md` and `docs/CODE_STANDARDS.md`.
304
+ 2. Create a dedicated branch per change.
305
+ 3. Keep scope focused and include deterministic evidence when relevant.
306
+ 4. Before opening a PR, run at least:
307
+ - `npm run typecheck`
308
+ - `npm run test:operational-memory`
309
+ - `npm run test:saas-ingestion`
310
+ 5. Open a PR with clear problem statement, approach, and validation evidence.
311
+
312
+ ## Support and Security
313
+
314
+ - Functional/usage issues: open a GitHub issue with reproducible steps.
315
+ - Enterprise diagnostics: include generated reports from `.audit-reports` when applicable.
316
+ - Security-sensitive findings: use GitHub Security Advisories for coordinated disclosure.
288
317
 
289
318
  ## License
290
319
 
291
- MIT (`LICENSE`)
320
+ MIT. See `LICENSE`.
321
+
322
+ ## If Pumuki Helped You
323
+
324
+ If this project was useful for your team, please consider leaving a GitHub star:
325
+
326
+ [Star Pumuki on GitHub](https://github.com/SwiftEnProfundidad/ast-intelligence-hooks)
package/VERSION CHANGED
@@ -1 +1 @@
1
- v6.3.17
1
+ v6.3.19
@@ -0,0 +1,145 @@
1
+ {
2
+ "stage": "PRE_COMMIT",
3
+ "audit_mode": "engine",
4
+ "outcome": "BLOCK",
5
+ "files_scanned": 987,
6
+ "total_violations": 146,
7
+ "by_enterprise_severity": {
8
+ "CRITICAL": 42,
9
+ "HIGH": 44,
10
+ "MEDIUM": 60,
11
+ "LOW": 0
12
+ },
13
+ "rules_coverage": {
14
+ "active": 417,
15
+ "evaluated": 417,
16
+ "unevaluated": 0,
17
+ "coverage_ratio": 1
18
+ },
19
+ "top_rules": [
20
+ {
21
+ "ruleId": "common.types.unknown_without_guard",
22
+ "count": 60
23
+ },
24
+ {
25
+ "ruleId": "common.types.undefined_in_base_type",
26
+ "count": 33
27
+ },
28
+ {
29
+ "ruleId": "common.types.record_unknown_requires_type",
30
+ "count": 26
31
+ },
32
+ {
33
+ "ruleId": "common.network.missing_error_handling",
34
+ "count": 6
35
+ },
36
+ {
37
+ "ruleId": "common.error.empty_catch",
38
+ "count": 4
39
+ },
40
+ {
41
+ "ruleId": "skills.backend.no-empty-catch",
42
+ "count": 4
43
+ },
44
+ {
45
+ "ruleId": "skills.frontend.no-empty-catch",
46
+ "count": 4
47
+ },
48
+ {
49
+ "ruleId": "heuristics.ts.child-process-spawn-sync.ast",
50
+ "count": 2
51
+ },
52
+ {
53
+ "ruleId": "heuristics.ts.child-process-exec-file-sync.ast",
54
+ "count": 1
55
+ },
56
+ {
57
+ "ruleId": "heuristics.ts.child-process-exec-file-untrusted-args.ast",
58
+ "count": 1
59
+ },
60
+ {
61
+ "ruleId": "heuristics.ts.child-process-exec.ast",
62
+ "count": 1
63
+ },
64
+ {
65
+ "ruleId": "heuristics.ts.dynamic-shell-invocation.ast",
66
+ "count": 1
67
+ },
68
+ {
69
+ "ruleId": "heuristics.ts.process-exit.ast",
70
+ "count": 1
71
+ },
72
+ {
73
+ "ruleId": "workflow.bdd.insufficient_features",
74
+ "count": 1
75
+ },
76
+ {
77
+ "ruleId": "workflow.bdd.missing_feature_files",
78
+ "count": 1
79
+ }
80
+ ],
81
+ "top_files": [
82
+ {
83
+ "file": "scripts/framework-menu-matrix-canary-lib.ts",
84
+ "count": 6
85
+ },
86
+ {
87
+ "file": "core/facts/extractHeuristicFacts.ts",
88
+ "count": 4
89
+ },
90
+ {
91
+ "file": "integrations/lifecycle/gitService.ts",
92
+ "count": 4
93
+ },
94
+ {
95
+ "file": "core/facts/detectors/typescript/index.ts",
96
+ "count": 3
97
+ },
98
+ {
99
+ "file": "integrations/config/skillsCustomRules.ts",
100
+ "count": 3
101
+ },
102
+ {
103
+ "file": "integrations/lifecycle/update.ts",
104
+ "count": 3
105
+ },
106
+ {
107
+ "file": "integrations/mcp/enterpriseServer.ts",
108
+ "count": 3
109
+ },
110
+ {
111
+ "file": "scripts/adapter-session-status-writes-log-filter-lib.ts",
112
+ "count": 3
113
+ },
114
+ {
115
+ "file": "PROJECT_ROOT",
116
+ "count": 2
117
+ },
118
+ {
119
+ "file": "core/facts/detectors/browser/index.ts",
120
+ "count": 2
121
+ },
122
+ {
123
+ "file": "core/facts/detectors/process/core.ts",
124
+ "count": 2
125
+ },
126
+ {
127
+ "file": "core/facts/detectors/process/shell.ts",
128
+ "count": 2
129
+ },
130
+ {
131
+ "file": "core/facts/detectors/process/spawn.ts",
132
+ "count": 2
133
+ },
134
+ {
135
+ "file": "core/facts/detectors/security/securityCredentials.ts",
136
+ "count": 2
137
+ },
138
+ {
139
+ "file": "core/facts/detectors/security/securityCrypto.ts",
140
+ "count": 2
141
+ }
142
+ ],
143
+ "source": ".audit_tmp/c021-0-t2/enterprise-menu1.json",
144
+ "generated_at": "2026-02-24T09:18:27Z"
145
+ }