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.
Files changed (83) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/dev-pipeline/README.md +1 -1
  3. package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +165 -125
  4. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +13 -1
  5. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +0 -6
  6. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +5 -3
  7. package/bundled/dev-pipeline/prizmkit_runtime/test_result.py +160 -0
  8. package/bundled/dev-pipeline/scripts/check-session-status.py +11 -1
  9. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +23 -806
  10. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +6 -8
  11. package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +1 -1
  12. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +6 -8
  13. package/bundled/dev-pipeline/scripts/prompt_framework.py +68 -56
  14. package/bundled/dev-pipeline/scripts/update-bug-status.py +21 -2
  15. package/bundled/dev-pipeline/scripts/update-checkpoint.py +52 -131
  16. package/bundled/dev-pipeline/scripts/update-feature-status.py +21 -2
  17. package/bundled/dev-pipeline/scripts/update-refactor-status.py +21 -2
  18. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +3 -3
  19. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +8 -19
  20. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +6 -6
  21. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +5 -5
  22. package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +1 -1
  23. package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +1 -1
  24. package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +1 -1
  25. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +1 -1
  26. package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +13 -10
  27. package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +1 -1
  28. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +18 -9
  29. package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +1 -1
  30. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +1 -1
  31. package/bundled/dev-pipeline/templates/sections/phase-commit.md +1 -1
  32. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +2 -2
  33. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-base.md +1 -1
  34. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-lite-suffix.md +1 -1
  35. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +1 -1
  36. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +14 -26
  37. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +2 -2
  38. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +3 -3
  39. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +1 -1
  40. package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +13 -10
  41. package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +1 -1
  42. package/bundled/dev-pipeline/templates/session-status-schema.json +1 -1
  43. package/bundled/dev-pipeline/tests/test_checkpoint_state.py +494 -413
  44. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +144 -684
  45. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +20 -41
  46. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +24 -24
  47. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +176 -36
  48. package/bundled/skills/_metadata.json +6 -6
  49. package/bundled/skills/prizmkit/SKILL.md +13 -18
  50. package/bundled/skills/prizmkit/references/workflow-state-protocol.md +73 -80
  51. package/bundled/skills/prizmkit-code-review/SKILL.md +7 -7
  52. package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +73 -80
  53. package/bundled/skills/prizmkit-committer/SKILL.md +8 -7
  54. package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +73 -80
  55. package/bundled/skills/prizmkit-implement/SKILL.md +3 -2
  56. package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +73 -80
  57. package/bundled/skills/prizmkit-plan/SKILL.md +2 -1
  58. package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +73 -80
  59. package/bundled/skills/prizmkit-retrospective/SKILL.md +8 -6
  60. package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +73 -80
  61. package/bundled/skills/prizmkit-test/SKILL.md +217 -189
  62. package/bundled/skills/prizmkit-test/references/external-contract-mock-guidance.md +119 -0
  63. package/bundled/skills/prizmkit-test/references/independent-test-review.md +269 -0
  64. package/bundled/skills/prizmkit-test/references/test-coverage-model.md +193 -0
  65. package/bundled/skills/prizmkit-test/references/test-report-template.md +164 -79
  66. package/bundled/skills/prizmkit-workflow/SKILL.md +28 -36
  67. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +73 -80
  68. package/package.json +1 -1
  69. package/bundled/skills/prizmkit-test/assets/authoritative-records.schema.json +0 -477
  70. package/bundled/skills/prizmkit-test/assets/behavior-risk-matrix.schema.json +0 -116
  71. package/bundled/skills/prizmkit-test/assets/evidence-manifest.schema.json +0 -111
  72. package/bundled/skills/prizmkit-test/assets/evidence-package-template.json +0 -66
  73. package/bundled/skills/prizmkit-test/references/boundary-coverage-protocol.md +0 -104
  74. package/bundled/skills/prizmkit-test/references/contract-mock-protocol.md +0 -65
  75. package/bundled/skills/prizmkit-test/references/evidence-protocol.md +0 -208
  76. package/bundled/skills/prizmkit-test/references/evidence-request-protocol.md +0 -80
  77. package/bundled/skills/prizmkit-test/references/examples.md +0 -100
  78. package/bundled/skills/prizmkit-test/references/service-boundary-test-catalog.md +0 -228
  79. package/bundled/skills/prizmkit-test/references/test-generation-steps.md +0 -118
  80. package/bundled/skills/prizmkit-test/references/trusted-evidence-execution.md +0 -107
  81. package/bundled/skills/prizmkit-test/references/workflow-state-protocol.md +0 -181
  82. package/bundled/skills/prizmkit-test/scripts/build_test_evidence.py +0 -1930
  83. package/bundled/skills/prizmkit-test/scripts/validate_test_evidence.py +0 -1847
@@ -1,6 +1,6 @@
1
1
  ### Phase 4: Commit & Learn
2
2
 
