devrites 7.0.17 → 7.1.1

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 (86) hide show
  1. package/CHANGELOG.md +17 -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-autocomplete/reference/loop.md +9 -10
  11. package/pack/.claude/skills/rite-build/SKILL.md +10 -10
  12. package/pack/.claude/skills/rite-build/reference/afk-discipline.md +9 -11
  13. package/pack/.claude/skills/rite-build/reference/anti-patterns.md +2 -2
  14. package/pack/.claude/skills/rite-build/reference/checkpoint.md +10 -5
  15. package/pack/.claude/skills/rite-build/reference/one-slice-cycle.md +6 -4
  16. package/pack/.claude/skills/rite-build/reference/output.md +15 -21
  17. package/pack/.claude/skills/rite-build/reference/parallel-batch.md +23 -17
  18. package/pack/.claude/skills/rite-build/reference/phase-contract.md +15 -3
  19. package/pack/.claude/skills/rite-define/SKILL.md +4 -2
  20. package/pack/.claude/skills/rite-plan/reference/slicing.md +6 -2
  21. package/pack/generated/claude/agents/devrites-upgrade-planner.md +2 -1
  22. package/pack/generated/claude/skills/rite-autocomplete/SKILL.md +7 -7
  23. package/pack/generated/claude/skills/rite-autocomplete/reference/loop.md +9 -10
  24. package/pack/generated/claude/skills/rite-build/SKILL.md +10 -10
  25. package/pack/generated/claude/skills/rite-build/reference/afk-discipline.md +9 -11
  26. package/pack/generated/claude/skills/rite-build/reference/anti-patterns.md +2 -2
  27. package/pack/generated/claude/skills/rite-build/reference/checkpoint.md +10 -5
  28. package/pack/generated/claude/skills/rite-build/reference/one-slice-cycle.md +6 -4
  29. package/pack/generated/claude/skills/rite-build/reference/output.md +15 -21
  30. package/pack/generated/claude/skills/rite-build/reference/parallel-batch.md +23 -17
  31. package/pack/generated/claude/skills/rite-build/reference/phase-contract.md +15 -3
  32. package/pack/generated/claude/skills/rite-define/SKILL.md +4 -2
  33. package/pack/generated/claude/skills/rite-plan/reference/slicing.md +6 -2
  34. package/pack/generated/codex/agents/devrites-upgrade-planner.toml +2 -1
  35. package/pack/generated/codex/skills/rite-autocomplete/SKILL.md +7 -7
  36. package/pack/generated/codex/skills/rite-autocomplete/reference/loop.md +9 -10
  37. package/pack/generated/codex/skills/rite-build/SKILL.md +10 -10
  38. package/pack/generated/codex/skills/rite-build/reference/afk-discipline.md +9 -11
  39. package/pack/generated/codex/skills/rite-build/reference/anti-patterns.md +2 -2
  40. package/pack/generated/codex/skills/rite-build/reference/checkpoint.md +10 -5
  41. package/pack/generated/codex/skills/rite-build/reference/one-slice-cycle.md +6 -4
  42. package/pack/generated/codex/skills/rite-build/reference/output.md +15 -21
  43. package/pack/generated/codex/skills/rite-build/reference/parallel-batch.md +23 -17
  44. package/pack/generated/codex/skills/rite-build/reference/phase-contract.md +15 -3
  45. package/pack/generated/codex/skills/rite-define/SKILL.md +4 -2
  46. package/pack/generated/codex/skills/rite-plan/reference/slicing.md +6 -2
  47. package/pack/generated/devin/agents/devrites-upgrade-planner.md +2 -1
  48. package/pack/generated/devin/skills/rite-autocomplete/SKILL.md +7 -7
  49. package/pack/generated/devin/skills/rite-autocomplete/reference/loop.md +9 -10
  50. package/pack/generated/devin/skills/rite-build/SKILL.md +10 -10
  51. package/pack/generated/devin/skills/rite-build/reference/afk-discipline.md +9 -11
  52. package/pack/generated/devin/skills/rite-build/reference/anti-patterns.md +2 -2
  53. package/pack/generated/devin/skills/rite-build/reference/checkpoint.md +10 -5
  54. package/pack/generated/devin/skills/rite-build/reference/one-slice-cycle.md +6 -4
  55. package/pack/generated/devin/skills/rite-build/reference/output.md +15 -21
  56. package/pack/generated/devin/skills/rite-build/reference/parallel-batch.md +23 -17
  57. package/pack/generated/devin/skills/rite-build/reference/phase-contract.md +15 -3
  58. package/pack/generated/devin/skills/rite-define/SKILL.md +4 -2
  59. package/pack/generated/devin/skills/rite-plan/reference/slicing.md +6 -2
  60. package/pack/generated/omp/agents/devrites-upgrade-planner.md +2 -1
  61. package/pack/generated/omp/skills/rite-autocomplete/SKILL.md +7 -7
  62. package/pack/generated/omp/skills/rite-autocomplete/reference/loop.md +9 -10
  63. package/pack/generated/omp/skills/rite-build/SKILL.md +10 -10
  64. package/pack/generated/omp/skills/rite-build/reference/afk-discipline.md +9 -11
  65. package/pack/generated/omp/skills/rite-build/reference/anti-patterns.md +2 -2
  66. package/pack/generated/omp/skills/rite-build/reference/checkpoint.md +10 -5
  67. package/pack/generated/omp/skills/rite-build/reference/one-slice-cycle.md +6 -4
  68. package/pack/generated/omp/skills/rite-build/reference/output.md +15 -21
  69. package/pack/generated/omp/skills/rite-build/reference/parallel-batch.md +23 -17
  70. package/pack/generated/omp/skills/rite-build/reference/phase-contract.md +15 -3
  71. package/pack/generated/omp/skills/rite-define/SKILL.md +4 -2
  72. package/pack/generated/omp/skills/rite-plan/reference/slicing.md +6 -2
  73. package/pack/generated/pi/agents/devrites-upgrade-planner.md +2 -1
  74. package/pack/generated/pi/skills/rite-autocomplete/SKILL.md +7 -7
  75. package/pack/generated/pi/skills/rite-autocomplete/reference/loop.md +9 -10
  76. package/pack/generated/pi/skills/rite-build/SKILL.md +10 -10
  77. package/pack/generated/pi/skills/rite-build/reference/afk-discipline.md +9 -11
  78. package/pack/generated/pi/skills/rite-build/reference/anti-patterns.md +2 -2
  79. package/pack/generated/pi/skills/rite-build/reference/checkpoint.md +10 -5
  80. package/pack/generated/pi/skills/rite-build/reference/one-slice-cycle.md +6 -4
  81. package/pack/generated/pi/skills/rite-build/reference/output.md +15 -21
  82. package/pack/generated/pi/skills/rite-build/reference/parallel-batch.md +23 -17
  83. package/pack/generated/pi/skills/rite-build/reference/phase-contract.md +15 -3
  84. package/pack/generated/pi/skills/rite-define/SKILL.md +4 -2
  85. package/pack/generated/pi/skills/rite-plan/reference/slicing.md +6 -2
  86. package/package.json +1 -1
