@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
@@ -1,210 +1,213 @@
1
- ---
2
- name: orc-fast
3
- description: >
4
- Fastest ORC lane — knowledge-gated single-executor implementation, with no
5
- analyst and no planner. Use for "use orc-fast to implement X" or "/orc-fast".
6
- Requires TWO prerequisites: a fresh project wiki (orc-wiki) AND a cached
7
- code-pattern for the request's language. If either is missing, it falls back
8
- to orc-mini. One Sonnet 5 medium executor, a build+test smoke gate, one repair
9
- round, ship.
10
- ---
11
-
12
- # ORC-FAST
13
-
14
- The speed lane: precomputed knowledge instead of pipeline phases — the wiki
15
- supplies grounding, the pattern cache supplies house style, so fast pays for
16
- neither an analyst nor a planner. That trade only holds when both exist and
17
- the wiki is fresh, so the two prerequisite gates below are hard: fail either →
18
- **fall back to orc-mini** carrying whatever intake was done. Fallback is the
19
- router — orc-fast is always safe to try.
20
-
21
- Runs fine with the orchestrator at **Sonnet 5, medium effort** (a Sonnet 4.6 main session is below the executor pin) —
22
- no scoring, no planning judgment (the effort guard only gates the full `orc`
23
- skill). **You never implement — you spawn.**
24
-
25
- ## What fast deliberately does NOT have
26
-
27
- No analyst, planner, scoring, waves, reviewer, verifier, test-author, or
28
- summary. One executor, one smoke gate, one repair round. More than that → the
29
- fit gate hands it to orc-mini.
30
-
31
- ## Phases
32
-
33
- `orc lane phases orc-fast --json` is this lane's pipeline. **The CLI owns the order**:
34
- never derive it from the headings below, and never rename or renumber one
35
- without the manifest (`../_shared/lane-contract.md` §Phases).
36
-
37
- ## Phase F0 — Preflight (the two prerequisite gates; no spawn)
38
-
39
- Emit a `GATE` trace line per check.
40
-
41
- **0. Config, FIRST.** `orc lane config orc-fast --json`: obey `effective`, print
42
- `announce[]` VERBATIM, honour `stops[]`; never merge `.claude/orc.config.yaml`
43
- (`../_shared/config-precedence.md`). **`habits{}` in it → print `habits.line`,
44
- read `../_shared/habits.md` NOW.**
45
-
46
- **a. Wiki gate.** Decide existence with `orc wiki status` — the deterministic
47
- probe in `../_shared/detecting-artifacts.md`, never an ad-hoc `find` (`.claude`
48
- is hidden). `none` = gate FAILED → fallback; else read the tier from
49
- `orc wiki status --json` → `.tier` (FRESH / AGING / STALE; the CLI computes
50
- it — never recompute it by hand).
51
- - **FRESH** → proceed silently. **AGING** → one-line notice, proceed.
52
- - **STALE** → the user judges. Ask (H `fast.f0.stale-wiki`) 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 --brief` builds or
78
- updates the cache itself. (2) **F2 slice:** ONE `orc graph ctx <declared files> --if-enabled --json --brief` → its `card`
79
- is the `graph` block; the return carries `graph_used`. (3) **F3 GREEN:** `orc graph update --if-enabled --json --brief`,
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
- Their shape and four rules: `../_shared/phases/preflight.md` (`core`). The
85
- probes are this lane's own.
86
-
87
- ## Phase F1 — Fit gate + micro-intake (one pass, ONE user round-trip)
88
-
89
- Draft a 3–5 line intent spec + 2–3 acceptance bullets. Judge fit: more than
90
- one real task, ~5+ files, or core/security-sensitive surface → fallback to
91
- orc-mini WITH the intent spec attached (no rework); emit a `GATE` line for the
92
- verdict. Then the lane's ONLY pre-spawn ask — one combined confirmation:
93
- preflight result + intent spec + acceptance bullets + "proceed?" (soft
94
- sign-off; never split into multiple questions). Create the run folder
95
- (`.claude/orc/run/{run-slug}/` — shared format, so fallback needs no
96
- migration) and write the intent-spec + a minimal checkpoint.
97
-
98
- ## Phase F2 — Slice build + dispatch (ONE executor)
99
-
100
- Build one slice for `orc-executor-sonnet-5-med` (dispatch BY NAME; model
101
- 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.5 main session, so the "runs fine at Sonnet medium" premise applies only with it off (`../_shared/opus5-only.md`).
102
-
103
- **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.
104
-
105
- - the task (intent spec) + acceptance bullets as definition-of-done
106
- - **wiki pointers, not content** (fast's lane-delta in
107
- `../_shared/phases/wiki-consult.md`): the PATHS of 1–3 relevant pages
108
- selected from `wiki/INDEX.md` by keyword match — prefer the cross-cutting
109
- maps (`orc-reference-api-surface` etc.) when the domain matches. Instruct
110
- the executor to READ them first, and include the precedence line verbatim:
111
- `code > fresh wiki > stale wiki (hints) > model priors`. Never paste wiki
112
- bodies into the slice (a Sonnet-medium orchestrator curating wiki prose
113
- defeats the lane). **Emit `WIKI-CONSULT <tier> :: docs=<the selected pointer
114
- paths>`** (tier from the F0 gate; `docs=none` if no pages fit) — the F0
115
- `GATE` line captured the gate *decision*; this captures which pages grounded
116
- the run.
117
- - the cached pattern injected LITERALLY (same `pattern` slice contract as
118
- full; the pattern file is small by design)
119
- - **crosslink (cross-repo, advisory):** a task touching a boundary in
120
- `.claude/orc/crosslink/needs.json` gets the cached linked contract injected
121
- as `crosslink` ("hints, not verified") — advisory, never blocks, never
122
- outranks local code.
123
- - **`db:postgres` bonus:** a data-access task with
124
- `.claude/orc/patterns/postgres-pattern.md` CACHED merges it into the same
125
- `pattern` slice (query invariants). Cache MISS → skip silently — fast never
126
- codifies and never falls back on this.
127
- - **the read ladder** (`../_shared/read-ladder.md`): read only as far up as the
128
- question needs — a file the task will EDIT is read in full first. Precomputed
129
- knowledge REPLACING exploration is this lane; a directory sweep is not. With the graph on, `orc graph ctx` cards locate first.
130
- - the standing `house_rules` card (`../_shared/phases/house-rules.md`, literal,
131
- same as full/mini) + the `rules_card` under it (`orc rules slice` → `text`, verbatim)
132
- - constraints from the intent spec
133
- - **terse-return rule:** standard contract fields, NO narrative prose — files
134
- changed, one-line diff summary, smoke-relevant notes only.
135
-
136
- Validate the return per `../_shared/return-validation.md` §1–§3 + the § of
137
- each field you injected — `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`**. 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** → the flaky check, then 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
- After a GREEN F3, before ship (H `fast.f3-5.mock`): follow `../_shared/drift-recovery.md` (load on
156
- fire) — the `mock-examples/<change-slug>/` deliverable, the `DRIFT-FROM` loop and
157
- its cap. Trace: `PHASE mock-example`, `DRIFT loop=<n>`.
158
-
159
- ## Phase F4 — Ship
160
-
161
- Offer commit (H `fast.f4.ship` · `any.ship.review-before-push`; push if asked; never stage `mock-examples/`). Append the final markers to the checkpoint, emit
162
- `OUTCOME task=… band=fast model=… retries=… unmet=…` + `FINISH`, show the
163
- dispatch line (model/effort actually used) + the `/usage` reminder. Every end — ship
164
- or a red STOP — prints the card (`../_shared/phases/summary.md` §End-of-run card). Fast never
165
- triggers the post-ship wiki refresh ask (preflight polices freshness on the
166
- way in) — the passive stale-flag note still applies to touched covered files.
167
-
168
- ## Fallback contract (orc-fast → orc-mini)
169
-
170
- Follow the writer side of `../_shared/fallback-handoff.md`: announce the
171
- failed gate in one line, write the `FALLBACK-FROM` block into the run folder
172
- (REASON: wiki-absent | wiki-stale-user-choice | pattern-absent | fit-gate |
173
- smoke-red-escalation), and invoke orc-mini pointing at it. The run folder is
174
- already in the shared format — no migration.
175
-
176
- ## Behavior trace (always on)
177
-
178
- `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases orc-fast --json` →
179
- `trace_grammar` gives the verbs). Lane token `fast`, tier
180
- **Build lanes** — batched to **2 packets** (preflight+dispatch ·
181
- gate+ship) → `orc trace write --packet -`. At run start write `log_dir/.current` =
182
- `run-fast-<slug>-<DDMMYY>-<HHMMSS>.txt` AND `touch the trace file` of that name
183
- in the SAME step. A phase that ends with `zero new trace lines is a protocol violation`.
184
-
185
- ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
186
-
187
- - **Calls:** `orc lane calls orc-fast --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.
189
- - **Config:** F0 step 0.
190
- - **Rules:** `orc rules slice --lane orc-fast --json` is the ONLY assembler
191
- (`../_shared/phases/rules.md`). Its `line` prints VERBATIM at preflight.
192
-
193
- Fast has no config key of its own — command-entry only; wave/scoring/review
194
- keys never apply, and the tier edges the F0 gate reads arrive resolved.
195
-
196
- ## Checkpoint (minimal, append-only)
197
-
198
- One `fast-checkpoint.md` in the run folder: GATE results (+ any
199
- `wiki_stale_override`), the dispatch, smoke verdicts, OUTCOME — enough for
200
- /orc-retro mining and fresh-session resume, nothing more.
201
-
202
- ## What fast still enforces
203
-
204
- All artifacts in the run subfolder, never project root · never offer commit on
205
- a red build · never invoke `/usage` programmatically.
206
-
207
- ## Waiting mid-run (`/orc-wait`)
208
-
209
- Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
210
- Checkpoint **full** · safe point **after the executor returns**.
1
+ ---
2
+ name: orc-fast
3
+ description: >
4
+ Fastest ORC lane — knowledge-gated single-executor implementation, with no
5
+ analyst and no planner. Use for "use orc-fast to implement X" or "/orc-fast".
6
+ Requires TWO prerequisites: a fresh project wiki (orc-wiki) AND a cached
7
+ code-pattern for the request's language. If either is missing, it falls back
8
+ to orc-mini. One Sonnet 5 medium executor, a build+test smoke gate, one repair
9
+ round, ship.
10
+ ---
11
+
12
+ # ORC-FAST
13
+
14
+ The speed lane: precomputed knowledge instead of pipeline phases — the wiki
15
+ supplies grounding, the pattern cache supplies house style, so fast pays for
16
+ neither an analyst nor a planner. That trade only holds when both exist and
17
+ the wiki is fresh, so the two prerequisite gates below are hard: fail either →
18
+ **fall back to orc-mini** carrying whatever intake was done. Fallback is the
19
+ router — orc-fast is always safe to try.
20
+
21
+ Runs fine with the orchestrator at **Sonnet 5, medium effort** (a Sonnet 4.6 main session is below the executor pin) —
22
+ no scoring, no planning judgment (the effort guard only gates the full `orc`
23
+ skill). **You never implement — you spawn.**
24
+
25
+ ## What fast deliberately does NOT have
26
+
27
+ No analyst, planner, scoring, waves, reviewer, verifier, test-author, or
28
+ summary. One executor, one smoke gate, one repair round. More than that → the
29
+ fit gate hands it to orc-mini.
30
+
31
+ ## Phases
32
+
33
+ `orc lane phases orc-fast --json` is this lane's pipeline. **The CLI owns the order**:
34
+ never derive it from the headings below, and never rename or renumber one
35
+ without the manifest (`../_shared/lane-contract.md` §Phases).
36
+
37
+ ## Phase F0 — Preflight (the two prerequisite gates; no spawn)
38
+
39
+ Emit a `GATE` trace line per check.
40
+
41
+ **0. Config, FIRST.** `orc lane config orc-fast --json`: obey `effective`, print
42
+ `announce[]` VERBATIM, honour `stops[]`; never merge `.claude/orc.config.yaml`
43
+ (`../_shared/config-precedence.md`). **`habits{}` in it → print `habits.line`,
44
+ read `../_shared/habits.md` NOW.**
45
+
46
+ **a. Wiki gate.** Decide existence with `orc wiki status` — the deterministic
47
+ probe in `../_shared/detecting-artifacts.md`, never an ad-hoc `find` (`.claude`
48
+ is hidden). `none` = gate FAILED → fallback; else read the tier from
49
+ `orc wiki status --json` → `.tier` (FRESH / AGING / STALE; the CLI computes
50
+ it — never recompute it by hand).
51
+ - **FRESH** → proceed silently. **AGING** → one-line notice, proceed.
52
+ - **STALE** → the user judges. Ask (H `fast.f0.stale-wiki`) 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` or `semi`) → print the probe line once, make no other graph call. Print each JSON `line`; put
77
+ each `trace` in the next packet VERBATIM. (1) **Consult, here:** print `probes["graph-status"].line`; run
78
+ `orc graph status --if-enabled --heal --json --brief` only when `heal_needed` is true. (2) **F2 anchors:** ONE
79
+ `orc graph ctx --for-slice <declared files> --focus=<3–6 words> [--refs=<copy-from files>] --anchors --if-enabled --json --brief` (a request that names one symbol: `ctx <symbol> --anchors` gives the card and the anchors in one call)
80
+ → print its `line`; paste its `card` into the slice VERBATIM as `graph_anchors`, with its `read all: …` line and its code block — never shorten it (exit 3 or 4, or one named file with no outside change → none); the return carries `graph_used`.
81
+ (3) **F3, before the suite:** `orc graph changes --files=<actual files> --if-enabled --json --brief` → print `tests_line`,
82
+ run its `tests[]` first, then the suite, then print `blast_line`. (4) **F3 GREEN:** `orc graph update --notes-pending --files
83
+ <actual files> --if-enabled --json --brief` ONLY when `update_step` is `lane`. No lane runs the gain meter. A missing graph never falls back.
84
+
85
+ **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.
86
+
87
+ Their shape and four rules: `../_shared/phases/preflight.md` (`core`). The
88
+ probes are this lane's own.
89
+
90
+ ## Phase F1 — Fit gate + micro-intake (one pass, ONE user round-trip)
91
+
92
+ Draft a 3–5 line intent spec + 2–3 acceptance bullets. Judge fit: more than
93
+ one real task, ~5+ files, or core/security-sensitive surface → fallback to
94
+ orc-mini WITH the intent spec attached (no rework); emit a `GATE` line for the
95
+ verdict. Then the lane's ONLY pre-spawn ask — one combined confirmation:
96
+ preflight result + intent spec + acceptance bullets + "proceed?" (soft
97
+ sign-off; never split into multiple questions). Create the run folder
98
+ (`.claude/orc/run/{run-slug}/` — shared format, so fallback needs no
99
+ migration) and write the intent-spec + a minimal checkpoint.
100
+
101
+ ## Phase F2 — Slice build + dispatch (ONE executor)
102
+
103
+ Build one slice for `orc-executor-sonnet-5-med` (dispatch BY NAME; model
104
+ 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.5 main session, so the "runs fine at Sonnet medium" premise applies only with it off (`../_shared/opus5-only.md`).
105
+
106
+ **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-5-med`; 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.
107
+
108
+ - the task (intent spec) + acceptance bullets as definition-of-done
109
+ - **wiki pointers, not content** (fast's lane-delta in
110
+ `../_shared/phases/wiki-consult.md`): the PATHS of 1–3 relevant pages
111
+ selected from `wiki/INDEX.md` by keyword match (With `graph_anchors` in the slice, list at most ONE wiki page path (the one about the feature's intent), not 1–3) — prefer the cross-cutting
112
+ maps (`orc-reference-api-surface` etc.) when the domain matches. Instruct
113
+ the executor to READ them first, and include the precedence line verbatim:
114
+ `code > fresh wiki > stale wiki (hints) > model priors`. Never paste wiki
115
+ bodies into the slice (a Sonnet-medium orchestrator curating wiki prose
116
+ defeats the lane). **Emit `WIKI-CONSULT <tier> :: docs=<the selected pointer
117
+ paths>`** (tier from the F0 gate; `docs=none` if no pages fit) — the F0
118
+ `GATE` line captured the gate *decision*; this captures which pages grounded
119
+ the run.
120
+ - the cached pattern injected LITERALLY (same `pattern` slice contract as
121
+ full; the pattern file is small by design)
122
+ - **crosslink (cross-repo, advisory):** a task touching a boundary in
123
+ `.claude/orc/crosslink/needs.json` gets the cached linked contract injected
124
+ as `crosslink` ("hints, not verified") — advisory, never blocks, never
125
+ outranks local code.
126
+ - **`db:postgres` bonus:** a data-access task with
127
+ `.claude/orc/patterns/postgres-pattern.md` CACHED merges it into the same
128
+ `pattern` slice (query invariants). Cache MISS → skip silently — fast never
129
+ codifies and never falls back on this.
130
+ - **the read ladder** (`../_shared/read-ladder.md`): read only as far up as the
131
+ question needs — a file the task will EDIT is read in full first. Precomputed
132
+ knowledge REPLACING exploration is this lane; a directory sweep is not. With the graph on, the `graph_anchors` locate first.
133
+ - the standing `house_rules` card (`../_shared/phases/house-rules.md`, literal,
134
+ same as full/mini) + the `rules_card` under it (`orc rules slice` → `text`, verbatim)
135
+ - constraints from the intent spec
136
+ - **terse-return rule:** standard contract fields, NO narrative prose — files
137
+ changed, one-line diff summary, smoke-relevant notes only.
138
+
139
+ Validate the return per `../_shared/return-validation.md` §1–§3 + the § of
140
+ each field you injected — `unmet[]`
141
+ honesty, `pattern_version` + `invariants_checked` attestation, `actual_model`
142
+ / `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
143
+ return = failure (one re-dispatch, then fallback offer).
144
+
145
+ **Before any re-dispatch, run `orc run inflight`**. 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`.
146
+
147
+ ## Phase F3 — Smoke gate (build + test; blocks ship on red)
148
+
149
+ Run the gate per `../_shared/smoke-gate.md`, sourcing commands **from
150
+ `wiki-meta.json`'s `commands` block** (recorded at wiki scan — don't
151
+ rediscover tooling; manifest lacks them → detect once and say so). **GREEN**
152
+ → code-graph step e.(4) (never a gate) → ship. **RED** → the flaky check, then one repair round; second red → STOP and offer: escalate to
153
+ orc-mini (reason `smoke-red-escalation`) / switch to full `/orc` / stop.
154
+ Docs-only → gate N/A, say so.
155
+
156
+ ## Phase F3.5 — Mock example (config `mock_example`, default ask)
157
+
158
+ After a GREEN F3, before ship (H `fast.f3-5.mock`): follow `../_shared/drift-recovery.md` (load on
159
+ fire) — the `mock-examples/<change-slug>/` deliverable, the `DRIFT-FROM` loop and
160
+ its cap. Trace: `PHASE mock-example`, `DRIFT loop=<n>`.
161
+
162
+ ## Phase F4 — Ship
163
+
164
+ Offer commit (H `fast.f4.ship` · `any.ship.review-before-push`; push if asked; never stage `mock-examples/`). Append the final markers to the checkpoint, emit
165
+ `OUTCOME task=… band=fast model=… retries=… unmet=…` + `FINISH`, show the
166
+ dispatch line (model/effort actually used) + the `/usage` reminder. Every end — ship
167
+ or a red STOP — prints the card (`../_shared/phases/summary.md` §End-of-run card). Fast never
168
+ triggers the post-ship wiki refresh ask (preflight polices freshness on the
169
+ way in) — the passive stale-flag note still applies to touched covered files.
170
+
171
+ ## Fallback contract (orc-fast → orc-mini)
172
+
173
+ Follow the writer side of `../_shared/fallback-handoff.md`: announce the
174
+ failed gate in one line, write the `FALLBACK-FROM` block into the run folder
175
+ (REASON: wiki-absent | wiki-stale-user-choice | pattern-absent | fit-gate |
176
+ smoke-red-escalation), and invoke orc-mini pointing at it. The run folder is
177
+ already in the shared format — no migration.
178
+
179
+ ## Behavior trace (always on)
180
+
181
+ `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases orc-fast --json` →
182
+ `trace_grammar` gives the verbs). Lane token `fast`, tier
183
+ **Build lanes** — batched to **2 packets** (preflight+dispatch ·
184
+ gate+ship) → `orc trace write --packet -`. At run start write `log_dir/.current` =
185
+ `run-fast-<slug>-<DDMMYY>-<HHMMSS>.txt` AND `touch the trace file` of that name
186
+ in the SAME step. A phase that ends with `zero new trace lines is a protocol violation`.
187
+
188
+ ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
189
+
190
+ - **Calls:** `orc lane calls orc-fast --json` names shared calls and exit codes.
191
+ **An exit code is an ANSWER where it says so, not a failure.** Own calls are here; make no other.
192
+ - **Config:** F0 step 0.
193
+ - **Rules:** `orc rules slice --lane orc-fast --json` is the ONLY assembler
194
+ (`../_shared/phases/rules.md`). Its `line` prints VERBATIM at preflight.
195
+
196
+ Fast has no config key of its own — command-entry only; wave/scoring/review
197
+ keys never apply, and the tier edges the F0 gate reads arrive resolved.
198
+
199
+ ## Checkpoint (minimal, append-only)
200
+
201
+ One `fast-checkpoint.md` in the run folder: GATE results (+ any
202
+ `wiki_stale_override`), the dispatch, smoke verdicts, OUTCOME — enough for
203
+ /orc-retro mining and fresh-session resume, nothing more.
204
+
205
+ ## What fast still enforces
206
+
207
+ All artifacts in the run subfolder, never project root · never offer commit on
208
+ a red build · never invoke `/usage` programmatically.
209
+
210
+ ## Waiting mid-run (`/orc-wait`)
211
+
212
+ Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
213
+ Checkpoint **full** · safe point **after the executor returns**.