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
@@ -187,7 +187,7 @@ Record tool choice, URL, steps, screenshot path if available, result, and cleanu
187
187
 
188
188
  ### Headless Commit Authorization
189
189
 
190
- This pipeline launch authorizes one local task commit only after review, authoritative test evidence, and required behavior-preservation gates pass. Never ask a question, wait for input, or request confirmation. Invoke `/prizmkit-committer` with `mode=l4-headless`, `owner=prizmkit-l4`, `local_commit_authorized=true`, and `push_authorized=false`. Never push.
190
+ This pipeline launch authorizes one local task commit only after review, authoritative test evidence, and required behavior-preservation gates pass. Never ask a question, wait for input, or request confirmation. Invoke `/prizmkit-committer` with `mode=l4-headless`, `owner=prizmkit-l4`, and `local_commit_authorized=true`. The runtime controls any optional remote publication after the local commit; do not make a publication decision in this session.
191
191
 
192
192
  Run `/prizmkit-retrospective` using the current working tree and staged changes as input context. Do not rely only on `git diff --cached`.
193
193
 
@@ -199,7 +199,7 @@ Run `/prizmkit-committer` with commit prefix:
199
199
  refactor({{REFACTOR_ID}}): {{REFACTOR_TITLE}}
200
200
  ```
201
201
 
202
- Do not push.
202
+ The runtime controls any optional remote publication after this local commit; do not make a publication decision in this session.
203
203
 
204
204
  Write `.prizmkit/refactor/{{REFACTOR_ID}}/refactor-report.md` with:
205
205
  - refactor summary;
@@ -267,7 +267,7 @@ Before exiting, write `{{SESSION_STATUS_PATH}}`:
267
267
  ## Reminders
268
268
 
269
269
  - Use L1 skills: `/prizmkit-plan`, `/prizmkit-implement`, `/prizmkit-code-review`, `/prizmkit-retrospective`, `/prizmkit-committer`.
270
- - Do not spawn a top-level Dev implementation subagent; Code Review runs only in the current Main Agent without delegation.
270
+ - Do not spawn a top-level Dev implementation subagent; Code Review keeps mandatory Main-Agent ownership and may use only its strict-gated skill-owned Reviewer after convergence.
271
271
  - Behavior preservation is the first priority.
272
272
  - Browser verification is a mandatory attempt by default; it blocks only when explicitly required.
273
273
  - If `DEV_PORT` is unknown, discover it from project config; do not guess port 3000.
@@ -1,6 +1,6 @@
1
1
  ### Phase 4: Commit & Learn
2
2
 
3
- This phase is included only for sessions allowed to commit. Fresh manual/hybrid bugfix prompts omit this phase entirely and stop as partial before retrospective/commit.
3
+ This phase follows successful automated, manual, or hybrid verification and runs only after the authoritative test gate permits commit.
4
4
 
5
5
  **Bug Fix Documentation Policy**:
6
6
  - Default: run `/prizmkit-retrospective` with structural sync only.
@@ -17,7 +17,7 @@ Run `/prizmkit-committer` with commit prefix:
17
17
  fix({{FIX_SCOPE}}): {{BUG_TITLE}}
18
18
  ```
19
19
 
20
- Do not push.
20
+ The runtime controls any optional remote publication after this local commit; do not make a publication decision in this session.
21
21
 
22
22
  Write `.prizmkit/bugfix/{{BUG_ID}}/fix-report.md` with:
23
23
  - root cause summary;
@@ -2,14 +2,9 @@
2
2
 
3
3
  `verification_type` is `{{VERIFICATION_TYPE}}`.
4
4
 