@@ -2,34 +2,28 @@
2
2
 
3
3
  > Root-only: not inlined in --role bundles.
4
4
 
5
- **Slices remain:**
5
+ ## Caller-owned continuation
6
6
 
7
- ```text
8
- Done: built slice <n> — <name>.
9
- Changed: <files>; state.md, touched-files.md, evidence.md
10
- Evidence: acceptance met; tests <cmd> → pass; browser <summary|n/a>; drift <none|handled>
11
- Open: <none|blockers|questions>
12
- Next: /rite-build
13
- Record: .devrites/work/<slug>/evidence.md
14
- ↻ Hygiene: /clear between slices (none in `orient` `inflight_waves`); /rite-handoff if away > a few hours
15
- ```
7
+ Before standalone replies, return internally to active `/rite-autocomplete` or
8
+ another controlling rite after green proof, checkpoint, and accounting:
9
+ - Slices remain: re-read durable state and reselect/refill; no user-facing reply.
10
+ - All built: return internally to the caller to invoke `/rite-prove` under its own contract.
11
+
12
+ Human/safety/access/Git stops still use the shared reply contract.
13
+
14
+ ## Standalone response
16
15
 
17
- **All built:**
16
+ HITL returns after one green slice; AFK chains per `afk-discipline.md`.
17
+ Every wright returns after one slice. Build alone never invokes Prove.
18
18
 
19
19
  ```text
20
- Done: built slice <n> — <name>; all slices built.
20
+ Done: built slice <n> — <name>[; all slices built].
21
21
  Changed: <files>; state.md, touched-files.md, evidence.md
22
22
  Evidence: acceptance met; tests <cmd> → pass; browser <summary|n/a>; drift <none|handled>
23
23
  Open: <none|blockers|questions>
24
- Next: /rite-prove
24
+ Next: /rite-build [all built: /rite-prove]
25
25
  Record: .devrites/work/<slug>/evidence.md
26
- ↻ Hygiene: /clear before /rite-prove; /rite-handoff if away > a few hours
26
+ ↻ Hygiene: /clear between slices (none in `orient` `inflight_waves`); /rite-handoff if away > a few hours
27
27
  ```
