pumuki 6.3.13 → 6.3.15

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 (66) hide show
  1. package/README.md +95 -7
  2. package/VERSION +1 -1
  3. package/bin/pumuki-mcp-enterprise.js +5 -0
  4. package/bin/pumuki-pre-write.js +11 -0
  5. package/docs/API_REFERENCE.md +2 -1
  6. package/docs/CORE_INTEGRATIONS_UNTESTED_INVENTORY.md +57 -0
  7. package/docs/INSTALLATION.md +101 -54
  8. package/docs/MCP_SERVERS.md +167 -74
  9. package/docs/PUMUKI_FULL_VALIDATION_CHECKLIST.md +46 -45
  10. package/docs/PUMUKI_OPENSPEC_SDD_ROADMAP.md +55 -0
  11. package/docs/README.md +9 -0
  12. package/docs/REFRACTOR_PROGRESS.md +288 -6
  13. package/docs/USAGE.md +115 -8
  14. package/docs/validation/README.md +5 -0
  15. package/docs/validation/mock-consumer-next-cycle-enterprise-checklist.md +68 -0
  16. package/docs/validation/mock-consumer-next-round-scope.md +222 -0
  17. package/docs/validation/mock-consumer-post-release-handoff-pack.md +486 -0
  18. package/docs/validation/phase12-go-no-go-report.md +73 -0
  19. package/docs/validation/post-phase12-next-lot-decision.md +75 -0
  20. package/integrations/config/skillsRuleSet.ts +53 -6
  21. package/integrations/evidence/buildEvidence.ts +42 -3
  22. package/integrations/evidence/generateEvidence.test.ts +59 -0
  23. package/integrations/evidence/readEvidence.test.ts +61 -0
  24. package/integrations/evidence/schema.test.ts +81 -0
  25. package/integrations/evidence/schema.ts +11 -0
  26. package/integrations/evidence/writeEvidence.test.ts +18 -0
  27. package/integrations/evidence/writeEvidence.ts +11 -0
  28. package/integrations/git/resolveGitRefs.ts +2 -2
  29. package/integrations/git/runPlatformGate.ts +64 -0
  30. package/integrations/git/runPlatformGateEvidence.ts +13 -0
  31. package/integrations/git/stageRunners.ts +10 -1
  32. package/integrations/lifecycle/artifacts.ts +57 -4
  33. package/integrations/lifecycle/cli.ts +248 -12
  34. package/integrations/lifecycle/constants.ts +1 -0
  35. package/integrations/lifecycle/gitService.ts +1 -0
  36. package/integrations/lifecycle/install.ts +24 -1
  37. package/integrations/lifecycle/openSpecBootstrap.ts +190 -0
  38. package/integrations/lifecycle/state.ts +57 -0
  39. package/integrations/lifecycle/uninstall.ts +3 -1
  40. package/integrations/lifecycle/update.ts +11 -0
  41. package/integrations/mcp/enterpriseServer.cli.ts +12 -0
  42. package/integrations/mcp/enterpriseServer.ts +762 -0
  43. package/integrations/mcp/evidenceFacets.ts +5 -2
  44. package/integrations/mcp/evidenceFacetsBase.ts +3 -94
  45. package/integrations/mcp/evidenceFacetsFindings.ts +39 -0
  46. package/integrations/mcp/evidenceFacetsLedger.ts +27 -0
  47. package/integrations/mcp/evidenceFacetsPlatforms.ts +21 -0
  48. package/integrations/mcp/evidenceFacetsRulesets.ts +53 -0
  49. package/integrations/mcp/evidenceFacetsSeverity.ts +62 -0
  50. package/integrations/mcp/evidenceFacetsSnapshot.ts +4 -104
  51. package/integrations/mcp/evidencePayloadBuilders.ts +2 -0
  52. package/integrations/mcp/evidencePayloadContext.ts +5 -0
  53. package/integrations/mcp/evidencePayloadStatus.ts +100 -0
  54. package/integrations/mcp/evidencePayloadSummary.ts +0 -81
  55. package/integrations/mcp/evidencePayloads.ts +2 -8
  56. package/integrations/mcp/index.ts +1 -0
  57. package/integrations/sdd/index.ts +11 -0
  58. package/integrations/sdd/openSpecCli.ts +180 -0
  59. package/integrations/sdd/policy.ts +190 -0
  60. package/integrations/sdd/sessionStore.ts +152 -0
  61. package/integrations/sdd/types.ts +69 -0
  62. package/package.json +10 -5
  63. package/scripts/framework-menu-runner-path-lib.ts +10 -3
  64. package/scripts/framework-menu.ts +86 -5
  65. package/scripts/package-install-smoke-gate-lib.ts +6 -1
  66. package/scripts/package-install-smoke-lifecycle-lib.ts +3 -0
