prizmkit 1.1.120 → 1.1.121

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 (45) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +23 -25
  3. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +8 -2
  4. package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +10 -1
  5. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +43 -29
  6. package/bundled/dev-pipeline/scripts/continuation.py +51 -6
  7. package/bundled/dev-pipeline/scripts/update-bug-status.py +57 -14
  8. package/bundled/dev-pipeline/scripts/update-feature-status.py +54 -5
  9. package/bundled/dev-pipeline/scripts/update-refactor-status.py +57 -14
  10. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +2 -2
  11. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +2 -1
  12. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +2 -2
  13. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +3 -3
  14. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +3 -3
  15. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +4 -4
  16. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +3 -3
  17. package/bundled/dev-pipeline/tests/test_auto_skip.py +5 -5
  18. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +10 -3
  19. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +9 -2
  20. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +9 -1
  21. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +222 -18
  22. package/bundled/dev-pipeline/tests/test_unified_cli.py +14 -10
  23. package/bundled/skills/_metadata.json +4 -4
  24. package/bundled/skills/prizmkit-code-review/SKILL.md +49 -48
  25. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +13 -8
  26. package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +46 -32
  27. package/bundled/skills/prizmkit-code-review/references/reviewer-workspace-protocol.md +90 -0
  28. package/bundled/skills/prizmkit-test/SKILL.md +159 -155
  29. package/bundled/skills/prizmkit-test/assets/authoritative-records.schema.json +420 -0
  30. package/bundled/skills/prizmkit-test/assets/behavior-risk-matrix.schema.json +116 -0
  31. package/bundled/skills/prizmkit-test/assets/evidence-manifest.schema.json +112 -0
  32. package/bundled/skills/prizmkit-test/assets/evidence-package-template.json +97 -0
  33. package/bundled/skills/prizmkit-test/references/boundary-coverage-protocol.md +76 -192
  34. package/bundled/skills/prizmkit-test/references/contract-mock-protocol.md +65 -0
  35. package/bundled/skills/prizmkit-test/references/evidence-protocol.md +194 -0
  36. package/bundled/skills/prizmkit-test/references/evidence-request-protocol.md +78 -0
  37. package/bundled/skills/prizmkit-test/references/examples.md +65 -108
  38. package/bundled/skills/prizmkit-test/references/service-boundary-test-catalog.md +10 -7
  39. package/bundled/skills/prizmkit-test/references/test-generation-steps.md +90 -82
  40. package/bundled/skills/prizmkit-test/references/test-report-template.md +77 -98
  41. package/bundled/skills/prizmkit-test/references/trusted-evidence-execution.md +97 -0
  42. package/bundled/skills/prizmkit-test/scripts/build_test_evidence.py +723 -0
  43. package/bundled/skills/prizmkit-test/scripts/validate_test_evidence.py +1426 -0
  44. package/package.json +1 -1
  45. package/bundled/skills/prizmkit-test/scripts/validate_boundary_report.py +0 -347
@@ -1,13 +1,16 @@
1
1
  # Review Report Output Template
2
2
 
3
- Used in Phase 2 of `/prizmkit-code-review`. Always write `review-report.md` to the artifact directory using this format.
3
+ Used in Phase 2 of `/prizmkit-code-review`. Write `review-report.md` to the artifact directory using this format.
4
4
 
5
5
  ```markdown
6
6
  # Review Report
7
7
 
8
8
  ## Verdict: <PASS|NEEDS_FIXES>
9
- ## Review Mode: <reviewer-agent-active-checkout|not-run-no-changes>
10
- ## Rounds: <number of review rounds completed; use 0 for no-change PASS>
9
+ ## Review Mode: <independent-reviewer-verified-snapshot|not-run-no-changes>
10
+ ## Reviewer Strategy: <platform-selected strategy summary|not-applicable>
11
+ ## Snapshot Verification: <VERIFIED|FAILED|NOT_APPLICABLE>
12
+ ## Snapshot Identity: <manifest identity or failure reason>
13
+ ## Rounds: <number of completed review rounds; use 0 for no-change PASS or pre-review snapshot failure>
11
14
  ## Total findings: <total> → Fixed: <fixed>, Rejected: <rejected>, Unresolved: <unresolved>
12
15
 
13
16
  ## Round <N>
@@ -15,18 +18,20 @@ Findings: <count> | Accepted: <count>, Rejected: <count>
15
18
 
16
19
  ### Finding <N>: <short title>
17
20
  - Severity: <high|medium|low>
18
- - Dimension: <goal-alignment|defect|completeness|consistency|security|rules-compliance>
21
+ - Dimension: <goal-alignment|defect|completeness|consistency|security|test-quality|rules-compliance>
19
22
  - Location: <filepath:line or project-level>
20
23
  - Problem: <what was wrong and why it mattered>
21
24
  - Status: <fixed (round N)|rejected — reason|unresolved — reason>
22
25
 
23
26
  ## Final Summary
24
- <One to three sentences summarizing the review outcome, including no-change PASS when applicable.>
27
+ <One to three sentences summarizing the review outcome, snapshot verification, and any remaining blocker.>
25
28
  ```
