prizmkit 1.1.154 → 1.1.155

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 (157) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/codex/skill-adapter.js +1 -1
  3. package/bundled/adapters/pi/skill-adapter.js +2 -1
  4. package/bundled/dev-pipeline/.env.example +2 -6
  5. package/bundled/dev-pipeline/README.md +21 -27
  6. package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +341 -15
  7. package/bundled/dev-pipeline/prizmkit_runtime/cli.py +0 -3
  8. package/bundled/dev-pipeline/prizmkit_runtime/daemon.py +1 -15
  9. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +48 -14
  10. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +50 -2
  11. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +0 -9
  12. package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +3 -3
  13. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +120 -22
  14. package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +482 -0
  15. package/bundled/dev-pipeline/prizmkit_runtime/test_result.py +64 -11
  16. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +145 -367
  17. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +91 -62
  18. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +105 -69
  19. package/bundled/dev-pipeline/scripts/prompt_framework.py +36 -41
  20. package/bundled/dev-pipeline/scripts/update-bug-status.py +1 -4
  21. package/bundled/dev-pipeline/scripts/update-checkpoint.py +61 -13
  22. package/bundled/dev-pipeline/scripts/update-feature-status.py +1 -4
  23. package/bundled/dev-pipeline/scripts/update-refactor-status.py +1 -4
  24. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +22 -27
  25. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +71 -104
  26. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +59 -111
  27. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +37 -72
  28. package/bundled/dev-pipeline/templates/sections/artifact-manifest.md +39 -0
  29. package/bundled/dev-pipeline/templates/sections/bugfix-critical-paths.md +3 -1
  30. package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +8 -25
  31. package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +3 -3
  32. package/bundled/dev-pipeline/templates/sections/bugfix-phase-implement.md +2 -2
  33. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +3 -3
  34. package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +2 -2
  35. package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +4 -4
  36. package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +0 -1
  37. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +7 -4
  38. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +14 -27
  39. package/bundled/dev-pipeline/templates/sections/feature-completion-summary.md +20 -0
  40. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +8 -71
  41. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +7 -7
  42. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +3 -3
  43. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +4 -4
  44. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +5 -17
  45. package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +3 -1
  46. package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +10 -23
  47. package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +2 -2
  48. package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +2 -2
  49. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +3 -3
  50. package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +2 -2
  51. package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +7 -7
  52. package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +0 -1
  53. package/bundled/dev-pipeline/templates/sections/retrospective.md +12 -0
  54. package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +35 -0
  55. package/bundled/dev-pipeline/templates/session-status-schema.json +45 -62
  56. package/bundled/dev-pipeline/tests/test_checkpoint_state.py +469 -18
  57. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +262 -175
  58. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +62 -23
  59. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +76 -28
  60. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +168 -18
  61. package/bundled/dev-pipeline/tests/test_recovery_workflow.py +111 -0
  62. package/bundled/dev-pipeline/tests/test_reset_preserve.py +0 -2
  63. package/bundled/dev-pipeline/tests/test_runtime_commit.py +608 -0
  64. package/bundled/dev-pipeline/tests/test_unified_cli.py +167 -25
  65. package/bundled/skills/_metadata.json +9 -9
  66. package/bundled/skills/app-planner/SKILL.md +3 -3
  67. package/bundled/skills/app-planner/references/generated-plan-review.md +2 -1
  68. package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +56 -64
  69. package/bundled/skills/app-planner/references/rules/backend/fixed-rules.md +85 -240
  70. package/bundled/skills/app-planner/references/rules/backend/question-bank.md +25 -25
  71. package/bundled/skills/app-planner/references/rules/backend/question-manifest.json +16 -7
  72. package/bundled/skills/app-planner/references/rules/backend/template.md +74 -92
  73. package/bundled/skills/app-planner/references/rules/database/derivation-rules.md +93 -93
  74. package/bundled/skills/app-planner/references/rules/database/fixed-rules.md +66 -173
  75. package/bundled/skills/app-planner/references/rules/database/question-bank.md +31 -26
  76. package/bundled/skills/app-planner/references/rules/database/question-manifest.json +13 -4
  77. package/bundled/skills/app-planner/references/rules/database/template.md +76 -98
  78. package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +68 -95
  79. package/bundled/skills/app-planner/references/rules/frontend/fixed-rules.md +93 -166
  80. package/bundled/skills/app-planner/references/rules/frontend/question-bank.md +46 -36
  81. package/bundled/skills/app-planner/references/rules/frontend/question-manifest.json +11 -2
  82. package/bundled/skills/app-planner/references/rules/frontend/template.md +79 -257
  83. package/bundled/skills/app-planner/references/rules/mobile/derivation-rules.md +91 -99
  84. package/bundled/skills/app-planner/references/rules/mobile/fixed-rules.md +73 -246
  85. package/bundled/skills/app-planner/references/rules/mobile/question-bank.md +17 -17
  86. package/bundled/skills/app-planner/references/rules/mobile/question-manifest.json +17 -2
  87. package/bundled/skills/app-planner/references/rules/mobile/template.md +73 -85
  88. package/bundled/skills/app-planner/references/rules-configuration.md +133 -65
  89. package/bundled/skills/app-planner/scripts/validate-rules-configuration.py +291 -0
  90. package/bundled/skills/prizmkit/SKILL.md +17 -18
  91. package/bundled/skills/prizmkit/references/workflow-state-protocol.md +22 -18
  92. package/bundled/skills/prizmkit-code-review/SKILL.md +22 -58
  93. package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +6 -6
  94. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +2 -2
  95. package/bundled/skills/prizmkit-committer/SKILL.md +82 -132
  96. package/bundled/skills/prizmkit-deploy/SKILL.md +27 -11
  97. package/bundled/skills/prizmkit-deploy/assets/deploy-document-template.md +89 -0
  98. package/bundled/skills/prizmkit-deploy/references/ci-cd-workflows.md +44 -14
  99. package/bundled/skills/prizmkit-deploy/references/cloud-platform-deploy.md +19 -3
  100. package/bundled/skills/prizmkit-deploy/references/database-setup.md +22 -12
  101. package/bundled/skills/prizmkit-deploy/references/deploy-config-schema.md +3 -1
  102. package/bundled/skills/prizmkit-deploy/references/deploy-history-schema.md +22 -6
  103. package/bundled/skills/prizmkit-deploy/references/deploy-metadata-schema.json +49 -0
  104. package/bundled/skills/prizmkit-deploy/references/live-validation-notes.md +1 -1
  105. package/bundled/skills/prizmkit-deploy/references/pending-input-schema.json +164 -0
  106. package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +9 -8
  107. package/bundled/skills/prizmkit-deploy/references/ssh-execution-flow.md +6 -6
  108. package/bundled/skills/prizmkit-implement/SKILL.md +30 -66
  109. package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +4 -4
  110. package/bundled/skills/prizmkit-init/SKILL.md +4 -0
  111. package/bundled/skills/prizmkit-plan/SKILL.md +21 -64
  112. package/bundled/skills/prizmkit-plan/references/artifact-identity.md +38 -0
  113. package/bundled/skills/prizmkit-plan/references/independent-plan-review.md +4 -4
  114. package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +5 -5
  115. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +11 -1
  116. package/bundled/skills/prizmkit-retrospective/SKILL.md +63 -77
  117. package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +3 -3
  118. package/bundled/skills/prizmkit-retrospective/references/retrospective-result-schema.json +138 -0
  119. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +17 -23
  120. package/bundled/skills/prizmkit-test/SKILL.md +64 -51
  121. package/bundled/skills/prizmkit-test/references/boundary-contract-and-test-double-guidance.md +206 -0
  122. package/bundled/skills/prizmkit-test/references/independent-test-review.md +17 -9
  123. package/bundled/skills/prizmkit-test/references/test-coverage-model.md +45 -21
  124. package/bundled/skills/prizmkit-test/references/test-report-template.md +20 -13
  125. package/bundled/skills/prizmkit-workflow/SKILL.md +35 -37
  126. package/bundled/skills/prizmkit-workflow/references/artifact-identity.md +34 -0
  127. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +22 -18
  128. package/bundled/skills/recovery-workflow/SKILL.md +2 -1
  129. package/bundled/skills/recovery-workflow/references/detection.md +4 -3
  130. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +15 -5
  131. package/package.json +1 -1
  132. package/src/scaffold.js +33 -22
  133. package/bundled/dev-pipeline/templates/sections/bugfix-artifacts.md +0 -16
  134. package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +0 -31
  135. package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +0 -7
  136. package/bundled/dev-pipeline/templates/sections/critical-paths-lite.md +0 -7
  137. package/bundled/dev-pipeline/templates/sections/directory-convention-agent.md +0 -9
  138. package/bundled/dev-pipeline/templates/sections/directory-convention-lite.md +0 -6
  139. package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +0 -15
  140. package/bundled/dev-pipeline/templates/sections/phase-commit.md +0 -61
  141. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +0 -24
  142. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-lite-suffix.md +0 -12
  143. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +0 -44
  144. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +0 -25
  145. package/bundled/dev-pipeline/templates/sections/phase-plan-agent.md +0 -20
  146. package/bundled/dev-pipeline/templates/sections/phase-plan-lite.md +0 -20
  147. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +0 -20
  148. package/bundled/dev-pipeline/templates/sections/refactor-artifacts.md +0 -17
  149. package/bundled/dev-pipeline/templates/sections/refactor-session-status.md +0 -28
  150. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +0 -52
  151. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-lite.md +0 -52
  152. package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +0 -174
  153. package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +0 -174
  154. package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +0 -174
  155. package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +0 -174
  156. package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +0 -174
  157. package/bundled/skills/prizmkit-test/references/external-contract-mock-guidance.md +0 -119
