prizmkit 1.1.139 → 1.1.141

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 (74) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +41 -121
  3. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +0 -6
  4. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +1 -2
  5. package/bundled/dev-pipeline/prizmkit_runtime/test_result.py +150 -0
  6. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +21 -804
  7. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +4 -6
  8. package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +1 -1
  9. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +4 -6
  10. package/bundled/dev-pipeline/scripts/prompt_framework.py +56 -55
  11. package/bundled/dev-pipeline/scripts/update-bug-status.py +1 -2
  12. package/bundled/dev-pipeline/scripts/update-checkpoint.py +14 -96
  13. package/bundled/dev-pipeline/scripts/update-feature-status.py +1 -2
  14. package/bundled/dev-pipeline/scripts/update-refactor-status.py +1 -2
  15. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +3 -3
  16. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +7 -18
  17. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +6 -6
  18. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +5 -5
  19. package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +1 -1
  20. package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +1 -1
  21. package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +1 -1
  22. package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +13 -10
  23. package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +1 -1
  24. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +14 -9
  25. package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +1 -1
  26. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +1 -1
  27. package/bundled/dev-pipeline/templates/sections/phase-commit.md +1 -1
  28. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +2 -2
  29. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-base.md +1 -1
  30. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-lite-suffix.md +1 -1
  31. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +1 -1
  32. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +14 -26
  33. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +3 -3
  34. package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +13 -10
  35. package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +1 -1
  36. package/bundled/dev-pipeline/tests/test_checkpoint_state.py +287 -384
  37. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +119 -684
  38. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +17 -40
  39. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +20 -23
  40. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +29 -32
  41. package/bundled/skills/_metadata.json +6 -6
  42. package/bundled/skills/prizmkit/SKILL.md +8 -13
  43. package/bundled/skills/prizmkit/references/workflow-state-protocol.md +61 -80
  44. package/bundled/skills/prizmkit-code-review/SKILL.md +3 -3
  45. package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +61 -80
  46. package/bundled/skills/prizmkit-committer/SKILL.md +3 -3
  47. package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +61 -80
  48. package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +61 -80
  49. package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +61 -80
  50. package/bundled/skills/prizmkit-retrospective/SKILL.md +2 -2
  51. package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +61 -80
  52. package/bundled/skills/prizmkit-test/SKILL.md +217 -187
  53. package/bundled/skills/prizmkit-test/references/external-contract-mock-guidance.md +119 -0
  54. package/bundled/skills/prizmkit-test/references/independent-test-review.md +269 -0
  55. package/bundled/skills/prizmkit-test/references/test-coverage-model.md +193 -0
  56. package/bundled/skills/prizmkit-test/references/test-report-template.md +164 -79
  57. package/bundled/skills/prizmkit-workflow/SKILL.md +15 -23
  58. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +61 -80
  59. package/package.json +1 -1
  60. package/bundled/skills/prizmkit-test/assets/authoritative-records.schema.json +0 -476
  61. package/bundled/skills/prizmkit-test/assets/behavior-risk-matrix.schema.json +0 -116
  62. package/bundled/skills/prizmkit-test/assets/evidence-manifest.schema.json +0 -111
  63. package/bundled/skills/prizmkit-test/assets/evidence-package-template.json +0 -66
  64. package/bundled/skills/prizmkit-test/references/boundary-coverage-protocol.md +0 -104
  65. package/bundled/skills/prizmkit-test/references/contract-mock-protocol.md +0 -65
  66. package/bundled/skills/prizmkit-test/references/evidence-protocol.md +0 -208
  67. package/bundled/skills/prizmkit-test/references/evidence-request-protocol.md +0 -80
  68. package/bundled/skills/prizmkit-test/references/examples.md +0 -100
  69. package/bundled/skills/prizmkit-test/references/service-boundary-test-catalog.md +0 -228
  70. package/bundled/skills/prizmkit-test/references/test-generation-steps.md +0 -118
  71. package/bundled/skills/prizmkit-test/references/trusted-evidence-execution.md +0 -110
  72. package/bundled/skills/prizmkit-test/references/workflow-state-protocol.md +0 -181
  73. package/bundled/skills/prizmkit-test/scripts/build_test_evidence.py +0 -1851
  74. package/bundled/skills/prizmkit-test/scripts/validate_test_evidence.py +0 -1793