26
29
 
27
- For `PASS` with no findings, write `Total findings: 0 → Fixed: 0, Rejected: 0, Unresolved: 0` and `## Round 0: PASS — no workspace changes to review` or `## Round N: PASS — no issues found`.
30
+ For `PASS` with no findings, write `Total findings: 0 → Fixed: 0, Rejected: 0, Unresolved: 0` and either `## Round 0: PASS — no workspace changes to review` or `## Round N: PASS — no issues found`.
31
+
32
+ For snapshot verification failure, use verdict `NEEDS_FIXES`, snapshot verification `FAILED`, and record the mismatch as an unresolved review blocker rather than an ordinary code finding.
28
33
 
29
34
  ## Verdict Rules
30
35
 
31
- - `PASS`: Reviewer returned no findings, no workspace changes existed, or all remaining findings were rejected as unreasonable.
32
- - `NEEDS_FIXES`: Max rounds completed but accepted findings remain unresolved.
36
+ - `PASS`: Reviewer returned no findings from a verified snapshot, no workspace changes existed, or all findings from a verified snapshot were rejected as unreasonable.
37
+ - `NEEDS_FIXES`: Max rounds completed with accepted findings unresolved, or no independent Reviewer could verify an equivalent current snapshot.
@@ -1,9 +1,9 @@
1
1
  # Reviewer Subagent Prompt Template
2
2
 
3
- Used in Phase 1 Step 1 of `/prizmkit-code-review`. The orchestrator fills `{goals}`, `{plan decisions}`, `{scoped test report}`, `{workspace context}`, `{dev rules}`, `{round N}`, and `{round_context}` before spawning an independent inline reviewer subagent from the active checkout.
3
+ Used in Phase 1 Step 1 of `/prizmkit-code-review`. The orchestrator fills the placeholders before spawning an independent read-only Reviewer under `${SKILL_DIR}/references/reviewer-workspace-protocol.md`.
4
4
 
5
5
  ```
6
- You are an independent PrizmKit reviewer subagent launched by `/prizmkit-code-review` from the active checkout. Review workspace changes against the spec goals, plan decisions, scoped test evidence, and per-layer dev rules. Do not modify files and do not apply fixes; the Main Agent will filter findings and apply accepted fixes directly.
6
+ You are the independent read-only Reviewer for `/prizmkit-code-review`. Review the verified workspace snapshot against the spec goals, plan decisions, scoped test evidence, and dev rules. Do not modify files or apply fixes; the Main Agent will filter findings and apply accepted fixes.
7
7
 
8
8
  ## Spec Goals
9
9
  {goals and acceptance criteria from spec.md}
@@ -12,53 +12,67 @@ You are an independent PrizmKit reviewer subagent launched by `/prizmkit-code-re
12
12
  {architecture decisions and task list from plan.md}
13
13
 
14
14
  ## Scoped Test Report
15
- {summary from artifact_dir/test-report-path.txt and test-report.md, including Scope, Generated / Updated Tests, In-Scope Failures, Baseline Failures, Out of Scope Gaps, Boundary Matrix / Boundary Completion Gate if present, and Verdict. If no scoped report exists for a change artifact, write "No scoped /prizmkit-test report found (expected for pre-test review)." Treat that absence as informational unless the calling workflow explicitly requires a prior test report.}
15
+ {summary from artifact_dir/test-report-path.txt and test-report.md, including Scope, Generated / Updated Tests, In-Scope Failures, Baseline Failures, Out of Scope Gaps, Boundary Matrix / Boundary Completion Gate if present, and Verdict. If no scoped report exists, write "No scoped /prizmkit-test report found (expected for pre-test review)." Treat that absence as informational unless the calling workflow requires a prior report.}
16
16
 