28
28
 
29
- HITL returns after one green slice. Only explicit `.devrites/AFK` lets the
30
- controlling root chain another pending slice after green-proof, cap, and pause
31
- gates. Every `devrites-slice-wright` returns after exactly one slice.
32
-
33
- At all built, Build never enters `/rite-prove` automatically; a higher-level
34
- orchestrator may invoke it only under its own contract. Awaiting-human or
35
- stopped states use the shared reply contract.
29
+ Awaiting-human or stopped states use the shared reply contract.
@@ -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`](skill://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
@@ -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:
@@ -46,15 +46,14 @@ readiness check first; reject overlap. Do not stop on `max_agents`,
46
46
  `max_minutes`, or `max_review_queue`. Count every leaf result. A new activation
47
47
  gets fresh activation-local counters but retains durable slice/recovery state.
48
48
 
49
- When driving `/rite-build`, ignore afk-discipline remaining-0, `--max-slices`,
50
- and parallel AFK headroom as stop conditions. Pass this invocation's
51
- `--parallel N` into `/rite-build` when present; leftover sentinel
52
- `max_parallel` is then not the cap. Close validating questions and blocking questions
53
- that already name a ranked recommended option (recommended pick via
54
- `devrites-engine state resolve`) instead of queuing them or handing
55
- `/rite-resolve` to the user. Escalating, irreversible-risk, access, and
56
- blocking with no recommended option still pause, as does Seal's judgment-only
57
- validating question (`slice: seal`).
49
+ [Build return](../../rite-build/reference/output.md#caller-owned-continuation).
50
+ Pass `--parallel N`; ignore leftover cap/headroom, remaining-0,
51
+ and `--max-slices` stops. Agent-invented dispatch, wait, tool-call, or turn budgets are not stop conditions.
52
+ An explicit human request to pause or run only a bounded subset still wins.
53
+ Path collisions serialize work; they do not end the run.
54
+ Resolve ranked validating/blocking picks via `devrites-engine state resolve`;
55
+ never hand `/rite-resolve` to the user. Escalating, irreversible-risk, access, blocking
56
+ without recommendations, and Seal judgment (`slice: seal`) still pause.
58
57
 
59
58
  ## Phase arc
60
59
 
@@ -67,7 +66,7 @@ Workspace files carry state; chat does not. Read and execute each phase skill:
67
66
  | 3 | `/rite-temper` | harden or reduce; `expand` and extra acceptance stop for a human; irreversible risk still pauses |
68
67
  | 4 | `/rite-define` | approved plan/tasks/traceability |
69
68
  | 5 | `/rite-vet` | every plan; derive mutable budget after READY |
70
- | 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
+ | 6 | `/rite-build` batch loop | largest eligible path-disjoint set (cap: this invocation's `--parallel N`, else sentinel `max_parallel`, else 10; serial if <2 eligible); refill per landing; charge once per landed slice |
71
70
  | 7 | `/rite-prove` | all slices built except deferred (`Satisfies: none`); approved proof; recovery on red |
72
71
  | 8 | `/rite-polish` | re-prove after code edits |
73
72
  | 9 | `/rite-review` | in-scope correction then fresh proof |
@@ -11,10 +11,10 @@ user-invocable: true
11
11
 
12
12
  # /rite-build: one verified slice
13
13
 
14
- HITL stops; a later user invocation starts the next slice.
15
- Explicit `.devrites/AFK` alone lets the controlling root chain under green proof,
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
14
+ Active caller takes precedence per [output.md](reference/output.md#caller-owned-continuation).
15
+ Standalone HITL stops; standalone AFK chains under green proof, caps and pause
16
+ rules. Every wright returns after one slice.
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
@@ -108,10 +109,9 @@ AFK charges per landed sibling only. Running lease blocks another
108
109
 
109
110
  Run every step in `reference/phase-contract.md`: readiness, one target, dispatch
110
111
  or canonical transaction, return inspection, independent code/doubt/test analysis,
111
- approved fail-on-red proof, record, AFK accounting, and stop. Use
112
+ approved fail-on-red proof, record, and applicable accounting. Continue/reply via
112
113
  [`reference/output.md`](reference/output.md) plus the shared
113
- [`reply contract`](../devrites-lib/reference/reply-contract.md). HITL never starts
114
- the next slice automatically; AFK obeys remaining budget; Prove requires every slice built except a
114
+ [`reply contract`](../devrites-lib/reference/reply-contract.md). Standalone AFK obeys remaining budget; Prove requires every slice built except a
115
115
  [deferred slice](../rite-plan/reference/slicing.md#deferred-slice).
116
116
 
117
117
  ## Phase exit
@@ -2,22 +2,20 @@
2
2
 
3
3
  > Root-only: not inlined in --role bundles.
4
4
 
5
- AFK mode is active when `.devrites/AFK` exists. It lets `/rite-build` chain slices
6
- without per-slice user input. The rules below limit that unattended work.
7
-
8
- Load the shared
5
+ `.devrites/AFK` enables unattended slice chaining. Load the shared
9
6
  [`afk-hitl.md`](../../devrites-lib/reference/standards/afk-hitl.md#the-sentinel-devritesafk)
10
- contract for the sentinel schema, defaults, gate ceiling, and mutable-counter
11
- ownership. This file owns only Build's dispatch, charging, and red-path behavior.
7
+ for sentinel schema, defaults, gate ceiling, and mutable-counter ownership.
8
+ This file owns Build dispatch, charging, and red paths.
12
9
 
13
- Rules: green before `built`; hard `max_slices` cap; gates before the action they
14
- control; irreversible work (destructive/auth/public API) always pauses; a tick
15
- never ends with an open or sealed wave — wait for its returns or
16
- `dispatch abandon --reason`.
10
+ Rules: green before `built`; gates before their action; irreversible work
11
+ (destructive/auth/public API) pauses; no tick ends with an open/sealed wave —
12
+ wait for returns or `dispatch abandon --reason`.
17
13
 
18
14
  ## Iteration cap
19
15
 
20
- The controlling root owns the cap:
16
+ Under active `/rite-autocomplete`, skip the slice-cap checks, charges, and cap-stop message below;
17
+ use its [admission rules](../../rite-autocomplete/reference/loop.md#admit-each-unattended-cycle).
18
+ Otherwise root owns cap:
21
19
 
22
20
  1. **Before every dispatch**, re-read `.devrites/AFK`, `state.md`, and the
23
21
  selected slice. This invocation's `--parallel N` is the cap when present;
@@ -10,12 +10,12 @@ Pack-wide rationalizations and red flags live in
10
10
 
11
11
  | Excuse | Rebuttal |
12
12
  |---|---|
13
- | "Slices 1 and 2 are related; let me do both." | HITL needs a later user invocation. Explicit `.devrites/AFK` may let the root chain only after green proof and cap/pause gates; each wright still returns after one. |
13
+ | "Slices 1 and 2 are related; let me do both." | Caller first: [output.md](output.md#caller-owned-continuation). Standalone HITL stops; standalone AFK chains after green proof and cap/pause gates; each wright returns after one. |
14
14
  | "It's faster to skip `devrites-doubt` for this small change." | Doubt is cheapest *before* the decision is standing. After is debugging. |
15
15
 
16
16
  ## Red Flags
17
17
 
18
- - About to start slice N+1 outside explicit AFK or before its green-proof/cap/pause gates.
18
+ - Next slice violates caller/standalone routing or proof/cap/pause gates.
19
19
  - Skipping `devrites-doubt` on a branching, boundary, data-model, auth, public-API, or migration decision.
20
20
  - Adding a dependency or a second design system without recording rationale in `decisions.md`.
21
21
  - Writing a `try/catch` block wider than what you handle.
@@ -54,11 +54,16 @@ BODY
54
54
 
55
55
  **Local-only:** never push or let scratch work trigger CI.
56
56
 
57
- After the commit lands, run `devrites-engine check regression <slug> --update`
58
- to ratchet the workspace progress baseline — the landed slice, newly checked
59
- acceptance criteria, and resolved questions become the new floor that later
60
- checks compare against. A `BLOCKED` compare before that ratchet means durable
61
- facts were lost this cycle; restore or route them before landing the commit.
57
+ After green landing (parallel: successful integrate), check `state.md`
58
+ outside fences before reselecting:
59
+
60
+ ```text
61
+ - [x] SLICE-004 built — <proof/checkpoint reference>
62
+ ```
63
+
64
+ A cursor `built_slices` value or a tasks.md `Status: built` field is not a substitute.
65
+ After landing: `devrites-engine check regression <slug> --update`. Before landing,
66
+ restore or route `BLOCKED` lost facts.
62
67
 
63
68
  ## Restore
64
69
  After a crash, a fresh session may read the last `WIP(<slug>)` body as crash context.
@@ -1,8 +1,8 @@
1
1
  # One-slice cycle
2
2
 
3
- One wright dispatch builds one thin, proven slice. HITL stops; only explicit
4
- `.devrites/AFK` lets the controlling root chain another pending slice under the
5
- green-proof, cap, and pause rules. Each wright returns after exactly one slice.
3
+ Each wright returns after one proven slice. Root follows
4
+ [`output.md`](output.md#caller-owned-continuation); standalone AFK uses
5
+ `afk-discipline.md`.
6
6
  This serial cycle is the default `/rite-build`. Opt-in fan-out: [`parallel-batch.md`](parallel-batch.md) (`--parallel N`).
7
7
 
8
8
  ## The cycle
@@ -31,7 +31,9 @@ RECORD → orchestrator: after green verification, update state.md/evidence.m
31
31
  upsert the authoritative candidate manifest from the actual scoped diff
32
32
  (CHECKPOINT) → only now, with review+proof green: local WIP(<slug>): <imperative summary>
33
33
  on the control branch (no slice id) → checkpoint.md
34
- NEXT → HITL root reports and stops. AFK with parallel cap>1: return to parallel-batch selection to refill; otherwise repeat under afk-discipline.md
34
+ NEXT → controlling caller first: return internally via output.md; no user-facing reply.
35
+ HITL stops. Standalone AFK with parallel cap>1:
36
+ return to parallel-batch selection to refill; otherwise repeat under afk-discipline.md
35
37
  ```
