prizmkit 1.1.175 → 1.1.177

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 (34) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +2 -2
  3. package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +104 -1
  4. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +0 -2
  5. package/bundled/dev-pipeline/scripts/update-checkpoint.py +31 -3
  6. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
  7. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +1 -9
  8. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +1 -1
  9. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +1 -1
  10. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +2 -2
  11. package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +3 -3
  12. package/bundled/dev-pipeline/tests/test_checkpoint_state.py +44 -3
  13. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +31 -4
  14. package/bundled/dev-pipeline/tests/test_runtime_commit.py +155 -0
  15. package/bundled/rules/prizm/prizm-commit-workflow.md +3 -3
  16. package/bundled/skills/_metadata.json +1 -1
  17. package/bundled/skills/bug-planner/SKILL.md +27 -31
  18. package/bundled/skills/bug-planner/references/error-recovery.md +24 -24
  19. package/bundled/skills/bug-planner/references/generated-plan-review.md +5 -1
  20. package/bundled/skills/feature-planner/SKILL.md +17 -17
  21. package/bundled/skills/feature-planner/references/error-recovery.md +25 -15
  22. package/bundled/skills/feature-planner/references/generated-plan-review.md +5 -1
  23. package/bundled/skills/feature-planner/references/incremental-feature-planning.md +5 -3
  24. package/bundled/skills/feature-planner/references/new-project-planning.md +7 -4
  25. package/bundled/skills/prizmkit/SKILL.md +5 -5
  26. package/bundled/skills/prizmkit-committer/SKILL.md +21 -24
  27. package/bundled/skills/prizmkit-workflow/SKILL.md +9 -9
  28. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +8 -7
  29. package/bundled/skills/refactor-planner/SKILL.md +18 -12
  30. package/bundled/skills/refactor-planner/references/error-recovery.md +16 -8
  31. package/bundled/skills/refactor-planner/references/fast-path.md +4 -3
  32. package/bundled/skills/refactor-planner/references/generated-plan-review.md +5 -1
  33. package/package.json +1 -1
  34. package/bundled/dev-pipeline/templates/sections/subagent-timeout-recovery.md +0 -9
@@ -1,5 +1,5 @@
1
1
  {
2
- "frameworkVersion": "1.1.175",
3
- "bundledAt": "2026-08-08T09:53:47.266Z",
4
- "bundledFrom": "17d8555"
2
+ "frameworkVersion": "1.1.177",
3
+ "bundledAt": "2026-08-14T15:01:11.231Z",
4
+ "bundledFrom": "99ed585"
5
5
  }
@@ -1072,7 +1072,7 @@ def _finalize_prepared_runtime_commit(
1072
1072
  execution_root: Path,
1073
1073
  prompt: PromptGenerationResult,
1074
1074
  ) -> RuntimeCommitResult:
1075
- """Execute a prepared commit only when the checkpoint proves readiness."""
1075
+ """Let Runtime adopt and execute an eligible prepared commit request."""
1076
1076
  checkpoint = prompt.checkpoint_path
1077
1077
  artifact = prompt.artifact_path
1078
1078
  if checkpoint is None or artifact is None or not checkpoint.is_file():