3
- This phase follows successful automated, manual, or hybrid verification and runs only after the authoritative test gate permits commit.
3
+ This phase follows successful automated, manual, or hybrid verification and runs only after a valid `TEST_PASS` report/result pair permits commit.
4
4
 
5
5
  **Bug Fix Documentation Policy**:
6
6
  - Default: run `/prizmkit-retrospective` with structural sync only.
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Goal**: prove or strongly establish the root cause before editing code.
4
4
 
5
- 1. Read `.prizmkit/prizm-docs/root.prizm`, then only the relevant L1/L2 docs for affected modules.
5
+ 1. Read `.prizmkit/prizm-docs/root.prizm`, then only the relevant module indexes and detail docs for affected modules.
6
6
  2. Trace from the error source to the likely root cause:
7
7
  - classify error type;
8
8
  - inspect relevant TRAPS/RULES;
@@ -2,7 +2,7 @@
2
2
 
3
3
  `verification_type` is `{{VERIFICATION_TYPE}}`.
4
4
 
5
- L4 is always headless and must complete manual/hybrid verification automatically. Do not ask for a user, wait for UAT, or stop as `partial`.
5
+ The pipeline session is always headless and must complete manual/hybrid verification automatically. Do not ask for a user, wait for UAT, or stop as `partial`.
6
6
 
7
7
  1. Select the available non-interactive verification path: browser tooling, CLI/API checks, fixtures, project test commands, or another deterministic local check.
8
8
  2. Cover the reported behavior and acceptance criteria; for browser-visible behavior, capture both the original reproduction and post-fix result when the configured tooling is available.
@@ -16,4 +16,4 @@ Missing required evidence, an unsafe repair, a failed verification, or failure t
16
16
  - `REVIEW_NEEDS_FIXES` → route through bounded implementation/review/test repair; do not commit.
17
17
  - `REVIEW_INCOMPLETE` or `REVIEW_INVALID` → inspect progress once, write `failure-log.md`, and stop. Do not accept old or incidental verdict text and do not synthesize a passing result outside the skill.
18
18
 
19
- **Checkpoint update**: Set step `prizmkit-code-review` to `completed` with `stage_result=REVIEW_PASS` only for an accepted valid Final Result.
19
+ **Checkpoint update**: Set step `prizmkit-code-review` to `completed` with `stage_result=REVIEW_PASS` only for an accepted valid Final Result. Set it to `failed` with `stage_result=REVIEW_NEEDS_FIXES` when the review returns known unresolved findings.
@@ -1,21 +1,24 @@
1
1
  ### Bugfix Test Gate — PrizmKit Test
2
2
 
3
- After Main-Agent code review returns a valid `PASS`, run the mandatory post-review test stage against the same Bugfix artifact root. Implementation and review completion alone can never classify the task complete.
3
+ After Main-Agent Code Review returns `PASS`, run the mandatory test stage against the same Bugfix artifact root:
4
4
 
5
5
  ```text
6
6
  /prizmkit-test scope=this-change artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/
7
7
  ```
8
8
 
9
- Read the current structured evidence package under `.prizmkit/test/evidence/<evidence-id>/`: `manifest.json`, `verdict.json`, and `validation.json`. A derived Markdown report is not completion authority. Confirm scope, hashes, final verdict, and validator result before accepting `TEST_PASS`.
9
+ Consume the sibling terminal artifacts:
10
10
 
11
- Gate outcomes and authoritative routing:
11
+ - `.prizmkit/bugfix/{{BUG_ID}}/test-report.md`
12
+ - `.prizmkit/bugfix/{{BUG_ID}}/test-result.json`
12
13
 
13
- - `TEST_PASS`: update the checkpoint handoff and continue to retrospective.
14
- - `TEST_FAIL` with `repair_scope=test-infrastructure`: return to `/prizmkit-implement`, then return directly to this test gate; do not make speculative production edits.
15
- - `TEST_FAIL` with `repair_scope=production|runtime|schema|dependency|public-interface`: return to implementation, obtain a fresh code-review result, then return to this test gate.
16
- - `TEST_FAIL` with an unknown or missing `repair_scope`: record `WORKFLOW_BLOCKED` and leave a safe checkpoint at the test stage; do not guess a production edit.
17
- - `TEST_BLOCKED`: preserve all evidence and artifacts, perform only bounded automatic environment recovery, then terminate as `WORKFLOW_BLOCKED` with `blocked_reason=test_blocked`. Never edit production speculatively and never ask the user.
14
+ They must agree on the testing result and unresolved items. Do not require an evidence package, manifest, hashes, attestation, or test-internal checkpoint.
18
15
 
19
- The `repair_round` counter is shared with review failures and may not exceed three outer rounds. At the limit, leave a truthful blocked terminal result. Internal code-review convergence has its separate ten-round limit.
16
+ Gate outcomes:
20
17
 
