@azure-id/orc 2.0.2 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/CHANGELOG.md +455 -0
  2. package/README-id.md +52 -23
  3. package/README.md +36 -20
  4. package/bin/build-agents.js +205 -206
  5. package/bin/clear-logs.js +620 -0
  6. package/bin/cli.js +47417 -46420
  7. package/bin/fix.js +459 -0
  8. package/bin/gotcha.js +288 -8
  9. package/bin/habit.js +1538 -1453
  10. package/bin/mockrun-catalog.js +3 -0
  11. package/bin/onboarding-content.js +2 -1
  12. package/bin/pricing.json +28 -21
  13. package/bin/trace-write.js +869 -657
  14. package/bin/verify-contracts.js +5552 -5471
  15. package/bin/verify-package.js +716 -705
  16. package/bin/webui/api.js +125 -6
  17. package/bin/webui/css/panels/hookui.css +79 -0
  18. package/bin/webui/fixtures/behaviour.js +30 -0
  19. package/bin/webui/fixtures/extra.js +2036 -2036
  20. package/bin/webui/fixtures/flow.js +81 -81
  21. package/bin/webui/fixtures/hookui.js +506 -431
  22. package/bin/webui/fixtures/index.js +32 -3
  23. package/bin/webui/fixtures/knowledge.js +2 -2
  24. package/bin/webui/fixtures/maintenance.js +123 -42
  25. package/bin/webui/fixtures/rules.js +1007 -1002
  26. package/bin/webui/fixtures/settings.js +6 -7
  27. package/bin/webui/fixtures/stats.js +9 -6
  28. package/bin/webui/fixtures/wait.js +98 -97
  29. package/bin/webui/i18n/en/behaviour.json +13 -0
  30. package/bin/webui/i18n/en/hookui.json +290 -194
  31. package/bin/webui/i18n/en/maintenance.json +71 -52
  32. package/bin/webui/i18n/en/settings.json +60 -60
  33. package/bin/webui/i18n/id/behaviour.json +13 -0
  34. package/bin/webui/i18n/id/hookui.json +290 -194
  35. package/bin/webui/i18n/id/maintenance.json +71 -52
  36. package/bin/webui/i18n/id/settings.json +60 -60
  37. package/bin/webui/js/05-banners.js +181 -172
  38. package/bin/webui/js/06-edit.js +193 -183
  39. package/bin/webui/js/panels/behaviour.js +77 -12
  40. package/bin/webui/js/panels/hookui.js +2196 -1691
  41. package/bin/webui/js/panels/maintenance.js +336 -235
  42. package/bin/webui/js/panels/settings.js +726 -719
  43. package/mock-run/INDEX.md +1 -0
  44. package/mock-run/a-normal-day.md +2 -2
  45. package/mock-run/extra-slots.md +177 -177
  46. package/mock-run/habits.md +1 -1
  47. package/mock-run/orc-aftermath.md +392 -392
  48. package/mock-run/orc-budget.md +29 -33
  49. package/mock-run/orc-cli.md +200 -200
  50. package/mock-run/orc-explain.md +86 -86
  51. package/mock-run/orc-extra.md +389 -392
  52. package/mock-run/orc-fast.md +2 -2
  53. package/mock-run/orc-fix.md +87 -0
  54. package/mock-run/orc-pattern.md +112 -112
  55. package/mock-run/orc-quick.md +146 -146
  56. package/mock-run/orc.md +4 -4
  57. package/package.json +1 -1
  58. package/templates/agents/MODEL-MAPPING.md +176 -173
  59. package/templates/agents/orc-analyze-mini-sonnet-5-high.md +2 -2
  60. package/templates/agents/{orc-claude-writer-opus-5-med.md → orc-claude-writer-opus-5-low.md} +4 -4
  61. package/templates/agents/orc-executor-haiku-4-5.md +1 -1
  62. package/templates/agents/orc-executor-opus-5-low.md +1 -1
  63. package/templates/agents/orc-executor-sonnet-4-6-high.md +1 -1
  64. package/templates/agents/orc-executor-sonnet-4-6-med.md +1 -1
  65. package/templates/agents/orc-executor-sonnet-5-high.md +2 -2
  66. package/templates/agents/orc-executor-sonnet-5-low.md +155 -0
  67. package/templates/agents/orc-executor-sonnet-5-med.md +155 -0
  68. package/templates/agents/orc-pattern-codifier-sonnet-5-high.md +2 -2
  69. package/templates/agents/orc-planner-mini-sonnet-5-high.md +2 -2
  70. package/templates/agents/{orc-recon-sonnet-4-6-med.md → orc-recon-sonnet-5-med.md} +4 -4
  71. package/templates/agents/orc-retro-sonnet-5-high.md +2 -2
  72. package/templates/agents/{orc-reviewer-opus-5-med.md → orc-reviewer-opus-5-low.md} +4 -4
  73. package/templates/agents/{orc-wiki-scanner-opus-5-med.md → orc-wiki-scanner-opus-5-low.md} +3 -3
  74. package/templates/agents/orc-wiki-scanner-sonnet-5-high.md +2 -2
  75. package/templates/commands/orc-fast.md +10 -10
  76. package/templates/commands/orc-fix.md +18 -0
  77. package/templates/commands/orc-wiki.md +64 -64
  78. package/templates/hooks/README.md +75 -7
  79. package/templates/hooks/orc-session-hook.js +78 -3
  80. package/templates/hooks/orc-statusline-render.js +317 -23
  81. package/templates/hooks/orc-statusline.js +162 -49
  82. package/templates/hooks/orc-subagent-line.js +23 -5
  83. package/templates/hooks/orc-weather-fetch.js +123 -0
  84. package/templates/skills/_shared/extra-dispatch.md +1331 -1331
  85. package/templates/skills/_shared/gotchas.md +27 -7
  86. package/templates/skills/_shared/habits.md +2 -2
  87. package/templates/skills/_shared/opus5-only.md +137 -137
  88. package/templates/skills/_shared/phases/review.md +2 -2
  89. package/templates/skills/_shared/phases/trace-verbs.md +17 -3
  90. package/templates/skills/_shared/phases/trace.md +136 -136
  91. package/templates/skills/_shared/review-slice.md +28 -1
  92. package/templates/skills/_shared/wait.md +1 -0
  93. package/templates/skills/orc/README.md +2 -2
  94. package/templates/skills/orc/SKILL.md +227 -227
  95. package/templates/skills/orc/config.md +25 -27
  96. package/templates/skills/orc/examples/full-run-mock.md +74 -73
  97. package/templates/skills/orc/references/effort-and-mode.md +222 -222
  98. package/templates/skills/orc/references/preflight-report.md +3 -3
  99. package/templates/skills/orc/references/ultra-mode.md +1 -1
  100. package/templates/skills/orc/schemas/checkpoint.md +122 -122
  101. package/templates/skills/orc/subskills/orc-review-verify/SKILL.md +3 -3
  102. package/templates/skills/orc/subskills/orc-review-verify/core.md +1 -1
  103. package/templates/skills/orc-analyze/SKILL.md +4 -2
  104. package/templates/skills/orc-claude/SKILL.md +14 -14
  105. package/templates/skills/orc-claude/examples/claude-run-mock.md +65 -65
  106. package/templates/skills/orc-diy/SKILL.md +5 -5
  107. package/templates/skills/orc-fast/SKILL.md +210 -208
  108. package/templates/skills/orc-fix/SKILL.md +110 -0
  109. package/templates/skills/orc-grill/SKILL.md +232 -232
  110. package/templates/skills/orc-grill/references/grill-doc.md +1 -1
  111. package/templates/skills/orc-mini/SKILL.md +4 -4
  112. package/templates/skills/orc-mini/examples/mini-run-mock.md +4 -2
  113. package/templates/skills/orc-quick/README.md +536 -536
  114. package/templates/skills/orc-quick/SKILL.md +2 -2
  115. package/templates/skills/orc-quick/references/context-doc.md +145 -145
  116. package/templates/skills/orc-quick/references/dispatch-gate.md +220 -219
  117. package/templates/skills/orc-quick/references/gh-mode.md +4 -2
  118. package/templates/skills/orc-retro/SKILL.md +1 -1
  119. package/templates/skills/orc-retro/examples/retro-mock.md +16 -16
  120. package/templates/skills/orc-wiki/README.md +325 -325
  121. package/templates/skills/orc-wiki/SKILL.md +195 -195
  122. package/templates/skills/orc-wiki/examples/wiki-run-mock.md +37 -37
  123. package/templates/skills/orc-wiki/references/extra.md +2 -2
  124. package/templates/skills/orc-wiki/references/partial-refresh.md +276 -271
  125. package/templates/skills/orc-wiki/references/phases/phase-0.md +1 -1
  126. package/templates/skills/orc-wiki/references/phases/phase-2.md +3 -3
  127. package/templates/skills/orc-wiki/references/phases/phase-3c.md +3 -2
  128. package/templates/agents/orc-claude-writer-opus-4-8-high.md +0 -48
  129. package/templates/agents/orc-wiki-scanner-opus-4-8-high.md +0 -74
