devrites 7.2.5 → 7.2.7

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 (79) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +1 -1
  3. package/SECURITY.md +11 -7
  4. package/docs/engine/commands.md +4 -4
  5. package/engine/internal/lib/cli_observe.go +1 -1
  6. package/engine/internal/lib/context.go +7 -4
  7. package/engine/internal/lib/dispatch.go +77 -21
  8. package/engine/internal/lib/taskgraph.go +149 -12
  9. package/pack/.claude/skills/devrites-lib/reference/parallel-dispatch.md +3 -3
  10. package/pack/.claude/skills/devrites-lib/reference/standards/agents.md +3 -6
  11. package/pack/.claude/skills/devrites-lib/reference/standards/principles.md +5 -6
  12. package/pack/.claude/skills/rite-autocomplete/reference/decision-policy.md +3 -1
  13. package/pack/.claude/skills/rite-autocomplete/reference/lookahead.md +18 -35
  14. package/pack/.claude/skills/rite-autocomplete/reference/stop-conditions.md +7 -8
  15. package/pack/.claude/skills/rite-build/reference/parallel-batch.md +26 -16
  16. package/pack/.claude/skills/rite-build/reference/wright-dispatch.md +5 -5
  17. package/pack/.claude/skills/rite-spec/SKILL.md +2 -2
  18. package/pack/.claude/skills/rite-temper/SKILL.md +4 -5
  19. package/pack/generated/claude/skills/devrites-lib/reference/parallel-dispatch.md +3 -3
  20. package/pack/generated/claude/skills/devrites-lib/reference/standards/agents.md +3 -6
  21. package/pack/generated/claude/skills/devrites-lib/reference/standards/principles.md +5 -6
  22. package/pack/generated/claude/skills/rite-autocomplete/reference/decision-policy.md +3 -1
  23. package/pack/generated/claude/skills/rite-autocomplete/reference/lookahead.md +18 -35
  24. package/pack/generated/claude/skills/rite-autocomplete/reference/stop-conditions.md +7 -8
  25. package/pack/generated/claude/skills/rite-build/reference/parallel-batch.md +26 -16
  26. package/pack/generated/claude/skills/rite-build/reference/wright-dispatch.md +5 -5
  27. package/pack/generated/claude/skills/rite-spec/SKILL.md +2 -2
  28. package/pack/generated/claude/skills/rite-temper/SKILL.md +4 -5
  29. package/pack/generated/codex/skills/devrites-lib/reference/parallel-dispatch.md +3 -3
  30. package/pack/generated/codex/skills/devrites-lib/reference/standards/agents.md +3 -6
  31. package/pack/generated/codex/skills/devrites-lib/reference/standards/principles.md +5 -6
  32. package/pack/generated/codex/skills/rite-autocomplete/reference/decision-policy.md +3 -1
  33. package/pack/generated/codex/skills/rite-autocomplete/reference/lookahead.md +18 -35
  34. package/pack/generated/codex/skills/rite-autocomplete/reference/stop-conditions.md +7 -8
  35. package/pack/generated/codex/skills/rite-build/reference/parallel-batch.md +26 -16
  36. package/pack/generated/codex/skills/rite-build/reference/wright-dispatch.md +5 -5
  37. package/pack/generated/codex/skills/rite-spec/SKILL.md +2 -2
  38. package/pack/generated/codex/skills/rite-temper/SKILL.md +4 -5
  39. package/pack/generated/devin/skills/devrites-lib/reference/parallel-dispatch.md +3 -3
  40. package/pack/generated/devin/skills/devrites-lib/reference/standards/agents.md +3 -6
  41. package/pack/generated/devin/skills/devrites-lib/reference/standards/principles.md +5 -6
  42. package/pack/generated/devin/skills/rite-autocomplete/reference/decision-policy.md +3 -1
  43. package/pack/generated/devin/skills/rite-autocomplete/reference/lookahead.md +18 -35
  44. package/pack/generated/devin/skills/rite-autocomplete/reference/stop-conditions.md +7 -8
  45. package/pack/generated/devin/skills/rite-build/reference/parallel-batch.md +26 -16
  46. package/pack/generated/devin/skills/rite-build/reference/wright-dispatch.md +5 -5
  47. package/pack/generated/devin/skills/rite-spec/SKILL.md +2 -2
  48. package/pack/generated/devin/skills/rite-temper/SKILL.md +4 -5
  49. package/pack/generated/dsh/skills/devrites-lib/reference/parallel-dispatch.md +3 -3
  50. package/pack/generated/dsh/skills/devrites-lib/reference/standards/agents.md +3 -6
  51. package/pack/generated/dsh/skills/devrites-lib/reference/standards/principles.md +5 -6
  52. package/pack/generated/dsh/skills/rite-autocomplete/reference/decision-policy.md +3 -1
  53. package/pack/generated/dsh/skills/rite-autocomplete/reference/lookahead.md +18 -35
  54. package/pack/generated/dsh/skills/rite-autocomplete/reference/stop-conditions.md +7 -8
  55. package/pack/generated/dsh/skills/rite-build/reference/parallel-batch.md +26 -16
  56. package/pack/generated/dsh/skills/rite-build/reference/wright-dispatch.md +5 -5
  57. package/pack/generated/dsh/skills/rite-spec/SKILL.md +2 -2
  58. package/pack/generated/dsh/skills/rite-temper/SKILL.md +4 -5
  59. package/pack/generated/omp/skills/devrites-lib/reference/parallel-dispatch.md +3 -3
  60. package/pack/generated/omp/skills/devrites-lib/reference/standards/agents.md +3 -6
  61. package/pack/generated/omp/skills/devrites-lib/reference/standards/principles.md +5 -6
  62. package/pack/generated/omp/skills/rite-autocomplete/reference/decision-policy.md +3 -1
  63. package/pack/generated/omp/skills/rite-autocomplete/reference/lookahead.md +18 -35
  64. package/pack/generated/omp/skills/rite-autocomplete/reference/stop-conditions.md +7 -8
  65. package/pack/generated/omp/skills/rite-build/reference/parallel-batch.md +26 -16
  66. package/pack/generated/omp/skills/rite-build/reference/wright-dispatch.md +5 -5
  67. package/pack/generated/omp/skills/rite-spec/SKILL.md +2 -2
  68. package/pack/generated/omp/skills/rite-temper/SKILL.md +4 -5
  69. package/pack/generated/pi/skills/devrites-lib/reference/parallel-dispatch.md +3 -3
  70. package/pack/generated/pi/skills/devrites-lib/reference/standards/agents.md +3 -6
  71. package/pack/generated/pi/skills/devrites-lib/reference/standards/principles.md +5 -6
  72. package/pack/generated/pi/skills/rite-autocomplete/reference/decision-policy.md +3 -1
  73. package/pack/generated/pi/skills/rite-autocomplete/reference/lookahead.md +18 -35
  74. package/pack/generated/pi/skills/rite-autocomplete/reference/stop-conditions.md +7 -8
  75. package/pack/generated/pi/skills/rite-build/reference/parallel-batch.md +26 -16
  76. package/pack/generated/pi/skills/rite-build/reference/wright-dispatch.md +5 -5
  77. package/pack/generated/pi/skills/rite-spec/SKILL.md +2 -2
  78. package/pack/generated/pi/skills/rite-temper/SKILL.md +4 -5
  79. package/package.json +3 -3