@@ -46,7 +46,7 @@ Accept:
46
46
 
47
47
  - `description`: the natural-language formal requirement;
48
48
  - `artifact_dir`: optional explicit requirement artifact root;
49
- - `execution_mode`: `interactive` by default; headless only when a trusted host explicitly authorizes it;
49
+ - `execution_mode`: `interactive`; external headless automation must invoke atomic stages directly and use its Python runtime for commit execution;
50
50
  - `resume`: optional workflow state path or requirement slug for recovery.
51
51
 
52
52
  If `description` is missing and no resumable workflow is supplied, ask for the requirement before invoking `prizmkit-plan`. External automation must invoke atomic stages directly with its own execution checkpoint rather than nesting this composite workflow.
@@ -57,11 +57,11 @@ If `description` is missing and no resumable workflow is supplied, ask for the r
57
57
 
58
58
  Invoke `/prizmkit-plan` with the requirement and any explicit `artifact_dir`. Do not write a second plan in this orchestrator.
59
59
 
60
- If initialization context is missing, allow `prizmkit-plan` to recommend initialization and continue with source fallback when the user chooses to proceed. Initialization is a soft prerequisite, not a hidden lifecycle stage.
60
+ If initialization context is missing, let `prizmkit-plan` use its source fallback. Initialization is not a hidden lifecycle stage.
61
61
 