36
38
 
37
39
  ## Why the boundary matters
@@ -2,34 +2,28 @@
2
2
 
3
3
  > Root-only: not inlined in --role bundles.
4
4
 
5
- **Slices remain:**
5
+ ## Caller-owned continuation
6
6
 
7
- ```text
8
- Done: built slice <n> — <name>.
9
- Changed: <files>; state.md, touched-files.md, evidence.md
10
- Evidence: acceptance met; tests <cmd> → pass; browser <summary|n/a>; drift <none|handled>
11
- Open: <none|blockers|questions>
12
- Next: /rite-build
13
- Record: .devrites/work/<slug>/evidence.md
14
- ↻ Hygiene: /clear between slices (none in `orient` `inflight_waves`); /rite-handoff if away > a few hours
15
- ```
7
+ Before standalone replies, return internally to active `/rite-autocomplete` or
8
+ another controlling rite after green proof, checkpoint, and accounting:
9
+ - Slices remain: re-read durable state and reselect/refill; no user-facing reply.
10
+ - All built: return internally to the caller to invoke `/rite-prove` under its own contract.
11
+
12
+ Human/safety/access/Git stops still use the shared reply contract.
13
+
14
+ ## Standalone response
16
15
 
17
- **All built:**
16
+ HITL returns after one green slice; AFK chains per `afk-discipline.md`.
17
+ Every wright returns after one slice. Build alone never invokes Prove.
18
18
 