@@ -1,208 +1,210 @@
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 4.6 high 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 4.6 / Sonnet 5, medium effort** —
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
- **a. Wiki gate.** Decide existence with `orc wiki status` — the deterministic
42
- probe in `../_shared/detecting-artifacts.md`, never an ad-hoc `find` (`.claude`
43
- is hidden). `none` = gate FAILED → fallback; else read the tier from
44
- `orc wiki status --json` → `.tier` (FRESH / AGING / STALE; the CLI computes
45
- it — never recompute it by hand).
46
- - **FRESH** → proceed silently. **AGING** → one-line notice, proceed.
47
- - **STALE** → the user judges. Ask (H `fast.f0.stale-wiki`) with exactly these options:
48
- 1. **Refresh wiki, then continue fast** *(recommended)* — run orc-wiki's
49
- incremental refresh (diff since `scan_commit`, re-scan only affected
50
- docs), then re-enter this preflight.
51
- 2. **Drop to orc-mini** *(preferable if in a hurry — mini grounds itself)*.
52
- 3. **Continue fast anyway** *(not recommended — the executor may follow
53
- stale claims)* — proceed and stamp `wiki_stale_override: true` in the
54
- checkpoint so /orc-retro can correlate outcomes with overrides.
55
-
56
- **b. Pattern gate.** Detect the request's language (file extensions / repo
57
- deps, same signals as the full lane's tagging) and confirm the cache with
58
- `orc pattern status <lang>` (exit 0 = cached — the deterministic probe in
59
- `../_shared/detecting-artifacts.md`, never an ad-hoc `find`). Absent for the
60
- language in play → gate FAILED → fallback. (A request touching no FE/BE language — pure docs/
61
- config — passes this gate as N/A.) The cross-cutting `postgres` pattern is
62
- NEVER a gate prerequisite — it is bonus-only (injected at F2 on a cache HIT),
63
- so a missing `postgres-pattern.md` never fails the gate or forces a fallback.
64
-
65
- **Any gate FAILED** → announce which prerequisite failed in one line, then
66
- hand off to orc-mini via the fallback contract below. Never stop the chat.
67
-
68
- **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).
69
-
70
- **e. Code graph cache — NOT a gate, and never skipped** (`../_shared/code-graph.md` §0). Every call carries
71
- `--if-enabled`: exit 3 = off → print `graph: off` once, make no other graph call. Print each JSON `line`; put
72
- each `trace` in the next packet VERBATIM. (1) **Here:** `orc graph status --if-enabled --heal --json --brief` builds or
73
- updates the cache itself. (2) **F2 slice:** ONE `orc graph ctx <declared files> --if-enabled --json --brief` → its `card`
74
- is the `graph` block; the return carries `graph_used`. (3) **F3 GREEN:** `orc graph update --if-enabled --json --brief`,
75
- then one `orc graph notes pending` batch — the next run starts from this cache. A missing graph never falls back.
76
-
77
- **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.
78
-
79
- The SHAPE of these steps — the order, and the four rules that make it worth
80
- having — is `../_shared/phases/preflight.md` (`core`). The probes
81
- themselves are this lane's own and stay here.
82
-
83
- ## Phase F1 — Fit gate + micro-intake (one pass, ONE user round-trip)
84
-
85
- Draft a 3–5 line intent spec + 2–3 acceptance bullets. Judge fit: more than
86
- one real task, ~5+ files, or core/security-sensitive surface → fallback to
87
- orc-mini WITH the intent spec attached (no rework); emit a `GATE` line for the
88
- verdict. Then the lane's ONLY pre-spawn ask — one combined confirmation:
89
- preflight result + intent spec + acceptance bullets + "proceed?" (soft
90
- sign-off; never split into multiple questions). Create the run folder
91
- (`.claude/orc/run/{run-slug}/` — shared format, so fallback needs no
92
- migration) and write the intent-spec + a minimal checkpoint.
93
-
94
- ## Phase F2 — Slice build + dispatch (ONE executor)
95
-
96
- Build one slice for `orc-executor-sonnet-4-6-high` (dispatch BY NAME; model
97
- 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`).
98
-
99
- **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.
100
-
101
- - the task (intent spec) + acceptance bullets as definition-of-done
102
- - **wiki pointers, not content** (fast's lane-delta in
103
- `../_shared/phases/wiki-consult.md`): the PATHS of 1–3 relevant pages
104
- selected from `wiki/INDEX.md` by keyword match — prefer the cross-cutting
105
- maps (`orc-reference-api-surface` etc.) when the domain matches. Instruct
106
- the executor to READ them first, and include the precedence line verbatim:
107
- `code > fresh wiki > stale wiki (hints) > model priors`. Never paste wiki
108
- bodies into the slice (a Sonnet-medium orchestrator curating wiki prose
109
- defeats the lane). **Emit `WIKI-CONSULT <tier> :: docs=<the selected pointer
110
- paths>`** (tier from the F0 gate; `docs=none` if no pages fit) — the F0
111
- `GATE` line captured the gate *decision*; this captures which pages grounded
112
- the run.
113
- - the cached pattern injected LITERALLY (same `pattern` slice contract as
114
- full; the pattern file is small by design)
115
- - **crosslink (cross-repo, advisory):** a task touching a boundary in
116
- `.claude/orc/crosslink/needs.json` gets the cached linked contract injected
117
- as `crosslink` ("hints, not verified") — advisory, never blocks, never
118
- outranks local code.
119
- - **`db:postgres` bonus:** a data-access task with
120
- `.claude/orc/patterns/postgres-pattern.md` CACHED merges it into the same
121
- `pattern` slice (query invariants). Cache MISS → skip silently — fast never
122
- codifies and never falls back on this.
123
- - **the read ladder** (`../_shared/read-ladder.md`): read only as far up as the
124
- question needs — a file the task will EDIT is read in full first. Precomputed
125
- knowledge REPLACING exploration is this lane; a directory sweep is not. With the graph on, `orc graph ctx` cards locate first.
126
- - the standing `house_rules` card (`../_shared/phases/house-rules.md`, literal,
127
- same as full/mini) + the `rules_card` under it (`orc rules slice` → `text`, verbatim)
128
- - constraints from the intent spec
129
- - **terse-return rule:** standard contract fields, NO narrative prose — files
130
- changed, one-line diff summary, smoke-relevant notes only.
131
-
132
- Validate the return per `../_shared/return-validation.md` §1–§3 + the § of
133
- each field you injected — `unmet[]`
134
- honesty, `pattern_version` + `invariants_checked` attestation, `actual_model`
135
- / `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
136
- return = failure (one re-dispatch, then fallback offer).
137
-
138
- **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`.
139
-
140
- ## Phase F3 — Smoke gate (build + test; blocks ship on red)
141
-
142
- Run the gate per `../_shared/smoke-gate.md`, sourcing commands **from
143
- `wiki-meta.json`'s `commands` block** (recorded at wiki scan — don't
144
- rediscover tooling; manifest lacks them → detect once and say so). **GREEN**
145
- → code-graph step e.(3) (never a gate) → ship. **RED** → the flaky check, then one repair round; second red → STOP and offer: escalate to
146
- orc-mini (reason `smoke-red-escalation`) / switch to full `/orc` / stop.
147
- Docs-only → gate N/A, say so.
148
-
149
- ## Phase F3.5 — Mock example (config `mock_example`, default ask)
150
-
151
- After a GREEN F3, before ship (H `fast.f3-5.mock`): follow `../_shared/drift-recovery.md` (load on
152
- fire) — the `mock-examples/<change-slug>/` deliverable, the `DRIFT-FROM` loop and
153
- its cap. Trace: `PHASE mock-example`, `DRIFT loop=<n>`.
154
-
155
- ## Phase F4 — Ship
156
-
157
- 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
158
- `OUTCOME task=… band=fast model=… retries=… unmet=…` + `FINISH`, show the
159
- dispatch line (model/effort actually used) + the `/usage` reminder. Every end — ship
160
- or a red STOP — prints the card (`../_shared/phases/summary.md` §End-of-run card). Fast never
161
- triggers the post-ship wiki refresh ask (preflight polices freshness on the
162
- way in) — the passive stale-flag note still applies to touched covered files.
163
-
164
- ## Fallback contract (orc-fast → orc-mini)
165
-
166
- Follow the writer side of `../_shared/fallback-handoff.md`: announce the
167
- failed gate in one line, write the `FALLBACK-FROM` block into the run folder
168
- (REASON: wiki-absent | wiki-stale-user-choice | pattern-absent | fit-gate |
169
- smoke-red-escalation), and invoke orc-mini pointing at it. The run folder is
170
- already in the shared format — no migration.
171
-
172
- ## Behavior trace (always on)
173
-
174
- `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases orc-fast --json` →
175
- `trace_grammar` gives the verbs). Lane token `fast`, tier
176
- **Build lanes** — batched to **2 packets** (preflight+dispatch ·
177
- gate+ship) → `orc trace write --packet -`. At run start write `log_dir/.current` =
178
- `run-fast-<slug>-<DDMMYY>-<HHMMSS>.txt` AND `touch the trace file` of that name
179
- in the SAME step. A phase that ends with `zero new trace lines is a protocol violation`.
180
-
181
- ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
182
-
183
- - **Calls:** `orc lane calls orc-fast --json` names every call and its exit codes.
184
- **An exit code is an ANSWER where it says so, not a failure.** Make no other call.
185
- - **Config:** `orc lane config orc-fast --json`. Obey `effective`, print every line
186
- in `announce[]` VERBATIM at preflight, and honour `stops[]` before wave 1.
187
- Never merge `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`).
188
- - **Rules:** `orc rules slice --lane orc-fast --json` is the ONLY assembler
189
- (`../_shared/phases/rules.md`). Its `line` prints VERBATIM at preflight.
190
-
191
- Fast has no config key of its own — command-entry only; wave/scoring/review
192
- keys never apply, and the tier edges the F0 gate reads arrive resolved.
193
-
194
- ## Checkpoint (minimal, append-only)
195
-
196
- One `fast-checkpoint.md` in the run folder: GATE results (+ any
197
- `wiki_stale_override`), the dispatch, smoke verdicts, OUTCOME — enough for
198
- /orc-retro mining and fresh-session resume, nothing more.
199
-
200
- ## What fast still enforces
201
-
202
- All artifacts in the run subfolder, never project root · never offer commit on
203
- a red build · never invoke `/usage` programmatically.
204
-
205
- ## Waiting mid-run (`/orc-wait`)
206
-
207
- Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
208
- 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 → 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**.
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: orc-fix
3
+ description: >
4
+ Say "this is a fix, and here is what it fixes". Use for "/orc-fix", "this
5
+ fixes Sonar typescript:S3776", "ORC caused this defect", "this bug came from
6
+ AI-generated code", "record this fix". It classifies the fix from evidence,
7
+ asks once, and records it so the next review sees it. A rider: it opens no
8
+ run and returns to exactly where the run was. With no run open it can also
9
+ make the fix, like /orc-quick.
10
+ ---
11
+
12
+ # ORC — the fix record
13
+
14
+ A RIDER lane, like `/orc-wait` and `/orc-explain`. It opens no run of its own,
15
+ writes no `run-<lane>-<slug>` pointer and never writes `.current`. The user can
16
+ call it at any time — also while another lane waits at a question.
17
+
18
+ ## What this lane never does
19
+
20
+ - It never begins between a dispatch and its validated return.
21
+ - It never changes the host run: no re-plan, no re-score, no new task. A
22
+ suspend does not widen anyone's authority.
23
+ - With a run open, it never writes code. The host lane makes the fix — two
24
+ writers on one tree is the conflict `/orc-wait` forbids (DE-12).
25
+ - It never sets `miss` itself, and never records `author: orc`. The CLI does
26
+ the first, and refuses the second.
27
+
28
+ ## F0 — look (silent)
29
+
30
+ Run `orc fix classify --text "<the user's words>" --json`. The CLI reads the
31
+ git state, `git blame` on the named lines, the traces and the host run, and
32
+ proposes ONE class on two axes:
33
+
34
+ - `source` (what found it): `sonar` · `ci` · `defect` · `pr` · `review` · `other`
35
+ - `introduced_by` (who wrote the bad lines): `orc` · `ai` · `human` · `unknown`
36
+
37
+ | exit | meaning | what you do |
38
+ |---|---|---|
39
+ | 0 | classified | go to F1 |
40
+ | 1 | a dispatch is in flight | say so, wait for its return, then run F0 again |
41
+ | 2 | no text | ask what the fix fixes |
42
+
43
+ Never classify in your head. The user's three cases: "a SonarQube fix" →
44
+ `source: sonar`; "a defect caused by ORC" → `source: defect, introduced_by:
45
+ orc`; "a bug caused by AI-generated code" → `introduced_by: ai`.
46
+
47
+ ## F1 — ask once (H `fix.f1.class`)
48
+
49
+ Show the proposed class, every `evidence` line and the file, then:
50
+
51
+ ```text
52
+ This fix: source sonar · introduced by ORC (run-mini-total-290926)
53
+ - a Sonar rule key (typescript:S3776)
54
+ - git blame → 4c1e2a9: the commit falls inside the run's trace window ...
55
+ 1. confirm 2. change the class 3. cancel
56
+ ```
57
+
58
+ The user's word wins over the evidence. A changed class goes into the record
59
+ as `class_by: "user"`; a confirmed one as `class_by: "evidence"`. Cancel →
60
+ nothing is written; return to the run.
61
+
62
+ ## F2 — record
63
+
64
+ Pipe the classify answer's `record` object (with the user's class and
65
+ `class_by`) to `orc fix record - --json`. The CLI:
66
+
67
+ 1. writes ONE observation through the gotcha store — with a Sonar issue key it
68
+ uses the importer's own id, so a later `gotcha sync` completes the same row;
69
+ 2. computes `miss` from the stored review scopes;
70
+ 3. writes ONE `FIX` line into the HOST run's trace, when one is open;
71
+ 4. prints ONE line. Show it VERBATIM, then stop.
72
+
73
+ Exit 1 → a dispatch started meanwhile; nothing was written. Wait, then F2 again.
74
+
75
+ ## No run open — offer the fix (DE-12)
76
+
77
+ `mode: may-fix` from F0 → offer to make the fix before F2, like `/orc-quick`:
78
+
79
+ 1. The user picks the executor at the `/orc-quick` dispatch gate (that lane's
80
+ `dispatch-gate.md` reference, "Writing code") — nothing spawns without a yes.
81
+ 2. The slice carries `orc rules slice --lane orc-fix --json` (below).
82
+ 3. The smoke gate (`../_shared/smoke-gate.md`): red blocks the record.
83
+ 4. F2 with `outcome: "addressed"` and `via: "orc-fix"`.
84
+
85
+ The user can also say "record only" — then F2 at once.
86
+
87
+ ## Config
88
+
89
+ `orc lane config orc-fix --json`, obey `effective`. Never merge
90
+ `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`).
91
+
92
+ ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
93
+
94
+ `orc rules slice --lane orc-fix --json` is the ONLY assembler. It rides only in
95
+ an executor slice of the no-run fix.
96
+
97
+ ## Habits and trace
98
+
99
+ **Habits:** the host run had `habits{}` in its config answer → read
100
+ `../_shared/habits.md`; its next packet takes the `ASK` for `fix.f1.class`
101
+ (class `never`: a fact is never a habit). No `habits{}` → ignore `(H …)`.
102
+
103
+ **Trace:** the CLI writes the `FIX` line itself. You do not narrate it and you
104
+ do not repeat it. With no run open, nothing is traced — the record is the
105
+ observation.
106
+
107
+ ## Waiting mid-run (`/orc-wait`)
108
+
109
+ Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
110
+ Checkpoint **none** · safe point **after the record is written**. Nothing here to checkpoint, so all three modes behave identically — say so rather than asking.