@azure-id/orc 1.8.2 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +299 -0
  2. package/README-id.md +68 -51
  3. package/README.md +60 -45
  4. package/bin/cli.js +301 -39
  5. package/bin/graph-audit.js +235 -0
  6. package/bin/graph-extract.js +308 -3
  7. package/bin/graph-gain.js +23 -3
  8. package/bin/graph-map.js +9 -1
  9. package/bin/graph-query.js +152 -10
  10. package/bin/graph-shard.js +6 -1
  11. package/bin/graph-signals.js +287 -4
  12. package/bin/graph.js +717 -658
  13. package/bin/verify-contracts.js +277 -61
  14. package/bin/verify-package.js +19 -1
  15. package/bin/webui/fixtures/knowledge.js +21 -4
  16. package/bin/webui/i18n/en/knowledge.json +5 -2
  17. package/bin/webui/i18n/id/knowledge.json +5 -2
  18. package/bin/webui/js/panels/knowledge.js +21 -2
  19. package/mock-run/orc-quick.md +141 -113
  20. package/package.json +1 -1
  21. package/templates/agents/MODEL-MAPPING.md +15 -5
  22. package/templates/agents/orc-executor-haiku-4-5.md +19 -1
  23. package/templates/agents/orc-executor-opus-4-7-high.md +19 -1
  24. package/templates/agents/orc-executor-opus-4-7-med.md +19 -1
  25. package/templates/agents/orc-executor-opus-4-8-high.md +19 -1
  26. package/templates/agents/orc-executor-opus-5-high.md +19 -1
  27. package/templates/agents/orc-executor-opus-5-low.md +19 -1
  28. package/templates/agents/orc-executor-opus-5-med.md +19 -1
  29. package/templates/agents/orc-executor-sonnet-4-6-high.md +19 -1
  30. package/templates/agents/orc-executor-sonnet-4-6-med.md +19 -1
  31. package/templates/agents/orc-executor-sonnet-5-high.md +19 -1
  32. package/templates/agents/orc-planner-mini-opus-5-med.md +75 -69
  33. package/templates/agents/orc-planner-mini-sonnet-5-high.md +73 -67
  34. package/templates/agents/orc-recon-opus-5-low.md +109 -0
  35. package/templates/agents/orc-recon-sonnet-4-6-med.md +109 -0
  36. package/templates/commands/orc-mini.md +10 -12
  37. package/templates/commands/orc-quick.md +20 -33
  38. package/templates/hooks/README.md +11 -1
  39. package/templates/hooks/orc-graph-hook.js +53 -7
  40. package/templates/hooks/orc-trace.js +476 -471
  41. package/templates/skills/_shared/code-graph.md +56 -17
  42. package/templates/skills/_shared/phases/execution.md +4 -4
  43. package/templates/skills/_shared/phases/planning.md +3 -3
  44. package/templates/skills/_shared/phases/preflight.md +1 -1
  45. package/templates/skills/_shared/phases/review.md +3 -1
  46. package/templates/skills/_shared/phases/rules.md +172 -159
  47. package/templates/skills/_shared/phases/ship.md +1 -1
  48. package/templates/skills/_shared/phases/trace.md +4 -2
  49. package/templates/skills/_shared/phases/wiki-consult.md +9 -5
  50. package/templates/skills/_shared/read-ladder.md +14 -1
  51. package/templates/skills/_shared/return-validation.md +22 -0
  52. package/templates/skills/context-combiner/SKILL.md +13 -13
  53. package/templates/skills/orc/SKILL.md +1 -1
  54. package/templates/skills/orc/subskills/orc-execution/core.md +171 -159
  55. package/templates/skills/orc-fast/SKILL.md +3 -3
  56. package/templates/skills/orc-mini/SKILL.md +145 -137
  57. package/templates/skills/orc-mini/examples/mini-run-mock.md +64 -50
  58. package/templates/skills/orc-mini/references/complexity.md +119 -0
  59. package/templates/skills/orc-quick/README.md +495 -423
  60. package/templates/skills/orc-quick/SKILL.md +157 -212
  61. package/templates/skills/orc-quick/references/context-doc.md +145 -114
  62. package/templates/skills/orc-quick/references/defect.md +101 -0
  63. package/templates/skills/orc-quick/references/dispatch-gate.md +55 -24
  64. package/templates/skills/orc-quick/references/gh-mode.md +148 -127
  65. package/templates/skills/orc-quick/references/look.md +107 -0
@@ -1,27 +1,24 @@
1
1
  ---
2
2
  name: orc-mini