17
- ## Workspace Context
18
- {git status, unstaged diff summary, staged diff summary, current working directory, expected active checkout git top-level, and new-file paths captured by the Main Agent in Phase 0 from the active checkout. This is your primary review scope — use this context to understand what changed. Request targeted file reads only when you need specific line-level detail for a finding, not to re-discover or re-index the repository. Do not read files that are not in the workspace context unless you need them to verify impact (callers, dependents, shared patterns).}
17
+ ## Workspace Manifest
18
+ {repository and baseline identity, review-round identity, changed path inventory and statuses, staged/unstaged composition, untracked content entries, delete markers, rename pairs, and stable content identities captured by the Main Agent}
19
19
 
20
- ## Active Checkout Guard
21
- The orchestrator must provide the expected active checkout git top-level in Workspace Context. Before reviewing, verify that your current git top-level matches that expected active checkout.
20
+ ## Review Payload
21
+ {the reviewable representation of every manifest entry, plus clearly identified unchanged context needed to evaluate callers, dependents, or shared patterns}
22
22
 
23
- If your current checkout is different, or appears to be under `.claude/worktrees/`, `.prizmkit/state/worktrees/`, a copied checkout, a remote isolated checkout, a temporary repository clone, or any branch/top-level other than the orchestrator-provided active checkout:
24
- - Stop immediately.
25
- - Do not review files.
26
- - Do not produce normal findings.
27
- - Report `WRONG_CHECKOUT` and state that `/prizmkit-code-review` cannot continue because the reviewer subagent was not started in the active checkout/no-worktree mode required by this skill.
23
+ ## Reviewer Strategy
24
+ {concise description of how the current platform made the snapshot available. This is diagnostic context, not a required parameter contract.}
28
25
 
29
- Worktree, copied-checkout, remote-checkout, and branch-switched review are not supported by `/prizmkit-code-review`; do not continue even if the files appear similar. Do not request or create worktrees, copied repositories, branch switches, or remote checkouts.
26
+ ## Workspace Equivalence Guard
27
+ Validate the supplied manifest and payload according to the Reviewer Workspace Protocol before normal review:
28
+ - Every manifest path and state must be represented.
29
+ - Staged, unstaged, untracked, deleted, and renamed changes must not be silently lost.
30
+ - Changed content identities and review-round identity must match.
31
+ - Unexplained changed paths, stale content, or unverifiable entries are mismatches.
30
32
 
31
- ## Dev Rules (per-layer conventions)
33
+ Do not reject a snapshot merely because its physical path, checkout layout, branch label, host, or transport differs from the Main Agent's environment. Content equivalence is the invariant.
34
+
35
+ If equivalence cannot be proven:
36
+ - Stop before normal review.
37
+ - Do not produce ordinary findings.
38
+ - Return `WORKSPACE_MISMATCH` with concrete mismatch evidence and required corrective action.
39
+
40
+ ## Dev Rules
32
41
  {rules from .prizmkit/rules/<layer>-rules.md, or "No custom dev rules configured — use general best practices."}
33
42
 
34
43
  ## Review Round
35
44
  Round {N}. {round_context}
36
45
 
37
46
  ## What to Review
38
- Use the orchestrator-provided workspace context as the source of truth for changed files:
39
- - For new files listed in workspace status, read their full content.
40
- - For modified files, read enough surrounding context to understand the change.
41
- - Do not edit files, stage changes, run test suites, spawn other agents, or invoke tools that modify the workspace.
42
- - Do not request or create worktrees — you are reviewing the active checkout's changes. The orchestrator has already captured the full diff and status context; re-discovering the whole repository is wasteful and unnecessary.
47
+ Use the verified workspace snapshot as the primary review scope:
48
+ - Read the full content of new files.
49
+ - For modified files, read enough surrounding context to understand behavior and impact.
50
+ - Read unchanged callers, dependents, or shared patterns only when needed to verify a potential finding.
51
+ - Do not edit files, stage changes, run tools that modify the review view, spawn other agents, or apply fixes.
52
+ - Do not broadly re-index the repository when the supplied snapshot and targeted reads are sufficient.
43
53
 
44
54
  ## Review Dimensions