62
62
  ### 2. Preserve Requirement Identity
63
63
 
64
- Once `prizmkit-plan` resolves an `artifact_dir`, capture it and pass the exact same value to every later stage. The artifact root is generic and is not restricted to one directory family:
64
+ Once `prizmkit-plan` resolves an `artifact_dir`, capture it and pass the exact same value to every later stage. Read `${SKILL_DIR}/references/artifact-identity.md` before deriving or opening workflow state. The artifact root is generic and is not restricted to one directory family:
65
65
 
66
66
  ```text
67
67
  .prizmkit/specs/<requirement-slug>/
@@ -69,35 +69,38 @@ Once `prizmkit-plan` resolves an `artifact_dir`, capture it and pass the exact s
69
69
  .prizmkit/refactor/<refactor-id>/
70
70
  ```
71
71
 
72
- Never select a different most-recent plan when resuming or handing off. The workflow state path is:
72
+ Never select a different most-recent plan when resuming or handing off. Derive the workflow state path from the exact artifact-directory basename, validate its safe identity, and fail closed if an existing state path belongs to another artifact:
73
73
 
74
74
  ```text
75
- .prizmkit/state/workflows/<requirement-slug>.json
75
+ .prizmkit/state/workflows/<requirement-identity>.json
76
76
  ```
77
77
 
78
- Read `${SKILL_DIR}/references/workflow-state-protocol.md` for the shared state contract. This workflow state remains distinct from any external host execution checkpoint. The target project controls whether generated `.prizmkit/` files are committed, ignored, or shared; do not modify its Git policy.
78
+ Read `${SKILL_DIR}/references/artifact-identity.md` for path/collision rules and `${SKILL_DIR}/references/workflow-state-protocol.md` for the shared state content contract. This workflow state remains distinct from any external host execution checkpoint. The target project controls whether generated `.prizmkit/` files are committed, ignored, or shared; do not modify its Git policy.
79
79
 
80
80
  ### 3. Advance Only on Truthful Success
81
81
 
82
82
  After each atomic stage:
83
83
 
84
- 1. Read the stage's actual output and terminal status.
85
- 2. Validate the expected authoritative artifact or evidence and workflow-state transition.
86
- 3. Preserve the same `artifact_dir`.
87
- 4. Continue only on the permitted success status.
88
- 5. Because this composite is the active orchestrator, atomic skills return terminal state and `next_stage` to it; they must not invoke the next stage recursively.
89
- 6. If the host cannot invoke another skill automatically, stop with exactly one deterministic next skill, its `artifact_dir`, and the workflow-state path.
84
+ 1. Read the stage-local result and stage-owned artifacts.
85
+ 2. Validate those artifacts independently.
86
+ 3. Map the domain result to this composite's lifecycle status and update workflow state itself.
87
+ 4. Preserve the same `artifact_dir`.
88
+ 5. Continue only on the permitted success result.
89
+ 6. Supply explicit stage-local inputs to the next invocation; atomic Skills never read this composite's state or choose routing.
90
+ 7. If the host cannot invoke another Skill automatically, stop with one deterministic next invocation and caller-owned state path.
90
91
 
91
92
  Expected transitions:
92
93
 
93
94
  | Stage | Required success | Next stage |
94
95
  |---|---|---|
95
- | `prizmkit-plan` | `status=completed`, `stage_result=PLAN_READY` | `prizmkit-implement` |
96
- | `prizmkit-implement` | `status=completed`, `stage_result=IMPLEMENTED` | `prizmkit-code-review` |
97
- | `prizmkit-code-review` | `status=completed`, `stage_result=REVIEW_PASS` | `prizmkit-test` |
98
- | `prizmkit-test` | `status=completed`, `stage_result=TEST_PASS` | `prizmkit-retrospective` |
99
- | `prizmkit-retrospective` | `status=completed`, `stage_result=RETRO_COMPLETE`, with artifact result `DOCS_UPDATED` or `NO_DOC_CHANGE` | `prizmkit-committer` |
100
- | `prizmkit-committer` | explicit interactive confirmation, then `status=completed` with `stage_result=COMMITTED` | end |
96
+ | `prizmkit-plan` | `PLAN_READY` plus valid `spec.md`/`plan.md` | `prizmkit-implement` |
97
+ | `prizmkit-implement` | `IMPLEMENTED` plus completed task markers | `prizmkit-code-review` |
98
+ | `prizmkit-code-review` | `PASS` plus valid `review-report.md` | `prizmkit-test` |
99
+ | `prizmkit-test` | `TEST_PASS` plus consistent report/result pair | `prizmkit-retrospective` |
100
+ | `prizmkit-retrospective` | `RETRO_COMPLETE` plus an artifact whose `outcome` and `result` agree | `prizmkit-committer` |
101
+ | `prizmkit-committer` | `COMMITTED` after explicit interactive confirmation | end |
102
+
103
+ Before invoking `prizmkit-retrospective`, derive the exact changed project paths outside `.prizmkit/` and pass them as `change_paths` with a concise `change_summary`. Do not ask that atomic Skill to infer scope from this composite's state or earlier artifacts.
101
104
 
102
105
  `TEST_NOT_APPLICABLE` is not a valid lifecycle success. Lightweight changes must execute deterministic verification and return `TEST_PASS`.
103
106
 
@@ -106,16 +109,16 @@ Expected transitions:
106
109
  The composite must not:
107
110
 
108
111
  - reinterpret a plan as implementation;