3
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.
4
+ Lightweight build lane: light intake, a mini planner, ONE Sonnet 5
5
+ executor, a build+test smoke gate, ship. Use for "/orc-mini", "use
6
+ orc-mini to implement X", or a small change that needs a plan but not a
7
+ full review. Skips review, verify and summary; can switch to the full
8
+ /orc flow mid-run.
11
9
  ---
12
10
 
13
11
  # ORC-MINI
14
12
 
15
13
  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."
14
+ Everything in the main spine (`../orc/SKILL.md`) applies EXCEPT the differences
15
+ below. Load its references and schemas by path — the HOT-PATH essentials
16
+ (dispatch names, return-contract fields, artifact path) are inlined here so
17
+ nothing is reconstructed from "full minus deltas."
20
18
 
21
19
  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
-
20
+ **You never implement — you spawn.** The one exception is the **smoke gate**: a
21
+ read-only build+test run, not implementation — you still never write code.
25
22
  **Worked example** (orient only — never execute from it): `examples/mini-run-mock.md`.
26
23
 
27
24
  ## Differences from the full orchestrator
@@ -30,20 +27,21 @@ a read-only build+test run, not implementation — you still never write code.
30
27
  Instead: the **smoke gate** after execution, then the opt-in
31
28
  **test-authoring ask**, then ship.
32
29
  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).
30
+ scoring table** — a **one-line complexity read** replaces it (mini-ok? or
31
+ recommend switching to full); log that line, never render the matrix.
32
+ 3. **No dispatch-style and no batch-pause questions** — one subagent makes both
33
+ meaningless; never ask them.
34
+ 4. **Lighter intake.** Only the **Always + medium tier** (Q1–Q4 in
35
+ `../_shared/phases/intake.md`); no high tier (Q5/Q6). Step 3.5 runs at
36
+ NAMES-ONLY depth: confirm the names the draft cites with ONE `orc graph ctx
37
+ <names> --if-enabled --json` (five per call; exit 4, or a non-code noun such
38
+ as a command or a config key → Glob/Grep as before), tag the rest
39
+ `UNVERIFIED`, resolve the tags in the sign-off line, >3 tags → recommend full
40
+ or `orc-analyze`. Sign-off **defaults to SOFT**, not GATE.
41
+ 5. **Still write tests** when the project has a test setup (the executor does it
42
+ inside its task).
45
43
  6. **Everything else is identical:** run folder + intent-spec, planning,
46
- checkpoint/state-of-play, stop sequence, usage reminder, ship flow.
44
+ checkpoint, stop sequence, usage reminder, ship flow.
47
45
 
48
46
  ## Mini flow (the phase set)
49
47
 
@@ -51,115 +49,116 @@ a read-only build+test run, not implementation — you still never write code.
51
49
  Phase 0 intake (Q1–Q4, soft sign-off) + run folder + intent-spec
52
50
  Phase 1 planning (dispatch orc-planner-mini; analyst first only on real docs)
53
51
  → 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, literal)
56
- + the `rules_card` under it (`orc rules slice` → `text`, verbatim) + the
57
- cached `postgres` pattern on a data-access task (cache HIT only) + `orc graph ctx` cards when the graph is on — collect + validate return
52
+ Phase 3 dispatch ONE executor (orc-executor-sonnet-5-high) — slice carries the
53
+ standing `house_rules` card (../_shared/phases/house-rules.md, literal) +
54
+ the `rules_card` under it (`orc rules slice` → `text`, verbatim) + the cached
55
+ `postgres` pattern (HIT only) + the --for-slice card + wiki PATHS
58
56
  Phase M SMOKE GATE — run build+test → GREEN proceed · RED block ship + surface
59
57
  Phase X MOCK EXAMPLE (config mock_example) — offer/build after a GREEN gate
60
58
  Phase T TEST-AUTHORING ASK (opt-in) — offer to write test cases (never run them)
61
59
  Phase 8 ship (commit / push / PR — never stages mock-examples/)
