@azure-id/orc 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +151 -0
  2. package/README.md +84 -34
  3. package/bin/cli.js +1110 -0
  4. package/bin/verify-contracts.js +112 -1
  5. package/bin/verify-package.js +568 -563
  6. package/bin/webui/api.js +15 -0
  7. package/bin/webui/app.html +210 -207
  8. package/bin/webui/css/panels/wait.css +123 -0
  9. package/bin/webui/fixtures/index.js +7 -0
  10. package/bin/webui/fixtures/wait.js +97 -0
  11. package/bin/webui/i18n/en/nav.json +21 -20
  12. package/bin/webui/i18n/en/wait.json +41 -0
  13. package/bin/webui/i18n/id/nav.json +21 -20
  14. package/bin/webui/i18n/id/wait.json +41 -0
  15. package/bin/webui/js/01-i18n.js +151 -150
  16. package/bin/webui/js/panels/wait.js +253 -0
  17. package/package.json +1 -1
  18. package/templates/commands/orc-wait.md +19 -0
  19. package/templates/hooks/orc-statusline.js +227 -1
  20. package/templates/skills/_shared/phases/execution.md +2 -0
  21. package/templates/skills/_shared/phases/preflight.md +22 -0
  22. package/templates/skills/_shared/return-validation.md +222 -145
  23. package/templates/skills/_shared/wait.md +240 -0
  24. package/templates/skills/orc/SKILL.md +247 -238
  25. package/templates/skills/orc-aftermath/SKILL.md +6 -1
  26. package/templates/skills/orc-analyze/SKILL.md +6 -1
  27. package/templates/skills/orc-boundary/SKILL.md +6 -1
  28. package/templates/skills/orc-brainstorm/SKILL.md +6 -1
  29. package/templates/skills/orc-budget/SKILL.md +6 -1
  30. package/templates/skills/orc-challenge/SKILL.md +6 -1
  31. package/templates/skills/orc-claude/SKILL.md +6 -1
  32. package/templates/skills/orc-diy/SKILL.md +6 -1
  33. package/templates/skills/orc-doc/SKILL.md +490 -481
  34. package/templates/skills/orc-explain/SKILL.md +5 -0
  35. package/templates/skills/orc-export/SKILL.md +5 -0
  36. package/templates/skills/orc-fast/SKILL.md +222 -215
  37. package/templates/skills/orc-grill/SKILL.md +6 -1
  38. package/templates/skills/orc-learn/SKILL.md +6 -1
  39. package/templates/skills/orc-mini/SKILL.md +252 -244
  40. package/templates/skills/orc-pact/SKILL.md +6 -1
  41. package/templates/skills/orc-pattern/SKILL.md +6 -1
  42. package/templates/skills/orc-poly/SKILL.md +6 -1
  43. package/templates/skills/orc-quick/SKILL.md +353 -346
  44. package/templates/skills/orc-retro/SKILL.md +6 -1
  45. package/templates/skills/orc-route/SKILL.md +6 -1
  46. package/templates/skills/orc-verify/SKILL.md +6 -1
  47. package/templates/skills/orc-wait/SKILL.md +163 -0
  48. package/templates/skills/orc-wiki/SKILL.md +180 -171
