prizmkit 1.1.130 → 1.1.134
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/adapters/claude/command-adapter.js +0 -2
- package/bundled/dev-pipeline/.env.example +1 -1
- package/bundled/dev-pipeline/assets/skill-subagent-integration.md +11 -6
- package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +445 -8
- package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +2 -9
- package/bundled/dev-pipeline/prizmkit_runtime/processes.py +21 -1
- package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +87 -66
- package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +53 -3
- package/bundled/dev-pipeline/prizmkit_runtime/runner_recovery.py +55 -25
- package/bundled/dev-pipeline/prizmkit_runtime/runner_status.py +4 -0
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +119 -18
- package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +3 -2
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +411 -17
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +57 -14
- package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +5 -4
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +55 -2
- package/bundled/dev-pipeline/scripts/prompt_framework.py +152 -1
- package/bundled/dev-pipeline/scripts/update-bug-status.py +53 -0
- package/bundled/dev-pipeline/scripts/update-checkpoint.py +294 -69
- package/bundled/dev-pipeline/scripts/update-feature-status.py +57 -0
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +53 -0
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +5 -5
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +28 -22
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +24 -10
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +20 -2
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +2 -2
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +1 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +5 -10
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +9 -19
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +21 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +1 -1
- package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +10 -10
- package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +1 -1
- package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +15 -0
- package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-commit.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +26 -23
- package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +5 -5
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +15 -11
- package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +1 -1
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +6 -6
- package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +21 -0
- package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +1 -1
- package/bundled/dev-pipeline/templates/sections/subagent-timeout-recovery.md +1 -1
- package/bundled/dev-pipeline/templates/sections/task-contract.md +4 -0
- package/bundled/dev-pipeline/tests/test_checkpoint_state.py +362 -3
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +349 -48
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +129 -0
- package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +91 -0
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +567 -23
- package/bundled/dev-pipeline/tests/test_unified_cli.py +37 -10
- package/bundled/skills/_metadata.json +63 -26
- package/bundled/skills/app-planner/SKILL.md +4 -3
- package/bundled/skills/bug-fix-workflow/SKILL.md +89 -180
- package/bundled/skills/bug-planner/SKILL.md +12 -27
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +131 -220
- package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +36 -90
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +129 -271
- package/bundled/skills/feature-pipeline-launcher/references/configuration.md +35 -76
- package/bundled/skills/feature-planner/SKILL.md +27 -22
- package/bundled/skills/feature-planner/assets/planning-guide.md +4 -4
- package/bundled/skills/feature-workflow/SKILL.md +94 -121
- package/bundled/skills/prizmkit/SKILL.md +130 -94
- package/bundled/skills/prizmkit/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-code-review/SKILL.md +132 -86
- package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +243 -0
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +42 -1
- package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +93 -1
- package/bundled/skills/prizmkit-committer/SKILL.md +125 -48
- package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-implement/SKILL.md +99 -73
- package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +1 -1
- package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-init/SKILL.md +5 -5
- package/bundled/skills/prizmkit-plan/SKILL.md +146 -105
- package/bundled/skills/prizmkit-plan/assets/plan-template.md +18 -0
- package/bundled/skills/prizmkit-plan/references/independent-plan-review.md +242 -0
- package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +4 -4
- package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-retrospective/SKILL.md +111 -53
- package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +7 -6
- package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +5 -4
- package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-test/SKILL.md +52 -6
- package/bundled/skills/prizmkit-test/assets/authoritative-records.schema.json +63 -12
- package/bundled/skills/prizmkit-test/assets/evidence-manifest.schema.json +1 -1
- package/bundled/skills/prizmkit-test/assets/evidence-package-template.json +13 -0
- package/bundled/skills/prizmkit-test/references/evidence-protocol.md +6 -1
- package/bundled/skills/prizmkit-test/references/evidence-request-protocol.md +8 -1
- package/bundled/skills/prizmkit-test/references/examples.md +1 -1
- package/bundled/skills/prizmkit-test/references/test-generation-steps.md +4 -1
- package/bundled/skills/prizmkit-test/references/test-report-template.md +1 -1
- package/bundled/skills/prizmkit-test/references/trusted-evidence-execution.md +15 -0
- package/bundled/skills/prizmkit-test/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-test/scripts/build_test_evidence.py +744 -23
- package/bundled/skills/prizmkit-test/scripts/validate_test_evidence.py +194 -15
- package/bundled/skills/prizmkit-workflow/SKILL.md +266 -0
- package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/recovery-workflow/SKILL.md +62 -241
- package/bundled/skills/recovery-workflow/evals/evals.json +17 -33
- package/bundled/skills/recovery-workflow/references/detection.md +28 -52
- package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +105 -439
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +136 -275
- package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +53 -88
- package/bundled/skills/refactor-planner/SKILL.md +12 -57
- package/bundled/skills/refactor-planner/references/behavior-preservation.md +111 -230
- package/bundled/skills/refactor-planner/references/error-recovery.md +37 -0
- package/bundled/skills/refactor-planner/references/planning-phases.md +11 -17
- package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +1 -1
- package/bundled/skills/refactor-workflow/SKILL.md +98 -139
- package/bundled/templates/project-memory-template.md +4 -4
- package/package.json +1 -1
- package/src/index.js +4 -0
- package/src/prompts.js +10 -3
- package/src/scaffold.js +1 -1
- package/bundled/dev-pipeline/tests/test-deploy-safety.sh +0 -223
- package/bundled/skills/feature-pipeline-launcher/scripts/preflight-check.py +0 -462
|
@@ -15,9 +15,44 @@ Choose project-semantic parameters from the target project: framework, commands,
|
|
|
15
15
|
|
|
16
16
|
Fix only the protocol mechanisms needed for safe, replayable evidence: project/evidence/request locators, schema-shaped requests, path confinement, real process execution, complete raw capture, runner-generated chained receipts, hash binding, append-only history, differential isolation/cleanup, and resume invalidation. Read `${SKILL_DIR}/references/trusted-evidence-execution.md` before inventory, execution, differential proof, resume, or replay; it defines the trust boundary and builder commands. Read `${SKILL_DIR}/references/evidence-request-protocol.md` when authoring any request or authoritative JSON record; it defines request ownership, structured N/A, and the schema map.
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## Canonical Evidence Builder Lifecycle
|
|
19
|
+
|
|
20
|
+
The Main Agent supplies semantic requests only; it does not author authoritative package records. Initialize and drive one evidence directory through the builder in this order:
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
init → capture-change → inventory → execute/differential → finalize → render-report → validate --attest → resume
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Use `${SKILL_DIR}/scripts/build_test_evidence.py` for every lifecycle command:
|
|
27
|
+
|
|
28
|
+
- `init`: creates the package directories and immutable baseline identity.
|
|
29
|
+
- `capture-change`: captures the complete canonical change, including untracked, deleted, renamed, and copied files; never substitute plain `git diff`.
|
|
30
|
+
- `inventory`: hashes current source/tests/contracts/lockfiles, rejects category overlap, excludes runtime-only paths, and validates directory roots plus explicit changed-file sets.
|
|
31
|
+
- `execute`: runs native project commands and owns `executions.json`, `receipts/`, and `raw/`.
|
|
32
|
+
- `differential`: records executable proof or a mechanically validated `NOT_APPLICABLE` decision only for genuinely new behavior or textual-contract behavior.
|
|
33
|
+
- `finalize`: owns manifest, stage hashes, verdict, generated-test snapshots, and evidence identity.
|
|
34
|
+
- `render-report`: derives `test-report.md`; it is never authoritative.
|
|
35
|
+
- `resume`: preserves prior receipts and refuses to rebind an identity-changing package; create a new package after scope/source identity changes.
|
|
36
|
+
|
|
37
|
+
Before testing, inspect and reuse repository-native tests and their runner configuration. Existing tests are the default. Add or modify a project-native test only after recording a concrete behavior gap. Classify each planned test as `existing`, `added`, or `modified`; `generated-tests/` is empty for unchanged existing tests and contains only snapshots of added/modified native test sources.
|
|
38
|
+
|
|
39
|
+
`test-plan.json` is the only source of test IDs. Execution requests may reference only IDs declared there, and the builder rejects unknown IDs or layer mappings. Assess all five layers explicitly, but set `required=true` only when risk requires it; every omitted layer needs structured N/A evidence. The same binding applies test ↔ behavior ↔ execution ↔ differential proof.
|
|
40
|
+
|
|
41
|
+
The builder/validator, not the Main Agent, produces or updates `manifest.json`, `executions.json`, `receipts/*`, `validation.json`, `verdict.json`, `test-report.md`, and `source-change.patch`. `validation.json` is produced only by `validate_test_evidence.py --attest`; a package is not a `TEST_PASS` until the second strict validation succeeds.
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
For a formal requirement, `/prizmkit-test` runs after the Main-Agent code-review stage reaches `PASS` and before retrospective:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
plan → implement → code-review → test → retrospective → committer
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Read `${SKILL_DIR}/references/workflow-state-protocol.md` before reading or updating lifecycle state. Reuse the caller's `artifact_dir`; do not select another recent plan. When an active `orchestrator` is recorded, return the testing result and next-stage metadata to it instead of invoking another skill independently.
|
|
51
|
+
|
|
52
|
+
## Atomic Stage Boundary
|
|
53
|
+
|
|
54
|
+
`prizmkit-test` owns only auditable test evidence generation, validation, and the testing-domain verdict. It writes the authoritative `TEST_*` result and `next_stage`, then returns control. When an external orchestrator is active, it must not invoke retrospective or implementation itself. The active orchestrator owns the next-stage invocation and repair routing.
|
|
19
55
|
|
|
20
|
-
Use for:
|
|
21
56
|
|
|
22
57
|
- behavior-changing source code;
|
|
23
58
|
- runtime configuration, schema, migration, generated-runtime, lockfile, or dependency changes;
|
|
@@ -35,6 +70,7 @@ Documentation, comment, and formatting-only scopes use deterministic lightweight
|
|
|
35
70
|
3. Preserve complete command/environment/output values as requested. Mark the package `sensitivity=project-controlled`; the project owns access control, retention, and upload policy.
|
|
36
71
|
4. Treat code-level dependencies as mock-first. Real deployed test-environment validation is a separate authorized activity.
|
|
37
72
|
5. Never delete existing tests.
|
|
73
|
+
6. For `TEST_FAIL`, classify and persist an evidence-backed `repair_scope` of `test-infrastructure`, `production`, `runtime`, `schema`, `dependency`, `public-interface`, or `unknown`. Test-infrastructure scope routes to implement then test; production-family scope routes to implement, code-review, then test. If evidence cannot support a safe classification, return `TEST_BLOCKED`.
|
|
38
74
|
|
|
39
75
|
If test infrastructure is missing, the infrastructure preparation state establishes only the necessary project-native infrastructure autonomously. Do not ask the user to install routine test dependencies in a headless run; verify dependency versions before editing manifests.
|
|
40
76
|
|
|
@@ -171,7 +207,7 @@ Create `.prizmkit/test/evidence/<evidence-id>/` from the package template with:
|
|
|
171
207
|
- `contracts/` snapshots
|
|
172
208
|
- derived `test-report.md`
|
|
173
209
|
|
|
174
|
-
Hash baseline, diff, the stable source snapshot, inventoried source/tests/contracts/lockfiles, environment, plan, and every evidence file. Runtime state, evidence output, linked Agent worktrees, Git metadata, and bytecode caches are outside source identity; evidence files remain independently content-addressed through `manifest.json`. Set `environment_claim=mocked-code-level-only
|
|
210
|
+
Hash baseline, diff, the stable source snapshot, inventoried source/tests/contracts/lockfiles, environment, plan, and every evidence file. Runtime state, evidence output, linked Agent worktrees, Git metadata, and bytecode caches are outside source identity; evidence files remain independently content-addressed through `manifest.json`. Set `environment_claim=mocked-code-level-only`.
|
|
175
211
|
|
|
176
212
|
### 9. EVIDENCE_VALIDATE
|
|
177
213
|
|
|
@@ -203,11 +239,17 @@ For a large module or bounded budget, persist matrix/checkpoint progress and ret
|
|
|
203
239
|
Only these testing-domain outcomes are valid:
|
|
204
240
|
|
|
205
241
|
- `TEST_PASS`: every required module behavior/risk and Regression Ring check is proven, required executions pass reliably, cleanup succeeds, no verdict-capable unresolved edge remains, and deterministic validation passes.
|
|
206
|
-
- `TEST_FAIL`: a valid reliable test reproduces an implementation or resolved-contract failure.
|
|
242
|
+
- `TEST_FAIL`: a valid reliable test reproduces an implementation or resolved-contract failure. The authoritative verdict record must include `repair_scope` and enough evidence for the next stage to route safely.
|
|
207
243
|
- `TEST_BLOCKED`: unknown scope, conflicting truth, unavailable/unreliable/flaky necessary execution, incomplete evidence, unproven tests, failed cleanup, budget truncation, or deterministic validation failure.
|
|
208
244
|
|
|
209
245
|
No conditional pass exists.
|
|
210
246
|
|
|
247
|
+
## Workflow State and Handoff
|
|
248
|
+
|
|
249
|
+
Before writing state, read `${SKILL_DIR}/references/workflow-state-protocol.md`.
|
|
250
|
+
|
|
251
|
+
On `TEST_PASS`, update the active workflow state with `status=TEST_PASS`, `stage_result=TEST_PASS`, and `next_stage=retrospective`. On `TEST_FAIL`, persist the evidence-backed `repair_scope`, set `status=TEST_FAIL` and `stage_result=TEST_FAIL`, and return to implementation; test-infrastructure scope selects `next_stage=implement` with a direct test resume, while production-family scope selects `next_stage=implement` and requires code review before testing again. On `TEST_BLOCKED`, preserve the blocker, do not modify production code speculatively, and return a blocked result. The authoritative verdict is the validated evidence record; the derived Markdown report is only a compatibility view. If an active orchestrator exists, return the terminal result and `next_stage` to it; do not invoke the next skill independently.
|
|
252
|
+
|
|
211
253
|
## Derived Report and Handoff
|
|
212
254
|
|
|
213
255
|
Generate `test-report.md` from structured evidence using `${SKILL_DIR}/references/test-report-template.md`. It is a replaceable view, not the source of truth. Report only:
|
|
@@ -216,9 +258,13 @@ Generate `test-report.md` from structured evidence using `${SKILL_DIR}/reference
|
|
|
216
258
|
- evidence directory and ID;
|
|
217
259
|
- validator result and key execution pointers;
|
|
218
260
|
- sensitivity and mocked-versus-real warning;
|
|
219
|
-
-
|
|
261
|
+
- authoritative evidence pointers for external automation and interactive consumers.
|
|
262
|
+
|
|
263
|
+
Do not embed an independent AI reviewer, decide overall code quality, claim broad Spec compliance, repair a validly detected business defect, authorize commit/release, or perform deployed test/production validation. The derived report is a view; `verdict.json`, validation records, and the evidence manifest remain authoritative.
|
|
264
|
+
|
|
265
|
+
## Compatibility
|
|
220
266
|
|
|
221
|
-
|
|
267
|
+
Consumers must read authoritative `TEST_*` evidence. During migration, a legacy Markdown report may be used only as a compatibility view after the authoritative verdict has passed validation.
|
|
222
268
|
|
|
223
269
|
Existing Pipeline and Skill consumers are not migrated by this protocol. Temporary post-install incompatibility with callers expecting the legacy report is accepted and must be stated, not hidden.
|
|
224
270
|
|
|
@@ -183,12 +183,33 @@
|
|
|
183
183
|
}
|
|
184
184
|
},
|
|
185
185
|
"changed_files": { "$ref": "#/$defs/stringArray" },
|
|
186
|
-
"module_roots": {
|
|
186
|
+
"module_roots": {
|
|
187
|
+
"type": "array",
|
|
188
|
+
"minItems": 1,
|
|
189
|
+
"items": {
|
|
190
|
+
"oneOf": [
|
|
191
|
+
{ "$ref": "#/$defs/path" },
|
|
192
|
+
{
|
|
193
|
+
"type": "object",
|
|
194
|
+
"additionalProperties": false,
|
|
195
|
+
"required": ["path", "changed_files"],
|
|
196
|
+
"properties": {
|
|
197
|
+
"path": { "$ref": "#/$defs/path" },
|
|
198
|
+
"changed_files": { "$ref": "#/$defs/stringArray" }
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
},
|
|
187
204
|
"module_root_files": {
|
|
188
205
|
"type": "object",
|
|
189
206
|
"minProperties": 1,
|
|
190
207
|
"additionalProperties": { "$ref": "#/$defs/stringArray" }
|
|
191
208
|
},
|
|
209
|
+
"module_root_changed_files": {
|
|
210
|
+
"type": "object",
|
|
211
|
+
"additionalProperties": { "$ref": "#/$defs/stringArray" }
|
|
212
|
+
},
|
|
192
213
|
"exclusions": { "type": "array", "items": { "$ref": "#/$defs/path" } },
|
|
193
214
|
"discovery_evidence": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/discoveryEvidence" } },
|
|
194
215
|
"plan_inputs": { "type": "object", "minProperties": 1 }
|
|
@@ -225,8 +246,9 @@
|
|
|
225
246
|
"properties": {
|
|
226
247
|
"id": { "type": "string", "minLength": 1 },
|
|
227
248
|
"behavior_ids": { "$ref": "#/$defs/stringArray" },
|
|
249
|
+
"change_status": { "enum": ["existing", "added", "modified"] },
|
|
228
250
|
"project_path": { "$ref": "#/$defs/path" },
|
|
229
|
-
"snapshot_path": { "
|
|
251
|
+
"snapshot_path": { "type": ["string", "null"] },
|
|
230
252
|
"inventory_path": { "$ref": "#/$defs/path" },
|
|
231
253
|
"layers": { "$ref": "#/$defs/stringArray" }
|
|
232
254
|
}
|
|
@@ -289,19 +311,47 @@
|
|
|
289
311
|
},
|
|
290
312
|
"executionLog": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/executionReceipt" } },
|
|
291
313
|
"differentialRequest": {
|
|
314
|
+
"type": "object",
|
|
315
|
+
"oneOf": [
|
|
316
|
+
{
|
|
317
|
+
"type": "object",
|
|
318
|
+
"additionalProperties": false,
|
|
319
|
+
"required": ["request_version", "behavior_id", "method", "execution_request", "baseline_commit", "current_tree_sha256", "mutation_patch_path", "test_overlay_paths", "expected_failure_signals"],
|
|
320
|
+
"properties": {
|
|
321
|
+
"request_version": { "const": "1.0" },
|
|
322
|
+
"behavior_id": { "type": "string", "minLength": 1 },
|
|
323
|
+
"method": { "enum": ["baseline", "controlled-mutation"] },
|
|
324
|
+
"execution_request": { "$ref": "#/$defs/executionRequest" },
|
|
325
|
+
"baseline_commit": { "type": "string", "minLength": 1 },
|
|
326
|
+
"current_tree_sha256": { "$ref": "#/$defs/sha256" },
|
|
327
|
+
"mutation_patch_path": { "type": ["string", "null"] },
|
|
328
|
+
"test_overlay_paths": { "$ref": "#/$defs/stringArray" },
|
|
329
|
+
"expected_failure_signals": { "$ref": "#/$defs/stringArray" }
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"type": "object",
|
|
334
|
+
"additionalProperties": false,
|
|
335
|
+
"required": ["request_version", "behavior_id", "method", "not_applicable"],
|
|
336
|
+
"properties": {
|
|
337
|
+
"request_version": { "const": "1.0" },
|
|
338
|
+
"behavior_id": { "type": "string", "minLength": 1 },
|
|
339
|
+
"method": { "const": "not-applicable" },
|
|
340
|
+
"not_applicable": { "$ref": "#/$defs/differentialNotApplicable" }
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
]
|
|
344
|
+
},
|
|
345
|
+
"differentialNotApplicable": {
|
|
292
346
|
"type": "object",
|
|
293
347
|
"additionalProperties": false,
|
|
294
|
-
"required": ["
|
|
348
|
+
"required": ["reason", "rationale", "evidence", "considered_signals", "conflicts"],
|
|
295
349
|
"properties": {
|
|
296
|
-
"
|
|
297
|
-
"
|
|
298
|
-
"
|
|
299
|
-
"
|
|
300
|
-
"
|
|
301
|
-
"current_tree_sha256": { "$ref": "#/$defs/sha256" },
|
|
302
|
-
"mutation_patch_path": { "type": ["string", "null"] },
|
|
303
|
-
"test_overlay_paths": { "$ref": "#/$defs/stringArray" },
|
|
304
|
-
"expected_failure_signals": { "$ref": "#/$defs/stringArray" }
|
|
350
|
+
"reason": { "enum": ["new-behavior", "textual-contract"] },
|
|
351
|
+
"rationale": { "type": "string", "minLength": 16 },
|
|
352
|
+
"evidence": { "$ref": "#/$defs/stringArray" },
|
|
353
|
+
"considered_signals": { "$ref": "#/$defs/stringArray" },
|
|
354
|
+
"conflicts": { "type": "array", "items": { "type": "object" } }
|
|
305
355
|
}
|
|
306
356
|
},
|
|
307
357
|
"differentialProof": {
|
|
@@ -375,6 +425,7 @@
|
|
|
375
425
|
"real_environment_validated": { "const": false },
|
|
376
426
|
"repairs_business_defects": { "const": false },
|
|
377
427
|
"code_evidence_replayable": { "type": "boolean" },
|
|
428
|
+
"repair_scope": { "enum": ["test-infrastructure", "production", "runtime", "schema", "dependency", "public-interface"] },
|
|
378
429
|
"blockers": { "type": "array", "items": { "type": "string", "minLength": 1 } },
|
|
379
430
|
"reproduced_failures": { "type": "array", "items": { "type": "string", "minLength": 1 } }
|
|
380
431
|
}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"protocol_version": "1.0",
|
|
3
|
+
"lifecycle_commands": [
|
|
4
|
+
"init",
|
|
5
|
+
"capture-change",
|
|
6
|
+
"inventory",
|
|
7
|
+
"execute",
|
|
8
|
+
"differential",
|
|
9
|
+
"finalize",
|
|
10
|
+
"render-report",
|
|
11
|
+
"resume"
|
|
12
|
+
],
|
|
13
|
+
"generated_tests_policy": "Only added or modified repository-native tests are snapshotted; existing tests have no generated snapshot.",
|
|
3
14
|
"records": {
|
|
4
15
|
"change_classification": "change-classification.json",
|
|
5
16
|
"scope": "scope.json",
|
|
@@ -13,6 +24,8 @@
|
|
|
13
24
|
"verdict": "verdict.json",
|
|
14
25
|
"validation": "validation.json",
|
|
15
26
|
"source_patch": "source-change.patch",
|
|
27
|
+
"change_capture": "change-capture.json",
|
|
28
|
+
"lifecycle": "lifecycle.json",
|
|
16
29
|
"derived_report": "test-report.md"
|
|
17
30
|
},
|
|
18
31
|
"directories": {
|
|
@@ -23,7 +23,12 @@ Hashes and validator receipts provide byte-level binding and drift detection, no
|
|
|
23
23
|
|
|
24
24
|
`source-change.patch` preserves the complete target diff. Snapshot generated/changed tests under `generated-tests/`, contracts under `contracts/`, and raw stdout/stderr under `raw/`. Never replace old execution/output records.
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## Existing Tests and Package Finalization
|
|
27
|
+
|
|
28
|
+
The evidence package is an audit of repository behavior, not a request to invent a parallel test suite. Discover and execute the smallest relevant native tests before adding anything. `generated-tests/` is a snapshot area for added or modified repository-native tests only; it may be empty when existing tests cover the behavior.
|
|
29
|
+
|
|
30
|
+
The canonical package lifecycle is `init → capture-change → inventory → execute/differential → finalize → render-report → validate --attest → resume`. Builder commands own `source-change.patch`, receipts, raw outputs, manifest, verdict, and report. The validator alone owns `validation.json`. Evidence identity is derived from the resolved baseline, canonical patch hash, and scope hash; identity-changing resume creates a new package instead of rewriting the old directory.
|
|
31
|
+
|
|
27
32
|
|
|
28
33
|
Run exactly these states in order:
|
|
29
34
|
|
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Load this reference when writing an inventory, execution, differential, resume, or replay request. Validate every authoritative record against `${SKILL_DIR}/assets/authoritative-records.schema.json`; the validator loads the named `$defs` for each file.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Canonical Lifecycle Ownership
|
|
6
|
+
|
|
7
|
+
Start every new package with `init`, then run builder-owned `capture-change` before semantic inventory. `capture-change` is the only producer of `source-change.patch`; it records tracked, untracked, deleted, renamed, and copied paths against the resolved baseline. The Main Agent must not create or edit the patch.
|
|
8
|
+
|
|
9
|
+
Use existing project-native tests first. A test plan must identify each test as `existing`, `added`, or `modified`; only the latter two may receive a `generated-tests/` snapshot. Existing tests are executed from their repository paths and do not need generated snapshots. `test-plan.json` is the sole authority for test IDs, and execution requests with unknown IDs are rejected by the builder.
|
|
10
|
+
|
|
11
|
+
`finalize` creates the manifest, stage dependency hashes, verdict, evidence identity, and deterministic report inputs. `render-report` only renders the derived Markdown view. The validator alone creates `validation.json` during `--attest`; never hand-author a validation attestation or rebind a finalized package after identity inputs change.
|
|
12
|
+
|
|
6
13
|
|
|
7
14
|
The model writes project-semantic requests after inspecting manifests, runner configuration, contracts, test conventions, changed files, and module boundaries. The bundled builder owns process execution, raw output, receipts, isolation, tree hashes, and invalidation calculations.
|
|
8
15
|
|
|
@@ -99,4 +99,4 @@ A comments-only diff is deterministically classified and parser/format/generated
|
|
|
99
99
|
|
|
100
100
|
## Compatibility Notice
|
|
101
101
|
|
|
102
|
-
The
|
|
102
|
+
The testing-domain verdict remains `TEST_PASS | TEST_FAIL | TEST_BLOCKED`. Consumers must use validated authoritative evidence and may use `test-report.md` only as a derived compatibility view. The formal lifecycle does not reinterpret a testing result as a review or commit verdict.
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Use this reference during `INFRA_READY`, `TEST_BUILD`, and `EXECUTE_PROVE`. The authoritative scope and completeness inputs are `scope.json`, `behavior-risk-matrix.json`, and `test-plan.json`.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Existing-Test-First Rule
|
|
6
|
+
|
|
7
|
+
Before creating a test, inspect the repository's native test files, runner configuration, and existing behavior assertions. Execute the smallest relevant existing tests first. Add or modify a repository-native test only when a concrete behavior gap is identified and recorded in the test plan. Mark each test `existing`, `added`, or `modified`; only `added` and `modified` tests are copied into `generated-tests/`. An unchanged existing test has no generated snapshot.
|
|
8
|
+
|
|
6
9
|
|
|
7
10
|
For `scope=this-change`, changed files locate the affected module; they do not restrict tests to changed lines. Fill observable behavior/risk gaps across the whole affected module and execute its Regression Ring. Unrelated modules remain out of scope unless they are direct callers, consumers, shared contracts, or state dependencies.
|
|
8
11
|
|
|
@@ -78,7 +78,7 @@ Verdict: TEST_PASS | TEST_FAIL | TEST_BLOCKED
|
|
|
78
78
|
- Real deployed environment validated: no
|
|
79
79
|
|
|
80
80
|
## Compatibility
|
|
81
|
-
The
|
|
81
|
+
The formal lifecycle consumes validated authoritative `TEST_*` evidence through workflow state and structured evidence pointers. `test-report.md` is a derived compatibility view and must not be interpreted as a review, retrospective, commit, or release verdict.
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
## Verdict Rendering Rules
|
|
@@ -41,6 +41,21 @@ Treat evidence as auditable project-controlled provenance, not a defense against
|
|
|
41
41
|
|
|
42
42
|
## Builder Commands
|
|
43
43
|
|
|
44
|
+
Drive a new package through the canonical lifecycle. Semantic request files remain model-authored; authoritative package records remain tool-owned:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
python3 ${SKILL_DIR}/scripts/build_test_evidence.py --project-root <root> --evidence-dir <staging> init --baseline <commit>
|
|
48
|
+
python3 ${SKILL_DIR}/scripts/build_test_evidence.py --project-root <root> --evidence-dir <staging> capture-change
|
|
49
|
+
python3 ${SKILL_DIR}/scripts/build_test_evidence.py --project-root <root> --evidence-dir <staging> inventory --request requests/inventory.json
|
|
50
|
+
python3 ${SKILL_DIR}/scripts/build_test_evidence.py --project-root <root> --evidence-dir <staging> execute --request requests/focused.json
|
|
51
|
+
python3 ${SKILL_DIR}/scripts/build_test_evidence.py --project-root <root> --evidence-dir <staging> differential --request requests/differential.json
|
|
52
|
+
python3 ${SKILL_DIR}/scripts/build_test_evidence.py --project-root <root> --evidence-dir <staging> finalize --request requests/finalize.json
|
|
53
|
+
python3 ${SKILL_DIR}/scripts/build_test_evidence.py --project-root <root> --evidence-dir <staging> render-report
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`capture-change` includes tracked modifications, untracked files, deletions, renames, and copies. `finalize` owns the manifest, verdict, stage hashes, evidence identity, and generated-test snapshots. The validator is the only producer of `validation.json`.
|
|
57
|
+
|
|
58
|
+
|
|
44
59
|
Write requests beneath the evidence directory, then invoke the bundled script:
|
|
45
60
|
|
|
46
61
|
```bash
|
|
@@ -0,0 +1,181 @@
|
|
|
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.
|