109
- - repair production code outside `prizmkit-implement` or the Main-Agent review loop;
112
+ - repair production code itself instead of invoking the appropriate atomic stage with explicit repair input;
110
113
  - claim tests passed without a consistent `test-report.md` and terminal `test-result.json`;
111
114
  - reinterpret testing-domain results as runtime/session outcomes;
112
115
  - perform retrospective documentation changes itself;
113
- - stage or commit before `prizmkit-committer` applies the current execution's authorization boundary;
116
+ - stage or commit before `prizmkit-committer` completes the interactive preview and confirmation boundary;
114
117
  - invoke `prizmkit-deploy` as a hidden seventh stage.
115
118
 
116
119
  ## Failure and Repair Routing
117
120
 
118
- Use the shared workflow state and authoritative stage evidence to determine routing. Do not blindly retry every failure.
121
+ Use caller-owned workflow state and authoritative stage artifacts to determine routing. Atomic Skills never own this decision.
119
122
 
120
123
  ### Review Failure
121
124
 
@@ -136,15 +139,16 @@ The Main-Agent review skill owns its internal review repairs and its internal te
136
139
  ```text
137
140
  TEST_NEEDS_FIXES
138
141
  → preserve test-report.md and test-result.json
139
- stop with the known remaining correction or delta-review requirement
140
- caller owns any later review/retest decision
142
+ when the outer repair budget remains, supply the exact correction to prizmkit-implement
143
+ require fresh prizmkit-code-review and prizmkit-test results
144
+ → otherwise stop with WORKFLOW_BLOCKED
141
145
 
142
146
  TEST_BLOCKED
143
147
  → preserve test-report.md and test-result.json
144
148
  → stop with the unresolved truth, input, safety, environment, or reliability blocker
145
149
  ```
146
150
 
147
- The composite must not invoke implementation or Code Review automatically from inside the returned testing result unless its own explicitly authorized outer policy defines a new invocation. It must never treat either result as an AI CLI crash.
151
+ The composite's bounded outer repair policy owns that fresh invocation route; it does not recreate the testing-local repair loop. It must never treat either non-pass result as an AI CLI crash.
148
152
 
149
153
  ### Environment Block
150
154
 
@@ -159,7 +163,7 @@ TEST_BLOCKED
159
163
  → stop with a deterministic prizmkit-test resume entry
160
164
  ```
161
165
 
162
- A trusted headless host performs its own bounded automatic environment recovery when invoking atomic stages. It does not invoke this composite workflow or silently turn a blocked result into success.
166
+ An external headless runtime may perform its own bounded environment recovery when invoking atomic stages. It does not invoke this interactive composite workflow or silently turn a blocked result into success.
163
167
 
164
168
  ### Repair Limit
165
169
 
@@ -179,19 +183,13 @@ When the limit is reached:
179
183
 
180
184
  The internal `prizmkit-code-review` limit of ten completed review rounds remains separate and does not increment `repair_round`.
181
185
 
182
- ## Commit Authorization Boundary
183
-
184
- The composite may automatically reach `/prizmkit-committer`, but it must not silently create a Git commit.
186
+ ## Interactive Commit Boundary
185
187
 
186
- Interactive execution requires the committer to:
188
+ The composite reaches `/prizmkit-committer operation=interactive-commit` but must not silently create a Git commit.
187
189
 
188
- 1. verify all five preceding stage results for the same `artifact_dir`;
189
- 2. inspect the final workspace;
190
- 3. present intended files, diff summary, sensitive-file warnings, and the proposed Conventional Commit message;
191
- 4. wait for explicit user confirmation from the current user;
192
- 5. create and verify the local commit only after confirmation.
190
+ The composite must validate all prior stage artifacts, derive exact non-`.prizmkit/` change paths for the retrospective input, and validate its result. It then invokes the committer with the same `artifact_dir`, exact `evidence_paths`, caller-state paths in `excluded_paths`, and `operation=interactive-commit`. The committer inspects the supplied final change, presents the exact commit, waits for confirmation, and creates it only after approval.
193
191
 
194
- Trusted headless execution is a separate atomic-stage path. It requires a host-defined non-interactive `mode`, a trusted `owner` identifier, and `local_commit_authorized=true`; it does not ask or wait. Unknown headless contexts are blocked. Remote publication is a separate host-runtime operation and is never decided by this composite workflow.
192
+ External headless orchestration supplies explicit evidence to `operation=prepare-runtime-commit`, maps `COMMIT_REQUEST_READY` to its own pending state, and lets Python Runtime validate and execute the request. Remote publication remains separate.
195
193
 
196
194
  ## Automatic Handoff and Manual Fallback
197
195
 
@@ -206,7 +204,7 @@ When it does not:
206
204
  ```text
207
205
  Next stage: /prizmkit-<skill>
208
206
  artifact_dir: <same resolved artifact_dir>
209
- workflow_state: .prizmkit/state/workflows/<requirement-slug>.json
207
+ workflow_state: .prizmkit/state/workflows/<requirement-identity>.json
210
208
  ```
211
209
 
212
210
  The user can invoke that one atomic skill and this composite can resume with `resume` later.
@@ -242,7 +240,7 @@ push: not performed automatically
242
240
  next_action: invoke /prizmkit-deploy separately if deployment is needed
243
241
  ```
244
242
 