21
- **Checkpoint update**: Only a validated structured `TEST_PASS` may complete `prizmkit-test` with `stage_result=TEST_PASS` plus `manifest`, `verdict`, and `validation` evidence paths, then proceed to retrospective.
18
+ - `TEST_PASS`: mark the test checkpoint step completed and continue to retrospective.
19
+ - `TEST_NEEDS_FIXES`: preserve the report/result and stop truthfully. A high-risk production repair reports `review_required=true` and `review_scope=delta`; the caller owns any review-and-retest route.
20
+ - `TEST_BLOCKED`: preserve the report/result and blocker, then record terminal `WORKFLOW_BLOCKED`. Do not reinterpret the result as a runtime crash or make speculative production edits.
21
+
22
+ The skill itself diagnoses and repairs valid execution failures for at most three rounds before returning. The caller must not recreate that repair loop or maintain test-internal state.
23
+
24
+ **Checkpoint update**: Only `TEST_PASS` plus `test-report.md` and `test-result.json` completes `prizmkit-test` and allows retrospective.
@@ -1,6 +1,6 @@
1
1
  ## Reminders
2
2
 
3
- - Use L1 skills: `/prizmkit-plan`, `/prizmkit-implement`, `/prizmkit-code-review`, `/prizmkit-retrospective`, `/prizmkit-committer`.
3
+ - Use the atomic skills: `/prizmkit-plan`, `/prizmkit-implement`, `/prizmkit-code-review`, `/prizmkit-retrospective`, `/prizmkit-committer`.
4
4
  - All bugfix skills use `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`.
5
5
  - The first plan task must prove the bug with a reproduction test when feasible.
6
6
  - Commit with `fix(<scope>):`, not `feat:`.
@@ -1,6 +1,6 @@
1
1
  ## Workflow Checkpoint System
2
2
 
3
- A checkpoint file tracks this task family's L4 execution. It is not the L1 workflow-state record.
3
+ A checkpoint file tracks this task family's pipeline execution. It is not a skill result or a replacement for skill-owned reports.
4
4
 
5
5
  **Path**: `{{CHECKPOINT_PATH}}`
6
6
 
@@ -13,20 +13,29 @@ Use this helper to update checkpoint status. Do not hand-edit `workflow-checkpoi
13
13
  --checkpoint-path {{CHECKPOINT_PATH}} \
14
14
  --step <step-id-or-skill-name> \
15
15
  --status <in_progress|completed|failed|skipped> \
16
+ --stage-result <optional-domain-result> \
16
17
  --note "<optional note>"
17
18
  ```
18
19
 
19
20
  - Use the step `skill` value such as `prizmkit-implement`, or the step id such as `S04`.
21
+ - Omit `--stage-result` for stages without a domain result.
22
+ - Complete `prizmkit-plan` with `--status completed --stage-result PLAN_READY`.
23
+ - Complete `prizmkit-implement` with `--status completed --stage-result IMPLEMENTED`.
24
+ - Complete `prizmkit-code-review` only with `--status completed --stage-result REVIEW_PASS`.
25
+ - Complete `prizmkit-test` only after validating the sibling report/result pair, with `--status completed --stage-result TEST_PASS`.
26
+ - Complete `prizmkit-retrospective` with `--status completed --stage-result RETRO_COMPLETE`.
27
+ - Record commit authorization wait with `--status in_progress --stage-result COMMIT_PENDING`; after the local commit, use `--status completed --stage-result COMMITTED`.
28
+ - For `TEST_NEEDS_FIXES` or `TEST_BLOCKED`, use `--status failed --stage-result <result>` and preserve its report/result and blocker; never mark the test step completed.
20
29
  - Omit `--note` when there is no useful failure or handoff note.
21
30
 
22
31
  ### Rules
23
32
 