45
- Evaluate the changes across these dimensions (focus on what's relevant):
55
+ Evaluate the relevant dimensions:
46
56
 
47
- 1. **Goal alignment**: Do the changes accomplish all goals from spec.md? Anything missing or off-target?
48
- 2. **Defects**: Logic bugs, missing error handling, boundary condition issues, incorrect behavior.
49
- 3. **Completeness**: Files that should have been changed but weren't? Missing tests, types, imports, exports?
50
- 4. **Consistency**: Do changes follow the project's existing patterns, naming conventions, and code style?
51
- 5. **Security**: Hardcoded secrets, injection vulnerabilities, unsafe operations.
52
- 6. **Test quality**: If a scoped `/prizmkit-test` report is present, verify the report scope is `this-change`, the artifact dir matches the reviewed change, generated/updated tests assert real behavior rather than mock success or empty assertions, in-scope failures are not mislabeled as baseline failures, baseline failures are genuinely unrelated or pre-existing, out-of-scope gaps were not turned into unrelated test changes, and the report verdict is compatible with proceeding.
53
- 7. **Rules compliance**: (Skip this dimension if no dev rules were provided.) Do changes follow the per-layer dev rules? Flag violations of framework conventions, naming patterns, state management, or other rules defined for that layer.
57
+ 1. **Goal alignment**: Do the changes accomplish the spec goals and acceptance criteria?
58
+ 2. **Defects**: Are there logic bugs, boundary failures, or missing error handling?
59
+ 3. **Completeness**: Are required files, tests, types, imports, or exports missing?
60
+ 4. **Consistency**: Do the changes follow existing project patterns, naming, and style?
61
+ 5. **Security**: Do the changes introduce secrets, injection paths, or unsafe operations?
62
+ 6. **Test quality**: When a scoped report exists, verify its scope and artifact identity, meaningful assertions, failure classification, boundary evidence, and verdict compatibility.
63
+ 7. **Rules compliance**: When dev rules exist, verify the relevant layer conventions.
54
64
 
55
65
  ## Output Format
56
- Respond with EXACTLY this format:
66
+ Respond with exactly this structure:
67
+
68
+ ### Result: PASS | NEEDS_FIXES | WORKSPACE_MISMATCH
57
69
 
58
- ### Result: PASS | NEEDS_FIXES | WRONG_CHECKOUT
70
+ ### Snapshot Verification
71
+ - Status: VERIFIED | FAILED
72
+ - Identity: <manifest identity or mismatch summary>
59
73
 
60
74
  ### Findings
61
- (If PASS, write "No issues found." If WRONG_CHECKOUT, include only checkout mismatch evidence and do not include normal review findings.)
75
+ (If PASS, write "No issues found." If WORKSPACE_MISMATCH, include only mismatch evidence and required action.)
62
76
 
63
77
  #### Finding N
64
78
  - **Severity**: high | medium | low
@@ -69,10 +83,10 @@ Respond with EXACTLY this format:
69
83
  - **Verification**: How to confirm the fix is correct
70
84
 
71
85
  ### Summary
72
- One to two sentences about the overall state of the changes.
86
+ One to two sentences about the snapshot and overall state of the changes.
73
87
  ```
74
88
 
75
89
  ## Round Context
76
90
 
77
91
  - Round 1: "This is the first review. Examine all changes comprehensively."
78
- - Round 2+: "Previous round found issues that were fixed. Focus on: (1) whether previous fixes are correct, (2) whether fixes introduced new problems, (3) any remaining issues. Do not re-report issues that have already been fixed."
92
+ - Round 2+: "Previous findings were filtered and accepted fixes were applied. Verify those fixes, check for regressions, and identify remaining issues without re-reporting resolved findings."
@@ -0,0 +1,90 @@
1
+ # Reviewer Workspace Protocol
2
+
3
+ Use this protocol whenever `/prizmkit-code-review` delegates review to an independent Reviewer. The protocol defines observable guarantees, not Agent API parameters, so the Main Agent can adapt to the capabilities of the current platform.
4
+
5
+ ## Protocol Invariants
6
+
7
+ 1. **Independence**: A subagent separate from the Main Agent performs review judgment. The Main Agent may prepare the snapshot, filter findings, and apply fixes, but does not substitute its own review when delegation fails.
8
+ 2. **Completeness**: The review snapshot represents every in-scope staged, unstaged, untracked, deleted, and renamed change captured for the round.
9
+ 3. **Currency**: Each review round uses a snapshot captured after the previous round's fixes. Never reuse a prior-round snapshot as evidence of current state.
10
+ 4. **Equivalence**: The Reviewer's view must be content-equivalent to the captured Main-Agent workspace. Physical path, checkout layout, branch label, host, and transport may differ without violating equivalence.
11
+ 5. **Verifiability**: The Reviewer validates the supplied manifest before normal review. Missing, extra, stale, or mixed content produces `WORKSPACE_MISMATCH`, not code findings.
12
+ 6. **Read-only review**: The Reviewer does not modify files or apply fixes. This keeps review evidence stable and preserves clear fix ownership.
13
+
14
+ ## Strategy Selection
15
+
16
+ Choose a platform-supported strategy that can satisfy all protocol invariants. The strategy may use a shared workspace, an isolated workspace populated with the captured change, a remote environment supplied with equivalent content, a materialized snapshot, or another mechanism the platform supports.
17
+
18
+ Do not encode a particular Agent type, model, isolation value, branch convention, directory prefix, or transport command into the skill contract. Those details are implementation choices and may change across platforms or sessions.
19
+
20
+ Prefer the least elaborate strategy that can prove equivalence. If a candidate strategy cannot carry or expose all workspace states, choose another strategy rather than weakening the protocol.
21
+
22
+ ## Workspace Manifest
23
+
24
+ Create a manifest for each round containing enough information to detect an incomplete or stale review view:
25
+
26
+ - repository identity and baseline revision
27
+ - round number or equivalent monotonic round identity
28
+ - changed path inventory and each path's status
29
+ - staged and unstaged composition when both exist for a path
30
+ - untracked file content required for review
31
+ - deleted-path markers
32
+ - rename source and destination pairs
33
+ - stable content identities for changed content and any review-critical context
34
+ - relevant spec, plan, dev-rule, and scoped-test evidence identities or embedded content
35
+
36
+ The exact encoding is implementation-defined. Use hashes when available, but another deterministic content identity is acceptable when the environment lacks a hashing utility. A prose summary alone is insufficient when it cannot detect omitted or stale content.
37
+
38
+ ## Review Payload
39
+
40
+ Provide the Reviewer with both:
41
+
42
+ 1. The manifest used for verification.
43
+ 2. A reviewable representation of every manifest entry.
44
+
45
+ A reviewable representation may be workspace files, complete file content, patches plus required base content, or an equivalent materialization. Diff summaries alone are insufficient for new files or when surrounding code is necessary to evaluate behavior.
46
+
47
+ Supply targeted dependency or caller context when required to verify impact. Keep that context distinguishable from changed content so the Reviewer does not mistake unchanged files for part of the patch.
48
+
49
+ ## Reviewer Verification
50
+
51
+ Before normal review, the Reviewer checks:
52
+
53
+ 1. Repository and baseline identity are consistent with the supplied snapshot.
54
+ 2. Every changed path in the manifest is available in the review payload.
55
+ 3. No unexplained changed path appears outside the manifest.
56
+ 4. Staged, unstaged, untracked, deleted, and renamed states are represented without silent loss.
57
+ 5. Content identities match the manifest.
58
+ 6. The snapshot belongs to the current review round.
59
+
60
+ When all checks pass, report snapshot verification as `VERIFIED` and proceed with review.
61
+
62
+ When a check cannot be completed or fails, stop normal review and return:
63
+
64
+ ```text
65
+ ### Result: WORKSPACE_MISMATCH
66
+
67
+ ### Snapshot Verification
68
+ - Status: FAILED
69
+ - Mismatch: <missing, extra, stale, or unverifiable manifest entries>
70
+ - Required action: <what the Main Agent must re-capture, transport, or verify>
71
+ ```
72
+
73
+ Do not emit ordinary code findings after `WORKSPACE_MISMATCH`, because findings from an unverified snapshot could misrepresent the current change.
74
+
75
+ ## Round Refresh
76
+
77
+ After accepted fixes are applied:
78
+
79
+ 1. Discard the previous manifest as current evidence.
80
+ 2. Capture a new manifest and review payload from the Main Agent's updated workspace.
81
+ 3. Establish a fresh independent Reviewer view using any valid strategy.
82
+ 4. Repeat Reviewer verification before the next review.
83
+
84
+ A platform may reuse an existing Reviewer session only when the refreshed payload replaces stale state and equivalence is verified again.
85
+
86
+ ## Failure Boundary
87
+
88
+ Retry or change strategy when the mismatch is repairable. Stop when the platform cannot provide an independent Reviewer with a verifiable equivalent snapshot.
89
+
90
+ Record the failure as an unresolved review blocker with verdict `NEEDS_FIXES`, snapshot verification `FAILED`, and the mismatch evidence. Do not downgrade to Main-Agent self-review, because doing so would satisfy neither the independence invariant nor the user's expectation of an independent quality gate.