5
- For a fresh bugfix session, manual/hybrid verification is blocking before commit:
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`.
6
6
 
7
- 1. Write `{{SESSION_STATUS_PATH}}` with:
8
- - `status`: `partial`
9
- - `can_resume`: `true`
10
- - `resume_from_phase`: `4`
11
- - explanation that manual UAT is required before commit
12
- 2. Document the UAT checklist in `.prizmkit/bugfix/{{BUG_ID}}/fix-report.md` or `failure-log.md`.
13
- 3. Stop before `/prizmkit-retrospective` and `/prizmkit-committer`.
14
-
15
- Recovery-class sessions (retry, resume, continuation, context overflow) may substitute automated verification for manual/hybrid UAT, but must document the substitution evidence before committing.
7
+ 1. Select the available non-interactive verification path: browser tooling, CLI/API checks, fixtures, project test commands, or another deterministic local check.
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.
9
+ 3. Record the selected verification method, commands/tool, inputs, outputs, limitations, and evidence paths in `.prizmkit/bugfix/{{BUG_ID}}/fix-report.md` and the session/checkpoint metadata.
10
+ 4. Continue through the authoritative `prizmkit-test` gate, `/prizmkit-retrospective`, and `/prizmkit-committer` when all gates pass. Missing or blocked verification evidence is `TEST_BLOCKED`, not a request for user input.
@@ -2,13 +2,13 @@
2
2
 
3
3
  Code review is mandatory for every committable Bugfix, including small or obvious fixes. Do not create a FAST_PATH that skips this gate.
4
4
 
5
- Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds. The current Main Agent is the only Code Review executor: it reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings.
5
+ Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`. The skill runs a mandatory Main-Agent review loop for up to ten completed rounds: the Main Agent reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings. After convergence, one skill-owned independent Reviewer is optional only when the strict structural capability gate passes; otherwise no Reviewer is created.
6
6
 
7
- The Code Review execution boundary is absolute for this phase:
7
+ The Code Review execution boundary is closed for this phase:
8
8
 
9
- - Do not delegate any review work directly or indirectly.
10
- - Do not invoke another review skill or review workflow.
11
- - Do not use a general-purpose execution unit for review or relabel delegated work as a finder, verifier, audit, compatibility review, verification, or gap sweep.
9
+ - Do not delegate the mandatory Main-Agent review or invoke another review skill or workflow.
10
+ - Do not add review execution outside the single optional Reviewer owned and gated by `prizmkit-code-review`.
11
+ - The optional Reviewer must be structurally read-only, unable to execute arbitrary commands or downstream execution, and natively resumable as the same unit; otherwise strict downgrade applies.
12
12
  - Direct reading, searching, editing, and testing by the current Main Agent remain allowed.
13
13
  - `review-report.md` is the only persisted review artifact; do not append separate Review Notes to another artifact.
14
14
 
@@ -28,4 +28,4 @@ Before exiting, write the session status file:
28
28
  }
29
29
  ```
30
30
 
31
- For fresh manual/hybrid partial stops, set `status="partial"`, `can_resume=true`, and `resume_from_phase=4`.
31
+ For manual/hybrid verification, record the selected automated verification method and evidence in `manual_verification_policy`; never use a partial stop solely because the plan labels verification as manual or hybrid.
@@ -6,7 +6,7 @@ You are running in **headless non-interactive mode** with a FINITE context windo
6
6
 
7
7
  1. **context-snapshot.md is your single source of truth** — After it is available, use it instead of re-reading individual source files. If you just created or updated it in this session, continue from the in-context content; read it only when resuming/continuing, after context compaction/loss, or when handing work to a subagent.
8
8
  2. **Never re-read your own writes** — After you create/modify a file, do NOT read it back to verify. Trust your write was correct.
9
- 3. **Never re-read unmodified files** — Once you have read a file into context, do NOT read it again unless it was modified by an Edit/Write operation after your last read. Use platform file/search tools for targeted lookup; when shell-free helper lookup is needed, run `{{RUNTIME_HELPER_CMD}} text search <file> --pattern "<pattern>" --json`, then read only the smallest bounded range with the platform file-reading tool instead of full-file Read. Before issuing a Read, ask yourself: "Have I read this file before, and has it changed since?" If the answer is "no, it hasn't changed" — do NOT read it. This applies to all files summarized in context-snapshot.md Section 4. Normal work delegation outside Code Review must receive context-snapshot.md and rely on it rather than independently re-reading files the Main Agent already read. Code Review is excluded from normal work delegation and runs only in the current Main Agent.
9
+ 3. **Never re-read unmodified files** — Once you have read a file into context, do NOT read it again unless it was modified by an Edit/Write operation after your last read. Use platform file/search tools for targeted lookup; when shell-free helper lookup is needed, run `{{RUNTIME_HELPER_CMD}} text search <file> --pattern "<pattern>" --json`, then read only the smallest bounded range with the platform file-reading tool instead of full-file Read. Before issuing a Read, ask yourself: "Have I read this file before, and has it changed since?" If the answer is "no, it hasn't changed" — do NOT read it. This applies to all files summarized in context-snapshot.md Section 4. Normal work delegation outside the optional skill-owned review contract must receive context-snapshot.md and rely on it rather than independently re-reading files the Main Agent already read. Code Review keeps mandatory Main-Agent ownership and may use only its strict-gated skill-owned Reviewer after convergence.
10
10
  4. **Stay focused** — Do NOT explore code unrelated to this feature. No curiosity-driven reads.
11
11
  5. **One task at a time** — Complete and test one task before starting the next.
12
12
  6. **Minimize tool output** — Never load full command output into context. First capture command output to a temp file using the command/tool output option or the host-appropriate redirection, then inspect only the final relevant lines and use targeted search helpers to extract the information needed for the current task. Only read the filtered result — never the raw full output.
@@ -8,9 +8,8 @@ The pipeline launch has already authorized local commits for this task. Invoke `
8
8
  {
9
9
  "mode": "l4-headless",
10
10
  "owner": "prizmkit-l4",
11
- "local_commit_authorized": true,
12
- "push_authorized": false
11
+ "local_commit_authorized": true
13
12
  }