24
- 1. Before each skill, read the checkpoint and verify the previous step is `completed` or `skipped`. A pending or in-progress predecessor must be completed first.
25
- 2. Starting a skill marks its step `in_progress`; completion marks it `completed`; failures mark it `failed` and write `failure-log.md`.
26
- 3. L4 checkpoint metadata must preserve `current_stage`, `next_stage`, `stage_result`, `repair_scope`, `repair_round`, `authoritative_evidence_paths`, `blocked_reason`, and `terminal_status`.
27
- 4. `authoritative_evidence_paths` may point only to validated structured `manifest.json`, `verdict.json`, and `validation.json`; a Markdown report is never completion authority.
28
- 5. Preserve all evidence and session artifacts on recovery. Never replace the task family's L1 workflow state with this L4 checkpoint or merge their schemas.
29
- 6. The outer repair round is shared across review/test failures and stops at three. The internal Code Review loop has its separate ten-round limit.
30
- 7. `TEST_BLOCKED`, an unknown result, an unsafe repair scope, or an exhausted third repair round records terminal `WORKFLOW_BLOCKED` with a deterministic `blocked_reason`; never speculate on production edits.
31
- 8. `WORKFLOW_COMPLETED` is valid only when the expected family stage sequence is complete, Code Review records `REVIEW_PASS`, and the test stage records `TEST_PASS` with all three authoritative evidence records.
33
+ 1. Before each skill, verify its predecessor is `completed` or `skipped`.
34
+ 2. Starting a skill marks its step `in_progress`; a valid success marks it `completed`; a non-pass records its truthful `stage_result` and leaves later stages incomplete.
35
+ 3. Pipeline metadata owns only `current_stage`, `next_stage`, `stage_result`, `repair_scope`, `repair_round`, `blocked_reason`, and `terminal_status`; lifecycle `status` belongs to each checkpoint step.
36
+ 4. Skills own their reports and terminal results. The pipeline must not duplicate a skill's internal state machine or require evidence manifests, hashes, or attestations.
37
+ 5. Preserve all reports and session artifacts on recovery. Never replace skill artifacts with the pipeline checkpoint or merge their schemas.
38
+ 6. `TEST_NEEDS_FIXES` is a known testing-domain non-pass. `TEST_BLOCKED` records terminal `WORKFLOW_BLOCKED` with a deterministic reason. Neither is an AI CLI crash.
39
+ 7. Any cross-stage continuation or retry policy belongs to the pipeline and must remain separate from the test skill's internal review and repair budgets.
40
+ 8. `WORKFLOW_COMPLETED` is valid only when the expected family sequence is complete, Code Review records `REVIEW_PASS`, the test stage records `TEST_PASS`, and every declared artifact exists.
32
41
  9. On session exit, leave the checkpoint at the truthful stage. Do not mark future steps completed.
@@ -2,7 +2,7 @@
2
2
 
3
3
  This pipeline session is non-interactive. Do not ask questions, wait for user input, or request commit confirmation.
4
4
 
5
- The pipeline launch has already authorized local commits for this task. Invoke `/prizmkit-committer` with the L4-managed execution context:
5
+ The pipeline launch has already authorized local commits for this task. Invoke `/prizmkit-committer` with the pipeline-managed execution context:
6
6
 
7
7
  ```json
8
8
  {
@@ -15,7 +15,7 @@ git log --oneline
15
15
  **b.** Run `/prizmkit-retrospective` (**before commit**, maintains `.prizmkit/prizm-docs/` architecture index):
16
16
  1. **Structural sync**: update KEY_FILES/INTERFACES/DEPENDENCIES/file counts for changed modules
17
17
  2. **Architecture knowledge**: extract TRAPS, RULES, DECISIONS from completed work into `.prizmkit/prizm-docs/`
18
- 3. **L2 coverage check**: For any module/sub-module with source files created or significantly modified in this session but no L2 `.prizm` doc — evaluate whether L2 is warranted and create if so. The current session has the best context for accurate KEY_FILES, TRAPS, and DECISIONS.
18
+ 3. **Detail-doc coverage check**: For any module/sub-module with source files created or significantly modified in this session but no detail `.prizm` doc — evaluate whether one is warranted and create it when needed. The current session has the best context for accurate KEY_FILES, TRAPS, and DECISIONS.
19
19
  4. Stage doc changes: `git add .prizmkit/prizm-docs/`
20
20
  ⚠️ Do NOT commit here. Only stage.
21
21
 
@@ -3,7 +3,7 @@
3
3
  **a.** Run `/prizmkit-retrospective` — maintains `.prizmkit/prizm-docs/` (architecture index):
4
4
  1. **Structural sync**: Use `git diff --cached --name-status` to locate changed modules, update KEY_FILES/INTERFACES/DEPENDENCIES/file counts in affected `.prizmkit/prizm-docs/` files
5
5
  2. **Architecture knowledge** (feature sessions only): Extract TRAPS/RULES/DECISIONS from completed work into `.prizmkit/prizm-docs/`
6
- 3. **L2 coverage check**: For any module/sub-module with source files created or significantly modified in this session but no L2 `.prizm` doc — evaluate whether L2 is warranted and create if so. The current session has the best context for accurate KEY_FILES, TRAPS, and DECISIONS.
6
+ 3. **Detail-doc coverage check**: For any module/sub-module with source files created or significantly modified in this session but no detail `.prizm` doc — evaluate whether one is warranted and create it when needed. The current session has the best context for accurate KEY_FILES, TRAPS, and DECISIONS.
7
7
  4. Stage doc changes: `git add .prizmkit/prizm-docs/`
8
8
  ⚠️ Do NOT commit here. Only stage.
9
9
 
@@ -1,4 +1,4 @@
1
- - **Section 3 — Key TRAPS & RULES**: extract only relevant TRAPS/RULES from prizm-docs. Do NOT copy full L0/L1/L2 content — the orchestrator already loaded them.
1
+ - **Section 3 — Key TRAPS & RULES**: extract only relevant TRAPS/RULES from the loaded Prizm docs. Do NOT copy complete documentation files — the orchestrator already loaded them.
2
2
  - **Section 4 — File Manifest**: For each file, list: path, why needed, and a **key-content summary** so you do NOT need to re-read the file. Format depends on file type:
3
3
  - **Code files** (JS/TS/Python/Go): function signatures. Example: `config` (Zod object), `loadConfig(path)→Config`.
4
4
  - **Shell scripts** (`.sh`): command-line args, key behavior branches, sourced libs, critical line ranges. Example: `args: --feature-id; sources lib/common.sh; lines 120-180 worktree logic`.
@@ -19,6 +19,6 @@
19
19
  | `package.json` | Test cmd+deps | scripts:{test:vitest}, deps:{vitest} |
20
20
 
21
21
  ### Known TRAPS (from .prizmkit/prizm-docs/)
22
- - <trap entries extracted from L1/L2 docs>
22
+ - <trap entries extracted from the loaded Prizm docs>
23
23
 
24
24
 
@@ -5,7 +5,7 @@
5
5
  ```