@@ -1,181 +0,0 @@
1
- # PrizmKit Workflow State Protocol
2
-
3
- `workflow-state.json` is lifecycle runtime metadata for one formal requirement. It preserves stage handoff, repair routing, orchestrator ownership, and resume information without replacing authoritative artifacts or any host-owned execution checkpoint.
4
-
5
- ## Location and Identity
6
-
7
- ```text
8
- .prizmkit/state/workflows/<requirement-slug>.json
9
- ```
10
-
11
- The state file is created only when a lifecycle runs. The active `artifact_dir` is the generic requirement artifact root and must be preserved exactly across every stage:
12
-
13
- ```text
14
- .prizmkit/specs/<requirement-slug>/
15
- .prizmkit/bugfix/<bug-id>/
16
- .prizmkit/refactor/<refactor-id>/
17
- ```
18
-
19
- Never select a different most-recent plan when resuming or handing off. Any execution checkpoint maintained by an external host remains separate from this lifecycle state. Never merge, substitute, or infer one schema from the other. The target project controls whether generated `.prizmkit/` files are committed, ignored, or shared.
20
-
21
- ## Authority
22
-
23
- The state file is an index, not the authority for stage completion:
24
-
25
- | Information | Authority |
26
- |---|---|
27
- | Requirement goals and acceptance criteria | `{artifact_dir}/spec.md` |
28
- | Implementation tasks and completion | `{artifact_dir}/plan.md` plus current workspace |
29
- | Review findings and verdict | `{artifact_dir}/review-report.md` final result |
30
- | Test execution, verdict, and repair scope | Validated evidence package and authoritative `verdict.json` |
31
- | Test report presentation | `{artifact_dir}/test-report.md` as a derived view only |
32
- | Retrospective completion and result | `{artifact_dir}/retrospective-result.json` |
33
- | Durable architecture knowledge | `.prizmkit/prizm-docs/` |
34
- | Local commit | Git history and confirmed or authorized commit identity |
35
- | Current stage, orchestrator, and resume entry | Workflow state |
36
- | External orchestration progress | The external host's own checkpoint, never this state |
37
-
38
- Every consumer compares workflow state with authoritative artifacts and the current workspace. Missing or stale state is reconstructed from those sources and is never accepted as success by itself.
39
-
40
- ## Schema
41
-
42
- ```json
43
- {
44
- "schema_version": 1,
45
- "artifact_dir": ".prizmkit/specs/example",
46
- "orchestrator": "prizmkit-workflow",
47
- "stage": "test",
48
- "status": "TEST_PASS",
49
- "stage_result": "TEST_PASS",
50
- "completed_stages": ["plan", "implement", "code-review", "test"],
51
- "repair_scope": null,
52
- "repair_round": 0,
53
- "next_stage": "retrospective",
54
- "resume_from": "prizmkit-retrospective"
55
- }
56
- ```
57
-
58
- ### Fields
59
-
60
- | Field | Meaning |
61
- |---|---|
62
- | `schema_version` | State schema version. Current value is `1`. |
63
- | `artifact_dir` | The single generic requirement artifact root reused by every stage. |
64
- | `orchestrator` | `prizmkit-workflow`, another semantic coordinator identifier, or `null` for direct stage use. |
65
- | `stage` | The stage that most recently wrote state. |
66
- | `status` | Lifecycle progression status, distinct from the domain `stage_result`. |
67
- | `stage_result` | Domain result such as `PASS`, `NEEDS_FIXES`, `TEST_*`, `DOCS_UPDATED`, or `NO_DOC_CHANGE`. |
68
- | `completed_stages` | Ordered stages completed for this requirement. |
69
- | `repair_scope` | `null`, `test-infrastructure`, `production`, `runtime`, `schema`, `dependency`, `public-interface`, or `unknown`. |
70
- | `repair_round` | Outer cross-stage repair round, from `0` through `3`. |
71
- | `next_stage` | Next semantic stage, or `null` after commit. |
72
- | `resume_from` | Exact atomic skill that can resume, or `null` after commit. |
73
-
74
- ## Lifecycle and Verdict Mappings
75
-
76
- The mandatory formal lifecycle is:
77
-
78
- ```text
79
- PLAN_READY
80
- → IMPLEMENTED
81
- → REVIEW_PASS
82
- → TEST_PASS
83
- → RETRO_COMPLETE
84
- → COMMIT_PENDING
85
- → COMMITTED
86
- ```
87
-
88
- No formal stage is silently optional. Domain evidence maps as follows:
89
-
90
- ```text
91
- review-report final PASS → status=REVIEW_PASS, stage_result=PASS
92
- review-report final NEEDS_FIXES → status=REVIEW_NEEDS_FIXES, stage_result=NEEDS_FIXES
93
- validated verdict TEST_PASS → status=TEST_PASS, stage_result=TEST_PASS
94
- validated verdict TEST_FAIL → status=TEST_FAIL, stage_result=TEST_FAIL
95
- validated verdict TEST_BLOCKED → status=TEST_BLOCKED, stage_result=TEST_BLOCKED
96
- retrospective result DOCS_UPDATED → status=RETRO_COMPLETE, stage_result=DOCS_UPDATED
97
- retrospective result NO_DOC_CHANGE → status=RETRO_COMPLETE, stage_result=NO_DOC_CHANGE
98
- ```
99
-
100
- `RETRO_COMPLETE` is the stable completion status. `DOCS_UPDATED` and `NO_DOC_CHANGE` are mutually exclusive retrospective results, not substitute statuses. A derived Markdown test report never establishes a `TEST_*` status without validated authoritative evidence.
101
-
102
- ## Repair Routing
103
-
104
- ```text
105
- REVIEW_NEEDS_FIXES
106
- → implement
107
- → code-review
108
- → test
109
-
110
- TEST_FAIL with repair_scope=test-infrastructure
111
- → implement
112
- → test
113
-
114
- TEST_FAIL with repair_scope=production|runtime|schema|dependency|public-interface
115
- → implement
116
- → code-review
117
- → test
118
-
119
- TEST_FAIL with repair_scope=unknown
120
- → conservative production route only when safe
121
- → otherwise WORKFLOW_BLOCKED
122
-
123
- TEST_BLOCKED
124
- → never make speculative production edits
125
- → interactive execution stops with a prizmkit-test resume entry
126
- → a trusted headless host may perform bounded environment recovery, then records WORKFLOW_BLOCKED if unresolved
127
-
128
- RETRO_BLOCKED
129
- → WORKFLOW_BLOCKED
130
- WORKFLOW_BLOCKED
131
- → resume only after the recorded blocker is resolved
132
- ```
133
-
134
- The outer workflow permits at most three automatic repair rounds. These are cross-stage rounds (`repair_round` `0` through `3`). The code-review internal loop permits at most ten completed review rounds and is separate; review-internal repairs do not increment the outer counter.
135
-
136
- ## Orchestrator Ownership and Handoff
137
-
138
- 1. An atomic stage performs only its own stage, writes the truthful terminal result and `next_stage`, and returns control.
139
- 2. When `orchestrator` is non-null, only that orchestrator invokes the next skill. The atomic stage must not auto-invoke it again.
140
- 3. Direct stage use may report one deterministic next invocation but does not claim the next stage ran.
141
- 4. Every handoff preserves the same `artifact_dir`.
142
- 5. External automation invokes atomic stages directly and does not invoke `prizmkit-workflow` as a nested coordinator.
143
- 6. Workflow state never replaces or absorbs an external host's checkpoint.
144
-
145
- ## Commit Authorization
146
-
147
- Interactive execution:
148
-
149
- ```text
150
- committer previews intended files and message
151
- → waits for explicit confirmation from the current user
152
- → creates the local commit
153
- ```
154
-
155
- Trusted headless execution:
156
-
157
- ```text
158
- a trusted host explicitly authorizes the current local task commit
159
- → host injects mode=<host-defined-headless-mode>, owner=<trusted-host-identifier>,
160
- local_commit_authorized=true
161
- → committer verifies gates and commits automatically
162
- → no question or wait is permitted
163
- ```
164
-
165
- A self-declared or otherwise untrusted headless context does not authorize a commit. Remote publication remains a separate host-runtime decision.
166
-
167
- ## Recovery
168
-
169
- When state is missing, stale, or inconsistent:
170
-
171
- 1. Read `spec.md` and `plan.md` from `artifact_dir` only when they are not already available in current context.
172
- 2. Inspect task markers and the current workspace.
173
- 3. Read the latest review report and final result when needed to establish review authority.
174
- 4. Validate authoritative test evidence and `repair_scope`.
175
- 5. Validate `retrospective-result.json` when retrospective is claimed complete.
176
- 6. Verify the commit when commit is claimed complete.
177
- 7. When an external host is active, let that host validate its own checkpoint independently; never merge the schemas.
178
- 8. Reconstruct the latest safe predecessor and report the reconstruction.
179
- 9. Continue only from the first incomplete or invalid stage.
180
-
181
- Stale state never bypasses review, testing, retrospective, commit authorization, or external host checkpoint enforcement.