19
19
  ```text
20
- Done: built slice <n> — <name>; all slices built.
20
+ Done: built slice <n> — <name>[; all slices built].
21
21
  Changed: <files>; state.md, touched-files.md, evidence.md
22
22
  Evidence: acceptance met; tests <cmd> → pass; browser <summary|n/a>; drift <none|handled>
23
23
  Open: <none|blockers|questions>
24
- Next: /rite-prove
24
+ Next: /rite-build [all built: /rite-prove]
25
25
  Record: .devrites/work/<slug>/evidence.md
26
- ↻ Hygiene: /clear before /rite-prove; /rite-handoff if away > a few hours
26
+ ↻ Hygiene: /clear between slices (none in `orient` `inflight_waves`); /rite-handoff if away > a few hours
27
27
  ```
28
28
 
29
- HITL returns after one green slice. Only explicit `.devrites/AFK` lets the
30
- controlling root chain another pending slice after green-proof, cap, and pause
31
- gates. Every `devrites-slice-wright` returns after exactly one slice.
32
-
33
- At all built, Build never enters `/rite-prove` automatically; a higher-level
34
- orchestrator may invoke it only under its own contract. Awaiting-human or
35
- stopped states use the shared reply contract.
29
+ Awaiting-human or stopped states use the shared reply contract.
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devrites",
3
- "version": "7.0.17",
3
+ "version": "7.1.1",
4
4
  "description": "DevRites: a disciplined senior-engineer workflow pack for Claude Code, Codex, omp, pi, and Devin CLI",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://github.com/ViktorsBaikers/DevRites#readme",