@@ -1,244 +1,252 @@
1
- ---
2
- name: orc-mini
3
- description: >
4
- Lightweight ORC for fast implementation. Use for
5
- "use orc-mini to implement X" or "/orc-mini". Same
6
- intake → intent-spec → planning → dispatch → smoke-gate → ship spine as the full
7
- orchestrator, but SKIPS full code review, verification, and the summary phase.
8
- Dispatches ONE Sonnet 5 high-effort subagent for implementation, then runs a
9
- build+test smoke gate (blocks ship on red) and offers opt-in test authoring.
10
- Switchable to full flow mid-run. The orchestrator never implements — it spawns.
11
- ---
12
-
13
- # ORC-MINI
14
-
15
- A trimmed orchestrator for when you want speed over the full quality pipeline.
16
- Everything in the main spine (`../orc/SKILL.md`) applies EXCEPT the
17
- differences below. Load the main skill's references and schemas by path — the
18
- HOT-PATH essentials (dispatch names, return-contract fields, artifact path)
19
- are inlined here so nothing is reconstructed from "full minus deltas."
20
-
21
- Run as **Opus 4.8 high**, or Opus 5 / Fable 5 at medium+ (as full; never downgrade).
22
- **You never implement — you spawn.** The one exception is the **smoke gate**:
23
- a read-only build+test run, not implementation — you still never write code.
24
-
25
- **Worked example** (orient only — never execute from it): `examples/mini-run-mock.md`.
26
-
27
- ## Differences from the full orchestrator
28
-
29
- 1. **Skip full Phase 5 (Review), Phase 6 (Verify), and Phase 7 (Summary).**
30
- Instead: the **smoke gate** after execution, then the opt-in
31
- **test-authoring ask**, then ship.
32
- 2. **Implementation is ONE subagent, Sonnet 5, high effort.** No waves. **No
33
- scoring table** — replace it with a **one-line complexity read** (mini-ok?
34
- or recommend switching to full); log that line, never render the matrix.
35
- 3. **No dispatch-style and no batch-pause questions** — a single subagent
36
- makes both meaningless; never ask them.
37
- 4. **Lighter intake.** Ask only the **Always + medium tier** (Q1–Q4 in
38
- `../_shared/phases/intake.md`); skip the high tier (Q5/Q6). Run the Step
39
- 3.5 repo cross-check at NAMES-ONLY depth (Glob/Grep-confirm what the draft
40
- names, tag the rest `UNVERIFIED`, resolve tags in the sign-off line; >3
41
- tags → recommend the full flow or `orc-analyze`). Sign-off **defaults to
42
- SOFT**, not GATE.
43
- 5. **Still write tests** if the project has a test setup (the executor
44
- creates/updates them in its task).
45
- 6. **Everything else is identical:** run folder + intent-spec, planning,
46
- checkpoint/state-of-play, stop sequence, usage reminder, ship flow.
47
-
48
- ## Mini flow (the phase set)
49
-
50
- ```
51
- Phase 0 intake (Q1–Q4, soft sign-off) + run folder + intent-spec
52
- Phase 1 planning (dispatch orc-planner-mini; analyst first only on real docs)
53
- → one-line complexity read (mini-ok? or recommend switch-to-full)
54
- Phase 3 dispatch ONE executor (orc-executor-sonnet-5-high) — slice carries
55
- the standing `house_rules` card (../_shared/phases/house-rules.md,
56
- injected literally) + the cached `postgres` pattern on a data-access
57
- task (cache HIT only) — collect + validate return
58
- Phase M SMOKE GATE — run build+test → GREEN proceed · RED block ship + surface
59
- Phase X MOCK EXAMPLE (config mock_example) — offer/build after a GREEN gate
60
- Phase T TEST-AUTHORING ASK (opt-in) — offer to write test cases (never run them)
61
- Phase 8 ship (commit / push / PR — never stages mock-examples/)
62
- ```
63
- (No Phase 2 scoring table, no dispatch-style/batch-pause asks, no full
64
- review/verify/summary.)
65
-
66
- **Postgres query grounding.** On a Postgres project, if the task touches the
67
- data-access layer AND `orc pattern status postgres` reports cached (the
68
- deterministic probe in `../_shared/detecting-artifacts.md`, never an ad-hoc
69
- `find` for `.claude/orc/patterns/postgres-pattern.md`), inject it LITERALLY into
70
- the slice (conventions + blocking query invariants).
71
- Cache MISS → skip — mini never codifies (that's the full lane /
72
- `/orc-pattern`); universal invariants + neighbor imitation still cover it.
73
-
74
- **Gotchas (repair memory; config `gotchas`) — mini READS and WRITES.** Probe at
75
- Phase 1 (`orc gotcha status`, one row, never silent), inject the SCOPE-MATCHING
76
- entries into the Phase 3 slice (cap 3; zero matches = no block, never
77
- unfiltered), and append a returned `gotcha_recorded` YOURSELF after the return.
78
- Trimmed mechanics + `.claude/orc/gotchas.md`: `../_shared/gotchas.md` §10.
79
-
80
- ## Phase M — Smoke gate (build + test; blocks ship on red)
81
-
82
- After the executor return validates (`../_shared/return-validation.md` —
83
- including `done` with non-empty `unmet[]` = partial, and §6's worktree delta: a path changed outside `declared_files` is a violation whatever the return said), YOU run the smoke gate
84
- per `../_shared/smoke-gate.md`: read-only build+test. **GREEN** →
85
- test-authoring ask, then ship. **RED** → never offer commit/ship; one repair
86
- re-dispatch, second red → STOP and surface. Docs-only → gate N/A, say so.
87
-
88
- ## Phase X Mock example + drift recovery (config `mock_example`, default ask)
89
-
90
- Canonical: `../_shared/drift-recovery.md` — load it when the phase fires. After
91
- a GREEN Phase M, before ship: `ask` MANDATORY offer (never silently
92
- skipped/run) · `on` → build · `off` → skip. Deliverable
93
- `mock-examples/<change-slug>/` at project root (EXAMPLE.md + one runnable
94
- mocked artifact) **never committed, never staged** (no `.gitignore` edit).
95
- One question after the user runs it: matches expectation? [yes / drift:
96
- <describe>]. Drift → `DRIFT-FROM` handoff (gap analysis patch plan → dispatch
97
- re-gate → re-offer), hard cap 2 loops, then an honest unresolved report.
98
- Trace: `PHASE mock-example`, `DRIFT loop=<n>`.
99
-
100
- ## Phase T — Test-authoring ask (opt-in; writes tests, never runs them)
101
-
102
- Same opt-in as full Phase 6.5 — mini **only asks** (never gates the ship).
103
- Default from `config.generate_tests`; at the end of a GREEN run ask: *"Write
104
- test cases for these changes? (I'll author them — automated files +
105
- TEST-PLAN.md + a curl bundle for HTTP APIs but never run them; you test
106
- manually.)"* Yes dispatch `orc-test-author-opus-5-med` (subskill
107
- `../orc/subskills/orc-testgen/`) with the run's `actual_files`,
108
- definition-of-done, touched flows, constraints, stack; the two manual
109
- deliverables land in **`test-generator/<change-slug>/` at the project root**.
110
- Validate the returned `test_plan_path`/`curl_bundle_path` are under that folder
111
- (else malformed re-dispatch); relay + state the exact path (committed on ship,
112
- not gitignored). No ship. Either way this NEVER runs tests.
113
-
114
- ## Behavior trace (always on)
115
-
116
- `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases` names
117
- the file and the layers). Lane token `mini`, tier **Build lanes** —
118
- per phase, batched to **3 packets** (intake+plan · execution · ship), each
119
- paired with the next phase's first dispatch.
120
- At run start write `log_dir/.current` = `run-mini-<slug>-<DDMMYY>-<HHMMSS>.txt` AND
121
- `touch the trace file` of that name in the SAME step.
122
- Nothing else about the protocol is restated here; a phase that ends with
123
- `zero new trace lines is a protocol violation`.
124
-
125
- Mini does NOT drop the trace. `OUTCOME band=mini` per task.
126
-
127
- ## Complexity read (replaces the scoring table)
128
-
129
- ONE judgment before dispatch: is this genuinely mini-sized (single coherent
130
- area, low interdependency, low blast radius)? State it in one line and log it.
131
- Complex/high-risk (many interdependencies, core/shared surface,
132
- security-sensitive) **recommend switching to full** let the user choose.
133
-
134
- ## Fallback intake (arriving from orc-fast)
135
-
136
- orc-fast falls back HERE whenever its prerequisites fail — never by stopping
137
- the chat. Follow the reader side of `../_shared/fallback-handoff.md`: the
138
- `FALLBACK-FROM` block in the shared run folder names the reason; acknowledge
139
- it in one line, skip re-deriving whatever is carried, reuse the run folder.
140
-
141
- ## Switching to full flow mid-run
142
-
143
- On "switch to full" (or when the complexity read / a mid-run surprise clearly
144
- needs review/verify): the run folder, checkpoint, and intent-spec already live
145
- in the shared `.claude/orc/run/{run-slug}/` format, so the full flow resumes from
146
- the current checkpoint and adds the phases mini skipped. Record the switch in
147
- the decision log.
148
-
149
- ## Dispatch via named agents (canonical name-map dispatch BY these names)
150
-
151
- Models pinned in `.claude/agents/`; look up here, never reconstruct a name (agent = skill-name + model-effort suffix). See `.claude/agents/MODEL-MAPPING.md`. `opus5_only: true` FORCES the right column and needs an Opus 5 main session — mini's cheap-lane premise is off while it is on (`../_shared/opus5-only.md`).
152
-
153
- **Extra (`extra_enabled`, `../_shared/extra-dispatch.md`):** mini's ONE executor may run off Claude. It has no score, so resolve the pinned executor's **BAND, both edges, and require them to agree** — a partially covering row keeps the run on Claude and the preflight says so. Print the `extra:` line at intake whenever the gate is on (P0: `a lane that sends work off Claude without saying so`); dispatch via `orc extra dispatch --task <file> --json` with the IDENTICAL slice; validate with `return-validation.md` **§2b, not §2** (⛔ SUBSTITUTION replaces the downgrade check); a failure runs `orc extra reconcile <task_id>` FIRST — a worktree that moved is RESUMED, never re-done — then falls back to the pinned Claude agent, announced. A cited-risk change never leaves Claude (`extra_risk_tasks`, default `off`) — and mini's complexity read is not a substitute for that gate.
154
-
155
- | Role | Agent (dispatch this) | Model / effort | When `opus5_only` |
156
- |------|-----------------------|----------------|-------------------|
157
- | mini analysis (docs only) | `orc-analyze-mini-sonnet-5-high` | claude-sonnet-5 / high | `orc-analyze-mini-opus-5-med` |
158
- | mini planning | `orc-planner-mini-sonnet-5-high` | claude-sonnet-5 / high | `orc-planner-mini-opus-5-med` |
159
- | mini execution | `orc-executor-sonnet-5-high` | claude-sonnet-5 / high | `orc-executor-opus-5-low` |
160
- | test authoring (opt-in) | `orc-test-author-opus-5-med` | claude-opus-5 / medium | unchanged |
161
-
162
- ## Config
163
-
164
- **ONE resolver, and it is not you:** `orc lane config orc-mini --json`. Obey
165
- `effective`, print every line in `announce[]` VERBATIM at preflight, and honour
166
- `stops[]` before wave 1. Never re-derive a value, a precedence or an inertness
167
- from `.claude/orc.config.yaml` a key this lane does not read is not in the
168
- answer, and a key another key shadows comes back already marked. Exit ≠ 0 → say
169
- the CLI is unavailable and fall back to `../_shared/config-precedence.md`'s
170
- documented defaults, out loud. Priorities and families:
171
- `../_shared/config-precedence.md`.
172
-
173
- Wave/scoring/scout keys never apply to mini — and they are not in the answer,
174
- so there is nothing to render or ask.
175
-
176
- ## Calls
177
-
178
- **ONE catalogue, and it is not you:** `orc lane calls orc-mini --json` names every
179
- CLI call this lane makes, each with its exit-code contract, its cost, when to run
180
- it, and what an EMPTY answer means. Never invent a spelling, never re-word an
181
- exit code, and never re-derive a state word the CLI's state words are the only
182
- state words, and **an exit code is an ANSWER wherever that contract says so, not
183
- a failure**. A call the answer does not name is a call this lane does not make.
184
- Exit 0 from the catalogue itself say the CLI is unavailable and name the
185
- command you are about to run, out loud, before running it.
186
-
187
- ## TDD (ONE intake question mini's whole TDD policy)
188
-
189
- At intake ask once:
190
- *"Anchor this in plan-time acceptance tests (TDD red tests first, implement
191
- to green)? [yes/no]"*. Yes → the planner slice carries `tdd: on` (the mini
192
- planner authors `tdd_spec` per requirement, **scoped by the same `disposition` set the full lane uses** — `new-surface | behavior-change | covered-by-existing | no-behavior | no-runner`, derived from the `facets`, same safety floor: a cited `risk[]` is never scoped out, so a constant or a translation string gets no test but an auth change always does). Mini keeps its SINGLE executor — no paired TDD task; that executor materializes the failing tests FIRST, then implements to green
193
- (implement→test→repair, cap `tdd_loop_max`; emit `TDD-RED`/`TDD-GREEN` per
194
- iteration; cap hitSTOP + honest red report), and Phase M's smoke gate runs
195
- the TDD suite as part of build+test. Scoped-out requirements are named with their
196
- reason at preflight — never silent. No skip entirely; never re-ask.
197
-
198
- ## Analyst & planner (mini lane)
199
-
200
- orc-mini dispatches the FAST variants (Sonnet 5 high): `orc-analyze-mini` and
201
- `orc-planner-mini` same artifacts and output contracts as full, trimmed
202
- depth. The mini analyst is **doc-optional**: on real doc input it runs first,
203
- then the mini planner; on a merely ambiguous request, prefer one inline
204
- clarifying question over a cold analyst spawn. Always single-pass — **no deep
205
- mode, no scouts**; it escalates to `/orc-analyze` deep on its concrete
206
- thresholds and the user chooses. You never analyze or plan yourself.
207
-
208
- **Mini-lane gates (yours, deterministic same as full; full detail in
209
- `../_shared/phases/analyst-gates.md`; emit `GATE` trace lines).** On
210
- mini-analyst return: evidence spot-check + derivation lint; refuse
211
- take-into-build on open `UNVERIFIED`/missing `scope_closed`; `git_head`
212
- HEAD at plan time re-run the spot-check first. On mini-planner return: Glob
213
- every `disposition: exists` path, recompute coverage (no orphan
214
- requirements), cycle + collision checks. Any miss → bounce (one retry, then
215
- escalate). At dispatch, append the task's `spec_invariants` to the slice's
216
- `constraints[]` verbatim.
217
-
218
- ## Wiki consult (if present)
219
-
220
- Same rule as the full skill — load `../_shared/phases/wiki-consult.md` at the
221
- planning/complexity-read step: compute the FRESH / AGING / STALE tier from
222
- `.claude/orc/wiki-meta.json`, pull the relevant pages (incl. cross-cutting
223
- maps like `orc-reference-api-surface` when their domain applies), apply
224
- `code > fresh wiki > stale wiki (hints) > model priors`, and **emit
225
- `WIKI-CONSULT <tier> :: docs=<pages pulled>`**. Crosslink: a task touching a
226
- boundary in `.claude/orc/crosslink/needs.json` gets the cached contract
227
- injected per that reference advisory, never blocking. Mini never generates
228
- the wiki; after a code-changing run apply the passive stale-flag note only
229
- (the post-ship refresh ASK is full-lane/ultra behavior).
230
-
231
- ## Shared artifacts
232
-
233
- Writes to the SAME location as the full skill
234
- (`.claude/orc/run/{run-slug}/`) a switch needs no migration.
235
-
236
- ## What mini still enforces (from the main hard rules)
237
-
238
- Never implement yourself (the smoke gate is read-only, not implementation) ·
239
- all RUN-STATE artifacts in the run subfolder, never project root (the one
240
- exception is the opt-in `test-generator/<change-slug>/` self-QA deliverable,
241
- which lands at the project root by design) · validate every
242
- subagent return (malformed = failure) · report the dispatch log + remind the
243
- user to run `/usage` (never invoke it programmatically) · **never offer commit
244
- on a red build** (enforced by Phase M).
1
+ ---
2
+ name: orc-mini
3
+ description: >
4
+ Lightweight ORC for fast implementation. Use for
5
+ "use orc-mini to implement X" or "/orc-mini". Same
6
+ intake → intent-spec → planning → dispatch → smoke-gate → ship spine as the full
7
+ orchestrator, but SKIPS full code review, verification, and the summary phase.
8
+ Dispatches ONE Sonnet 5 high-effort subagent for implementation, then runs a
9
+ build+test smoke gate (blocks ship on red) and offers opt-in test authoring.
10
+ Switchable to full flow mid-run. The orchestrator never implements — it spawns.
11
+ ---
12
+
13
+ # ORC-MINI
14
+
15
+ A trimmed orchestrator for when you want speed over the full quality pipeline.
16
+ Everything in the main spine (`../orc/SKILL.md`) applies EXCEPT the
17
+ differences below. Load the main skill's references and schemas by path — the
18
+ HOT-PATH essentials (dispatch names, return-contract fields, artifact path)
19
+ are inlined here so nothing is reconstructed from "full minus deltas."
20
+
21
+ Run as **Opus 4.8 high**, or Opus 5 / Fable 5 at medium+ (as full; never downgrade).
22
+ **You never implement — you spawn.** The one exception is the **smoke gate**:
23
+ a read-only build+test run, not implementation — you still never write code.
24
+
25
+ **Worked example** (orient only — never execute from it): `examples/mini-run-mock.md`.
26
+
27
+ ## Differences from the full orchestrator
28
+
29
+ 1. **Skip full Phase 5 (Review), Phase 6 (Verify), and Phase 7 (Summary).**
30
+ Instead: the **smoke gate** after execution, then the opt-in
31
+ **test-authoring ask**, then ship.
32
+ 2. **Implementation is ONE subagent, Sonnet 5, high effort.** No waves. **No
33
+ scoring table** — replace it with a **one-line complexity read** (mini-ok?
34
+ or recommend switching to full); log that line, never render the matrix.
35
+ 3. **No dispatch-style and no batch-pause questions** — a single subagent
36
+ makes both meaningless; never ask them.
37
+ 4. **Lighter intake.** Ask only the **Always + medium tier** (Q1–Q4 in
38
+ `../_shared/phases/intake.md`); skip the high tier (Q5/Q6). Run the Step
39
+ 3.5 repo cross-check at NAMES-ONLY depth (Glob/Grep-confirm what the draft
40
+ names, tag the rest `UNVERIFIED`, resolve tags in the sign-off line; >3
41
+ tags → recommend the full flow or `orc-analyze`). Sign-off **defaults to
42
+ SOFT**, not GATE.
43
+ 5. **Still write tests** if the project has a test setup (the executor
44
+ creates/updates them in its task).
45
+ 6. **Everything else is identical:** run folder + intent-spec, planning,
46
+ checkpoint/state-of-play, stop sequence, usage reminder, ship flow.
47
+
48
+ ## Mini flow (the phase set)
49
+
50
+ ```
51
+ Phase 0 intake (Q1–Q4, soft sign-off) + run folder + intent-spec
52
+ Phase 1 planning (dispatch orc-planner-mini; analyst first only on real docs)
53
+ → one-line complexity read (mini-ok? or recommend switch-to-full)
54
+ Phase 3 dispatch ONE executor (orc-executor-sonnet-5-high) — slice carries
55
+ the standing `house_rules` card (../_shared/phases/house-rules.md,
56
+ injected literally) + the cached `postgres` pattern on a data-access
57
+ task (cache HIT only) — collect + validate return
58
+ Phase M SMOKE GATE — run build+test → GREEN proceed · RED block ship + surface
59
+ Phase X MOCK EXAMPLE (config mock_example) — offer/build after a GREEN gate
60
+ Phase T TEST-AUTHORING ASK (opt-in) — offer to write test cases (never run them)
61
+ Phase 8 ship (commit / push / PR — never stages mock-examples/)
62
+ ```
63
+ (No Phase 2 scoring table, no dispatch-style/batch-pause asks, no full
64
+ review/verify/summary.)
65
+
66
+ **Postgres query grounding.** On a Postgres project, if the task touches the
67
+ data-access layer AND `orc pattern status postgres` reports cached (the
68
+ deterministic probe in `../_shared/detecting-artifacts.md`, never an ad-hoc
69
+ `find` for `.claude/orc/patterns/postgres-pattern.md`), inject it LITERALLY into
70
+ the slice (conventions + blocking query invariants).
71
+ Cache MISS → skip — mini never codifies (that's the full lane /
72
+ `/orc-pattern`); universal invariants + neighbor imitation still cover it.
73
+
74
+ **Gotchas (repair memory; config `gotchas`) — mini READS and WRITES.** Probe at
75
+ Phase 1 (`orc gotcha status`, one row, never silent), inject the SCOPE-MATCHING
76
+ entries into the Phase 3 slice (cap 3; zero matches = no block, never
77
+ unfiltered), and append a returned `gotcha_recorded` YOURSELF after the return.
78
+ Trimmed mechanics + `.claude/orc/gotchas.md`: `../_shared/gotchas.md` §10.
79
+
80
+ ## Phase M — Smoke gate (build + test; blocks ship on red)
81
+
82
+ After the executor return validates (`../_shared/return-validation.md` —
83
+ including `done` with non-empty `unmet[]` = partial, and §6's worktree delta: a path changed outside `declared_files` is a violation whatever the return said), YOU run the smoke gate
84
+ per `../_shared/smoke-gate.md`: read-only build+test. **GREEN** →
85
+ test-authoring ask, then ship. **RED** → never offer commit/ship; one repair
86
+ re-dispatch, second red → STOP and surface. Docs-only → gate N/A, say so.
87
+ `orc run inflight` FIRST — exit 2 REFUSES, because
88
+ `a lane that re-dispatches over a live attempt` has broken the contract
89
+ (`../_shared/return-validation.md` §0).
90
+
91
+ ## Phase X Mock example + drift recovery (config `mock_example`, default ask)
92
+
93
+ Canonical: `../_shared/drift-recovery.md` load it when the phase fires. After
94
+ a GREEN Phase M, before ship: `ask` → MANDATORY offer (never silently
95
+ skipped/run) · `on` build · `off` skip. Deliverable
96
+ `mock-examples/<change-slug>/` at project root (EXAMPLE.md + one runnable
97
+ mocked artifact) **never committed, never staged** (no `.gitignore` edit).
98
+ One question after the user runs it: matches expectation? [yes / drift:
99
+ <describe>]. Drift → `DRIFT-FROM` handoff (gap analysis → patch plan → dispatch
100
+ re-gate re-offer), hard cap 2 loops, then an honest unresolved report.
101
+ Trace: `PHASE mock-example`, `DRIFT loop=<n>`.
102
+
103
+ ## Phase T Test-authoring ask (opt-in; writes tests, never runs them)
104
+
105
+ Same opt-in as full Phase 6.5 mini **only asks** (never gates the ship).
106
+ Default from `config.generate_tests`; at the end of a GREEN run ask: *"Write
107
+ test cases for these changes? (I'll author them — automated files +
108
+ TEST-PLAN.md + a curl bundle for HTTP APIs — but never run them; you test
109
+ manually.)"* Yes dispatch `orc-test-author-opus-5-med` (subskill
110
+ `../orc/subskills/orc-testgen/`) with the run's `actual_files`,
111
+ definition-of-done, touched flows, constraints, stack; the two manual
112
+ deliverables land in **`test-generator/<change-slug>/` at the project root**.
113
+ Validate the returned `test_plan_path`/`curl_bundle_path` are under that folder
114
+ (else malformed re-dispatch); relay + state the exact path (committed on ship,
115
+ not gitignored). No → ship. Either way this NEVER runs tests.
116
+
117
+ ## Behavior trace (always on)
118
+
119
+ `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases` names
120
+ the file and the layers). Lane token `mini`, tier **Build lanes** —
121
+ per phase, batched to **3 packets** (intake+plan · execution · ship), each
122
+ paired with the next phase's first dispatch.
123
+ At run start write `log_dir/.current` = `run-mini-<slug>-<DDMMYY>-<HHMMSS>.txt` AND
124
+ `touch the trace file` of that name in the SAME step.
125
+ Nothing else about the protocol is restated here; a phase that ends with
126
+ `zero new trace lines is a protocol violation`.
127
+
128
+ Mini does NOT drop the trace. `OUTCOME … band=mini` per task.
129
+
130
+ ## Complexity read (replaces the scoring table)
131
+
132
+ ONE judgment before dispatch: is this genuinely mini-sized (single coherent
133
+ area, low interdependency, low blast radius)? State it in one line and log it.
134
+ Complex/high-risk (many interdependencies, core/shared surface,
135
+ security-sensitive) → **recommend switching to full** — let the user choose.
136
+
137
+ ## Fallback intake (arriving from orc-fast)
138
+
139
+ orc-fast falls back HERE whenever its prerequisites fail never by stopping
140
+ the chat. Follow the reader side of `../_shared/fallback-handoff.md`: the
141
+ `FALLBACK-FROM` block in the shared run folder names the reason; acknowledge
142
+ it in one line, skip re-deriving whatever is carried, reuse the run folder.
143
+
144
+ ## Switching to full flow mid-run
145
+
146
+ On "switch to full" (or when the complexity read / a mid-run surprise clearly
147
+ needs review/verify): the run folder, checkpoint, and intent-spec already live
148
+ in the shared `.claude/orc/run/{run-slug}/` format, so the full flow resumes from
149
+ the current checkpoint and adds the phases mini skipped. Record the switch in
150
+ the decision log.
151
+
152
+ ## Dispatch via named agents (canonical name-map — dispatch BY these names)
153
+
154
+ Models pinned in `.claude/agents/`; look up here, never reconstruct a name (agent = skill-name + model-effort suffix). See `.claude/agents/MODEL-MAPPING.md`. `opus5_only: true` FORCES the right column and needs an Opus 5 main session — mini's cheap-lane premise is off while it is on (`../_shared/opus5-only.md`).
155
+
156
+ **Extra (`extra_enabled`, `../_shared/extra-dispatch.md`):** mini's ONE executor may run off Claude. It has no score, so resolve the pinned executor's **BAND, both edges, and require them to agree** — a partially covering row keeps the run on Claude and the preflight says so. Print the `extra:` line at intake whenever the gate is on (P0: `a lane that sends work off Claude without saying so`); dispatch via `orc extra dispatch --task <file> --json` with the IDENTICAL slice; validate with `return-validation.md` **§2b, not §2** (⛔ SUBSTITUTION replaces the downgrade check); a failure runs `orc extra reconcile <task_id>` FIRST — a worktree that moved is RESUMED, never re-done — then falls back to the pinned Claude agent, announced. A cited-risk change never leaves Claude (`extra_risk_tasks`, default `off`) — and mini's complexity read is not a substitute for that gate.
157
+
158
+ | Role | Agent (dispatch this) | Model / effort | When `opus5_only` |
159
+ |------|-----------------------|----------------|-------------------|
160
+ | mini analysis (docs only) | `orc-analyze-mini-sonnet-5-high` | claude-sonnet-5 / high | `orc-analyze-mini-opus-5-med` |
161
+ | mini planning | `orc-planner-mini-sonnet-5-high` | claude-sonnet-5 / high | `orc-planner-mini-opus-5-med` |
162
+ | mini execution | `orc-executor-sonnet-5-high` | claude-sonnet-5 / high | `orc-executor-opus-5-low` |
163
+ | test authoring (opt-in) | `orc-test-author-opus-5-med` | claude-opus-5 / medium | unchanged |
164
+
165
+ ## Config
166
+
167
+ **ONE resolver, and it is not you:** `orc lane config orc-mini --json`. Obey
168
+ `effective`, print every line in `announce[]` VERBATIM at preflight, and honour
169
+ `stops[]` before wave 1. Never re-derive a value, a precedence or an inertness
170
+ from `.claude/orc.config.yaml` a key this lane does not read is not in the
171
+ answer, and a key another key shadows comes back already marked. Exit ≠ 0 → say
172
+ the CLI is unavailable and fall back to `../_shared/config-precedence.md`'s
173
+ documented defaults, out loud. Priorities and families:
174
+ `../_shared/config-precedence.md`.
175
+
176
+ Wave/scoring/scout keys never apply to mini — and they are not in the answer,
177
+ so there is nothing to render or ask.
178
+
179
+ ## Calls
180
+
181
+ **ONE catalogue, and it is not you:** `orc lane calls orc-mini --json` names every
182
+ CLI call this lane makes, each with its exit-code contract, its cost, when to run
183
+ it, and what an EMPTY answer means. Never invent a spelling, never re-word an
184
+ exit code, and never re-derive a state word the CLI's state words are the only
185
+ state words, and **an exit code is an ANSWER wherever that contract says so, not
186
+ a failure**. A call the answer does not name is a call this lane does not make.
187
+ Exit 0 from the catalogue itself say the CLI is unavailable and name the
188
+ command you are about to run, out loud, before running it.
189
+
190
+ ## TDD (ONE intake questionmini's whole TDD policy)
191
+
192
+ At intake ask once:
193
+ *"Anchor this in plan-time acceptance tests (TDD — red tests first, implement
194
+ to green)? [yes/no]"*. Yes the planner slice carries `tdd: on` (the mini
195
+ planner authors `tdd_spec` per requirement, **scoped by the same `disposition` set the full lane uses** — `new-surface | behavior-change | covered-by-existing | no-behavior | no-runner`, derived from the `facets`, same safety floor: a cited `risk[]` is never scoped out, so a constant or a translation string gets no test but an auth change always does). Mini keeps its SINGLE executor — no paired TDD task; that executor materializes the failing tests FIRST, then implements to green
196
+ (implementtest→repair, cap `tdd_loop_max`; emit `TDD-RED`/`TDD-GREEN` per
197
+ iteration; cap hit → STOP + honest red report), and Phase M's smoke gate runs
198
+ the TDD suite as part of build+test. Scoped-out requirements are named with their
199
+ reason at preflight — never silent. No → skip entirely; never re-ask.
200
+
201
+ ## Analyst & planner (mini lane)
202
+
203
+ orc-mini dispatches the FAST variants (Sonnet 5 high): `orc-analyze-mini` and
204
+ `orc-planner-mini` same artifacts and output contracts as full, trimmed
205
+ depth. The mini analyst is **doc-optional**: on real doc input it runs first,
206
+ then the mini planner; on a merely ambiguous request, prefer one inline
207
+ clarifying question over a cold analyst spawn. Always single-pass — **no deep
208
+ mode, no scouts**; it escalates to `/orc-analyze` deep on its concrete
209
+ thresholds and the user chooses. You never analyze or plan yourself.
210
+
211
+ **Mini-lane gates (yours, deterministic same as full; full detail in
212
+ `../_shared/phases/analyst-gates.md`; emit `GATE` trace lines).** On
213
+ mini-analyst return: evidence spot-check + derivation lint; refuse
214
+ take-into-build on open `UNVERIFIED`/missing `scope_closed`; `git_head`
215
+ HEAD at plan time → re-run the spot-check first. On mini-planner return: Glob
216
+ every `disposition: exists` path, recompute coverage (no orphan
217
+ requirements), cycle + collision checks. Any miss → bounce (one retry, then
218
+ escalate). At dispatch, append the task's `spec_invariants` to the slice's
219
+ `constraints[]` verbatim.
220
+
221
+ ## Wiki consult (if present)
222
+
223
+ Same rule as the full skill load `../_shared/phases/wiki-consult.md` at the
224
+ planning/complexity-read step: compute the FRESH / AGING / STALE tier from
225
+ `.claude/orc/wiki-meta.json`, pull the relevant pages (incl. cross-cutting
226
+ maps like `orc-reference-api-surface` when their domain applies), apply
227
+ `code > fresh wiki > stale wiki (hints) > model priors`, and **emit
228
+ `WIKI-CONSULT <tier> :: docs=<pages pulled>`**. Crosslink: a task touching a
229
+ boundary in `.claude/orc/crosslink/needs.json` gets the cached contract
230
+ injected per that reference — advisory, never blocking. Mini never generates
231
+ the wiki; after a code-changing run apply the passive stale-flag note only
232
+ (the post-ship refresh ASK is full-lane/ultra behavior).
233
+
234
+ ## Shared artifacts
235
+
236
+ Writes to the SAME location as the full skill
237
+ (`.claude/orc/run/{run-slug}/`) — a switch needs no migration.
238
+
239
+ ## What mini still enforces (from the main hard rules)
240
+
241
+ Never implement yourself (the smoke gate is read-only, not implementation) ·
242
+ all RUN-STATE artifacts in the run subfolder, never project root (the one
243
+ exception is the opt-in `test-generator/<change-slug>/` self-QA deliverable,
244
+ which lands at the project root by design) · validate every
245
+ subagent return (malformed = failure) · report the dispatch log + remind the
246
+ user to run `/usage` (never invoke it programmatically) · **never offer commit
247
+ on a red build** (enforced by Phase M).
248
+
249
+ ## Waiting mid-run (`/orc-wait`)
250
+
251
+ Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
252
+ Checkpoint **full** · safe point **after the executor returns**. `soft` FORCES that checkpoint and does NOT stop if the write fails; `hard` skips it and can lose an in-flight return. Never begin a wait between a dispatch and its validated return, or before the smoke gate has reported.
@@ -247,4 +247,9 @@ exit code, and never re-derive a state word — the CLI's state words are the on
247
247
  state words, and **an exit code is an ANSWER wherever that contract says so, not