package/README.md CHANGED
@@ -21,8 +21,9 @@ Pumuki converts code changes into traceable, reproducible decisions:
21
21
  - [Quick Start for Consumer Repositories](#quick-start-for-consumer-repositories)
22
22
  - [Lifecycle Commands](#lifecycle-commands)
23
23
  - [Gate Commands](#gate-commands)
24
+ - [OpenSpec SDD (Mandatory)](#openspec-sdd-mandatory)
24
25
  - [Architecture and Policy Model](#architecture-and-policy-model)
25
- - [MCP Evidence Context Server (Optional)](#mcp-evidence-context-server-optional)
26
+ - [MCP Servers (Optional)](#mcp-servers-optional)
26
27
  - [Framework Development (This Repository)](#framework-development-this-repository)
27
28
  - [Deterministic Validation Suite](#deterministic-validation-suite)
28
29
  - [Troubleshooting](#troubleshooting)
@@ -47,10 +48,11 @@ Legacy package `pumuki-ast-hooks` is deprecated and frozen at `6.3.7`.
47
48
  ## Capabilities
48
49
 
49
50
  - Stage-aware gate policies: `PRE_COMMIT`, `PRE_PUSH`, `CI`.
51
+ - OpenSpec SDD enforcement across `PRE_WRITE`, `PRE_COMMIT`, `PRE_PUSH`, and `CI`.
50
52
  - Multi-platform detection and combined evaluation: iOS, Backend, Frontend, Android.
51
53
  - Rules + overrides with locked baseline semantics.
52
54
  - Deterministic evidence (`.ai_evidence.json`) for machine and human workflows.
53
- - Optional read-only MCP evidence server for agent consumption.
55
+ - Optional MCP servers (evidence + enterprise baseline surface) for agent consumption.
54
56
 
55
57
  ## Quick Start for Consumer Repositories
56
58
 
@@ -74,14 +76,21 @@ Run from the target repository root:
74
76
  npx pumuki install
75
77
  ```
76
78
 
77
- ### 3) Verify lifecycle status
79
+ ### 3) Verify lifecycle and SDD status
78
80
 
79
81
  ```bash
80
82
  npx pumuki doctor
81
83
  npx pumuki status
84
+ npx pumuki sdd status
82
85
  ```
83
86
 
84
- ### 4) Run stage gates manually (optional)
87
+ ### 4) Open SDD session for your active OpenSpec change (required)
88
+
89
+ ```bash
90
+ npx pumuki sdd session --open --change=<change-id>
91
+ ```
92
+
93
+ ### 5) Run stage gates manually (optional)
85
94
 
86
95
  ```bash
87
96
  npx pumuki-pre-commit
@@ -89,10 +98,11 @@ npx pumuki-pre-push
89
98
  npx pumuki-ci
90
99
  ```
91
100
 
92
- ### 5) Expected outputs
101
+ ### 6) Expected outputs
93
102
 
94
103
  - Gate exit code: `0` (allow) or `1` (block).
95
104
  - Deterministic evidence file: `.ai_evidence.json`.
105
+ - SDD telemetry in evidence: `snapshot.sdd_metrics`.
96
106
 
97
107
  ### Update and remove
98
108
 
@@ -118,6 +128,9 @@ The `pumuki` binary provides repository lifecycle operations:
118
128
  | `pumuki update --latest` | Update package and re-apply managed hooks |
119
129
  | `pumuki doctor` | Safety checks (hook drift, tracked `node_modules`, lifecycle state) |
120
130
  | `pumuki status` | Current lifecycle snapshot |
131
+ | `pumuki sdd status` | OpenSpec/SDD compatibility and active session snapshot |
132
+ | `pumuki sdd validate --stage=<...>` | SDD decision for selected stage (`PRE_WRITE`, `PRE_COMMIT`, `PRE_PUSH`, `CI`) |
133
+ | `pumuki sdd session --open|--refresh|--close` | Manage active SDD session lifecycle per repository |
121
134
 
122
135
  `pumuki remove` is dependency-safe by design: it never deletes non-Pumuki third-party dependencies and preserves pre-existing third-party empty directories.
123
136
  Use `pumuki remove` (or `pumuki uninstall --purge-artifacts` + `npm uninstall pumuki`) for complete teardown.
@@ -131,6 +144,47 @@ Dedicated gate binaries are available:
131
144
  | `pumuki-pre-commit` | `PRE_COMMIT` |
132
145
  | `pumuki-pre-push` | `PRE_PUSH` |
133
146
  | `pumuki-ci` | `CI` |
147
+ | `pumuki-pre-write` | `PRE_WRITE` |
148
+
149
+ ## OpenSpec SDD (Mandatory)
150
+
151
+ Pumuki now enforces SDD/OpenSpec as a first-class guardrail.
152
+
153
+ ### Enforcement behavior
154
+
155
+ - `PRE_WRITE`: requires valid OpenSpec installation/project/session.
156
+ - `PRE_COMMIT`, `PRE_PUSH`, `CI`: require valid session plus `openspec validate --changes`.
157
+ - Blocking SDD decisions are emitted into evidence as finding `sdd.policy.blocked` with `source: "sdd-policy"`.
158
+
159
+ ### Auto-bootstrap and compatibility
160
+
161
+ - `pumuki install` auto-bootstraps OpenSpec when needed:
162
+ - installs `@fission-ai/openspec@latest` (when `package.json` exists and OpenSpec is missing/incompatible),
163
+ - scaffolds `openspec/` baseline (`project` file plus archive/spec placeholders) when absent.
164
+ - `pumuki update --latest` migrates legacy `openspec` package to `@fission-ai/openspec` before reapplying hooks.
165
+
166
+ ### Minimal daily flow
167
+
168
+ ```bash
169
+ # one-time per repo
170
+ npx pumuki install
171
+
172
+ # start/restart work on a change
173
+ npx pumuki sdd session --open --change=<change-id>
174
+ # or
175
+ npx pumuki sdd session --refresh
176
+
177
+ # verify policy explicitly
178
+ npx pumuki sdd validate --stage=PRE_COMMIT
179
+ ```
180
+
181
+ ### Emergency bypass (restricted)
182
+
183
+ ```bash
184
+ PUMUKI_SDD_BYPASS=1 npx pumuki sdd validate --stage=PRE_COMMIT
185
+ ```
186
+
187
+ Use only for controlled incident recovery. Bypass should be temporary and auditable.
134
188
 
135
189
  ## Architecture and Policy Model
136
190
 
@@ -161,11 +215,11 @@ Dedicated gate binaries are available:
161
215
  | Frontend | `apps/frontend/**/*.{ts,tsx,js,jsx}` and `apps/web/**/*.{ts,tsx,js,jsx}` |
162
216
  | Android | `*.kt`, `*.kts` |
163
217
 
164
- ## MCP Evidence Context Server (Optional)
218
+ ## MCP Servers (Optional)
165
219
 
166
220
  MCP is optional. Pumuki core does not depend on MCP.
167
221
 
168
- ### Consumer repository usage
222
+ ### Consumer repository usage (Evidence Server)
169
223
 
170
224
  Use the published binary from npm:
171
225
 
@@ -181,12 +235,32 @@ Use the published binary from npm:
181
235
  }
182
236
  ```
183
237
 
238
+ ### Consumer repository usage (Enterprise Baseline Server)
239
+
240
+ ```json
241
+ {
242
+ "mcpServers": {
243
+ "pumuki-enterprise": {
244
+ "command": "npx",
245
+ "args": ["--yes", "pumuki-mcp-enterprise"],
246
+ "cwd": "/absolute/path/to/your-consumer-repo"
247
+ }
248
+ }
249
+ }
250
+ ```
251
+
252
+ Enterprise server baseline surface:
253
+ - Resources: `evidence://status`, `gitflow://state`, `context://active`, `sdd://status`, `sdd://active-change`.
254
+ - Tools: `ai_gate_check`, `check_sdd_status`, `validate_and_fix`, `sync_branches`, `cleanup_stale_branches`.
255
+ - Mutating tools are always forced to `dry-run` in baseline mode.
256
+
184
257
  ### Framework repository usage
185
258
 
186
259
  If you are developing this framework locally:
187
260
 
188
261
  ```bash
189
262
  npm run mcp:evidence
263
+ npm run mcp:enterprise
190
264
  ```
191
265
 
192
266
  ## Framework Development (This Repository)
@@ -215,6 +289,18 @@ Operational menu:
215
289
  npm run framework:menu
216
290
  ```
217
291
 
292
+ Consumer repositories should use:
293
+
294
+ ```bash
295
+ npx --yes pumuki-framework
296
+ ```
297
+
298
+ Menu behavior:
299
+ - Default mode is `Consumer` (focused options: staged/range gates, bundles, evidence, exit).
300
+ - Type `A` to switch to `Advanced` mode (full operational surface).
301
+ - Type `C` in advanced mode to return to consumer mode.
302
+ - Set `PUMUKI_MENU_MODE=advanced` to start directly in advanced mode.
303
+
218
304
  ## Deterministic Validation Suite
219
305
 
220
306
  Core validation commands used by maintainers:
@@ -234,6 +320,8 @@ Core validation commands used by maintainers:
234
320
  | Symptom | Typical cause | Action |
235
321
  | --- | --- | --- |
236
322
  | Gate behaves differently in local and CI | Skills lock or policy drift | `npm run skills:lock:check` |
323
+ | `pumuki-pre-push` blocks with missing upstream guidance | Branch has no upstream tracking ref | `git push --set-upstream origin <branch>` |
324
+ | CI result differs from expected base range | `GITHUB_BASE_REF` missing and fallback refs unavailable | Ensure `GITHUB_BASE_REF`, or keep `origin/main` / `main` available |
237
325
  | `tsx` runtime errors | Unsupported Node runtime | Upgrade to `Node >= 18` |
238
326
  | Upgrade side effects | Inconsistent modules/lockfile state | `rm -rf node_modules package-lock.json && npm install` |
239
327
  | Consumer repo still has artifacts after tests | Lifecycle was not removed | `npx --yes pumuki remove` |
package/VERSION CHANGED
@@ -1 +1 @@
1
- v6.3.11
1
+ v6.3.15
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { runTsEntry } = require('./_run-ts-entry');
4
+
5
+ process.exit(runTsEntry('integrations/mcp/enterpriseServer.cli.ts', process.argv.slice(2)));
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { runTsEntry } = require('./_run-ts-entry');
4
+
5
+ process.exit(
6
+ runTsEntry('integrations/lifecycle/cli.ts', [
7
+ 'sdd',
8
+ 'validate',
9
+ '--stage=PRE_WRITE',
10
+ ])
11
+ );
@@ -23,6 +23,7 @@ Exit code contract:
23
23
 
24
24
  - `0` on pass/warn
25
25
  - `1` on block or runner error
26
+ - `1` on `PRE_PUSH` when no upstream tracking branch is configured (fail-safe).
26
27
 
27
28
  ## Platform wrappers (exports)
28
29
 
@@ -61,7 +62,7 @@ Files:
61
62
  Key helpers:
62
63
 
63
64
  - `getFactsForCommitRange({ fromRef, toRef, extensions })`
64
- - `resolveUpstreamRef()`
65
+ - `resolveUpstreamRef()` (`string | null`; `null` when upstream is missing)
65
66
  - `resolveCiBaseRef()`
66
67
  - `runCliCommand(runner)`
67
68
 
@@ -0,0 +1,57 @@
1
+ # Deterministic Inventory: core/integrations without direct tests
2
+
3
+ ## Criteria
4
+ - Scope: `*.ts` files under `core/` and `integrations/`, excluding `__tests__/`, `*.test.ts`, `*.spec.ts`, and `*.d.ts`.
5
+ - A file is considered "without direct test" when no sibling `file.test.ts` / `file.spec.ts` exists (or under local `__tests__/`).
6
+ - Deterministic impact prioritization: `score = (reverse_dependencies * 20) + loc`.
7
+ - Priority levels: `P1` (deps>=8 or loc>=220), `P2` (deps>=4 or loc>=140), `P3` (deps>=2 or loc>=70), `P4` otherwise.
8
+
9
+ ## Summary
10
+ - Total source files analyzed: **204**
11
+ - Total test files detected: **208**
12
+ - Total without direct test: **22**
13
+ - Priority distribution: P1=1, P2=1, P3=9, P4=11
14
+
15
+ ## Top 60 by impact
16
+ | Priority | Score | RevDeps | LOC | File |
17
+ |---|---:|---:|---:|---|
18
+ | P1 | 399 | 5 | 299 | `integrations/gate/stagePolicies.ts` |
19
+ | P2 | 138 | 4 | 58 | `integrations/platform/detectPlatforms.ts` |
20
+ | P3 | 172 | 2 | 132 | `integrations/mcp/evidenceContextServer.ts` |
21
+ | P3 | 131 | 3 | 71 | `integrations/mcp/evidencePayloadConfig.ts` |
22
+ | P3 | 103 | 2 | 63 | `integrations/sdd/types.ts` |
23
+ | P3 | 87 | 2 | 47 | `integrations/mcp/evidenceFacetsRulesets.ts` |
24
+ | P3 | 79 | 3 | 19 | `integrations/mcp/evidenceFacetsPlatforms.ts` |
25
+ | P3 | 75 | 2 | 35 | `integrations/mcp/evidenceFacetsFindings.ts` |
26
+ | P3 | 71 | 3 | 11 | `integrations/sdd/index.ts` |
27
+ | P3 | 66 | 3 | 6 | `integrations/mcp/evidenceFacets.ts` |
28
+ | P3 | 64 | 2 | 24 | `integrations/mcp/evidenceFacetsLedger.ts` |
29
+ | P4 | 82 | 1 | 62 | `integrations/mcp/evidencePayloadSummary.ts` |
30
+ | P4 | 46 | 1 | 26 | `integrations/platform/detectFrontend.ts` |
31
+ | P4 | 42 | 1 | 22 | `integrations/platform/detectAndroid.ts` |
32
+ | P4 | 39 | 1 | 19 | `integrations/platform/detectBackend.ts` |
33
+ | P4 | 22 | 1 | 2 | `integrations/mcp/evidenceFacetsSuppressedShare.ts` |
34
+ | P4 | 13 | 0 | 13 | `integrations/git/index.ts` |
35
+ | P4 | 13 | 0 | 13 | `integrations/mcp/evidenceContextServer.cli.ts` |
36
+ | P4 | 9 | 0 | 9 | `integrations/mcp/enterpriseServer.cli.ts` |
37
+ | P4 | 4 | 0 | 4 | `integrations/mcp/evidenceFacetsSnapshot.ts` |
38
+ | P4 | 3 | 0 | 3 | `integrations/mcp/evidenceFacetsBase.ts` |
39
+ | P4 | 2 | 0 | 2 | `integrations/mcp/index.ts` |
40
+
41
+ ## Full artifact
42
+ - See full list in `docs/CORE_INTEGRATIONS_UNTESTED_INVENTORY.json`.
43
+
44
+ ## Selected Initial Atomic Batch (Batch 01)
45
+ - `integrations/gate/stagePolicies.ts` (P1, score 399)
46
+ - `integrations/platform/detectPlatforms.ts` (P2, score 138)
47
+ - `integrations/mcp/evidenceContextServer.ts` (P3, score 172)
48
+
49
+ ### Selection criteria
50
+ - Impact-first selection (score + priority) over the deterministic inventory.
51
+ - Cross-domain coverage (`gate`, `platform`, `mcp`) to reduce early systemic risk.
52
+ - Strict operational limit: maximum 3 files to keep the cycle atomic and traceable.
53
+
54
+ ### Batch 01 exit criteria
55
+ - At least one direct unit test exists for each file in the batch.
56
+ - Batch tests pass locally.
57
+ - Tracker is updated with Batch 01 as ✅ and Batch 02 as the only 🚧 active task.
@@ -1,6 +1,7 @@
1
1
  # Installation Guide (v2.x)
2
2
 
3
3
  This guide covers the active setup for the deterministic framework implementation in this repository.
4
+ From v2.x, SDD with OpenSpec is part of the default enterprise installation path.
4
5
 
5
6
  ## Prerequisites
6
7
 
@@ -33,101 +34,135 @@ npm run test:deterministic
33
34
 
34
35
  If both commands pass, the workspace is ready.
35
36
 
36
- ## Run the framework locally
37
+ ## Enterprise consumer installation (recommended)
37
38
 
38
- ### Interactive menu
39
+ ### 1) Install package
39
40
 
40
41
  ```bash
41
- npm run framework:menu
42
+ npm install --save-exact pumuki
42
43
  ```
43
44
 
44
- Menu includes deterministic gate actions and optional operational diagnostics adapters.
45
-
46
- Optional adapter readiness check:
45
+ ### 2) Install managed lifecycle and OpenSpec bootstrap
47
46
 
48
47
  ```bash
49
- npm run validation:adapter-readiness -- \
50
- --adapter-report .audit-reports/adapter/adapter-real-session-report.md \
51
- --out .audit-reports/adapter/adapter-readiness.md
52
-
53
- npm run validation:adapter-session-status -- \
54
- --out .audit-reports/adapter/adapter-session-status.md
55
-
56
- npm run validation:adapter-real-session-report -- \
57
- --status-report .audit-reports/adapter/adapter-session-status.md \
58
- --out .audit-reports/adapter/adapter-real-session-report.md
48
+ npx --yes pumuki install
59
49
  ```
60
50
 
61
- Note: the current adapter implementation uses `--adapter-report` as the adapter input flag.
51
+ Behavior:
52
+ - Installs managed hooks (`pre-commit`, `pre-push`).
53
+ - Auto-installs `@fission-ai/openspec@latest` when OpenSpec is missing/incompatible (when `package.json` exists).
54
+ - Scaffolds `openspec/` baseline if missing (`project` file plus archive/spec placeholders).
62
55
 
63
- ### Direct stage runners
56
+ ### 3) Verify lifecycle and SDD status
64
57
 
65
58
  ```bash
66
- # PRE_COMMIT
67
- npx tsx integrations/git/preCommitIOS.cli.ts
59
+ npx --yes pumuki doctor
60
+ npx --yes pumuki status
61
+ npx --yes pumuki sdd status
62
+ ```
68
63
 
69
- # PRE_PUSH
70
- npx tsx integrations/git/prePushBackend.cli.ts
64
+ ### 4) Open active SDD session
71
65
 
72
- # CI
73
- npx tsx integrations/git/ciFrontend.cli.ts
66
+ ```bash
67
+ npx --yes pumuki sdd session --open --change=<change-id>
74
68
  ```
75
69
 
76
- ## Lifecycle commands (enterprise consumer repositories)
77
-
78
- Install the package from npm (canonical enterprise command):
70
+ Optional maintenance:
79
71
 
80
72
  ```bash
81
- npm install --save-exact pumuki
73
+ npx --yes pumuki sdd session --refresh
74
+ npx --yes pumuki sdd validate --stage=PRE_COMMIT
82
75
  ```
83
76
 
84
- Install managed Git hooks in the current repository:
77
+ ### 5) Run gates
85
78
 
86
79
  ```bash
87
- npx --yes pumuki install
80
+ npx --yes pumuki-pre-write
81
+ npx --yes pumuki-pre-commit
82
+ npx --yes pumuki-pre-push
83
+ npx --yes pumuki-ci
88
84
  ```
89
85
 
90
- Run lifecycle doctor before rollout:
86
+ ## Run menu from this framework repository
87
+
88
+ ### Interactive menu
91
89
 
92
90
  ```bash
93
- npx --yes pumuki doctor
91
+ npm run framework:menu
94
92
  ```
95
93
 
96
- Uninstall and purge untracked Pumuki artifacts:
94
+ Menu starts in `Consumer` mode by default (focused options for day-to-day gate usage).
95
+ Use `A` to switch to the full `Advanced` menu and `C` to switch back.
96
+ Each option includes a short inline description.
97
+
98
+ Consumer repositories do not have the `framework:menu` npm script by default.
99
+ Use the published binary instead:
97
100
 
98
101
  ```bash
99
- npx --yes pumuki uninstall --purge-artifacts
102
+ npx --yes pumuki-framework
100
103
  ```
101
104
 
102
- One-command cleanup and package removal:
105
+ ### Direct stage runners
103
106
 
104
107
  ```bash
105
- npx --yes pumuki remove
106
- ```
108
+ # PRE_WRITE
109
+ npx --yes pumuki-pre-write
107
110
 
108
- Use this command instead of plain `npm uninstall pumuki` when you need deterministic lifecycle cleanup.
109
- It also removes orphan `node_modules/.package-lock.json` residue when `node_modules` has no other entries.
110
- Plain `npm uninstall pumuki` removes only the dependency entry and leaves managed hooks/lifecycle state untouched.
111
+ # PRE_COMMIT
112
+ npx --yes pumuki-pre-commit
111
113
 
112
- Update to latest published Pumuki and re-apply hooks:
114
+ # PRE_PUSH
115
+ npx --yes pumuki-pre-push
113
116
 
114
- ```bash
115
- npx --yes pumuki update --latest
117
+ # CI
118
+ npx --yes pumuki-ci
116
119
  ```
117
120
 
118
- Package-level updates/removal also support short npm commands:
121
+ ## Lifecycle + SDD commands
119
122
 
120
123
  ```bash
124
+ # package level
125
+ npm install --save-exact pumuki
121
126
  npm update pumuki
122
127
  npm uninstall pumuki
128
+
129
+ # lifecycle
130
+ npx --yes pumuki install
131
+ npx --yes pumuki update --latest
132
+ npx --yes pumuki doctor
133
+ npx --yes pumuki status
134
+ npx --yes pumuki uninstall --purge-artifacts
135
+ npx --yes pumuki remove
136
+
137
+ # sdd
138
+ npx --yes pumuki sdd status
139
+ npx --yes pumuki sdd validate --stage=PRE_WRITE
140
+ npx --yes pumuki sdd validate --stage=PRE_COMMIT
141
+ npx --yes pumuki sdd validate --stage=PRE_PUSH
142
+ npx --yes pumuki sdd validate --stage=CI
143
+ npx --yes pumuki sdd session --open --change=<change-id>
144
+ npx --yes pumuki sdd session --refresh
145
+ npx --yes pumuki sdd session --close
123
146
  ```
124
147
 
125
- ## Optional: enable heuristic pilot
148
+ Notes:
149
+ - `pumuki remove` is the deterministic teardown path (`hooks + state + managed artifacts + dependency removal`).
150
+ - Plain `npm uninstall pumuki` removes only the dependency entry.
151
+ - `pumuki update --latest` migrates legacy `openspec` package to `@fission-ai/openspec` when required.
152
+
153
+ ## Guardrails
154
+
155
+ - `pumuki install` / `pumuki update` block when tracked files exist under `node_modules`.
156
+ - `PRE_WRITE`, `PRE_COMMIT`, `PRE_PUSH`, and `CI` enforce SDD/OpenSpec policy.
157
+
158
+ Emergency bypass (incident-only):
126
159
 
127
160
  ```bash
128
- PUMUKI_ENABLE_AST_HEURISTICS=true npx tsx integrations/git/prePushIOS.cli.ts
161
+ PUMUKI_SDD_BYPASS=1 npx --yes pumuki sdd validate --stage=PRE_COMMIT
129
162
  ```
130
163
 
164
+ Remove bypass immediately after remediation.
165
+
131
166
  ## CI workflows
132
167
 
133
168
  The repository ships reusable and platform workflows:
@@ -140,15 +175,16 @@ The repository ships reusable and platform workflows:
140
175
 
141
176
  Each run uploads `.ai_evidence.json` artifact.
142
177
 
143
- ## MCP evidence context server
144
-
145
- Start read-only evidence server:
178
+ ## MCP servers
146
179
 
147
180
  ```bash
148
181
  npm run mcp:evidence
182
+ npm run mcp:enterprise
149
183
  ```
150
184
 
151
- Reference: `docs/MCP_EVIDENCE_CONTEXT_SERVER.md`.
185
+ References:
186
+ - `docs/MCP_EVIDENCE_CONTEXT_SERVER.md`
187
+ - `docs/MCP_SERVERS.md`
152
188
 
153
189
  ## Evidence file
154
190
 
@@ -161,13 +197,24 @@ Schema reference: `docs/evidence-v2.1.md`.
161
197
  ### PRE_PUSH fails due to missing upstream
162
198
 
163
199
  ```bash
164
- git branch --set-upstream-to origin/<branch>
200
+ git push --set-upstream origin <branch>
165
201
  ```
166
202
 
167
203
  ### CI cannot resolve base ref
168
204
 
169
- Ensure `GITHUB_BASE_REF` is present or that `origin/main` exists.
205
+ Ensure `GITHUB_BASE_REF` is present, or that `origin/main` (preferred) or `main` exists.
206
+ CI fallback order is `origin/main` -> `main` -> `HEAD`.
170
207
 
171
- ### No findings while expecting violations
208
+ ### SDD blocks installation or gates
172
209
 
173
- Confirm changed files match supported platform paths/extensions consumed by platform detectors.
210
+ ```bash
211
+ npx --yes pumuki sdd status
212
+ npx --yes pumuki sdd validate --stage=PRE_COMMIT
213
+ ```
214
+
215
+ Then reopen/refresh active session:
216
+
217
+ ```bash
218
+ npx --yes pumuki sdd session --open --change=<change-id>
219
+ npx --yes pumuki sdd session --refresh
220
+ ```