245
- If the user declines interactive commit confirmation, report `status=in_progress`, `stage_result=COMMIT_PENDING` rather than `WORKFLOW_COMPLETE` and provide the exact `/prizmkit-committer` resume entry.
243
+ If the user declines interactive commit confirmation, preserve the committer stage as pending or in progress without a workflow `stage_result`, report the atomic operation result `COMMIT_DECLINED`, and provide the exact `/prizmkit-committer operation=interactive-commit` resume entry. `COMMIT_PENDING` is reserved for a validated Runtime commit request and must not represent an interactive decline.
246
244
 
247
245
  If blocked, report:
248
246
 
@@ -0,0 +1,34 @@
1
+ # Interactive Workflow Artifact Identity
2
+
3
+ The interactive workflow derives state identity from the exact caller/planning artifact directory; it never generates a second slug.
4
+
5
+ ## Derivation
6
+
7
+ 1. Resolve `artifact_dir` as a project-relative path inside the active checkout.
8
+ 2. Take its final path component unchanged as `<requirement-identity>`.
9
+ 3. Require 1-96 Unicode code points and at most 200 UTF-8 bytes, containing only letters, decimal digits, ASCII hyphens, or ASCII underscores, with a letter or digit at both ends. Reject control characters, separators, `.`/`..`, symlink escape, and empty identity. The byte limit leaves portable filename space for the `.json` suffix.
10
+ 4. Use exactly:
11
+
12
+ ```text
13
+ .prizmkit/state/workflows/<requirement-identity>.json
14
+ ```
15
+
16
+ Examples:
17
+
18
+ ```text
19
+ .prizmkit/specs/070-skill-generated-artifact-contracts/
20
+ → .prizmkit/state/workflows/070-skill-generated-artifact-contracts.json
21
+
22
+ .prizmkit/bugfix/B-001/
23
+ → .prizmkit/state/workflows/B-001.json
24
+ ```
25
+
26
+ ## Collision and Resume Safety
27
+
28
+ - Store the exact normalized project-relative `artifact_dir` in state.
29
+ - Before creating state, if the target file already exists, read it and require its `artifact_dir` to equal the active artifact directory exactly.
30
+ - A state file naming collision with a different artifact directory is blocking. Do not overwrite, merge, suffix, or silently select a recent state; require the caller to resolve the conflicting record explicitly.
31
+ - When `resume` supplies a state path, require it to equal the derived path, remain under `.prizmkit/state/workflows/`, and point to the exact artifact directory recorded inside it.
32
+ - Continue using the same state path and artifact directory for every stage and repair round.
33
+
34
+ External checkpoints use their own identity and are never derived from or merged into this path.
@@ -4,11 +4,13 @@
4
4
 
5
5
  ## Location and Identity
6
6
 
7
+ Derive the path through `${SKILL_DIR}/references/artifact-identity.md`:
8
+
7
9
  ```text
8
- .prizmkit/state/workflows/<requirement-slug>.json
10
+ .prizmkit/state/workflows/<requirement-identity>.json
9
11
  ```
10
12
 
11
- The active `artifact_dir` is preserved exactly across every stage:
13
+ The identity is the validated artifact-directory basename. An existing state file for a different `artifact_dir` is a blocking collision and is never overwritten or suffixed automatically. The active `artifact_dir` is preserved exactly across every stage:
12
14
 
13
15
  ```text
14
16
  .prizmkit/specs/<requirement-slug>/
@@ -31,7 +33,7 @@ The state file is an index, not the authority for stage completion:
31
33
  | Terminal testing result | `{artifact_dir}/test-result.json` |
32
34
  | Retrospective completion | `{artifact_dir}/retrospective-result.json` |
33
35
  | Durable architecture knowledge | `.prizmkit/prizm-docs/` |
34
- | Local commit | Git history and confirmed or authorized commit identity |
36
+ | Local commit | Git history and runtime- or user-verified commit identity |
35
37
  | Current stage, orchestrator, and resume entry | Workflow state |
36
38
  | External orchestration progress | External host checkpoint |
37
39
 
@@ -64,7 +66,7 @@ Every consumer compares workflow state with the skill-owned artifacts and curren
64
66
  | `orchestrator` | Semantic coordinator identifier, or null for direct stage use. |
65
67
  | `stage` | Stage that most recently wrote state. |
66
68
  | `status` | Lifecycle status: `pending`, `in_progress`, `completed`, `failed`, or `skipped`. |
67
- | `stage_result` | Domain result for the current stage, such as `PLAN_READY`, `IMPLEMENTED`, `REVIEW_PASS`, `REVIEW_NEEDS_FIXES`, `TEST_*`, `RETRO_COMPLETE`, or `COMMITTED`. |
69
+ | `stage_result` | Coordinator-recorded lifecycle result mapped from a validated atomic result and its required artifacts, such as `PLAN_READY`, `IMPLEMENTED`, `REVIEW_PASS`, `REVIEW_NEEDS_FIXES`, `TEST_*`, `RETRO_COMPLETE`, or `COMMITTED`. |
68
70
  | `completed_stages` | Ordered stages completed for this requirement. |
69
71
  | `repair_scope` | Optional caller-owned routing scope. The test skill reports high-risk repairs through `test-result.json` instead of scheduling another stage. |
70
72
  | `repair_round` | Optional outer cross-stage repair round, from 0 through 3. It is not a test-internal repair counter. |
@@ -97,10 +99,10 @@ review-report NEEDS_FIXES → status=failed, stage_result=REVIEW_NEED
97
99
  test-result TEST_PASS → status=completed, stage_result=TEST_PASS
98
100
  test-result TEST_NEEDS_FIXES → status=failed, stage_result=TEST_NEEDS_FIXES
99
101
  test-result TEST_BLOCKED → status=failed, stage_result=TEST_BLOCKED
100
- retrospective DOCS_UPDATED → status=completed, stage_result=RETRO_COMPLETE
101
- retrospective NO_DOC_CHANGE → status=completed, stage_result=RETRO_COMPLETE
102
- retrospective blocked → status=failed, stage_result=RETRO_BLOCKED
103
- commit authorization pending → status=in_progress, stage_result=COMMIT_PENDING
102
+ retrospective outcome=RETRO_COMPLETE, result=DOCS_UPDATED → status=completed, stage_result=RETRO_COMPLETE
103
+ retrospective outcome=RETRO_COMPLETE, result=NO_DOC_CHANGE → status=completed, stage_result=RETRO_COMPLETE
104
+ retrospective outcome=RETRO_BLOCKED → status=failed, stage_result=RETRO_BLOCKED
105
+ runtime commit preparation → status=in_progress, stage_result=COMMIT_PENDING
104
106
  local commit confirmed → status=completed, stage_result=COMMITTED
105
107
  commit blocked → status=failed, stage_result=COMMIT_BLOCKED
106
108
  ```