6
6
 
7
7
  If MISSING — build it now:
8
- 1. Read `.prizmkit/prizm-docs/root.prizm` and relevant L1/L2 prizm docs
8
+ 1. Read `.prizmkit/prizm-docs/root.prizm` and the relevant module indexes and detail docs
9
9
  2. Read source files listed in the feature's scope (use prizm-docs KEY_FILES for guidance)
10
10
  3. Write `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
11
11
  - **Section 1 — Feature Brief**: 2-3 line feature description from Task Contract
@@ -1,4 +1,4 @@
1
- - **Section 3 — Key TRAPS & RULES**: extract only relevant TRAPS/RULES from prizm-docs that apply to files in this scope. Do NOT copy full L0/L1/L2 content.
1
+ - **Section 3 — Key TRAPS & RULES**: extract only relevant TRAPS/RULES from the loaded Prizm docs that apply to files in this scope. Do NOT copy complete documentation files.
2
2
  - **Section 4 — File Manifest**: For each relevant file, list path, why needed, key interface signatures. Use table format:
3
3
 
4
4
  ### Files to Modify
@@ -11,7 +11,7 @@
11
11
  - If implementation is delegated to a subagent, the subagent must read `plan.md` and `context-snapshot.md` before editing
12
12
  - Uses context from `context-snapshot.md` (Prizm docs, TRAPS, file manifest) for targeted source reads; avoid re-reading source files already summarized there unless they changed after the snapshot
13
13
  - Implements task-by-task, marking each `[x]` immediately
14
- - Creates/updates L2 `.prizm` docs when creating new modules or significantly modifying existing ones — AI selectively decides which modules warrant L2 based on complexity and importance
14
+ - Creates/updates detail `.prizm` docs when creating new modules or significantly modifying existing ones — AI selectively decides which modules warrant detail documentation based on complexity and importance
15
15
  - Does not run the scoped/full test gate; testing happens after code review in the PrizmKit Test phase
16
16
  - Writes '## Implementation Log' to `context-snapshot.md`
17
17
 
@@ -1,42 +1,30 @@
1
1
  ### Scoped Feature Test Gate — PrizmKit Test
2
2
 
3
- **Goal**: After Code Review completes, generate and verify tests for this Feature's changed scope through `/prizmkit-test`. Review is a hard precondition for accepting any full test result.
3
+ **Goal**: After Code Review completes, use `/prizmkit-test` to analyze the complete affected business module and Regression Ring, add project-native tests, repair valid failures within the skill's bounded loop, and produce the terminal report/result pair.
4
4
 
5
- Create a current-run marker immediately before invoking the skill:
6
-
7
- ```bash
8
- {{RUNTIME_HELPER_CMD}} artifact ensure-dir .prizmkit/specs/{{FEATURE_SLUG}}
9
- {{RUNTIME_HELPER_CMD}} artifact touch .prizmkit/specs/{{FEATURE_SLUG}}/.prizmkit-test-started
10
- ```
11
-
12
- Run `/prizmkit-test` with the Feature artifact directory. This gate is Feature-only: never substitute `.prizmkit/bugfix/` or `.prizmkit/refactor/` artifact roots.
5
+ Run the skill with the current Feature artifact directory:
13
6
 
14
7
  ```text
15
8
  /prizmkit-test scope=this-change artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/
