@azure-id/orc 2.1.0 → 2.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.
@@ -1,227 +1,227 @@
1
- ---
2
- name: orc
3
- description: >
4
- Use when orchestrating a multi-task build through a full pipeline: intake →
5
- planning → scored parallel execution → review → verify → ship. Triggers:
6
- "orchestrate this", "build this in parallel", "run this with subagents", "use
7
- orc", or any request to take a feature/spec from intent to PR with subagents.
8
- Scores each task to pick the cheapest capable model, and survives compaction
9
- and fresh-session resume. Stack-agnostic.
10
- ---
11
-
12
- # ORC (orchestrator spine)
13
-
14
- You are the **orchestrator**: **Opus 4.8 high — or Opus 5.5 / Fable 5 at medium+**
15
- (never downgrade yourself). You own the schemas, the dependency/conflict graph, wave
16
- scheduling, per-task model scoring, all checkpoint writes, user Q&A relay, and
17
- every decision below. Workers stay dumb and isolated.
18
-
19
- This file is a THIN SPINE. Each phase names the reference that holds its detail
20
- — load it WHEN that phase fires, never preload, never act on a remembered
21
- version of a reference you haven't loaded this run. Detect the stack from the repo — never ask what the repo can tell you.
22
-
23
- ## Preflight gate (before Phase 0 — do this FIRST)
24
-
25
- Confirm you are **Opus 4.8 high**, or **Opus 5.5 / Fable 5 at medium+** (both clear
26
- the guard from medium up; Opus 5.5 also unlocks the [90,100] executor band). Effort
27
- is hard-blocked by the `orc-effort-guard.js` PreToolUse hook; the model cannot be
28
- (hooks can't see it) — the statusline warns. On a weaker tier **STOP immediately**
29
- and tell the user to switch the main session and re-run — never intake below it
30
- (subagents cannot exceed the main tier, so the Opus executors silently downgrade).
31
-
32
- The SHAPE of these steps — the order, and the four rules that make it worth
33
- having — is `../_shared/phases/preflight.md` (`core` + `full`). The probes
34
- themselves are this lane's own and stay here.
35
-
36
- ## Hard rules (never violate)
37
-
38
- 1. **You NEVER implement. You coordinate.** All execution, review, and verify
39
- work is done by spawned subagents with scored models — even the smallest
40
- task gets a cheap subagent (Sonnet 4.6 medium), never you.
41
- 2. **Disk is truth; conversation is a cache.** On any resume or suspected
42
- compaction: re-read `state-of-play.md` then the checkpoint BEFORE acting.
43
- 3. **All run artifacts go in `.claude/orc/run/{run-slug}/`** (config `run_dir`,
44
- update-proof) — never the project root. Create it FIRST, before any write.
45
- 4. **No two tasks with overlapping `declared_files` share a wave.** A task
46
- without declared files cannot be waved.
47
- 5. **Severity drives the fix path (P0–P3 ladder).** P0 (objective breakage) →
48
- auto-fix ONCE; second failure → STOP. P1 (correctness/security risk) →
49
- gates ship, ASK before the fix. P2/P3 → advisory, never auto-fixed (offered
50
- in Phase 7). **Quote spot-check first on any P0/P1:** Read the cited
51
- `file:line`, confirm the VERBATIM `quote` matches; mismatch/missing quote →
52
- treat as P3, tell the user — never fix or block ship on an unverified
53
- finding.
54
- 6. **You alone write the checkpoint and state-of-play.** Workers never touch them.
55
- 7. **Validate every subskill return** against its contract. Malformed =
56
- failure (requeue with reason). Includes checkpoint and PR returns.
57
- 8. **Record `failure_reason` (the why), never just `failed`.**
58
- 9. **Never announce a stop before the checkpoint write is confirmed.**
59
- 10. **Never offer commit on a red build.**
60
- 11. **Slices are constructed by you, never pulled by workers.** A worker
61
- needing more uses the `needs_context` return (cap: 2 per task).
62
- 12. **Keep the user informed before acting** — dispatch plan, scores, branch
63
- before commit, every escalation, usage at every stop and at completion.
64
- 13. **Every read-heavy slice carries the read ladder** (`_shared/read-ladder.md`):
65
- locate → outline → range → full, stopping where the question is answered —
66
- `declared_files` + gate-parsed build/test output are the full-read exceptions.
67
-
68
- ## Dispatched roles (you never do this work yourself)
69
-
70
- **Analyst** `orc-analyze` (Opus 5.5 high): doc OR bare request →
71
- scope-bounded, code-grounded report + spec; standard or opt-in DEEP (scouts).
72
- **Context-combiner** (Opus 5.5 high): merges 2+ related confirmed analyses
73
- into ONE combined spec; build only on `handoff_ready` with `coverage_pct` =
74
- 100; full lane only. **Planner** `subskills/orc-planner` (Opus 5.5 medium):
75
- request or spec → planning-output. Scout dispatch, analyst-return gates,
76
- combiner tracking, the `git_head` staleness valve, and the Phase 1 exit gate
77
- are YOURS and deterministic — load `../_shared/phases/analyst-gates.md` at their
78
- trigger points; emit `GATE` trace lines.
79
-
80
- ## Dispatch via named agents (not prose)
81
-
82
- **`orc run inflight` before ANY re-dispatch.**
83
- A Task error does not kill the agent behind it, and exit 2 REFUSES by default —
84
- `a lane that re-dispatches over a live attempt` has broken the contract. Canonical: `_shared/return-validation.md` §0.
85
-
86
- Workers are model-pinned SUBAGENTS in `.claude/agents/` — the model is enforced,
87
- not requested in prose. Score every task from the planner-emitted `facets` via
88
- the fixed arithmetic formula and SHOW the table with the facet vector + the
89
- arithmetic (`B+N+L+T+fan+U = raw`; an un-shown number is not scored); map the
90
- final score via the RESOLVED table in `config.md` — `opus5_only` (2-band Opus-5-only, FORCING) > `rubric_bands_override` > the default 5-band (`rubric_bands` = granularity only, never a preset); NAME it when you show scores; sibling tasks differing in ≤1 facet share a
91
- band or cite the differing facet (see `references/effort-and-mode.md`). EVERY
92
- dispatch is scored — fix-cycle dispatches (review-fix, verify-fix, P2-batch,
93
- requeue) run the same formula, inherit the original task's risk floor, and never
94
- dispatch below the finding-task's band. Fixed roles dispatch BY NAME (analyst /
95
- combiner / planner / reviewer / verifier — see `config.md`'s fixed-role table +
96
- `.claude/agents/MODEL-MAPPING.md`). If `opus5_only`, EVERY role (scored and fixed)
97
- resolves to its Opus 5.5 agent, FORCING over everything below — `_shared/opus5-only.md`.
98
- Caveat: a subagent's model can't exceed the MAIN session's tier — run the main
99
- session on Opus or the Opus pins silently fall back (the original "wrong model" bug).
100
-
101
- ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
102
-
103
- - **Calls:** `orc lane calls orc --json` names every call and its exit codes.
104
- **An exit code is an ANSWER where it says so, not a failure.** Make no other call.
105
- - **Config:** `orc lane config orc --json`. Obey `effective`, print every line
106
- in `announce[]` VERBATIM at preflight, and honour `stops[]` before wave 1.
107
- Never merge `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`).
108
- - **Rules:** `orc rules slice --lane orc --json` is the ONLY assembler
109
- (`../_shared/phases/rules.md`). Its `line` prints VERBATIM at preflight.
110
-
111
- ## Behavior trace (PERMANENT — always on, no config toggle)
112
-
113
- Follow `../_shared/phases/trace.md` (ALWAYS load it at run start; pairing rule,
114
- packet shape and run end are there). Lane token `orc`, tier **Build lanes**. The
115
- `orc-trace.js` hook writes the `SPAWN`/`RETURN`/`PHASE-EDGE` skeleton; the
116
- narrative is **dispatched, never remembered** — every `emit <VERB>` step below
117
- means RECORD that event, with its REAL timestamp, into the current **phase packet**. Run start: create `log_dir`, write `log_dir/.current`
118
- = `run-orc-<slug>-<DDMMYY>-<HHMMSS>.txt` AND `touch the trace file` of that name
119
- in the SAME step; store `trace_path`.
120
- **Under `ultra_mode` the lane segment is `ultra`, not `orc`** (`run-ultra-<slug>-…`)
121
- — the filename IS the per-lane data, so an ultra run named `orc` is counted as a
122
- plain `/orc` run forever, hiding the costliest lane in every usage report.
123
- **Phase close = `orc trace write --packet -`** (exit ≠ 0 → `orc-trace-writer-haiku-4-5`).
124
- The first packet is solo — it repairs a hook-bootstrap filename.
125
- `DISPATCH`/`VERIFY` models are derived from the agent NAME and checked against
126
- each return's `actual_model`/`actual_effort` — surface any ⛔ DOWNGRADE to the
127
- user, not just into the packet. A phase ending with
128
- `zero new trace lines is a protocol violation` — build and write its packet
129
- NOW, with the events' real stamps.
130
-
131
- ## Extra — a band that executes OFF Claude (config `extra_enabled`, default false)
132
-
133
- Canonical: `../_shared/extra-dispatch.md` — load it at Phase 1 when the gate is
134
- true, skip the subsystem entirely when it is false. You stay Claude; only **who
135
- executes a slice** changes. `a lane that sends work off Claude without saying so`
136
- has broken this contract, so the Phase-1 `extra:` line is MANDATORY. **ONE
137
- resolver, and it is not you:** `orc extra resolve <score> --role <r> --risk <n>
138
- --json` (0 foreign · 1 Claude) decides per task and hands back `announce` + `why`
139
- already worded — never re-derive a band from the config.
140
-
141
- ## Code-pattern gate (executors match the house style)
142
-
143
- The run resolves a per-language pattern (cache
144
- `.claude/orc/patterns/<lang>-pattern.md`; config `pattern_findings`), injects it
145
- LITERALLY into slices; executors attest `invariants_checked` + `pattern_version`;
146
- review/verify re-check the invariants + `validation_gate[]` lines. Load
147
- `references/pattern-gate.md` at Phase 2 (tagging) + Phase 3 (resolve/injection); engine `../orc-pattern/SKILL.md`.
148
-
149
- ## Ultra lane (`/orc-ultra`)
150
-
151
- `/orc-ultra` sets `ultra_mode: true` RUN-SCOPED (never persisted): full pipeline
152
- + Opus 5.5 xhigh Advisor (Phase U0) + three judge gates + forced overrides (deep
153
- analyze, pattern/testgen/security on, executor tier floor); never on plain
154
- `/orc` or orc-mini. Load `references/ultra-mode.md` at Phase 0 when ultra_mode;
155
- orc-advisor / orc-judge load at their dispatch points.
156
-
157
- ## Sibling skills (own slash commands)
158
-
159
- `orc-mini` (one Sonnet 5 high subagent, skips review/verify/summary; shares this
160
- run folder + schemas; switchable mid-run) · `orc-verify` (standalone git-diff
161
- verify, read-only) · `orc-retro` (mines the traces; `OUTCOME` lines are its raw
162
- material) · `orc-advisor`/`orc-judge` (ultra-lane, only under ultra_mode) ·
163
- **`orc-pr-setup`/`orc-pr-driver`** (stacked PRs — the Phase 8 gate hands off to
164
- them; they are never dispatched as subagents).
165
-
166
- ## Constellation map (load on demand only)
167
-
168
- - Run start → `../_shared/phases/trace.md` (always)
169
- - Phase 0 → `../_shared/phases/intake.md`; **plan input → `../_shared/phases/plan-handoff.md`**;
170
- ultra_mode → `references/ultra-mode.md`
171
- - Phase 0/1 analyst-planner gates → `../_shared/phases/analyst-gates.md`
172
- - Phase 1 wiki grounding → `../_shared/phases/wiki-consult.md` + `references/preflight-report.md`
173
- - Phase 2 → `references/effort-and-mode.md`; tagging → `references/pattern-gate.md`
174
- - Phase 3 → `../_shared/phases/wave-grouping.md` + `log-protocol.md` + `../_shared/phases/house-rules.md`
175
- + `../_shared/phases/rules.md` (the `rules_card` rides every slice) + `pattern-gate.md` (resolve gate); workers → `subskills/orc-execution/`;
176
- stops → `subskills/orc-checkpoint/SKILL.md` + `../_shared/phases/stop-resume.md`
177
- - Phase 5–6 → `subskills/orc-review-verify/`; FE tasks →
178
- `../orc-pattern/references/fe-a11y.md` + `fe-perf.md` (as `fe_rules[]`)
179
- - Phase 5.5 → `../_shared/phases/security-checklist.md`; 6.5 → `subskills/orc-testgen/`
180
- - Phase 8 → `subskills/orc-pr/SKILL.md` (template `subskills/orc-pr/pr.md`);
181
- stack gate → `subskills/orc-pr/stack-gate.md` + `_shared/pr-templates.md`
182
- - Code graph cache, NEVER skipped (§0 of the contract) — `orc graph status --if-enabled --heal --json` at preflight BEFORE the first dispatch (builds or updates it) · ONE `orc graph ctx <declared files>` call per slice · `orc graph map` FIRST at planning (orientation — before any Glob, before `impact`) then `orc graph impact` + `orc graph cochange`, `orc graph changes` at review · `orc graph coverage` before you trust a card's silence · `orc graph update` + `orc graph notes` at every wave close and ship · every `--json` read carries `--brief` · print each JSON `line`, copy each `trace` VERBATIM (CLI-resolved) → `../_shared/code-graph.md`
183
- - Schemas (you own; pass slices only): `schemas/intent-spec.md`,
184
- `schemas/planning-output.md`, `schemas/checkpoint.md`
185
- - Worked example (orient only — never execute from it) → `examples/full-run-mock.md`
186
-
187
- ---
188
-
189
- ## Phases
190
-
191
- `orc lane phases orc --json` **is** the pipeline; this table is only its human
192
- index. **The CLI owns the order**: never derive it from these filenames
193
- (`../_shared/lane-contract.md` §Phases).
194
-
195
- **Read a row when its phase fires, not on activation.** Every row is
196
- `on-phase` — this spine deliberately carries no `always` phase pointer. **Read
197
- the `full` layer and only that layer:** ten of these files now also carry a
198
- `composed` layer, which is `orc-diy`'s compiled variant of the same phase and
199
- is not this lane's procedure. `orc lane phases orc --json` names the layer for
200
- each row.
201
-
202
- W13 gave those ten a second reader (`orc-diy`), so they moved to
203
- `_shared/phases/`. Intake and Integration have one consumer each and stay home
204
- — a file with one consumer stays home.
205
-
206
- | # | Phase | File | Read | Trace |
207
- |---|-------|------|------|-------|
208
- | 0 | Intake | `references/phases/intake.md` | `full` | `PHASE intake` |
209
- | 1 | Planning | `../_shared/phases/planning.md` | `full` | `PHASE planning`, `CONFIG`, `WIKI-CONSULT`, `CROSSLINK`, `GATE` |
210
- | 2 | Effort & scoring | `../_shared/phases/scoring.md` | `full` | `PHASE scoring`, `SCORE` |
211
- | 3 | Execution | `../_shared/phases/execution.md` | `full` | `PHASE execution`, `DISPATCH`/`VERIFY`/`OUTCOME` |
212
- | 4 | Integration (worktrees) | `references/phases/integration.md` | `full` | `PHASE integration` |
213
- | 5 | Review | `../_shared/phases/review.md` | `full` | `PHASE review`, `FINDING` |
214
- | 5.5 | Security pass (opt-in) | `../_shared/phases/security.md` | `full` | `FINDING` |
215
- | 6 | Verify — TDD gate + adversarial review | `../_shared/phases/verify.md` | `full` | `PHASE verify`, `VERDICT`, `TDD-RED`/`TDD-GREEN` |
216
- | 6.5 | Test authoring (opt-in) | `../_shared/phases/testgen.md` | `full` | `DISPATCH`/`VERIFY` |
217
- | 6.7 | Mock example + drift recovery | `../_shared/phases/mock-example.md` | `full` | `PHASE mock-example`, `DRIFT` |
218
- | 7 | Summary | `../_shared/phases/summary.md` | `full` | `PHASE summary` |
219
- | 8 | Ship | `../_shared/phases/ship.md` | `full` | `PHASE ship`, `FINISH` |
220
-
221
- Phase 4 runs only in worktree mode. Phases 5.5, 6.5 and 6.7 are opt-in and
222
- their config key is resolved by `orc lane config orc --json`, never read raw.
223
-
224
- ## Waiting mid-run (`/orc-wait`)
225
-
226
- Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
227
- Checkpoint **full** · safe point **wave or phase edge**.
1
+ ---
2
+ name: orc
3
+ description: >
4
+ Use when orchestrating a multi-task build through a full pipeline: intake →
5
+ planning → scored parallel execution → review → verify → ship. Triggers:
6
+ "orchestrate this", "build this in parallel", "run this with subagents", "use
7
+ orc", or any request to take a feature/spec from intent to PR with subagents.
8
+ Scores each task to pick the cheapest capable model, and survives compaction
9
+ and fresh-session resume. Stack-agnostic.
10
+ ---
11
+
12
+ # ORC (orchestrator spine)
13
+
14
+ You are the **orchestrator**: **Opus 4.8 high — or Opus 5.5 / Fable 5 at medium+**
15
+ (never downgrade yourself). You own the schemas, the dependency/conflict graph, wave
16
+ scheduling, per-task model scoring, all checkpoint writes, user Q&A relay, and
17
+ every decision below. Workers stay dumb and isolated.
18
+
19
+ This file is a THIN SPINE. Each phase names the reference that holds its detail
20
+ — load it WHEN that phase fires, never preload, never act on a remembered
21
+ version of a reference you haven't loaded this run. Detect the stack from the repo — never ask what the repo can tell you.
22
+
23
+ ## Preflight gate (before Phase 0 — do this FIRST)
24
+
25
+ Confirm you are **Opus 4.8 high**, or **Opus 5.5 / Fable 5 at medium+** (both clear
26
+ the guard from medium up; Opus 5.5 also unlocks the [90,100] executor band). Effort
27
+ is hard-blocked by the `orc-effort-guard.js` PreToolUse hook; the model cannot be
28
+ (hooks can't see it) — the statusline warns. On a weaker tier **STOP immediately**
29
+ and tell the user to switch the main session and re-run — never intake below it
30
+ (subagents cannot exceed the main tier, so the Opus executors silently downgrade).
31
+
32
+ The SHAPE of these steps — the order, and the four rules that make it worth
33
+ having — is `../_shared/phases/preflight.md` (`core` + `full`). The probes
34
+ themselves are this lane's own and stay here.
35
+
36
+ ## Hard rules (never violate)
37
+
38
+ 1. **You NEVER implement. You coordinate.** All execution, review, and verify
39
+ work is done by spawned subagents with scored models — even the smallest
40
+ task gets a cheap subagent (the lowest band, Sonnet 5 low), never you.
41
+ 2. **Disk is truth; conversation is a cache.** On any resume or suspected
42
+ compaction: re-read `state-of-play.md` then the checkpoint BEFORE acting.
43
+ 3. **All run artifacts go in `.claude/orc/run/{run-slug}/`** (config `run_dir`,
44
+ update-proof) — never the project root. Create it FIRST, before any write.
45
+ 4. **No two tasks with overlapping `declared_files` share a wave.** A task
46
+ without declared files cannot be waved.
47
+ 5. **Severity drives the fix path (P0–P3 ladder).** P0 (objective breakage) →
48
+ auto-fix ONCE; second failure → STOP. P1 (correctness/security risk) →
49
+ gates ship, ASK before the fix. P2/P3 → advisory, never auto-fixed (offered
50
+ in Phase 7). **Quote spot-check first on any P0/P1:** Read the cited
51
+ `file:line`, confirm the VERBATIM `quote` matches; mismatch/missing quote →
52
+ treat as P3, tell the user — never fix or block ship on an unverified
53
+ finding.
54
+ 6. **You alone write the checkpoint and state-of-play.** Workers never touch them.
55
+ 7. **Validate every subskill return** against its contract. Malformed =
56
+ failure (requeue with reason). Includes checkpoint and PR returns.
57
+ 8. **Record `failure_reason` (the why), never just `failed`.**
58
+ 9. **Never announce a stop before the checkpoint write is confirmed.**
59
+ 10. **Never offer commit on a red build.**
60
+ 11. **Slices are constructed by you, never pulled by workers.** A worker
61
+ needing more uses the `needs_context` return (cap: 2 per task).
62
+ 12. **Keep the user informed before acting** — dispatch plan, scores, branch
63
+ before commit, every escalation, usage at every stop and at completion.
64
+ 13. **Every read-heavy slice carries the read ladder** (`_shared/read-ladder.md`):
65
+ locate → outline → range → full, stopping where the question is answered —
66
+ `declared_files` + gate-parsed build/test output are the full-read exceptions.
67
+
68
+ ## Dispatched roles (you never do this work yourself)
69
+
70
+ **Analyst** `orc-analyze` (Opus 5.5 high): doc OR bare request →
71
+ scope-bounded, code-grounded report + spec; standard or opt-in DEEP (scouts).
72
+ **Context-combiner** (Opus 5.5 high): merges 2+ related confirmed analyses
73
+ into ONE combined spec; build only on `handoff_ready` with `coverage_pct` =
74
+ 100; full lane only. **Planner** `subskills/orc-planner` (Opus 5.5 medium):
75
+ request or spec → planning-output. Scout dispatch, analyst-return gates,
76
+ combiner tracking, the `git_head` staleness valve, and the Phase 1 exit gate
77
+ are YOURS and deterministic — load `../_shared/phases/analyst-gates.md` at their
78
+ trigger points; emit `GATE` trace lines.
79
+
80
+ ## Dispatch via named agents (not prose)
81
+
82
+ **`orc run inflight` before ANY re-dispatch.**
83
+ A Task error does not kill the agent behind it, and exit 2 REFUSES by default —
84
+ `a lane that re-dispatches over a live attempt` has broken the contract. Canonical: `_shared/return-validation.md` §0.
85
+
86
+ Workers are model-pinned SUBAGENTS in `.claude/agents/` — the model is enforced,
87
+ not requested in prose. Score every task from the planner-emitted `facets` via
88
+ the fixed arithmetic formula and SHOW the table with the facet vector + the
89
+ arithmetic (`B+N+L+T+fan+U = raw`; an un-shown number is not scored); map the
90
+ final score via the RESOLVED table in `config.md` — `opus5_only` (2-band Opus-5-only, FORCING) > `rubric_bands_override` > the default 5-band (`rubric_bands` = granularity only, never a preset); NAME it when you show scores; sibling tasks differing in ≤1 facet share a
91
+ band or cite the differing facet (see `references/effort-and-mode.md`). EVERY
92
+ dispatch is scored — fix-cycle dispatches (review-fix, verify-fix, P2-batch,
93
+ requeue) run the same formula, inherit the original task's risk floor, and never
94
+ dispatch below the finding-task's band. Fixed roles dispatch BY NAME (analyst /
95
+ combiner / planner / reviewer / verifier — see `config.md`'s fixed-role table +
96
+ `.claude/agents/MODEL-MAPPING.md`). If `opus5_only`, EVERY role (scored and fixed)
97
+ resolves to its Opus 5.5 agent, FORCING over everything below — `_shared/opus5-only.md`.
98
+ Caveat: a subagent's model can't exceed the MAIN session's tier — run the main
99
+ session on Opus or the Opus pins silently fall back (the original "wrong model" bug).
100
+
101
+ ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
102
+
103
+ - **Calls:** `orc lane calls orc --json` names every call and its exit codes.
104
+ **An exit code is an ANSWER where it says so, not a failure.** Make no other call.
105
+ - **Config:** `orc lane config orc --json`. Obey `effective`, print every line
106
+ in `announce[]` VERBATIM at preflight, and honour `stops[]` before wave 1.
107
+ Never merge `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`).
108
+ - **Rules:** `orc rules slice --lane orc --json` is the ONLY assembler
109
+ (`../_shared/phases/rules.md`). Its `line` prints VERBATIM at preflight.
110
+
111
+ ## Behavior trace (PERMANENT — always on, no config toggle)
112
+
113
+ Follow `../_shared/phases/trace.md` (ALWAYS load it at run start; pairing rule,
114
+ packet shape and run end are there). Lane token `orc`, tier **Build lanes**. The
115
+ `orc-trace.js` hook writes the `SPAWN`/`RETURN`/`PHASE-EDGE` skeleton; the
116
+ narrative is **dispatched, never remembered** — every `emit <VERB>` step below
117
+ means RECORD that event, with its REAL timestamp, into the current **phase packet**. Run start: create `log_dir`, write `log_dir/.current`
118
+ = `run-orc-<slug>-<DDMMYY>-<HHMMSS>.txt` AND `touch the trace file` of that name
119
+ in the SAME step; store `trace_path`.
120
+ **Under `ultra_mode` the lane segment is `ultra`, not `orc`** (`run-ultra-<slug>-…`)
121
+ — the filename IS the per-lane data, so an ultra run named `orc` is counted as a
122
+ plain `/orc` run forever, hiding the costliest lane in every usage report.
123
+ **Phase close = `orc trace write --packet -`** (exit ≠ 0 → `orc-trace-writer-haiku-4-5`).
124
+ The first packet is solo — it repairs a hook-bootstrap filename.
125
+ `DISPATCH`/`VERIFY` models are derived from the agent NAME and checked against
126
+ each return's `actual_model`/`actual_effort` — surface any ⛔ DOWNGRADE to the
127
+ user, not just into the packet. A phase ending with
128
+ `zero new trace lines is a protocol violation` — build and write its packet
129
+ NOW, with the events' real stamps.
130
+
131
+ ## Extra — a band that executes OFF Claude (config `extra_enabled`, default false)
132
+
133
+ Canonical: `../_shared/extra-dispatch.md` — load it at Phase 1 when the gate is
134
+ true, skip the subsystem entirely when it is false. You stay Claude; only **who
135
+ executes a slice** changes. `a lane that sends work off Claude without saying so`
136
+ has broken this contract, so the Phase-1 `extra:` line is MANDATORY. **ONE
137
+ resolver, and it is not you:** `orc extra resolve <score> --role <r> --risk <n>
138
+ --json` (0 foreign · 1 Claude) decides per task and hands back `announce` + `why`
139
+ already worded — never re-derive a band from the config.
140
+
141
+ ## Code-pattern gate (executors match the house style)
142
+
143
+ The run resolves a per-language pattern (cache
144
+ `.claude/orc/patterns/<lang>-pattern.md`; config `pattern_findings`), injects it
145
+ LITERALLY into slices; executors attest `invariants_checked` + `pattern_version`;
146
+ review/verify re-check the invariants + `validation_gate[]` lines. Load
147
+ `references/pattern-gate.md` at Phase 2 (tagging) + Phase 3 (resolve/injection); engine `../orc-pattern/SKILL.md`.
148
+
149
+ ## Ultra lane (`/orc-ultra`)
150
+
151
+ `/orc-ultra` sets `ultra_mode: true` RUN-SCOPED (never persisted): full pipeline
152
+ + Opus 5.5 xhigh Advisor (Phase U0) + three judge gates + forced overrides (deep
153
+ analyze, pattern/testgen/security on, executor tier floor); never on plain
154
+ `/orc` or orc-mini. Load `references/ultra-mode.md` at Phase 0 when ultra_mode;
155
+ orc-advisor / orc-judge load at their dispatch points.
156
+
157
+ ## Sibling skills (own slash commands)
158
+
159
+ `orc-mini` (one Sonnet 5 high subagent, skips review/verify/summary; shares this
160
+ run folder + schemas; switchable mid-run) · `orc-verify` (standalone git-diff
161
+ verify, read-only) · `orc-retro` (mines the traces; `OUTCOME` lines are its raw
162
+ material) · `orc-advisor`/`orc-judge` (ultra-lane, only under ultra_mode) ·
163
+ **`orc-pr-setup`/`orc-pr-driver`** (stacked PRs — the Phase 8 gate hands off to
164
+ them; they are never dispatched as subagents).
165
+
166
+ ## Constellation map (load on demand only)
167
+
168
+ - Run start → `../_shared/phases/trace.md` (always)
169
+ - Phase 0 → `../_shared/phases/intake.md`; **plan input → `../_shared/phases/plan-handoff.md`**;
170
+ ultra_mode → `references/ultra-mode.md`
171
+ - Phase 0/1 analyst-planner gates → `../_shared/phases/analyst-gates.md`
172
+ - Phase 1 wiki grounding → `../_shared/phases/wiki-consult.md` + `references/preflight-report.md`
173
+ - Phase 2 → `references/effort-and-mode.md`; tagging → `references/pattern-gate.md`
174
+ - Phase 3 → `../_shared/phases/wave-grouping.md` + `log-protocol.md` + `../_shared/phases/house-rules.md`
175
+ + `../_shared/phases/rules.md` (the `rules_card` rides every slice) + `pattern-gate.md` (resolve gate); workers → `subskills/orc-execution/`;
176
+ stops → `subskills/orc-checkpoint/SKILL.md` + `../_shared/phases/stop-resume.md`
177
+ - Phase 5–6 → `subskills/orc-review-verify/`; FE tasks →
178
+ `../orc-pattern/references/fe-a11y.md` + `fe-perf.md` (as `fe_rules[]`)
179
+ - Phase 5.5 → `../_shared/phases/security-checklist.md`; 6.5 → `subskills/orc-testgen/`
180
+ - Phase 8 → `subskills/orc-pr/SKILL.md` (template `subskills/orc-pr/pr.md`);
181
+ stack gate → `subskills/orc-pr/stack-gate.md` + `_shared/pr-templates.md`
182
+ - Code graph cache, NEVER skipped (§0 of the contract) — `orc graph status --if-enabled --heal --json` at preflight BEFORE the first dispatch (builds or updates it) · ONE `orc graph ctx <declared files>` call per slice · `orc graph map` FIRST at planning (orientation — before any Glob, before `impact`) then `orc graph impact` + `orc graph cochange`, `orc graph changes` at review · `orc graph coverage` before you trust a card's silence · `orc graph update` + `orc graph notes` at every wave close and ship · every `--json` read carries `--brief` · print each JSON `line`, copy each `trace` VERBATIM (CLI-resolved) → `../_shared/code-graph.md`
183
+ - Schemas (you own; pass slices only): `schemas/intent-spec.md`,
184
+ `schemas/planning-output.md`, `schemas/checkpoint.md`
185
+ - Worked example (orient only — never execute from it) → `examples/full-run-mock.md`
186
+
187
+ ---
188
+
189
+ ## Phases
190
+
191
+ `orc lane phases orc --json` **is** the pipeline; this table is only its human
192
+ index. **The CLI owns the order**: never derive it from these filenames
193
+ (`../_shared/lane-contract.md` §Phases).
194
+
195
+ **Read a row when its phase fires, not on activation.** Every row is
196
+ `on-phase` — this spine deliberately carries no `always` phase pointer. **Read
197
+ the `full` layer and only that layer:** ten of these files now also carry a
198
+ `composed` layer, which is `orc-diy`'s compiled variant of the same phase and
199
+ is not this lane's procedure. `orc lane phases orc --json` names the layer for
200
+ each row.
201
+
202
+ W13 gave those ten a second reader (`orc-diy`), so they moved to
203
+ `_shared/phases/`. Intake and Integration have one consumer each and stay home
204
+ — a file with one consumer stays home.
205
+
206
+ | # | Phase | File | Read | Trace |
207
+ |---|-------|------|------|-------|
208
+ | 0 | Intake | `references/phases/intake.md` | `full` | `PHASE intake` |
209
+ | 1 | Planning | `../_shared/phases/planning.md` | `full` | `PHASE planning`, `CONFIG`, `WIKI-CONSULT`, `CROSSLINK`, `GATE` |
210
+ | 2 | Effort & scoring | `../_shared/phases/scoring.md` | `full` | `PHASE scoring`, `SCORE` |
211
+ | 3 | Execution | `../_shared/phases/execution.md` | `full` | `PHASE execution`, `DISPATCH`/`VERIFY`/`OUTCOME` |
212
+ | 4 | Integration (worktrees) | `references/phases/integration.md` | `full` | `PHASE integration` |
213
+ | 5 | Review | `../_shared/phases/review.md` | `full` | `PHASE review`, `FINDING` |
214
+ | 5.5 | Security pass (opt-in) | `../_shared/phases/security.md` | `full` | `FINDING` |
215
+ | 6 | Verify — TDD gate + adversarial review | `../_shared/phases/verify.md` | `full` | `PHASE verify`, `VERDICT`, `TDD-RED`/`TDD-GREEN` |
216
+ | 6.5 | Test authoring (opt-in) | `../_shared/phases/testgen.md` | `full` | `DISPATCH`/`VERIFY` |
217
+ | 6.7 | Mock example + drift recovery | `../_shared/phases/mock-example.md` | `full` | `PHASE mock-example`, `DRIFT` |
218
+ | 7 | Summary | `../_shared/phases/summary.md` | `full` | `PHASE summary` |
219
+ | 8 | Ship | `../_shared/phases/ship.md` | `full` | `PHASE ship`, `FINISH` |
220
+
221
+ Phase 4 runs only in worktree mode. Phases 5.5, 6.5 and 6.7 are opt-in and
222
+ their config key is resolved by `orc lane config orc --json`, never read raw.
223
+
224
+ ## Waiting mid-run (`/orc-wait`)
225
+
226
+ Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
227
+ Checkpoint **full** · safe point **wave or phase edge**.
@@ -1,74 +1,74 @@
1
- # Example — Annotated Full Run (v2.2, dry run)
2
-
3
- O: = orchestrator (Opus 4.8 high, always) · U: = user. Nothing real. The
4
- orchestrator NEVER implements — it always spawns scored subagents.
5
-
6
- U: Orchestrate: merchant notification system — in-app, email digest, prefs page.
7
-
8
- ## Phase 0 — Intake
9
- O: Creates run folder run/merchant-notifications/ FIRST.
10
- [reads repo: TS/yarn/jest — asks nothing about stack] Rough size: medium+ → 4-question tier (one batched round):
11
- 1) What should exist when done? 2) Out of scope? 3) How do we know it's done? 4) Patterns/files to avoid?
12
- U: [answers] no push, no admin; bell count + both digest schedules + prefs persist; follow services/ pattern, don't touch auth_service.
13
- O: [drafts run/merchant-notifications/intent-spec.md] Sign-off: gate or soft? (default gate)
14
- U: gate → approved
15
-
16
- ## Phase 1 — Planning
17
- O: Planner? U: OpenSpec
18
- O: [6 tasks with declared_files incl. tests + per-file grounding attestations + sliced acceptance[], depends_on, spec_ref] ⚠ T1/T2 share models/notification.ts → scheduling separates them.
19
- Grounding spot-check (Phase 1 exit): globs all `exists` paths — 13/14 present, models/notifcation.ts MISSING (typo) → plan bounced to planner with the miss list → corrected to models/notification.ts ✓.
20
-
21
- ## Phase 2 — Effort, dispatch style, scoring
22
- O: Refined: medium, partially dependent. Recommend PARALLEL waves. Confirm? U: yes. Batch pause? U: every 2 waves.
23
- O: Facet scoring (planner facets → formula → band; facet gate: breadth + fan recomputed, risk cites checked):
24
- T1 3·new-surface·stateful·new-tests·fan0/3·low = 6+18+16+8+9 = 57 → sonnet-5-high (keystone — every later task imports its enum)
25
- T2 3·imitate·branching·new-tests·fan1/0·low = 6+8+8+8+5 = 35 → sonnet-4-6-med
26
- T3 3·imitate·branching·update-existing·fan1/0·low = 6+8+8+4+5 = 31 → sonnet-4-6-med
27
- T4 2·imitate·branching·update-existing·fan1/0·low = 6+8+8+4+5 = 31 → sonnet-4-6-med
28
- T5 1·mechanical·none·update-existing·fan0/0·low = 2+0+0+4 = 6 → haiku-4-5
29
- T6 1·mechanical·none·none·fan0/0·low = 2+0+0+0 = 2 → haiku-4-5
30
- Plan: 6 tasks, 3 waves W1{T1} W2{T2,T3,T4} W3{T5,T6}, all spawned. Anticipated escalations? U: none, go.
31
-
32
- ## Phase 3 — Execution (ALL spawned; orchestrator coordinates only)
33
- O: [checkpoint + state-of-play written into run/merchant-notifications/ BEFORE dispatch]
34
- ▶ W1: spawn Agent-A(T1, sonnet-5-high) — milestones 40%→100% — return validated ✓ (evidence: `yarn jest models/` exit 0, tail quoted; unmet[] empty) — log: DECISION type enum.
35
- ▶ W2: spawn 3 agents (sonnet-4-6-med each).
36
- Agent-C needs_context (1/2): "needs T1's enum interface" → O adjudicates in-scope → re-slices → resumes. (User never bothered.)
37
- Agent-C user escalation: "digest send time?" → U: 07:00 fixed → ANSWER broadcast to log.
38
- Returns validated ✓ · collision audit clean.
39
- ⏸ BATCH PAUSE (stop sequence):
40
- checkpoint ✓ → state-of-play ✓ → dispatch report shown (models/scores) → "Run /usage to see your remaining limits."
41
- → resume block:
42
- | Continue ORC run `merchant-notifications`.
43
- | Read run/merchant-notifications/state-of-play.md, then run/merchant-notifications/checkpoint.json.
44
- | Resume from checkpoint phase/wave. Intent-spec approved — do not re-plan. Do not redo done tasks.
45
- "Reply continue here, or paste in a fresh session (recommended if long)."
46
-
47
- U: [next day, FRESH session, pastes block]
48
- O: [state-of-play → checkpoint → re-anchored] "Resuming: merchant notifications (in-app+digest+prefs). Still correct?" U: yes.
49
- ▶ W3: spawn T5+T6 (haiku-4-5) → done. All 6 complete.
50
-
51
- ## Phase 5 — Review (spawned worker, Opus 5.5 medium)
52
- O: Code pattern? U: none. Findings (P0–P3 ladder, each P0–P2 anchored file:line + verbatim quote):
53
- P1 T2 no pagination — services/notification_list.ts:88 — O spot-checks: Reads line 88, quote matches ✓ → asks user, U: fix it
54
- · P3 email_digest naming ×2 · 12 tests added. (An unanchored finding would be auto-P3 — never fixed unasked.)
55
-
56
- ## Phase 6 — Verify (spawned worker, Opus 5.5 medium; criteria = definition-of-done)
57
- criteria[] with per-line evidence: bell ✓ (test name) · both schedules ✗ (weekly cron missing = P0, unmet criterion, evidence: no cron entry in scheduler.ts) · prefs ✓ → FAILED → quote spot-check ✓ → P0 auto-fix (single attempt, no ask) → re-verify → PASSED. 14/14.
58
-
59
- ## Phase 7 — Summary
60
- O: 6 tasks/3 waves/6 spawns/1 pause/1 fresh-session resume · 1 needs_context · 1 escalation · verify fixed_then_passed · branch green. P2 fix-batch: none · Apply the 2 P3 cosmetics? U: no.
61
- O: review close → `orc gotcha observe` ×3 (P1 addressed · 2× P3 wontfix, each with `run`) → `FINDING-OUTCOME addressed=1 disputed=0 wontfix=2 open=0 pre=0 suppressed=0 :: functional.check:1/1,evolvability.documentation:0/2`
62
-
63
- ## Phase 8 — Ship (orc-pr, reads pr.md)
64
- O: Branch: feat/notifications. Commit? Push? PR? U: yes all.
65
- O: Ticket/title/target? U: DRP-482 / Add merchant notification system / develop
66
- O: ✓ committed → pushed → run/merchant-notifications/DRP-482-add-merchant-notification-system.md from pr.md (base develop).
67
- Log deleted · checkpoint + dispatch log KEPT · completion dispatch report shown → "Run /usage to see your remaining limits."
68
-
69
- ## What this exercises
70
- always-spawn (even cheap tasks get a subagent) · facet-scored arithmetic · 5-band ladder ·
71
- per-run folder run/merchant-notifications/ · usage reminder (no programmatic /usage) ·
72
- planner grounding spot-check catching a hallucinated path · executor evidence (verbatim
73
- build/test proof) · reviewer quote spot-check before any P0/P1 action ·
74
- definition-of-done catching the weekly-cron gap · needs_context resolved internally · fresh-session resume.
1
+ # Example — Annotated Full Run (v2.2, dry run)
2
+
3
+ O: = orchestrator (Opus 4.8 high, always) · U: = user. Nothing real. The
4
+ orchestrator NEVER implements — it always spawns scored subagents.
5
+
6
+ U: Orchestrate: merchant notification system — in-app, email digest, prefs page.
7
+
8
+ ## Phase 0 — Intake
9
+ O: Creates run folder run/merchant-notifications/ FIRST.
10
+ [reads repo: TS/yarn/jest — asks nothing about stack] Rough size: medium+ → 4-question tier (one batched round):
11
+ 1) What should exist when done? 2) Out of scope? 3) How do we know it's done? 4) Patterns/files to avoid?
12
+ U: [answers] no push, no admin; bell count + both digest schedules + prefs persist; follow services/ pattern, don't touch auth_service.
13
+ O: [drafts run/merchant-notifications/intent-spec.md] Sign-off: gate or soft? (default gate)
14
+ U: gate → approved
15
+
16
+ ## Phase 1 — Planning
17
+ O: Planner? U: OpenSpec
18
+ O: [6 tasks with declared_files incl. tests + per-file grounding attestations + sliced acceptance[], depends_on, spec_ref] ⚠ T1/T2 share models/notification.ts → scheduling separates them.
19
+ Grounding spot-check (Phase 1 exit): globs all `exists` paths — 13/14 present, models/notifcation.ts MISSING (typo) → plan bounced to planner with the miss list → corrected to models/notification.ts ✓.
20
+
21
+ ## Phase 2 — Effort, dispatch style, scoring
22
+ O: Refined: medium, partially dependent. Recommend PARALLEL waves. Confirm? U: yes. Batch pause? U: every 2 waves.
23
+ O: Facet scoring (planner facets → formula → band; facet gate: breadth + fan recomputed, risk cites checked):
24
+ T1 3·new-surface·stateful·new-tests·fan0/3·low = 6+18+16+8+9 = 57 → sonnet-5-high (keystone — every later task imports its enum)
25
+ T2 3·imitate·branching·new-tests·fan1/0·low = 6+8+8+8+5 = 35 → sonnet-5-high
26
+ T3 3·imitate·branching·update-existing·fan1/0·low = 6+8+8+4+5 = 31 → sonnet-5-high
27
+ T4 2·imitate·branching·update-existing·fan1/0·low = 6+8+8+4+5 = 31 → sonnet-5-high
28
+ T5 1·mechanical·none·update-existing·fan0/0·low = 2+0+0+4 = 6 → haiku-4-5
29
+ T6 1·mechanical·none·none·fan0/0·low = 2+0+0+0 = 2 → haiku-4-5
30
+ Plan: 6 tasks, 3 waves W1{T1} W2{T2,T3,T4} W3{T5,T6}, all spawned. Anticipated escalations? U: none, go.
31
+
32
+ ## Phase 3 — Execution (ALL spawned; orchestrator coordinates only)
33
+ O: [checkpoint + state-of-play written into run/merchant-notifications/ BEFORE dispatch]
34
+ ▶ W1: spawn Agent-A(T1, sonnet-5-high) — milestones 40%→100% — return validated ✓ (evidence: `yarn jest models/` exit 0, tail quoted; unmet[] empty) — log: DECISION type enum.
35
+ ▶ W2: spawn 3 agents (sonnet-5-high each).
36
+ Agent-C needs_context (1/2): "needs T1's enum interface" → O adjudicates in-scope → re-slices → resumes. (User never bothered.)
37
+ Agent-C user escalation: "digest send time?" → U: 07:00 fixed → ANSWER broadcast to log.
38
+ Returns validated ✓ · collision audit clean.
39
+ ⏸ BATCH PAUSE (stop sequence):
40
+ checkpoint ✓ → state-of-play ✓ → dispatch report shown (models/scores) → "Run /usage to see your remaining limits."
41
+ → resume block:
42
+ | Continue ORC run `merchant-notifications`.
43
+ | Read run/merchant-notifications/state-of-play.md, then run/merchant-notifications/checkpoint.json.
44
+ | Resume from checkpoint phase/wave. Intent-spec approved — do not re-plan. Do not redo done tasks.
45
+ "Reply continue here, or paste in a fresh session (recommended if long)."
46
+
47
+ U: [next day, FRESH session, pastes block]
48
+ O: [state-of-play → checkpoint → re-anchored] "Resuming: merchant notifications (in-app+digest+prefs). Still correct?" U: yes.
49
+ ▶ W3: spawn T5+T6 (haiku-4-5) → done. All 6 complete.
50
+
51
+ ## Phase 5 — Review (spawned worker, Opus 5.5 medium)
52
+ O: Code pattern? U: none. Findings (P0–P3 ladder, each P0–P2 anchored file:line + verbatim quote):
53
+ P1 T2 no pagination — services/notification_list.ts:88 — O spot-checks: Reads line 88, quote matches ✓ → asks user, U: fix it
54
+ · P3 email_digest naming ×2 · 12 tests added. (An unanchored finding would be auto-P3 — never fixed unasked.)
55
+
56
+ ## Phase 6 — Verify (spawned worker, Opus 5.5 medium; criteria = definition-of-done)
57
+ criteria[] with per-line evidence: bell ✓ (test name) · both schedules ✗ (weekly cron missing = P0, unmet criterion, evidence: no cron entry in scheduler.ts) · prefs ✓ → FAILED → quote spot-check ✓ → P0 auto-fix (single attempt, no ask) → re-verify → PASSED. 14/14.
58
+
59
+ ## Phase 7 — Summary
60
+ O: 6 tasks/3 waves/6 spawns/1 pause/1 fresh-session resume · 1 needs_context · 1 escalation · verify fixed_then_passed · branch green. P2 fix-batch: none · Apply the 2 P3 cosmetics? U: no.
61
+ O: review close → `orc gotcha observe` ×3 (P1 addressed · 2× P3 wontfix, each with `run`) → `FINDING-OUTCOME addressed=1 disputed=0 wontfix=2 open=0 pre=0 suppressed=0 :: functional.check:1/1,evolvability.documentation:0/2`
62
+
63
+ ## Phase 8 — Ship (orc-pr, reads pr.md)
64
+ O: Branch: feat/notifications. Commit? Push? PR? U: yes all.
65
+ O: Ticket/title/target? U: DRP-482 / Add merchant notification system / develop
66
+ O: ✓ committed → pushed → run/merchant-notifications/DRP-482-add-merchant-notification-system.md from pr.md (base develop).
67
+ Log deleted · checkpoint + dispatch log KEPT · completion dispatch report shown → "Run /usage to see your remaining limits."
68
+
69
+ ## What this exercises
70
+ always-spawn (even cheap tasks get a subagent) · facet-scored arithmetic · 5-band ladder ·
71
+ per-run folder run/merchant-notifications/ · usage reminder (no programmatic /usage) ·
72
+ planner grounding spot-check catching a hallucinated path · executor evidence (verbatim
73
+ build/test proof) · reviewer quote spot-check before any P0/P1 action ·
74
+ definition-of-done catching the weekly-cron gap · needs_context resolved internally · fresh-session resume.