@@ -115,8 +117,8 @@ commit blocked → status=failed, stage_result=COMMIT_BLOC
115
117
 
116
118
  ```text
117
119
  TEST_NEEDS_FIXES
118
- → known correction or required delta review remains
119
- → caller decides whether and how to arrange another stage
120
+ a known correction remains
121
+ → caller decides whether and how to arrange another invocation
120
122
 
121
123
  TEST_BLOCKED
122
124
  → truth, input, safe environment, or reliable execution prevents a verdict
@@ -132,30 +134,32 @@ Any outer repair or continuation policy is independently owned by the caller and
132
134
 
133
135
  1. An atomic stage performs only its own stage, writes its truthful result and artifact paths, and returns control.
134
136
  2. When `orchestrator` is non-null, only that orchestrator invokes the next skill.
135
- 3. Direct stage use may report a possible next invocation but does not claim it ran.
137
+ 3. Direct atomic use returns only its local result and artifacts; it does not report or select another invocation.
136
138
  4. Every handoff preserves the same `artifact_dir`.
137
139
  5. External automation invokes atomic stages directly and does not nest the composite workflow.
138
140
  6. Workflow state never replaces or absorbs an external host checkpoint.
139
141
 
140
- ## Commit Authorization
142
+ ## Commit Execution Ownership
141
143
 
142
144
  Interactive execution:
143
145
 
144
146
  ```text
145
147
  committer previews intended files and message
146
148
  → waits for explicit current-user confirmation
147
- → creates the local commit
149
+ stages, creates, and verifies the local commit
148
150
  ```
149
151
 
150
- Trusted headless execution:
152
+ Pipeline execution:
151
153
 
152
154
  ```text
153
- trusted host explicitly authorizes the current local task commit
154
- → committer verifies gates and commits automatically
155
+ external coordinator validates its required gates and supplies exact readiness evidence
156
+ → committer validates only that evidence and writes an exact runtime-commit-request.json
157
+ → external coordinator maps COMMIT_REQUEST_READY to its checkpoint's in_progress/COMMIT_PENDING state
158
+ → Python runtime validates the request, commits, verifies Git, and writes checkpoint completed/COMMITTED
155
159
  → remote publication remains separate
