devrites 7.0.17 → 7.1.0

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 (50) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +1 -1
  3. package/engine/help.go +4 -3
  4. package/engine/internal/lib/affected.go +233 -0
  5. package/engine/internal/lib/cli_observe.go +25 -3
  6. package/engine/internal/lib/taskgraph.go +79 -12
  7. package/engine/main.go +19 -2
  8. package/pack/.claude/agents/devrites-upgrade-planner.md +2 -1
  9. package/pack/.claude/skills/rite-autocomplete/SKILL.md +7 -7
  10. package/pack/.claude/skills/rite-build/SKILL.md +5 -4
  11. package/pack/.claude/skills/rite-build/reference/parallel-batch.md +23 -17
  12. package/pack/.claude/skills/rite-build/reference/phase-contract.md +15 -3
  13. package/pack/.claude/skills/rite-define/SKILL.md +4 -2
  14. package/pack/.claude/skills/rite-plan/reference/slicing.md +6 -2
  15. package/pack/generated/claude/agents/devrites-upgrade-planner.md +2 -1
  16. package/pack/generated/claude/skills/rite-autocomplete/SKILL.md +7 -7
  17. package/pack/generated/claude/skills/rite-build/SKILL.md +5 -4
  18. package/pack/generated/claude/skills/rite-build/reference/parallel-batch.md +23 -17
  19. package/pack/generated/claude/skills/rite-build/reference/phase-contract.md +15 -3
  20. package/pack/generated/claude/skills/rite-define/SKILL.md +4 -2
  21. package/pack/generated/claude/skills/rite-plan/reference/slicing.md +6 -2
  22. package/pack/generated/codex/agents/devrites-upgrade-planner.toml +2 -1
  23. package/pack/generated/codex/skills/rite-autocomplete/SKILL.md +7 -7
  24. package/pack/generated/codex/skills/rite-build/SKILL.md +5 -4
  25. package/pack/generated/codex/skills/rite-build/reference/parallel-batch.md +23 -17
  26. package/pack/generated/codex/skills/rite-build/reference/phase-contract.md +15 -3
  27. package/pack/generated/codex/skills/rite-define/SKILL.md +4 -2
  28. package/pack/generated/codex/skills/rite-plan/reference/slicing.md +6 -2
  29. package/pack/generated/devin/agents/devrites-upgrade-planner.md +2 -1
  30. package/pack/generated/devin/skills/rite-autocomplete/SKILL.md +7 -7
  31. package/pack/generated/devin/skills/rite-build/SKILL.md +5 -4
  32. package/pack/generated/devin/skills/rite-build/reference/parallel-batch.md +23 -17
  33. package/pack/generated/devin/skills/rite-build/reference/phase-contract.md +15 -3
  34. package/pack/generated/devin/skills/rite-define/SKILL.md +4 -2
  35. package/pack/generated/devin/skills/rite-plan/reference/slicing.md +6 -2
  36. package/pack/generated/omp/agents/devrites-upgrade-planner.md +2 -1
  37. package/pack/generated/omp/skills/rite-autocomplete/SKILL.md +7 -7
  38. package/pack/generated/omp/skills/rite-build/SKILL.md +5 -4
  39. package/pack/generated/omp/skills/rite-build/reference/parallel-batch.md +23 -17
  40. package/pack/generated/omp/skills/rite-build/reference/phase-contract.md +15 -3
  41. package/pack/generated/omp/skills/rite-define/SKILL.md +4 -2
  42. package/pack/generated/omp/skills/rite-plan/reference/slicing.md +6 -2
  43. package/pack/generated/pi/agents/devrites-upgrade-planner.md +2 -1
  44. package/pack/generated/pi/skills/rite-autocomplete/SKILL.md +7 -7
  45. package/pack/generated/pi/skills/rite-build/SKILL.md +5 -4
  46. package/pack/generated/pi/skills/rite-build/reference/parallel-batch.md +23 -17
  47. package/pack/generated/pi/skills/rite-build/reference/phase-contract.md +15 -3
  48. package/pack/generated/pi/skills/rite-define/SKILL.md +4 -2
  49. package/pack/generated/pi/skills/rite-plan/reference/slicing.md +6 -2
  50. package/package.json +1 -1
@@ -73,13 +73,25 @@ One contract builds one slice: preserve TDD, exact paths and independent judgmen
73
73
  ## Proof tiers
74
74
 
75
75
  With a `test-plan.md` `## Feature gates` section, step 6 runs `Tests/proof` and every
76
- other row; feature gates run once per parallel landing, on control, while worktree
77
- wrights continue. The next landing and Prove wait for them; red is a fingerprint
78
- against slices landed since the last green run. Serial same-worktree mode, and plans
76
+ other row; feature gates run once per landing train, on control, while worktree
77
+ wrights continue: land every green sibling together, run the suite once, and bisect only
78
+ on red. The next train and Prove wait for them; red is a fingerprint against slices
79
+ landed since the last green run. Serial same-worktree mode, and plans
79
80
  without the section, run every row each round. Run gate, benchmark and proof commands
80
81
  through the host's shell tool, never a code-evaluation subprocess, whose environment
81
82
  can lack the owner's exported variables.
82
83
 
84
+ Wrights run only the tests their changed paths reach, resolved from the merge base
85
+ against the plan's baseline rather than the last commit; Prove and Seal always run the
86
+ full suite. Resolve that narrow set with
87
+ `devrites-engine check affected <changed path...>`, which expands a changed package to its
88
+ dependent packages and widens on its own when a path is a module manifest, a generated
89
+ artifact, CI config, shared testdata, or one it cannot classify. Widen to the full suite
90
+ inside Build the moment a slice touches `go.mod` or a
91
+ lockfile, generated artifacts, CI config, a shared test harness, or whenever no test can
92
+ be named for a changed path. When selection is uncertain, run the full suite: the narrow
93
+ set is an optimisation, never a substitute.
94
+
83
95
  ## Independent Build review
84
96
 