14
13
  ```
15
14
 
16
- The committer must still verify every lifecycle gate, inspect the intended diff, generate a Conventional Commit message, stage only intended files, create the local commit, and verify it. It must never push. If the execution context is absent or invalid, mark the task blocked and exit; do not ask the user.
15
+ The committer must still verify every lifecycle gate, inspect the intended diff, generate a Conventional Commit message, stage only intended files, create the local commit, and verify it. Remote publication is controlled by the runtime after the local commit; do not make a publication decision in this session. If the execution context is absent or invalid, mark the task blocked and exit; do not ask the user.
@@ -27,7 +27,7 @@ git add .prizmkit/prizm-docs/
27
27
 
28
28
  **d.** Run `/prizmkit-committer` → THE ONLY commit for this feature:
29
29
  `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`
30
- This single commit includes: feature code + tests + .prizmkit/prizm-docs/ updates. Do NOT push.
30
+ This single commit includes: feature code + tests + .prizmkit/prizm-docs/ updates.
31
31
  - MANDATORY: commit must be done via `/prizmkit-committer` skill. Do NOT run manual `git add`/`git commit` as a substitute.
32
32
  - Do NOT run `update-feature-status.py` here — the pipeline runner handles feature-list.json updates automatically after session exit.
33
33
 
@@ -72,4 +72,4 @@ After all of the following are true, the session is **TERMINAL**:
72
72
  - `.prizmkit/specs/{{FEATURE_SLUG}}/completion-summary.json` is written
73
73
  - the `prizmkit-committer` checkpoint is marked `completed`
74
74
 
75
- At that point, stop immediately. Do **not** process delayed normal-work results, edit files, amend the commit, or start any new tool calls. Code Review cannot have delayed delegated findings because it runs only in the current Main Agent. Any normal-work result that arrives after S09 is completed is follow-up work for a later session, not part of this feature commit.
75
+ At that point, stop immediately. Do **not** process delayed normal-work results, edit files, amend the commit, or start any new tool calls. Code Review must end its optional Reviewer lifecycle before Final Result, so no independent-review response remains pending. Any normal-work result that arrives after S09 is completed is follow-up work for a later session, not part of this feature commit.
@@ -15,7 +15,7 @@ git add .prizmkit/prizm-docs/
15
15
 
16
16
  **c.** Run `/prizmkit-committer` → THE ONLY commit for this feature:
17
17
  `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`
18
- This single commit includes: feature code + tests + .prizmkit/prizm-docs/ updates. Do NOT push.
18
+ This single commit includes: feature code + tests + .prizmkit/prizm-docs/ updates.
19
19
  - MANDATORY: commit must be done via `/prizmkit-committer` skill. Do NOT run manual `git add`/`git commit` as a substitute.
20
20
  - Do NOT run `update-feature-status.py` here — the pipeline runner handles feature-list.json updates automatically after session exit.
21
21
 
@@ -58,4 +58,4 @@ After all of the following are true, the session is **TERMINAL**:
58
58
  - `.prizmkit/specs/{{FEATURE_SLUG}}/completion-summary.json` is written
59
59
  - the `prizmkit-committer` checkpoint is marked `completed`
60
60
 
61
- At that point, stop immediately. Do **not** process delayed normal-work results, edit files, amend the commit, or start any new tool calls. Code Review cannot have delayed delegated findings because it runs only in the current Main Agent. Any normal-work result that arrives after S09 is completed is follow-up work for a later session, not part of this feature commit.
61
+ At that point, stop immediately. Do **not** process delayed normal-work results, edit files, amend the commit, or start any new tool calls. Code Review must end its optional Reviewer lifecycle before Final Result, so no independent-review response remains pending. Any normal-work result that arrives after S09 is completed is follow-up work for a later session, not part of this feature commit.
@@ -2,13 +2,13 @@
2
2
 
3
3
  Review the completed implementation before the scoped feature test gate runs. Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so `/prizmkit-code-review` can read the spec, plan, context snapshot, implementation log, and current diff. Do not require a prior `/prizmkit-test` report here; the next phase owns the formal test gate.
4
4
 
5
- Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds. The current Main Agent is the only Code Review executor: it reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings.
5
+ Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill runs a mandatory Main-Agent review loop for up to ten completed rounds: the Main Agent reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings. After convergence, one skill-owned independent Reviewer is optional only when the strict structural capability gate passes; otherwise no Reviewer is created.
6
6
 
7
- The Code Review execution boundary is absolute for this phase:
7
+ The Code Review execution boundary is closed for this phase:
8
8
 
9
- - Do not delegate any review work directly or indirectly.
10
- - Do not invoke another review skill or review workflow.
11
- - Do not use a general-purpose execution unit for review or relabel delegated work as a finder, verifier, audit, compatibility review, verification, or gap sweep.
9
+ - Do not delegate the mandatory Main-Agent review or invoke another review skill or workflow.
10
+ - Do not add review execution outside the single optional Reviewer owned and gated by `prizmkit-code-review`.
11
+ - The optional Reviewer must be structurally read-only, unable to execute arbitrary commands or downstream execution, and natively resumable as the same unit; otherwise strict downgrade applies.
12
12
  - Direct reading, searching, editing, and testing by the current Main Agent remain allowed.
13
13
  - `review-report.md` is the only persisted review artifact; do not append separate Review Notes to `context-snapshot.md`.
14
14
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Review the completed implementation before the full Feature test gate runs. A review result is a required predecessor; never accept or route around testing as if a review had passed.
4
4
 
5
- Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so `/prizmkit-code-review` can read the spec, plan, context snapshot, implementation log, and current diff. The current Main Agent is the only Code Review executor. The skill runs a bounded Main-Agent review loop of at most ten completed internal rounds and writes only `review-report.md`. The Main-Agent review loop permits up to ten completed rounds.
5
+ Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so `/prizmkit-code-review` can read the spec, plan, context snapshot, implementation log, and current diff. The skill runs a mandatory Main-Agent review loop of up to ten completed rounds and writes only `review-report.md`. After Main-Agent convergence, the skill may create one skill-owned independent Reviewer only when its strict structural capability gate passes; otherwise it records downgrade and creates none.
6
6
 
7
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
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.
@@ -10,11 +10,11 @@ Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so `/prizmkit-code-review`
10
10
 
11
11
  Missing required evidence, unsafe repair, failed verification, or failure to converge by round ten produces `REVIEW_NEEDS_FIXES`.
12
12
 
13
- The Code Review execution boundary is absolute:
13
+ The Code Review execution boundary is closed:
14
14
 
15
- - Do not delegate any review work directly or indirectly.
16
- - Do not invoke another review skill or review workflow.
17
- - Do not use a general-purpose execution unit for review or relabel delegated work as a finder, verifier, audit, compatibility review, verification, or gap sweep.
15
+ - Do not delegate the mandatory Main-Agent review or invoke another review skill or workflow.
16
+ - Do not add review execution outside the single optional Reviewer owned and gated by `prizmkit-code-review`.
17
+ - The optional Reviewer must be structurally read-only, unable to execute arbitrary commands or downstream execution, and natively resumable as the same unit; otherwise strict downgrade applies.
18
18
  - Direct reading, searching, editing, and testing by the current Main Agent remain allowed.
19
19
  - `review-report.md` is the only persisted review artifact; do not append separate Review Notes to `context-snapshot.md`.
20
20
 
@@ -14,7 +14,7 @@ Run `/prizmkit-committer` with commit prefix:
14
14
  refactor({{REFACTOR_ID}}): {{REFACTOR_TITLE}}
15
15
  ```