156
160
  ```
157
161
 
158
- A self-declared or untrusted headless context does not authorize a commit.
162
+ The preparation request is data for runtime validation, not prompt-level authorization. The committer must not stage, commit, or predeclare COMMITTED in pipeline preparation mode.
159
163
 
160
164
  ## Recovery
161
165
 
@@ -171,4 +175,4 @@ When state is missing, stale, or inconsistent:
171
175
  8. Reconstruct the latest safe predecessor and report the reconstruction.
172
176
  9. Continue only from the first incomplete or invalid stage.
173
177
 
174
- Stale state never bypasses review, testing, retrospective, commit authorization, or external checkpoint enforcement.
178
+ Stale state never bypasses review, testing, retrospective, commit preparation/execution, or external checkpoint enforcement.
@@ -42,7 +42,8 @@ The detector reads only active checkout records:
42
42
 
43
43
  A candidate is resumable only when:
44
44
  - `state` is `active`;
45
- - `task_id` matches its task family;
45
+ - `task_type` equals the checkout directory family;
46
+ - `task_id` is explicitly recorded, matches the exact `F-NNN`, `B-NNN`, or `R-NNN` family form, and equals its parent state-directory name;
46
47
  - `active_dev_branch` is present; and
47
48
  - the recorded local branch still exists.
48
49
 
@@ -13,9 +13,10 @@ Recovery uses the runtime's durable task checkout identity rather than reconstru
13
13
  A record is resumable only when:
14
14
 
15
15
  1. `state` equals `active`.
16
- 2. `task_id` matches the directory family.
17
- 3. `active_dev_branch` is non-empty.
18
- 4. `refs/heads/<active_dev_branch>` exists locally.
16
+ 2. `task_type` equals the checkout directory family.
17
+ 3. `task_id` is explicitly present, matches the exact `F-NNN`, `B-NNN`, or `R-NNN` family form, and equals its parent state-directory name.
18
+ 4. `active_dev_branch` is non-empty.
19
+ 5. `refs/heads/<active_dev_branch>` exists locally.
19
20
 
20
21
  Ignore records whose state is `completed` or `reset`. Also ignore session logs, plan lists, artifact directories, and checkpoint files when no active checkout record exists. Those files may remain after completed or historical work and are not evidence of an interrupted task.
21
22
 
@@ -5,6 +5,7 @@ from __future__ import annotations
5
5
 
6
6
  import argparse
7
7
  import json
8
+ import re
8
9
  import subprocess
9
10
  from pathlib import Path
10
11
 
@@ -14,19 +15,19 @@ FAMILIES = (
14
15
  "name": "feature",
15
16
  "state_dir": "features",
16
17
  "plan_path": ".prizmkit/plans/feature-list.json",
17
- "id_prefix": "F-",
18
+ "id_pattern": r"^F-\d{3}$",
18
19
  },
19
20
  {
20
21
  "name": "bugfix",
21
22
  "state_dir": "bugfix",
22
23
  "plan_path": ".prizmkit/plans/bug-fix-list.json",
23
- "id_prefix": "B-",
24
+ "id_pattern": r"^B-\d{3}$",
24
25
  },
25
26
  {
26
27
  "name": "refactor",
27
28
  "state_dir": "refactor",
28
29
  "plan_path": ".prizmkit/plans/refactor-list.json",
29
- "id_prefix": "R-",
30
+ "id_pattern": r"^R-\d{3}$",
30
31
  },
31
32
  )
32
33
 
@@ -83,9 +84,18 @@ def detect_candidates(project_root: Path) -> list[dict[str, object]]:
83
84
  data = load_json(checkout_path)
84
85
  if not data or str(data.get("state") or "") != "active":
85
86
  continue
86
- task_id = str(data.get("task_id") or checkout_path.parent.name).strip()
87
+ raw_task_id = data.get("task_id")
88
+ if not isinstance(raw_task_id, str):
89
+ continue
90
+ task_id = raw_task_id.strip()
87
91
  branch = str(data.get("active_dev_branch") or "").strip()
88
- if not task_id.startswith(family["id_prefix"]) or not branch_exists(project_root, branch):
92
+ if (
93
+ task_id != raw_task_id
94
+ or data.get("task_type") != family["name"]
95
+ or checkout_path.parent.name != task_id
96
+ or re.fullmatch(family["id_pattern"], task_id) is None
97
+ or not branch_exists(project_root, branch)
98
+ ):
89
99
  continue
90
100
  candidates.append(
91
101
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prizmkit",
3
- "version": "1.1.154",
3
+ "version": "1.1.155",
4
4
  "description": "Create a new PrizmKit-powered project with clean initialization — no framework dev files, just what you need.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/scaffold.js CHANGED
@@ -13,7 +13,8 @@ import path from 'path';
13
13
  import { readFileSync } from 'fs';
14
14
  import { fileURLToPath, pathToFileURL } from 'url';
15
15
  import { dirname, join } from 'path';
16
- import { execSync } from 'child_process';
16
+ import { execFileSync, execSync } from 'child_process';
17
+ import os from 'os';
17
18
  import {
18
19
  loadMetadata,
19
20
  getTemplatesDir,
@@ -1373,6 +1374,19 @@ export async function installPlaywrightCli(projectRoot, dryRun) {
1373
1374
  // OpenCLI 安装
1374
1375
  // ============================================================
1375
1376
 
1377
+ /**
1378
+ * Side-effect-free OpenCLI presence check. Running OpenCLI itself is unsafe here:
1379
+ * browser-oriented commands such as `opencli doctor` create a live browser session.
1380
+ */
1381
+ function isOpenCliAvailable() {
1382
+ try {
1383
+ execFileSync(os.platform() === 'win32' ? 'where.exe' : 'which', ['opencli'], { stdio: 'ignore' });
1384
+ return true;
1385
+ } catch {
1386
+ return false;
1387
+ }
1388
+ }
1389
+
1376
1390
  /**
1377
1391
  * 安装 opencli(全局 npm 包)
1378
1392
  * 用于浏览器交互验证,复用 Chrome 已登录会话(OAuth/SSO/第三方集成)
@@ -1383,12 +1397,11 @@ export async function installOpenCli(projectRoot, dryRun, autoDownload = true) {
1383
1397
  return;
1384
1398
  }
1385
1399
 
1386
- // Check if already installed
1387
- try {
1388
- execSync('opencli --version', { stdio: 'pipe' });
1400
+ // Detect the executable without running it. This keeps repeated PrizmKit
1401
+ // installs/upgrades idempotent and avoids starting an OpenCLI browser session.
1402
+ if (isOpenCliAvailable()) {
1389
1403
  console.log(chalk.green(' ✓ opencli (already installed)'));
1390
- } catch {
1391
- // Not installed, install it
1404
+ } else {
1392
1405
  try {
1393
1406
  console.log(chalk.blue(' ⏳ Installing @jackwener/opencli globally...'));
1394
1407
  execSync('npm install -g @jackwener/opencli@latest', { stdio: 'pipe', timeout: 120000 });
@@ -1400,22 +1413,20 @@ export async function installOpenCli(projectRoot, dryRun, autoDownload = true) {
1400
1413
  }
1401
1414
  }
1402
1415
 
1403
- // Verify opencli connectivity Chrome Browser Bridge extension is a manual install
1404
- try {
1405
- const doctorOutput = execSync('opencli doctor 2>&1', { stdio: 'pipe', timeout: 15000 }).toString();
1406
- if (doctorOutput.includes('[MISSING] Extension') || doctorOutput.includes('[FAIL] Connectivity')) {
1407
- console.log(chalk.yellow(' ⚠ Chrome Browser Bridge extension is NOT connected'));
1408
-
1409
- if (autoDownload) {
1410
- await downloadOpenCliExtension();
1411
- } else {
1412
- printOpenCliManualSteps();
1413
- }
1414
- } else {
1415
- console.log(chalk.green(' ✓ opencli connectivity verified'));
1416
- }
1417
- } catch {
1418
- // doctor command itself failed — already warned about install issues
1416
+ // Check only PrizmKit's downloaded extension files. Connectivity checks are
1417
+ // intentionally user-initiated because `opencli doctor` opens a browser tab.
1418
+ const extensionManifest = path.join(
1419
+ process.env.HOME || process.env.USERPROFILE || '.',
1420
+ '.opencli',
1421
+ 'extension',
1422
+ 'manifest.json',
1423
+ );
1424
+ if (fs.pathExistsSync(extensionManifest)) {
1425
+ console.log(chalk.green(' ✓ OpenCLI extension files (already downloaded)'));
1426
+ } else if (autoDownload) {
1427
+ await downloadOpenCliExtension();
1428
+ } else {
1429
+ printOpenCliManualSteps();
1419
1430
  }
1420
1431
  }
1421
1432
 
@@ -1,16 +0,0 @@
1
- ## Bug Fix Artifacts Directory
2
-
3
- Use only this durable artifact directory for this bug fix:
4
-
5
- ```text
6
- .prizmkit/bugfix/{{BUG_ID}}/
7
- ├── spec.md
8
- ├── plan.md
9
- ├── context-snapshot.md
10
- ├── review-report.md
11
- ├── fix-report.md
12
- ├── failure-log.md
13
- └── workflow-checkpoint.json
14
- ```
15
-
16
- Do not write bugfix artifacts under feature or refactor artifact directories.
@@ -1,31 +0,0 @@
1
- ### Step 3: Report Session Status
2
-
3
- Before exiting, write the session status file:
4
-
5
- `{{SESSION_STATUS_PATH}}`
6
-
7
- ```json
8
- {
9
- "session_id": "{{SESSION_ID}}",
10
- "bug_id": "{{BUG_ID}}",
11
- "status": "<success|partial|failed>",
12
- "completed_phases": [1, 2, 3, 4],
13
- "current_phase": 4,
14
- "checkpoint_reached": "<current checkpoint step>",
15
- "fast_path": false,
16
- "errors": [],
17
- "can_resume": false,
18
- "resume_from_phase": null,
19
- "artifacts": {
20
- "spec_path": ".prizmkit/bugfix/{{BUG_ID}}/spec.md",
21
- "plan_path": ".prizmkit/bugfix/{{BUG_ID}}/plan.md",
22
- "fix_report_path": ".prizmkit/bugfix/{{BUG_ID}}/fix-report.md"
23
- },
24
- "git_commit": "<commit hash or null>",
25
- "traps_updated": false,
26
- "manual_verification_policy": "{{MANUAL_VERIFICATION_POLICY}}",
27
- "timestamp": "{{TIMESTAMP}}"
28
- }
29
- ```
30
-
31
- For manual/hybrid verification, record the selected automated verification method and evidence in `manual_verification_policy`; never use a partial stop solely because the plan labels verification as manual or hybrid.
@@ -1,7 +0,0 @@
1
- ## Critical Paths
2
-
3
- | Resource | Path |
4
- |----------|------|
5
- | Feature Artifacts Dir | `.prizmkit/specs/{{FEATURE_SLUG}}/` |
6
- | Context Snapshot | `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` |
7
- | Project Root | {{PROJECT_ROOT}} |
@@ -1,7 +0,0 @@
1
- ## Critical Paths
2
-
3
- | Resource | Path |
4
- |----------|------|
5
- | Feature Artifacts Dir | `.prizmkit/specs/{{FEATURE_SLUG}}/` |
6
- | Context Snapshot | `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` |
7
- | Project Root | {{PROJECT_ROOT}} |
@@ -1,9 +0,0 @@
1
- ## PrizmKit Directory Convention
2
-
3
- ```
4
- .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md ← Main Agent writes Sections 1-4 + Implementation Log
5
- .prizmkit/specs/{{FEATURE_SLUG}}/plan.md ← includes Tasks section
6
- .prizmkit/specs/{{FEATURE_SLUG}}/review-report.md ← Main Agent writes Code Review progress and Final Result
7
- ```
8
-
9
- **`context-snapshot.md`** is the implementation knowledge base and remains append-only after initial creation. Code Review writes only `review-report.md`; it does not append separate Review Notes to the context snapshot.
@@ -1,6 +0,0 @@
1
- ## PrizmKit Directory Convention
2
-
3
- ```
4
- .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md
5
- .prizmkit/specs/{{FEATURE_SLUG}}/plan.md ← includes Tasks section
6
- ```
@@ -1,15 +0,0 @@
1
- ### Headless Commit Authorization
2
-
3
- This pipeline session is non-interactive. Do not ask questions, wait for user input, or request commit confirmation.
4
-
5
- The pipeline launch has already authorized local commits for this task. Invoke `/prizmkit-committer` with the pipeline-managed execution context:
6
-
7
- ```json
8
- {
9
- "mode": "l4-headless",
10
- "owner": "prizmkit-l4",
11
- "local_commit_authorized": true
12
- }
13
- ```
14
-
15
- The committer must still verify every lifecycle gate, inspect the intended diff, generate a Conventional Commit message, stage only intended files, create the local commit, and verify it. Remote publication is controlled by the runtime after the local commit; do not make a publication decision in this session. If the execution context is absent or invalid, mark the task blocked and exit; do not ask the user.