@azure-id/orc 2.1.1 → 2.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 (145) hide show
  1. package/CHANGELOG.md +320 -0
  2. package/README.md +48 -23
  3. package/bin/build-agents.js +207 -205
  4. package/bin/cli.js +48188 -47417
  5. package/bin/fix.js +21 -18
  6. package/bin/graph-extract.js +314 -6
  7. package/bin/graph-gain.js +83 -2
  8. package/bin/graph-map.js +23 -1
  9. package/bin/graph-notes.js +1 -1
  10. package/bin/graph-query.js +1362 -37
  11. package/bin/graph-resolve.js +1 -1
  12. package/bin/graph-shard.js +29 -6
  13. package/bin/graph-signals.js +5 -3
  14. package/bin/graph.js +7 -3
  15. package/bin/habit.js +1 -1
  16. package/bin/pricing.json +8 -1
  17. package/bin/trace-write.js +40 -11
  18. package/bin/verify-contracts.js +5661 -5552
  19. package/bin/verify-package.js +716 -716
  20. package/bin/webui/api.js +8 -0
  21. package/bin/webui/fixtures/extra.js +2036 -2036
  22. package/bin/webui/fixtures/flow.js +1 -1
  23. package/bin/webui/fixtures/index.js +2 -2
  24. package/bin/webui/fixtures/knowledge.js +8 -1
  25. package/bin/webui/fixtures/pact.js +112 -111
  26. package/bin/webui/fixtures/stats.js +2 -2
  27. package/bin/webui/i18n/en/knowledge.json +2 -0
  28. package/bin/webui/i18n/id/knowledge.json +2 -0
  29. package/bin/webui/js/panels/knowledge.js +17 -0
  30. package/guides/code-graph-benefit.md +116 -0
  31. package/guides/configuration.md +150 -0
  32. package/guides/documents.md +262 -0
  33. package/guides/extra-models.md +448 -0
  34. package/guides/habits-and-gotchas.md +152 -0
  35. package/guides/knowledge-reads.md +190 -0
  36. package/guides/model-selection.md +186 -0
  37. package/guides/rules.md +305 -0
  38. package/guides/status-line.md +344 -0
  39. package/mock-run/orc-cli.md +3 -2
  40. package/mock-run/orc-doc.md +452 -448
  41. package/mock-run/orc.md +157 -157
  42. package/package.json +2 -1
  43. package/templates/agents/MODEL-MAPPING.md +176 -176
  44. package/templates/agents/{orc-executor-haiku-4-5.md → orc-executor-haiku-5-high.md} +21 -8
  45. package/templates/agents/orc-executor-opus-4-7-high.md +17 -5
  46. package/templates/agents/orc-executor-opus-4-7-med.md +17 -5
  47. package/templates/agents/orc-executor-opus-4-8-high.md +17 -5
  48. package/templates/agents/orc-executor-opus-5-high.md +17 -5
  49. package/templates/agents/orc-executor-opus-5-low.md +17 -5
  50. package/templates/agents/orc-executor-opus-5-med.md +17 -5
  51. package/templates/agents/orc-executor-sonnet-4-6-high.md +17 -5
  52. package/templates/agents/orc-executor-sonnet-5-high.md +17 -5
  53. package/templates/agents/orc-executor-sonnet-5-low.md +17 -5
  54. package/templates/agents/orc-executor-sonnet-5-med.md +17 -5
  55. package/templates/agents/{orc-graph-noter-sonnet-4-6-med.md → orc-graph-noter-haiku-5-high.md} +4 -4
  56. package/templates/agents/orc-planner-mini-opus-5-med.md +3 -1
  57. package/templates/agents/orc-planner-mini-sonnet-5-high.md +3 -1
  58. package/templates/agents/orc-planner-opus-5-med.md +3 -1
  59. package/templates/agents/{orc-trace-writer-haiku-4-5.md → orc-trace-writer-haiku-5-high.md} +4 -3
  60. package/templates/commands/orc-doc.md +128 -128
  61. package/templates/commands/orc-export.md +51 -46
  62. package/templates/hooks/README.md +8 -3
  63. package/templates/hooks/orc-effort-guard.js +105 -27
  64. package/templates/hooks/orc-graph-hook.js +252 -4
  65. package/templates/hooks/orc-statusline.js +13 -6
  66. package/templates/hooks/orc-trace.js +1 -1
  67. package/templates/skills/_shared/README.md +2 -2
  68. package/templates/skills/_shared/code-graph.md +185 -251
  69. package/templates/skills/_shared/extra-dispatch.md +1331 -1331
  70. package/templates/skills/_shared/lane-contract.md +7 -3
  71. package/templates/skills/_shared/opus5-only.md +137 -137
  72. package/templates/skills/_shared/phases/execution.md +13 -11
  73. package/templates/skills/_shared/phases/planning.md +27 -9
  74. package/templates/skills/_shared/phases/preflight.md +3 -3
  75. package/templates/skills/_shared/phases/review.md +4 -3
  76. package/templates/skills/_shared/phases/ship.md +7 -10
  77. package/templates/skills/_shared/phases/summary.md +2 -3
  78. package/templates/skills/_shared/phases/trace-verbs.md +21 -16
  79. package/templates/skills/_shared/phases/trace.md +3 -3
  80. package/templates/skills/_shared/phases/wiki-consult.md +2 -2
  81. package/templates/skills/_shared/pr-templates.md +108 -106
  82. package/templates/skills/_shared/read-ladder.md +8 -2
  83. package/templates/skills/_shared/return-validation.md +10 -6
  84. package/templates/skills/_shared/review-slice.md +1 -1
  85. package/templates/skills/_shared/stack-plan.md +135 -135
  86. package/templates/skills/_shared/wait.md +14 -2
  87. package/templates/skills/context-combiner/SKILL.md +2 -2
  88. package/templates/skills/orc/SKILL.md +227 -227
  89. package/templates/skills/orc/config.md +2 -2
  90. package/templates/skills/orc/examples/full-run-mock.md +74 -74
  91. package/templates/skills/orc/schemas/planning-output.md +3 -0
  92. package/templates/skills/orc-aftermath/SKILL.md +15 -15
  93. package/templates/skills/orc-analyze/SKILL.md +2 -2
  94. package/templates/skills/orc-analyze-mini/SKILL.md +2 -2
  95. package/templates/skills/orc-boundary/SKILL.md +15 -15
  96. package/templates/skills/orc-boundary/references/card.md +81 -78
  97. package/templates/skills/orc-boundary/references/gate.md +113 -113
  98. package/templates/skills/orc-brainstorm/SKILL.md +15 -15
  99. package/templates/skills/orc-budget/SKILL.md +15 -15
  100. package/templates/skills/orc-challenge/README.md +1 -1
  101. package/templates/skills/orc-challenge/SKILL.md +16 -16
  102. package/templates/skills/orc-challenge/examples/council-full-roster.md +1 -1
  103. package/templates/skills/orc-claude/SKILL.md +4 -4
  104. package/templates/skills/orc-claude/examples/claude-run-mock.md +1 -1
  105. package/templates/skills/orc-diy/SKILL.md +2 -2
  106. package/templates/skills/orc-diy/references/blocks/wiki.md +26 -26
  107. package/templates/skills/orc-diy/references/flow-schema.md +2 -2
  108. package/templates/skills/orc-doc/README.md +2 -2
  109. package/templates/skills/orc-doc/SKILL.md +501 -490
  110. package/templates/skills/orc-doc/examples/orc-doc-prd-run.md +12 -1
  111. package/templates/skills/orc-doc/references/chunking.md +6 -4
  112. package/templates/skills/orc-doc/references/gates.md +311 -311
  113. package/templates/skills/orc-doc/references/resume-protocol.md +229 -228
  114. package/templates/skills/orc-explain/SKILL.md +88 -88
  115. package/templates/skills/orc-export/SKILL.md +190 -187
  116. package/templates/skills/orc-fast/SKILL.md +213 -210
  117. package/templates/skills/orc-grill/SKILL.md +245 -245
  118. package/templates/skills/orc-handoff/SKILL.md +11 -11
  119. package/templates/skills/orc-learn/SKILL.md +13 -13
  120. package/templates/skills/orc-learn/examples/learn-run-mock.md +2 -2
  121. package/templates/skills/orc-mini/SKILL.md +12 -12
  122. package/templates/skills/orc-mini/examples/mini-run-mock.md +4 -5
  123. package/templates/skills/orc-pact/SKILL.md +15 -15
  124. package/templates/skills/orc-pact/references/gate.md +70 -70
  125. package/templates/skills/orc-pattern/SKILL.md +3 -3
  126. package/templates/skills/orc-poly/SKILL.md +4 -4
  127. package/templates/skills/orc-poly/examples/poly-run-mock.md +51 -51
  128. package/templates/skills/orc-pr-driver/SKILL.md +4 -3
  129. package/templates/skills/orc-pr-driver/references/orc-run-split.md +108 -99
  130. package/templates/skills/orc-pr-setup/SKILL.md +2 -2
  131. package/templates/skills/orc-quick/README.md +535 -536
  132. package/templates/skills/orc-quick/SKILL.md +29 -32
  133. package/templates/skills/orc-quick/references/context-doc.md +145 -145
  134. package/templates/skills/orc-quick/references/dispatch-gate.md +220 -220
  135. package/templates/skills/orc-quick/references/gh-mode.md +2 -1
  136. package/templates/skills/orc-quick/references/look.md +34 -12
  137. package/templates/skills/orc-retro/SKILL.md +2 -2
  138. package/templates/skills/orc-retro/examples/retro-mock.md +2 -2
  139. package/templates/skills/orc-route/SKILL.md +2 -2
  140. package/templates/skills/orc-test/SKILL.md +6 -3
  141. package/templates/skills/orc-verify/SKILL.md +2 -2
  142. package/templates/skills/orc-wait/SKILL.md +10 -2
  143. package/templates/skills/orc-wiki/SKILL.md +4 -4
  144. package/templates/skills/orc-wiki/references/pattern-prewarm.md +19 -19
  145. package/templates/agents/orc-executor-sonnet-4-6-med.md +0 -155