16
9
  ```
17
10
 
18
- ## Authoritative Evidence Gate
11
+ ## Testing Result Gate
19
12
 
20
- The report is a derived view only. Its historical Boundary Matrix and Boundary Completion Gate are useful context but never completion authority. A valid derived view may state `Boundary-missing: 0`, `Happy-path-only: 0`, `Completion gate passed: yes`, and `Validator result: passed`, but those Markdown fields cannot establish success. Locate the evidence package through `.prizmkit/specs/{{FEATURE_SLUG}}/test-report-path.txt`, then consume and validate these structured records:
13
+ Consume these sibling terminal artifacts:
21
14
 
22
- - `.prizmkit/test/evidence/<evidence-id>/manifest.json`
23
- - `.prizmkit/test/evidence/<evidence-id>/verdict.json`
24
- - `.prizmkit/test/evidence/<evidence-id>/validation.json`
15
+ - `.prizmkit/specs/{{FEATURE_SLUG}}/test-report.md`
16
+ - `.prizmkit/specs/{{FEATURE_SLUG}}/test-result.json`
25
17
 
26
- Before accepting `TEST_PASS`, verify all three records are present, JSON is complete and non-duplicated, the evidence ID and scope match this Feature, every manifest-listed file hash matches, `final_verdict` and `verdict.verdict` agree, `validation.result=passed`, `validation.verdict` agrees, validator/payload hashes are present, the compatibility boundary rejects the legacy report interface, and current inventoried target hashes still match. Never accept a Markdown-only report or a Markdown `PASS` as completion evidence.
18
+ The JSON is the minimal terminal result projection and the report contains semantic coverage, native execution, Main-Agent review, optional independent Test Reviewer, and repair details. They must agree. Do not require an evidence package, manifest, hashes, attestation, package lifecycle, or test-internal checkpoint.
27
19
 
28
- ## Repair Routing
20
+ ## Caller Routing
29
21
 
30
- Preserve the same artifact directory and update the L1 workflow state plus this L4 checkpoint with `current_stage`, `next_stage`, `stage_result`, `repair_scope`, `repair_round`, authoritative evidence paths, `blocked_reason`, and `terminal_status`. L1 workflow state and `workflow-checkpoint.json` are separate contracts; never substitute one for the other.
22
+ The caller checkpoint records only the returned testing result and caller-owned routing state. It must not ask the skill to manage sessions or checkpoints.
31
23
 
32
- - `REVIEW_NEEDS_FIXES` → `prizmkit-implement` `prizmkit-code-review` `prizmkit-test`.
33
- - `TEST_FAIL` with `repair_scope=test-infrastructure` `prizmkit-implement` `prizmkit-test`; do not make speculative production edits.
34
- - `TEST_FAIL` with `repair_scope=production|runtime|schema|dependency|public-interface` `prizmkit-implement` `prizmkit-code-review` `prizmkit-test`.
35
- - `TEST_FAIL` with unknown or unsafe scope → do not guess a production edit; record `WORKFLOW_BLOCKED` and a safe resume entry.
36
- - `TEST_BLOCKED` → preserve all evidence and artifacts, perform only bounded environment recovery, then finish terminal `WORKFLOW_BLOCKED` with `blocked_reason=test_blocked`; never edit production speculatively. When a finalized blocked package exists, pass its validated `manifest`, `verdict`, and `validation` paths to the checkpoint; do not leave these paths null.
37
- - The builder's evidence-protocol recovery budget is separate from the outer `repair_round`: after bounded preflight/package attempts, stop creating evidence versions and return `TEST_BLOCKED`.
38
- - The outer `repair_round` is shared across review/test failures and may not exceed three. The Code Review internal loop limit remains separate and is at most ten completed rounds.
24
+ - `TEST_PASS` → mark `prizmkit-test` completed and continue to retrospective.
25
+ - `TEST_NEEDS_FIXES` stop the current caller path truthfully. If `review_required=true` and `review_scope=delta`, a caller may route the repaired delta through Code Review before invoking test again. Any continuation policy is caller-owned, not part of the test skill.
26
+ - `TEST_BLOCKED` preserve the report, result, and blocker; record terminal `WORKFLOW_BLOCKED`. Do not reinterpret it as an AI CLI crash or perform speculative production edits.
39
27
 
40
- A missing, stale, incomplete, mismatched, tampered, or wrong-scope package is not `TEST_PASS`: preserve the evidence, write `failure-log.md`, and leave the checkpoint resumable or blocked according to headless policy.
28
+ A test execution failure inside the skill is not automatically terminal: `/prizmkit-test` owns up to three direct diagnosis-and-repair rounds. The caller handles only the terminal result returned after that loop.
41
29
 
42
- **CP-4**: Only a validated structured `TEST_PASS` may complete `prizmkit-test` with `stage_result=TEST_PASS` plus `manifest`, `verdict`, and `validation` evidence paths, then proceed to retrospective. `TEST_FAIL` and `TEST_BLOCKED` remain in the repair/recovery state machine.
30
+ **CP-4**: `TEST_PASS` plus the required `test-report.md` and `test-result.json` completes the test step. `TEST_NEEDS_FIXES` and `TEST_BLOCKED` are truthful non-pass testing results and cannot complete later stages.
@@ -4,8 +4,8 @@ Review the completed implementation before the full Feature test gate runs. A re
4
4
 
5
5
  Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so `/prizmkit-code-review` can read the spec, plan, context snapshot, implementation log, and current diff. Follow the skill's current review contract for review execution, repairs, verification, evidence, and handoff. Do not invoke another review skill or add a second review path outside that contract.
6
6
 
7
- - `REVIEW_PASS` → update checkpoint metadata with `stage=code-review`, `status=REVIEW_PASS`, `stage_result=REVIEW_PASS`, `next_stage=prizmkit-test`, and `resume_from=prizmkit-test`; then run the full test gate.
8
- - `REVIEW_NEEDS_FIXES` → preserve findings, increment the shared outer `repair_round`, route `prizmkit-implement` → `prizmkit-code-review` → `prizmkit-test`, and do not accept any test result from before the repaired review.
7
+ - `REVIEW_PASS` → update checkpoint metadata with `stage=code-review`, `status=completed`, `stage_result=REVIEW_PASS`, `next_stage=prizmkit-test`, and `resume_from=prizmkit-test`; then run the full test gate.
8
+ - `REVIEW_NEEDS_FIXES` → update the review step with `status=failed` and `stage_result=REVIEW_NEEDS_FIXES`, preserve findings, increment the shared outer `repair_round`, route `prizmkit-implement` → `prizmkit-code-review` → `prizmkit-test`, and do not accept any test result from before the repaired review.
9
9
  - If the outer repair round is already three, record `WORKFLOW_BLOCKED`; do not start another repair route.
10
10
 
11
11
  Missing required evidence, unsafe repair, failed verification, or failure to converge under the review contract produces `REVIEW_NEEDS_FIXES`.
@@ -20,7 +20,7 @@ If `EXISTING_CODE` is non-empty: your spec/plan/tasks must reflect this existing
20
20
 
21
21
  **Step A — Build Context Snapshot** (skip if `context-snapshot.md` already exists):
22
22
 
23
- 1. Read `.prizmkit/prizm-docs/root.prizm` and relevant L1/L2 prizm docs
23
+ 1. Read `.prizmkit/prizm-docs/root.prizm` and the relevant module indexes and detail docs
24
24
  2. Detect source code directories from KEY_FILES and STRUCTURE sections in `root.prizm`; if root docs are unavailable, use the helper to list likely source files:
25
25
  ```bash
