devrites 6.1.0 → 6.1.2

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 (202) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/docs/architecture.md +3 -1
  4. package/docs/cli.md +4 -1
  5. package/docs/engine/commands.md +4 -4
  6. package/docs/orchestration.md +4 -3
  7. package/docs/usage.md +1 -1
  8. package/engine/internal/lib/claims.go +12 -2
  9. package/engine/internal/lib/claims_holder.go +124 -0
  10. package/engine/internal/lib/cli_observe.go +14 -0
  11. package/engine/internal/lib/taskgraph.go +124 -0
  12. package/engine/internal/parallel/cli.go +111 -9
  13. package/engine/internal/parallel/lease.go +58 -4
  14. package/engine/internal/parallel/ops.go +244 -75
  15. package/engine/internal/parallel/select.go +31 -6
  16. package/pack/.claude/agents/devrites-plan-drafter.md +2 -1
  17. package/pack/.claude/agents/devrites-slice-wright.md +2 -1
  18. package/pack/.claude/skills/devrites-debug-recovery/SKILL.md +5 -4
  19. package/pack/.claude/skills/devrites-lib/reference/parallel-dispatch.md +7 -2
  20. package/pack/.claude/skills/devrites-lib/reference/reply-contract.md +12 -15
  21. package/pack/.claude/skills/devrites-lib/reference/standards/afk-hitl.md +28 -8
  22. package/pack/.claude/skills/devrites-lib/reference/standards/agents.md +6 -2
  23. package/pack/.claude/skills/devrites-lib/reference/standards/core.md +1 -1
  24. package/pack/.claude/skills/devrites-lib/reference/standards/one-shot-actions.md +7 -6
  25. package/pack/.claude/skills/devrites-lib/reference/standards/workflow-artifacts.md +10 -6
  26. package/pack/.claude/skills/devrites-lib/reference/workspace-artifact-schema.md +1 -1
  27. package/pack/.claude/skills/rite-autocomplete/SKILL.md +13 -11
  28. package/pack/.claude/skills/rite-autocomplete/reference/loop.md +8 -6
  29. package/pack/.claude/skills/rite-autocomplete/reference/stop-conditions.md +28 -21
  30. package/pack/.claude/skills/rite-build/SKILL.md +7 -7
  31. package/pack/.claude/skills/rite-build/reference/afk-discipline.md +8 -5
  32. package/pack/.claude/skills/rite-build/reference/checkpoint.md +1 -1
  33. package/pack/.claude/skills/rite-build/reference/one-slice-cycle.md +1 -1
  34. package/pack/.claude/skills/rite-build/reference/parallel-batch.md +33 -26
  35. package/pack/.claude/skills/rite-build/reference/phase-contract.md +10 -1
  36. package/pack/.claude/skills/rite-build/reference/spec-drift-guard.md +3 -2
  37. package/pack/.claude/skills/rite-build/reference/wright-dispatch.md +2 -2
  38. package/pack/.claude/skills/rite-define/SKILL.md +1 -1
  39. package/pack/.claude/skills/rite-handoff/SKILL.md +1 -1
  40. package/pack/.claude/skills/rite-plan/SKILL.md +1 -1
  41. package/pack/.claude/skills/rite-plan/reference/slicing.md +5 -0
  42. package/pack/.claude/skills/rite-prove/SKILL.md +4 -2
  43. package/pack/.claude/skills/rite-prove/reference/failure-triage.md +2 -1
  44. package/pack/.claude/skills/rite-spec/reference/state-workspace.md +2 -2
  45. package/pack/.claude/skills/rite-vet/reference/artifacts.md +8 -0
  46. package/pack/.claude/skills/rite-vet/reference/review-axes.md +1 -1
  47. package/pack/generated/claude/agents/devrites-plan-drafter.md +2 -1
  48. package/pack/generated/claude/agents/devrites-slice-wright.md +2 -1
  49. package/pack/generated/claude/skills/devrites-debug-recovery/SKILL.md +5 -4
  50. package/pack/generated/claude/skills/devrites-lib/reference/parallel-dispatch.md +7 -2
  51. package/pack/generated/claude/skills/devrites-lib/reference/reply-contract.md +12 -15
  52. package/pack/generated/claude/skills/devrites-lib/reference/standards/afk-hitl.md +28 -8
  53. package/pack/generated/claude/skills/devrites-lib/reference/standards/agents.md +6 -2
  54. package/pack/generated/claude/skills/devrites-lib/reference/standards/core.md +1 -1
  55. package/pack/generated/claude/skills/devrites-lib/reference/standards/one-shot-actions.md +7 -6
  56. package/pack/generated/claude/skills/devrites-lib/reference/standards/workflow-artifacts.md +10 -6
  57. package/pack/generated/claude/skills/devrites-lib/reference/workspace-artifact-schema.md +1 -1
  58. package/pack/generated/claude/skills/rite-autocomplete/SKILL.md +13 -11
  59. package/pack/generated/claude/skills/rite-autocomplete/reference/loop.md +8 -6
  60. package/pack/generated/claude/skills/rite-autocomplete/reference/stop-conditions.md +28 -21
  61. package/pack/generated/claude/skills/rite-build/SKILL.md +7 -7
  62. package/pack/generated/claude/skills/rite-build/reference/afk-discipline.md +8 -5
  63. package/pack/generated/claude/skills/rite-build/reference/checkpoint.md +1 -1
  64. package/pack/generated/claude/skills/rite-build/reference/one-slice-cycle.md +1 -1
  65. package/pack/generated/claude/skills/rite-build/reference/parallel-batch.md +33 -26
  66. package/pack/generated/claude/skills/rite-build/reference/phase-contract.md +10 -1
  67. package/pack/generated/claude/skills/rite-build/reference/spec-drift-guard.md +3 -2
  68. package/pack/generated/claude/skills/rite-build/reference/wright-dispatch.md +2 -2
  69. package/pack/generated/claude/skills/rite-define/SKILL.md +1 -1
  70. package/pack/generated/claude/skills/rite-handoff/SKILL.md +1 -1
  71. package/pack/generated/claude/skills/rite-plan/SKILL.md +1 -1
  72. package/pack/generated/claude/skills/rite-plan/reference/slicing.md +5 -0
  73. package/pack/generated/claude/skills/rite-prove/SKILL.md +4 -2
  74. package/pack/generated/claude/skills/rite-prove/reference/failure-triage.md +2 -1
  75. package/pack/generated/claude/skills/rite-spec/reference/state-workspace.md +2 -2
  76. package/pack/generated/claude/skills/rite-vet/reference/artifacts.md +8 -0
  77. package/pack/generated/claude/skills/rite-vet/reference/review-axes.md +1 -1
  78. package/pack/generated/codex/agents/devrites-plan-drafter.toml +2 -1
  79. package/pack/generated/codex/agents/devrites-slice-wright.toml +2 -1
  80. package/pack/generated/codex/skills/devrites-debug-recovery/SKILL.md +5 -4
  81. package/pack/generated/codex/skills/devrites-lib/reference/parallel-dispatch.md +7 -2
  82. package/pack/generated/codex/skills/devrites-lib/reference/reply-contract.md +12 -15
  83. package/pack/generated/codex/skills/devrites-lib/reference/standards/afk-hitl.md +28 -8
  84. package/pack/generated/codex/skills/devrites-lib/reference/standards/agents.md +6 -2
  85. package/pack/generated/codex/skills/devrites-lib/reference/standards/core.md +1 -1
  86. package/pack/generated/codex/skills/devrites-lib/reference/standards/one-shot-actions.md +7 -6
  87. package/pack/generated/codex/skills/devrites-lib/reference/standards/workflow-artifacts.md +10 -6
  88. package/pack/generated/codex/skills/devrites-lib/reference/workspace-artifact-schema.md +1 -1
  89. package/pack/generated/codex/skills/rite-autocomplete/SKILL.md +13 -11
  90. package/pack/generated/codex/skills/rite-autocomplete/reference/loop.md +8 -6
  91. package/pack/generated/codex/skills/rite-autocomplete/reference/stop-conditions.md +28 -21
  92. package/pack/generated/codex/skills/rite-build/SKILL.md +7 -7
  93. package/pack/generated/codex/skills/rite-build/reference/afk-discipline.md +8 -5
  94. package/pack/generated/codex/skills/rite-build/reference/checkpoint.md +1 -1
  95. package/pack/generated/codex/skills/rite-build/reference/one-slice-cycle.md +1 -1
  96. package/pack/generated/codex/skills/rite-build/reference/parallel-batch.md +33 -26
  97. package/pack/generated/codex/skills/rite-build/reference/phase-contract.md +10 -1
  98. package/pack/generated/codex/skills/rite-build/reference/spec-drift-guard.md +3 -2
  99. package/pack/generated/codex/skills/rite-build/reference/wright-dispatch.md +2 -2
  100. package/pack/generated/codex/skills/rite-define/SKILL.md +1 -1
  101. package/pack/generated/codex/skills/rite-handoff/SKILL.md +1 -1
  102. package/pack/generated/codex/skills/rite-plan/SKILL.md +1 -1
  103. package/pack/generated/codex/skills/rite-plan/reference/slicing.md +5 -0
  104. package/pack/generated/codex/skills/rite-prove/SKILL.md +4 -2
  105. package/pack/generated/codex/skills/rite-prove/reference/failure-triage.md +2 -1
  106. package/pack/generated/codex/skills/rite-spec/reference/state-workspace.md +2 -2
  107. package/pack/generated/codex/skills/rite-vet/reference/artifacts.md +8 -0
  108. package/pack/generated/codex/skills/rite-vet/reference/review-axes.md +1 -1
  109. package/pack/generated/devin/agents/devrites-plan-drafter.md +2 -1
  110. package/pack/generated/devin/agents/devrites-slice-wright.md +2 -1
  111. package/pack/generated/devin/skills/devrites-debug-recovery/SKILL.md +5 -4
  112. package/pack/generated/devin/skills/devrites-lib/reference/parallel-dispatch.md +7 -2
  113. package/pack/generated/devin/skills/devrites-lib/reference/reply-contract.md +12 -15
  114. package/pack/generated/devin/skills/devrites-lib/reference/standards/afk-hitl.md +28 -8
  115. package/pack/generated/devin/skills/devrites-lib/reference/standards/agents.md +6 -2
  116. package/pack/generated/devin/skills/devrites-lib/reference/standards/core.md +1 -1
  117. package/pack/generated/devin/skills/devrites-lib/reference/standards/one-shot-actions.md +7 -6
  118. package/pack/generated/devin/skills/devrites-lib/reference/standards/workflow-artifacts.md +10 -6
  119. package/pack/generated/devin/skills/devrites-lib/reference/workspace-artifact-schema.md +1 -1
  120. package/pack/generated/devin/skills/rite-autocomplete/SKILL.md +13 -11
  121. package/pack/generated/devin/skills/rite-autocomplete/reference/loop.md +8 -6
  122. package/pack/generated/devin/skills/rite-autocomplete/reference/stop-conditions.md +28 -21
  123. package/pack/generated/devin/skills/rite-build/SKILL.md +7 -7
  124. package/pack/generated/devin/skills/rite-build/reference/afk-discipline.md +8 -5
  125. package/pack/generated/devin/skills/rite-build/reference/checkpoint.md +1 -1
  126. package/pack/generated/devin/skills/rite-build/reference/one-slice-cycle.md +1 -1
  127. package/pack/generated/devin/skills/rite-build/reference/parallel-batch.md +33 -26
  128. package/pack/generated/devin/skills/rite-build/reference/phase-contract.md +10 -1
  129. package/pack/generated/devin/skills/rite-build/reference/spec-drift-guard.md +3 -2
  130. package/pack/generated/devin/skills/rite-build/reference/wright-dispatch.md +2 -2
  131. package/pack/generated/devin/skills/rite-define/SKILL.md +1 -1
  132. package/pack/generated/devin/skills/rite-handoff/SKILL.md +1 -1
  133. package/pack/generated/devin/skills/rite-plan/SKILL.md +1 -1
  134. package/pack/generated/devin/skills/rite-plan/reference/slicing.md +5 -0
  135. package/pack/generated/devin/skills/rite-prove/SKILL.md +4 -2
  136. package/pack/generated/devin/skills/rite-prove/reference/failure-triage.md +2 -1
  137. package/pack/generated/devin/skills/rite-spec/reference/state-workspace.md +2 -2
  138. package/pack/generated/devin/skills/rite-vet/reference/artifacts.md +8 -0
  139. package/pack/generated/devin/skills/rite-vet/reference/review-axes.md +1 -1
  140. package/pack/generated/omp/agents/devrites-plan-drafter.md +2 -1
  141. package/pack/generated/omp/agents/devrites-slice-wright.md +2 -1
  142. package/pack/generated/omp/skills/devrites-debug-recovery/SKILL.md +5 -4
  143. package/pack/generated/omp/skills/devrites-lib/reference/parallel-dispatch.md +7 -2
  144. package/pack/generated/omp/skills/devrites-lib/reference/reply-contract.md +12 -15
  145. package/pack/generated/omp/skills/devrites-lib/reference/standards/afk-hitl.md +28 -8
  146. package/pack/generated/omp/skills/devrites-lib/reference/standards/agents.md +6 -2
  147. package/pack/generated/omp/skills/devrites-lib/reference/standards/core.md +1 -1
  148. package/pack/generated/omp/skills/devrites-lib/reference/standards/one-shot-actions.md +7 -6
  149. package/pack/generated/omp/skills/devrites-lib/reference/standards/workflow-artifacts.md +10 -6
  150. package/pack/generated/omp/skills/devrites-lib/reference/workspace-artifact-schema.md +1 -1
  151. package/pack/generated/omp/skills/rite-autocomplete/SKILL.md +13 -11
  152. package/pack/generated/omp/skills/rite-autocomplete/reference/loop.md +8 -6
  153. package/pack/generated/omp/skills/rite-autocomplete/reference/stop-conditions.md +28 -21
  154. package/pack/generated/omp/skills/rite-build/SKILL.md +7 -7
  155. package/pack/generated/omp/skills/rite-build/reference/afk-discipline.md +8 -5
  156. package/pack/generated/omp/skills/rite-build/reference/checkpoint.md +1 -1
  157. package/pack/generated/omp/skills/rite-build/reference/one-slice-cycle.md +1 -1
  158. package/pack/generated/omp/skills/rite-build/reference/parallel-batch.md +33 -26
  159. package/pack/generated/omp/skills/rite-build/reference/phase-contract.md +10 -1
  160. package/pack/generated/omp/skills/rite-build/reference/spec-drift-guard.md +3 -2
  161. package/pack/generated/omp/skills/rite-build/reference/wright-dispatch.md +2 -2
  162. package/pack/generated/omp/skills/rite-define/SKILL.md +1 -1
  163. package/pack/generated/omp/skills/rite-handoff/SKILL.md +1 -1
  164. package/pack/generated/omp/skills/rite-plan/SKILL.md +1 -1
  165. package/pack/generated/omp/skills/rite-plan/reference/slicing.md +5 -0
  166. package/pack/generated/omp/skills/rite-prove/SKILL.md +4 -2
  167. package/pack/generated/omp/skills/rite-prove/reference/failure-triage.md +2 -1
  168. package/pack/generated/omp/skills/rite-spec/reference/state-workspace.md +2 -2
  169. package/pack/generated/omp/skills/rite-vet/reference/artifacts.md +8 -0
  170. package/pack/generated/omp/skills/rite-vet/reference/review-axes.md +1 -1
  171. package/pack/generated/pi/agents/devrites-plan-drafter.md +2 -1
  172. package/pack/generated/pi/agents/devrites-slice-wright.md +2 -1
  173. package/pack/generated/pi/skills/devrites-debug-recovery/SKILL.md +5 -4
  174. package/pack/generated/pi/skills/devrites-lib/reference/parallel-dispatch.md +7 -2
  175. package/pack/generated/pi/skills/devrites-lib/reference/reply-contract.md +12 -15
  176. package/pack/generated/pi/skills/devrites-lib/reference/standards/afk-hitl.md +28 -8
  177. package/pack/generated/pi/skills/devrites-lib/reference/standards/agents.md +6 -2
  178. package/pack/generated/pi/skills/devrites-lib/reference/standards/core.md +1 -1
  179. package/pack/generated/pi/skills/devrites-lib/reference/standards/one-shot-actions.md +7 -6
  180. package/pack/generated/pi/skills/devrites-lib/reference/standards/workflow-artifacts.md +10 -6
  181. package/pack/generated/pi/skills/devrites-lib/reference/workspace-artifact-schema.md +1 -1
  182. package/pack/generated/pi/skills/rite-autocomplete/SKILL.md +13 -11
  183. package/pack/generated/pi/skills/rite-autocomplete/reference/loop.md +8 -6
  184. package/pack/generated/pi/skills/rite-autocomplete/reference/stop-conditions.md +28 -21
  185. package/pack/generated/pi/skills/rite-build/SKILL.md +7 -7
  186. package/pack/generated/pi/skills/rite-build/reference/afk-discipline.md +8 -5
  187. package/pack/generated/pi/skills/rite-build/reference/checkpoint.md +1 -1
  188. package/pack/generated/pi/skills/rite-build/reference/one-slice-cycle.md +1 -1
  189. package/pack/generated/pi/skills/rite-build/reference/parallel-batch.md +33 -26
  190. package/pack/generated/pi/skills/rite-build/reference/phase-contract.md +10 -1
  191. package/pack/generated/pi/skills/rite-build/reference/spec-drift-guard.md +3 -2
  192. package/pack/generated/pi/skills/rite-build/reference/wright-dispatch.md +2 -2
  193. package/pack/generated/pi/skills/rite-define/SKILL.md +1 -1
  194. package/pack/generated/pi/skills/rite-handoff/SKILL.md +1 -1
  195. package/pack/generated/pi/skills/rite-plan/SKILL.md +1 -1
  196. package/pack/generated/pi/skills/rite-plan/reference/slicing.md +5 -0
  197. package/pack/generated/pi/skills/rite-prove/SKILL.md +4 -2
  198. package/pack/generated/pi/skills/rite-prove/reference/failure-triage.md +2 -1
  199. package/pack/generated/pi/skills/rite-spec/reference/state-workspace.md +2 -2
  200. package/pack/generated/pi/skills/rite-vet/reference/artifacts.md +8 -0
  201. package/pack/generated/pi/skills/rite-vet/reference/review-axes.md +1 -1
  202. package/package.json +1 -1