@@ -1082,7 +1082,7 @@ def _finalize_prepared_runtime_commit(
1082
1082
  state = load_checkpoint_state(checkpoint, project_root=execution_root)
1083
1083
  request_path = artifact / REQUEST_FILENAME
1084
1084
  cleanup_recovery = state.semantic_complete and request_path.is_file()
1085
- if not state.semantic_commit_ready and not cleanup_recovery:
1085
+ if not state.semantic_commit_ready and not cleanup_recovery and not request_path.is_file():
1086
1086
  return RuntimeCommitResult("not_ready", "checkpoint_not_commit_ready")
1087
1087
  result = finalize_runtime_commit(
1088
1088
  execution_root,
@@ -2,6 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ import copy
5
6
  import json
6
7
  import os
7
8
  import re
@@ -92,7 +93,16 @@ def finalize_runtime_commit(
92
93
  if not state.valid:
93
94
  return RuntimeCommitResult("failed", f"invalid_checkpoint:{state.error_code}")
94
95
  if not state.semantic_commit_ready and not state.semantic_complete:
95
- return RuntimeCommitResult("not_ready", "checkpoint_not_commit_ready")
96
+ prepared = prepare_runtime_commit_handoff(
97
+ root,
98
+ artifact_dir=artifact,
99
+ checkpoint_path=checkpoint,
100
+ )
101
+ if prepared.status != "ready":
102
+ return prepared
103
+ state = load_checkpoint_state(checkpoint, project_root=root)
104
+ if not state.semantic_commit_ready:
105
+ return RuntimeCommitResult("failed", "checkpoint_not_commit_ready_after_runtime_prepare")
96
106
 
97
107
  request_path = artifact / REQUEST_FILENAME
98
108
  request, error = _load_request(request_path, root, artifact)
@@ -214,6 +224,99 @@ def finalize_runtime_commit(
214
224
  return RuntimeCommitResult("committed", "runtime_commit_completed", head, recovered)
215
225
 
216
226
 
227
+ def prepare_runtime_commit_handoff(
228
+ project_root: Path,
229
+ *,
230
+ artifact_dir: Path,
231
+ checkpoint_path: Path,
232
+ ) -> RuntimeCommitResult:
233
+ """Atomically publish COMMIT_PENDING for one valid Runtime request.
234
+
235
+ The AI session owns request creation but not Runtime readiness. Existing
236
+ COMMIT_PENDING checkpoints remain idempotently ready; blocked or otherwise
237
+ ineligible checkpoints are never rewritten by this transition.
238
+ """
239
+ try:
240
+ root = project_root.resolve()
241
+ artifact = artifact_dir.resolve()
242
+ checkpoint = checkpoint_path.resolve()
243
+ except (OSError, RuntimeError):
244
+ return RuntimeCommitResult("failed", "unsafe_artifact_identity")
245
+ if not _within(artifact, root) or not _within(checkpoint, artifact):
246
+ return RuntimeCommitResult("failed", "unsafe_artifact_identity")
247
+
248
+ state = load_checkpoint_state(checkpoint, project_root=root)
249
+ if not state.valid:
250
+ return RuntimeCommitResult("failed", f"invalid_checkpoint:{state.error_code}")
251
+ if state.semantic_complete:
252
+ return RuntimeCommitResult("not_ready", "runtime_commit_already_finalized")
253
+ if state.semantic_commit_ready:
254
+ return RuntimeCommitResult("ready", "runtime_commit_handoff_already_prepared")
255
+ if state.semantic_blocked:
256
+ return RuntimeCommitResult("not_ready", "workflow_checkpoint_blocked")
257
+
258
+ request, error = _load_request(artifact / REQUEST_FILENAME, root, artifact)
259
+ if request is None:
260
+ return RuntimeCommitResult("failed", error or "invalid_commit_request")
261
+ if request.runtime_commit_hash:
262
+ return RuntimeCommitResult("failed", "premature_runtime_commit_hash")
263
+ current_head = _git(root, "rev-parse", "HEAD")
264
+ if current_head.return_code != 0:
265
+ return RuntimeCommitResult("failed", "git_head_unavailable")
266
+ if current_head.stdout.strip().lower() != request.base_head.lower():
267
+ return RuntimeCommitResult("failed", "base_head_mismatch")
268
+
269
+ data = copy.deepcopy(state.raw_data)
270
+ if not isinstance(data, dict):
271
+ return RuntimeCommitResult("failed", "checkpoint_runtime_prepare_rejected")
272
+ raw_steps = data.get("steps")
273
+ if not isinstance(raw_steps, list):
274
+ return RuntimeCommitResult("failed", "checkpoint_runtime_prepare_rejected")
275
+ committers = [
276
+ step for step in raw_steps
277
+ if isinstance(step, dict) and step.get("skill") == "prizmkit-committer"
278
+ ]
279
+ if len(committers) != 1:
280
+ return RuntimeCommitResult("failed", "checkpoint_runtime_prepare_rejected")
281
+ committer = committers[0]
282
+ if committer.get("status") != "in_progress" or committer.get("stage_result") not in {None, ""}:
283
+ return RuntimeCommitResult("not_ready", "checkpoint_not_runtime_handoff_candidate")
284
+ committer["stage_result"] = "COMMIT_PENDING"
285
+
286
+ state_key = semantic_state_key(str(data.get("workflow_type") or ""))
287
+ semantic = data.get(state_key)
288
+ if not isinstance(semantic, dict) or semantic.get("terminal_status") is not None:
289
+ return RuntimeCommitResult("not_ready", "checkpoint_not_runtime_handoff_candidate")
290
+ semantic.update(
291
+ {
292
+ "schema_version": 1,
293
+ "orchestrator": "pipeline-runtime",
294
+ "stage": "committer",
295
+ "status": "in_progress",
296
+ "stage_result": "COMMIT_PENDING",
297
+ "current_stage": "prizmkit-committer",
298
+ "next_stage": "prizmkit-committer",
299
+ "resume_from": None,
300
+ "blocked_reason": None,
301
+ "terminal_status": None,
302
+ }
303
+ )
304
+ candidate = validate_checkpoint_data(
305
+ data,
306
+ path=checkpoint,
307
+ exists=True,
308
+ project_root=root,
309
+ )
310
+ if not candidate.valid or not candidate.semantic_commit_ready:
311
+ return RuntimeCommitResult("failed", "checkpoint_runtime_prepare_rejected")
312
+ if _write_json_atomic(checkpoint, data):
313
+ return RuntimeCommitResult("failed", "checkpoint_runtime_prepare_failed")
314
+ prepared = load_checkpoint_state(checkpoint, project_root=root)
315
+ if not prepared.semantic_commit_ready:
316
+ return RuntimeCommitResult("failed", "checkpoint_not_commit_ready_after_runtime_prepare")
317
+ return RuntimeCommitResult("ready", "runtime_commit_handoff_prepared")
318
+
319
+
217
320
  def finalize_accepted_workspace_commit(
218
321
  project_root: Path,
219
322
  *,
@@ -841,8 +841,6 @@ def assemble_sections(sections_dir, init_done, browser_enabled,
841
841
  load_section(sections_dir, "context-budget-rules.md")))
842
842
  sections.append(("directory-convention",
843
843
  load_section(sections_dir, "directory-convention-full.md")))
844
- sections.append(("timeout-recovery",
845
- load_section(sections_dir, "subagent-timeout-recovery.md")))
846
844
  sections.append(("artifact-manifest",
847
845
  load_section(sections_dir, "artifact-manifest.md")))
848
846
 
@@ -269,6 +269,24 @@ def _checkpoint_project_root(checkpoint_path):
269
269
  return str(path.parent)
270
270
 
271
271
 
272
+ def _declared_runtime_request_exists(checkpoint_path, step):
273
+ """Return whether the committer's exact declared Runtime request exists."""
274
+ if step.get("skill") != "prizmkit-committer":
275
+ return False
276
+ project_root = Path(_checkpoint_project_root(checkpoint_path)).resolve()
277
+ for artifact in step.get("required_artifacts") or ():
278
+ if not isinstance(artifact, str) or not artifact.endswith("/runtime-commit-request.json"):
279
+ continue
280
+ candidate = (project_root / artifact).resolve()
281
+ try:
282
+ candidate.relative_to(project_root)
283
+ except ValueError:
284
+ continue
285
+ if candidate.is_file():
286
+ return True
287
+ return False
288
+
289
+
272
290
  def _finalize_semantics(checkpoint_path, data, state_key):
273
291
  """Derive a deterministic terminal status after an atomic mutation."""
274
292
  candidate = validate_checkpoint_data(
@@ -345,16 +363,24 @@ def update_checkpoint(
345
363
  return {"ok": False, "error": verdict_error}
346
364
 
347
365
  semantic_update = _normalize_semantic_update(semantic_update)
348
- if semantic_update.get("stage_result") == "COMMITTED":
366
+ if semantic_update.get("stage_result") in {"COMMIT_PENDING", "COMMITTED"}:
349
367
  return {
350
368
  "ok": False,
351
- "error": "COMMITTED is Runtime-owned and cannot be written by the Prompt checkpoint helper",
369
+ "error": "COMMIT_PENDING and COMMITTED are Runtime-owned and cannot be written by the Prompt checkpoint helper",
352
370
  }
353
371
  semantic_error = _validate_semantic_update(step, semantic_update)
354
372
  if semantic_error:
355
373
  return {"ok": False, "error": semantic_error}
356
374
 
357
375
  stage_result = semantic_update.get("stage_result")
376
+ if stage_result == "COMMIT_BLOCKED" and _declared_runtime_request_exists(checkpoint_path, step):
377
+ return {
378
+ "ok": False,
379
+ "error": (
380
+ "A Runtime commit request already exists; the Prompt checkpoint helper cannot "
381
+ "downgrade the committer to COMMIT_BLOCKED. Stop and let Python Runtime validate the handoff."
382
+ ),
383
+ }
358
384
  if new_status == "completed" and step.get("skill") == "prizmkit-code-review":
359
385
  stage_result = stage_result or step.get("stage_result")
360
386
  if stage_result != "REVIEW_PASS":
@@ -434,13 +460,15 @@ def update_checkpoint(
434
460
  if err:
435
461
  return {"ok": False, "error": err}
436
462
 
463
+ prompt_semantic = dict(final_state.semantic_snapshot)
464
+ prompt_semantic.pop("commit_ready", None)
437
465
  return {
438
466
  "ok": True,
439
467
  "step_id": step.get("id"),
440
468
  "skill": step.get("skill"),
441
469
  "old_status": old_status,
442
470
  "new_status": new_status,
443
- "semantic": final_state.semantic_snapshot,
471
+ "semantic": prompt_semantic,
444
472
  }
445
473
 
446
474
 
@@ -38,7 +38,7 @@ Complete the feature in headless non-interactive mode using the active atomic sk
38
38
  5. Invoke `/prizmkit-test scope=this-change artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. Validate its report/result pair. For `TEST_NEEDS_FIXES`, classify the concrete correction into an allowed `repair_scope`; unknown/unsafe scope blocks, while a safe in-budget route re-enters Implement and requires fresh Review, configured verification, and Test. Do not duplicate the Skill's internal repair loop.
39
39
  6. Write `completion-summary.json` before retrospective and commit preparation.
40
40
  7. Invoke `/prizmkit-retrospective` with the exact artifact root, non-`.prizmkit/` `change_paths`, and `change_summary`; validate `outcome=RETRO_COMPLETE`.
41
- 8. Before commit preparation, validate the complete Git-visible workspace regardless of when or where each correct change originated. Final Review/Test authority must cover every behavior-affecting visible change; ignored paths remain local, while merge conflicts, Secrets, sensitive content, stale evidence, and known incorrect or unverifiable content block. After validating every required artifact, invoke `/prizmkit-committer operation=prepare-runtime-commit artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/ evidence_paths=<exact paths> request_path=.prizmkit/specs/{{FEATURE_SLUG}}/runtime-commit-request.json`. Require a schema-v2 pathless request and `COMMIT_REQUEST_READY`; this session then records `COMMIT_PENDING` and stops. The Python runtime re-enumerates and commits the complete non-ignored workspace with only exact causal request/checkpoint bookkeeping omitted.
41
+ 8. Before commit preparation, validate the complete Git-visible workspace regardless of when or where each correct change originated. Final Review/Test authority must cover every behavior-affecting visible change; ignored paths remain local, while merge conflicts, Secrets, sensitive content, stale evidence, and known incorrect or unverifiable content block. After validating every required artifact, invoke `/prizmkit-committer operation=prepare-runtime-commit artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/ evidence_paths=<exact paths> request_path=.prizmkit/specs/{{FEATURE_SLUG}}/runtime-commit-request.json`. Require a schema-v2 pathless request and `COMMIT_REQUEST_READY`, then stop without another committer checkpoint update or request validator. The Python Runtime validates the request, publishes commit readiness, and commits the complete non-ignored workspace with only exact causal request/checkpoint bookkeeping omitted.
42
42
 
43
43
  ## Failure Capture
44
44
 
@@ -85,14 +85,6 @@ This is a finite, headless, non-interactive session. Preserve correctness first,
85
85
 
86
86
  ---
87
87
 
88
- ## Execution-Unit Timeout Recovery
89
-
90
- If an execution unit times out:
91
- 1. `{{RUNTIME_HELPER_CMD}} artifact list .prizmkit/specs/{{FEATURE_SLUG}}` — check what exists
92
- 2. If `context-snapshot.md` exists, use it for recovery navigation together with the current diff and the smallest relevant current-source reads. Continue only the remaining steps under the owning skill's execution budget.
93
- 3. Apply the owning skill or runtime contract for retry, native continuation, strict downgrade, or Main-Agent fallback. Do not create an unapproved replacement execution unit.
94
- 4. Do not poll indefinitely after the owning contract's retry budget is exhausted; write `failure-log.md` with the timeout and last observable state when recovery is blocked.
95
-
96
88
  ## Execution
97
89
 
98
90
  {{IF_INIT_NEEDED}}
@@ -450,7 +442,7 @@ Invoke `/prizmkit-retrospective` with the exact artifact root, exact non-`.prizm
450
442
 
451
443
  Before commit preparation, validate the complete Git-visible workspace regardless of when or where each correct change originated. Code Review and Test authority must cover every behavior-affecting visible change. Ignored paths remain naturally absent; merge conflicts, Secrets, sensitive content, stale evidence, and known incorrect or unverifiable content block. Never force-add or change/interpret project ignore policy.
452
444
 
453
- After this injected session validates every required artifact, invoke `/prizmkit-committer operation=prepare-runtime-commit artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/ evidence_paths=<exact paths> request_path=.prizmkit/specs/{{FEATURE_SLUG}}/runtime-commit-request.json`. Require a schema-v2 pathless request and `COMMIT_REQUEST_READY`; this session records `COMMIT_PENDING` and stops. The Python runtime re-enumerates and commits the complete non-ignored workspace, omitting only exact causal request/checkpoint bookkeeping, then verifies the local commit and finalizes checkpoint `COMMITTED`.
445
+ After this injected session validates every required artifact, invoke `/prizmkit-committer operation=prepare-runtime-commit artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/ evidence_paths=<exact paths> request_path=.prizmkit/specs/{{FEATURE_SLUG}}/runtime-commit-request.json`. Require a schema-v2 pathless request and `COMMIT_REQUEST_READY`, then stop without another committer checkpoint update or request validator. The Python Runtime validates the request, publishes commit readiness, commits the complete non-ignored workspace while omitting only exact causal request/checkpoint bookkeeping, verifies the local commit, and finalizes checkpoint `COMMITTED`.
454
446
 
455
447
  ## Critical Paths
456
448
 
@@ -245,7 +245,7 @@ Invoke `/prizmkit-retrospective` with the exact artifact root, exact non-`.prizm
245
245
 
246
246
  **c. Runtime commit preparation**
247
247
 
248
- After this injected session validates every required artifact and confirms final Review/Test authority covers the complete behavior-affecting Git-visible workspace, invoke `/prizmkit-committer operation=prepare-runtime-commit artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/ evidence_paths=<exact paths> request_path=.prizmkit/bugfix/{{BUG_ID}}/runtime-commit-request.json`. Require a schema-v2 pathless request and `COMMIT_REQUEST_READY`; this session records `COMMIT_PENDING` and stops. Ignored files remain local. The Python runtime re-enumerates and commits the complete non-ignored workspace with only exact causal request/checkpoint bookkeeping omitted, verifies the local commit, finalizes checkpoint `COMMITTED`, and controls any later publication.
248
+ After this injected session validates every required artifact and confirms final Review/Test authority covers the complete behavior-affecting Git-visible workspace, invoke `/prizmkit-committer operation=prepare-runtime-commit artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/ evidence_paths=<exact paths> request_path=.prizmkit/bugfix/{{BUG_ID}}/runtime-commit-request.json`. Require a schema-v2 pathless request and `COMMIT_REQUEST_READY`, then stop without another committer checkpoint update or request validator. Ignored files remain local. The Python Runtime validates the request, publishes commit readiness, commits the complete non-ignored workspace with only exact causal request/checkpoint bookkeeping omitted, verifies the local commit, finalizes checkpoint `COMMITTED`, and controls any later publication.
249
249
 
250
250
  ---
251
251
 
@@ -210,7 +210,7 @@ Write `.prizmkit/refactor/{{REFACTOR_ID}}/completion-summary.json` for downstrea
210
210
 
211
211
  Complete `refactor-report` and `completion-summary` before retrospective. Then invoke `/prizmkit-retrospective` with the exact artifact root, exact non-`.prizmkit/` `change_paths`, and a concise `change_summary`. Validate `outcome=RETRO_COMPLETE`; do not stage or commit.
212
212
 
213
- After this injected session validates every required artifact and confirms final Review/Test authority covers the complete behavior-affecting Git-visible workspace, invoke `/prizmkit-committer operation=prepare-runtime-commit artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/ evidence_paths=<exact paths> request_path=.prizmkit/refactor/{{REFACTOR_ID}}/runtime-commit-request.json`. Require a schema-v2 pathless request and `COMMIT_REQUEST_READY`; this session records `COMMIT_PENDING` and stops. Ignored files remain local. The Python runtime re-enumerates and commits the complete non-ignored workspace with only exact causal request/checkpoint bookkeeping omitted, verifies the local commit, finalizes checkpoint `COMMITTED`, and controls any later publication.
213
+ After this injected session validates every required artifact and confirms final Review/Test authority covers the complete behavior-affecting Git-visible workspace, invoke `/prizmkit-committer operation=prepare-runtime-commit artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/ evidence_paths=<exact paths> request_path=.prizmkit/refactor/{{REFACTOR_ID}}/runtime-commit-request.json`. Require a schema-v2 pathless request and `COMMIT_REQUEST_READY`, then stop without another committer checkpoint update or request validator. Ignored files remain local. The Python Runtime validates the request, publishes commit readiness, commits the complete non-ignored workspace with only exact causal request/checkpoint bookkeeping omitted, verifies the local commit, finalizes checkpoint `COMMITTED`, and controls any later publication.
214
214
 
215
215
  ---
216
216
 
@@ -24,9 +24,9 @@ Use this helper to update checkpoint status. Do not hand-edit `workflow-checkpoi
24
24
  - Complete `prizmkit-code-review` only with `--status completed --stage-result REVIEW_PASS`.
25
25
  - Complete `prizmkit-test` only after validating the sibling report/result pair, with `--status completed --stage-result TEST_PASS`.
26
26
  - Complete `prizmkit-retrospective` with `--status completed --stage-result RETRO_COMPLETE`.
27
- - After this injected session validates required gates and `/prizmkit-committer` returns `COMMIT_REQUEST_READY` with `runtime-commit-request.json`, record `--status in_progress --stage-result COMMIT_PENDING` and stop normal work. The Python runtime executes the local commit and alone advances this step to `completed/COMMITTED`.
27
+ - After this injected session validates required gates and `/prizmkit-committer` returns `COMMIT_REQUEST_READY` with `runtime-commit-request.json`, stop normal work without another checkpoint-helper call for the committer. The Python Runtime alone validates the request, publishes commit readiness, executes the local commit, and advances the step to `completed/COMMITTED`.
28
28
  - For `REVIEW_NEEDS_FIXES` or `TEST_NEEDS_FIXES`, classify the concrete correction into one allowed `--repair-scope`, record the failed step and result, and let the helper select the bounded implementation route. If the scope cannot be established safely, record `WORKFLOW_BLOCKED` rather than guessing.
29
- - Record `PLAN_BLOCKED`, `IMPLEMENT_BLOCKED`, `TEST_BLOCKED`, `RETRO_BLOCKED`, or `COMMIT_BLOCKED` with `--status failed --stage-result <result>` and a useful note. The helper records terminal `WORKFLOW_BLOCKED`; never mark the failed step completed.
29
+ - Record `PLAN_BLOCKED`, `IMPLEMENT_BLOCKED`, `TEST_BLOCKED`, or `RETRO_BLOCKED` with `--status failed --stage-result <result>` and a useful note. Record `COMMIT_BLOCKED` only when Committer returned it without producing `runtime-commit-request.json`; after a request exists, stop and leave all remaining committer transitions to Runtime. The helper records terminal `WORKFLOW_BLOCKED`; never mark a failed step completed.
30
30
  - When the routed implementation step is marked `in_progress`, the helper rewinds later checkpoint steps to pending while preserving their stage-owned reports for historical evidence. Fresh Review, configured verification, and Test results are still mandatory.
31
31
  - Complete `manual-verification` when configured; do not skip a required manual/hybrid evidence gate.
32
32
  - Omit `--note` when there is no useful failure or handoff note.
@@ -23,7 +23,7 @@ After Code Review, all configured verification, `TEST_PASS`, family reports/summ
23
23
  }
24
24
  ```
25
25
 
26
- 5. Require the stage-local result `COMMIT_REQUEST_READY`. Then this injected session—not the Skill—marks `prizmkit-committer` `in_progress` with `stage_result=COMMIT_PENDING` through the checkpoint helper. Do not mark it completed or write `COMMITTED`.
27
- 6. Stop normal work after the valid request and checkpoint handoff exist. Do not run `git add`, `git commit`, `git commit --amend`, merge, push, or create additional task files.
26
+ 5. Require the stage-local result `COMMIT_REQUEST_READY` and the exact request file. After that success, do not call the checkpoint helper again for the committer stage and do not run another request validator. Stop normal work immediately.
27
+ 6. Do not run `git add`, `git commit`, `git commit --amend`, merge, push, broad source searches, or create additional task files after the valid request exists.
28
28
 
29
- The Runtime validates the pathless schema, base, complete non-ignored workspace, sensitive path safeguards, merge state, and causal bookkeeping boundary. It stages the complete workspace, omitting only the exact active request/checkpoint whose final receipt cannot truthfully precede the commit; verifies a non-empty commit with the expected parent and message; records its Git receipt; and only then finalizes `COMMITTED` and performs configured integration. A malformed, stale, unsafe, incomplete, or contradictory handoff blocks without deleting user data.
29
+ The Runtime validates the pathless schema, base, complete pre-commit checkpoint, non-ignored workspace, sensitive path safeguards, merge state, and causal bookkeeping boundary. It atomically publishes its own commit-pending checkpoint state, stages the complete workspace while omitting only the exact active request/checkpoint whose final receipt cannot truthfully precede the commit, verifies a non-empty commit with the expected parent and message, records its Git receipt, and only then finalizes `COMMITTED` and performs configured integration. A malformed, stale, unsafe, incomplete, or contradictory handoff blocks without deleting user data.
@@ -407,14 +407,13 @@ def test_update_checkpoint_reenters_failed_stage_without_stale_result(tmp_path):
407
407
  assert "stage_result" not in persisted["feature_state"]
408
408
 
409
409
 
410
- def test_checkpoint_updater_supports_every_owned_stage_result(tmp_path):
410
+ def test_checkpoint_updater_supports_every_prompt_owned_stage_result(tmp_path):
411
411
  cases = [
412
412
  ("prizmkit-plan", "PLAN_READY", "completed"),
413
413
  ("prizmkit-implement", "IMPLEMENTED", "completed"),
414
414
  ("prizmkit-code-review", "REVIEW_PASS", "completed"),
415
415
  ("prizmkit-test", "TEST_BLOCKED", "failed"),
416
416
  ("prizmkit-retrospective", "RETRO_COMPLETE", "completed"),
417
- ("prizmkit-committer", "COMMIT_PENDING", "in_progress"),
418
417
  ]
419
418
 
420
419
  assert {stage_result for _skill, stage_result, _status in cases} <= VALID_STAGE_RESULTS
@@ -695,6 +694,7 @@ def test_update_checkpoint_completes_test_pass_without_validator(tmp_path):
695
694
  persisted = json.loads(checkpoint.read_text(encoding="utf-8"))
696
695
  assert persisted["steps"][2]["status"] == "completed"
697
696
  assert persisted["steps"][2]["stage_result"] == "TEST_PASS"
697
+ assert "commit_ready" not in result["semantic"]
698
698
 
699
699
 
700
700
  def test_update_checkpoint_rejects_test_completion_for_non_pass(tmp_path):
@@ -717,7 +717,7 @@ def test_update_checkpoint_rejects_test_completion_for_non_pass(tmp_path):
717
717
  assert "requires TEST_PASS" in result["error"]
718
718
 
719
719
 
720
- def test_prompt_checkpoint_helper_rejects_runtime_owned_committed_result(tmp_path):
720
+ def test_prompt_checkpoint_helper_rejects_runtime_owned_commit_results(tmp_path):
721
721
  payload = _family_checkpoint(tmp_path, semantic={}, terminal=False)
722
722
  committer = next(
723
723
  step for step in payload["steps"] if step["skill"] == "prizmkit-committer"
@@ -726,6 +726,12 @@ def test_prompt_checkpoint_helper_rejects_runtime_owned_committed_result(tmp_pat
726
726
  committer["stage_result"] = "COMMIT_PENDING"
727
727
  checkpoint = _write(tmp_path / "workflow-checkpoint.json", payload)
728
728
 
729
+ pending = update_checkpoint(
730
+ str(checkpoint),
731
+ "prizmkit-committer",
732
+ "in_progress",
733
+ semantic_update={"stage_result": "COMMIT_PENDING"},
734
+ )
729
735
  result = update_checkpoint(
730
736
  str(checkpoint),
731
737
  "prizmkit-committer",
@@ -733,6 +739,8 @@ def test_prompt_checkpoint_helper_rejects_runtime_owned_committed_result(tmp_pat
733
739
  semantic_update={"stage_result": "COMMITTED"},
734
740
  )
735
741
 
742
+ assert pending["ok"] is False
743
+ assert "Runtime-owned" in pending["error"]
736
744
  assert result["ok"] is False
737
745
  assert "Runtime-owned" in result["error"]
738
746
  without_result = update_checkpoint(
@@ -775,6 +783,39 @@ def test_update_checkpoint_rejects_finalization_before_test_pass(tmp_path):
775
783
  assert "TEST_PASS" in result["error"]
776
784
 
777
785
 
786
+ def test_prompt_checkpoint_helper_cannot_block_after_runtime_request_exists(tmp_path):
787
+ payload = _family_checkpoint(tmp_path, semantic={}, terminal=False)
788
+ committer = next(
789
+ step for step in payload["steps"] if step["skill"] == "prizmkit-committer"
790
+ )
791
+ committer["status"] = "in_progress"
792
+ committer.pop("stage_result", None)
793
+ committer["required_artifacts"] = [
794
+ ".prizmkit/specs/feature/runtime-commit-request.json"
795
+ ]
796
+ artifact_dir = tmp_path / ".prizmkit/specs/feature"
797
+ request = artifact_dir / "runtime-commit-request.json"
798
+ request.write_text("{}", encoding="utf-8")
799
+ checkpoint = _write(artifact_dir / "workflow-checkpoint.json", payload)
800
+
801
+ result = update_checkpoint(
802
+ str(checkpoint),
803
+ "prizmkit-committer",
804
+ "failed",
805
+ semantic_update={"stage_result": "COMMIT_BLOCKED"},
806
+ )
807
+
808
+ assert result["ok"] is False
809
+ assert "request already exists" in result["error"]
810
+ persisted = json.loads(checkpoint.read_text(encoding="utf-8"))
811
+ persisted_committer = next(
812
+ step for step in persisted["steps"]
813
+ if step["skill"] == "prizmkit-committer"
814
+ )
815
+ assert persisted_committer["status"] == "in_progress"
816
+ assert "stage_result" not in persisted_committer
817
+
818
+
778
819
  def test_commit_pending_is_runtime_ready_but_not_workflow_complete(tmp_path):
779
820
  payload = _family_checkpoint(tmp_path, semantic={}, terminal=False)
780
821
  payload["steps"].insert(
@@ -433,9 +433,10 @@ class TestScopedFeatureTestGate:
433
433
  assert "--status completed --stage-result REVIEW_PASS" in rendered
434
434
  assert "--status completed --stage-result TEST_PASS" in rendered
435
435
  assert "--status completed --stage-result RETRO_COMPLETE" in rendered
436
- assert "--status in_progress --stage-result COMMIT_PENDING" in rendered
437
- assert "Python runtime" in rendered
438
- assert "alone advances this step to `completed/COMMITTED`" in rendered
436
+ assert "--status in_progress --stage-result COMMIT_PENDING" not in rendered
437
+ assert "without another checkpoint-helper call for the committer" in rendered
438
+ assert "Python Runtime alone validates the request" in rendered
439
+ assert "advances the step to `completed/COMMITTED`" in rendered
439
440
  assert "Do not hand-edit `workflow-checkpoint.json` directly." in rendered
440
441
  assert "authoritative_evidence_paths" not in rendered
441
442
 
@@ -642,6 +643,28 @@ class TestHeadlessRecoveryReframing:
642
643
  for forbidden in (deleted_section, loader, placeholder, deleted_title):
643
644
  assert forbidden not in content
644
645
 
646
+ def test_feature_prompts_do_not_include_retired_execution_unit_timeout_recovery(self):
647
+ deleted_section = "subagent-timeout-recovery.md"
648
+ deleted_title = "Execution-Unit Timeout Recovery"
649
+ active_paths = [
650
+ Path("dev-pipeline/scripts/generate-bootstrap-prompt.py"),
651
+ Path("dev-pipeline/templates/bootstrap-tier3.md"),
652
+ ]
653
+
654
+ assert (Path("dev-pipeline/templates/sections") / deleted_section).exists() is False
655
+ for path in active_paths:
656
+ content = path.read_text(encoding="utf-8")
657
+ assert deleted_section not in content
658
+ assert deleted_title not in content
659
+
660
+ sections_dir = Path("dev-pipeline/templates/sections").resolve()
661
+ rendered = "\n".join(
662
+ section for _name, section in assemble_sections(
663
+ str(sections_dir), init_done=True, browser_enabled=False,
664
+ )
665
+ )
666
+ assert deleted_title not in rendered
667
+
645
668
  def test_assembled_prompts_do_not_spawn_log_monitor_or_require_compact(self):
646
669
  sections_dir = Path("dev-pipeline/templates/sections").resolve()
647
670
  deleted_title = "Session " + "Checkpoint Awareness"
@@ -1381,6 +1404,9 @@ class TestHeadlessPromptCleanupF033:
1381
1404
  assert artifact in prompt
1382
1405
  assert "Atomic Skills write only their stage-owned artifacts and domain results" in prompt
1383
1406
  assert "COMMIT_REQUEST_READY" in prompt
1407
+ assert "do not call the checkpoint helper again for the committer stage" in prompt
1408
+ assert "do not run another request validator" in prompt
1409
+ assert "atomically publishes its own commit-pending checkpoint state" in prompt
1384
1410
  assert '"schema_version": 2' in prompt
1385
1411
  assert '"intended_paths"' not in prompt
1386
1412
  assert "complete final Git-visible workspace" in prompt
@@ -1558,7 +1584,8 @@ class TestFeatureBootstrapShellExtraction:
1558
1584
  assert "text count .prizmkit/specs/123-prompt-cleanup/plan.md --pattern \"- [ ]\"" in tier3
1559
1585
  assert "/prizmkit-committer operation=prepare-runtime-commit" in tier3
1560
1586
  assert "Require a schema-v2 pathless request and `COMMIT_REQUEST_READY`" in tier3
1561
- assert "The Python runtime re-enumerates and commits the complete non-ignored workspace" in tier3
1587
+ assert "stop without another committer checkpoint update or request validator" in tier3
1588
+ assert "The Python Runtime validates the request, publishes commit readiness" in tier3
1562
1589
  assert "validate the complete Git-visible workspace" in tier3
1563
1590
  assert "Code Review and Test authority must cover every behavior-affecting visible change" in tier3
1564
1591
  assert "Ignored paths remain naturally absent" in tier3