devrites 6.1.1 → 6.1.3

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 (221) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/docs/cli.md +4 -1
  4. package/docs/command-map.md +1 -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/commands.go +1 -1
  9. package/engine/help.go +5 -1
  10. package/engine/internal/acceptance/cli.go +14 -5
  11. package/engine/internal/acceptance/run.go +20 -5
  12. package/engine/internal/lib/apply_bundle.go +474 -0
  13. package/engine/internal/lib/claims.go +12 -2
  14. package/engine/internal/lib/claims_holder.go +124 -0
  15. package/engine/internal/lib/cli_observe.go +14 -0
  16. package/engine/internal/lib/diffscope.go +2 -1
  17. package/engine/internal/lib/taskgraph.go +124 -0
  18. package/engine/internal/parallel/cli.go +111 -9
  19. package/engine/internal/parallel/lease.go +58 -4
  20. package/engine/internal/parallel/ops.go +244 -75
  21. package/engine/internal/parallel/select.go +31 -6
  22. package/engine/main.go +4 -0
  23. package/pack/.claude/agents/devrites-plan-drafter.md +13 -3
  24. package/pack/.claude/agents/devrites-slice-wright.md +5 -1
  25. package/pack/.claude/skills/devrites-lib/reference/parallel-dispatch.md +14 -5
  26. package/pack/.claude/skills/devrites-lib/reference/standards/afk-hitl.md +24 -9
  27. package/pack/.claude/skills/devrites-lib/reference/standards/agents.md +6 -2
  28. package/pack/.claude/skills/devrites-lib/reference/standards/core.md +3 -0
  29. package/pack/.claude/skills/devrites-lib/reference/standards/gates.md +3 -0
  30. package/pack/.claude/skills/devrites-lib/reference/standards/testing.md +7 -0
  31. package/pack/.claude/skills/devrites-lib/reference/standards/workflow-artifacts.md +10 -6
  32. package/pack/.claude/skills/devrites-lib/reference/workspace-artifact-schema.md +1 -1
  33. package/pack/.claude/skills/rite-autocomplete/SKILL.md +2 -2
  34. package/pack/.claude/skills/rite-autocomplete/reference/loop.md +1 -1
  35. package/pack/.claude/skills/rite-autocomplete/reference/stop-conditions.md +6 -2
  36. package/pack/.claude/skills/rite-build/SKILL.md +7 -7
  37. package/pack/.claude/skills/rite-build/reference/afk-discipline.md +2 -2
  38. package/pack/.claude/skills/rite-build/reference/checkpoint.md +1 -1
  39. package/pack/.claude/skills/rite-build/reference/one-slice-cycle.md +3 -2
  40. package/pack/.claude/skills/rite-build/reference/parallel-batch.md +28 -21
  41. package/pack/.claude/skills/rite-build/reference/phase-contract.md +10 -1
  42. package/pack/.claude/skills/rite-build/reference/spec-drift-guard.md +3 -2
  43. package/pack/.claude/skills/rite-build/reference/wright-dispatch.md +9 -2
  44. package/pack/.claude/skills/rite-define/SKILL.md +11 -2
  45. package/pack/.claude/skills/rite-handoff/SKILL.md +1 -1
  46. package/pack/.claude/skills/rite-plan/SKILL.md +20 -9
  47. package/pack/.claude/skills/rite-plan/reference/slicing.md +5 -0
  48. package/pack/.claude/skills/rite-polish/SKILL.md +6 -4
  49. package/pack/.claude/skills/rite-prove/SKILL.md +3 -2
  50. package/pack/.claude/skills/rite-review/SKILL.md +6 -1
  51. package/pack/.claude/skills/rite-seal/SKILL.md +2 -2
  52. package/pack/.claude/skills/rite-seal/reference/phase-contract.md +7 -1
  53. package/pack/.claude/skills/rite-vet/SKILL.md +9 -5
  54. package/pack/.claude/skills/rite-vet/reference/artifacts.md +8 -0
  55. package/pack/.claude/skills/rite-vet/reference/review-axes.md +1 -1
  56. package/pack/generated/claude/agents/devrites-plan-drafter.md +13 -3
  57. package/pack/generated/claude/agents/devrites-slice-wright.md +5 -1
  58. package/pack/generated/claude/skills/devrites-lib/reference/parallel-dispatch.md +14 -5
  59. package/pack/generated/claude/skills/devrites-lib/reference/standards/afk-hitl.md +24 -9
  60. package/pack/generated/claude/skills/devrites-lib/reference/standards/agents.md +6 -2
  61. package/pack/generated/claude/skills/devrites-lib/reference/standards/core.md +3 -0
  62. package/pack/generated/claude/skills/devrites-lib/reference/standards/gates.md +3 -0
  63. package/pack/generated/claude/skills/devrites-lib/reference/standards/testing.md +7 -0
  64. package/pack/generated/claude/skills/devrites-lib/reference/standards/workflow-artifacts.md +10 -6
  65. package/pack/generated/claude/skills/devrites-lib/reference/workspace-artifact-schema.md +1 -1
  66. package/pack/generated/claude/skills/rite-autocomplete/SKILL.md +2 -2
  67. package/pack/generated/claude/skills/rite-autocomplete/reference/loop.md +1 -1
  68. package/pack/generated/claude/skills/rite-autocomplete/reference/stop-conditions.md +6 -2
  69. package/pack/generated/claude/skills/rite-build/SKILL.md +7 -7
  70. package/pack/generated/claude/skills/rite-build/reference/afk-discipline.md +2 -2
  71. package/pack/generated/claude/skills/rite-build/reference/checkpoint.md +1 -1
  72. package/pack/generated/claude/skills/rite-build/reference/one-slice-cycle.md +3 -2
  73. package/pack/generated/claude/skills/rite-build/reference/parallel-batch.md +28 -21
  74. package/pack/generated/claude/skills/rite-build/reference/phase-contract.md +10 -1
  75. package/pack/generated/claude/skills/rite-build/reference/spec-drift-guard.md +3 -2
  76. package/pack/generated/claude/skills/rite-build/reference/wright-dispatch.md +9 -2
  77. package/pack/generated/claude/skills/rite-define/SKILL.md +11 -2
  78. package/pack/generated/claude/skills/rite-handoff/SKILL.md +1 -1
  79. package/pack/generated/claude/skills/rite-plan/SKILL.md +20 -9
  80. package/pack/generated/claude/skills/rite-plan/reference/slicing.md +5 -0
  81. package/pack/generated/claude/skills/rite-polish/SKILL.md +6 -4
  82. package/pack/generated/claude/skills/rite-prove/SKILL.md +3 -2
  83. package/pack/generated/claude/skills/rite-review/SKILL.md +6 -1
  84. package/pack/generated/claude/skills/rite-seal/SKILL.md +2 -2
  85. package/pack/generated/claude/skills/rite-seal/reference/phase-contract.md +7 -1
  86. package/pack/generated/claude/skills/rite-vet/SKILL.md +9 -5
  87. package/pack/generated/claude/skills/rite-vet/reference/artifacts.md +8 -0
  88. package/pack/generated/claude/skills/rite-vet/reference/review-axes.md +1 -1
  89. package/pack/generated/codex/agents/devrites-plan-drafter.toml +13 -3
  90. package/pack/generated/codex/agents/devrites-slice-wright.toml +5 -1
  91. package/pack/generated/codex/skills/devrites-lib/reference/parallel-dispatch.md +14 -5
  92. package/pack/generated/codex/skills/devrites-lib/reference/standards/afk-hitl.md +24 -9
  93. package/pack/generated/codex/skills/devrites-lib/reference/standards/agents.md +6 -2
  94. package/pack/generated/codex/skills/devrites-lib/reference/standards/core.md +3 -0
  95. package/pack/generated/codex/skills/devrites-lib/reference/standards/gates.md +3 -0
  96. package/pack/generated/codex/skills/devrites-lib/reference/standards/testing.md +7 -0
  97. package/pack/generated/codex/skills/devrites-lib/reference/standards/workflow-artifacts.md +10 -6
  98. package/pack/generated/codex/skills/devrites-lib/reference/workspace-artifact-schema.md +1 -1
  99. package/pack/generated/codex/skills/rite-autocomplete/SKILL.md +2 -2
  100. package/pack/generated/codex/skills/rite-autocomplete/reference/loop.md +1 -1
  101. package/pack/generated/codex/skills/rite-autocomplete/reference/stop-conditions.md +6 -2
  102. package/pack/generated/codex/skills/rite-build/SKILL.md +7 -7
  103. package/pack/generated/codex/skills/rite-build/reference/afk-discipline.md +2 -2
  104. package/pack/generated/codex/skills/rite-build/reference/checkpoint.md +1 -1
  105. package/pack/generated/codex/skills/rite-build/reference/one-slice-cycle.md +3 -2
  106. package/pack/generated/codex/skills/rite-build/reference/parallel-batch.md +28 -21
  107. package/pack/generated/codex/skills/rite-build/reference/phase-contract.md +10 -1
  108. package/pack/generated/codex/skills/rite-build/reference/spec-drift-guard.md +3 -2
  109. package/pack/generated/codex/skills/rite-build/reference/wright-dispatch.md +9 -2
  110. package/pack/generated/codex/skills/rite-define/SKILL.md +11 -2
  111. package/pack/generated/codex/skills/rite-handoff/SKILL.md +1 -1
  112. package/pack/generated/codex/skills/rite-plan/SKILL.md +20 -9
  113. package/pack/generated/codex/skills/rite-plan/reference/slicing.md +5 -0
  114. package/pack/generated/codex/skills/rite-polish/SKILL.md +6 -4
  115. package/pack/generated/codex/skills/rite-prove/SKILL.md +3 -2
  116. package/pack/generated/codex/skills/rite-review/SKILL.md +6 -1
  117. package/pack/generated/codex/skills/rite-seal/SKILL.md +2 -2
  118. package/pack/generated/codex/skills/rite-seal/reference/phase-contract.md +7 -1
  119. package/pack/generated/codex/skills/rite-vet/SKILL.md +9 -5
  120. package/pack/generated/codex/skills/rite-vet/reference/artifacts.md +8 -0
  121. package/pack/generated/codex/skills/rite-vet/reference/review-axes.md +1 -1
  122. package/pack/generated/devin/agents/devrites-plan-drafter.md +13 -3
  123. package/pack/generated/devin/agents/devrites-slice-wright.md +5 -1
  124. package/pack/generated/devin/skills/devrites-lib/reference/parallel-dispatch.md +14 -5
  125. package/pack/generated/devin/skills/devrites-lib/reference/standards/afk-hitl.md +24 -9
  126. package/pack/generated/devin/skills/devrites-lib/reference/standards/agents.md +6 -2
  127. package/pack/generated/devin/skills/devrites-lib/reference/standards/core.md +3 -0
  128. package/pack/generated/devin/skills/devrites-lib/reference/standards/gates.md +3 -0
  129. package/pack/generated/devin/skills/devrites-lib/reference/standards/testing.md +7 -0
  130. package/pack/generated/devin/skills/devrites-lib/reference/standards/workflow-artifacts.md +10 -6
  131. package/pack/generated/devin/skills/devrites-lib/reference/workspace-artifact-schema.md +1 -1
  132. package/pack/generated/devin/skills/rite-autocomplete/SKILL.md +2 -2
  133. package/pack/generated/devin/skills/rite-autocomplete/reference/loop.md +1 -1
  134. package/pack/generated/devin/skills/rite-autocomplete/reference/stop-conditions.md +6 -2
  135. package/pack/generated/devin/skills/rite-build/SKILL.md +7 -7
  136. package/pack/generated/devin/skills/rite-build/reference/afk-discipline.md +2 -2
  137. package/pack/generated/devin/skills/rite-build/reference/checkpoint.md +1 -1
  138. package/pack/generated/devin/skills/rite-build/reference/one-slice-cycle.md +3 -2
  139. package/pack/generated/devin/skills/rite-build/reference/parallel-batch.md +28 -21
  140. package/pack/generated/devin/skills/rite-build/reference/phase-contract.md +10 -1
  141. package/pack/generated/devin/skills/rite-build/reference/spec-drift-guard.md +3 -2
  142. package/pack/generated/devin/skills/rite-build/reference/wright-dispatch.md +9 -2
  143. package/pack/generated/devin/skills/rite-define/SKILL.md +11 -2
  144. package/pack/generated/devin/skills/rite-handoff/SKILL.md +1 -1
  145. package/pack/generated/devin/skills/rite-plan/SKILL.md +20 -9
  146. package/pack/generated/devin/skills/rite-plan/reference/slicing.md +5 -0
  147. package/pack/generated/devin/skills/rite-polish/SKILL.md +6 -4
  148. package/pack/generated/devin/skills/rite-prove/SKILL.md +3 -2
  149. package/pack/generated/devin/skills/rite-review/SKILL.md +6 -1
  150. package/pack/generated/devin/skills/rite-seal/SKILL.md +2 -2
  151. package/pack/generated/devin/skills/rite-seal/reference/phase-contract.md +7 -1
  152. package/pack/generated/devin/skills/rite-vet/SKILL.md +9 -5
  153. package/pack/generated/devin/skills/rite-vet/reference/artifacts.md +8 -0
  154. package/pack/generated/devin/skills/rite-vet/reference/review-axes.md +1 -1
  155. package/pack/generated/omp/agents/devrites-plan-drafter.md +13 -3
  156. package/pack/generated/omp/agents/devrites-slice-wright.md +5 -1
  157. package/pack/generated/omp/skills/devrites-lib/reference/parallel-dispatch.md +14 -5
  158. package/pack/generated/omp/skills/devrites-lib/reference/standards/afk-hitl.md +24 -9
  159. package/pack/generated/omp/skills/devrites-lib/reference/standards/agents.md +6 -2
  160. package/pack/generated/omp/skills/devrites-lib/reference/standards/core.md +3 -0
  161. package/pack/generated/omp/skills/devrites-lib/reference/standards/gates.md +3 -0
  162. package/pack/generated/omp/skills/devrites-lib/reference/standards/testing.md +7 -0
  163. package/pack/generated/omp/skills/devrites-lib/reference/standards/workflow-artifacts.md +10 -6
  164. package/pack/generated/omp/skills/devrites-lib/reference/workspace-artifact-schema.md +1 -1
  165. package/pack/generated/omp/skills/rite-autocomplete/SKILL.md +2 -2
  166. package/pack/generated/omp/skills/rite-autocomplete/reference/loop.md +1 -1
  167. package/pack/generated/omp/skills/rite-autocomplete/reference/stop-conditions.md +6 -2
  168. package/pack/generated/omp/skills/rite-build/SKILL.md +7 -7
  169. package/pack/generated/omp/skills/rite-build/reference/afk-discipline.md +2 -2
  170. package/pack/generated/omp/skills/rite-build/reference/checkpoint.md +1 -1
  171. package/pack/generated/omp/skills/rite-build/reference/one-slice-cycle.md +3 -2
  172. package/pack/generated/omp/skills/rite-build/reference/parallel-batch.md +28 -21
  173. package/pack/generated/omp/skills/rite-build/reference/phase-contract.md +10 -1
  174. package/pack/generated/omp/skills/rite-build/reference/spec-drift-guard.md +3 -2
  175. package/pack/generated/omp/skills/rite-build/reference/wright-dispatch.md +9 -2
  176. package/pack/generated/omp/skills/rite-define/SKILL.md +11 -2
  177. package/pack/generated/omp/skills/rite-handoff/SKILL.md +1 -1
  178. package/pack/generated/omp/skills/rite-plan/SKILL.md +20 -9
  179. package/pack/generated/omp/skills/rite-plan/reference/slicing.md +5 -0
  180. package/pack/generated/omp/skills/rite-polish/SKILL.md +6 -4
  181. package/pack/generated/omp/skills/rite-prove/SKILL.md +3 -2
  182. package/pack/generated/omp/skills/rite-review/SKILL.md +6 -1
  183. package/pack/generated/omp/skills/rite-seal/SKILL.md +2 -2
  184. package/pack/generated/omp/skills/rite-seal/reference/phase-contract.md +7 -1
  185. package/pack/generated/omp/skills/rite-vet/SKILL.md +9 -5
  186. package/pack/generated/omp/skills/rite-vet/reference/artifacts.md +8 -0
  187. package/pack/generated/omp/skills/rite-vet/reference/review-axes.md +1 -1
  188. package/pack/generated/pi/agents/devrites-plan-drafter.md +13 -3
  189. package/pack/generated/pi/agents/devrites-slice-wright.md +5 -1
  190. package/pack/generated/pi/skills/devrites-lib/reference/parallel-dispatch.md +14 -5
  191. package/pack/generated/pi/skills/devrites-lib/reference/standards/afk-hitl.md +24 -9
  192. package/pack/generated/pi/skills/devrites-lib/reference/standards/agents.md +6 -2
  193. package/pack/generated/pi/skills/devrites-lib/reference/standards/core.md +3 -0
  194. package/pack/generated/pi/skills/devrites-lib/reference/standards/gates.md +3 -0
  195. package/pack/generated/pi/skills/devrites-lib/reference/standards/testing.md +7 -0
  196. package/pack/generated/pi/skills/devrites-lib/reference/standards/workflow-artifacts.md +10 -6
  197. package/pack/generated/pi/skills/devrites-lib/reference/workspace-artifact-schema.md +1 -1
  198. package/pack/generated/pi/skills/rite-autocomplete/SKILL.md +2 -2
  199. package/pack/generated/pi/skills/rite-autocomplete/reference/loop.md +1 -1
  200. package/pack/generated/pi/skills/rite-autocomplete/reference/stop-conditions.md +6 -2
  201. package/pack/generated/pi/skills/rite-build/SKILL.md +7 -7
  202. package/pack/generated/pi/skills/rite-build/reference/afk-discipline.md +2 -2
  203. package/pack/generated/pi/skills/rite-build/reference/checkpoint.md +1 -1
  204. package/pack/generated/pi/skills/rite-build/reference/one-slice-cycle.md +3 -2
  205. package/pack/generated/pi/skills/rite-build/reference/parallel-batch.md +28 -21
  206. package/pack/generated/pi/skills/rite-build/reference/phase-contract.md +10 -1
  207. package/pack/generated/pi/skills/rite-build/reference/spec-drift-guard.md +3 -2
  208. package/pack/generated/pi/skills/rite-build/reference/wright-dispatch.md +9 -2
  209. package/pack/generated/pi/skills/rite-define/SKILL.md +11 -2
  210. package/pack/generated/pi/skills/rite-handoff/SKILL.md +1 -1
  211. package/pack/generated/pi/skills/rite-plan/SKILL.md +20 -9
  212. package/pack/generated/pi/skills/rite-plan/reference/slicing.md +5 -0
  213. package/pack/generated/pi/skills/rite-polish/SKILL.md +6 -4
  214. package/pack/generated/pi/skills/rite-prove/SKILL.md +3 -2
  215. package/pack/generated/pi/skills/rite-review/SKILL.md +6 -1
  216. package/pack/generated/pi/skills/rite-seal/SKILL.md +2 -2
  217. package/pack/generated/pi/skills/rite-seal/reference/phase-contract.md +7 -1
  218. package/pack/generated/pi/skills/rite-vet/SKILL.md +9 -5
  219. package/pack/generated/pi/skills/rite-vet/reference/artifacts.md +8 -0
  220. package/pack/generated/pi/skills/rite-vet/reference/review-axes.md +1 -1
  221. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to DevRites are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and DevRites adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Releases are generated automatically by [semantic-release](https://semantic-release.gitbook.io/) from Conventional Commits on `main`.
4
4
 
5
+ ## [6.1.3](https://github.com/ViktorsBaikers/DevRites/compare/v6.1.2...v6.1.3) (2026-10-16)
6
+
7
+ ### Changed
8
+
9
+ * **devrites:** apply plan bundles in the engine and overlap phase work ([#109](https://github.com/ViktorsBaikers/DevRites/issues/109)) ([4394b0a](https://github.com/ViktorsBaikers/DevRites/commit/4394b0af21677da279be0ca5c359af728e482fd9))
10
+
11
+ ## [6.1.2](https://github.com/ViktorsBaikers/DevRites/compare/v6.1.1...v6.1.2) (2026-10-16)
12
+
13
+ ### Fixed
14
+
15
+ * **devrites:** close autocomplete dead ends and orphaned writer claims ([#108](https://github.com/ViktorsBaikers/DevRites/issues/108)) ([a680203](https://github.com/ViktorsBaikers/DevRites/commit/a680203d226160f9dae3bf5a386914567bd25da5))
16
+
5
17
  ## [6.1.1](https://github.com/ViktorsBaikers/DevRites/compare/v6.1.0...v6.1.1) (2026-10-16)
6
18
 
7
19
  ### Fixed
package/README.md CHANGED
@@ -31,7 +31,7 @@ history can't lose it. After you clear the conversation, switch hosts, or hand
31
31
  the feature to another engineer, the next session reads the same plan,
32
32
  decisions, and evidence before it continues.
33
33
 
34
- **Status:** [`v6.1.1`](https://github.com/ViktorsBaikers/DevRites/releases/tag/v6.1.1): see [`CHANGELOG.md`](CHANGELOG.md) for release notes.
34
+ **Status:** [`v6.1.3`](https://github.com/ViktorsBaikers/DevRites/releases/tag/v6.1.3): see [`CHANGELOG.md`](CHANGELOG.md) for release notes.
35
35
 
36
36
  This is the latest published release; `main` may contain unreleased work.
37
37
 
package/docs/cli.md CHANGED
@@ -165,7 +165,10 @@ self-contained updater.
165
165
  and exits `3` naming the holder when a live claim by another session covers a
166
166
  path; `release --session <id> --id <claim>` frees it; `list [--all]` shows
167
167
  live (or all) claims; `check [--session <id>] <path>...` is the read-only
168
- preflight. Claims coordinate concurrent same-tree sessions; they never
168
+ preflight. Each claim records its host and the claiming session's long-lived
169
+ processes; when all of them have exited on this host, `list` shows the claim
170
+ `dead` and it no longer conflicts. Other hosts or an unavailable `ps` never
171
+ prove exit. Claims coordinate concurrent same-tree sessions; they never
169
172
  replace the one-writer-per-worktree rule in `standards/agents.md`.
170
173
  - `note <add|list|check|rm>` manages `notes.md` anchored notes: `add <slug>
171
174
  <subject> <quote> <title> [body]` binds a note to a verbatim quote in one
@@ -44,7 +44,7 @@ The Go surface is intentionally closed and deterministic:
44
44
  | Candidate and deterministic checks | `check candidate`, `check readiness [--emit-binding]`, `check seal`, `check slice <slug> <SLICE-ID>`, `check task-graph`, `check regression <slug> [--update]`, `check drift <slug> [--record]`, `check windows <slug>`, `check dup`, `check path-disjoint`, `parallel select`, `check skill-trust`, `check indexes`, `detect commands [--root <dir>] [--json]` | Candidate validates/hashes the strict project manifest; readiness checks phase files, the required `tasks.md` slice graph, or emits the vetted Build-input binding; seal checks final files/open gates, that graph and binding, then exact candidate bindings. `check slice` preflights one slice before wright dispatch — contract present, exact Writer allowlist paths, `Satisfies` AC ids resolvable, bounded scope — so a malformed slice fails before a writer context is spent. `check indexes` reports install manifest and optional code-index directory presence as JSON. `parallel select` returns the greedy path-disjoint subset ≤ cap from the supplied ready slices. `check regression` compares current workspace progress against the durable `regression-baseline.json` high-water mark and `--update` ratchets it at a checkpoint, so a lost slice, unchecked criterion, or reopened question fails closed instead of passing silently. `check windows` scans the feature diff for newly introduced deferral markers (TODO/FIXME/skipped test/stub idioms) and fails when any lacks a `windows.md` waiver row — silent deferrals block the seal. `check dup` reports advisory near-duplicate clusters that survive renaming (normalized token shingles, transitive clusters, distance-boosted rank, `*`-marked diff overlap, stable content hashes, `.devrites/dup-ignore` dismissal ledger) — leads for reviewer triage, never a gate. `check drift` attributes readiness-input drift to the exact artifact: `--record` snapshots per-input SHA-256 digests into `readiness-inputs.json` under the feature lock, and a later compare names each `changed`/`missing`/`added` input (falling back to the aggregate `eng-review.md` binding plus mtime candidates when no baseline exists) so a stale-binding repair starts at the right file — advisory, never a gate. `detect commands` resolves the repository's own test/lint/vet/build commands (Makefile targets, then `package.json` scripts, then language-manifest fallbacks, plus the lockfile-derived package manager) so `gates.md` `CHECK` lines and proof steps cite real wiring instead of invented commands — read-only, no installs, no execution. |
45
45
  | Workspace observation | `observe summary`, `orient`, `observe slice <slug> <SLICE-ID>`, `next`, `handoff` | JSON workspace snapshot for agents (cursor, task graph, `artifact_budgets`, `bulk_files`); `orient` is an alias for `observe summary`. `observe slice` prints one `SLICE-###` section of `tasks.md` so Build reads a slice, not the file. `next` prints the minimal remaining lifecycle path plus advisory skips (e.g. clarify at zero open questions). `handoff` emits the deterministic resume record (cursor, `awaiting_human`, blocking question gates, ledger reduction with unmet/stale ids, dead ends, read-next order) — the `/rite-handoff` spine and compaction-fallback entry. |
46
46
  | Context packets, dispatch waves, metrics, claims, notes | `context [slug] (--phase <p> \| --skill <name>) [--role <r>] [--trigger a,b]`, `dispatch <slug> <open\|start\|seal\|return\|status\|abandon>`, `metrics record`, `metrics summary`, `claim <add\|release\|list\|check>`, `note <add\|list\|check\|rm>` | `context` emits one deduplicated read-set bundle per phase/role/skill from each skill's `loads:` manifest — a dispatch target reads it instead of selecting files; `--skill` works without a workspace when `--out` is given. `dispatch` owns the launch-wave barrier (seal needs a handle per role; return needs seal) and auto-records dispatch/return metrics. `metrics` owns the append-only `metrics.jsonl` ledger. `claim` owns the append-only `.devrites/claims.jsonl` ledger — advisory, session-scoped file claims with TTL so concurrent same-tree sessions see each other's write intent before edits collide (conflict exits 3; never a substitute for one-writer-per-worktree). `note` owns the anchored `notes.md` ledger — notes bound to verbatim code quotes, regraded `exact`/`moved`/`stale`/`ambiguous`/`lost` as the code drifts; `check seal` refuses non-`exact` anchors. `check diff-scope` is the mechanical changed-paths ⊆ allowlist gate run before reviewer dispatch. |
47
- | Atomic workspace state | `state resolve`, `state merge-manifest`, `state close`, `migrate [--dry-run] [--answer id=choice]` | Go owns answer/drop/batch resolution, the recorded predecessor-chain manifest union for a release milestone, transactional close, and fail-closed v5 schema normalization. |
47
+ | Atomic workspace state | `state resolve`, `state merge-manifest`, `state apply-bundle <slug> <bundle.json>... [--dry-run]`, `state close`, `migrate [--dry-run] [--answer id=choice]` | Go owns answer/drop/batch resolution, the recorded predecessor-chain manifest union for a release milestone, the all-or-nothing apply of plan-drafter hunk bundles (base-hash pins, unique non-overlapping anchors, no lost IDs, no new task-graph or budget defect, no appended dated delta section), transactional close, and fail-closed v5 schema normalization. |
48
48
  | Acceptance ledger | `gates scaffold`, `gates status`, `gates run [--timeout N]`, `gates reverify [--timeout N]`, `gates lint [--strict]`, `gates attest <id> <note>`, `gates abandon <id> <why>` | Go owns the `gates.md` ledger: per-outcome gates whose runnable `CHECK`/`CWD` must exactly match a `test-plan.md` Build-entry preflight row, evidence bound to the gate definition digest (stale = unmet), `ABANDON:` handoffs, and oracle lint. Readiness/seal require a parse-clean, all-met ledger whenever `gates.md` is a required artifact. |
49
49
  | Security | `secret-scan` | `/rite-ship`, safe hooks, or an operator scans staged blobs, stdin, or touched files. |
50
50
  | Install/operator | `install`, `update`, `uninstall`, `version` | Direct update acquires latest; npm/bootstrap may supply local candidates; the engine performs manifest-owned local changes. |
@@ -16,9 +16,9 @@ workflow strategy.
16
16
  | `check readiness --emit-binding <slug>` | Render the exact stable Build-input binding for Vet to record after review. |
17
17
  | `check seal <slug>` | Check files required by target Phase `seal`, open human gates, the `tasks.md` slice graph, canonical `AC-###` presence when `tasks.md`/`test-plan.md` are required, the stable Build-input binding, and exact candidate bindings. |
18
18
  | `check path-disjoint [--root <dir>] [<json-file> | -]` | Verify slice path sets are pairwise disjoint. |
19
- | `parallel select --cap <1-10> [--root <dir>] [<json-file> | -]` | Choose the greedy path-disjoint subset ≤ cap from supplied ready slices. |
20
- | `parallel <create\|integrate\|cleanup\|status\|abort\|lease-read\|lease-write\|lease-clear\|record-green>` | Deterministic parallel worktree leases, integration, and cleanup for parallel writer batches. |
21
- | `check task-graph <slug>` | Validate `tasks.md` slice dependency graph for cycles, unknown deps, malformed tokens, duplicate IDs, missing `Dependencies`, and `depends_on` mismatch. Prints a non-blocking `ADVISORY size:` line (and records a `size-advisory` metric) for each slice with 12+ Writer allowlist files and no `Size rationale:`. A `Dependencies` ID may carry a `(via <interface>)` suffix (empty or unclosed is a malformed token); prints a non-blocking `ADVISORY edge:` line (and records an `edge-advisory` metric) for each edge with no via, or whose via text is not a case-insensitive substring of the dependency's `Consumes / Produces:`. Advisories print only when the graph is valid. |
19
+ | `parallel select --cap <1-10> [--root <dir>] [--slug <slug>] [<json-file> | -]` | Choose the greedy path-disjoint subset ≤ cap from supplied ready slices. With `--slug` and a running lease, the lease's not-yet-landed slices hold cap slots and paths, and only new picks print. |
20
+ | `parallel <create\|add\|integrate\|cleanup\|status\|abort\|lease-read\|lease-write\|lease-clear\|record-green>` | Deterministic parallel worktree leases, integration, and cleanup for parallel writer batches. A lease is a pipeline: `integrate --slice <id> --apply-to-control` lands one green sibling onto control (refusing if anything but this lease moved control), and `add` starts new path-disjoint siblings from the current control tip while others still run. |
21
+ | `check task-graph <slug>` | Validate `tasks.md` slice dependency graph for cycles, unknown deps, malformed tokens, duplicate IDs, missing `Dependencies`, and `depends_on` mismatch. Prints a non-blocking `ADVISORY size:` line (and records a `size-advisory` metric) for each slice with 12+ Writer allowlist files and no `Size rationale:`. A `Dependencies` ID may carry a `(via <interface>)` suffix (empty or unclosed is a malformed token); prints a non-blocking `ADVISORY edge:` line (and records an `edge-advisory` metric) for each edge with no via, or whose via text is not a case-insensitive substring of the dependency's `Consumes / Produces:`. Prints `schedule: <n> slices in <r> build rounds at cap 10` (the `/rite-build` batch selection replayed over each slice's Writer allowlist, else Files likely touched; omitted when a slice has no path) and a non-blocking `ADVISORY hub:` line (top five; records a `hub-advisory` metric) for each path, compared case-folded, that three or more slices without `Serial rationale:` write. Advisories print only when the graph is valid. |
22
22
  | `check regression <slug> [--update]` | Compare the workspace's structural progress facts (phase ordinal, checked ACs, met/abandoned gates, done slices, resolved questions, present artifacts) against the recorded `regression-baseline.json` high-water mark; `--update` ratchets the baseline forward under the feature lock and prints each blessed regression. |
23
23
  | `check drift <slug> [--record]` | Attribute readiness-input changes to the exact artifact. `--record` writes the per-input `readiness-inputs.json` digest baseline under the feature lock; without it the workspace diffs current inputs against that baseline (or falls back to the aggregate binding recorded in `eng-review.md`). Advisory: exit `0` on drift; a corrupt baseline exits `3`. A `test-plan.md` change limited to exact `Workflow Artifact reviewed identity: <64hex>` lines is reported as `reviewed-identity-only` (ADR-0034). |
24
24
  | `check windows <slug> [--worktree\|--staged\|--base <ref>]` | Fail on deferral and bar-lowering markers the change introduces without a waiver row in the workspace's `windows.md`: added TODO/FIXME/XXX/HACK, skipped/focused-test and stub idioms, checker suppressions, one-line empty catch; removed `deleted-test` files and net `removed-assertion` lines in remaining test files. |
@@ -37,7 +37,7 @@ workflow strategy.
37
37
  | `dispatch <slug> <open\|start\|seal\|return\|status\|abandon>` | Launch-wave barrier for parallel dispatch: seal needs a handle per role, return needs seal; start/return auto-record metrics. A build wave with a wright role needs `--slice <SLICE-ID>` per slice, and a slice-bound vet wave takes it too; every 5 rounds of either kind on one slice, `open` exits `3` until `--reslice-review <DRIFT-ID>` names an unused `drift.md` `## <DRIFT-ID>` heading for that slice. `open` also warns when an earlier wave for the same slice never returned. |
38
38
  | `metrics record <slug> --phase <p> --event <e> [--role r] [--bytes n] [--note s]` | Append an event to the workspace's `metrics.jsonl` ledger. |
39
39
  | `metrics summary [slug] [--by-slice]` | Reduce `metrics.jsonl` into a per-phase roll-up. `--by-slice` reads `dispatch.json` instead: per slice, build wright rounds, slice-bound Vet rechecks, and agent-minutes (role start to `returned_at`; abandoned waves excluded). |
40
- | `claim <add\|release\|list\|check>` | Advisory session-scoped file claims in `.devrites/claims.jsonl` (append-only). `add` records intent to write a path set with a TTL (1–240 min, default 30); a live claim by another session exits `3` and names the holder. `release` appends a release event owned by the claiming session. `list` shows live claims (`--all` includes expired/released). `check` is the read-only preflight for a path set. Coordination aid only — never a substitute for one-writer-per-worktree. |
40
+ | `claim <add\|release\|list\|check>` | Advisory session-scoped file claims in `.devrites/claims.jsonl` (append-only). `add` records intent to write a path set with a TTL (1–240 min, default 30); a live claim by another session exits `3` and names the holder. `release` appends a release event owned by the claiming session. `list` shows live claims (`--all` includes expired/released); a claim whose holding session has provably exited on this host shows `dead` and no longer conflicts. `check` is the read-only preflight for a path set. Coordination aid only — never a substitute for one-writer-per-worktree. |
41
41
  | `note <add\|list\|check\|rm> <slug> ...` | Anchored workspace notes in `notes.md`: `add <slug> <subject> <quote> <title> [body]` binds a note to a verbatim quote in one repository file and assigns `NOTE-###`; `list` and `check` regrade each anchor `exact`/`moved`/`stale`/`ambiguous`/`lost` by searching the repo for the quote (dependency and workspace trees excluded); `check --repair` rewrites a `moved` subject to its new file; `rm` deletes by ID. `check seal` refuses a malformed `notes.md` and any non-`exact` anchor. |
42
42
  | `gates <scaffold\|status\|run\|reverify\|lint\|attest\|abandon> <slug>` | Operate the `gates.md` acceptance ledger: seed per-AC gates, execute runnable gates bound to `test-plan.md` preflight rows, attest manual gates, and reduce to `all-met`/`not-met`/`handoff`/`malformed`. |
43
43
  | `state resolve <qid> "<answer>"` | Resolve an open question and update `questions.md` plus `state.md` atomically. |
@@ -138,9 +138,10 @@ and a control `parallel-lease.md` apply. `--parallel N` on `/rite-autocomplete`
138
138
  or `/rite-build` is the batch cap for that run and wins over leftover sentinel
139
139
  `max_parallel`; `/rite-autocomplete --parallel N` also writes or replaces only
140
140
  that field. Absent the flag, the sentinel (default cap 10 under
141
- `/rite-autocomplete`) is a **cap**: each round runs
142
- the largest eligible set, recomputes after every completed round, and repeats until no
143
- pending slice remains; a one-slice round is serial for that round only (see
141
+ `/rite-autocomplete`) is a **cap**: the run fills it
142
+ with the largest eligible set, lands each sibling as soon as its review and proof are
143
+ green, refills the freed slot (`parallel add`), and repeats until no pending slice
144
+ remains; a one-slice round is serial for that round only (see
144
145
  [`parallel-batch.md`](../pack/.claude/skills/rite-build/reference/parallel-batch.md)).
145
146
  Same-worktree multi-writer and root-emulated worktrees remain forbidden; default
146
147
  `/rite-build` stays one writer across linked worktrees.
package/docs/usage.md CHANGED
@@ -71,7 +71,7 @@ Project-root sentinel (outside the workspace):
71
71
  | `.devrites/AFK` | you (presence = AFK mode active) | optional YAML: `max_slices`, `notify`, `allow_gates`. Empty file = AFK with defaults. See [`pack/.claude/skills/devrites-lib/reference/standards/afk-hitl.md`](../pack/.claude/skills/devrites-lib/reference/standards/afk-hitl.md). |
72
72
  | `.devrites/CHECKPOINT` | unused as a gate | reserved path (not a candidate). After Independent Build review and fail-on-red proof are green (not when a wright returns), `/rite-build` / `/rite-prove` / `/rite-polish` / `/rite-review` land a local `WIP(<slug>): <imperative summary>` commit (serial: checkpoint git recipe or no-op if nothing staged; parallel: `devrites-engine parallel integrate`); `/rite-ship` later collapses an eligible WIP run. See [`pack/.claude/skills/rite-build/reference/checkpoint.md`](../pack/.claude/skills/rite-build/reference/checkpoint.md). |
73
73
  | `.devrites/dup-ignore` | you (optional) | One `check dup` cluster hash per line with a `#` reason — the dismissal ledger. Content-derived hashes survive line moves but resurface on structural edits. See [`pack/.claude/skills/devrites-lib/reference/standards/duplicate-code.md`](../pack/.claude/skills/devrites-lib/reference/standards/duplicate-code.md). |
74
- | `.devrites/claims.jsonl` | `devrites-engine claim add` | Append-only advisory file claims: `{id, session, paths, reason, claimed_at, expires_at}` plus release events. Session-scoped and TTL-bounded — per-checkout state, so gitignore it (a committed ledger exports stale claims to every clone). See [`standards/agents.md`](../pack/.claude/skills/devrites-lib/reference/standards/agents.md). |
74
+ | `.devrites/claims.jsonl` | `devrites-engine claim add` | Append-only advisory file claims: `{id, session, paths, reason, claimed_at, expires_at, host, anchors}` plus release events. Session-scoped and TTL-bounded — per-checkout state, so gitignore it (a committed ledger exports stale claims to every clone). See [`standards/agents.md`](../pack/.claude/skills/devrites-lib/reference/standards/agents.md). |
75
75
 
76
76
  The shape of this directory is also documented in
77
77
  [`flow.md` § Workspace state model](flow.md#7-workspace-state-model).
@@ -34,7 +34,7 @@ func rootModeFor(command string, args []string) rootMode {
34
34
  return rootLenient
35
35
  case "state":
36
36
  switch subcommand {
37
- case "resolve", "merge-manifest", "close":
37
+ case "resolve", "merge-manifest", "apply-bundle", "close":
38
38
  return rootStrict
39
39
  }
40
40
  return rootUnused
package/engine/help.go CHANGED
@@ -30,7 +30,7 @@ const (
30
30
  check dup [slug] [--all|--worktree|--staged|--base <ref>]
31
31
  `
32
32
 
33
- stateUsage = `usage: devrites-engine state <resolve|merge-manifest|close> ...
33
+ stateUsage = `usage: devrites-engine state <resolve|merge-manifest|apply-bundle|close> ...
34
34
 
35
35
  state resolve <qid> "<answer>"
36
36
  state resolve --drop <qid> ["<reason>"]
@@ -39,6 +39,7 @@ const (
39
39
  state resolve --human --drop <qid> ["<reason>"]
40
40
  state resolve --human --batch <file>
41
41
  state merge-manifest <slug> [<predecessor>...]
42
+ state apply-bundle <slug> <bundle.json>... [--dry-run]
42
43
  state close <slug>
43
44
  `
44
45
 
@@ -86,6 +87,7 @@ const (
86
87
  dupUsageLine = "usage: devrites-engine check dup [slug] [--all|--worktree|--staged|--base <ref>] [--min-lines n] [--threshold f] [--ignore-file <path>] [--limit n] [--exclude <csv>] [--phase p] [--cwd <dir>]"
87
88
  resolveUsage = `usage: devrites-engine state resolve <qid> "<answer>" | state resolve --drop <qid> ["<reason>"] | state resolve --batch <file> | state resolve --human <qid> "<answer>" | state resolve --human --drop <qid> ["<reason>"] | state resolve --human --batch <file>`
88
89
  mergeManifestUsage = "usage: devrites-engine state merge-manifest <slug> [<predecessor>...]"
90
+ applyBundleUsage = "usage: devrites-engine state apply-bundle <slug> <bundle.json>... [--dry-run]"
89
91
  closeUsage = "usage: devrites-engine state close <slug>"
90
92
  observeSliceUsage = "usage: devrites-engine observe slice <slug> <SLICE-ID>"
91
93
  observeSummaryUsage = "usage: devrites-engine observe summary [slug]"
@@ -286,6 +288,8 @@ func helpState(rest []string) string {
286
288
  return resolveUsage
287
289
  case "merge-manifest":
288
290
  return mergeManifestUsage
291
+ case "apply-bundle":
292
+ return applyBundleUsage
289
293
  case "close":
290
294
  return closeUsage
291
295
  default:
@@ -248,9 +248,19 @@ func cmdRun(root string, args []string, reverify bool, stdout, stderr io.Writer)
248
248
  return ExitBlocked
249
249
  }
250
250
 
251
- lockErr := state.WithFeatureLock(root, slug, func() error {
252
- text, err := ReadLedgerFile(ledgerPath)
253
- if err != nil {
251
+ // The gates lock serializes check execution; the feature lock is held only
252
+ // to read inputs and per writeback, so dispatch and other workspace writers
253
+ // are not blocked for the whole (often minutes-long) run.
254
+ featureLock := func(fn func() error) error { return state.WithFeatureLock(root, slug, fn) }
255
+ lockErr := state.WithLock(ledgerPath+".lock", func() error {
256
+ var text string
257
+ var approved []ApprovedCommand
258
+ if err := featureLock(func() error {
259
+ var err error
260
+ text, err = ReadLedgerFile(ledgerPath)
261
+ approved = loadTestPlan(testPlanPath)
262
+ return err
263
+ }); err != nil {
254
264
  return err
255
265
  }
256
266
  doc := ParseLedger(text)
@@ -260,8 +270,7 @@ func cmdRun(root string, args []string, reverify bool, stdout, stderr io.Writer)
260
270
  }
261
271
  return nil
262
272
  }
263
- approved := loadTestPlan(testPlanPath)
264
- for _, result := range RunGates(context.Background(), project, ledgerPath, doc, approved, reverify, timeout) {
273
+ for _, result := range RunGates(context.Background(), project, ledgerPath, doc, approved, reverify, timeout, featureLock) {
265
274
  switch {
266
275
  case !result.Ran:
267
276
  fmt.Fprintf(stdout, "gate %s: skipped (%s)\n", result.ID, result.Detail)
@@ -65,9 +65,19 @@ func ReadLedgerFile(ledgerPath string) (string, error) {
65
65
  // Each pass writes definition-bound evidence; each failure clears the box and
66
66
  // restores EVIDENCE: pending.
67
67
  //
68
- // The caller holds the feature lock across this call.
69
- func RunGates(ctx context.Context, root, ledgerPath string, doc *Document, approved []ApprovedCommand, reverify bool, timeout time.Duration) []GateResult {
68
+ // Gates sharing one CHECK and CWD execute once per call; each matches its own
69
+ // EXPECT against that shared output. writeLock, when non-nil, wraps every
70
+ // ledger writeback so the caller need not hold the feature lock while checks
71
+ // execute; writeResult re-verifies the gate's oracle before it writes.
72
+ func RunGates(ctx context.Context, root, ledgerPath string, doc *Document, approved []ApprovedCommand, reverify bool, timeout time.Duration, writeLock func(func() error) error) []GateResult {
70
73
  var results []GateResult
74
+ outcomes := map[string]RunOutcome{}
75
+ write := func(gate *Gate, evidence string, checked bool) error {
76
+ if writeLock == nil {
77
+ return writeResult(ledgerPath, gate, evidence, checked)
78
+ }
79
+ return writeLock(func() error { return writeResult(ledgerPath, gate, evidence, checked) })
80
+ }
71
81
  for _, gate := range doc.Gates {
72
82
  if _, abandoned := doc.Abandoned[gate.ID]; abandoned {
73
83
  results = append(results, GateResult{ID: gate.ID, Detail: "abandoned; handoff required"})
@@ -94,17 +104,22 @@ func RunGates(ctx context.Context, root, ledgerPath string, doc *Document, appro
94
104
  if gate.Cwd != "" {
95
105
  cwd = filepath.Join(root, filepath.FromSlash(gate.Cwd))
96
106
  }
97
- outcome := Execute(ctx, gate.Check, cwd, timeout)
107
+ key := gate.Check + "\x00" + cwd
108
+ outcome, ran := outcomes[key]
109
+ if !ran {
110
+ outcome = Execute(ctx, gate.Check, cwd, timeout)
111
+ outcomes[key] = outcome
112
+ }
98
113
  if outcome.Err == nil && outcome.ExitCode == 0 && expectation.Matches(outcome.Output) {
99
114
  evidence := FormatEvidence(gate, OutputDigest(outcome.Output), outcome.OutputBytes, time.Now().UTC().Format(time.RFC3339))
100
- writeErr := writeResult(ledgerPath, gate, evidence, true)
115
+ writeErr := write(gate, evidence, true)
101
116
  results = append(results, GateResult{
102
117
  ID: gate.ID, Ran: true, Passed: true,
103
118
  Discarded: errors.Is(writeErr, ErrOracleMoved), WriteErr: writeErr,
104
119
  Detail: resultDetail(writeErr, "pass"),
105
120
  })
106
121
  } else {
107
- writeErr := writeResult(ledgerPath, gate, "pending", false)
122
+ writeErr := write(gate, "pending", false)
108
123
  results = append(results, GateResult{
109
124
  ID: gate.ID, Ran: true,
110
125
  Discarded: errors.Is(writeErr, ErrOracleMoved), WriteErr: writeErr,