62
60
  ```
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.
61
+ (No Phase 2 scoring table, no dispatch-style/batch-pause asks, no full review/verify/summary.)
62
+ **Postgres query grounding.** Data-access task on a Postgres project → probe
63
+ `orc pattern status postgres` (`../_shared/detecting-artifacts.md`, never an
64
+ ad-hoc `find`). HIT → inject the pattern LITERALLY into the slice (conventions +
65
+ blocking query invariants). MISS → skip; mini never codifies (full lane /
66
+ `/orc-pattern`).
73
67
 
74
68
  **Gotchas (repair memory; config `gotchas`) — mini READS and WRITES.** Probe at
75
69
  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.
70
+ entries into the Phase 3 slice (cap 3; zero matches = no block), and append a
71
+ returned `gotcha_recorded` YOURSELF. `.claude/orc/gotchas.md` and the mechanics: `../_shared/gotchas.md` §10.
79
72
 
80
73
  ## Code graph cache — consult, build, use, update (`../_shared/code-graph.md` §0)
81
74
 
82
- Never skipped. Every call carries `--if-enabled`: exit 3 = off → print `graph: off` once, make no other graph call.
83
- Print each JSON `line` in chat; put each `trace` in the next packet VERBATIM.
84
- 1. **Preflight, with the probes, before the planner:** `orc graph status --if-enabled --heal --json` — it builds or updates the cache itself.
85
- 2. **Phase 3 slice:** ONE `orc graph ctx <declared_files> --if-enabled --json` → its `card` is the `graph` block; the return carries `graph_used`.
86
- 3. **Phase M GREEN:** `orc graph update --if-enabled --json`, then one `orc graph notes pending` batch (§6) — the next run starts from this cache.
75
+ Never skipped. Every call carries `--if-enabled`: exit 3 = off → print `graph: off` once, make no other graph call. Print each JSON `line` in chat; put each `trace` in the next packet VERBATIM.
76
+ 1. **Preflight, with the probes, before the planner:** `orc graph status --if-enabled --heal --json --brief` — it builds or updates the cache itself.
77
+ 2. **Phase 0, before the tiered round:** `orc graph map --focus "<3–6 words from the request>" --budget 800 --if-enabled --json --brief`. Its ranked files pre-fill Q4's `➡️` recommendation. Never ask what the map already answered.
78
+ 3. **Phase 1, ONE call:** `orc graph impact <declared_files> --complexity --risk=<facets.risk[] as class[@file:line],…> --if-enabled --json --brief`. Its `complexity.line` IS the complexity line — print it VERBATIM (`risk not given` → append the classes yourself); its `facts{}` IS `graph_facts` — paste it, then set `facts.map` to the `map --focus` card you already hold. No `complexity` in the answer (an older CLI) → count as `references/complexity.md` §2 says.
79
+ 4. **Phase 3 slice:** ONE `orc graph ctx <declared_files> --for-slice --if-enabled --json --brief` → its `card` is the `graph` block, the OUTSIDE view. No card when the change stays inside one named file with no signature change (`../_shared/code-graph.md` §7). The return carries `graph_used`.
80
+ 5. **Phase M, before the suite:** `orc graph changes --files=<actual_files> --if-enabled --json --brief` — print its `tests_line`, run the files its `tests[]` names first, then the suite, then its `blast_line` VERBATIM. The CLI attaches every `risk` word's `why`.
81
+ 6. **Phase M GREEN:** `orc graph update --notes-pending --files <actual_files> --if-enabled --json --brief` — ONE call for the update AND the notes batch (§6) — then `orc graph gain --run <this run> --if-enabled --json --brief`, `line` copied VERBATIM into the ship summary. It is an estimate with a range; never restate it as a saving.
87
82
 
88
83
  ## Phase M — Smoke gate (build + test; blocks ship on red)
89
84
 
90
- After the executor return validates (`../_shared/return-validation.md` —
91
- 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
92
- per `../_shared/smoke-gate.md`: read-only build+test. **GREEN** → code-graph step 3 (above) →
93
- test-authoring ask, then ship. **RED** → never offer commit/ship; one repair
94
- re-dispatch, second red → STOP and surface. Docs-only → gate N/A, say so.
95
- `orc run inflight` FIRST — exit 2 REFUSES, because
85
+ After the executor return validates (`../_shared/return-validation.md` — 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
86
+ per `../_shared/smoke-gate.md`: read-only build+test, with **the affected tests
87
+ FIRST** (code-graph step 5; a runner that takes no file list → one line saying
88
+ so), then build and suite once each, then the blast radius from the same
89
+ `changes` answer, `risk` never without its `why`:
90
+ `blast radius 2 symbols touched · callers 3 in 2 files · tests reach 2 · risk medium: <symbol> (fan-in 3, no test reaches it)`.
91
+ **GREEN** → code-graph step 6 → test-authoring ask, then ship. **RED** → never
92
+ offer commit/ship; one repair re-dispatch, second red → STOP and surface.
93
+ Docs-only → gate N/A, say so. `orc run inflight` FIRST — exit 2 REFUSES, because
96
94
  `a lane that re-dispatches over a live attempt` has broken the contract
97
- (`../_shared/return-validation.md` §0).
95
+ (`../_shared/return-validation.md` §0). **A `risk: high` row adds ONE option,
96
+ never a phase:** an exported symbol with fan-in 3+ that no test reaches adds one
97
+ option to the EXISTING end-of-run batch (mock example · test authoring · ship)
98
+ — *a. dispatch `orc-reviewer-opus-5-med` on the diff (P0/P1 block the commit
99
+ offer once) · b. write a test in Phase T · c. ship anyway*. No new user turn;
100
+ mini still skips full review.
98
101
 
99
102
  ## Phase X — Mock example + drift recovery (config `mock_example`, default ask)
100
103
 
101
104
  Canonical: `../_shared/drift-recovery.md` — load it when the phase fires. After
102
105
  a GREEN Phase M, before ship: `ask` → MANDATORY offer (never silently
103
106
  skipped/run) · `on` → build · `off` → skip. Deliverable
104
- `mock-examples/<change-slug>/` at project root (EXAMPLE.md + one runnable
105
- mocked artifact) — **never committed, never staged** (no `.gitignore` edit).
106
- One question after the user runs it: matches expectation? [yes / drift:
107
- <describe>]. Drift → `DRIFT-FROM` handoff (gap analysis → patch plan → dispatch
108
- → re-gate → re-offer), hard cap 2 loops, then an honest unresolved report.
109
- Trace: `PHASE mock-example`, `DRIFT loop=<n>`.
107
+ `mock-examples/<change-slug>/` at project root — **never committed, never
108
+ staged**. Drift → `DRIFT-FROM` handoff, hard cap 2 loops, then an honest
109
+ unresolved report. Trace: `PHASE mock-example`, `DRIFT loop=<n>`.
110
110
 
111
111
  ## Phase T — Test-authoring ask (opt-in; writes tests, never runs them)
112
112
 
113
113
  Same opt-in as full Phase 6.5 — mini **only asks** (never gates the ship).
114
- Default from `config.generate_tests`; at the end of a GREEN run ask: *"Write
115
- test cases for these changes? (I'll author them — automated files +
116
- TEST-PLAN.md + a curl bundle for HTTP APIs — but never run them; you test
117
- manually.)"* Yes → dispatch `orc-test-author-opus-5-med` (subskill
118
- `../orc/subskills/orc-testgen/`) with the run's `actual_files`,
119
- definition-of-done, touched flows, constraints, stack; the two manual
120
- deliverables land in **`test-generator/<change-slug>/` at the project root**.
121
- Validate the returned `test_plan_path`/`curl_bundle_path` are under that folder
122
- (else malformed → re-dispatch); relay + state the exact path (committed on ship,
123
- not gitignored). No → ship. Either way this NEVER runs tests.
114
+ Default from `config.generate_tests`; at the end of a GREEN run ask whether to
115
+ author test cases (files + TEST-PLAN.md + a curl bundle for HTTP APIs), saying
116
+ they are never run. Yes → dispatch `orc-test-author-opus-5-med` (subskill
117
+ `../orc/subskills/orc-testgen/`) with `actual_files`, the definition-of-done,
118
+ touched flows, constraints and stack; the manual deliverables land in
119
+ **`test-generator/<change-slug>/` at the project root**. Validate that the
120
+ returned `test_plan_path`/`curl_bundle_path` sit under that folder (else
121
+ malformed → re-dispatch) and state the exact path. No → ship; either way this
122
+ NEVER runs tests.
124
123
 
125
124
  ## Behavior trace (always on)
126
125
 
127
- `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases` names
128
- the file and the layers). Lane token `mini`, tier **Build lanes** —
129
- per phase, batched to **3 packets** (intake+plan · execution · ship), each
130
- paired with the next phase's first dispatch.
131
- At run start write `log_dir/.current` = `run-mini-<slug>-<DDMMYY>-<HHMMSS>.txt` AND
132
- `touch the trace file` of that name in the SAME step.
133
- Nothing else about the protocol is restated here; a phase that ends with
134
- `zero new trace lines is a protocol violation`.
135
-
136
- Mini does NOT drop the trace. `OUTCOME … band=mini` per task.
137
-
138
- ## Complexity read (replaces the scoring table)
139
-
140
- ONE judgment before dispatch: is this genuinely mini-sized (single coherent
141
- area, low interdependency, low blast radius)? State it in one line and log it.
142
- Complex/high-risk (many interdependencies, core/shared surface,
143
- security-sensitive) → **recommend switching to full** — let the user choose.
126
+ `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases` names the
127
+ file and the layers). Lane token `mini`, tier **Build lanes** — per phase,
128
+ batched to **3 packets** (intake+plan · execution · ship), each paired with the
129
+ next phase's first dispatch. At run start write `log_dir/.current` =
130
+ `run-mini-<slug>-<DDMMYY>-<HHMMSS>.txt` AND `touch the trace file` of that name
131
+ in the SAME step. Nothing else about the protocol is restated here; a phase that
132
+ ends with `zero new trace lines is a protocol violation`. Mini does NOT drop the
133
+ trace. `OUTCOME … band=mini` per task.
134
+
135
+ ## Complexity read (replaces the scoring table) — `references/complexity.md`
136
+
137
+ ONE line before dispatch, carrying its own NUMBERS. **The CLI computes it** —
138
+ `complexity.line` from the Phase 1 call, printed VERBATIM. The four thresholds,
139
+ the `(graph off)` form and why each number is that number: `references/complexity.md`.
140
+ `complexity: mini-ok — 3 files · confident callers 4 in 2 files · tests reach 2 · risk none · cochange none`
141
+ It is an OFFER: *1. switch to /orc (recommended — <the reason>) · 2. continue in
142
+ mini*. Continuing writes the NUMBERS into the decision log, so `/orc-retro` can
143
+ move a threshold instead of anyone arguing about it. Trace: `GATE complexity :: <the line>`.
144
144
 
145
145
  ## Fallback intake (arriving from orc-fast)
146
146
 
147
- orc-fast falls back HERE whenever its prerequisites fail — never by stopping
148
- the chat. Follow the reader side of `../_shared/fallback-handoff.md`: the
149
- `FALLBACK-FROM` block in the shared run folder names the reason; acknowledge
150
- it in one line, skip re-deriving whatever is carried, reuse the run folder.
147
+ orc-fast falls back HERE whenever its prerequisites fail — never by stopping the
148
+ chat. Follow the reader side of `../_shared/fallback-handoff.md`: the
149
+ `FALLBACK-FROM` block in the shared run folder names the reason; acknowledge it
150
+ in one line, reuse the run folder, re-derive nothing it carries.
151
151
 
152
152
  ## Switching to full flow mid-run
153
153
 
154
- On "switch to full" (or when the complexity read / a mid-run surprise clearly
155
- needs review/verify): the run folder, checkpoint, and intent-spec already live
156
- in the shared `.claude/orc/run/{run-slug}/` format, so the full flow resumes from
157
- the current checkpoint and adds the phases mini skipped. Record the switch in
158
- the decision log.
154
+ On "switch to full" (or when the complexity read recommends it): the run folder,
155
+ checkpoint and intent-spec already use the shared `.claude/orc/run/{run-slug}/`
156
+ format, so the full flow resumes from the current checkpoint and adds the phases
157
+ mini skipped. Record the switch in the decision log.
159
158
 
160
159
  ## Dispatch via named agents (canonical name-map — dispatch BY these names)
161
160
 
162
- 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`).
161
+ Models pinned in `.claude/agents/`; look one 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`).
163
162
 
164
163
  **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.
165
164
 
@@ -179,10 +178,8 @@ from `.claude/orc.config.yaml` — a key this lane does not read is not in the
179
178
  answer, and a key another key shadows comes back already marked. Exit ≠ 0 → say
180
179
  the CLI is unavailable and fall back to `../_shared/config-precedence.md`'s
181
180
  documented defaults, out loud. Priorities and families:
182
- `../_shared/config-precedence.md`.
183
-
184
- Wave/scoring/scout keys never apply to mini — and they are not in the answer,
185
- so there is nothing to render or ask.
181
+ `../_shared/config-precedence.md`. Wave, scoring and scout keys never apply to
182
+ mini and are not in the answer, so there is nothing to render or ask.
186
183
 
187
184
  ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
188
185
 
@@ -216,50 +213,61 @@ reason at preflight — never silent. No → skip entirely; never re-ask.
216
213
  ## Analyst & planner (mini lane)
217
214
 
218
215
  orc-mini dispatches the FAST variants (Sonnet 5 high): `orc-analyze-mini` and
219
- `orc-planner-mini` — same artifacts and output contracts as full, trimmed
220
- depth. The mini analyst is **doc-optional**: on real doc input it runs first,
221
- then the mini planner; on a merely ambiguous request, prefer one inline
222
- clarifying question over a cold analyst spawn. Always single-pass — **no deep
223
- mode, no scouts**; it escalates to `/orc-analyze` deep on its concrete
216
+ `orc-planner-mini`. The mini analyst is **doc-optional**: on real doc input it
217
+ runs first, then the mini planner; on a merely ambiguous request, prefer one
218
+ inline clarifying question over a cold analyst spawn. Always single-pass — **no
219
+ deep mode, no scouts**; it escalates to `/orc-analyze` deep on its concrete
224
220
  thresholds and the user chooses. You never analyze or plan yourself.
225
221
 
222
+ **The planner slice carries `graph_facts`** — `map`, `impact`, `cochange` and
223
+ the `generation`, or `null` when the graph is off (shape:
224
+ `references/complexity.md` §1b). The planner grounds `declared_files` and
225
+ `facets.breadth` on them; a `cochange` partner not in the plan is an
226
+ `open_questions[]` entry, never a silent addition.
227
+
226
228
  **Mini-lane gates (yours, deterministic — same as full; full detail in
227
229
  `../_shared/phases/analyst-gates.md`; emit `GATE` trace lines).** On
228
230
  mini-analyst return: evidence spot-check + derivation lint; refuse
229
231
  take-into-build on open `UNVERIFIED`/missing `scope_closed`; `git_head` ≠
230
- HEAD at plan time → re-run the spot-check first. On mini-planner return: Glob
231
- every `disposition: exists` path, recompute coverage (no orphan
232
- requirements), cycle + collision checks. Any miss → bounce (one retry, then
233
- escalate). At dispatch, append the task's `spec_invariants` to the slice's
234
- `constraints[]` verbatim.
232
+ HEAD at plan time → re-run the spot-check first. On mini-planner return: confirm
233
+ every `disposition: exists` path with `orc graph ctx <paths> --if-enabled
234
+ --json --brief`, FIVE at a time — exit 0 confirms, exit 4 or an unindexed path falls
235
+ back to a Glob. Then recompute coverage (no orphan requirements), cycle +
236
+ collision checks. Any miss → bounce (one retry, then escalate). At dispatch,
237
+ append the task's `spec_invariants` to the slice's `constraints[]` verbatim.
235
238
 
236
239
  ## Wiki consult (if present)
237
240
 
238
241
  Same rule as the full skill — load `../_shared/phases/wiki-consult.md` at the
239
- planning/complexity-read step: compute the FRESH / AGING / STALE tier from
240
- `.claude/orc/wiki-meta.json`, pull the relevant pages (incl. cross-cutting
241
- maps like `orc-reference-api-surface` when their domain applies), apply
242
- `code > fresh wiki > stale wiki (hints) > model priors`, and **emit
243
- `WIKI-CONSULT <tier> :: docs=<pages pulled>`**. Crosslink: a task touching a
244
- boundary in `.claude/orc/crosslink/needs.json` gets the cached contract
245
- injected per that reference — advisory, never blocking. Mini never generates
246
- the wiki; after a code-changing run apply the passive stale-flag note only
247
- (the post-ship refresh ASK is full-lane/ultra behavior).
248
-
249
- ## Shared artifacts
250
-
251
- Writes to the SAME location as the full skill
252
- (`.claude/orc/run/{run-slug}/`) — a switch needs no migration.
253
-
254
- ## What mini still enforces (from the main hard rules)
255
-
256
- Never implement yourself (the smoke gate is read-only, not implementation) ·
257
- all RUN-STATE artifacts in the run subfolder, never project root (the one
258
- exception is the opt-in `test-generator/<change-slug>/` self-QA deliverable,
259
- which lands at the project root by design) · validate every
260
- subagent return (malformed = failure) · report the dispatch log + remind the
261
- user to run `/usage` (never invoke it programmatically) · **never offer commit
262
- on a red build** (enforced by Phase M).
242
+ planning/complexity-read step: compute the FRESH / `AGING` / STALE tier from
243
+ `.claude/orc/wiki-meta.json` and `orc wiki status --json`, then **select PATHS,
244
+ never bodies**. From `wiki/INDEX.md` pick 1–3 page paths by keyword
245
+ (cross-cutting maps like `orc-reference-api-surface` when their domain applies)
246
+ and put the PATHS in the planner and executor slices with *"Read these first:
247
+ the TL;DR for orientation, `Contracts & shapes` for specifics"* plus
248
+ `code > fresh wiki > stale wiki (hints) > model priors`. **You never read a page
249
+ body into your own context.** **Emit `WIKI-CONSULT <tier> :: docs=<paths>`**. Crosslink: a task touching a
250
+ boundary in `.claude/orc/crosslink/needs.json` gets the cached contract injected
251
+ per that reference — advisory, never blocking. Mini never generates the wiki;
252
+ after a code-changing run apply the passive stale-flag note only.
253
+
254
+ **`none` is an answer — record it, never drop it.** `wiki_used: none` and
255
+ `graph_used: none` from ANY return go into the checkpoint and the ship line
256
+ (`knowledge: wiki 2 pages offered · used none · graph card 2 targets · used
257
+ none`). Two runs in a row with `wiki_used: none` on FRESH pages → one line:
258
+ `wiki: the selected pages were not used in 2 runs — check their TL;DRs
259
+ (/orc-wiki)`. A signal, never a gate, never dropped for looking null.
260
+
261
+ ## Shared artifacts, and what mini still enforces
262
+
263
+ Mini writes to the SAME location as the full skill (`.claude/orc/run/`
264
+ `{run-slug}/`), so a switch needs no migration. From the main hard rules: never
265
+ implement yourself (the smoke gate is read-only) · every RUN-STATE artifact in
266
+ the run subfolder, never the project root (the one exception is the opt-in
267
+ `test-generator/<change-slug>/` deliverable, at the project root by design) ·
268
+ validate every subagent return (malformed = failure) · report the dispatch log
269
+ and remind the user to run `/usage` (never yourself) · **never offer commit on a
270
+ red build** (Phase M enforces it).
263
271
 
264
272
  ## Waiting mid-run (`/orc-wait`)
265
273
 
@@ -1,50 +1,64 @@
1
- # Example — Annotated Mini Run (dry run)
2
-
3
- O: = orchestrator (Opus 4.8 high, always) · U: = user. Nothing real. The
4
- orchestrator NEVER implements — it spawns ONE Sonnet-5-high executor, then runs a
5
- read-only build+test smoke gate itself.
6
-
7
- U: /orc-mini add a `--json` flag to the `report` CLI command
8
-
9
- ## Phase 0 — Intake (lighter: Q1–Q4, soft sign-off)
10
- O: Creates run folder run/report-json-flag/ FIRST.
11
- [reads repo: Python/poetry/pytest — asks nothing about stack]
12
- Batched round (medium tier): 1) What should exist? 2) Out of scope?
13
- 3) How do we know it's done? 4) Patterns/files to avoid?
14
- U: report --json prints machine-readable output; no other commands touched;
15
- `pytest tests/test_report.py` green; follow the existing click option style.
16
- O: [drafts intent-spec.md] Sign-off defaults to SOFT — proceeding unless you object.
17
-
18
- ## Phase 1 — Planning + complexity read
19
- O: [dispatches orc-planner-mini] → 1 task, declared_files: cli/report.py,
20
- tests/test_report.py — both grounded `exists` (globbed) + acceptance sliced
21
- from the intent-spec. O spot-checks: both paths present ✓.
22
- O: Complexity read (one line, no scoring table): single coherent area, low blast
23
- radius → mini-appropriate. (If it read complex/high-risk → I'd recommend /orc.)
24
-
25
- ## Phase 3 — Execute (ONE subagent)
26
- O: → claude-sonnet-5 / high :: DISPATCH orc-executor-sonnet-5-high :: add --json flag
27
- [executor edits cli/report.py + updates tests, returns actual_files + actual_model
28
- + evidence {`pytest tests/test_report.py`, exit 0, tail quoted} + empty unmet[]]
29
- O: VERIFY actual=claude-sonnet-5/high ✅ MATCH · evidence present ✓
30
-
31
- ## Phase M — Smoke gate (build + test; blocks ship on red)
32
- O: [runs `pytest tests/test_report.py`] ⛔ RED — 1 failure: JSON missing trailing key.
33
- Not offering commit. Auto-fix ONCE → re-dispatch executor with the failure output.
34
- [re-run] ✅ GREEN — build + tests pass. VERDICT pass
35
-
36
- ## Phase T — Test-authoring ask (opt-in; writes, never runs)
37
- O: Write test cases for these changes? (I author them — files + TEST-PLAN.md — but
38
- never run them; you test manually.) [default from config.generate_tests]
39
- U: yes
40
- O: [dispatches orc-test-author-opus-5-med] → automated tests in
41
- tests/test_report.py; manual deliverable at test-generator/report-json-flag/TEST-PLAN.md
42
- (non-API project → curl_bundle_path null). Validate: path under
43
- test-generator/report-json-flag/ ✓.
44
- O: Self-QA plan: test-generator/report-json-flag/TEST-PLAN.md (committed on ship).
45
-
46
- ## Phase 8 — Ship
47
- O: Current branch: feat/report-json. Commit? Push? PR?
48
- U: commit
49
- O: [commits] Done. Usage: dispatch log below + run /usage for your limits.
50
- (Switch to full flow any time — the run folder + checkpoint are shared.)
1
+ # Example — Annotated Mini Run (dry run)
2
+
3
+ O: = orchestrator (Opus 4.8 high, always) · U: = user. Nothing real. The
4
+ orchestrator NEVER implements — it spawns ONE Sonnet-5-high executor, then runs a
5
+ read-only build+test smoke gate itself.
6
+
7
+ U: /orc-mini add a `--json` flag to the `report` CLI command
8
+
9
+ ## Phase 0 — Intake (lighter: Q1–Q4, soft sign-off)
10
+ O: Creates run folder run/report-json-flag/ FIRST.
11
+ [reads repo: Python/poetry/pytest — asks nothing about stack]
12
+ graph: FRESH — 6 files · 8 symbols
13
+ GRAPH-MAP :: focus="report json flag" budget=800 → cli/report.py, tests/test_report.py
14
+ Batched round (medium tier): 1) What should exist? 2) Out of scope?
15
+ 3) How do we know it's done? 4) Patterns/files to avoid?
16
+ [Q4's ➡️ already names cli/report.py and tests/test_report.py — the map
17
+ answered it, so O does not ask the user to recite their own repo.]
18
+ U: report --json prints machine-readable output; no other commands touched;
19
+ `pytest tests/test_report.py` green; follow the existing click option style.
20
+ O: [drafts intent-spec.md] Sign-off defaults to SOFT — proceeding unless you object.
21
+
22
+ ## Phase 1 — Planning + complexity read
23
+ O: [dispatches orc-planner-mini WITH graph_facts: map + impact + cochange, gen 7]
24
+ → 1 task, declared_files: cli/report.py, tests/test_report.py — both grounded
25
+ `exists`, evidence "graph gen 7" + acceptance sliced from the intent-spec.
26
+ O confirms both paths with ONE `orc graph ctx` call (exit 0) ✓.
27
+ O: GATE complexity :: complexity: mini-ok — 2 files · confident callers 1 in 1 file ·
28
+ tests reach 1 · risk none · cochange none
29
+ (4+ caller files, 8+ callers, a cited risk class, or a cochange partner with
30
+ 3+ co-commits would have made this "recommend /orc" — an offer, never a switch.)
31
+
32
+ ## Phase 3 — Execute (ONE subagent)
33
+ O: graph: --for-slice card (2 files) · wiki: 1 path (pointer, body never read here)
34
+ O: → claude-sonnet-5 / high :: DISPATCH orc-executor-sonnet-5-high :: add --json flag
35
+ [executor edits cli/report.py + updates tests, returns actual_files + actual_model
36
+ + evidence {`pytest tests/test_report.py`, exit 0, tail quoted} + empty unmet[]]
37
+ O: VERIFY actual=claude-sonnet-5/high ✅ MATCH · evidence present ✓
38
+
39
+ ## Phase M — Smoke gate (build + test; blocks ship on red)
40
+ O: GRAPH-CHANGES → tests reached 1 file (call 1)
41
+ [runs `pytest tests/test_report.py` FIRST] ⛔ RED — 1 failure: JSON missing trailing key.
42
+ Not offering commit. Auto-fix ONCE → re-dispatch executor with the failure output.
43
+ [re-run] ✅ GREEN — tests reached 1 file → 4 passed · suite 12 passed · build ok.
44
+ blast radius 1 symbol touched · callers 1 in 1 file · tests reach 1 · risk none
45
+ VERDICT pass
46
+ O: GRAPH-UPDATE :: gen 8 · 2 files · 1 note pending → noter batch dispatched
47
+ graph gain: paid 0.8K tokens · avoided an estimated 2–5K · measured: not yet (N=1)
48
+
49
+ ## Phase T — Test-authoring ask (opt-in; writes, never runs)
50
+ O: Write test cases for these changes? (I author them — files + TEST-PLAN.md — but
51
+ never run them; you test manually.) [default from config.generate_tests]
52
+ U: yes
53
+ O: [dispatches orc-test-author-opus-5-med] → automated tests in
54
+ tests/test_report.py; manual deliverable at test-generator/report-json-flag/TEST-PLAN.md
55
+ (non-API project → curl_bundle_path null). Validate: path under
56
+ test-generator/report-json-flag/ ✓.
57
+ O: Self-QA plan: test-generator/report-json-flag/TEST-PLAN.md (committed on ship).
58
+
59
+ ## Phase 8 — Ship
60
+ O: Current branch: feat/report-json. Commit? Push? PR?
61
+ U: commit
62
+ O: knowledge: wiki 1 page offered · used tests/test_report.py note · graph used 1 target
63
+ O: [commits] Done. Usage: dispatch log below + run /usage for your limits.
64
+ (Switch to full flow any time — the run folder + checkpoint are shared.)