85
97
  After inspection, freeze full slice scope and cumulative baseline diff with
@@ -175,9 +175,11 @@ Pull these via `Read` when shaping the plan:
175
175
  buildable AC/REQ maps to an existing slice/proof, every slice maps to real
176
176
  acceptance, and names/prose agree. Missing, duplicate, contradictory, or
177
177
  meaning-changing mappings block. Then run
178
- `devrites-engine check task-graph <slug>`; a malformed dependency graph blocks
178
+ `devrites-engine check task-graph <slug> --strict`; a malformed dependency graph, or a
179
+ shared path written by `hubAdvisoryMin`+ slices with no `Serial rationale:`, blocks
179
180
  before Vet rather than spending a reviewer context on invalid tasks. Resolve each
180
- `ADVISORY size:`/`hub:` line now (split or seam slice, or a rationale); never blocking.
181
+ `ADVISORY size:`/`hub:`/`chain:` line now (split or seam slice, or a rationale);
182
+ `--strict` refuses the contended plan, the default run only advises.
181
183
  7. **Readiness gate** (`plan-template.md`): require CLEAR coverage; complete acceptance,
182
184
  wiring, shared-contract proof, applicable outputs, and rollback; risk-first acyclic order;
183
185
  justified deviations; and every horizon item present, with blockers resolved, planning
@@ -172,8 +172,12 @@ cannot name what crosses, drop the edge; a shallow, wide graph runs in parallel.
172
172
 
173
173
  Slices sharing a file never build side by side: put a hub file's shared edit
174
174
  (registry, command table, test harness) in one seam slice the others depend on.
175
- `check task-graph` prints the `schedule:` and `ADVISORY hub:` lines; inseparable
176
- writes get `Serial rationale: <why>`. Never merge slices or drop acceptance to widen it.
175
+ `check task-graph` prints the `schedule:`, `ADVISORY hub:` and `ADVISORY chain:` lines.
176
+ A `chain` line means only one slice was ever ready, so the DAG rather than the cap
177
+ serializes: cut a slice that stands alone, or record `Serial rationale: <why>`.
178
+ `check task-graph <slug> --strict` refuses a plan whose shared path carries `ADVISORY hub:`
179
+ writers, so a contended plan must split disjointly instead of widening the cap.
180
+ Never merge slices or drop acceptance to widen it.
177
181
 
178
182
  ## Deferred slice
179
183
  A slice with `Satisfies: none` is an optional follow-up: plan-invented hardening or
@@ -23,7 +23,8 @@ Read named paths only. Accept released v1/v2 bullet or v3 table `state.md` under
23
23
  `.devrites/work/<slug>/`. Reject aliases, release scripts/markers, and conversion.
24
24
 
25
25
  Cite current rule plus workspace evidence for each applicable axis: cursor/topology,
26
- phase artifacts, decisions, planning/traceability/proof, built-code/intent, protected
26
+ phase artifacts, decisions, planning/traceability/proof (including a `check task-graph`
27
+ `ADVISORY chain:` schedule that no parallel cap can widen), built-code/intent, protected
27
28
  history, artifact budgets/feature ceiling (the supplied `devrites-engine orient`
28
29
  `artifact_budgets`/`bulk_files` and `task_graph.slice_count` against
29
30
  [`workspace-artifact-schema.md`](../skills/devrites-lib/reference/workspace-artifact-schema.md) and [`slicing.md`](../skills/rite-plan/reference/slicing.md) § Feature ceiling),
@@ -118,13 +118,13 @@ next sequence continuation through Vet in a second session, then stop.
118
118
  `/rite-build` batch loop → `/rite-prove` → `/rite-polish` →
119
119
  `/rite-review` → `/rite-seal`. Read and execute each skill; durable files, not
120
120
  chat, carry state. Apply the mutable post-vet budget before first Build.
121
- Build runs the path-disjoint batch `parallel select --from-plan` picks (cap: this invocation's
122
- `--parallel N`, else sentinel `max_parallel`, else 10) and refills a slot
123
- per landing until no pending slice remains; a one-slice round is serial for that round only, then
124
- selection runs again (host isolation still forces serial when concurrent writers
125
- cannot be separated). When `--parallel N`
126
- is present, pass it into `/rite-build` and do not consult leftover sentinel
127
- `max_parallel`.
121
+ Build uses `parallel select --from-plan` (cap: explicit `--parallel N`, else
122
+ sentinel `max_parallel`, else 10), refilling per landing until none pending;
123
+ a one-slice round is serial for that round only; reselect afterward. Host
124
+ isolation may force serial. If `--parallel N` is explicit,
125
+ pass it into `/rite-build` and ignore leftover sentinel `max_parallel`.
126
+ Otherwise pass the resolved sentinel/default cap into `/rite-build` as
127
+ `--parallel N`, never bare `/rite-build`.
128
128
  **Completion:** loop reaches Seal GO or persists a valid stop before any later phase.
129
129
  5. **Apply stops.** At every gate use
130
130
  [stop-conditions.md](reference/stop-conditions.md). A `blocked` label alone is not a stop condition:
@@ -14,7 +14,7 @@ user-invocable: true
14
14
  HITL stops; a later user invocation starts the next slice.
15
15
  Explicit `.devrites/AFK` alone lets the controlling root chain under green proof,
16
16
  caps and pause rules. Every wright returns after one slice.
17
- **Opt-in:** `/rite-build --parallel N` (2≤N≤10; N=1≡serial) follows
17
+ **HITL:** `/rite-build --parallel N` (2≤N≤10; N=1≡serial) follows
18
18
  [`reference/parallel-batch.md`](reference/parallel-batch.md)
19
19
  ([`one-slice-cycle.md`](reference/one-slice-cycle.md)).
20
20
 
@@ -45,8 +45,8 @@ Wright applies anti-slop; root verifies returns and never patches source. Refuse
45
45
 
46
46
  ## Invariants
47
47
 