26
26
  {{RUNTIME_HELPER_CMD}} artifact source-files . --json
@@ -30,7 +30,7 @@ If `EXISTING_CODE` is non-empty: your spec/plan/tasks must reflect this existing
30
30
  4. Write `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
31
31
  - **Section 1 — Feature Brief**: feature description (copy from Task Contract above, 2-3 lines only)
32
32
  - **Section 2 — Verification Gates**: copy the gate checklist from the Task Contract above
33
- - **Section 3 — Key TRAPS & RULES**: extract TRAPS and RULES entries from loaded prizm-docs that apply to files in this feature's scope. Do NOT copy full L0/L1/L2 content — only the specific TRAPS/RULES lines relevant to the files listed in Section 4.
33
+ - **Section 3 — Key TRAPS & RULES**: extract TRAPS and RULES entries from the loaded Prizm docs that apply to files in this feature's scope. Do NOT copy complete documentation filesinclude only the specific TRAPS/RULES lines relevant to the files listed in Section 4.
34
34
  - **Section 4 — File Manifest**: For each file relevant to this feature, list path, why needed (modify/reference/test), key interface signatures. Do NOT include full file content. Format:
35
35
  ### Files to Modify
36
36
  | File | Why Needed | Key Interfaces |
@@ -43,7 +43,7 @@ If `EXISTING_CODE` is non-empty: your spec/plan/tasks must reflect this existing
43
43
  | `<source-dir>/security/permission-guard.js` | Permission check integration | `checkCommandPermission(userId, cmd)` |
44
44
 
45
45
  ### Known TRAPS (from .prizmkit/prizm-docs/)
46
- - <trap entries extracted from L1/L2 docs>
46
+ - <trap entries extracted from the loaded Prizm docs>
47
47
  5. Confirm: `{{RUNTIME_HELPER_CMD}} artifact exists .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`
48
48
 
49
49
  **After Step A**: Use context-snapshot.md Section 4 File Manifest to guide targeted file reads. Do NOT scan directories or read unrelated files.
@@ -16,4 +16,4 @@ Missing required evidence, an unsafe repair, a failed verification, or failure t
16
16
 
17
17
  Verify directly that the review checks behavior preservation, public API compatibility, imports, tests, and rollback assumptions.
18
18
 
19
- **Checkpoint update**: Set step `prizmkit-code-review` to `completed` with `stage_result=REVIEW_PASS` only for an accepted valid Final Result. Do not complete the checkpoint for incomplete or invalid reports.
19
+ **Checkpoint update**: Set step `prizmkit-code-review` to `completed` with `stage_result=REVIEW_PASS` only for an accepted valid Final Result. Set it to `failed` with `stage_result=REVIEW_NEEDS_FIXES` when the review returns known unresolved findings. Do not complete the checkpoint for incomplete or invalid reports.
@@ -1,21 +1,24 @@
1
1
  ### Refactor Test Gate — PrizmKit Test
2
2
 
3
- After Main-Agent code review returns a valid `PASS`, run the mandatory post-review test stage against the same Refactor artifact root. Behavior-preservation checks collected during planning and implementation remain supporting evidence; they never replace this authoritative evidence gate.
3
+ After Main-Agent Code Review returns `PASS`, run the mandatory test stage against the same Refactor artifact root. Existing behavior-preservation context is input to testing; the final current-state native executions remain required.
4
4
 
5
5
  ```text