@@ -223,8 +223,9 @@ project/decision docs, and authoritative dependency sources; make and record rev
223
223
  implementation/test choices. Ask only about product, scope, acceptance, architecture policy,
224
224
  irreversible risk, or human-only access/action.
225
225
 
226
- Objective test/build/tool failure runs bounded `devrites-debug-recovery`; fix it or record a
227
- technical blocker. Never ask permission for another attempt, test, parser repair, or probe.
226
+ Objective test/build/tool failure runs bounded `devrites-debug-recovery`; fix it, or escalate and
227
+ park it under the [retry contract](#retry-cap-no-progress-loops-and-self-resolve). Never ask
228
+ permission for another attempt, test, parser repair, or probe.
228
229
  Close decisions at the earliest informed phase: product in spec, coverage in clarify,
229
230
  scope/risk in temper, architecture/dependencies in define, and proof/toolchain in vet. Build
230
231
  keeps only unavailable-pre-code or mandatory action-time checkpoints.
@@ -350,7 +351,7 @@ access, safety and irreversible-action boundaries independently stop work.
350
351
  invariant + defect mechanism + minimal reproduction/decisive failure signal.
351
352
  DEC/DRIFT IDs, line numbers, wording and splitting one cause create no new budget.
352
353
  - **Cap no-progress retries:** three no-progress attempts per exact causal fingerprint
353
- across wright/recovery. Only a correction whose narrow recheck leaves that cause
354
+ and strategy across wright/recovery. Only a correction whose narrow recheck leaves that cause
354
355
  open or reproduces its failure consumes an attempt.
355
356
  Closing a prior finding with discriminating evidence is progress: resolve it,
356
357
  do not charge. A new Critical or Important finding gets its own budget only for
@@ -384,11 +385,30 @@ access, safety and irreversible-action boundaries independently stop work.
384
385
  - **Reconcile terminal cursors.** Retained distinct Critical/Important evidence below
385
386
  cap resumes despite stale `Next step: none`; age/spent action authority is not exhaustion.
386
387
  <!-- workflow-artifact-adapter: {"module":"devrites-lib/reference/standards/workflow-artifacts.md","entry":"unattended root reaches current admitted Workflow Artifact work","action":"invoke classifier; execute returned route without wright/slice charge","return":"saved lifecycle phase/action; no intermediate reply"} -->
387
- - **Classify exhaustion:** human-owned contract/risk/access gaps open their gate.
388
- Otherwise preserve reproduction/dead ends, set `Status: blocked` and
389
- `Next step: none — technical recovery exhausted; requires new evidence or changed failure conditions`.
390
- Emit no phase command, retry-permission question or `/rite-resolve`.
391
- Reinvocation with unchanged cause stays blocked; it never resets the cap.
388
+ - **Escalate a spent strategy; never stop on it.** Three no-progress attempts spend
389
+ the fingerprint's current *strategy*, not the work. Record that strategy and its
390
+ attempts under `## Dead ends`, then the controlling caller escalates inline in the
391
+ same invocation: re-diagnose from the reproduction and dead ends, take the first
392
+ class below that still has an untried strategy, run `/rite-plan repair` plus
393
+ narrow Vet for it, and resume with a fresh three-attempt budget. Classes, in order:
394
+ (1) **shared root cause**: fix the owner every failing path routes through and
395
+ enforce it across all callers instead of another local guard; (2) **boundary
396
+ redesign**: acceptance-preserving reslice or redesign of the failing seam;
397
+ (3) **diagnostic amplification**: add discriminating probes or fixtures, then
398
+ correct from that evidence. A recorded strategy, or a rewording of one, never
399
+ repeats. Escalation never weakens tests, validators or acceptance. Each
400
+ fingerprint gets at most three escalations per activation; record each in
401
+ `drift.md` with its class and strategy.
402
+ - **Park, finish the rest, then stop once.** Human-owned contract/risk/access gaps
403
+ open their gate. Otherwise, with every escalation spent, mark the fingerprint
404
+ `parked` in `drift.md`, keep its reproduction and dead ends, and continue every
405
+ step that does not depend on it. Only when nothing runnable remains, set
406
+ `Status: blocked` and
407
+ `Next step: <invoking command> — technical recovery parked; reinvoke to reopen with fresh escalation`.
408
+ Emit no retry-permission question or `/rite-resolve`. A genuinely new
409
+ user-issued activation appends `reopened: <date>` to each parked fingerprint and
410
+ grants it three fresh escalations, counted from that line; wakes, compaction and
411
+ nested re-entry of the same run never reset counts.
392
412
  - **Resolve agent-owned questions first** from code/docs/decisions. Human communication
393
413
  is for blocked environment, handover, inaccessible critical information or missing
394
414
  credentials/permission—not writing, testing or review. Blocking/escalating/
@@ -62,7 +62,9 @@ a human plus an agent) can share one working tree. Before a same-tree writer
62
62
  starts, it records an advisory claim — `devrites-engine claim add --session
63
63
  <id> <paths>` — retains the returned `<claim-id>`, then checks the same paths