48
- - Default: one slice; writers serial on control (core.md #5). Parallel only via
49
- `--parallel N` under [`reference/parallel-batch.md`](reference/parallel-batch.md).
48
+ - Standalone HITL default: serial on control (core.md #5). AFK/`--parallel N`
49
+ uses [`parallel-batch.md`](reference/parallel-batch.md).
50
50
  Same-worktree multi-writer / root-emulated concurrency forbidden.
51
51
  Native-worktree pilot = single-slice isolation when `wright-dispatch.md`
52
52
  preflight + reconcile hold.
@@ -80,7 +80,8 @@ Wright applies anti-slop; root verifies returns and never patches source. Refuse
80
80
  <!-- workflow-artifact-adapter: {"module":"devrites-lib/reference/standards/workflow-artifacts.md","entry":"Vet-ready admitted bytes require root authorship outside product wright","action":"ROOT_TRANSACTION; root writes only admitted .devrites/** targets","return":"saved Build slice cursor; wright product allowlist unchanged"} -->
81
81
  ## `--parallel N` (opt-in)
82
82
 
83
- Omitted/`1` ≡ serial; `2`–`10` is a **cap** — the root runs the largest eligible
83
+ HITL default/explicit `1` ≡ serial; AFK inherits cap.
84
+ `2`–`10` is a **cap** — the root runs an eligible
84
85
  path-disjoint set it can start now (`N_eff`, from `parallel select --from-plan`), takes fewer when the cap cannot be
85
86
  filled, and refills a slot per landing (serial slice or one sibling) until
86
87
  no pending slice remains
@@ -37,13 +37,15 @@ Select **greedily in plan order** with
37
37
  reads the ready set (tasks.md dependencies checked `built` in `state.md`, minus
38
38
  running-lease slices) and each slice's Writer allowlist (else `Files likely
39
39
  touched`), plus its manifest/lockfile when `External dependencies:` is not none;
40
- in Build, `next` prints the same `eligible_now:`/`batch:`. `N_eff ≥ 2` → parallel batch;
41
- `N_eff = 1` → one serial round; nothing pending → Prove. A cap that cannot be filled
42
- is normal: take fewer. Serial is this round's size, not the rest of the run.
40
+ `next` prints `eligible_now:`/`batch:`. `n_eff` counts new picks only.
41
+ With a running lease, a single new pick still uses `parallel add`;
42
+ `n_eff=0` with a running lease waits for siblings, not Prove. Without one:
43
+ ≥2 → parallel batch, 1 → serial, none pending → Prove.
44
+ Serial is this round only; a cap need not be filled.
43
45
 
44
46
  **Refill per landing; never wait for the batch.** Each sibling lands alone when
45
- green ([Lifecycle](#lifecycle) step 6). Then re-read `state.md`, pending slices, and
46
- the tree and run `parallel select --slug <slug> --cap N --from-plan`: unlanded siblings hold
47
+ green ([Lifecycle](#lifecycle) step 6). Re-read state, pending slices, and the
48
+ tree; reselect: unlanded siblings hold
47
49
  their slots and paths, landed ones count as built, and only new picks print;
48
50
  `parallel add` starts each from the control tip and its wright dispatches at once.
49
51
  No lease → plain `select` + `create`. AFK/autocomplete is one run; HITL stops after
@@ -116,6 +118,10 @@ Lease: `batch_id`, `created_at`, `base_sha`, `n`,
116
118
  full inventory, then bounded owning-role rechecks after repairs. Run approved
117
119
  proof in the same window as that review. Gap or Critical/Important → `gap`;
118
120
  else proof → `green|red|gap`.
121
+
122
+ A recheck round is one dispatch per changed surface, not one per checklist: the
123
+ recheck agent carries every open checklist (code, test, doubt) for that diff and
124
+ answers each by name. Merging cuts dispatches; dropping a checklist does not.
119
125
  Reviewer fan-out for a batch is itself batched under
120
126
  [`parallel-dispatch.md`](../../devrites-lib/reference/parallel-dispatch.md#scale-limits)
121
127
  (≈4 concurrent read-only reviewers, 8 only with disjoint paths), and `max_agents`
@@ -137,11 +143,11 @@ Lease: `batch_id`, `created_at`, `base_sha`, `n`,
137
143
  7. Each landing: FF control (the branch that held `HEAD` when the batch started —
138
144
  often `main`/`master`, otherwise whatever the user was on) by one local commit,
139
145
  never pushed; union that sibling's paths into `touched-files.md`; update
140
- state/evidence; AFK +1 for that sibling; optional `check candidate`. Then
141
- refill ([Dynamic selection](#dynamic-selection-and-re-batching)) and start the
142
- feature gates on control
143
- ([Proof tiers](phase-contract.md#proof-tiers)); the next landing waits for them
144
- to pass, the refilled wrights do not.
146
+ state/evidence; AFK +1; optional `check candidate`. Land every green sibling,
147
+ refill ([Dynamic selection](#dynamic-selection-and-re-batching)), then run the
148
+ feature gates once for the train
149
+ ([Proof tiers](phase-contract.md#proof-tiers)); the next train waits, the
150
+ refilled wrights do not.
145
151
  8. Cleanup runs only after the last landing marks the lease `complete` — work
146
152
  landed in control, so `parallel cleanup` removes worktrees/branches.
147
153
  Blocked/human-stopped batches keep lease, worktrees, branches — nothing is
@@ -223,13 +229,13 @@ devrites-engine parallel lease-write|lease-read|lease-clear --root <repo> --slug
223
229
  # parallel cleanup --root <repo> --slug <slug> --force (salvages, prints retained refs)
224
230
  ```
225
231
 
226
- `integrate` without `--apply-to-control` stages the per-sibling commits, leaves
227
- the lease `running` and control at `B`; cleanup still refuses — the commits
228
- cannot be lost. `record-green` and `integrate` also accept an `integrate-failed`
229
- lease, so a failed integrate retries after repair. `--apply-to-control`
230
- refuses when control moved past `B` or holds uncommitted changes on slice
231
- paths — stop for the human (never stash or commit their work); the batch is
232
- untouched. Go is SSOT; never ad-hoc git/bash orchestration.
232
+ `integrate` without `--apply-to-control` stages commits; lease stays `running`,
233
+ control stays at its expected tip, cleanup refuses. `record-green` and `integrate`
234
+ accept `integrate-failed` for retry. Applied landings advance `control_tip`
235
+ (initially `B`), permitting landings/refill. External control movement or
236
+ uncommitted slice-path edits with `--apply-to-control` cause refusal:
237
+ stop for the human (never stash or commit their work); the batch is untouched.
238
+ Go is SSOT; never ad-hoc git/bash orchestration.
233
239
 
234
240
  ## Runtime isolation
235
241
 
@@ -73,13 +73,25 @@ One contract builds one slice: preserve TDD, exact paths and independent judgmen
73
73
  ## Proof tiers
74
74
 
75
75
  With a `test-plan.md` `## Feature gates` section, step 6 runs `Tests/proof` and every
76
- other row; feature gates run once per parallel landing, on control, while worktree
77
- wrights continue. The next landing and Prove wait for them; red is a fingerprint
78
- against slices landed since the last green run. Serial same-worktree mode, and plans
76
+ other row; feature gates run once per landing train, on control, while worktree
77
+ wrights continue: land every green sibling together, run the suite once, and bisect only
78
+ on red. The next train and Prove wait for them; red is a fingerprint against slices
79
+ landed since the last green run. Serial same-worktree mode, and plans
79
80
  without the section, run every row each round. Run gate, benchmark and proof commands
80
81
  through the host's shell tool, never a code-evaluation subprocess, whose environment
81
82
  can lack the owner's exported variables.
82
83
 
84
+ Wrights run only the tests their changed paths reach, resolved from the merge base
85
+ against the plan's baseline rather than the last commit; Prove and Seal always run the
86
+ full suite. Resolve that narrow set with
87
+ `devrites-engine check affected <changed path...>`, which expands a changed package to its
88
+ dependent packages and widens on its own when a path is a module manifest, a generated
89
+ artifact, CI config, shared testdata, or one it cannot classify. Widen to the full suite
90
+ inside Build the moment a slice touches `go.mod` or a
91
+ lockfile, generated artifacts, CI config, a shared test harness, or whenever no test can
92
+ be named for a changed path. When selection is uncertain, run the full suite: the narrow
93
+ set is an optimisation, never a substitute.
94
+
83
95
  ## Independent Build review
84
96
 
85
97
  After inspection, freeze full slice scope and cumulative baseline diff with
@@ -175,9 +175,11 @@ Pull these via `Read` when shaping the plan:
175
175
  buildable AC/REQ maps to an existing slice/proof, every slice maps to real
176
176
  acceptance, and names/prose agree. Missing, duplicate, contradictory, or
177
177
  meaning-changing mappings block. Then run
178
- `devrites-engine check task-graph <slug>`; a malformed dependency graph blocks
178
+ `devrites-engine check task-graph <slug> --strict`; a malformed dependency graph, or a
179
+ shared path written by `hubAdvisoryMin`+ slices with no `Serial rationale:`, blocks
179
180
  before Vet rather than spending a reviewer context on invalid tasks. Resolve each
180
- `ADVISORY size:`/`hub:` line now (split or seam slice, or a rationale); never blocking.
181
+ `ADVISORY size:`/`hub:`/`chain:` line now (split or seam slice, or a rationale);
182
+ `--strict` refuses the contended plan, the default run only advises.
181
183
  7. **Readiness gate** (`plan-template.md`): require CLEAR coverage; complete acceptance,
182
184
  wiring, shared-contract proof, applicable outputs, and rollback; risk-first acyclic order;
183
185
  justified deviations; and every horizon item present, with blockers resolved, planning
@@ -172,8 +172,12 @@ cannot name what crosses, drop the edge; a shallow, wide graph runs in parallel.
172
172
 
173
173
  Slices sharing a file never build side by side: put a hub file's shared edit
174
174
  (registry, command table, test harness) in one seam slice the others depend on.
175
- `check task-graph` prints the `schedule:` and `ADVISORY hub:` lines; inseparable
176
- writes get `Serial rationale: <why>`. Never merge slices or drop acceptance to widen it.
175
+ `check task-graph` prints the `schedule:`, `ADVISORY hub:` and `ADVISORY chain:` lines.
176
+ A `chain` line means only one slice was ever ready, so the DAG rather than the cap
177
+ serializes: cut a slice that stands alone, or record `Serial rationale: <why>`.
178
+ `check task-graph <slug> --strict` refuses a plan whose shared path carries `ADVISORY hub:`
179
+ writers, so a contended plan must split disjointly instead of widening the cap.
180
+ Never merge slices or drop acceptance to widen it.
177
181
 
178
182
  ## Deferred slice
179
183
  A slice with `Satisfies: none` is an optional follow-up: plan-invented hardening or
@@ -21,7 +21,8 @@ Read named paths only. Accept released v1/v2 bullet or v3 table `state.md` under
21
21
  `.devrites/work/<slug>/`. Reject aliases, release scripts/markers, and conversion.
22
22
 
23
23
  Cite current rule plus workspace evidence for each applicable axis: cursor/topology,
24
- phase artifacts, decisions, planning/traceability/proof, built-code/intent, protected
24
+ phase artifacts, decisions, planning/traceability/proof (including a `check task-graph`
25
+ `ADVISORY chain:` schedule that no parallel cap can widen), built-code/intent, protected
25
26
  history, artifact budgets/feature ceiling (the supplied `devrites-engine orient`
26
27
  `artifact_budgets`/`bulk_files` and `task_graph.slice_count` against
27
28
  [`workspace-artifact-schema.md`](.agents/skills/devrites-lib/reference/workspace-artifact-schema.md) and [`slicing.md`](.agents/skills/rite-plan/reference/slicing.md) § Feature ceiling),
@@ -118,13 +118,13 @@ next sequence continuation through Vet in a second session, then stop.
118
118
  `$rite-build` batch loop → `$rite-prove` → `$rite-polish` →
119
119
  `$rite-review` → `$rite-seal`. Read and execute each skill; durable files, not
120
120
  chat, carry state. Apply the mutable post-vet budget before first Build.
121
- Build runs the path-disjoint batch `parallel select --from-plan` picks (cap: this invocation's
122
- `--parallel N`, else sentinel `max_parallel`, else 10) and refills a slot
123
- per landing until no pending slice remains; a one-slice round is serial for that round only, then
124
- selection runs again (host isolation still forces serial when concurrent writers
125
- cannot be separated). When `--parallel N`
126
- is present, pass it into `$rite-build` and do not consult leftover sentinel
127
- `max_parallel`.
121
+ Build uses `parallel select --from-plan` (cap: explicit `--parallel N`, else
122
+ sentinel `max_parallel`, else 10), refilling per landing until none pending;
123
+ a one-slice round is serial for that round only; reselect afterward. Host
124
+ isolation may force serial. If `--parallel N` is explicit,
125
+ pass it into `$rite-build` and ignore leftover sentinel `max_parallel`.
126
+ Otherwise pass the resolved sentinel/default cap into `$rite-build` as
127
+ `--parallel N`, never bare `$rite-build`.
128
128
  **Completion:** loop reaches Seal GO or persists a valid stop before any later phase.
129
129
  5. **Apply stops.** At every gate use
130
130
  [stop-conditions.md](reference/stop-conditions.md). A `blocked` label alone is not a stop condition:
@@ -14,7 +14,7 @@ user-invocable: true
14
14
  HITL stops; a later user invocation starts the next slice.
15
15
  Explicit `.devrites/AFK` alone lets the controlling root chain under green proof,
16
16
  caps and pause rules. Every wright returns after one slice.
17
- **Opt-in:** `$rite-build --parallel N` (2≤N≤10; N=1≡serial) follows
17
+ **HITL:** `$rite-build --parallel N` (2≤N≤10; N=1≡serial) follows
18
18
  [`reference/parallel-batch.md`](reference/parallel-batch.md)
19
19
  ([`one-slice-cycle.md`](reference/one-slice-cycle.md)).
20
20
 
@@ -45,8 +45,8 @@ Wright applies anti-slop; root verifies returns and never patches source. Refuse
45
45
 
46
46
  ## Invariants
47
47
 
48
- - Default: one slice; writers serial on control (core.md #5). Parallel only via
49
- `--parallel N` under [`reference/parallel-batch.md`](reference/parallel-batch.md).
48
+ - Standalone HITL default: serial on control (core.md #5). AFK/`--parallel N`
49
+ uses [`parallel-batch.md`](reference/parallel-batch.md).
50
50
  Same-worktree multi-writer / root-emulated concurrency forbidden.
51
51
  Native-worktree pilot = single-slice isolation when `wright-dispatch.md`
52
52
  preflight + reconcile hold.
@@ -80,7 +80,8 @@ Wright applies anti-slop; root verifies returns and never patches source. Refuse
80
80
  <!-- workflow-artifact-adapter: {"module":"devrites-lib/reference/standards/workflow-artifacts.md","entry":"Vet-ready admitted bytes require root authorship outside product wright","action":"ROOT_TRANSACTION; root writes only admitted .devrites/** targets","return":"saved Build slice cursor; wright product allowlist unchanged"} -->
81
81
  ## `--parallel N` (opt-in)
82
82
 
83
- Omitted/`1` ≡ serial; `2`–`10` is a **cap** — the root runs the largest eligible
83
+ HITL default/explicit `1` ≡ serial; AFK inherits cap.
84
+ `2`–`10` is a **cap** — the root runs an eligible
84
85
  path-disjoint set it can start now (`N_eff`, from `parallel select --from-plan`), takes fewer when the cap cannot be
85
86
  filled, and refills a slot per landing (serial slice or one sibling) until
86
87
  no pending slice remains
@@ -37,13 +37,15 @@ Select **greedily in plan order** with
37
37
  reads the ready set (tasks.md dependencies checked `built` in `state.md`, minus
38
38
  running-lease slices) and each slice's Writer allowlist (else `Files likely
39
39
  touched`), plus its manifest/lockfile when `External dependencies:` is not none;
40
- in Build, `next` prints the same `eligible_now:`/`batch:`. `N_eff ≥ 2` → parallel batch;
41
- `N_eff = 1` → one serial round; nothing pending → Prove. A cap that cannot be filled
42
- is normal: take fewer. Serial is this round's size, not the rest of the run.
40
+ `next` prints `eligible_now:`/`batch:`. `n_eff` counts new picks only.
41
+ With a running lease, a single new pick still uses `parallel add`;
42
+ `n_eff=0` with a running lease waits for siblings, not Prove. Without one:
43
+ ≥2 → parallel batch, 1 → serial, none pending → Prove.
44
+ Serial is this round only; a cap need not be filled.
43
45
 
44
46
  **Refill per landing; never wait for the batch.** Each sibling lands alone when
45
- green ([Lifecycle](#lifecycle) step 6). Then re-read `state.md`, pending slices, and
46
- the tree and run `parallel select --slug <slug> --cap N --from-plan`: unlanded siblings hold
47
+ green ([Lifecycle](#lifecycle) step 6). Re-read state, pending slices, and the
48
+ tree; reselect: unlanded siblings hold
47
49
  their slots and paths, landed ones count as built, and only new picks print;
48
50
  `parallel add` starts each from the control tip and its wright dispatches at once.
49
51
  No lease → plain `select` + `create`. AFK/autocomplete is one run; HITL stops after
@@ -116,6 +118,10 @@ Lease: `batch_id`, `created_at`, `base_sha`, `n`,
116
118
  full inventory, then bounded owning-role rechecks after repairs. Run approved
117
119
  proof in the same window as that review. Gap or Critical/Important → `gap`;
118
120
  else proof → `green|red|gap`.
121
+
122
+ A recheck round is one dispatch per changed surface, not one per checklist: the
123
+ recheck agent carries every open checklist (code, test, doubt) for that diff and
124
+ answers each by name. Merging cuts dispatches; dropping a checklist does not.
119
125
  Reviewer fan-out for a batch is itself batched under
120
126
  [`parallel-dispatch.md`](../../devrites-lib/reference/parallel-dispatch.md#scale-limits)
121
127
  (≈4 concurrent read-only reviewers, 8 only with disjoint paths), and `max_agents`
@@ -137,11 +143,11 @@ Lease: `batch_id`, `created_at`, `base_sha`, `n`,
137
143
  7. Each landing: FF control (the branch that held `HEAD` when the batch started —
138
144
  often `main`/`master`, otherwise whatever the user was on) by one local commit,
139
145
  never pushed; union that sibling's paths into `touched-files.md`; update
140
- state/evidence; AFK +1 for that sibling; optional `check candidate`. Then
141
- refill ([Dynamic selection](#dynamic-selection-and-re-batching)) and start the
142
- feature gates on control
143
- ([Proof tiers](phase-contract.md#proof-tiers)); the next landing waits for them
144
- to pass, the refilled wrights do not.
146
+ state/evidence; AFK +1; optional `check candidate`. Land every green sibling,
147
+ refill ([Dynamic selection](#dynamic-selection-and-re-batching)), then run the
148
+ feature gates once for the train
149
+ ([Proof tiers](phase-contract.md#proof-tiers)); the next train waits, the
150
+ refilled wrights do not.
145
151
  8. Cleanup runs only after the last landing marks the lease `complete` — work
146
152
  landed in control, so `parallel cleanup` removes worktrees/branches.
147
153
  Blocked/human-stopped batches keep lease, worktrees, branches — nothing is
@@ -223,13 +229,13 @@ devrites-engine parallel lease-write|lease-read|lease-clear --root <repo> --slug
223
229
  # parallel cleanup --root <repo> --slug <slug> --force (salvages, prints retained refs)
224
230
  ```
225
231
 
226
- `integrate` without `--apply-to-control` stages the per-sibling commits, leaves
227
- the lease `running` and control at `B`; cleanup still refuses — the commits
228
- cannot be lost. `record-green` and `integrate` also accept an `integrate-failed`
229
- lease, so a failed integrate retries after repair. `--apply-to-control`
230
- refuses when control moved past `B` or holds uncommitted changes on slice
231
- paths — stop for the human (never stash or commit their work); the batch is
232
- untouched. Go is SSOT; never ad-hoc git/bash orchestration.
232
+ `integrate` without `--apply-to-control` stages commits; lease stays `running`,
233
+ control stays at its expected tip, cleanup refuses. `record-green` and `integrate`
234
+ accept `integrate-failed` for retry. Applied landings advance `control_tip`
235
+ (initially `B`), permitting landings/refill. External control movement or
236
+ uncommitted slice-path edits with `--apply-to-control` cause refusal:
237
+ stop for the human (never stash or commit their work); the batch is untouched.
238
+ Go is SSOT; never ad-hoc git/bash orchestration.
233
239
 
234
240
  ## Runtime isolation
235
241
 
@@ -73,13 +73,25 @@ One contract builds one slice: preserve TDD, exact paths and independent judgmen
73
73
  ## Proof tiers
74
74
 
75
75
  With a `test-plan.md` `## Feature gates` section, step 6 runs `Tests/proof` and every
76
- other row; feature gates run once per parallel landing, on control, while worktree
77
- wrights continue. The next landing and Prove wait for them; red is a fingerprint
78
- against slices landed since the last green run. Serial same-worktree mode, and plans
76
+ other row; feature gates run once per landing train, on control, while worktree
77
+ wrights continue: land every green sibling together, run the suite once, and bisect only
78
+ on red. The next train and Prove wait for them; red is a fingerprint against slices
79
+ landed since the last green run. Serial same-worktree mode, and plans
79
80
  without the section, run every row each round. Run gate, benchmark and proof commands
80
81
  through the host's shell tool, never a code-evaluation subprocess, whose environment
81
82
  can lack the owner's exported variables.
82
83
 
84
+ Wrights run only the tests their changed paths reach, resolved from the merge base
85
+ against the plan's baseline rather than the last commit; Prove and Seal always run the
86
+ full suite. Resolve that narrow set with
87
+ `devrites-engine check affected <changed path...>`, which expands a changed package to its
88
+ dependent packages and widens on its own when a path is a module manifest, a generated
89
+ artifact, CI config, shared testdata, or one it cannot classify. Widen to the full suite
90
+ inside Build the moment a slice touches `go.mod` or a
91
+ lockfile, generated artifacts, CI config, a shared test harness, or whenever no test can
92
+ be named for a changed path. When selection is uncertain, run the full suite: the narrow
93
+ set is an optimisation, never a substitute.
94
+
83
95
  ## Independent Build review
84
96
 
85
97
  After inspection, freeze full slice scope and cumulative baseline diff with
@@ -175,9 +175,11 @@ Pull these via `Read` when shaping the plan:
175
175
  buildable AC/REQ maps to an existing slice/proof, every slice maps to real
176
176
  acceptance, and names/prose agree. Missing, duplicate, contradictory, or
177
177
  meaning-changing mappings block. Then run
178
- `devrites-engine check task-graph <slug>`; a malformed dependency graph blocks
178
+ `devrites-engine check task-graph <slug> --strict`; a malformed dependency graph, or a
179
+ shared path written by `hubAdvisoryMin`+ slices with no `Serial rationale:`, blocks
179
180
  before Vet rather than spending a reviewer context on invalid tasks. Resolve each
180
- `ADVISORY size:`/`hub:` line now (split or seam slice, or a rationale); never blocking.
181
+ `ADVISORY size:`/`hub:`/`chain:` line now (split or seam slice, or a rationale);
182
+ `--strict` refuses the contended plan, the default run only advises.
181
183
  7. **Readiness gate** (`plan-template.md`): require CLEAR coverage; complete acceptance,
182
184
  wiring, shared-contract proof, applicable outputs, and rollback; risk-first acyclic order;
183
185
  justified deviations; and every horizon item present, with blockers resolved, planning
@@ -172,8 +172,12 @@ cannot name what crosses, drop the edge; a shallow, wide graph runs in parallel.
172
172
 
173
173
  Slices sharing a file never build side by side: put a hub file's shared edit
174
174
  (registry, command table, test harness) in one seam slice the others depend on.
175
- `check task-graph` prints the `schedule:` and `ADVISORY hub:` lines; inseparable
176
- writes get `Serial rationale: <why>`. Never merge slices or drop acceptance to widen it.
175
+ `check task-graph` prints the `schedule:`, `ADVISORY hub:` and `ADVISORY chain:` lines.
176
+ A `chain` line means only one slice was ever ready, so the DAG rather than the cap
177
+ serializes: cut a slice that stands alone, or record `Serial rationale: <why>`.
178
+ `check task-graph <slug> --strict` refuses a plan whose shared path carries `ADVISORY hub:`
179
+ writers, so a contended plan must split disjointly instead of widening the cap.
180
+ Never merge slices or drop acceptance to widen it.
177
181
 
178
182
  ## Deferred slice
179
183
  A slice with `Satisfies: none` is an optional follow-up: plan-invented hardening or
@@ -25,7 +25,8 @@ Read named paths only. Accept released v1/v2 bullet or v3 table `state.md` under
25
25
  `.devrites/work/<slug>/`. Reject aliases, release scripts/markers, and conversion.
26
26
 
27
27
  Cite current rule plus workspace evidence for each applicable axis: cursor/topology,
28
- phase artifacts, decisions, planning/traceability/proof, built-code/intent, protected
28
+ phase artifacts, decisions, planning/traceability/proof (including a `check task-graph`
29
+ `ADVISORY chain:` schedule that no parallel cap can widen), built-code/intent, protected
29
30
  history, artifact budgets/feature ceiling (the supplied `devrites-engine orient`
30
31
  `artifact_budgets`/`bulk_files` and `task_graph.slice_count` against
31
32
  [`workspace-artifact-schema.md`](../skills/devrites-lib/reference/workspace-artifact-schema.md) and [`slicing.md`](../skills/rite-plan/reference/slicing.md) § Feature ceiling),
@@ -117,13 +117,13 @@ next sequence continuation through Vet in a second session, then stop.
117
117
  `/rite-build` batch loop → `/rite-prove` → `/rite-polish` →
118
118
  `/rite-review` → `/rite-seal`. Read and execute each skill; durable files, not
119
119
  chat, carry state. Apply the mutable post-vet budget before first Build.
120
- Build runs the path-disjoint batch `parallel select --from-plan` picks (cap: this invocation's
121
- `--parallel N`, else sentinel `max_parallel`, else 10) and refills a slot
122
- per landing until no pending slice remains; a one-slice round is serial for that round only, then
123
- selection runs again (host isolation still forces serial when concurrent writers
124
- cannot be separated). When `--parallel N`
125
- is present, pass it into `/rite-build` and do not consult leftover sentinel
126
- `max_parallel`.
120
+ Build uses `parallel select --from-plan` (cap: explicit `--parallel N`, else
121
+ sentinel `max_parallel`, else 10), refilling per landing until none pending;
122
+ a one-slice round is serial for that round only; reselect afterward. Host
123
+ isolation may force serial. If `--parallel N` is explicit,
124
+ pass it into `/rite-build` and ignore leftover sentinel `max_parallel`.
125
+ Otherwise pass the resolved sentinel/default cap into `/rite-build` as
126
+ `--parallel N`, never bare `/rite-build`.
127
127
  **Completion:** loop reaches Seal GO or persists a valid stop before any later phase.
128
128
  5. **Apply stops.** At every gate use
129
129
  [stop-conditions.md](reference/stop-conditions.md). A `blocked` label alone is not a stop condition:
@@ -13,7 +13,7 @@ argument-hint: "[--parallel N] [slice number or name]"
13
13
  HITL stops; a later user invocation starts the next slice.
14
14
  Explicit `.devrites/AFK` alone lets the controlling root chain under green proof,
15
15
  caps and pause rules. Every wright returns after one slice.
16
- **Opt-in:** `/rite-build --parallel N` (2≤N≤10; N=1≡serial) follows
16
+ **HITL:** `/rite-build --parallel N` (2≤N≤10; N=1≡serial) follows
17
17
  [`reference/parallel-batch.md`](reference/parallel-batch.md)
18
18
  ([`one-slice-cycle.md`](reference/one-slice-cycle.md)).
19
19
 
@@ -44,8 +44,8 @@ Wright applies anti-slop; root verifies returns and never patches source. Refuse
44
44
 
45
45
  ## Invariants
46
46
 
47
- - Default: one slice; writers serial on control (core.md #5). Parallel only via
48
- `--parallel N` under [`reference/parallel-batch.md`](reference/parallel-batch.md).
47
+ - Standalone HITL default: serial on control (core.md #5). AFK/`--parallel N`
48
+ uses [`parallel-batch.md`](reference/parallel-batch.md).
49
49
  Same-worktree multi-writer / root-emulated concurrency forbidden.
50
50
  Native-worktree pilot = single-slice isolation when `wright-dispatch.md`
51
51
  preflight + reconcile hold.
@@ -79,7 +79,8 @@ Wright applies anti-slop; root verifies returns and never patches source. Refuse
79
79
  <!-- workflow-artifact-adapter: {"module":"devrites-lib/reference/standards/workflow-artifacts.md","entry":"Vet-ready admitted bytes require root authorship outside product wright","action":"ROOT_TRANSACTION; root writes only admitted .devrites/** targets","return":"saved Build slice cursor; wright product allowlist unchanged"} -->
80
80
  ## `--parallel N` (opt-in)
81
81
 
82
- Omitted/`1` ≡ serial; `2`–`10` is a **cap** — the root runs the largest eligible
82
+ HITL default/explicit `1` ≡ serial; AFK inherits cap.
83
+ `2`–`10` is a **cap** — the root runs an eligible
83
84
  path-disjoint set it can start now (`N_eff`, from `parallel select --from-plan`), takes fewer when the cap cannot be
84
85
  filled, and refills a slot per landing (serial slice or one sibling) until
85
86
  no pending slice remains
@@ -37,13 +37,15 @@ Select **greedily in plan order** with
37
37
  reads the ready set (tasks.md dependencies checked `built` in `state.md`, minus
38
38
  running-lease slices) and each slice's Writer allowlist (else `Files likely
39
39
  touched`), plus its manifest/lockfile when `External dependencies:` is not none;
40
- in Build, `next` prints the same `eligible_now:`/`batch:`. `N_eff ≥ 2` → parallel batch;
41
- `N_eff = 1` → one serial round; nothing pending → Prove. A cap that cannot be filled
42
- is normal: take fewer. Serial is this round's size, not the rest of the run.
40
+ `next` prints `eligible_now:`/`batch:`. `n_eff` counts new picks only.
41
+ With a running lease, a single new pick still uses `parallel add`;
42
+ `n_eff=0` with a running lease waits for siblings, not Prove. Without one:
43
+ ≥2 → parallel batch, 1 → serial, none pending → Prove.
44
+ Serial is this round only; a cap need not be filled.
43
45
 
44
46
  **Refill per landing; never wait for the batch.** Each sibling lands alone when
45
- green ([Lifecycle](#lifecycle) step 6). Then re-read `state.md`, pending slices, and
46
- the tree and run `parallel select --slug <slug> --cap N --from-plan`: unlanded siblings hold
47
+ green ([Lifecycle](#lifecycle) step 6). Re-read state, pending slices, and the
48
+ tree; reselect: unlanded siblings hold
47
49
  their slots and paths, landed ones count as built, and only new picks print;
48
50
  `parallel add` starts each from the control tip and its wright dispatches at once.
49
51
  No lease → plain `select` + `create`. AFK/autocomplete is one run; HITL stops after
@@ -116,6 +118,10 @@ Lease: `batch_id`, `created_at`, `base_sha`, `n`,
116
118
  full inventory, then bounded owning-role rechecks after repairs. Run approved
117
119
  proof in the same window as that review. Gap or Critical/Important → `gap`;
118
120
  else proof → `green|red|gap`.
121
+
122
+ A recheck round is one dispatch per changed surface, not one per checklist: the
123
+ recheck agent carries every open checklist (code, test, doubt) for that diff and
124
+ answers each by name. Merging cuts dispatches; dropping a checklist does not.
119
125
  Reviewer fan-out for a batch is itself batched under
120
126
  [`parallel-dispatch.md`](../../devrites-lib/reference/parallel-dispatch.md#scale-limits)
121
127
  (≈4 concurrent read-only reviewers, 8 only with disjoint paths), and `max_agents`
@@ -137,11 +143,11 @@ Lease: `batch_id`, `created_at`, `base_sha`, `n`,
137
143
  7. Each landing: FF control (the branch that held `HEAD` when the batch started —
138
144
  often `main`/`master`, otherwise whatever the user was on) by one local commit,
139
145
  never pushed; union that sibling's paths into `touched-files.md`; update
140
- state/evidence; AFK +1 for that sibling; optional `check candidate`. Then
141
- refill ([Dynamic selection](#dynamic-selection-and-re-batching)) and start the
142
- feature gates on control
143
- ([Proof tiers](phase-contract.md#proof-tiers)); the next landing waits for them
144
- to pass, the refilled wrights do not.
146
+ state/evidence; AFK +1; optional `check candidate`. Land every green sibling,
147
+ refill ([Dynamic selection](#dynamic-selection-and-re-batching)), then run the
148
+ feature gates once for the train
149
+ ([Proof tiers](phase-contract.md#proof-tiers)); the next train waits, the
150
+ refilled wrights do not.
145
151
  8. Cleanup runs only after the last landing marks the lease `complete` — work
146
152
  landed in control, so `parallel cleanup` removes worktrees/branches.
147
153
  Blocked/human-stopped batches keep lease, worktrees, branches — nothing is
@@ -223,13 +229,13 @@ devrites-engine parallel lease-write|lease-read|lease-clear --root <repo> --slug
223
229
  # parallel cleanup --root <repo> --slug <slug> --force (salvages, prints retained refs)
224
230
  ```
225
231
 
226
- `integrate` without `--apply-to-control` stages the per-sibling commits, leaves
227
- the lease `running` and control at `B`; cleanup still refuses — the commits
228
- cannot be lost. `record-green` and `integrate` also accept an `integrate-failed`
229
- lease, so a failed integrate retries after repair. `--apply-to-control`
230
- refuses when control moved past `B` or holds uncommitted changes on slice
231
- paths — stop for the human (never stash or commit their work); the batch is
232
- untouched. Go is SSOT; never ad-hoc git/bash orchestration.
232
+ `integrate` without `--apply-to-control` stages commits; lease stays `running`,
233
+ control stays at its expected tip, cleanup refuses. `record-green` and `integrate`
234
+ accept `integrate-failed` for retry. Applied landings advance `control_tip`
235
+ (initially `B`), permitting landings/refill. External control movement or
236
+ uncommitted slice-path edits with `--apply-to-control` cause refusal:
237
+ stop for the human (never stash or commit their work); the batch is untouched.
238
+ Go is SSOT; never ad-hoc git/bash orchestration.
233
239
 
234
240
  ## Runtime isolation
235
241