@@ -2,49 +2,32 @@
2
2
 
3
3
  > Root-only: not inlined in --role bundles.
4
4
 
5
- A second session plans the next sequence continuation while the active
6
- workspace builds, so the child's Spec → Vet overlaps its predecessor's
7
- Build → Seal. The main loop later resumes the planned child instead of
8
- specifying it again.
5
+ Plans the next continuation while the active workspace builds. Spec → Vet
6
+ overlaps the predecessor's Build → Seal.
9
7
 
10
8
  ## Start and target
11
9
 
12
- The operator starts the second host session with `/rite-autocomplete
13
- --lookahead` once the `.devrites/ACTIVE` workspace is in Build or later. The
14
- agent never launches a session itself. The target is the next recorded
15
- continuation after the active workspace: the entry
16
- [sequence continuation](loop.md#sequence-continuation) would open. Stop with
17
- nothing to do when the active workspace is before Build, no entry remains,
18
- `continue_sequence: false`, or the sequence budget is spent.
10
+ Start `/rite-autocomplete --lookahead` once `.devrites/ACTIVE` is in Build or later. The agent never launches a session. Target: the next continuation
11
+ ([sequence continuation](loop.md#sequence-continuation)). Stop when that workspace
12
+ is before Build, no entry remains, `continue_sequence: false`, or the budget is spent.
19
13
 
20
14
  ## Lease
21
15
 
22
- Before any write, take the workspace lease:
16
+ Before any write:
23
17
  `devrites-engine claim add --session lookahead-<target> --ttl 240 --workspace <target> --reason lookahead`.
24
- Exit 3 means another session holds the target: stop. Re-add the lease with the
25
- same session at each phase start, and release it with `devrites-engine claim
26
- release` on every stop. A crashed session's lease reads `dead` and frees itself.
18
+ Exit 3: held, stop. Re-add the same session each phase. Release with `devrites-engine claim release` on stop. A `dead` lease frees itself.
27
19
 
28
20
  ## Rules
29
21
 
30
- - Never read or write `.devrites/ACTIVE`. Pass the target slug explicitly to every
31
- skill and engine command, including `/rite-spec <target> "<objective>"` and
32
- `devrites-engine handoff <target> --resume`.
22
+ - Never read or write `.devrites/ACTIVE`. Pass the slug to `/rite-spec <target> "<objective>"` and `devrites-engine handoff <target> --resume`.
33
23
  - After the workspace exists, run `devrites-engine state set <target> sequence_lookahead=yes`.
34
- - Run Spec → Clarify → Temper → Define → Plan → Vet as the main loop does.
35
- Define and Plan read the predecessor's current tree and plan. Record an
36
- assumption for each predecessor interface the plan relies on.
37
- - At Vet, beside the readiness binding, record exactly one line
38
- `Predecessor readiness: <active-slug> <digest>` in `eng-review.md`. `<digest>`
39
- is the hex that `devrites-engine check readiness --emit-binding <active-slug>`
40
- prints. When the predecessor later changes its planning inputs, the child's
41
- readiness check blocks with `DRV-GATE-READINESS-STALE` and the main loop
42
- re-vets the child before Build.
43
- - Never Build, never write product source or tests, never commit, and never
44
- arm or rewrite `.devrites/AFK`. Owner questions go to the target's
45
- `questions.md` and stop the lookahead.
46
- - Stop at Vet `READY` with `next_action: build after predecessor Seal GO`, at a
47
- human gate, or when the target's lease is lost.
48
-
49
- **Failing case:** the lookahead passes Vet and starts Build while the
50
- predecessor is still sealing, so two root sessions write one tree.
24
+ - Run Spec → Clarify → Temper → Define → Plan → Vet. Define and Plan read the predecessor tree and plan. Record one assumption per predecessor interface used.
25
+ - At Vet record `Predecessor readiness: <active-slug> <digest>` in `eng-review.md` (the `--emit-binding` hex). A later planning change blocks `DRV-GATE-READINESS-STALE`; re-vet before Build.
26
+ - Predecessor still in Build or later forbids only Build, product source, tests, commits, and `.devrites/AFK`. It does not skip Define, Plan, or Vet, and is not `awaiting_human`. Acceptance, scope, and irreversible risk still stop.
27
+ - No spawn tool is not gate `access` or `awaiting_human`. Root writes Define and Plan. No Vet `READY` until those roles are admitted; else stop `running`, `next_action: /rite-vet`.
28
+ - On every entry, re-read `state.md` and `questions.md`. Do not report a stop from chat. `continuation: clear` with `awaiting_human` is not done: fold resolved decisions into the spec, then continue. An except-principle or change-the-spec question complies: change the spec and resolve it. Ask only when the approved objective cannot comply.
29
+ - Stop at Vet `READY` with `next_action: build after predecessor Seal GO`, at a real human gate, or when the lease is lost.
30
+
31
+ **Failing case:** Vet then Build while the predecessor is still sealing, so two sessions write one tree. Or Define, Plan, and Vet skipped because the predecessor is still Build, or a missing strategy-reviewer spawn recorded as gate `access`.
32
+
33
+ **Failing case:** stops to except a principle the spec can avoid.
@@ -59,14 +59,13 @@ Without a safe seam, escalate or park; only a real human/risk/scope gate stops f
59
59
  ## Other stop classes
60
60
 
61
61
  - **Gate severity:** escalating always stops. Blocking with a ranked recommended
62
- option (`proposed` or option 1 labelled Recommended): auto-pick via
63
- `devrites-engine state resolve`, then continue internally (including Spec Drift
64
- Guard when the answer changes ownership or acceptance). Exception: a question whose answer
65
- would add acceptance or product scope is never auto-picked, even with a
66
- recommended option; it stops for a human. Blocking with no
67
- recommended option still stops. Validating: auto-pick the recommended option,
68
- close the question, continue — except Seal's judgment-only acceptance question
69
- (`slice: seal`), which only a human answers; it stops.
62
+ option (`proposed` or option 1 labelled Recommended) auto-picks via
63
+ `devrites-engine state resolve` and continues, Spec Drift Guard included when
64
+ the answer changes ownership or acceptance. Added acceptance or scope is never
65
+ auto-picked. No recommended option still stops. An avoidable principle conflict
66
+ complies: change the spec and resolve it. Re-read on entry. `continuation: clear`
67
+ with `awaiting_human` still folds resolved decisions. Do not report a stop from chat.
68
+ Validating auto-picks, except Seal `slice: seal`, which a human answers.
70
69
  - **Temper:** `expand` and extra acceptance stop: ask through `AskUserQuestion`, hold the
71
70
  fold, and continue only after a human resolves the qid (an ADR is not that answer).
72
71
  Irreversible-risk still pauses. `hold-rigor`, `reduce-to-MVP`, and a skip do not pause.
@@ -27,16 +27,21 @@ N_eff = min(
27
27
  cap -- this invocation's --parallel N (wins over leftover sentinel max_parallel)
28
28
  | else sentinel max_parallel | else 10 (autocomplete default)
29
29
  eligible set -- dependency-satisfied pending slices, pairwise path-disjoint
30
- AFK headroom -- remaining max_slices, max_agents, max_minutes, review queue
30
+ AFK headroom -- outside /rite-autocomplete only (max_slices, max_agents,
31
+ max_minutes, review queue). Autocomplete ignores those;
32
+ do not shrink this batch for them
31
33
  host capacity -- concurrent worktree writers + the runtime isolation table
32
34
  )
33
35
  ```
34
36
 
35
37
  Select **greedily in plan order** with
36
- `devrites-engine parallel select --slug <slug> --cap N --from-plan`: the engine
37
- reads the ready set (tasks.md dependencies checked `built` in `state.md`, minus
38
- running-lease slices) and each slice's Writer allowlist (else `Files likely
39
- touched`), plus its manifest/lockfile when `External dependencies:` is not none;
38
+ `devrites-engine parallel select --slug <slug> --cap N --from-plan`: ready set
39
+ (dependencies built — state.md checkbox, or an evidence.md heading that says that slice was checkpointed plus a `Checkpoint: <sha>` line — minus running-lease slices), Writer allowlist
40
+ (else Files likely touched), plus manifest/lockfile when `External dependencies:`
41
+ names a package (module path, npm scope, backticked name, or a non-toolchain version).
42
+ `context --phase build` with no `--slice` stays on `active_slice` unless AFK
43
+ `max_parallel` is at least 2 or a lease is running; a HITL `--parallel N` run
44
+ passes `--whole` so the other slices stay visible.
40
45
  `next` prints `eligible_now:`/`batch:`. `n_eff` counts new picks only.
41
46
  With a running lease, a single new pick still uses `parallel add`;
42
47
  `n_eff=0` with a running lease waits for siblings, not Prove. Without one:
@@ -73,13 +78,14 @@ Before `parallel select`, add each slice's hidden write surfaces (list owner:
73
78
  [repository-topology.md § Ownership rules](../../devrites-lib/reference/standards/repository-topology.md#ownership-rules))
74
79
  — lockfile/manifest, the generated target of an edited source, migration chain,
75
80
  snapshot directory, formatter sweep — and compare paths case-folded
76
- (`src/Api.ts` = `src/api.ts`); `--from-plan` adds the manifest/lockfile itself.
81
+ (`src/Api.ts` = `src/api.ts`); `--from-plan` adds the manifest/lockfile for a package.
77
82
  Slices colliding on either run serially; the rest
78
83
  stay eligible. Record `serial: <ids> — <surface>` in `evidence.md`. Under AFK
79
- with `max_parallel ≥ 2`, `dispatch open` refuses a first-round build wright wave
80
- narrower than the from-plan batch (printing batch and command) until the wave
81
- holds that batch or `serial:` names every skipped pick; repair rounds, lease
82
- siblings, and HITL runs are never refused. **Failing
84
+ with `max_parallel ≥ 2`, `dispatch open` refuses a build wright wave narrower
85
+ than the from-plan batch until that wave holds the other picks or `serial:`
86
+ names each skipped one. Repairing a slice, or a slice already in the lease,
87
+ does not waive them. A `serial:` reason that only says the skipped slice is
88
+ repairing, already started, or in a wave does not count. HITL is never refused. **Failing
83
89
  case:** two slices each add a dependency, run in parallel, and integrate fails or
84
90
  lands a broken lockfile.
85
91
 
@@ -106,8 +112,11 @@ Lease: `batch_id`, `created_at`, `base_sha`, `n`,
106
112
  `pre-dispatch <id>` preflight row; a malformed contract or non-zero
107
113
  precondition is dropped from the batch and recorded as a gap, not dispatched.
108
114
  2. Write lease; freeze `B=HEAD`; `parallel create` worktrees.
109
- 3. Dispatch ≤10 wrights in parallel (cwd=worktree; allowlist; prove `HEAD==B`;
110
- one `--slice` per sibling on the wave). A linked worktree has no `.devrites`:
115
+ 3. Dispatch ≤10 wrights in parallel (cwd=worktree; allowlist; prove `HEAD==B`).
116
+ One wave, one role per sibling: `--role slice-wright.<SLICE-ID> --slice <SLICE-ID>`
117
+ for each. `start` every role before waiting on any. One shared `slice-wright`
118
+ role is refused: it has one handle, so the other slices never start.
119
+ A linked worktree has no `.devrites`:
111
120
  tell each wright to run `gates precheck` with `DEVRITES_ROOT=<control>/.devrites`.
112
121
  4. Inspect each returned path list, cumulative diff from `B`, transfer identity,
113
122
  and required result fields against the immutable contract. Reject malformed,
@@ -122,10 +131,11 @@ Lease: `batch_id`, `created_at`, `base_sha`, `n`,
122
131
  A recheck round is one dispatch per changed surface, not one per checklist: the
123
132
  recheck agent carries every open checklist (code, test, doubt) for that diff and
124
133
  answers each by name. Merging cuts dispatches; dropping a checklist does not.
125
- Reviewer fan-out for a batch is itself batched under
126
- [`parallel-dispatch.md`](../../devrites-lib/reference/parallel-dispatch.md#scale-limits)
127
- (≈4 concurrent read-only reviewers, 8 only with disjoint paths), and `max_agents`
128
- headroom bounds the batch size — one batch never assumes unbounded reviewers.
134
+ Reviewer fan-out does not shrink the writer batch. Reviewers queue at the
135
+ same cap as writers (10; see
136
+ [`parallel-dispatch.md`](../../devrites-lib/reference/parallel-dispatch.md#scale-limits)).
137
+ `max_agents` does not shrink it under autocomplete. Past that cap, queue a
138
+ second pass — a batch never assumes unbounded reviewers.
129
139
  5. Non-green siblings → **repair round** (below) in the same worktrees; lease
130
140
  stays `running` — no abort while repair budget remains. A green sibling →
131
141
  `parallel record-green`, then step 6 for it alone.
@@ -129,11 +129,11 @@ open findings move to the new slice owning their paths), or record
129
129
  `## <DRIFT-ID> — <SLICE-ID> reslice review` with why no smaller split exists and
130
130
  a spec trace of the slice's obligations (hardening no AC/INV/PROH requires moves to
131
131
  a sibling slice dependents do not need, still gated before Seal), and
132
- reopen with `--reslice-review <DRIFT-ID>`. Use
133
- at most one writer across all linked worktrees for this workspace. Never run two
134
- writers in one worktree, run isolated and same-worktree writers concurrently, or
135
- substitute a generic agent. Opt-in `/rite-build --parallel N` fans out only under
136
- [`parallel-batch.md`](parallel-batch.md).
132
+ reopen with `--reslice-review <DRIFT-ID>`. Same-worktree stays one writer.
133
+ Never run two writers in one worktree, mix isolated and same-worktree writers,
134
+ or substitute a generic agent. Opt-in `/rite-build --parallel N` is the
135
+ exception: one wright per worktree, each its own `slice-wright.<SLICE-ID>` role
136
+ on one wave ([`parallel-batch.md`](parallel-batch.md)).
137
137
 
138
138
  The `return` that completes the wave releases its claim; `dispatch abandon --release`
139
139
  releases it on any other host-confirmed terminal path (a stop, a launch refused with no
@@ -117,8 +117,8 @@ load a routed standard to discover required behavior, not to prescribe implement
117
117
  and [`interview-patterns.md`](reference/interview-patterns.md) for a vague ask. Every
118
118
  material dimension is resolved by a human pick or explicitly deferred as non-blocking;
119
119
  only genuinely reversible, low-impact details go to `assumptions.md`. A paper-only
120
- uncertainty may take one scoped `/rite-prototype` detour. A declared-principle conflict
121
- remains blocking until the human approves a recorded, scoped exception.
120
+ uncertainty may take one scoped `/rite-prototype` detour. A principle conflict
121
+ complies by changing the spec. Only an unavoidable violation blocks for a human.
122
122
  4a. **Build-interruption forecast.** Search first, then list and close foreseeable human needs:
123
123
  product/acceptance ambiguity, irreversible/external approval, or human-only access. Record
124
124
  owned prerequisites. Keep a build checkpoint only for unavailable pre-code evidence or a
@@ -123,12 +123,11 @@ the spec applicability map triggers that risk family.
123
123
  [`devrites-strategy-reviewer`](../../agents/devrites-strategy-reviewer.md)
124
124
  through the native fresh-context contract in
125
125
  [`agents.md`](../devrites-lib/reference/standards/agents.md), with **only** its `--role strategy-reviewer` read-set
126
- (hardened spec, `strategy.md`, claim-check artifacts) + rubric, no authoring reasoning. Fold technical findings into one correction;
127
- exact strategy reviewer rechecks open findings and affected coverage/regressions under
126
+ (hardened spec, `strategy.md`, claim-check artifacts) + rubric, no authoring reasoning. Fold findings once and recheck them under
128
127
  [the canonical retry contract](../devrites-lib/reference/standards/afk-hitl.md#retry-cap-no-progress-loops-and-self-resolve):
129
- Product/scope choices and unapproved irreversible risk remain human gates;
130
- technical exhaustion preserves blocker/reproduction.
131
- If the named agent is unavailable, stop for HITL. After an accepted edit to a
128
+ Product/scope and unapproved irreversible risk stay human gates;
129
+ exhaustion keeps the blocker.
130
+ If the named agent is unavailable, stop for HITL. Except `sequence_lookahead: yes` and no spawn tool: record the review pending, stay `running`, continue Define. Not access. After an accepted edit to a
132
131
  coverage-bound input, repeat step 6's native coverage revalidation before handoff.
133
132
  8. **STOP.** Report the mode, the scope deltas, and the floor verdict; recommend `/rite-define`.
134
133
 
@@ -169,9 +169,9 @@ named in the re-dispatch contract; changes outside task paths stop for the human
169
169
 
170
170
  ## Scale limits
171
171
 
172
- The role table bounds rosters. Use roughly four concurrent read-only reviewers,
173
- counting children any leaf spawned; eight only with disjoint paths/resources.
174
- Refuse unbounded swarms and role substitution: sharpen scope or use a bounded second pass when coverage is missing.
172
+ The role table bounds rosters. Use up to ten concurrent read-only reviewers,
173
+ the same cap as a writer batch, counting children any leaf spawned.
174
+ Refuse a larger swarm and role substitution: sharpen scope or use a bounded second pass when coverage is missing.
175
175
  Overlapping reviewers increase duplicate findings and reconciliation work.
176
176
 
177
177
  ## Children are tools, not peers
@@ -8,7 +8,7 @@ Follow DevRites policy and [`depth profiles`](../orchestration-profiles.md).
8
8
 
9
9
  <!-- root-only -->
10
10
  - Root owns scope, questions/decisions/results, `.devrites/**`, phase transitions — not product source/tests; vetted executable workflow artifacts follow [`workflow-artifacts.md`](workflow-artifacts.md).
11
- - Every named role runs; unavailable → HITL, never skip/substitute.
11
+ - Every named role runs; unavailable → HITL, never skip/substitute. `sequence_lookahead: yes` with no spawn tool defers the role, records the gap, and keeps planning. Not gate `access`, not a verdict. Admit the role before Build.
12
12
  <!-- /root-only -->
13
13
  - Among lifecycle `devrites-*` specialists, only bounded wright writes product
14
14
  source/tests; others inspect an immutable candidate. The independent `/rite-fast`
@@ -145,11 +145,8 @@ Basis: <files read · commands run to reach this finding>
145
145
  asks for is a Suggestion, however plausible. The `when` must also be reachable:
146
146
  a hostile actor enters only through a trust boundary the feature really has
147
147
  (users, network, external systems, untrusted files). A trigger that needs one it
148
- never faces — the code under test forging its own evidence, a tampering second
149
- user on a single-owner dev host, a swapped remote daemon under a local dev tool —
150
- is a Suggestion too. So is an environment state the feature's declared
151
- environment does not have (a mount option, kernel setting or daemon location
152
- absent from the target host): guard against it only when the spec names it.
148
+ never faces — forged test evidence, a second user on a single-owner host, or a swapped local daemon —
149
+ is a Suggestion too. So is an undeclared host setting (mount, kernel, daemon path): guard it only when the spec names it.
153
150
  A finding never pulls a deferred slice's scope forward.
154
151
  - **`no-findings`:** `No-findings:` names checks and inspected evidence. Bare
155
152
  pass, empty list, or “looks good” is malformed.
@@ -47,10 +47,9 @@ unaudited.
47
47
 
48
48
  ## Gate
49
49
 
50
- At plan, build, review, and seal, compare the proposed or actual change with each
51
- in-scope principle. An unexcepted violation is a Critical finding and blocks the
52
- phase. A missing or empty principles file passes silently.
50
+ At plan, build, review, and seal, compare the change with each in-scope principle.
51
+ An unexcepted violation is Critical and blocks. A missing or empty file passes.
53
52
 
54
- Adding, changing, retiring, or excepting a principle is a deliberate human-owned
55
- decision recorded in the file's governance history. Agents may propose wording;
56
- they do not ratify it.
53
+ Adding, changing, retiring, or excepting a principle is human-owned. Date it in
54
+ the governance history. Agents do not ratify it. Comply by changing the spec.
55
+ Ask for an exception only when the objective cannot be met without the violation.
@@ -41,4 +41,6 @@ recommended option stay human. A blocking question that already names option 1
41
41
  `(Recommended)` or `proposed:` is autocomplete's to resolve: pick that option
42
42
  via `devrites-engine state resolve` and continue. Recommended temper
43
43
  `expand` and extra acceptance are never auto-picked: they stop for a human through
44
- `AskUserQuestion`; do not invent product intent.
44
+ `AskUserQuestion`; do not invent product intent. A principle
45
+ conflict complies by changing the spec. Except a principle when the
46
+ objective cannot be met without the violation.
@@ -2,49 +2,32 @@
2
2
 
3
3
  > Root-only: not inlined in --role bundles.
4
4
 
5
- A second session plans the next sequence continuation while the active
6
- workspace builds, so the child's Spec → Vet overlaps its predecessor's
7
- Build → Seal. The main loop later resumes the planned child instead of
8
- specifying it again.
5
+ Plans the next continuation while the active workspace builds. Spec → Vet
6
+ overlaps the predecessor's Build → Seal.
9
7
 
10
8
  ## Start and target
11
9
 
12
- The operator starts the second host session with `/rite-autocomplete
13
- --lookahead` once the `.devrites/ACTIVE` workspace is in Build or later. The
14
- agent never launches a session itself. The target is the next recorded
15
- continuation after the active workspace: the entry
16
- [sequence continuation](loop.md#sequence-continuation) would open. Stop with
17
- nothing to do when the active workspace is before Build, no entry remains,
18
- `continue_sequence: false`, or the sequence budget is spent.
10
+ Start `/rite-autocomplete --lookahead` once `.devrites/ACTIVE` is in Build or later. The agent never launches a session. Target: the next continuation
11
+ ([sequence continuation](loop.md#sequence-continuation)). Stop when that workspace
12
+ is before Build, no entry remains, `continue_sequence: false`, or the budget is spent.
19
13
 
20
14
  ## Lease
21
15
 
22
- Before any write, take the workspace lease:
16
+ Before any write:
23
17
  `devrites-engine claim add --session lookahead-<target> --ttl 240 --workspace <target> --reason lookahead`.
24
- Exit 3 means another session holds the target: stop. Re-add the lease with the
25
- same session at each phase start, and release it with `devrites-engine claim
26
- release` on every stop. A crashed session's lease reads `dead` and frees itself.
18
+ Exit 3: held, stop. Re-add the same session each phase. Release with `devrites-engine claim release` on stop. A `dead` lease frees itself.
27
19
 
28
20
  ## Rules
29
21
 
30
- - Never read or write `.devrites/ACTIVE`. Pass the target slug explicitly to every
31
- skill and engine command, including `/rite-spec <target> "<objective>"` and
32
- `devrites-engine handoff <target> --resume`.
22
+ - Never read or write `.devrites/ACTIVE`. Pass the slug to `/rite-spec <target> "<objective>"` and `devrites-engine handoff <target> --resume`.
33
23
  - After the workspace exists, run `devrites-engine state set <target> sequence_lookahead=yes`.
34
- - Run Spec → Clarify → Temper → Define → Plan → Vet as the main loop does.
35
- Define and Plan read the predecessor's current tree and plan. Record an
36
- assumption for each predecessor interface the plan relies on.
37
- - At Vet, beside the readiness binding, record exactly one line
38
- `Predecessor readiness: <active-slug> <digest>` in `eng-review.md`. `<digest>`
39
- is the hex that `devrites-engine check readiness --emit-binding <active-slug>`
40
- prints. When the predecessor later changes its planning inputs, the child's
41
- readiness check blocks with `DRV-GATE-READINESS-STALE` and the main loop
42
- re-vets the child before Build.
43
- - Never Build, never write product source or tests, never commit, and never
44
- arm or rewrite `.devrites/AFK`. Owner questions go to the target's
45
- `questions.md` and stop the lookahead.
46
- - Stop at Vet `READY` with `next_action: build after predecessor Seal GO`, at a
47
- human gate, or when the target's lease is lost.
48
-
49
- **Failing case:** the lookahead passes Vet and starts Build while the
50
- predecessor is still sealing, so two root sessions write one tree.
24
+ - Run Spec → Clarify → Temper → Define → Plan → Vet. Define and Plan read the predecessor tree and plan. Record one assumption per predecessor interface used.
25
+ - At Vet record `Predecessor readiness: <active-slug> <digest>` in `eng-review.md` (the `--emit-binding` hex). A later planning change blocks `DRV-GATE-READINESS-STALE`; re-vet before Build.
26
+ - Predecessor still in Build or later forbids only Build, product source, tests, commits, and `.devrites/AFK`. It does not skip Define, Plan, or Vet, and is not `awaiting_human`. Acceptance, scope, and irreversible risk still stop.
27
+ - No spawn tool is not gate `access` or `awaiting_human`. Root writes Define and Plan. No Vet `READY` until those roles are admitted; else stop `running`, `next_action: /rite-vet`.
28
+ - On every entry, re-read `state.md` and `questions.md`. Do not report a stop from chat. `continuation: clear` with `awaiting_human` is not done: fold resolved decisions into the spec, then continue. An except-principle or change-the-spec question complies: change the spec and resolve it. Ask only when the approved objective cannot comply.
29
+ - Stop at Vet `READY` with `next_action: build after predecessor Seal GO`, at a real human gate, or when the lease is lost.
30
+
31
+ **Failing case:** Vet then Build while the predecessor is still sealing, so two sessions write one tree. Or Define, Plan, and Vet skipped because the predecessor is still Build, or a missing strategy-reviewer spawn recorded as gate `access`.
32
+
33
+ **Failing case:** stops to except a principle the spec can avoid.
@@ -61,14 +61,13 @@ Without a safe seam, escalate or park; only a real human/risk/scope gate stops f
61
61
  ## Other stop classes
62
62
 
63
63
  - **Gate severity:** escalating always stops. Blocking with a ranked recommended
64
- option (`proposed` or option 1 labelled Recommended): auto-pick via
65
- `devrites-engine state resolve`, then continue internally (including Spec Drift
66
- Guard when the answer changes ownership or acceptance). Exception: a question whose answer
67
- would add acceptance or product scope is never auto-picked, even with a
68
- recommended option; it stops for a human. Blocking with no
69
- recommended option still stops. Validating: auto-pick the recommended option,
70
- close the question, continue — except Seal's judgment-only acceptance question
71
- (`slice: seal`), which only a human answers; it stops.
64
+ option (`proposed` or option 1 labelled Recommended) auto-picks via
65
+ `devrites-engine state resolve` and continues, Spec Drift Guard included when
66
+ the answer changes ownership or acceptance. Added acceptance or scope is never
67
+ auto-picked. No recommended option still stops. An avoidable principle conflict
68
+ complies: change the spec and resolve it. Re-read on entry. `continuation: clear`
69
+ with `awaiting_human` still folds resolved decisions. Do not report a stop from chat.
70
+ Validating auto-picks, except Seal `slice: seal`, which a human answers.
72
71
  - **Temper:** `expand` and extra acceptance stop: ask through `AskUserQuestion`, hold the
73
72
  fold, and continue only after a human resolves the qid (an ADR is not that answer).
74
73
  Irreversible-risk still pauses. `hold-rigor`, `reduce-to-MVP`, and a skip do not pause.
@@ -27,16 +27,21 @@ N_eff = min(
27
27
  cap -- this invocation's --parallel N (wins over leftover sentinel max_parallel)
28
28
  | else sentinel max_parallel | else 10 (autocomplete default)
29
29
  eligible set -- dependency-satisfied pending slices, pairwise path-disjoint
30
- AFK headroom -- remaining max_slices, max_agents, max_minutes, review queue
30
+ AFK headroom -- outside /rite-autocomplete only (max_slices, max_agents,
31
+ max_minutes, review queue). Autocomplete ignores those;
32
+ do not shrink this batch for them
31
33
  host capacity -- concurrent worktree writers + the runtime isolation table
32
34
  )
33
35
  ```
34
36
 
35
37
  Select **greedily in plan order** with
36
- `devrites-engine parallel select --slug <slug> --cap N --from-plan`: the engine
37
- reads the ready set (tasks.md dependencies checked `built` in `state.md`, minus
38
- running-lease slices) and each slice's Writer allowlist (else `Files likely
39
- touched`), plus its manifest/lockfile when `External dependencies:` is not none;
38
+ `devrites-engine parallel select --slug <slug> --cap N --from-plan`: ready set
39
+ (dependencies built — state.md checkbox, or an evidence.md heading that says that slice was checkpointed plus a `Checkpoint: <sha>` line — minus running-lease slices), Writer allowlist
40
+ (else Files likely touched), plus manifest/lockfile when `External dependencies:`
41
+ names a package (module path, npm scope, backticked name, or a non-toolchain version).
42
+ `context --phase build` with no `--slice` stays on `active_slice` unless AFK
43
+ `max_parallel` is at least 2 or a lease is running; a HITL `--parallel N` run
44
+ passes `--whole` so the other slices stay visible.
40
45
  `next` prints `eligible_now:`/`batch:`. `n_eff` counts new picks only.
41
46
  With a running lease, a single new pick still uses `parallel add`;
42
47
  `n_eff=0` with a running lease waits for siblings, not Prove. Without one:
@@ -73,13 +78,14 @@ Before `parallel select`, add each slice's hidden write surfaces (list owner:
73
78
  [repository-topology.md § Ownership rules](../../devrites-lib/reference/standards/repository-topology.md#ownership-rules))
74
79
  — lockfile/manifest, the generated target of an edited source, migration chain,
75
80
  snapshot directory, formatter sweep — and compare paths case-folded
76
- (`src/Api.ts` = `src/api.ts`); `--from-plan` adds the manifest/lockfile itself.
81
+ (`src/Api.ts` = `src/api.ts`); `--from-plan` adds the manifest/lockfile for a package.
77
82
  Slices colliding on either run serially; the rest
78
83
  stay eligible. Record `serial: <ids> — <surface>` in `evidence.md`. Under AFK
79
- with `max_parallel ≥ 2`, `dispatch open` refuses a first-round build wright wave
80
- narrower than the from-plan batch (printing batch and command) until the wave
81
- holds that batch or `serial:` names every skipped pick; repair rounds, lease
82
- siblings, and HITL runs are never refused. **Failing
84
+ with `max_parallel ≥ 2`, `dispatch open` refuses a build wright wave narrower
85
+ than the from-plan batch until that wave holds the other picks or `serial:`
86
+ names each skipped one. Repairing a slice, or a slice already in the lease,
87
+ does not waive them. A `serial:` reason that only says the skipped slice is
88
+ repairing, already started, or in a wave does not count. HITL is never refused. **Failing
83
89
  case:** two slices each add a dependency, run in parallel, and integrate fails or
84
90
  lands a broken lockfile.
85
91
 
@@ -106,8 +112,11 @@ Lease: `batch_id`, `created_at`, `base_sha`, `n`,
106
112
  `pre-dispatch <id>` preflight row; a malformed contract or non-zero
107
113
  precondition is dropped from the batch and recorded as a gap, not dispatched.
108
114
  2. Write lease; freeze `B=HEAD`; `parallel create` worktrees.
109
- 3. Dispatch ≤10 wrights in parallel (cwd=worktree; allowlist; prove `HEAD==B`;
110
- one `--slice` per sibling on the wave). A linked worktree has no `.devrites`:
115
+ 3. Dispatch ≤10 wrights in parallel (cwd=worktree; allowlist; prove `HEAD==B`).
116
+ One wave, one role per sibling: `--role slice-wright.<SLICE-ID> --slice <SLICE-ID>`
117
+ for each. `start` every role before waiting on any. One shared `slice-wright`
118
+ role is refused: it has one handle, so the other slices never start.
119
+ A linked worktree has no `.devrites`:
111
120
  tell each wright to run `gates precheck` with `DEVRITES_ROOT=<control>/.devrites`.
112
121
  4. Inspect each returned path list, cumulative diff from `B`, transfer identity,
113
122
  and required result fields against the immutable contract. Reject malformed,
@@ -122,10 +131,11 @@ Lease: `batch_id`, `created_at`, `base_sha`, `n`,
122
131
  A recheck round is one dispatch per changed surface, not one per checklist: the
123
132
  recheck agent carries every open checklist (code, test, doubt) for that diff and
124
133
  answers each by name. Merging cuts dispatches; dropping a checklist does not.
125
- Reviewer fan-out for a batch is itself batched under
126
- [`parallel-dispatch.md`](../../devrites-lib/reference/parallel-dispatch.md#scale-limits)
127
- (≈4 concurrent read-only reviewers, 8 only with disjoint paths), and `max_agents`
128
- headroom bounds the batch size — one batch never assumes unbounded reviewers.
134
+ Reviewer fan-out does not shrink the writer batch. Reviewers queue at the
135
+ same cap as writers (10; see
136
+ [`parallel-dispatch.md`](../../devrites-lib/reference/parallel-dispatch.md#scale-limits)).
137
+ `max_agents` does not shrink it under autocomplete. Past that cap, queue a
138
+ second pass — a batch never assumes unbounded reviewers.
129
139
  5. Non-green siblings → **repair round** (below) in the same worktrees; lease
130
140
  stays `running` — no abort while repair budget remains. A green sibling →
131
141
  `parallel record-green`, then step 6 for it alone.
@@ -129,11 +129,11 @@ open findings move to the new slice owning their paths), or record
129
129
  `## <DRIFT-ID> — <SLICE-ID> reslice review` with why no smaller split exists and
130
130
  a spec trace of the slice's obligations (hardening no AC/INV/PROH requires moves to
131
131
  a sibling slice dependents do not need, still gated before Seal), and
132
- reopen with `--reslice-review <DRIFT-ID>`. Use
133
- at most one writer across all linked worktrees for this workspace. Never run two
134
- writers in one worktree, run isolated and same-worktree writers concurrently, or
135
- substitute a generic agent. Opt-in `/rite-build --parallel N` fans out only under
136
- [`parallel-batch.md`](parallel-batch.md).
132
+ reopen with `--reslice-review <DRIFT-ID>`. Same-worktree stays one writer.
133
+ Never run two writers in one worktree, mix isolated and same-worktree writers,
134
+ or substitute a generic agent. Opt-in `/rite-build --parallel N` is the
135
+ exception: one wright per worktree, each its own `slice-wright.<SLICE-ID>` role
136
+ on one wave ([`parallel-batch.md`](parallel-batch.md)).
137
137
 
138
138
  The `return` that completes the wave releases its claim; `dispatch abandon --release`
139
139
  releases it on any other host-confirmed terminal path (a stop, a launch refused with no
@@ -117,8 +117,8 @@ load a routed standard to discover required behavior, not to prescribe implement
117
117
  and [`interview-patterns.md`](reference/interview-patterns.md) for a vague ask. Every
118
118
  material dimension is resolved by a human pick or explicitly deferred as non-blocking;
119
119
  only genuinely reversible, low-impact details go to `assumptions.md`. A paper-only
120
- uncertainty may take one scoped `/rite-prototype` detour. A declared-principle conflict
121
- remains blocking until the human approves a recorded, scoped exception.
120
+ uncertainty may take one scoped `/rite-prototype` detour. A principle conflict
121
+ complies by changing the spec. Only an unavoidable violation blocks for a human.
122
122
  4a. **Build-interruption forecast.** Search first, then list and close foreseeable human needs:
123
123
  product/acceptance ambiguity, irreversible/external approval, or human-only access. Record
124
124
  owned prerequisites. Keep a build checkpoint only for unavailable pre-code evidence or a
@@ -123,12 +123,11 @@ the spec applicability map triggers that risk family.
123
123
  [`devrites-strategy-reviewer`](../../agents/devrites-strategy-reviewer.md)
124
124
  through the native fresh-context contract in
125
125
  [`agents.md`](../devrites-lib/reference/standards/agents.md), with **only** its `--role strategy-reviewer` read-set
126
- (hardened spec, `strategy.md`, claim-check artifacts) + rubric, no authoring reasoning. Fold technical findings into one correction;
127
- exact strategy reviewer rechecks open findings and affected coverage/regressions under
126
+ (hardened spec, `strategy.md`, claim-check artifacts) + rubric, no authoring reasoning. Fold findings once and recheck them under
128
127
  [the canonical retry contract](../devrites-lib/reference/standards/afk-hitl.md#retry-cap-no-progress-loops-and-self-resolve):
129
- Product/scope choices and unapproved irreversible risk remain human gates;
130
- technical exhaustion preserves blocker/reproduction.
131
- If the named agent is unavailable, stop for HITL. After an accepted edit to a
128
+ Product/scope and unapproved irreversible risk stay human gates;
129
+ exhaustion keeps the blocker.
130
+ If the named agent is unavailable, stop for HITL. Except `sequence_lookahead: yes` and no spawn tool: record the review pending, stay `running`, continue Define. Not access. After an accepted edit to a
132
131
  coverage-bound input, repeat step 6's native coverage revalidation before handoff.
133
132
  8. **STOP.** Report the mode, the scope deltas, and the floor verdict; recommend `/rite-define`.
134
133
 
@@ -169,9 +169,9 @@ named in the re-dispatch contract; changes outside task paths stop for the human
169
169
 
170
170
  ## Scale limits
171
171
 
172
- The role table bounds rosters. Use roughly four concurrent read-only reviewers,
173
- counting children any leaf spawned; eight only with disjoint paths/resources.
174
- Refuse unbounded swarms and role substitution: sharpen scope or use a bounded second pass when coverage is missing.
172
+ The role table bounds rosters. Use up to ten concurrent read-only reviewers,
173
+ the same cap as a writer batch, counting children any leaf spawned.
174
+ Refuse a larger swarm and role substitution: sharpen scope or use a bounded second pass when coverage is missing.
175
175
  Overlapping reviewers increase duplicate findings and reconciliation work.
176
176
 
177
177
  ## Children are tools, not peers
@@ -8,7 +8,7 @@ Follow DevRites policy and [`depth profiles`](../orchestration-profiles.md).
8
8
 
9
9
  <!-- root-only -->
10
10
  - Root owns scope, questions/decisions/results, `.devrites/**`, phase transitions — not product source/tests; vetted executable workflow artifacts follow [`workflow-artifacts.md`](workflow-artifacts.md).
11
- - Every named role runs; unavailable → HITL, never skip/substitute.
11
+ - Every named role runs; unavailable → HITL, never skip/substitute. `sequence_lookahead: yes` with no spawn tool defers the role, records the gap, and keeps planning. Not gate `access`, not a verdict. Admit the role before Build.
12
12
  <!-- /root-only -->
13
13
  - Among lifecycle `devrites-*` specialists, only bounded wright writes product
14
14
  source/tests; others inspect an immutable candidate. The independent `$rite-fast`
@@ -145,11 +145,8 @@ Basis: <files read · commands run to reach this finding>
145
145
  asks for is a Suggestion, however plausible. The `when` must also be reachable:
146
146
  a hostile actor enters only through a trust boundary the feature really has
147
147
  (users, network, external systems, untrusted files). A trigger that needs one it
148
- never faces — the code under test forging its own evidence, a tampering second
149
- user on a single-owner dev host, a swapped remote daemon under a local dev tool —
150
- is a Suggestion too. So is an environment state the feature's declared
151
- environment does not have (a mount option, kernel setting or daemon location
152
- absent from the target host): guard against it only when the spec names it.
148
+ never faces — forged test evidence, a second user on a single-owner host, or a swapped local daemon —
149
+ is a Suggestion too. So is an undeclared host setting (mount, kernel, daemon path): guard it only when the spec names it.
153
150
  A finding never pulls a deferred slice's scope forward.
154
151
  - **`no-findings`:** `No-findings:` names checks and inspected evidence. Bare
155
152
  pass, empty list, or “looks good” is malformed.
@@ -47,10 +47,9 @@ unaudited.
47
47
 
48
48
  ## Gate
49
49
 
50
- At plan, build, review, and seal, compare the proposed or actual change with each
51
- in-scope principle. An unexcepted violation is a Critical finding and blocks the
52
- phase. A missing or empty principles file passes silently.
50
+ At plan, build, review, and seal, compare the change with each in-scope principle.
51
+ An unexcepted violation is Critical and blocks. A missing or empty file passes.
53
52
 
54
- Adding, changing, retiring, or excepting a principle is a deliberate human-owned
55
- decision recorded in the file's governance history. Agents may propose wording;
56
- they do not ratify it.
53
+ Adding, changing, retiring, or excepting a principle is human-owned. Date it in
54
+ the governance history. Agents do not ratify it. Comply by changing the spec.
55
+ Ask for an exception only when the objective cannot be met without the violation.
@@ -41,4 +41,6 @@ recommended option stay human. A blocking question that already names option 1
41
41
  `(Recommended)` or `proposed:` is autocomplete's to resolve: pick that option
42
42
  via `devrites-engine state resolve` and continue. Recommended temper
43
43
  `expand` and extra acceptance are never auto-picked: they stop for a human through
44
- `AskUserQuestion`; do not invent product intent.
44
+ `AskUserQuestion`; do not invent product intent. A principle
45
+ conflict complies by changing the spec. Except a principle when the
46
+ objective cannot be met without the violation.