6
6
  /prizmkit-test scope=this-change artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/
7
7
  ```
8
8
 
9
- Read the current structured evidence package under `.prizmkit/test/evidence/<evidence-id>/`: `manifest.json`, `verdict.json`, and `validation.json`. A derived Markdown report is not completion authority. Confirm scope, hashes, final verdict, and validator result before accepting `TEST_PASS`.
9
+ Consume the sibling terminal artifacts:
10
10
 
11
- Gate outcomes and authoritative routing:
11
+ - `.prizmkit/refactor/{{REFACTOR_ID}}/test-report.md`
12
+ - `.prizmkit/refactor/{{REFACTOR_ID}}/test-result.json`
12
13
 
13
- - `TEST_PASS`: verify behavior-preservation evidence remains recorded, update the checkpoint handoff, and continue to retrospective.
14
- - `TEST_FAIL` with `repair_scope=test-infrastructure`: return to `/prizmkit-implement`, preserve the behavior baseline, then return directly to this test gate; do not make speculative production edits.
15
- - `TEST_FAIL` with `repair_scope=production|runtime|schema|dependency|public-interface`: return to implementation, obtain a fresh code-review result, then return to this test gate.
16
- - `TEST_FAIL` with an unknown or missing `repair_scope`: record `WORKFLOW_BLOCKED` and leave a safe checkpoint at the test stage; do not guess a production edit.
17
- - `TEST_BLOCKED`: preserve all evidence and artifacts, perform only bounded automatic environment recovery, then terminate as `WORKFLOW_BLOCKED` with `blocked_reason=test_blocked`. Never edit production speculatively and never ask the user.
14
+ They must agree on the testing result and unresolved items. Do not require an evidence package, manifest, hashes, attestation, or test-internal checkpoint.
18
15
 
19
- The `repair_round` counter is shared with review failures and may not exceed three outer rounds. At the limit, leave a truthful blocked terminal result. Internal code-review convergence has its separate ten-round limit.
16
+ Gate outcomes:
20
17
 
21
- **Checkpoint update**: Only a validated structured `TEST_PASS` may complete `prizmkit-test` with `stage_result=TEST_PASS` plus `manifest`, `verdict`, and `validation` evidence paths, then proceed to retrospective.
18
+ - `TEST_PASS`: verify required behavior-preservation coverage is included, mark the test step completed, and continue to retrospective.
19
+ - `TEST_NEEDS_FIXES`: preserve the report/result and stop truthfully. A high-risk production repair reports `review_required=true` and `review_scope=delta`; the caller owns any review-and-retest route.
20
+ - `TEST_BLOCKED`: preserve the report/result and blocker, then record terminal `WORKFLOW_BLOCKED`. Do not reinterpret the result as a runtime crash or make speculative production edits.
21
+
22
+ The skill itself diagnoses and repairs valid execution failures for at most three rounds before returning. The caller must not recreate that repair loop or maintain test-internal state.
23
+
24
+ **Checkpoint update**: Only `TEST_PASS` plus `test-report.md` and `test-result.json` completes `prizmkit-test` and allows retrospective.
@@ -1,6 +1,6 @@
1
1
  ## Reminders
2
2
 
3
- - Use L1 skills: `/prizmkit-plan`, `/prizmkit-implement`, `/prizmkit-code-review`, `/prizmkit-retrospective`, `/prizmkit-committer`.
3
+ - Use the atomic skills: `/prizmkit-plan`, `/prizmkit-implement`, `/prizmkit-code-review`, `/prizmkit-retrospective`, `/prizmkit-committer`.
4
4
  - All refactor skills use `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/`.
5
5
  - Behavior preservation is the first priority.
6
6
  - Follow the active skills and runtime contracts; they determine execution topology, review ownership, and delegation boundaries
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "status": {
17
17
  "type": "string",
18
- "enum": ["success", "partial", "failed", "commit_missing", "docs_missing", "merge_conflict", "context_overflow"]
18
+ "enum": ["success", "partial", "failed", "crashed", "timed_out", "infra_error", "commit_missing", "docs_missing", "merge_conflict", "context_overflow", "stalled_context_continuation", "workflow_blocked", "workflow_skipped"]
19
19
  },
20
20
  "completed_phases": {
21
21
  "type": "array",