248
248
  a failure**. A call the answer does not name is a call this lane does not make.
249
249
  Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
250
- command you are about to run, out loud, before running it.
250
+ command you are about to run, out loud, before running it.
251
+
252
+ ## Waiting mid-run (`/orc-wait`)
253
+
254
+ Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
255
+ Checkpoint **none** · safe point **read-only, seconds long**. Nothing here to checkpoint, so all three modes behave identically — say so rather than asking. Never begin a wait between a dispatch and its validated return, or before the smoke gate has reported.
@@ -146,4 +146,9 @@ exit code, and never re-derive a state word — the CLI's state words are the on
146
146
  state words, and **an exit code is an ANSWER wherever that contract says so, not
147
147
  a failure**. A call the answer does not name is a call this lane does not make.
148
148
  Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
149
- command you are about to run, out loud, before running it.
149
+ command you are about to run, out loud, before running it.
150
+
151
+ ## Waiting mid-run (`/orc-wait`)
152
+
153
+ Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
154
+ Checkpoint **none** · safe point **single dispatch**. Nothing here to checkpoint, so all three modes behave identically — say so rather than asking. Never begin a wait between a dispatch and its validated return, or before the smoke gate has reported.
@@ -234,4 +234,9 @@ exit code, and never re-derive a state word — the CLI's state words are the on
234
234
  state words, and **an exit code is an ANSWER wherever that contract says so, not
235
235
  a failure**. A call the answer does not name is a call this lane does not make.
236
236
  Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
237
- command you are about to run, out loud, before running it.
237
+ command you are about to run, out loud, before running it.
238
+
239
+ ## Waiting mid-run (`/orc-wait`)
240
+
241
+ Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
242
+ Checkpoint **docset** · safe point **after a per-repo plan is written**. `soft` FORCES that checkpoint and does NOT stop if the write fails; `hard` skips it and can lose an in-flight return. Never begin a wait between a dispatch and its validated return, or before the smoke gate has reported.