@azure-id/orc 1.7.1 → 1.8.2

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 (63) hide show
  1. package/CHANGELOG.md +3869 -3381
  2. package/README-id.md +942 -844
  3. package/README.md +882 -788
  4. package/bin/build-agents.js +43 -27
  5. package/bin/cli.js +45460 -44169
  6. package/bin/graph-extract.js +3216 -0
  7. package/bin/graph-gain.js +404 -0
  8. package/bin/graph-map.js +232 -0
  9. package/bin/graph-notes.js +229 -0
  10. package/bin/graph-query.js +1770 -0
  11. package/bin/graph-resolve.js +255 -0
  12. package/bin/graph-shard.js +325 -0
  13. package/bin/graph-signals.js +277 -0
  14. package/bin/graph.js +658 -0
  15. package/bin/verify-contracts.js +4809 -4553
  16. package/bin/verify-package.js +640 -616
  17. package/bin/webui/api.js +1425 -1414
  18. package/bin/webui/fixtures/index.js +584 -576
  19. package/bin/webui/fixtures/knowledge.js +356 -291
  20. package/bin/webui/fixtures/stats.js +107 -104
  21. package/bin/webui/i18n/en/knowledge.json +182 -151
  22. package/bin/webui/i18n/en/overview.json +101 -100
  23. package/bin/webui/i18n/id/knowledge.json +182 -151
  24. package/bin/webui/i18n/id/overview.json +101 -100
  25. package/bin/webui/js/panels/knowledge.js +1130 -1006
  26. package/bin/webui/js/panels/overview.js +492 -488
  27. package/package.json +39 -39
  28. package/templates/agents/MODEL-MAPPING.md +163 -158
  29. package/templates/agents/orc-executor-haiku-4-5.md +128 -121
  30. package/templates/agents/orc-executor-opus-4-7-high.md +129 -122
  31. package/templates/agents/orc-executor-opus-4-7-med.md +129 -122
  32. package/templates/agents/orc-executor-opus-4-8-high.md +129 -122
  33. package/templates/agents/orc-executor-opus-5-high.md +129 -122
  34. package/templates/agents/orc-executor-opus-5-low.md +129 -122
  35. package/templates/agents/orc-executor-opus-5-med.md +129 -122
  36. package/templates/agents/orc-executor-sonnet-4-6-high.md +129 -122
  37. package/templates/agents/orc-executor-sonnet-4-6-med.md +129 -122
  38. package/templates/agents/orc-executor-sonnet-5-high.md +129 -122
  39. package/templates/agents/orc-graph-noter-sonnet-4-6-med.md +89 -0
  40. package/templates/hooks/README.md +454 -396
  41. package/templates/hooks/orc-graph-hook.js +471 -0
  42. package/templates/hooks/orc-statusline-render.js +922 -921
  43. package/templates/hooks/orc-statusline.js +1596 -1545
  44. package/templates/skills/_shared/README.md +4 -0
  45. package/templates/skills/_shared/code-graph.md +348 -0
  46. package/templates/skills/_shared/opus5-only.md +4 -0
  47. package/templates/skills/_shared/phases/execution.md +168 -147
  48. package/templates/skills/_shared/phases/planning.md +149 -135
  49. package/templates/skills/_shared/phases/preflight.md +132 -118
  50. package/templates/skills/_shared/phases/review.md +63 -53
  51. package/templates/skills/_shared/phases/ship.md +100 -88
  52. package/templates/skills/_shared/phases/trace.md +8 -0
  53. package/templates/skills/_shared/phases/wiki-consult.md +194 -189
  54. package/templates/skills/_shared/read-ladder.md +132 -102
  55. package/templates/skills/_shared/return-validation.md +259 -250
  56. package/templates/skills/orc/SKILL.md +255 -254
  57. package/templates/skills/orc-analyze/SKILL.md +13 -13
  58. package/templates/skills/orc-diy/references/flow-schema.md +101 -100
  59. package/templates/skills/orc-fast/SKILL.md +236 -229
  60. package/templates/skills/orc-mini/SKILL.md +267 -259
  61. package/templates/skills/orc-quick/SKILL.md +378 -361
  62. package/templates/skills/orc-quick/references/dispatch-gate.md +6 -0
  63. package/templates/skills/orc-wiki/references/staleness.md +294 -288