@@ -184,8 +184,8 @@ Full lane only. `orc-analyze-mini` / `orc-mini` do not use the combiner.
184
184
 
185
185
  ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
186
186
 
187
- - **Calls:** `orc lane calls context-combiner --json` names every call and its exit codes.
188
- **An exit code is an ANSWER where it says so, not a failure.** Make no other call.
187
+ - **Calls:** `orc lane calls context-combiner --json` names shared calls and exit codes.
188
+ **An exit code is an ANSWER where it says so, not a failure.** Own calls are here; make no other.
189
189
  - **Config:** `orc lane config context-combiner --json`. Obey `effective`. Never merge
190
190
  `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`). Nothing
191
191
  here is contested, gated or a stop: no preflight line, no gate to honour.
@@ -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 (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
+ ---
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 `orc-effort-guard.js` (a Skill call: the live effort; a typed `/orc`:
28
+ the status line's reading, never a guess); the model cannot be — 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 shared calls and exit codes.
104
+ **An exit code is an ANSWER where it says so, not a failure.** Own calls are here; make no other.
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-5-high`).
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 — the four touchpoints (`../_shared/code-graph.md` §0), every call with `--if-enabled --json --brief`: (1) consult at preflight — print `probes["graph-status"].line`; `orc graph status --heal` only when `heal_needed`; exit 3 (`off` or `semi`) → no other graph call · (2) orient at planning — `orc graph map --focus=<3–6 words> --budget 800` ONCE, then `orc graph impact` + `orc graph cochange` on the candidate files · (3) anchors — one `orc graph ctx --for-slice <declared files> --focus=<words> [--refs=<task.precedent>] --anchors` per writing dispatch (a request that names one symbol: `ctx <symbol> --anchors` gives the card and the anchors in one call); its `card` goes into the slice VERBATIM as `graph_anchors`, with its `read all: …` line and its code block — never shorten it; With `graph_anchors` in the slice, list at most ONE wiki page path (the one about the feature's intent), not 1–3. ( none for one named file with no outside change) · (4) affected tests — `orc graph changes --files=<actual files>` at review. `orc graph update --notes-pending` only when `update_step` is `lane`. No lane runs the gain meter. Print each `line`; copy each `trace` VERBATIM
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**.
@@ -43,8 +43,8 @@ EFFORT, which is why the old four Opus rows are two. **Every band from score 41
43
43
  needs an Opus 5.5 MAIN session** or it silently falls back to the session model
44
44
  (the tier-honesty rule reports the downgrade) — that is the cost of this table.
45
45
 
46
- **Seven executors are named by NO band** — `orc-executor-haiku-4-5`,
47
- `orc-executor-sonnet-4-6-med`, `orc-executor-sonnet-4-6-high`,
46
+ **Six executors are named by NO band** — `orc-executor-haiku-5-high`,
47
+ `orc-executor-sonnet-4-6-high`,
48
48
  `orc-executor-opus-4-7-med`, `orc-executor-opus-4-7-high`,
49
49
  `orc-executor-opus-4-8-high` and `orc-executor-opus-5-high`. They still ship,
50
50
  reachable through `rubric_bands_override`, `orc diy`'s `fixed_executor` and