prizmkit 1.1.140 → 1.1.142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/VERSION.json +3 -3
- package/bundled/dev-pipeline/README.md +1 -1
- package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +165 -125
- package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +13 -1
- package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +0 -6
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +5 -3
- package/bundled/dev-pipeline/prizmkit_runtime/test_result.py +160 -0
- package/bundled/dev-pipeline/scripts/check-session-status.py +11 -1
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +23 -806
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +6 -8
- package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +1 -1
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +6 -8
- package/bundled/dev-pipeline/scripts/prompt_framework.py +68 -56
- package/bundled/dev-pipeline/scripts/update-bug-status.py +21 -2
- package/bundled/dev-pipeline/scripts/update-checkpoint.py +52 -131
- package/bundled/dev-pipeline/scripts/update-feature-status.py +21 -2
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +21 -2
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +3 -3
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +8 -19
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +6 -6
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +5 -5
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +1 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +1 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +1 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +1 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +13 -10
- package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +1 -1
- package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +18 -9
- package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-commit.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-base.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-lite-suffix.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +14 -26
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +3 -3
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +1 -1
- package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +13 -10
- package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +1 -1
- package/bundled/dev-pipeline/templates/session-status-schema.json +1 -1
- package/bundled/dev-pipeline/tests/test_checkpoint_state.py +494 -413
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +144 -684
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +20 -41
- package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +24 -24
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +176 -36
- package/bundled/skills/_metadata.json +6 -6
- package/bundled/skills/prizmkit/SKILL.md +13 -18
- package/bundled/skills/prizmkit/references/workflow-state-protocol.md +73 -80
- package/bundled/skills/prizmkit-code-review/SKILL.md +7 -7
- package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +73 -80
- package/bundled/skills/prizmkit-committer/SKILL.md +8 -7
- package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +73 -80
- package/bundled/skills/prizmkit-implement/SKILL.md +3 -2
- package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +73 -80
- package/bundled/skills/prizmkit-plan/SKILL.md +2 -1
- package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +73 -80
- package/bundled/skills/prizmkit-retrospective/SKILL.md +8 -6
- package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +73 -80
- package/bundled/skills/prizmkit-test/SKILL.md +217 -189
- package/bundled/skills/prizmkit-test/references/external-contract-mock-guidance.md +119 -0
- package/bundled/skills/prizmkit-test/references/independent-test-review.md +269 -0
- package/bundled/skills/prizmkit-test/references/test-coverage-model.md +193 -0
- package/bundled/skills/prizmkit-test/references/test-report-template.md +164 -79
- package/bundled/skills/prizmkit-workflow/SKILL.md +28 -36
- package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +73 -80
- package/package.json +1 -1
- package/bundled/skills/prizmkit-test/assets/authoritative-records.schema.json +0 -477
- package/bundled/skills/prizmkit-test/assets/behavior-risk-matrix.schema.json +0 -116
- package/bundled/skills/prizmkit-test/assets/evidence-manifest.schema.json +0 -111
- package/bundled/skills/prizmkit-test/assets/evidence-package-template.json +0 -66
- package/bundled/skills/prizmkit-test/references/boundary-coverage-protocol.md +0 -104
- package/bundled/skills/prizmkit-test/references/contract-mock-protocol.md +0 -65
- package/bundled/skills/prizmkit-test/references/evidence-protocol.md +0 -208
- package/bundled/skills/prizmkit-test/references/evidence-request-protocol.md +0 -80
- package/bundled/skills/prizmkit-test/references/examples.md +0 -100
- package/bundled/skills/prizmkit-test/references/service-boundary-test-catalog.md +0 -228
- package/bundled/skills/prizmkit-test/references/test-generation-steps.md +0 -118
- package/bundled/skills/prizmkit-test/references/trusted-evidence-execution.md +0 -107
- package/bundled/skills/prizmkit-test/references/workflow-state-protocol.md +0 -181
- package/bundled/skills/prizmkit-test/scripts/build_test_evidence.py +0 -1930
- package/bundled/skills/prizmkit-test/scripts/validate_test_evidence.py +0 -1847
|
@@ -1,87 +1,172 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Test Report Template
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Create one human-readable report for every terminal result. Replace an older report for the same invocation context; do not append duplicate final-result sections. Use the exact `## Final Result` heading and `- Result: <TEST_*>` marker shown below. Do not rename this machine-read contract to `Terminal Result`, `Final Decision`, or another heading.
|
|
4
4
|
|
|
5
5
|
```markdown
|
|
6
|
-
# Test
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
6
|
+
# Test Report
|
|
7
|
+
|
|
8
|
+
## Final Result
|
|
9
|
+
|
|
10
|
+
- Result: TEST_PASS | TEST_NEEDS_FIXES | TEST_BLOCKED
|
|
11
|
+
- Summary: <concise testing-domain conclusion>
|
|
12
|
+
|
|
13
|
+
## Change Scope
|
|
14
|
+
|
|
15
|
+
- Scope: <this-change / module / feature / full-project>
|
|
16
|
+
- Production paths: <paths or none>
|
|
17
|
+
- Test paths: <existing, added, and modified paths>
|
|
18
|
+
- Requirement source: <specification, acceptance criteria, caller request, or none>
|
|
19
|
+
|
|
20
|
+
## Affected Business Module
|
|
21
|
+
|
|
22
|
+
- Boundary: <explicit module or cohesion-derived responsibility>
|
|
23
|
+
- Public entry points: <entries>
|
|
24
|
+
- Scope rationale: <why this is the complete affected boundary>
|
|
25
|
+
|
|
26
|
+
## Observable Business Behaviors
|
|
27
|
+
|
|
28
|
+
| Behavior | Truth Source | Tests | Result |
|
|
29
|
+
|---|---|---|---|
|
|
30
|
+
| <behavior> | <spec/contract/acceptance/test/caller> | <test paths or cases> | passed / needs-fixes / blocked |
|
|
31
|
+
|
|
32
|
+
## Boundary and Risk Coverage
|
|
33
|
+
|
|
34
|
+
| Behavior | Applicable Risks | Coverage | Material Omission Reason |
|
|
35
|
+
|---|---|---|---|
|
|
36
|
+
| <behavior> | <functional, boundary, error, state, side-effect, permission, concurrency, idempotency, time, dependency, consumer> | <tests and layers> | <none or behavior-specific reason> |
|
|
37
|
+
|
|
38
|
+
Coverage metrics, when available: <diagnostic values or not collected>. Percentages are not the completion basis.
|
|
39
|
+
|
|
40
|
+
## Regression Ring
|
|
41
|
+
|
|
42
|
+
| Caller / Consumer / Contract / State | Coupling | Verification | Result |
|
|
43
|
+
|---|---|---|---|
|
|
44
|
+
| <edge> | <observable dependency> | <test or command> | passed / needs-fixes / blocked |
|
|
45
|
+
|
|
46
|
+
- Unresolved verdict-capable edges: <none or list>
|
|
47
|
+
|
|
48
|
+
## Tests Added or Updated
|
|
49
|
+
|
|
50
|
+
| Path | Layer | Behaviors and Risks | Change |
|
|
51
|
+
|---|---|---|---|
|
|
52
|
+
| <path> | focused / module / contract / integration / E2E / regression | <coverage> | added / updated / existing |
|
|
53
|
+
|
|
54
|
+
- Existing native framework reused: <yes/no and framework>
|
|
55
|
+
- Infrastructure changes: <none or concise list>
|
|
56
|
+
- Testability seams: <none or behavior-preserving changes>
|
|
57
|
+
|
|
58
|
+
## Native Test Execution
|
|
59
|
+
|
|
60
|
+
| Command | Working Directory | Scope / Layer | Result | Key Output |
|
|
61
|
+
|---|---|---|---|---|
|
|
62
|
+
| <native command> | <cwd> | <tests or layer> | passed / failed / blocked | <concise output or log pointer> |
|
|
63
|
+
|
|
64
|
+
- Required affected-module regression complete: yes / no
|
|
65
|
+
- Required Regression Ring verification complete: yes / no
|
|
66
|
+
- Project-wide regression required: yes / no
|
|
67
|
+
- Project-wide regression result: passed / failed / not-required / blocked
|
|
68
|
+
|
|
69
|
+
## Main-Agent Review
|
|
70
|
+
|
|
71
|
+
- Rounds: <0..10>
|
|
72
|
+
- Accepted findings: <count>
|
|
73
|
+
- Fixed findings: <count>
|
|
74
|
+
- Rejected findings: <count with concise evidence pointers>
|
|
75
|
+
- Unresolved findings: <count and list>
|
|
76
|
+
- Converged on exact final state: yes / no
|
|
77
|
+
|
|
78
|
+
## Independent Test Review
|
|
79
|
+
|
|
80
|
+
- Status: completed / downgraded / not_applicable
|
|
81
|
+
- Responses: <0..5>
|
|
82
|
+
- Capability gate or downgrade reason: <reason or none>
|
|
83
|
+
- Corrections and Main-Agent adjudication: <summary or none>
|
|
84
|
+
- Exact final state independently rechecked: yes / no
|
|
85
|
+
|
|
86
|
+
## Repairs Performed
|
|
87
|
+
|
|
88
|
+
| Round | Failure Classification | Repair | Focused Verification | Required Regression |
|
|
89
|
+
|---|---|---|---|---|
|
|
90
|
+
| <1..3> | test-defect / local-production-defect / high-risk-production-defect / environment-unavailable / truth-unresolved / flaky-or-unreliable | <change or none> | <result> | <result> |
|
|
91
|
+
|
|
92
|
+
- Repair rounds used: <0..3>
|
|
93
|
+
- Assertions or scope weakened to obtain green output: no
|
|
94
|
+
|
|
95
|
+
## Production Repair Risk
|
|
96
|
+
|
|
97
|
+
- Production changed during test: yes / no
|
|
98
|
+
- Repair locality: <local / high-risk / none>
|
|
99
|
+
- Delta Code Review required: yes / no
|
|
100
|
+
- Review scope: delta / none
|
|
101
|
+
- Rationale: <contract and risk analysis>
|
|
102
|
+
|
|
103
|
+
## External Contracts and Mocks
|
|
104
|
+
|
|
105
|
+
| Dependency | Contract Source | Test Double / Isolation | Variants | Remaining Risk |
|
|
106
|
+
|---|---|---|---|---|
|
|
107
|
+
| <dependency> | <project path or public official source/version> | <mock/fake/server/container/isolated service> | <success/boundary/failure variants> | <none or risk> |
|
|
108
|
+
|
|
109
|
+
- Production credentials or resources used: no
|
|
75
110
|
- Real deployed environment validated: no
|
|
76
111
|
|
|
77
|
-
##
|
|
78
|
-
|
|
112
|
+
## Remaining Risks and Unresolved Items
|
|
113
|
+
|
|
114
|
+
- <none, or every known correction/blocker with concrete target and next required fact>
|
|
79
115
|
```
|
|
80
116
|
|
|
81
|
-
##
|
|
117
|
+
## Result Rendering Rules
|
|
118
|
+
|
|
119
|
+
Render `TEST_PASS` only when:
|
|
120
|
+
|
|
121
|
+
- mandatory Main-Agent review converged;
|
|
122
|
+
- independent review converged or was visibly downgraded under its strict capability gate;
|
|
123
|
+
- all required native tests pass on the exact final state;
|
|
124
|
+
- no accepted or unresolved finding remains;
|
|
125
|
+
- no high-risk production repair awaits delta Code Review;
|
|
126
|
+
- no mutation occurred after final applicable review and execution.
|
|
127
|
+
|
|
128
|
+
Render `TEST_NEEDS_FIXES` for a known remaining correction, exhausted review/repair budget with known work, or a completed high-risk repair requiring delta Code Review.
|
|
129
|
+
|
|
130
|
+
Render `TEST_BLOCKED` when truth, required input, safe environment, execution reliability, external-target safety, or required Reviewer input prevents a safe verdict.
|
|
131
|
+
|
|
132
|
+
No conditional pass, commit authorization, release authorization, runtime classification, target hash, manifest, attestation, or package lifecycle belongs in the report.
|
|
133
|
+
|
|
134
|
+
## Terminal Machine Projection
|
|
135
|
+
|
|
136
|
+
Write `test-result.json` together with the report:
|
|
137
|
+
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"schema_version": 1,
|
|
141
|
+
"result": "TEST_PASS",
|
|
142
|
+
"report": "test-report.md",
|
|
143
|
+
"main_review_rounds": 1,
|
|
144
|
+
"independent_review": {
|
|
145
|
+
"status": "downgraded",
|
|
146
|
+
"responses": 0,
|
|
147
|
+
"downgrade_reason": "required read-only continuation capability is unavailable",
|
|
148
|
+
"final_state_rechecked": false
|
|
149
|
+
},
|
|
150
|
+
"repair_rounds": 0,
|
|
151
|
+
"production_changed": false,
|
|
152
|
+
"review_required": false,
|
|
153
|
+
"review_scope": null,
|
|
154
|
+
"unresolved_items": []
|
|
155
|
+
}
|
|
156
|
+
```
|
|
82
157
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
158
|
+
Constraints:
|
|
159
|
+
|
|
160
|
+
- `schema_version` is `1`.
|
|
161
|
+
- `result` is `TEST_PASS`, `TEST_NEEDS_FIXES`, or `TEST_BLOCKED`.
|
|
162
|
+
- `report` is the sibling report filename `test-report.md`.
|
|
163
|
+
- `main_review_rounds` is an integer from `0` through `10`; `0` is valid only when early blocking prevents a complete review round.
|
|
164
|
+
- `independent_review.status` is `completed`, `downgraded`, or `not_applicable`.
|
|
165
|
+
- `completed` requires `responses` from `1` through `5`, `downgrade_reason=null`, and `final_state_rechecked=true`.
|
|
166
|
+
- `downgraded` requires `responses=0`, a non-empty `downgrade_reason`, and `final_state_rechecked=false`.
|
|
167
|
+
- `not_applicable` requires `responses=0`, `downgrade_reason=null`, and `final_state_rechecked=false`.
|
|
168
|
+
- `independent_review.responses` is otherwise bounded from `0` through `5`.
|
|
169
|
+
- `review_scope` is `delta` exactly when `review_required=true`; otherwise it is null.
|
|
170
|
+
- `unresolved_items` contains concise strings and agrees with the report.
|
|
171
|
+
- Report and JSON agree on final result and production-review requirement.
|
|
172
|
+
- The JSON is terminal output only and is never updated as an internal checkpoint.
|
|
@@ -92,12 +92,12 @@ Expected transitions:
|
|
|
92
92
|
|
|
93
93
|
| Stage | Required success | Next stage |
|
|
94
94
|
|---|---|---|
|
|
95
|
-
| `prizmkit-plan` | `PLAN_READY` | `prizmkit-implement` |
|
|
96
|
-
| `prizmkit-implement` | `IMPLEMENTED` | `prizmkit-code-review` |
|
|
97
|
-
| `prizmkit-code-review` | `REVIEW_PASS` | `prizmkit-test` |
|
|
98
|
-
| `prizmkit-test` | `TEST_PASS` | `prizmkit-retrospective` |
|
|
99
|
-
| `prizmkit-retrospective` | `status=RETRO_COMPLETE
|
|
100
|
-
| `prizmkit-committer` | explicit interactive confirmation, then `COMMITTED` | end |
|
|
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 |
|
|
101
101
|
|
|
102
102
|
`TEST_NOT_APPLICABLE` is not a valid lifecycle success. Lightweight changes must execute deterministic verification and return `TEST_PASS`.
|
|
103
103
|
|
|
@@ -107,8 +107,8 @@ The composite must not:
|
|
|
107
107
|
|
|
108
108
|
- reinterpret a plan as implementation;
|
|
109
109
|
- repair production code outside `prizmkit-implement` or the Main-Agent review loop;
|
|
110
|
-
- claim tests passed without
|
|
111
|
-
-
|
|
110
|
+
- claim tests passed without a consistent `test-report.md` and terminal `test-result.json`;
|
|
111
|
+
- reinterpret testing-domain results as runtime/session outcomes;
|
|
112
112
|
- perform retrospective documentation changes itself;
|
|
113
113
|
- stage or commit before `prizmkit-committer` applies the current execution's authorization boundary;
|
|
114
114
|
- invoke `prizmkit-deploy` as a hidden seventh stage.
|
|
@@ -129,34 +129,26 @@ prizmkit-implement
|
|
|
129
129
|
|
|
130
130
|
The Main-Agent review skill owns its internal review repairs and its internal ten-round limit before returning its terminal result. The outer workflow repair counter is separate.
|
|
131
131
|
|
|
132
|
-
### Test
|
|
132
|
+
### Test Non-Pass
|
|
133
133
|
|
|
134
|
-
`
|
|
135
|
-
|
|
136
|
-
TEST_FAIL affecting only tests, fixtures, test-runner configuration, or evidence infrastructure uses `repair_scope=test-infrastructure`:
|
|
134
|
+
`prizmkit-test` already performs bounded test construction, execution-failure repair, mandatory Main-Agent review, and optional independent review before returning. The composite consumes its terminal artifacts without recreating those loops.
|
|
137
135
|
|
|
138
136
|
```text
|
|
139
|
-
|
|
140
|
-
→
|
|
141
|
-
→
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
Test infrastructure includes tests, fixtures, test-runner configuration, and evidence infrastructure only.
|
|
145
|
-
|
|
146
|
-
TEST_FAIL affecting production code, runtime configuration, schema, dependencies, or public interfaces uses the matching production-family scope:
|
|
137
|
+
TEST_NEEDS_FIXES
|
|
138
|
+
→ 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
|
|
147
141
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
→
|
|
151
|
-
→ prizmkit-code-review
|
|
152
|
-
→ prizmkit-test
|
|
142
|
+
TEST_BLOCKED
|
|
143
|
+
→ preserve test-report.md and test-result.json
|
|
144
|
+
→ stop with the unresolved truth, input, safety, environment, or reliability blocker
|
|
153
145
|
```
|
|
154
146
|
|
|
155
|
-
|
|
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.
|
|
156
148
|
|
|
157
149
|
### Environment Block
|
|
158
150
|
|
|
159
|
-
`TEST_BLOCKED` means
|
|
151
|
+
`TEST_BLOCKED` means a safe testing verdict is unavailable because truth, required input, environment, permission, external-target safety, execution reliability, or required review input remains unresolved.
|
|
160
152
|
|
|
161
153
|
Interactive behavior:
|
|
162
154
|
|
|
@@ -180,7 +172,7 @@ repair_round: 0 → 1 → 2 → 3
|
|
|
180
172
|
When the limit is reached:
|
|
181
173
|
|
|
182
174
|
- set workflow status to `WORKFLOW_BLOCKED`;
|
|
183
|
-
- preserve the latest
|
|
175
|
+
- preserve the latest reports and terminal results;
|
|
184
176
|
- report completed rounds and unresolved cause;
|
|
185
177
|
- report the exact skill, `artifact_dir`, and state path from which a user may resume after resolving the cause or explicitly authorizing another attempt;
|
|
186
178
|
- do not claim the requirement is complete.
|
|
@@ -225,7 +217,7 @@ On resume:
|
|
|
225
217
|
|
|
226
218
|
1. Read the workflow state specified by `resume` or discover the target project's active workflow state.
|
|
227
219
|
2. Read `${SKILL_DIR}/references/workflow-state-protocol.md`.
|
|
228
|
-
3. Verify `spec.md`, `plan.md`, review report,
|
|
220
|
+
3. Verify `spec.md`, `plan.md`, review report, test report/result pair, retrospective result, and current workspace against state.
|
|
229
221
|
4. If state is missing or stale, reconstruct the safest recoverable predecessor and report the reconstruction.
|
|
230
222
|
5. Continue from the first incomplete stage; never bypass a required gate based only on stale state.
|
|
231
223
|
6. Preserve the same `artifact_dir` and repair-round count.
|
|
@@ -239,18 +231,18 @@ At successful completion, report:
|
|
|
239
231
|
WORKFLOW_COMPLETE
|
|
240
232
|
artifact_dir: <path>
|
|
241
233
|
stages:
|
|
242
|
-
- PLAN_READY
|
|
243
|
-
- IMPLEMENTED
|
|
244
|
-
- REVIEW_PASS
|
|
245
|
-
- TEST_PASS
|
|
246
|
-
- RETRO_COMPLETE (DOCS_UPDATED | NO_DOC_CHANGE)
|
|
247
|
-
- COMMITTED
|
|
234
|
+
- status=completed, stage_result=PLAN_READY
|
|
235
|
+
- status=completed, stage_result=IMPLEMENTED
|
|
236
|
+
- status=completed, stage_result=REVIEW_PASS
|
|
237
|
+
- status=completed, stage_result=TEST_PASS
|
|
238
|
+
- status=completed, stage_result=RETRO_COMPLETE (result=DOCS_UPDATED | NO_DOC_CHANGE)
|
|
239
|
+
- status=completed, stage_result=COMMITTED
|
|
248
240
|
commit: <hash>
|
|
249
241
|
push: not performed automatically
|
|
250
242
|
next_action: invoke /prizmkit-deploy separately if deployment is needed
|
|
251
243
|
```
|
|
252
244
|
|
|
253
|
-
If the user declines interactive commit confirmation, report `COMMIT_PENDING` rather than `WORKFLOW_COMPLETE` and provide the exact `/prizmkit-committer` resume entry.
|
|
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.
|
|
254
246
|
|
|
255
247
|
If blocked, report:
|
|
256
248
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PrizmKit Workflow State Protocol
|
|
2
2
|
|
|
3
|
-
`workflow-state.json` is lifecycle
|
|
3
|
+
`workflow-state.json` is lifecycle metadata for one formal requirement. It preserves stage handoff, orchestrator ownership, and resume information without replacing skill-owned artifacts or any host-owned execution checkpoint.
|
|
4
4
|
|
|
5
5
|
## Location and Identity
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
.prizmkit/state/workflows/<requirement-slug>.json
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
The
|
|
11
|
+
The active `artifact_dir` is preserved exactly across every stage:
|
|
12
12
|
|
|
13
13
|
```text
|
|
14
14
|
.prizmkit/specs/<requirement-slug>/
|
|
@@ -16,7 +16,7 @@ The state file is created only when a lifecycle runs. The active `artifact_dir`
|
|
|
16
16
|
.prizmkit/refactor/<refactor-id>/
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
Never select
|
|
19
|
+
Never select another recent plan when resuming. Any external execution checkpoint remains separate from this state. Never merge, substitute, or infer one schema from the other.
|
|
20
20
|
|
|
21
21
|
## Authority
|
|
22
22
|
|
|
@@ -26,16 +26,16 @@ The state file is an index, not the authority for stage completion:
|
|
|
26
26
|
|---|---|
|
|
27
27
|
| Requirement goals and acceptance criteria | `{artifact_dir}/spec.md` |
|
|
28
28
|
| Implementation tasks and completion | `{artifact_dir}/plan.md` plus current workspace |
|
|
29
|
-
| Review findings and
|
|
30
|
-
| Test
|
|
31
|
-
|
|
|
32
|
-
| Retrospective completion
|
|
29
|
+
| Review findings and result | `{artifact_dir}/review-report.md` |
|
|
30
|
+
| Test semantics and native execution | `{artifact_dir}/test-report.md` |
|
|
31
|
+
| Terminal testing result | `{artifact_dir}/test-result.json` |
|
|
32
|
+
| Retrospective completion | `{artifact_dir}/retrospective-result.json` |
|
|
33
33
|
| Durable architecture knowledge | `.prizmkit/prizm-docs/` |
|
|
34
34
|
| Local commit | Git history and confirmed or authorized commit identity |
|
|
35
35
|
| Current stage, orchestrator, and resume entry | Workflow state |
|
|
36
|
-
| External orchestration progress |
|
|
36
|
+
| External orchestration progress | External host checkpoint |
|
|
37
37
|
|
|
38
|
-
Every consumer compares workflow state with
|
|
38
|
+
Every consumer compares workflow state with the skill-owned artifacts and current workspace. Missing or stale state is reconstructed from those sources and is never accepted as success by itself.
|
|
39
39
|
|
|
40
40
|
## Schema
|
|
41
41
|
|
|
@@ -45,7 +45,7 @@ Every consumer compares workflow state with authoritative artifacts and the curr
|
|
|
45
45
|
"artifact_dir": ".prizmkit/specs/example",
|
|
46
46
|
"orchestrator": "prizmkit-workflow",
|
|
47
47
|
"stage": "test",
|
|
48
|
-
"status": "
|
|
48
|
+
"status": "completed",
|
|
49
49
|
"stage_result": "TEST_PASS",
|
|
50
50
|
"completed_stages": ["plan", "implement", "code-review", "test"],
|
|
51
51
|
"repair_scope": null,
|
|
@@ -59,88 +59,83 @@ Every consumer compares workflow state with authoritative artifacts and the curr
|
|
|
59
59
|
|
|
60
60
|
| Field | Meaning |
|
|
61
61
|
|---|---|
|
|
62
|
-
| `schema_version` | State schema version.
|
|
63
|
-
| `artifact_dir` |
|
|
64
|
-
| `orchestrator` |
|
|
65
|
-
| `stage` |
|
|
66
|
-
| `status` | Lifecycle
|
|
67
|
-
| `stage_result` | Domain result such as `
|
|
62
|
+
| `schema_version` | State schema version. |
|
|
63
|
+
| `artifact_dir` | Generic requirement artifact root reused by every stage. |
|
|
64
|
+
| `orchestrator` | Semantic coordinator identifier, or null for direct stage use. |
|
|
65
|
+
| `stage` | Stage that most recently wrote state. |
|
|
66
|
+
| `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`. |
|
|
68
68
|
| `completed_stages` | Ordered stages completed for this requirement. |
|
|
69
|
-
| `repair_scope` |
|
|
70
|
-
| `repair_round` |
|
|
71
|
-
| `next_stage` | Next semantic stage, or
|
|
72
|
-
| `resume_from` | Exact atomic skill that can resume, or
|
|
69
|
+
| `repair_scope` | Optional caller-owned routing scope. The test skill reports high-risk repairs through `test-result.json` instead of scheduling another stage. |
|
|
70
|
+
| `repair_round` | Optional outer cross-stage repair round, from 0 through 3. It is not a test-internal repair counter. |
|
|
71
|
+
| `next_stage` | Next semantic stage, or null when stopped. |
|
|
72
|
+
| `resume_from` | Exact atomic skill that can resume, or null when none is selected. |
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
`status` and `stage_result` are deliberately separate. Lifecycle status values must never be replaced with domain result values.
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
## Lifecycle and Result Mappings
|
|
77
77
|
|
|
78
78
|
```text
|
|
79
79
|
PLAN_READY
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
→ IMPLEMENTED
|
|
81
|
+
→ REVIEW_PASS
|
|
82
|
+
→ TEST_PASS
|
|
83
|
+
→ RETRO_COMPLETE
|
|
84
|
+
→ COMMIT_PENDING
|
|
85
|
+
→ COMMITTED
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
No formal stage is silently optional. Domain
|
|
88
|
+
No formal stage is silently optional. Domain artifacts map to workflow state as follows:
|
|
89
89
|
|
|
90
90
|
```text
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
plan PLAN_READY → status=completed, stage_result=PLAN_READY
|
|
92
|
+
plan PLAN_BLOCKED → status=failed, stage_result=PLAN_BLOCKED
|
|
93
|
+
implementation IMPLEMENTED → status=completed, stage_result=IMPLEMENTED
|
|
94
|
+
implementation repair/block → status=failed, stage_result=IMPLEMENT_REPAIR or IMPLEMENT_BLOCKED
|
|
95
|
+
review-report PASS → status=completed, stage_result=REVIEW_PASS
|
|
96
|
+
review-report NEEDS_FIXES → status=failed, stage_result=REVIEW_NEEDS_FIXES
|
|
97
|
+
test-result TEST_PASS → status=completed, stage_result=TEST_PASS
|
|
98
|
+
test-result TEST_NEEDS_FIXES → status=failed, stage_result=TEST_NEEDS_FIXES
|
|
99
|
+
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
|
|
104
|
+
local commit confirmed → status=completed, stage_result=COMMITTED
|
|
105
|
+
commit blocked → status=failed, stage_result=COMMIT_BLOCKED
|
|
98
106
|
```
|
|
99
107
|
|
|
100
|
-
`
|
|
108
|
+
`DOCS_UPDATED` and `NO_DOC_CHANGE` remain retrospective artifact `result` values. The workflow `stage_result` is the retrospective stage result `RETRO_COMPLETE`.
|
|
101
109
|
|
|
102
|
-
|
|
110
|
+
`TEST_PASS` requires both `test-report.md` and a consistent `test-result.json`. No manifest, attestation, evidence package, or test-internal checkpoint is part of this contract.
|
|
103
111
|
|
|
104
|
-
|
|
105
|
-
REVIEW_NEEDS_FIXES
|
|
106
|
-
→ implement
|
|
107
|
-
→ code-review
|
|
108
|
-
→ test
|
|
109
|
-
|
|
110
|
-
TEST_FAIL with repair_scope=test-infrastructure
|
|
111
|
-
→ implement
|
|
112
|
-
→ test
|
|
112
|
+
## Non-Pass Results and Routing Boundary
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
→ implement
|
|
116
|
-
→ code-review
|
|
117
|
-
→ test
|
|
114
|
+
`prizmkit-test` performs its own bounded failure repair and review loops before returning. The test skill never invokes another lifecycle stage.
|
|
118
115
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
```text
|
|
117
|
+
TEST_NEEDS_FIXES
|
|
118
|
+
→ known correction or required delta review remains
|
|
119
|
+
→ caller decides whether and how to arrange another stage
|
|
122
120
|
|
|
123
121
|
TEST_BLOCKED
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
RETRO_BLOCKED
|
|
129
|
-
→ WORKFLOW_BLOCKED
|
|
130
|
-
WORKFLOW_BLOCKED
|
|
131
|
-
→ resume only after the recorded blocker is resolved
|
|
122
|
+
→ truth, input, safe environment, or reliable execution prevents a verdict
|
|
123
|
+
→ never make speculative production edits
|
|
124
|
+
→ caller or external host owns recovery policy
|
|
132
125
|
```
|
|
133
126
|
|
|
134
|
-
|
|
127
|
+
A test result is not an AI CLI session classification. `TEST_NEEDS_FIXES` and `TEST_BLOCKED` must not be rewritten as crash or infrastructure failure merely because they stop lifecycle progression.
|
|
128
|
+
|
|
129
|
+
Any outer repair or continuation policy is independently owned by the caller and cannot alter the test report. The Main-Agent test review limit of ten rounds, independent Test Reviewer limit of five responses, and execution-failure repair limit of three rounds are internal to one test invocation and do not update outer counters.
|
|
135
130
|
|
|
136
131
|
## Orchestrator Ownership and Handoff
|
|
137
132
|
|
|
138
|
-
1. An atomic stage performs only its own stage, writes
|
|
139
|
-
2. When `orchestrator` is non-null, only that orchestrator invokes the next skill.
|
|
140
|
-
3. Direct stage use may report
|
|
133
|
+
1. An atomic stage performs only its own stage, writes its truthful result and artifact paths, and returns control.
|
|
134
|
+
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.
|
|
141
136
|
4. Every handoff preserves the same `artifact_dir`.
|
|
142
|
-
5. External automation invokes atomic stages directly and does not
|
|
143
|
-
6. Workflow state never replaces or absorbs an external host
|
|
137
|
+
5. External automation invokes atomic stages directly and does not nest the composite workflow.
|
|
138
|
+
6. Workflow state never replaces or absorbs an external host checkpoint.
|
|
144
139
|
|
|
145
140
|
## Commit Authorization
|
|
146
141
|
|
|
@@ -148,34 +143,32 @@ Interactive execution:
|
|
|
148
143
|
|
|
149
144
|
```text
|
|
150
145
|
committer previews intended files and message
|
|
151
|
-
→ waits for explicit
|
|
146
|
+
→ waits for explicit current-user confirmation
|
|
152
147
|
→ creates the local commit
|
|
153
148
|
```
|
|
154
149
|
|
|
155
150
|
Trusted headless execution:
|
|
156
151
|
|
|
157
152
|
```text
|
|
158
|
-
|
|
159
|
-
→ host injects mode=<host-defined-headless-mode>, owner=<trusted-host-identifier>,
|
|
160
|
-
local_commit_authorized=true
|
|
153
|
+
trusted host explicitly authorizes the current local task commit
|
|
161
154
|
→ committer verifies gates and commits automatically
|
|
162
|
-
→
|
|
155
|
+
→ remote publication remains separate
|
|
163
156
|
```
|
|
164
157
|
|
|
165
|
-
A self-declared or
|
|
158
|
+
A self-declared or untrusted headless context does not authorize a commit.
|
|
166
159
|
|
|
167
160
|
## Recovery
|
|
168
161
|
|
|
169
162
|
When state is missing, stale, or inconsistent:
|
|
170
163
|
|
|
171
|
-
1.
|
|
172
|
-
2. Inspect task markers and
|
|
173
|
-
3. Read the
|
|
174
|
-
4. Validate
|
|
164
|
+
1. Reuse current context, then read `spec.md` and `plan.md` only when needed.
|
|
165
|
+
2. Inspect task markers and current workspace.
|
|
166
|
+
3. Read the current review report when needed to establish review authority.
|
|
167
|
+
4. Validate that `test-report.md` and terminal `test-result.json` exist, agree, and reflect the claimed result.
|
|
175
168
|
5. Validate `retrospective-result.json` when retrospective is claimed complete.
|
|
176
169
|
6. Verify the commit when commit is claimed complete.
|
|
177
|
-
7.
|
|
170
|
+
7. Let an active external host validate its own checkpoint independently.
|
|
178
171
|
8. Reconstruct the latest safe predecessor and report the reconstruction.
|
|
179
172
|
9. Continue only from the first incomplete or invalid stage.
|
|
180
173
|
|
|
181
|
-
Stale state never bypasses review, testing, retrospective, commit authorization, or external
|
|
174
|
+
Stale state never bypasses review, testing, retrospective, commit authorization, or external checkpoint enforcement.
|