@@ -1,229 +1,236 @@
1
- ---
2
- name: orc-fast
3
- description: >
4
- Fastest ORC lane — knowledge-gated single-executor implementation. Use for
5
- "use orc-fast to implement X" or "/orc-fast". Requires TWO prerequisites:
6
- a fresh project wiki (orc-wiki) AND a cached code-pattern for the request's
7
- language — the precomputed knowledge replaces the analyst/planner entirely.
8
- Either missing → falls back to orc-mini (never stops the chat). One
9
- Sonnet 4.6 high executor, a build+test smoke gate, one repair round, ship.
10
- Orchestrator runs fine at Sonnet medium. The orchestrator never implements —
11
- it spawns.
12
- ---
13
-
14
- # ORC-FAST
15
-
16
- The speed lane: precomputed knowledge instead of pipeline phases — the wiki
17
- supplies grounding, the pattern cache supplies house style, so fast pays for
18
- neither an analyst nor a planner. That trade only holds when both exist and
19
- the wiki is fresh, so the two prerequisite gates below are hard: fail either →
20
- **fall back to orc-mini** carrying whatever intake was done. Fallback is the
21
- router — orc-fast is always safe to try.
22
-
23
- Runs fine with the orchestrator at **Sonnet 4.6 / Sonnet 5, medium effort** —
24
- no scoring, no planning judgment (the effort guard only gates the full `orc`
25
- skill). **You never implement — you spawn.**
26
-
27
- ## What fast deliberately does NOT have
28
-
29
- No analyst, planner, scoring, waves, reviewer, verifier, test-author, or
30
- summary. One executor, one smoke gate, one repair round. More than that → the
31
- fit gate hands it to orc-mini.
32
-
33
- ## Phases
34
-
35
- `orc lane phases orc-fast --json` is this lane's pipeline: the ordered list, where
36
- each phase lives, and how much of it to read. **The CLI owns the order** — never
37
- derive it from the headings below, and never renumber or rename one without the
38
- manifest, because a `read: section` pointer names a HEADING and a renamed heading
39
- is a pointer into nothing.
40
-
41
- ## Phase F0 — Preflight (the two prerequisite gates; no spawn)
42
-
43
- Emit a `GATE` trace line per check when logging.
44
-
45
- **a. Wiki gate.** Decide existence with `orc wiki status` — the deterministic
46
- probe in `../_shared/detecting-artifacts.md`, never an ad-hoc `find` (`.claude`
47
- is hidden). `none` = gate FAILED → fallback; else wiki present → compute the
48
- tier from `.claude/orc/wiki-meta.json` per `../orc-wiki/references/staleness.md`:
49
- `git rev-list --count <scan_commit>..HEAD` → FRESH / AGING / STALE (manifest
50
- absent but docs present = STALE; wiki absent/empty = gate FAILED → fallback).
51
- - **FRESH** → proceed silently. **AGING** → one-line notice, proceed.
52
- - **STALE** → the user judges. Ask with exactly these options:
53
- 1. **Refresh wiki, then continue fast** *(recommended)* — run orc-wiki's
54
- incremental refresh (diff since `scan_commit`, re-scan only affected
55
- docs), then re-enter this preflight.
56
- 2. **Drop to orc-mini** *(preferable if in a hurry — mini grounds itself)*.
57
- 3. **Continue fast anyway** *(not recommended — the executor may follow
58
- stale claims)* — proceed and stamp `wiki_stale_override: true` in the
59
- checkpoint so /orc-retro can correlate outcomes with overrides.
60
-
61
- **b. Pattern gate.** Detect the request's language (file extensions / repo
62
- deps, same signals as the full lane's tagging) and confirm the cache with
63
- `orc pattern status <lang>` (exit 0 = cached — the deterministic probe in
64
- `../_shared/detecting-artifacts.md`, never an ad-hoc `find`). Absent for the
65
- language in play → gate FAILED → fallback. (A request touching no FE/BE language — pure docs/
66
- config — passes this gate as N/A.) The cross-cutting `postgres` pattern is
67
- NEVER a gate prerequisite — it is bonus-only (injected at F2 on a cache HIT),
68
- so a missing `postgres-pattern.md` never fails the gate or forces a fallback.
69
-
70
- **Any gate FAILED** → announce which prerequisite failed in one line, then
71
- hand off to orc-mini via the fallback contract below. Never stop the chat.
72
-
73
- **c. Gotchas — NOT a gate.** Two prerequisites stay two: a missing `.claude/orc/gotchas.md` never forces a fallback. Fast READS repair memory (`orc gotcha status`, then inject the SCOPE-MATCHING entries into the F2 slice, cap 3) and never WRITES it — `../_shared/gotchas.md` §10.
74
-
75
- **d. Extra — a PROBE, not a gate (P0).** Run `orc extra resolve --slot fast-executor --json` (0 = extra, 1 = Claude) — **a gate that is never probed is a gate that is always off**, and without this step the lane silently runs on Claude however `extra_enabled` and `orc extra role` were set. `extra` → print the `extra:` line HERE and carry the answer into F2; `claude` → print nothing, never fall back, never stop.
76
-
77
- The SHAPE of these steps — the order, and the four rules that make it worth
78
- having — is `../_shared/phases/preflight.md` (`core`). The probes
79
- themselves are this lane's own and stay here.
80
-
81
- ## Phase F1 — Fit gate + micro-intake (one pass, ONE user round-trip)
82
-
83
- Draft a 3–5 line intent spec + 2–3 acceptance bullets. Judge fit: more than
84
- one real task, ~5+ files, or core/security-sensitive surface → fallback to
85
- orc-mini WITH the intent spec attached (no rework); emit a `GATE` line for the
86
- verdict. Then the lane's ONLY pre-spawn ask — one combined confirmation:
87
- preflight result + intent spec + acceptance bullets + "proceed?" (soft
88
- sign-off; never split into multiple questions). Create the run folder
89
- (`.claude/orc/run/{run-slug}/` — shared format, so fallback needs no
90
- migration) and write the intent-spec + a minimal checkpoint.
91
-
92
- ## Phase F2 — Slice build + dispatch (ONE executor)
93
-
94
- Build one slice for `orc-executor-sonnet-4-6-high` (dispatch BY NAME; model
95
- pinned in the agent file). **Under `opus5_only` it is `orc-executor-opus-5-low`** — forced, and while that mode is on this lane needs an Opus 5 main session, so the "runs fine at Sonnet medium" premise applies only with it off (`../_shared/opus5-only.md`).
96
-
97
- **Extra (`extra_enabled`, `../_shared/extra-dispatch.md`):** the same slice may run off Claude. **This lane has no score at all, so it holds a POSITION, not a band:** resolve `orc extra resolve --slot fast-executor --json` (set with `orc extra role set fast-executor <profile>/<model>`). No row on that slot = Claude, and that is an answer, not a gap. The `extra:` line joins the F0 preflight (P0, printed whenever the gate is on) and NAMES the agent it displaces — `orc-executor-sonnet-4-6-high`; dispatch through `orc extra dispatch --task <file> --json` with `slot: "fast-executor"` and **no `score`** (both is refused by name); validate with `return-validation.md` **§2b, not §2**; a failure runs `orc extra reconcile <task_id>` FIRST — a worktree that moved is RESUMED, never re-done — then falls back to that same pinned agent BY NAME, announced. Extra is orthogonal to the knowledge gate — a fresh wiki and a cached pattern are still required, and a foreign worker gets the same pointers-not-content slice.
98
-
99
- - the task (intent spec) + acceptance bullets as definition-of-done
100
- - **wiki pointers, not content** (fast's lane-delta in
101
- `../_shared/phases/wiki-consult.md`): the PATHS of 1–3 relevant pages
102
- selected from `wiki/INDEX.md` by keyword match — prefer the cross-cutting
103
- maps (`orc-reference-api-surface` etc.) when the domain matches. Instruct
104
- the executor to READ them first, and include the precedence line verbatim:
105
- `code > fresh wiki > stale wiki (hints) > model priors`. Never paste wiki
106
- bodies into the slice (a Sonnet-medium orchestrator curating wiki prose
107
- defeats the lane). **Emit `WIKI-CONSULT <tier> :: docs=<the selected pointer
108
- paths>`** (tier from the F0 gate; `docs=none` if no pages fit) — the F0
109
- `GATE` line captured the gate *decision*; this captures which pages grounded
110
- the run.
111
- - the cached pattern injected LITERALLY (same `pattern` slice contract as
112
- full; the pattern file is small by design)
113
- - **crosslink (cross-repo, advisory):** a task touching a boundary in
114
- `.claude/orc/crosslink/needs.json` gets the cached linked contract injected
115
- as `crosslink` ("hints, not verified") — advisory, never blocks, never
116
- outranks local code.
117
- - **`db:postgres` bonus:** a data-access task with
118
- `.claude/orc/patterns/postgres-pattern.md` CACHED merges it into the same
119
- `pattern` slice (query invariants). Cache MISS → skip silently — fast never
120
- codifies and never falls back on this.
121
- - **the read ladder** (`../_shared/read-ladder.md`): read only as far up as the
122
- question needs — a file the task will EDIT is read in full first. Precomputed
123
- knowledge REPLACING exploration is this lane; a directory sweep is not.
124
- - the standing `house_rules` card (`../_shared/phases/house-rules.md`, literal,
125
- same as full/mini) + the `rules_card` under it (`orc rules slice` → `text`, verbatim)
126
- - constraints from the intent spec
127
- - **terse-return rule:** standard contract fields, NO narrative prose — files
128
- changed, one-line diff summary, smoke-relevant notes only.
129
-
130
- Validate the return per `../_shared/return-validation.md` — `unmet[]`
131
- honesty, `pattern_version` + `invariants_checked` attestation, `actual_model`
132
- / `actual_effort` downgrade check (emit the `VERIFY` trace line), and §6's worktree delta (`git status --short` before/after; a path changed outside `declared_files` is a violation whatever the return said). Malformed
133
- return = failure (one re-dispatch, then fallback offer).
134
-
135
- **Before any re-dispatch, run `orc run inflight`** (0 clear · 1 in-flight · 2 unknown). A Task error does not kill the agent behind it, and exit 2 REFUSES by default — `a lane that re-dispatches over a live attempt` has broken the contract. Canonical: `../_shared/return-validation.md`.
136
-
137
- ## Phase F3 — Smoke gate (build + test; blocks ship on red)
138
-
139
- Run the gate per `../_shared/smoke-gate.md`, sourcing commands **from
140
- `wiki-meta.json`'s `commands` block** (recorded at wiki scan — don't
141
- rediscover tooling; manifest lacks them → detect once and say so). **GREEN**
142
- → ship. **RED** → one repair round; second red → STOP and offer: escalate to
143
- orc-mini (reason `smoke-red-escalation`) / switch to full `/orc` / stop.
144
- Docs-only → gate N/A, say so.
145
-
146
- ## Phase F3.5 — Mock example (config `mock_example`, default ask)
147
-
148
- Canonical: `../_shared/drift-recovery.md` — load on fire. Only after a GREEN
149
- F3, before ship: `ask` → MANDATORY offer · `on` → build · `off` → skip.
150
- Deliverable `mock-examples/<change-slug>/` at project root — **never
151
- committed/staged**. Drift answer → `DRIFT-FROM` recovery (cap 2 loops, honest
152
- report on cap). Trace: `PHASE mock-example`, `DRIFT loop=<n>`.
153
-
154
- ## Phase F4 — Ship
155
-
156
- Offer commit (push if asked; never stage `mock-examples/`). Append the final markers to the checkpoint, emit
157
- `OUTCOME task=… band=fast model=… retries=… unmet=…` + `FINISH`, show the
158
- dispatch line (model/effort actually used) + the `/usage` reminder. Fast never
159
- triggers the post-ship wiki refresh ask (preflight polices freshness on the
160
- way in) — the passive stale-flag note still applies to touched covered files.
161
-
162
- ## Fallback contract (orc-fast → orc-mini)
163
-
164
- Follow the writer side of `../_shared/fallback-handoff.md`: announce the
165
- failed gate in one line, write the `FALLBACK-FROM` block into the run folder
166
- (REASON: wiki-absent | wiki-stale-user-choice | pattern-absent | fit-gate |
167
- smoke-red-escalation), and invoke orc-mini pointing at it. The run folder is
168
- already in the shared format — no migration.
169
-
170
- ## Behavior trace (always on)
171
-
172
- `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases` names
173
- the file and the layers). Lane token `fast`, tier **Build lanes** —
174
- per phase, batched to **2 packets** (preflight+dispatch · gate+ship), each
175
- paired with the next phase's first dispatch.
176
- At run start write `log_dir/.current` = `run-fast-<slug>-<DDMMYY>-<HHMMSS>.txt` AND
177
- `touch the trace file` of that name in the SAME step.
178
- Nothing else about the protocol is restated here; a phase that ends with
179
- `zero new trace lines is a protocol violation`.
180
-
181
- ## Config
182
-
183
- **ONE resolver, and it is not you:** `orc lane config orc-fast --json`. Obey
184
- `effective`, print every line in `announce[]` VERBATIM at preflight, and honour
185
- `stops[]` before wave 1. Never re-derive a value, a precedence or an inertness
186
- from `.claude/orc.config.yaml` — a key this lane does not read is not in the
187
- answer, and a key another key shadows comes back already marked. Exit ≠ 0 → say
188
- the CLI is unavailable and fall back to `../_shared/config-precedence.md`'s
189
- documented defaults, out loud. Priorities and families:
190
- `../_shared/config-precedence.md`.
191
-
192
- Fast has no config key of its own — command-entry only; wave/scoring/review
193
- keys never apply, and the tier edges the F0 gate reads arrive resolved.
194
-
195
- ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
196
-
197
- `orc rules slice --lane orc-fast --json` is the ONLY assembler; never build
198
- the card here. It rides under the house rules and above the task —
199
- **house rules > your project's rules > ORC's own packs** — and its `line` prints
200
- VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
201
- never a silent choice) and `rules_overridden[]`.
202
- ## Calls
203
-
204
- **ONE catalogue, and it is not you:** `orc lane calls orc-fast --json` names every
205
- CLI call this lane makes, each with its exit-code contract, its cost, when to run
206
- it, and what an EMPTY answer means. Never invent a spelling, never re-word an
207
- exit code, and never re-derive a state word — the CLI's state words are the only
208
- state words, and **an exit code is an ANSWER wherever that contract says so, not
209
- a failure**. A call the answer does not name is a call this lane does not make.
210
- Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
211
- command you are about to run, out loud, before running it.
212
-
213
- ## Checkpoint (minimal, append-only)
214
-
215
- One `fast-checkpoint.md` in the run folder: GATE results (+ any
216
- `wiki_stale_override`), the dispatch, smoke verdicts, OUTCOME — enough for
217
- /orc-retro mining and fresh-session resume, nothing more.
218
-
219
- ## What fast still enforces (from the main hard rules)
220
-
221
- Never implement yourself (smoke gate = read-only build+test) · all artifacts
222
- in the run subfolder, never project root · validate the subagent return
223
- (malformed = failure) · never offer commit on a red build · report the
224
- dispatch + remind the user to run `/usage` (never invoke it programmatically).
225
-
226
- ## Waiting mid-run (`/orc-wait`)
227
-
228
- Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
229
- 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.
1
+ ---
2
+ name: orc-fast
3
+ description: >
4
+ Fastest ORC lane — knowledge-gated single-executor implementation. Use for
5
+ "use orc-fast to implement X" or "/orc-fast". Requires TWO prerequisites:
6
+ a fresh project wiki (orc-wiki) AND a cached code-pattern for the request's
7
+ language — the precomputed knowledge replaces the analyst/planner entirely.
8
+ Either missing → falls back to orc-mini (never stops the chat). One
9
+ Sonnet 4.6 high executor, a build+test smoke gate, one repair round, ship.
10
+ Orchestrator runs fine at Sonnet medium. The orchestrator never implements —
11
+ it spawns.
12
+ ---
13
+
14
+ # ORC-FAST
15
+
16
+ The speed lane: precomputed knowledge instead of pipeline phases — the wiki
17
+ supplies grounding, the pattern cache supplies house style, so fast pays for
18
+ neither an analyst nor a planner. That trade only holds when both exist and
19
+ the wiki is fresh, so the two prerequisite gates below are hard: fail either →
20
+ **fall back to orc-mini** carrying whatever intake was done. Fallback is the
21
+ router — orc-fast is always safe to try.
22
+
23
+ Runs fine with the orchestrator at **Sonnet 4.6 / Sonnet 5, medium effort** —
24
+ no scoring, no planning judgment (the effort guard only gates the full `orc`
25
+ skill). **You never implement — you spawn.**
26
+
27
+ ## What fast deliberately does NOT have
28
+
29
+ No analyst, planner, scoring, waves, reviewer, verifier, test-author, or
30
+ summary. One executor, one smoke gate, one repair round. More than that → the
31
+ fit gate hands it to orc-mini.
32
+
33
+ ## Phases
34
+
35
+ `orc lane phases orc-fast --json` is this lane's pipeline: the ordered list, where
36
+ each phase lives, and how much of it to read. **The CLI owns the order** — never
37
+ derive it from the headings below, and never renumber or rename one without the
38
+ manifest, because a `read: section` pointer names a HEADING and a renamed heading
39
+ is a pointer into nothing.
40
+
41
+ ## Phase F0 — Preflight (the two prerequisite gates; no spawn)
42
+
43
+ Emit a `GATE` trace line per check when logging.
44
+
45
+ **a. Wiki gate.** Decide existence with `orc wiki status` — the deterministic
46
+ probe in `../_shared/detecting-artifacts.md`, never an ad-hoc `find` (`.claude`
47
+ is hidden). `none` = gate FAILED → fallback; else wiki present → compute the
48
+ tier from `.claude/orc/wiki-meta.json` per `../orc-wiki/references/staleness.md`:
49
+ `git rev-list --count <scan_commit>..HEAD` → FRESH / AGING / STALE (manifest
50
+ absent but docs present = STALE; wiki absent/empty = gate FAILED → fallback).
51
+ - **FRESH** → proceed silently. **AGING** → one-line notice, proceed.
52
+ - **STALE** → the user judges. Ask with exactly these options:
53
+ 1. **Refresh wiki, then continue fast** *(recommended)* — run orc-wiki's
54
+ incremental refresh (diff since `scan_commit`, re-scan only affected
55
+ docs), then re-enter this preflight.
56
+ 2. **Drop to orc-mini** *(preferable if in a hurry — mini grounds itself)*.
57
+ 3. **Continue fast anyway** *(not recommended — the executor may follow
58
+ stale claims)* — proceed and stamp `wiki_stale_override: true` in the
59
+ checkpoint so /orc-retro can correlate outcomes with overrides.
60
+
61
+ **b. Pattern gate.** Detect the request's language (file extensions / repo
62
+ deps, same signals as the full lane's tagging) and confirm the cache with
63
+ `orc pattern status <lang>` (exit 0 = cached — the deterministic probe in
64
+ `../_shared/detecting-artifacts.md`, never an ad-hoc `find`). Absent for the
65
+ language in play → gate FAILED → fallback. (A request touching no FE/BE language — pure docs/
66
+ config — passes this gate as N/A.) The cross-cutting `postgres` pattern is
67
+ NEVER a gate prerequisite — it is bonus-only (injected at F2 on a cache HIT),
68
+ so a missing `postgres-pattern.md` never fails the gate or forces a fallback.
69
+
70
+ **Any gate FAILED** → announce which prerequisite failed in one line, then
71
+ hand off to orc-mini via the fallback contract below. Never stop the chat.
72
+
73
+ **c. Gotchas — NOT a gate.** Two prerequisites stay two: a missing `.claude/orc/gotchas.md` never forces a fallback. Fast READS repair memory (`orc gotcha status`, then inject the SCOPE-MATCHING entries into the F2 slice, cap 3) and never WRITES it — `../_shared/gotchas.md` §10. The code graph is NOT a gate either (e. below).
74
+
75
+ **e. Code graph cache — NOT a gate, and never skipped** (`../_shared/code-graph.md` §0). Every call carries
76
+ `--if-enabled`: exit 3 = off → print `graph: off` once, make no other graph call. Print each JSON `line`; put
77
+ each `trace` in the next packet VERBATIM. (1) **Here:** `orc graph status --if-enabled --heal --json` builds or
78
+ updates the cache itself. (2) **F2 slice:** ONE `orc graph ctx <declared files> --if-enabled --json` → its `card`
79
+ is the `graph` block; the return carries `graph_used`. (3) **F3 GREEN:** `orc graph update --if-enabled --json`,
80
+ then one `orc graph notes pending` batch — the next run starts from this cache. A missing graph never falls back.
81
+
82
+ **d. Extra — a PROBE, not a gate (P0).** Run `orc extra resolve --slot fast-executor --json` (0 = extra, 1 = Claude) — **a gate that is never probed is a gate that is always off**, and without this step the lane silently runs on Claude however `extra_enabled` and `orc extra role` were set. `extra` → print the `extra:` line HERE and carry the answer into F2; `claude` → print nothing, never fall back, never stop.
83
+
84
+ The SHAPE of these steps — the order, and the four rules that make it worth
85
+ having — is `../_shared/phases/preflight.md` (`core`). The probes
86
+ themselves are this lane's own and stay here.
87
+
88
+ ## Phase F1 — Fit gate + micro-intake (one pass, ONE user round-trip)
89
+
90
+ Draft a 3–5 line intent spec + 2–3 acceptance bullets. Judge fit: more than
91
+ one real task, ~5+ files, or core/security-sensitive surface → fallback to
92
+ orc-mini WITH the intent spec attached (no rework); emit a `GATE` line for the
93
+ verdict. Then the lane's ONLY pre-spawn ask — one combined confirmation:
94
+ preflight result + intent spec + acceptance bullets + "proceed?" (soft
95
+ sign-off; never split into multiple questions). Create the run folder
96
+ (`.claude/orc/run/{run-slug}/` — shared format, so fallback needs no
97
+ migration) and write the intent-spec + a minimal checkpoint.
98
+
99
+ ## Phase F2 — Slice build + dispatch (ONE executor)
100
+
101
+ Build one slice for `orc-executor-sonnet-4-6-high` (dispatch BY NAME; model
102
+ pinned in the agent file). **Under `opus5_only` it is `orc-executor-opus-5-low`** — forced, and while that mode is on this lane needs an Opus 5 main session, so the "runs fine at Sonnet medium" premise applies only with it off (`../_shared/opus5-only.md`).
103
+
104
+ **Extra (`extra_enabled`, `../_shared/extra-dispatch.md`):** the same slice may run off Claude. **This lane has no score at all, so it holds a POSITION, not a band:** resolve `orc extra resolve --slot fast-executor --json` (set with `orc extra role set fast-executor <profile>/<model>`). No row on that slot = Claude, and that is an answer, not a gap. The `extra:` line joins the F0 preflight (P0, printed whenever the gate is on) and NAMES the agent it displaces — `orc-executor-sonnet-4-6-high`; dispatch through `orc extra dispatch --task <file> --json` with `slot: "fast-executor"` and **no `score`** (both is refused by name); validate with `return-validation.md` **§2b, not §2**; a failure runs `orc extra reconcile <task_id>` FIRST — a worktree that moved is RESUMED, never re-done — then falls back to that same pinned agent BY NAME, announced. Extra is orthogonal to the knowledge gate — a fresh wiki and a cached pattern are still required, and a foreign worker gets the same pointers-not-content slice.
105
+
106
+ - the task (intent spec) + acceptance bullets as definition-of-done
107
+ - **wiki pointers, not content** (fast's lane-delta in
108
+ `../_shared/phases/wiki-consult.md`): the PATHS of 1–3 relevant pages
109
+ selected from `wiki/INDEX.md` by keyword match — prefer the cross-cutting
110
+ maps (`orc-reference-api-surface` etc.) when the domain matches. Instruct
111
+ the executor to READ them first, and include the precedence line verbatim:
112
+ `code > fresh wiki > stale wiki (hints) > model priors`. Never paste wiki
113
+ bodies into the slice (a Sonnet-medium orchestrator curating wiki prose
114
+ defeats the lane). **Emit `WIKI-CONSULT <tier> :: docs=<the selected pointer
115
+ paths>`** (tier from the F0 gate; `docs=none` if no pages fit) — the F0
116
+ `GATE` line captured the gate *decision*; this captures which pages grounded
117
+ the run.
118
+ - the cached pattern injected LITERALLY (same `pattern` slice contract as
119
+ full; the pattern file is small by design)
120
+ - **crosslink (cross-repo, advisory):** a task touching a boundary in
121
+ `.claude/orc/crosslink/needs.json` gets the cached linked contract injected
122
+ as `crosslink` ("hints, not verified") — advisory, never blocks, never
123
+ outranks local code.
124
+ - **`db:postgres` bonus:** a data-access task with
125
+ `.claude/orc/patterns/postgres-pattern.md` CACHED merges it into the same
126
+ `pattern` slice (query invariants). Cache MISS → skip silently — fast never
127
+ codifies and never falls back on this.
128
+ - **the read ladder** (`../_shared/read-ladder.md`): read only as far up as the
129
+ question needs — a file the task will EDIT is read in full first. Precomputed
130
+ knowledge REPLACING exploration is this lane; a directory sweep is not. With the graph on, `orc graph ctx` cards locate first.
131
+ - the standing `house_rules` card (`../_shared/phases/house-rules.md`, literal,
132
+ same as full/mini) + the `rules_card` under it (`orc rules slice` → `text`, verbatim)
133
+ - constraints from the intent spec
134
+ - **terse-return rule:** standard contract fields, NO narrative prose — files
135
+ changed, one-line diff summary, smoke-relevant notes only.
136
+
137
+ Validate the return per `../_shared/return-validation.md` — `unmet[]`
138
+ honesty, `pattern_version` + `invariants_checked` attestation, `actual_model`
139
+ / `actual_effort` downgrade check (emit the `VERIFY` trace line), and §6's worktree delta (`git status --short` before/after; a path changed outside `declared_files` is a violation whatever the return said). Malformed
140
+ return = failure (one re-dispatch, then fallback offer).
141
+
142
+ **Before any re-dispatch, run `orc run inflight`** (0 clear · 1 in-flight · 2 unknown). A Task error does not kill the agent behind it, and exit 2 REFUSES by default — `a lane that re-dispatches over a live attempt` has broken the contract. Canonical: `../_shared/return-validation.md`.
143
+
144
+ ## Phase F3 — Smoke gate (build + test; blocks ship on red)
145
+
146
+ Run the gate per `../_shared/smoke-gate.md`, sourcing commands **from
147
+ `wiki-meta.json`'s `commands` block** (recorded at wiki scan — don't
148
+ rediscover tooling; manifest lacks them → detect once and say so). **GREEN**
149
+ → code-graph step e.(3) (never a gate) → ship. **RED** → one repair round; second red → STOP and offer: escalate to
150
+ orc-mini (reason `smoke-red-escalation`) / switch to full `/orc` / stop.
151
+ Docs-only → gate N/A, say so.
152
+
153
+ ## Phase F3.5 — Mock example (config `mock_example`, default ask)
154
+
155
+ Canonical: `../_shared/drift-recovery.md` — load on fire. Only after a GREEN
156
+ F3, before ship: `ask` → MANDATORY offer · `on` → build · `off` → skip.
157
+ Deliverable `mock-examples/<change-slug>/` at project root — **never
158
+ committed/staged**. Drift answer → `DRIFT-FROM` recovery (cap 2 loops, honest
159
+ report on cap). Trace: `PHASE mock-example`, `DRIFT loop=<n>`.
160
+
161
+ ## Phase F4 — Ship
162
+
163
+ Offer commit (push if asked; never stage `mock-examples/`). Append the final markers to the checkpoint, emit
164
+ `OUTCOME task=… band=fast model=… retries=… unmet=…` + `FINISH`, show the
165
+ dispatch line (model/effort actually used) + the `/usage` reminder. Fast never
166
+ triggers the post-ship wiki refresh ask (preflight polices freshness on the
167
+ way in) — the passive stale-flag note still applies to touched covered files.
168
+
169
+ ## Fallback contract (orc-fast → orc-mini)
170
+
171
+ Follow the writer side of `../_shared/fallback-handoff.md`: announce the
172
+ failed gate in one line, write the `FALLBACK-FROM` block into the run folder
173
+ (REASON: wiki-absent | wiki-stale-user-choice | pattern-absent | fit-gate |
174
+ smoke-red-escalation), and invoke orc-mini pointing at it. The run folder is
175
+ already in the shared format — no migration.
176
+
177
+ ## Behavior trace (always on)
178
+
179
+ `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases` names
180
+ the file and the layers). Lane token `fast`, tier **Build lanes** —
181
+ per phase, batched to **2 packets** (preflight+dispatch · gate+ship), each
182
+ paired with the next phase's first dispatch.
183
+ At run start write `log_dir/.current` = `run-fast-<slug>-<DDMMYY>-<HHMMSS>.txt` AND
184
+ `touch the trace file` of that name in the SAME step.
185
+ Nothing else about the protocol is restated here; a phase that ends with
186
+ `zero new trace lines is a protocol violation`.
187
+
188
+ ## Config
189
+
190
+ **ONE resolver, and it is not you:** `orc lane config orc-fast --json`. Obey
191
+ `effective`, print every line in `announce[]` VERBATIM at preflight, and honour
192
+ `stops[]` before wave 1. Never re-derive a value, a precedence or an inertness
193
+ from `.claude/orc.config.yaml` — a key this lane does not read is not in the
194
+ answer, and a key another key shadows comes back already marked. Exit ≠ 0 → say
195
+ the CLI is unavailable and fall back to `../_shared/config-precedence.md`'s
196
+ documented defaults, out loud. Priorities and families:
197
+ `../_shared/config-precedence.md`.
198
+
199
+ Fast has no config key of its own — command-entry only; wave/scoring/review
200
+ keys never apply, and the tier edges the F0 gate reads arrive resolved.
201
+
202
+ ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
203
+
204
+ `orc rules slice --lane orc-fast --json` is the ONLY assembler; never build
205
+ the card here. It rides under the house rules and above the task —
206
+ **house rules > your project's rules > ORC's own packs** — and its `line` prints
207
+ VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
208
+ never a silent choice) and `rules_overridden[]`.
209
+ ## Calls
210
+
211
+ **ONE catalogue, and it is not you:** `orc lane calls orc-fast --json` names every
212
+ CLI call this lane makes, each with its exit-code contract, its cost, when to run
213
+ it, and what an EMPTY answer means. Never invent a spelling, never re-word an
214
+ exit code, and never re-derive a state word — the CLI's state words are the only
215
+ state words, and **an exit code is an ANSWER wherever that contract says so, not
216
+ a failure**. A call the answer does not name is a call this lane does not make.
217
+ Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
218
+ command you are about to run, out loud, before running it.
219
+
220
+ ## Checkpoint (minimal, append-only)
221
+
222
+ One `fast-checkpoint.md` in the run folder: GATE results (+ any
223
+ `wiki_stale_override`), the dispatch, smoke verdicts, OUTCOME — enough for
224
+ /orc-retro mining and fresh-session resume, nothing more.
225
+
226
+ ## What fast still enforces (from the main hard rules)
227
+
228
+ Never implement yourself (smoke gate = read-only build+test) · all artifacts
229
+ in the run subfolder, never project root · validate the subagent return
230
+ (malformed = failure) · never offer commit on a red build · report the
231
+ dispatch + remind the user to run `/usage` (never invoke it programmatically).
232
+
233
+ ## Waiting mid-run (`/orc-wait`)
234
+
235
+ Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
236
+ 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.