prizmkit 1.1.131 → 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.
Files changed (65) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/claude/command-adapter.js +0 -2
  3. package/bundled/dev-pipeline/assets/skill-subagent-integration.md +11 -6
  4. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +2 -9
  5. package/bundled/dev-pipeline/prizmkit_runtime/processes.py +21 -1
  6. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +104 -17
  7. package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +3 -2
  8. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +15 -13
  9. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +3 -13
  10. package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +5 -4
  11. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +1 -1
  12. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +4 -4
  13. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +9 -9
  14. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +4 -7
  15. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +3 -3
  16. package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +2 -2
  17. package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +5 -10
  18. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +5 -5
  19. package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +1 -1
  20. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +1 -1
  21. package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +2 -3
  22. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +2 -2
  23. package/bundled/dev-pipeline/templates/sections/phase-commit.md +2 -2
  24. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +5 -5
  25. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +5 -5
  26. package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +1 -1
  27. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +5 -5
  28. package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +1 -1
  29. package/bundled/dev-pipeline/templates/sections/subagent-timeout-recovery.md +1 -1
  30. package/bundled/dev-pipeline/templates/sections/task-contract.md +4 -0
  31. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +39 -26
  32. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +7 -10
  33. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +3 -3
  34. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +156 -5
  35. package/bundled/dev-pipeline/tests/test_unified_cli.py +34 -7
  36. package/bundled/skills/_metadata.json +3 -3
  37. package/bundled/skills/prizmkit/references/workflow-state-protocol.md +3 -3
  38. package/bundled/skills/prizmkit-code-review/SKILL.md +22 -6
  39. package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +243 -0
  40. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +41 -0
  41. package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +3 -3
  42. package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +93 -1
  43. package/bundled/skills/prizmkit-committer/SKILL.md +6 -13
  44. package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +3 -3
  45. package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +3 -3
  46. package/bundled/skills/prizmkit-plan/SKILL.md +17 -3
  47. package/bundled/skills/prizmkit-plan/assets/plan-template.md +18 -0
  48. package/bundled/skills/prizmkit-plan/references/independent-plan-review.md +242 -0
  49. package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +4 -4
  50. package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +3 -3
  51. package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +3 -3
  52. package/bundled/skills/prizmkit-test/SKILL.md +25 -1
  53. package/bundled/skills/prizmkit-test/assets/authoritative-records.schema.json +63 -12
  54. package/bundled/skills/prizmkit-test/assets/evidence-manifest.schema.json +1 -1
  55. package/bundled/skills/prizmkit-test/assets/evidence-package-template.json +13 -0
  56. package/bundled/skills/prizmkit-test/references/evidence-protocol.md +6 -1
  57. package/bundled/skills/prizmkit-test/references/evidence-request-protocol.md +8 -1
  58. package/bundled/skills/prizmkit-test/references/test-generation-steps.md +4 -1
  59. package/bundled/skills/prizmkit-test/references/trusted-evidence-execution.md +15 -0
  60. package/bundled/skills/prizmkit-test/references/workflow-state-protocol.md +3 -3
  61. package/bundled/skills/prizmkit-test/scripts/build_test_evidence.py +744 -23
  62. package/bundled/skills/prizmkit-test/scripts/validate_test_evidence.py +194 -15
  63. package/bundled/skills/prizmkit-workflow/SKILL.md +1 -1
  64. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +3 -3
  65. package/package.json +1 -1
@@ -15,7 +15,31 @@ 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
- ## Formal Lifecycle Position
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
+
19
43
 
20
44
  For a formal requirement, `/prizmkit-test` runs after the Main-Agent code-review stage reaches `PASS` and before retrospective:
21
45
 
@@ -183,12 +183,33 @@
183
183
  }
184
184
  },
185
185
  "changed_files": { "$ref": "#/$defs/stringArray" },
186
- "module_roots": { "$ref": "#/$defs/stringArray" },
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": { "$ref": "#/$defs/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": ["request_version", "behavior_id", "method", "execution_request", "baseline_commit", "current_tree_sha256", "mutation_patch_path", "test_overlay_paths", "expected_failure_signals"],
348
+ "required": ["reason", "rationale", "evidence", "considered_signals", "conflicts"],
295
349
  "properties": {
296
- "request_version": { "const": "1.0" },
297
- "behavior_id": { "type": "string", "minLength": 1 },
298
- "method": { "enum": ["baseline", "controlled-mutation"] },
299
- "execution_request": { "$ref": "#/$defs/executionRequest" },
300
- "baseline_commit": { "type": "string", "minLength": 1 },
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
  }
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "files": {
58
58
  "type": "array",
59
- "minItems": 10,
59
+ "minItems": 1,
60
60
  "items": { "$ref": "#/$defs/file" }
61
61
  },
62
62
  "final_verdict": { "enum": ["TEST_PASS", "TEST_FAIL", "TEST_BLOCKED"] },
@@ -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
- ## Ordered State Machine
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
- ## Request Ownership
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
 
@@ -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
- ## Scope Guard
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
 
@@ -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
@@ -157,12 +157,12 @@ Trusted headless execution:
157
157
  ```text
158
158
  a trusted host explicitly authorizes the current local task commit
159
159
  → host injects mode=<host-defined-headless-mode>, owner=<trusted-host-identifier>,
160
- local_commit_authorized=true, push_authorized=false
160
+ local_commit_authorized=true
161
161
  → committer verifies gates and commits automatically
162
- → no question, wait, or push is permitted
162
+ → no question or wait is permitted
163
163
  ```
164
164
 
165
- A self-declared or otherwise untrusted headless context does not authorize a commit. Push is never implied by either mode.
165
+ A self-declared or otherwise untrusted headless context does not authorize a commit. Remote publication remains a separate host-runtime decision.
166
166
 
167
167
  ## Recovery
168
168