64
64
  with `devrites-engine claim check --session <id> <paths>`; a held claim from a
65
- live foreign session is a stop-and-report, not a merge-later problem. On every
65
+ live foreign session is never merged later or overridden. Unattended, skip only
66
+ work that needs those paths, run independent work, and re-check `claim list --all`
67
+ before stopping; stop and report the holder only when nothing independent remains. On every
66
68
  host-confirmed terminal path after `add` ([unknown outcomes keep it](../parallel-dispatch.md#cancellation-and-terminal-reconciliation)) — return,
67
69
  rejected result, stop, or a launch refused with no handle — run
68
70
  `devrites-engine claim release --session <id> --id <claim-id>`. Claims expire
@@ -73,7 +75,9 @@ Claims cover product paths only; root-authored `.devrites/**` files use
73
75
  Expiry is not proof the holder stopped: size `claim add --ttl <minutes>` to the
74
76
  expected write (engine max 240) and re-add before it lapses; before writing, also
75
77
  read `claim list --all` — a foreign `expired` claim on overlapping paths whose
76
- session is not proven terminal counts as held (stop and report). **Failing case:**
78
+ session is not proven terminal counts as held (stop and report). `dead` (engine-proven
79
+ exited holder) or `released` is terminal: reconcile per
80
+ [§ Cancellation](../parallel-dispatch.md#cancellation-and-terminal-reconciliation). **Failing case:**
77
81
  session B's `claim check` passes at minute 35 over session A's still-running wright.
78
82
 
79
83
  ## Independence
@@ -87,7 +87,7 @@ Verdict discipline — no vacuous verdicts:
87
87
 
88
88
  ## Caller-owned technical backtracking
89
89
 
90
- When a rite invokes an earlier rite inline to repair an agent-owned technical gap, the original rite stays the controlling caller: a nested `STOP` is a phase boundary, not user-facing. The caller re-reads `state.md`, follows the return cursor/`next_action`, and resumes unless a human-owned, safety, access, budget, or exhausted-recovery stop is active ([Persistence before stopping](#persistence-before-stopping-handoff-discipline)). Derive `exhausted-recovery` from the fingerprint's recorded no-progress attempts, not from a stale `state.md` label; one consumed authorization doesn't exhaust offline recovery from retained new evidence.
90
+ When a rite invokes an earlier rite inline to repair an agent-owned technical gap, the original rite stays the controlling caller: a nested `STOP` is a phase boundary, not user-facing. The caller re-reads `state.md`, follows the return cursor/`next_action`, and resumes unless a human-owned, safety, access, budget, or parked-recovery stop is active ([Persistence before stopping](#persistence-before-stopping-handoff-discipline)). Derive `parked-recovery` from the fingerprint's recorded no-progress attempts and escalations, not from a stale `state.md` label; one consumed authorization doesn't exhaust offline recovery from retained new evidence.
91
91
 
92
92
  An intermediate `Next step` is cold-resume metadata. Do not ask the human to
93
93
  copy routine `/rite-plan repair`, `/rite-vet`, `/rite-build`, or proof-rerun
@@ -73,8 +73,9 @@ Keep two budgets separate:
73
73
  Cold resume does not make that fingerprint old or exhausted. Derive its offline
74
74
  no-progress count from `drift.md` and `evidence.md`; while the count is below the
75
75
  cap, resume recovery even if a prior writer stored `blocked` / `Next step: none`.
76
- That terminal cursor is valid only for a human/safety gate, an actually exhausted
77
- fingerprint, or a proven absence of any safe retention/amplification design.
76
+ A blocked cursor is valid only for a human/safety gate or a parked fingerprint
77
+ with no independent work left; a missing safe retention/amplification design
78
+ escalates to the next correction class.
78
79
 
79
80
  A new real attempt is normally admissible only after the affected plan and fixtures
80
81
  are re-vetted, the failure condition is shown changed, and any required fresh
@@ -98,7 +99,7 @@ claim the runtime failure condition changed: the independently proven change is
98
99
  evidence-acquisition invariant, and the attempt's acceptance signal is the promised
99
100
  unique retained boundary (or action success).
100
101
 
101
- Terminal `Next: none` is valid only when no safe in-scope diagnostic-amplification
102
- seam exists, the required change is human/risk/scope owned, or the exact evidence-gap
103
- fingerprint exhausts bounded recovery. A missing old artifact alone is not terminal,
104
- and an amplification attempt never inherits authorization from the failed action.
102
+ When no safe in-scope diagnostic-amplification seam exists, escalate or park per
103
+ [`afk-hitl.md`](afk-hitl.md#retry-cap-no-progress-loops-and-self-resolve); only a
104
+ human/risk/scope-owned change stops for a human. A missing old artifact alone is not
105
+ terminal, and an amplification attempt never inherits authorization from the failed action.
@@ -326,12 +326,16 @@ Epoch starts 1. `FAILED` records preimages/cleanup/epoch/fingerprint/reason/
326
326
  boundary/route/no-progress count. Resolved fingerprints close; a different
327
327
  invariant gets a distinct fingerprint. Handoff death resumes its retry epoch with
328
328
  prior rows immutable. `WA-OP-011/012` enforce independent fingerprint/epoch caps
329
- and terminal source cleanup. Exhaustion records:
329
+ and terminal source cleanup. Exhaustion closes this admission, not the work:
330
+ the controlling caller escalates it under the
331
+ [retry contract](afk-hitl.md#retry-cap-no-progress-loops-and-self-resolve)
332
+ through `PLAN_VET_REPAIR`, and a re-vetted changed design re-admits under a new
333
+ identity with fresh epochs. A fully escalated fingerprint parks. Exhaustion records:
330
334
 
331
335
  ```text
332
- status=blocked
336
+ status=running
333
337
  exhaustion_cause=<same-fingerprint-count|total-epoch-limit>
334
- next_action=none — technical recovery exhausted; requires new evidence or changed failure conditions
338
+ next_action=/rite-plan repair <slug> — escalate exhausted workflow attempt
335
339
  ```
336
340
 
337
341
  The journal, evidence section, and observer retain that cause; epoch exhaustion
@@ -343,7 +347,7 @@ Precedence: busy owner; safety/access/approval gate; completed historical; activ
343
347
  journal; `CLEANED`; missing/stale authority; stale writer evidence; current
344
348
  admission. `PROVED|CLEANING` resumes cleanup; install-through-`PROVING`, rollback,
345
349
  or failure cleanup routes offline; retryable `FAILED` routes correction/retry;
346
- `EXHAUSTED` blocks; `PREPARING|PREPARED` resumes only with current authority.
350
+ `EXHAUSTED` escalates; `PREPARING|PREPARED` resumes only with current authority.
347
351
  There is no actor-history migration or backfill.
348
352
 
349
353
  |Route|Owner|Exact action|Durable state/status/next action|Cursor/output|
@@ -356,7 +360,7 @@ There is no actor-history migration or backfill.
356
360
  | `VERIFY_EXISTING`|controlling root|verify `CLEANED`, targets, proof, and product separation; do not reinstall|restore saved return phase/action|no retry/slice/action budget|
357
361
  | `NO_BACKFILL`|controlling root|no action|completed state unchanged|no new output|
358
362
  | `WAIT_ACTIVE_OWNER`|non-owner|no write; stop invocation|shared state unchanged|fixed owner-busy diagnostic|
359
- | `BLOCKED_EXHAUSTED`|controlling root|no attempt 4|blocked with exact exhausted next action|fixed exhausted diagnostic|
363
+ | `BLOCKED_EXHAUSTED`|controlling root|no attempt 4 on this admission; escalate through `PLAN_VET_REPAIR` or park per retry contract|`status=running`, exact exhausted `next_action`; parked keeps the parked-recovery action|fixed exhausted diagnostic; no intermediate reply|
360
364
  | `BLOCKED_GATE`|controlling root|follow existing safety/access/approval gate|gate-owned state|gate output; never reinterpret as retry|
361
365
 
362
366
  |Scenario ID|Trigger|Exact route / action|Durable consequence|Forbidden behavior|
@@ -422,7 +426,7 @@ pairs remain injective for actionable seams.
422
426
  | `devrites-debug-recovery/SKILL.md`|durable active failure or ambiguous admitted state|`OFFLINE_RECOVERY`; correct offline, re-preflight, narrow Vet, retry only under cap|saved caller or exact Plan/Vet route|
423
427
  | `rite-autocomplete/SKILL.md`|lifecycle cursor encounters admitted set or resumable journal|invoke classifier; execute returned route internally|saved phase/action; zero intermediate reply|
424
428
  | `rite-autocomplete/reference/loop.md`|loop tick sees Workflow Artifact trigger/state|invoke classifier once under owner lock; no actor-history migration|same loop cursor; no budget charge for verify/rerun|
425
- | `rite-autocomplete/reference/stop-conditions.md`|classifier returns owner-busy, exhausted, or existing hard gate|stop on exact `WAIT_ACTIVE_OWNER`, `BLOCKED_EXHAUSTED`, or `BLOCKED_GATE` result|unchanged cursor plus fixed route-owned output|
429
+ | `rite-autocomplete/reference/stop-conditions.md`|classifier returns owner-busy, exhausted, or existing hard gate|escalate `BLOCKED_EXHAUSTED`; on `WAIT_ACTIVE_OWNER` run independent work and recheck; stop on exact `BLOCKED_GATE` result|unchanged cursor plus fixed route-owned output|
426
430
  | `rite-build/SKILL.md`|Vet-ready admitted bytes require root authorship outside product wright|`ROOT_TRANSACTION`; root writes only admitted `.devrites/**` targets|saved Build slice cursor; wright product allowlist unchanged|
427
431
  | `rite-build/reference/phase-contract.md`|Build gate enters or resumes transaction|invoke canonical operation table; reconcile exact result|same slice/checkpoint cursor or Plan/Vet route|
428
432
  | `rite-prove/SKILL.md`|Prove consumes installed Workflow Artifact or `CLEANED` rerun|`VERIFY_EXISTING` or admitted proof path ending `PROVE_AND_RETURN`|saved Prove cursor; stop before real action|
@@ -237,7 +237,7 @@ slices; use `none` when they do not apply. Complexity above 3 triggers reslicing
237
237
  unless the stated reason makes the boundary irreducible. A Writer allowlist of 12+
238
238
  files prints an engine `ADVISORY size:` line (`check task-graph`, `check slice`;
239
239
  never blocking): split it acceptance-preserving, or add `Size rationale:` naming
240
- the inseparable capability.
240
+ the inseparable capability; `ADVISORY hub:` takes a seam slice or `Serial rationale:`.
241
241
 
242
242
  ## Read next by phase
243
243
 
@@ -47,14 +47,16 @@ executable controller/harness/bundle bytes or a missing writer, read
47
47
  likewise internal when current authority resolves it.
48
48
  - Always follow agent-owned backward edges through repair, affected Vet,
49
49
  correction, and proof. A nested `STOP`/`Next step` is not a user handoff.
50
- Pause only for a shared human/safety/access/exhaustion condition.
50
+ Pause only for a shared human/safety/access condition.
51
51
  - **Do not confuse an action budget with recovery exhaustion.** Spent action
52
52
  authority blocks another real execution, not offline correction of retained
53
53
  Critical/Important evidence. Stop for fresh GO only after changed conditions
54
54
  and READY Vet.
55
- - Every exact causal fingerprint gets at most three no-progress corrections.
56
- Closing one is progress; a distinct Critical/Important invariant has its own
57
- budget. Lower severity cannot prolong recovery.
55
+ - Every exact causal fingerprint gets three no-progress corrections per strategy.
56
+ A spent strategy escalates to a new correction class inline; after three
57
+ escalations it parks while independent work continues. Never ask permission to
58
+ retry. Closing one is progress; a distinct Critical/Important invariant has its
59
+ own budget. Lower severity cannot prolong recovery.
58
60
  - Do not stop on `--max-slices`, sentinel `max_slices`, `max_agents`,
59
61
  `max_minutes`, or `max_review_queue`. Count failed, malformed, and
60
62
  unavailable leaf calls.
@@ -77,7 +79,7 @@ executable controller/harness/bundle bytes or a missing writer, read
77
79
  Before honoring `blocked` with terminal `next_action`,
78
80
  reconcile retained consumptive evidence and fingerprint attempts from
79
81
  `drift.md`/`evidence.md`; a retained fingerprint below its cap resumes offline
80
- recovery.
82
+ recovery, and this new invocation reopens each parked fingerprint.
81
83
  <!-- workflow-artifact-adapter: {"module":"devrites-lib/reference/standards/workflow-artifacts.md","entry":"lifecycle cursor encounters admitted set or resumable journal","action":"invoke classifier; execute returned route internally","return":"saved phase/action; zero intermediate reply"} -->
82
84
  Reconstruct a missing return cursor only from
83
85
  the current phase and exact approved action in `test-plan.md`/evidence, never
@@ -104,8 +106,8 @@ executable controller/harness/bundle bytes or a missing writer, read
104
106
  `/rite-review` → `/rite-seal`. Read and execute each skill; durable files, not
105
107
  chat, carry state. Apply the mutable post-vet budget before first Build.
106
108
  Build runs the largest eligible path-disjoint batch (cap: this invocation's
107
- `--parallel N`, else sentinel `max_parallel`, else 10) and recomputes after
108
- every completed round until no pending slice remains; a one-slice round is serial for that round only, then
109
+ `--parallel N`, else sentinel `max_parallel`, else 10) and refills a slot
110
+ per landing until no pending slice remains; a one-slice round is serial for that round only, then
109
111
  selection runs again (host isolation still forces serial when concurrent writers
110
112
  cannot be separated). When `--parallel N`
111
113
  is present, pass it into `/rite-build` and do not consult leftover sentinel
@@ -116,15 +118,15 @@ executable controller/harness/bundle bytes or a missing writer, read
116
118
  route agent-owned red results through bounded recovery.
117
119
  Red gates block forward advancement and enter caller-owned recovery. Stop on
118
120
  hard risk, escalating, irreversible-risk, access, blocking with no
119
- recommended option, remaining NO-GO, or the exact fingerprint's proven
120
- exhaustion. An open blocking question that already names a ranked recommended
121
+ recommended option, remaining NO-GO, or parked fingerprints with no
122
+ independent work left. An open blocking question that already names a ranked recommended
121
123
  option (`proposed` or option 1 labelled Recommended) auto-resolves through
122
124
  `devrites-engine state resolve` and continues (a missing or failing resolver is
123
125
  the bounded resolver-failure stop); do not emit `/rite-resolve` as
124
126
  a user handoff. Exception: a question whose answer would add acceptance or
125
127
  product scope is never auto-resolved by a recommended option; it stops for a human.
126
- Technical exhaustion records terminal
127
- `Next step: none`, never a routine phase command. **Completion:** no stop is active, or its cursor and reason are durable.
128
+ A spent strategy escalates; parked recovery records
129
+ `Next step: /rite-autocomplete`, never a routine phase command. **Completion:** no stop is active, or its cursor and reason are durable.
128
130
  6. **Seal boundary.** Without a ship flag, leave the sealed workspace unshipped and
129
131
  open the next recorded continuation
130
132
  ([loop.md § Sequence continuation](reference/loop.md#sequence-continuation))
@@ -65,7 +65,7 @@ Workspace files carry state; chat does not. Read and execute each phase skill:
65
65
  | 3 | `/rite-temper` | harden or reduce; `expand` and extra acceptance stop for a human; irreversible risk still pauses |
66
66
  | 4 | `/rite-define` | approved plan/tasks/traceability |
67
67
  | 5 | `/rite-vet` | every plan; derive mutable budget after READY |
68
- | 6 | `/rite-build` batch loop | largest eligible path-disjoint set (cap: this invocation's `--parallel N`, else sentinel `max_parallel`, else 10; one-slice round when <2 eligible); recompute after each round; charge once per green built slice |
68
+ | 6 | `/rite-build` batch loop | largest eligible path-disjoint set (cap: this invocation's `--parallel N`, else sentinel `max_parallel`, else 10; one-slice round when <2 eligible); refill per landing; charge once per landed slice |
69
69
  | 7 | `/rite-prove` | all slices built; approved proof; recovery on red |
70
70
  | 8 | `/rite-polish` | re-prove after code edits |
71
71
  | 9 | `/rite-review` | in-scope correction then fresh proof |
@@ -106,7 +106,7 @@ parent's counter (same values, never a second charge); a child with no recorded
106
106
  parent/position is not a sequence member and the chain stops.
107
107
 
108
108
  Stop instead when: no recorded next entry; the cap or review-queue bound is
109
- reached; a human-owned, safety, access, or exhaustion condition fires; or Seal returns
109
+ reached; a human-owned, safety, access, or parked-recovery stop fires; or Seal returns
110
110
  `NO-GO`. On stop, report the sequence position, the sealed-but-unshipped workspaces, and
111
111
  the single release command (`/rite-autocomplete <release milestone> --ship`, or
112
112
  `/rite-ship` for the current sealed workspace when the sequence is complete).
@@ -138,14 +138,16 @@ agent-owned earlier-phase gap:
138
138
  Ask only for a human-owned decision or mandatory safety/access action. An open
139
139
  blocking question with `proposed` or option 1 labelled Recommended is not that
140
140
  decision: resolve it and continue. Three no-progress corrections of one exact
141
- fingerprint exhaust; preserve its reproduction and dead ends without another
142
- Plan/Vet command.
141
+ fingerprint spend only its strategy: escalate inline per the
142
+ [retry contract](../../devrites-lib/reference/standards/afk-hitl.md#retry-cap-no-progress-loops-and-self-resolve),
143
+ and park it after three escalations while independent work continues.
143
144
 
144
145
  ## Continuous caller obligation
145
146
 
146
147
  No user-facing reply is permitted while durable state contains agent-owned
147
148
  `NEEDS_REPLAN`, an intermediate Plan/Vet action, a distinct retained
148
- Critical/Important fingerprint below its cap, or an open blocking question that
149
+ Critical/Important fingerprint below its cap or with an escalation left, runnable
150
+ work independent of a parked fingerprint, or an open blocking question that
149
151
  already names a ranked recommended option. Invoke the next internal repair or
150
152
  `devrites-engine state resolve` immediately, unless that writer already hit the
151
153
  [resolver-failure stop](stop-conditions.md#other-stop-classes). **Failing case:**
@@ -155,4 +157,4 @@ Critical/Important invariant is progress, not exhaustion.
155
157
  The number of completed repair/Vet cycles is not a stop condition. Context
156
158
  pressure, compaction, session duration, and nested completion do not convert an
157
159
  internal checkpoint into a handoff. Persist it and resume until the requested
158
- rest point or a shared human/safety/access/exhaustion condition.
160
+ rest point or a shared human/safety/access/parked-recovery condition.
@@ -1,10 +1,10 @@
1
1
  # Stop conditions: when autocomplete pauses
2
2
 
3
3
  On a real stop, write `state.md` as `awaiting_human` or `blocked`, persist the
4
- reason, and include one resume command only when an actual human/safety/access
5
- action can change it. Exhausted agent-owned recovery records terminal
6
- `Next step: none` and no runnable recovery command. `--ship` never bypasses a
7
- stop.
4
+ reason, and include one resume command. Agent-owned recovery never ends the run:
5
+ a spent strategy escalates and a fully escalated fingerprint parks while other
6
+ work continues ([retry contract](../../devrites-lib/reference/standards/afk-hitl.md#retry-cap-no-progress-loops-and-self-resolve)).
7
+ `--ship` never bypasses a stop.
8
8
 
9
9
  Authority: `.claude/skills/devrites-lib/reference/standards/acceptance-preserving-reslice.md`.
10
10
 
@@ -22,8 +22,8 @@ Regardless of flags or AFK ceiling:
22
22
  - external-service contract change; or
23
23
  - filesystem destruction outside the workspace.
24
24
 
25
- Red proof cannot advance. Run bounded Debug Recovery; stop after proven
26
- exhaustion unless the remaining owner is human.
25
+ Red proof cannot advance. Run bounded Debug Recovery and escalate spent
26
+ strategies; a fully escalated fingerprint parks unless the remaining owner is human.
27
27
 
28
28
  ## Not stops: internal technical routing
29
29
 
@@ -34,13 +34,16 @@ agent-owned.
34
34
 
35
35
  Agent-owned backtracking is not a stop condition while the exact causal
36
36
  fingerprint has budget. Invoke the earlier phase, affected Vet, remediation, and
37
- proof; then resume the origin. Stop only after three no-progress corrections of
38
- that exact fingerprint or a real human/safety/access gate. Preserve reproduction,
39
- attempts, and dead ends; never offer `/rite-plan unblock` or another routine
40
- phase command. Reinvocation with unchanged evidence does not reset the cap.
41
- `unchanged` means the same fingerprint already has three recorded no-progress
42
- corrections. Closure is progress; a separately evidenced Critical/Important
43
- invariant starts its own cap and cannot extend the closed one.
37
+ proof; then resume the origin. Three no-progress corrections of that exact
38
+ fingerprint spend only its current strategy: escalate to the next correction
39
+ class inline (shared root cause, boundary redesign, diagnostic amplification)
40
+ with a fresh budget, never asking permission. After three escalations in this
41
+ activation the fingerprint parks; finish all independent work, then stop once.
42
+ Preserve reproduction, attempts, and dead ends; never offer `/rite-plan unblock`
43
+ or another routine phase command. A new user-issued `/rite-autocomplete`
44
+ reopens parked fingerprints with fresh escalation; wakes and compaction do not.
45
+ Closure is progress; a separately evidenced Critical/Important invariant starts
46
+ its own cap and cannot extend the closed one.
44
47
 
45
48
  Spent consumptive-action authorization is not technical-recovery exhaustion.
46
49
  It blocks another execution; retained new Critical/Important evidence still
@@ -50,11 +53,10 @@ authorization and never reuse old GO.
50
53
  Past evidence being irretrievable is not by itself terminal. If an in-scope
51
54
  trusted seam can uniquely discriminate the next failure, run diagnostic-
52
55
  amplification Plan repair and narrow Vet inline, then pause for fresh GO before
53
- one evidence-acquisition attempt. Use terminal none only when no safe in-scope
54
- seam exists, a real human/risk/scope gate owns it, or bounded recovery is
55
- exhausted.
56
+ one evidence-acquisition attempt. Without a safe seam, escalate to the next
57
+ class or park; only a real human/risk/scope gate stops for a human.
56
58
 
57
- <!-- workflow-artifact-adapter: {"module":"devrites-lib/reference/standards/workflow-artifacts.md","entry":"classifier returns owner-busy, exhausted, or existing hard gate","action":"stop on exact WAIT_ACTIVE_OWNER, BLOCKED_EXHAUSTED, or BLOCKED_GATE result","return":"unchanged cursor plus fixed route-owned output"} -->
59
+ <!-- workflow-artifact-adapter: {"module":"devrites-lib/reference/standards/workflow-artifacts.md","entry":"classifier returns owner-busy, exhausted, or existing hard gate","action":"escalate BLOCKED_EXHAUSTED; on WAIT_ACTIVE_OWNER run independent work and recheck; stop on exact BLOCKED_GATE result","return":"unchanged cursor plus fixed route-owned output"} -->
58
60
  ## Other stop classes
59
61
 
60
62
  - **Gate severity:** escalating always stops. Blocking with a ranked recommended
@@ -81,10 +83,15 @@ exhausted.
81
83
  pre-existing remaining value, explicit flag, sentinel cap, or post-vet pending count
82
84
  does not stop. Zero with no pending slices is normal completion.
83
85
  Malformed flag stops before any write.
86
+ - **Foreign writer:** a `live`/`expired` claim or `WAIT_ACTIVE_OWNER` held by
87
+ another session blocks only work on those paths; run independent work, re-check,
88
+ and stop only when nothing independent remains. `released`/`dead` claims are
89
+ reconciled per [§ Cancellation](../../devrites-lib/reference/parallel-dispatch.md#cancellation-and-terminal-reconciliation).
84
90
  - **Resource envelope:** overlapping run or missing AFK after arm still stops.
85
91
  Do not stop on `--max-slices`, `max_agents`, `max_minutes`, or `max_review_queue`.
86
92
  - **Confidence:** intent still cannot become testable acceptance after interview.
87
- - **Repeated failure:** the exact fingerprint's bounded recovery is exhausted.
93
+ - **Repeated failure:** not a stop. Escalate; a fully escalated fingerprint parks,
94
+ and the run stops only once no independent work remains.
88
95
  - **Resolver failure:** `devrites-engine state resolve` not found, or nonzero exit.
89
96
  Never hand-edit `questions.md`/`state.md` in its place. Not found stops at once;
90
97
  nonzero allows one identical re-run (the fingerprint is command + exit code +
@@ -99,7 +106,7 @@ disclose the exact plan, and stop for literal `GO` plus native approval. Without
99
106
  one, stop at Seal GO with `/rite-ship`. Seal GO, AFK, prior approval, and flags
100
107
  never satisfy Ship approval.
101
108
 
102
- A cold-resumable stop records `state.md` status, exact reason, and either one
103
- human-owned resume action or `none — technical recovery exhausted`; the owning
104
- question/drift/seal entry explains it. The user-facing line says what stopped
109
+ A cold-resumable stop records `state.md` status, exact reason, and one resume
110
+ action: the human-owned action, or `/rite-autocomplete` to reopen parked
111
+ fingerprints; the owning question/drift/seal entry explains it. The user-facing line says what stopped
105
112
  and, only when applicable, what human action resumes it.
@@ -75,15 +75,15 @@ Wright applies anti-slop; root verifies returns and never patches source. Refuse
75
75
 
76
76
  Omitted/`1` ≡ serial; `2`–`10` is a **cap** — the root runs the largest eligible
77
77
  path-disjoint set it can start now (`N_eff`), takes fewer when the cap cannot be
78
- filled, and recomputes after every completed round (serial slice or parallel
79
- integrate) until no pending slice remains
78
+ filled, and refills a slot per landing (serial slice or one sibling) until
79
+ no pending slice remains
80
80
  ([`parallel-batch.md` § Dynamic selection](reference/parallel-batch.md#dynamic-selection-and-re-batching)).
81
- Unattended runs (`/rite-autocomplete`, `.devrites/AFK` `max_parallel`) repeat batches
82
- inside the same run; HITL stops after each batch. This invocation's `--parallel N`
81
+ Unattended runs (`/rite-autocomplete`, `.devrites/AFK` `max_parallel`) refill
82
+ inside the same run; HITL stops after each landing. This invocation's `--parallel N`
83
83
  is the cap: leftover sentinel `max_parallel` is not consulted. Autocomplete with
84
84
  that flag also writes or replaces only `max_parallel: N`. Non-integer/`N≤0`/`N>10` hard refuse.
85
- All-green (independent review + proof) then integrate as one local `WIP(<slug>):`
86
- commit per sibling onto the current control branch (never pushed). Do not
85
+ Each sibling lands alone when its review + proof are green (`integrate --slice`):
86
+ one local `WIP(<slug>):` commit onto the control branch (never pushed). Do not
87
87
  integrate a sibling because the wright returned. A red/gap sibling gets a bounded repair
88
88
  round in its own worktree — never rebuilt from scratch while budget remains.
89
89
  Post-writer inventory and affected rechecks follow `phase-contract.md` § Independent
@@ -94,7 +94,7 @@ a human `Fix`. Exhausted repair blocks and preserves everything;
94
94
  `cleanup --force` salvages slice branches before removing worktrees —
95
95
  human-gated to abandon a batch, orchestrator-emitted only as the salvage
96
96
  step of an automatic frozen-lease re-batch.
97
- AFK charges after integrate only. Running lease blocks another
97
+ AFK charges per landed sibling only. Running lease blocks another
98
98
  `/rite-build`. Details: `parallel-batch.md`.
99
99
 
100
100
  ## Execute and reply
@@ -44,8 +44,8 @@ The controlling root owns the cap:
44
44
  before the next dispatch.
45
45
  - **Serial:** charge when fail-on-red is green and the built record is written
46
46
  (same rewrite as step 2).
47
- - **Parallel `--parallel`:** charge only after **successful serial integrate**
48
- — once per integrated green sibling. Abort / integrate-failed → charge **0**.
47
+ - **Parallel `--parallel`:** charge only after **successful integrate**
48
+ — once per landed green sibling. Abort / integrate-failed → charge **0**.
49
49
  Do not charge on worktree-green before integrate. See
50
50
  [`parallel-batch.md`](parallel-batch.md).
51
51
 
@@ -69,13 +69,16 @@ wrong contract or proof path — agent-owned recovery; never advance on broken s
69
69
  The fail-on-red path:
70
70
 
71
71
  1. Continue the same wright under `devrites-debug-recovery`, carrying exact output and dead
72
- ends; cap writer + recovery at three no-progress attempts per exact causal fingerprint.
72
+ ends; cap writer + recovery at three no-progress attempts per exact causal fingerprint
73
+ and strategy.
73
74
  A correction that closes the reproduction is progress; a different evidenced
74
75
  Critical/Important invariant starts a separate fingerprint.
75
76
  2. Green → record the slice. Product-contract/irreversible ambiguity → write the genuine
76
77
  human gate. Missing human-only credential/permission → write a human-intervention gate.
77
- 3. Any other exhausted objective failure → set `Status: blocked`, preserve the reproduction,
78
- set `Next step: none — technical recovery exhausted for <causal fingerprint>; requires new evidence or changed failure conditions`, and STOP without a qid or runnable phase command. Reinvocation with the unchanged fingerprint remains blocked and does not reset the cap.
78
+ 3. Any other spent strategy → escalate inline to the next correction class; after three
79
+ escalations park the fingerprint and build every slice that does not depend on it,
80
+ per the [retry contract](../../devrites-lib/reference/standards/afk-hitl.md#retry-cap-no-progress-loops-and-self-resolve).
81
+ Never ask a qid or permission to retry; never hand back a routine phase command.
79
82
  4. Fire `notify:` only for an actual `awaiting_human` transition.
80
83
 
81
84
  AFK never starts the next slice while checks are red and never asks the human to approve
@@ -18,7 +18,7 @@ the orchestrator pauses for approval before landing it.
18
18
  and fail-on-red proof are green, with no open Critical/Important and no repair
19
19
  wright still in flight. Serial: git recipe below (skip empty index) or isolated
20
20
  FF of a matching `transfer_commit`. Parallel: `devrites-engine parallel
21
- integrate --apply-to-control` (no second control `git commit`).
21
+ integrate --slice <id> --apply-to-control` (no second control `git commit`).
22
22
  - **Do not:** when a wright returns; before review/proof; with red/gap findings;
23
23
  fast-forward an isolated transfer onto control before those checks.
24
24
 
@@ -28,7 +28,7 @@ RECORD → orchestrator: after green verification, update state.md/evidence.m
28
28
  upsert the authoritative candidate manifest from the actual scoped diff
29
29
  (CHECKPOINT) → only now, with review+proof green: local WIP(<slug>): <imperative summary>
30
30
  on the control branch (no slice id) → checkpoint.md
31
- NEXT → HITL root reports and stops. AFK with parallel cap>1: return to parallel-batch selection and run the new N_eff; otherwise repeat under afk-discipline.md
31
+ NEXT → HITL root reports and stops. AFK with parallel cap>1: return to parallel-batch selection to refill; otherwise repeat under afk-discipline.md
32
32
  ```
33
33
 
34
34
  ## Why the boundary matters
@@ -36,14 +36,14 @@ Select **greedily in plan order**: pass every currently dependency-ready pending
36
36
  `N_eff = 1` → one serial round; nothing pending → Prove. A cap that cannot be filled
37
37
  is normal: take fewer. Serial is this round's size, not the rest of the run.
38
38
 
39
- **Re-batch automatically after every completed round** (parallel integrate+cleanup or
40
- a serial slice). Re-read `state.md`, pending slices, and the tree, then run
41
- `parallel select` again: finished work leaves the pending set, and satisfied
42
- dependencies unlock new slices. Under `.devrites/AFK` and `/rite-autocomplete` the
43
- repeat is the same run — HITL stops after each batch. `--parallel 5` with one eligible
44
- slice runs that one; when two to five then become eligible, the next round takes that
45
- many. **Failing case:** the run stays one-by-one after a serial round even though more
46
- slices are now eligible under the same cap.
39
+ **Refill per landing; never wait for the batch.** Each sibling lands alone when
40
+ green ([Lifecycle](#lifecycle) step 6). Then re-read `state.md`, pending slices, and
41
+ the tree and run `parallel select --cap N --slug <slug>`: unlanded siblings hold
42
+ their slots and paths, landed ones count as built, and only new picks print;
43
+ `parallel add` starts each from the control tip and its wright dispatches at once.
44
+ No lease → plain `select` + `create`. AFK/autocomplete is one run; HITL stops after
45
+ each landing. **Failing case:** three siblings are green, one is repairing, and no
46
+ new slice starts.
47
47
 
48
48
  ## Path-disjoint
49
49
 
@@ -109,22 +109,27 @@ Lease: `batch_id`, `created_at`, `base_sha`, `n`,
109
109
  headroom bounds the batch size — one batch never assumes unbounded reviewers.
110
110
  5. Non-green siblings → **repair round** (below) in the same worktrees; lease
111
111
  stays `running` — no abort while repair budget remains. A green sibling →
112
- `parallel record-green`. No partial integrate. All green → integrate.
112
+ `parallel record-green`, then step 6 for it alone.
113
113
  A recoverable RED blocks integration but does not cancel independent safe running siblings.
114
114
  Expected test-first RED is not a terminal gate failure. Cancel only for a shared
115
115
  invalid foundation, safety/access failure, resource boundary, or explicit stop;
116
116
  preserve completed and in-progress recoverable work and classify each result.
117
- 6. `parallel integrate --apply-to-control` **only after steps 4–5 are green**:
118
- each `transfer_commit` descends from `B` and diffs path-exact vs
119
- `B`; apply each in plan order as its own local `WIP(<slug>):` commit
120
- (imperative summary, never a slice id). Staging branch, then FF. Conflict →
121
- reset to `B`, `integrate-failed`; classify under repair rounds (siblings stay
122
- in place). Never integrate because a wright returned.
123
- 7. Success: FF control (the branch that held `HEAD` when the batch started —
124
- often `main`/`master`, otherwise whatever the user was on) to the integrate
125
- tip: N local commits, never pushed; union `touched-files.md`; update
126
- state/evidence; AFK +1 per integrated sibling; optional `check candidate`.
127
- 8. Cleanup runs only after `integrate` marks the lease `complete` — work
117
+ 6. `parallel integrate --slice <id> --apply-to-control` **only after its steps
118
+ 4–5 are green**: `transfer_commit` descends from the sibling's base and diffs
119
+ path-exact vs it; apply as its own local `WIP(<slug>):` commit
120
+ (imperative summary, never a slice id). Staging branch, then FF; the engine
121
+ refuses (never rewinds) if anything but this lease moved control. Conflict →
122
+ `integrate-failed`; classify under repair rounds (siblings stay in place).
123
+ Never integrate because a wright returned.
124
+ 7. Each landing: FF control (the branch that held `HEAD` when the batch started —
125
+ often `main`/`master`, otherwise whatever the user was on) by one local commit,
126
+ never pushed; union that sibling's paths into `touched-files.md`; update
127
+ state/evidence; AFK +1 for that sibling; optional `check candidate`. Then
128
+ refill ([Dynamic selection](#dynamic-selection-and-re-batching)) and start the
129
+ feature gates on control
130
+ ([Proof tiers](phase-contract.md#proof-tiers)); the next landing waits for them
131
+ to pass, the refilled wrights do not.
132
+ 8. Cleanup runs only after the last landing marks the lease `complete` — work
128
133
  landed in control, so `parallel cleanup` removes worktrees/branches.
129
134
  Blocked/human-stopped batches keep lease, worktrees, branches — nothing is
130
135
  removed while the batch may resume. `parallel abort` + `cleanup --force`
@@ -182,18 +187,20 @@ Repair rejected work in place; never discard/rebuild while budget remains.
182
187
  exhaustion. Use plan path only if inventory proves the approach unsound.
183
188
  - Stop under the canonical retry/authority/resource conditions, or when evidence
184
189
  proves the approach unsound and no in-scope corrected decomposition exists.
185
- - Exhaustion is not abort: record one technical blocker (`Status: blocked`;
186
- `Next step: none — technical recovery exhausted; requires new evidence or changed failure conditions`), preserve
187
- lease/worktrees/branches, STOP — same fingerprint stays blocked on
188
- reinvoke; new evidence resumes repair in place. Human-owned decisions use
189
- the drift-guard question and wait.
190
+ - A spent strategy is not abort: escalate per the canonical retry contract,
191
+ preserving lease/worktrees/branches; a fully escalated fingerprint parks and
192
+ the batch keeps its independent members. Repair resumes in place on
193
+ escalation or reinvocation. Human-owned decisions use the drift-guard
194
+ question and wait.
190
195
 
191
196
  ## Engine verbs
192
197
 
193
198
  ```text
194
- devrites-engine parallel select --cap <1-10> [--root <dir>] [<json-file>|-]
199
+ devrites-engine parallel select --cap <1-10> [--root <dir>] [--slug <slug>] [<json-file>|-]
195
200
  devrites-engine parallel create --root <repo> --slug <slug> --batch <id> --base <B> --json <file>|-
201
+ devrites-engine parallel add --root <repo> --slug <slug> --json <file>|-
196
202
  devrites-engine parallel record-green --root <repo> --slug <slug> --slice <id> --commit <sha>
203
+ devrites-engine parallel integrate --root <repo> --slug <slug> --slice <id> --apply-to-control
197
204
  devrites-engine parallel integrate --root <repo> --slug <slug> --apply-to-control
198
205
  devrites-engine parallel status --root <repo> --slug <slug>
199
206
  devrites-engine parallel lease-write|lease-read|lease-clear --root <repo> --slug <slug>
@@ -42,7 +42,8 @@ Spec Drift Guard still applies.
42
42
  6. **Prove.** Against the frozen pre-slice candidate inspect
43
43
  test hunks for deletion, skipping/focus, tautology, or weaker expectations.
44
44
  Wait for step 5's exact test-analyst account; missing/adverse criterion verdict is
45
- Critical. Run only `test-plan.md` repository/CI commands, record output, recheck
45
+ Critical. Run only `test-plan.md` repository/CI commands ([tier](#proof-tiers)),
46
+ record output, recheck
46
47
  `git diff --name-only`. Missing/weakened/red/source-mutating proof cannot pass.
47
48
  Pre-existing/environment-specific claims need a predating same-command,
48
49
  same-environment baseline; otherwise unresolved.
@@ -67,6 +68,14 @@ Spec Drift Guard still applies.
67
68
 
68
69
  One contract builds one slice: preserve TDD, exact paths and independent judgment.
69
70
 
71
+ ## Proof tiers
72
+
73
+ With a `test-plan.md` `## Feature gates` section, step 6 runs `Tests/proof` and every
74
+ other row; feature gates run once per parallel landing, on control, while worktree
75
+ wrights continue. The next landing and Prove wait for them; red is a fingerprint
76
+ against slices landed since the last green run. Serial same-worktree mode, and plans
77
+ without the section, run every row each round.
78
+
70
79
  ## Independent Build review
71
80
 
72
81
  After inspection, freeze full slice scope and cumulative baseline diff. Initial
@@ -82,5 +82,6 @@ The detecting phase owns backtracking and the batch sweep. Save
82
82
  `return_phase`/`return_next_action`; consume nested Plan/Vet `STOP` internally, complete
83
83
  vetted acceptance-preserving remediation, then restore the cursor and failed step.
84
84
  Never hand the human an intermediate command. The shared three-attempt causal-fingerprint
85
- cap still applies: exhaustion produces one technical blocker, while a genuinely
86
- human-owned decision uses the question format below.
85
+ cap still applies: a spent strategy escalates and a fully escalated fingerprint parks
86
+ under the [retry contract](../../devrites-lib/reference/standards/afk-hitl.md#retry-cap-no-progress-loops-and-self-resolve),
87
+ while a genuinely human-owned decision uses the question format below.