16
16
 
17
- Do not push.
17
+ The runtime controls any optional remote publication after this local commit; do not make a publication decision in this session.
18
18
 
19
19
  Write `.prizmkit/refactor/{{REFACTOR_ID}}/refactor-report.md` with:
20
20
  - refactor summary;
@@ -1,12 +1,12 @@
1
1
  ### Phase 3: Review — Code Review & Behavior Verification
2
2
 
3
- Run `/prizmkit-code-review` directly with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds. The current Main Agent is the only Code Review executor: it reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings.
3
+ Run `/prizmkit-code-review` directly with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/`. The skill runs a mandatory Main-Agent review loop for up to ten completed rounds: the Main Agent reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings. After convergence, one skill-owned independent Reviewer is optional only when the strict structural capability gate passes; otherwise no Reviewer is created.
4
4
 
5
- The Code Review execution boundary is absolute for this phase:
5
+ The Code Review execution boundary is closed for this phase:
6
6
 
7
- - Do not delegate any review work directly or indirectly.
8
- - Do not invoke another review skill or review workflow.
9
- - Do not use a general-purpose execution unit for review or relabel delegated work as a finder, verifier, audit, compatibility review, verification, or gap sweep.
7
+ - Do not delegate the mandatory Main-Agent review or invoke another review skill or workflow.
8
+ - Do not add review execution outside the single optional Reviewer owned and gated by `prizmkit-code-review`.
9
+ - The optional Reviewer must be structurally read-only, unable to execute arbitrary commands or downstream execution, and natively resumable as the same unit; otherwise strict downgrade applies.
10
10
  - Direct reading, searching, editing, and testing by the current Main Agent remain allowed.
11
11
  - `review-report.md` is the only persisted review artifact; do not append separate Review Notes to another artifact.
12
12
 
@@ -3,7 +3,7 @@
3
3
  - Use L1 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
- - Do not spawn a top-level Dev implementation subagent; Code Review runs only in the current Main Agent without delegation.
6
+ - Do not spawn a top-level Dev implementation subagent; Code Review keeps mandatory Main-Agent ownership and may use only its strict-gated skill-owned Reviewer after convergence.
7
7
  - Main orchestrator runs `/prizmkit-code-review` directly.
8
8
  - Commit with `refactor(<scope>):`, not `feat:` or `fix:`.
9
9
  - Checkpoint state is the recovery truth; skipped steps must be marked `skipped`.
@@ -1,6 +1,6 @@
1
1
  ## Normal Work Delegation Timeout Recovery
2
2
 
3
- This recovery path applies only to normal work delegated outside Code Review. Code Review never uses delegated execution or this retry procedure.
3
+ This recovery path applies only to normal work delegated outside the optional skill-owned review contract. Code Review never applies this retry procedure to its independent Reviewer; Reviewer creation or native-resume failure uses the skill's strict downgrade instead.
4
4
 
5
5
  If a normal work execution unit times out:
6
6
  1. `{{RUNTIME_HELPER_CMD}} artifact list .prizmkit/specs/{{FEATURE_SLUG}}` — check what exists
@@ -8,6 +8,10 @@ Implement {{FEATURE_ID}}: "{{FEATURE_TITLE}}".
8
8
 
9
9
  {{FEATURE_DESCRIPTION}}
10
10
 
11
+ ### User Context
12
+
13
+ {{USER_CONTEXT}}
14
+
11
15
  ### Scope Rule
12
16
 
13
17
  Current scope is limited to the intersection of:
@@ -51,9 +51,9 @@ FORBIDDEN_THREE_STRIKE = "3-" + "strike"
51
51
  FORBIDDEN_TWENTY_STEP = "20-" + "step window"
52
52
 
53
53
  REVIEW_PROMPT_REQUIRED = (
54
- "The current Main Agent is the only Code Review executor",
55
- "Do not invoke another review skill or review workflow",
56
- "finder, verifier, audit, compatibility review, verification, or gap sweep",
54
+ "mandatory Main-Agent review",
55
+ "strict structural capability gate",
56
+ "skill-owned independent Reviewer",
57
57
  "`review-report.md` is the only persisted review artifact",
58
58
  )
59
59
 
@@ -1235,10 +1235,10 @@ class TestDirectOrchestratorImplementationPrompts:
1235
1235
  assert FORBIDDEN_TEST_CMD_PLACEHOLDER not in rendered
1236
1236
  assert FORBIDDEN_THREE_STRIKE not in rendered
1237
1237
  assert FORBIDDEN_TWENTY_STEP not in rendered
1238
- assert "Main-Agent review loop" in rendered
1238
+ assert "mandatory Main-Agent review" in rendered
1239
1239
  assert "up to ten completed rounds" in rendered
1240
- assert "The current Main Agent is the only Code Review executor" in rendered
1241
- assert "Do not invoke another review skill or review workflow" in rendered
1240
+ assert "strict structural capability gate" in rendered
1241
+ assert "skill-owned independent Reviewer" in rendered
1242
1242
  assert "low=0" not in rendered
1243
1243
  assert "Reviewer 3" not in rendered
1244
1244
 
@@ -1366,9 +1366,19 @@ class TestContinuationHandoff:
1366
1366
  assert checkpoint_cursor(checkpoint)["first_cursor"] == "S02 (active)"
1367
1367
 
1368
1368
 
1369
- # ---------------------------------------------------------------------------
1370
- # F-033 headless prompt cleanup and platform-aware paths
1371
- # ---------------------------------------------------------------------------
1369
+ def test_modular_feature_prompt_renders_user_context(tmp_path):
1370
+ prompt = _render_feature_prompt(
1371
+ tmp_path / "user-context",
1372
+ mode="standard",
1373
+ user_context=["Use the existing event envelope", "Keep the public API backward compatible"],
1374
+ )
1375
+
1376
+ assert "Use the existing event envelope" in prompt
1377
+ assert "Keep the public API backward compatible" in prompt
1378
+ assert "These materials were provided by the user" in prompt
1379
+ assert "{{USER_CONTEXT}}" not in prompt
1380
+
1381
+
1372
1382
 
1373
1383
  HEADLESS_FORBIDDEN_PROMPT_STRINGS = [
1374
1384
  "### Interactive Claude Code Note",
@@ -1389,7 +1399,7 @@ def _write_feature_list(path, feature):
1389
1399
  path.write_text(json.dumps({"features": [feature], "global_context": {"language": "Python"}}), encoding="utf-8")
1390
1400
 
1391
1401
 
1392
- def _render_feature_prompt(tmp_path, mode="standard", template=None, platform="claude", browser_interaction=None, complexity=None):
1402
+ def _render_feature_prompt(tmp_path, mode="standard", template=None, platform="claude", browser_interaction=None, complexity=None, user_context=None):
1393
1403
  project = tmp_path / "project"
1394
1404
  project.mkdir(parents=True)
1395
1405
  (project / ".prizmkit" / "plans").mkdir(parents=True)
@@ -1403,6 +1413,8 @@ def _render_feature_prompt(tmp_path, mode="standard", template=None, platform="c
1403
1413
  "estimated_complexity": complexity or {"lite": "low", "standard": "medium", "full": "high"}[mode],
1404
1414
  "acceptance_criteria": ["Prompts are clean"],
1405
1415
  }
1416
+ if user_context is not None:
1417
+ feature["user_context"] = user_context
1406
1418
  if browser_interaction is not None:
1407
1419
  feature["browser_interaction"] = browser_interaction
1408
1420
  feature_list = project / ".prizmkit" / "plans" / "feature-list.json"
@@ -1801,28 +1813,29 @@ class TestBrowserOptInPromptPolicy:
1801
1813
  assert "browser-verification" not in self._checkpoint_skills(tmp_path / "global-disable" / "bugfix", "bugfix")
1802
1814
  assert "browser-verification" not in self._checkpoint_skills(tmp_path / "global-disable" / "refactor", "refactor")
1803
1815
 
1804
- def test_fresh_manual_bugfix_prompt_stops_before_commit_phase(self, tmp_path):
1816
+ def test_manual_bugfix_prompt_remains_headless_and_committable(self, tmp_path):
1805
1817
  prompt = _render_bugfix_prompt(
1806
- tmp_path / "fresh-manual-bugfix",
1818
+ tmp_path / "manual-bugfix",
1807
1819
  bug_overrides={"verification_type": "manual"},
1808
1820
  )
1809
1821
 
1810
1822
  assert "Manual / Hybrid Verification Gate" in prompt
1811
- assert "Stop before `/prizmkit-retrospective` and `/prizmkit-committer`" in prompt
1812
- assert "### Phase 4: Commit & Learn" not in prompt
1813
- assert "Run `/prizmkit-committer` with commit prefix" not in prompt
1823
+ assert "must complete manual/hybrid verification automatically" in prompt
1824
+ assert "Stop before `/prizmkit-retrospective` and `/prizmkit-committer`" not in prompt
1825
+ assert "### Headless Commit Authorization" in prompt
1826
+ assert "status=\"partial\"" not in prompt
1814
1827
 
1815
- def test_recovery_manual_bugfix_prompt_includes_commit_phase_with_substitution_policy(self, tmp_path):
1828
+ def test_recovery_manual_bugfix_uses_same_automatic_policy(self, tmp_path):
1816
1829
  prompt = _render_bugfix_prompt(
1817
1830
  tmp_path / "recovery-manual-bugfix",
1818
1831
  bug_overrides={"verification_type": "manual"},
1819
1832
  retry_count="1",
1820
1833
  )
1821
1834
 
1822
- assert "Manual / Hybrid Verification Gate" not in prompt
1823
- assert "Recovery-class session: automated verification may substitute for manual/hybrid UAT" in prompt
1824
- assert "### Phase 4: Commit & Learn" in prompt
1825
- assert "Run `/prizmkit-committer` with commit prefix" in prompt
1835
+ assert "Manual / Hybrid Verification Gate" in prompt
1836
+ assert "must complete manual/hybrid verification automatically" in prompt
1837
+ assert "Recovery-class session: automated verification may substitute" not in prompt
1838
+ assert "### Headless Commit Authorization" in prompt
1826
1839
 
1827
1840
 
1828
1841
  class TestHeadlessPromptCleanupF033:
@@ -1918,9 +1931,9 @@ class TestHeadlessPromptCleanupF033:
1918
1931
  refactor_prompt = _render_refactor_prompt(tmp_path / "refactor-mixed", platform="claude")
1919
1932
 
1920
1933
  assert "{{" + "REVIEWER_" + "SUBAGENT_PATH" + "}}" not in replacements
1921
- assert "Main-Agent review loop" in refactor_prompt
1922
- assert "The current Main Agent is the only Code Review executor" in refactor_prompt
1923
- assert "Do not invoke another review skill or review workflow" in refactor_prompt
1934
+ assert "mandatory Main-Agent review" in refactor_prompt
1935
+ assert "strict structural capability gate" in refactor_prompt
1936
+ assert "skill-owned independent Reviewer" in refactor_prompt
1924
1937
  assert "Reviewer 3" not in refactor_prompt
1925
1938
 
1926
1939
  def test_bugfix_refactor_explicit_codex_override(self, tmp_path, monkeypatch):
@@ -1942,9 +1955,9 @@ class TestHeadlessPromptCleanupF033:
1942
1955
  refactor_prompt = _render_refactor_prompt(tmp_path / "refactor-codex", platform="claude", explicit_platform="codex")
1943
1956
 
1944
1957
  assert "{{" + "REVIEWER_" + "SUBAGENT_PATH" + "}}" not in replacements
1945
- assert "Main-Agent review loop" in refactor_prompt
1946
- assert "The current Main Agent is the only Code Review executor" in refactor_prompt
1947
- assert "Do not invoke another review skill or review workflow" in refactor_prompt
1958
+ assert "mandatory Main-Agent review" in refactor_prompt
1959
+ assert "strict structural capability gate" in refactor_prompt
1960
+ assert "skill-owned independent Reviewer" in refactor_prompt
1948
1961
  assert "Reviewer 3" not in refactor_prompt
1949
1962
 
1950
1963
 
@@ -320,7 +320,7 @@ def test_template_source_is_clean_for_headless_prompt_contract():
320
320
  assert "prizmkit-workflow" not in content
321
321
  assert "/prizmkit-test scope=this-change artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/" in content
322
322
  assert "local_commit_authorized=true" in content
323
- assert "push_authorized=false" in content
323
+ assert "push_authorized" not in content
324
324
 
325
325
 
326
326
  def test_bugfix_prompt_keeps_fine_grained_phases_out_of_external_status_contract():
@@ -559,18 +559,15 @@ class TestBugfixCheckpointGeneration:
559
559
  assert metadata["repair_round"] == 2
560
560
  assert metadata["resume_from"] == "prizmkit-implement"
561
561
 
562
- def test_manual_bugfix_keeps_test_gate_but_omits_commit_authorization(self):
563
- sections_dir = Path("dev-pipeline/templates/sections")
562
+ def test_manual_bugfix_uses_automatic_verification_and_keeps_commit_gate(self):
564
563
  sections = assemble_bugfix_sections(
565
- "standard", str(sections_dir), False, True,
564
+ "standard", "dev-pipeline/templates/sections", False, True,
566
565
  )
567
566
  names = [name for name, _ in sections]
568
567
 
569
- assert "bugfix-phase-review" in names
570
- assert "bugfix-phase-test" in names
571
568
  assert "bugfix-manual-gate" in names
572
- assert "headless-commit-authorization" not in names
573
- assert "bugfix-phase-commit-report" not in names
569
+ assert "headless-commit-authorization" in names
570
+ assert "bugfix-phase-commit-report" in names
574
571
 
575
572
  def test_rendered_bugfix_prompt_is_atomic_headless_and_local_commit_only(self, tmp_path):
576
573
  prompt = _render_bugfix_prompt(tmp_path)
@@ -581,10 +578,10 @@ class TestBugfixCheckpointGeneration:
581
578
  assert "FAST_PATH=true" not in prompt
582
579
  assert "prizmkit-workflow" not in prompt
583
580
  assert '"local_commit_authorized": true' in prompt
584
- assert '"push_authorized": false' in prompt
581
+ assert "push_authorized" not in prompt
585
582
  assert "Do not ask questions, wait for user input" in prompt
583
+ assert "Remote publication is controlled by the runtime" in prompt
586
584
  assert "push_authorized\": true" not in prompt
587
- assert "automatic push" not in prompt.lower()
588
585
  assert ".prizmkit/bugfix/B-001/" in prompt
589
586
 
590
587
  def test_setup_section_skips_and_finalization_group_expands(self):
@@ -214,7 +214,7 @@ def test_template_source_is_clean_for_headless_prompt_contract():
214
214
  assert "prizmkit-workflow" not in content
215
215
  assert "/prizmkit-test scope=this-change artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/" in content
216
216
  assert "local_commit_authorized=true" in content
217
- assert "push_authorized=false" in content
217
+ assert "push_authorized" not in content
218
218
  assert "Behavior-preservation checks remain supporting evidence" in content
219
219
 
220
220
 
@@ -399,8 +399,8 @@ class TestRefactorCheckpointGeneration:
399
399
  assert "prizmkit-workflow" not in prompt
400
400
  assert "Behavior-preservation checks collected during planning and implementation remain supporting evidence" in prompt
401
401
  assert '"local_commit_authorized": true' in prompt
402
- assert '"push_authorized": false' in prompt
403
- assert "Do not ask questions, wait for user input" in prompt
402
+ assert "push_authorized" not in prompt
403
+ assert "Remote publication is controlled by the runtime" in prompt
404
404
  assert "automatic push" not in prompt.lower()
405
405
  assert "push_authorized\": true" not in prompt
406
406