@azure-id/orc 1.9.2 → 2.1.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 (228) hide show
  1. package/CHANGELOG.md +722 -0
  2. package/README-id.md +56 -42
  3. package/README.md +58 -41
  4. package/bin/build-agents.js +125 -29
  5. package/bin/clear-logs.js +620 -0
  6. package/bin/cli.js +1873 -180
  7. package/bin/fix.js +459 -0
  8. package/bin/gotcha-import.js +1081 -0
  9. package/bin/gotcha.js +1566 -0
  10. package/bin/graph-query.js +1 -1
  11. package/bin/graph.js +717 -717
  12. package/bin/habit.js +1538 -0
  13. package/bin/mockrun-catalog.js +284 -276
  14. package/bin/onboarding-content.js +2 -1
  15. package/bin/pricing.json +28 -21
  16. package/bin/run-undo.js +398 -0
  17. package/bin/trace-write.js +869 -0
  18. package/bin/verify-contracts.js +627 -100
  19. package/bin/verify-package.js +68 -10
  20. package/bin/webui/api.js +151 -6
  21. package/bin/webui/app.html +239 -232
  22. package/bin/webui/css/00-tokens.css +110 -92
  23. package/bin/webui/css/04-motion.css +87 -0
  24. package/bin/webui/css/06-responsive.css +203 -178
  25. package/bin/webui/css/panels/behaviour.css +205 -0
  26. package/bin/webui/css/panels/hookui.css +79 -0
  27. package/bin/webui/fixtures/behaviour.js +562 -0
  28. package/bin/webui/fixtures/extra.js +9 -9
  29. package/bin/webui/fixtures/flow.js +81 -81
  30. package/bin/webui/fixtures/hookui.js +506 -431
  31. package/bin/webui/fixtures/index.js +66 -3
  32. package/bin/webui/fixtures/knowledge.js +9 -3
  33. package/bin/webui/fixtures/maintenance.js +123 -42
  34. package/bin/webui/fixtures/rules.js +1007 -1002
  35. package/bin/webui/fixtures/settings.js +6 -7
  36. package/bin/webui/fixtures/stats.js +25 -6
  37. package/bin/webui/fixtures/wait.js +98 -97
  38. package/bin/webui/i18n/en/behaviour.json +156 -0
  39. package/bin/webui/i18n/en/hookui.json +290 -194
  40. package/bin/webui/i18n/en/maintenance.json +71 -52
  41. package/bin/webui/i18n/en/nav.json +25 -24
  42. package/bin/webui/i18n/en/settings.json +60 -60
  43. package/bin/webui/i18n/en/tour.json +37 -35
  44. package/bin/webui/i18n/id/behaviour.json +156 -0
  45. package/bin/webui/i18n/id/hookui.json +290 -194
  46. package/bin/webui/i18n/id/maintenance.json +71 -52
  47. package/bin/webui/i18n/id/nav.json +25 -24
  48. package/bin/webui/i18n/id/settings.json +60 -60
  49. package/bin/webui/i18n/id/tour.json +37 -35
  50. package/bin/webui/js/01-i18n.js +155 -154
  51. package/bin/webui/js/05-banners.js +181 -172
  52. package/bin/webui/js/06-edit.js +193 -183
  53. package/bin/webui/js/90-tour.js +498 -494
  54. package/bin/webui/js/91-shortcuts.js +126 -126
  55. package/bin/webui/js/99-boot.js +121 -118
  56. package/bin/webui/js/panels/behaviour.js +1087 -0
  57. package/bin/webui/js/panels/hookui.js +2196 -1691
  58. package/bin/webui/js/panels/maintenance.js +336 -235
  59. package/bin/webui/js/panels/settings.js +726 -719
  60. package/mock-run/INDEX.md +110 -107
  61. package/mock-run/extra-slots.md +1 -1
  62. package/mock-run/gotcha-import.md +118 -0
  63. package/mock-run/habits.md +129 -0
  64. package/mock-run/orc-aftermath.md +392 -392
  65. package/mock-run/orc-budget.md +29 -33
  66. package/mock-run/orc-cli.md +200 -200
  67. package/mock-run/orc-explain.md +86 -86
  68. package/mock-run/orc-extra.md +389 -392
  69. package/mock-run/orc-fix.md +87 -0
  70. package/mock-run/orc-pattern.md +112 -112
  71. package/mock-run/orc-quick.md +6 -1
  72. package/mock-run/orc.md +157 -157
  73. package/package.json +1 -1
  74. package/templates/agents/MODEL-MAPPING.md +37 -34
  75. package/templates/agents/orc-advisor-opus-5-xhigh.md +1 -7
  76. package/templates/agents/orc-analyze-mini-opus-5-med.md +1 -6
  77. package/templates/agents/orc-analyze-mini-sonnet-5-high.md +2 -5
  78. package/templates/agents/{orc-claude-writer-opus-4-8-high.md → orc-claude-writer-opus-5-low.md} +48 -53
  79. package/templates/agents/orc-context-combiner-opus-5-high.md +1 -11
  80. package/templates/agents/orc-executor-haiku-4-5.md +14 -6
  81. package/templates/agents/orc-executor-opus-4-7-high.md +14 -6
  82. package/templates/agents/orc-executor-opus-4-7-med.md +14 -6
  83. package/templates/agents/orc-executor-opus-4-8-high.md +14 -6
  84. package/templates/agents/orc-executor-opus-5-high.md +14 -6
  85. package/templates/agents/orc-executor-opus-5-low.md +14 -6
  86. package/templates/agents/orc-executor-opus-5-med.md +14 -6
  87. package/templates/agents/orc-executor-sonnet-4-6-high.md +14 -6
  88. package/templates/agents/orc-executor-sonnet-4-6-med.md +14 -6
  89. package/templates/agents/orc-executor-sonnet-5-high.md +15 -7
  90. package/templates/agents/orc-executor-sonnet-5-low.md +155 -0
  91. package/templates/agents/orc-executor-sonnet-5-med.md +155 -0
  92. package/templates/agents/orc-graph-noter-sonnet-4-6-med.md +1 -10
  93. package/templates/agents/orc-judge-opus-5-xhigh.md +5 -9
  94. package/templates/agents/orc-learn-writer-opus-5-low.md +1 -7
  95. package/templates/agents/orc-pattern-codifier-opus-5-med.md +1 -8
  96. package/templates/agents/orc-pattern-codifier-sonnet-5-high.md +58 -63
  97. package/templates/agents/orc-planner-mini-opus-5-med.md +1 -4
  98. package/templates/agents/orc-planner-mini-sonnet-5-high.md +2 -3
  99. package/templates/agents/orc-planner-opus-5-med.md +1 -4
  100. package/templates/agents/orc-recon-opus-5-low.md +1 -8
  101. package/templates/agents/orc-recon-sonnet-4-6-med.md +1 -8
  102. package/templates/agents/orc-retro-opus-5-med.md +6 -8
  103. package/templates/agents/orc-retro-sonnet-5-high.md +7 -8
  104. package/templates/agents/orc-reviewer-opus-5-low.md +96 -0
  105. package/templates/agents/orc-scout-opus-5-low.md +1 -6
  106. package/templates/agents/orc-scout-sonnet-4-6-high.md +35 -39
  107. package/templates/agents/orc-system-analyst-opus-5-high.md +1 -6
  108. package/templates/agents/orc-test-author-opus-5-med.md +4 -5
  109. package/templates/agents/orc-trace-writer-haiku-4-5.md +3 -7
  110. package/templates/agents/orc-verifier-opus-5-med.md +16 -8
  111. package/templates/agents/{orc-wiki-scanner-opus-4-8-high.md → orc-wiki-scanner-opus-5-low.md} +74 -79
  112. package/templates/agents/orc-wiki-scanner-sonnet-5-high.md +97 -106
  113. package/templates/commands/orc-analyze.md +13 -21
  114. package/templates/commands/orc-fast.md +10 -15
  115. package/templates/commands/orc-fix.md +18 -0
  116. package/templates/commands/orc-poly.md +12 -21
  117. package/templates/commands/orc-pr-driver.md +11 -30
  118. package/templates/commands/orc-pr-setup.md +10 -31
  119. package/templates/commands/orc-route.md +11 -41
  120. package/templates/commands/orc-test.md +5 -60
  121. package/templates/commands/orc-wiki.md +64 -64
  122. package/templates/hooks/README.md +109 -7
  123. package/templates/hooks/orc-session-hook.js +339 -0
  124. package/templates/hooks/orc-statusline-render.js +317 -23
  125. package/templates/hooks/orc-statusline.js +165 -50
  126. package/templates/hooks/orc-subagent-line.js +23 -5
  127. package/templates/hooks/orc-weather-fetch.js +123 -0
  128. package/templates/skills/_shared/README.md +9 -0
  129. package/templates/skills/_shared/code-graph.md +47 -55
  130. package/templates/skills/_shared/config-precedence.md +3 -1
  131. package/templates/skills/_shared/extra-dispatch.md +78 -93
  132. package/templates/skills/_shared/gotchas.md +248 -177
  133. package/templates/skills/_shared/habits.md +101 -0
  134. package/templates/skills/_shared/lane-contract.md +84 -0
  135. package/templates/skills/_shared/opus5-only.md +14 -14
  136. package/templates/skills/_shared/phases/README.md +142 -83
  137. package/templates/skills/_shared/phases/analyst-gates.md +10 -21
  138. package/templates/skills/_shared/phases/execution.md +8 -14
  139. package/templates/skills/_shared/phases/house-rules.md +27 -32
  140. package/templates/skills/_shared/phases/intake.md +127 -133
  141. package/templates/skills/_shared/phases/mock-example.md +46 -56
  142. package/templates/skills/_shared/phases/plan-handoff.md +91 -97
  143. package/templates/skills/_shared/phases/planning.md +7 -17
  144. package/templates/skills/_shared/phases/preflight.md +19 -42
  145. package/templates/skills/_shared/phases/review.md +24 -28
  146. package/templates/skills/_shared/phases/rules.md +18 -42
  147. package/templates/skills/_shared/phases/scoring.md +55 -65
  148. package/templates/skills/_shared/phases/security-checklist.md +46 -50
  149. package/templates/skills/_shared/phases/security.md +45 -55
  150. package/templates/skills/_shared/phases/ship.md +6 -15
  151. package/templates/skills/_shared/phases/stop-resume.md +2 -5
  152. package/templates/skills/_shared/phases/summary.md +73 -48
  153. package/templates/skills/_shared/phases/testgen.md +41 -51
  154. package/templates/skills/_shared/phases/trace-verbs.md +447 -0
  155. package/templates/skills/_shared/phases/trace.md +66 -297
  156. package/templates/skills/_shared/phases/verify.md +62 -70
  157. package/templates/skills/_shared/phases/wave-grouping.md +128 -133
  158. package/templates/skills/_shared/phases/wiki-consult.md +10 -6
  159. package/templates/skills/_shared/read-ladder.md +2 -55
  160. package/templates/skills/_shared/return-validation.md +17 -70
  161. package/templates/skills/_shared/review-slice.md +106 -0
  162. package/templates/skills/_shared/smoke-gate.md +46 -28
  163. package/templates/skills/_shared/wait.md +1 -0
  164. package/templates/skills/context-combiner/SKILL.md +15 -44
  165. package/templates/skills/orc/README.md +2 -2
  166. package/templates/skills/orc/SKILL.md +35 -63
  167. package/templates/skills/orc/config.md +25 -27
  168. package/templates/skills/orc/examples/full-run-mock.md +2 -1
  169. package/templates/skills/orc/references/effort-and-mode.md +17 -17
  170. package/templates/skills/orc/references/pattern-gate.md +89 -89
  171. package/templates/skills/orc/references/phases/intake.md +41 -47
  172. package/templates/skills/orc/references/phases/integration.md +13 -19
  173. package/templates/skills/orc/references/preflight-report.md +11 -12
  174. package/templates/skills/orc/references/ultra-mode.md +9 -7
  175. package/templates/skills/orc/schemas/checkpoint.md +122 -122
  176. package/templates/skills/orc/subskills/orc-execution/SKILL.md +27 -73
  177. package/templates/skills/orc/subskills/orc-execution/core.md +12 -99
  178. package/templates/skills/orc/subskills/orc-execution/subagent.md +14 -13
  179. package/templates/skills/orc/subskills/orc-review-verify/SKILL.md +12 -53
  180. package/templates/skills/orc/subskills/orc-review-verify/core.md +52 -135
  181. package/templates/skills/orc/subskills/orc-review-verify/subagent.md +7 -7
  182. package/templates/skills/orc/subskills/orc-testgen/SKILL.md +11 -22
  183. package/templates/skills/orc/subskills/orc-testgen/core.md +20 -59
  184. package/templates/skills/orc/subskills/orc-testgen/subagent.md +7 -7
  185. package/templates/skills/orc-advisor/SKILL.md +56 -60
  186. package/templates/skills/orc-analyze/SKILL.md +33 -67
  187. package/templates/skills/orc-analyze/schemas/report-audit.md +2 -1
  188. package/templates/skills/orc-analyze/schemas/report-prose.md +2 -1
  189. package/templates/skills/orc-analyze-mini/SKILL.md +35 -70
  190. package/templates/skills/orc-claude/SKILL.md +14 -14
  191. package/templates/skills/orc-claude/examples/claude-run-mock.md +65 -65
  192. package/templates/skills/orc-diy/README.md +31 -0
  193. package/templates/skills/orc-diy/SKILL.md +27 -78
  194. package/templates/skills/orc-diy/references/blocks/pattern.md +18 -18
  195. package/templates/skills/orc-fast/SKILL.md +49 -75
  196. package/templates/skills/orc-fix/SKILL.md +110 -0
  197. package/templates/skills/orc-judge/SKILL.md +77 -82
  198. package/templates/skills/orc-mini/SKILL.md +64 -112
  199. package/templates/skills/orc-mini/examples/mini-run-mock.md +4 -2
  200. package/templates/skills/orc-pattern/SKILL.md +27 -48
  201. package/templates/skills/orc-poly/SKILL.md +32 -61
  202. package/templates/skills/orc-pr-driver/SKILL.md +25 -51
  203. package/templates/skills/orc-pr-driver/references/green-gate.md +113 -105
  204. package/templates/skills/orc-pr-setup/SKILL.md +20 -45
  205. package/templates/skills/orc-quick/README.md +44 -3
  206. package/templates/skills/orc-quick/SKILL.md +77 -108
  207. package/templates/skills/orc-quick/references/dispatch-gate.md +18 -6
  208. package/templates/skills/orc-quick/references/gh-mode.md +50 -1
  209. package/templates/skills/orc-quick/references/look.md +3 -1
  210. package/templates/skills/orc-retro/SKILL.md +20 -19
  211. package/templates/skills/orc-retro/examples/retro-mock.md +17 -17
  212. package/templates/skills/orc-route/SKILL.md +25 -45
  213. package/templates/skills/orc-test/SKILL.md +16 -37
  214. package/templates/skills/orc-verify/SKILL.md +14 -32
  215. package/templates/skills/orc-wait/SKILL.md +156 -163
  216. package/templates/skills/orc-wiki/README.md +325 -325
  217. package/templates/skills/orc-wiki/SKILL.md +195 -195
  218. package/templates/skills/orc-wiki/examples/wiki-run-mock.md +37 -37
  219. package/templates/skills/orc-wiki/references/extra.md +2 -2
  220. package/templates/skills/orc-wiki/references/partial-refresh.md +276 -271
  221. package/templates/skills/orc-wiki/references/phases/phase-0.md +2 -7
  222. package/templates/skills/orc-wiki/references/phases/phase-1.md +1 -6
  223. package/templates/skills/orc-wiki/references/phases/phase-2.md +4 -9
  224. package/templates/skills/orc-wiki/references/phases/phase-3.md +1 -6
  225. package/templates/skills/orc-wiki/references/phases/phase-3c.md +4 -8
  226. package/templates/agents/orc-claude-writer-opus-5-med.md +0 -55
  227. package/templates/agents/orc-reviewer-opus-5-med.md +0 -60
  228. package/templates/agents/orc-wiki-scanner-opus-5-med.md +0 -81
@@ -11,10 +11,10 @@ description: >
11
11
  # ORC-MINI
12
12
 
13
13
  A trimmed orchestrator for when you want speed over the full quality pipeline.
14
- Everything in the main spine (`../orc/SKILL.md`) applies EXCEPT the differences
15
- below. Load its references and schemas by path — the HOT-PATH essentials
16
- (dispatch names, return-contract fields, artifact path) are inlined here so
17
- nothing is reconstructed from "full minus deltas."
14
+ The full lane's behaviour applies EXCEPT the differences below. **Never load
15
+ `../orc/SKILL.md`** — this spine is self-contained. Load the shared phase files
16
+ and schemas it names, by path; the HOT-PATH essentials (dispatch names,
17
+ return-contract fields, artifact path) are inlined here.
18
18
 
19
19
  Run as **Opus 4.8 high**, or Opus 5.5 / Fable 5 at medium+ (as full; never downgrade).
20
20
  **You never implement — you spawn.** The one exception is the **smoke gate**: a
@@ -30,7 +30,7 @@ read-only build+test run, not implementation — you still never write code.
30
30
  scoring table** — a **one-line complexity read** replaces it (mini-ok? or
31
31
  recommend switching to full); log that line, never render the matrix.
32
32
  3. **No dispatch-style and no batch-pause questions** — one subagent makes both
33
- meaningless; never ask them.
33
+ meaningless.
34
34
  4. **Lighter intake.** Only the **Always + medium tier** (Q1–Q4 in
35
35
  `../_shared/phases/intake.md`); no high tier (Q5/Q6). Step 3.5 runs at
36
36
  NAMES-ONLY depth: confirm the names the draft cites with ONE `orc graph ctx
@@ -41,12 +41,13 @@ read-only build+test run, not implementation — you still never write code.
41
41
  5. **Still write tests** when the project has a test setup (the executor does it
42
42
  inside its task).
43
43
  6. **Everything else is identical:** run folder + intent-spec, planning,
44
- checkpoint, stop sequence, usage reminder, ship flow.
44
+ checkpoint, stop sequence (H `any.stop.where`), usage reminder, ship flow.
45
45
 
46
46
  ## Mini flow (the phase set)
47
47
 
48
48
  ```
49
49
  Phase 0 intake (Q1–Q4, soft sign-off) + run folder + intent-spec
50
+ · `habits{}` in lane config → print `habits.line`, read ../_shared/habits.md
50
51
  Phase 1 planning (dispatch orc-planner-mini; analyst first only on real docs)
51
52
  → one-line complexity read (mini-ok? or recommend switch-to-full)
52
53
  Phase 3 dispatch ONE executor (orc-executor-sonnet-5-high) — slice carries the
@@ -56,9 +57,8 @@ Phase 3 dispatch ONE executor (orc-executor-sonnet-5-high) — slice carries th
56
57
  Phase M SMOKE GATE — run build+test → GREEN proceed · RED block ship + surface
57
58
  Phase X MOCK EXAMPLE (config mock_example) — offer/build after a GREEN gate
58
59
  Phase T TEST-AUTHORING ASK (opt-in) — offer to write test cases (never run them)
59
- Phase 8 ship (commit / push / PR — never stages mock-examples/)
60
+ Phase 8 ship (commit / push / PR — never stages mock-examples/) (H `mini.phase-8.ship`)
60
61
  ```
61
- (No Phase 2 scoring table, no dispatch-style/batch-pause asks, no full review/verify/summary.)
62
62
  **Postgres query grounding.** Data-access task on a Postgres project → probe
63
63
  `orc pattern status postgres` (`../_shared/detecting-artifacts.md`, never an
64
64
  ad-hoc `find`). HIT → inject the pattern LITERALLY into the slice (conventions +
@@ -78,67 +78,57 @@ Never skipped. Every call carries `--if-enabled`: exit 3 = off → print `graph:
78
78
  3. **Phase 1, ONE call:** `orc graph impact <declared_files> --complexity --risk=<facets.risk[] as class[@file:line],…> --if-enabled --json --brief`. Its `complexity.line` IS the complexity line — print it VERBATIM (`risk not given` → append the classes yourself); its `facts{}` IS `graph_facts` — paste it, then set `facts.map` to the `map --focus` card you already hold. No `complexity` in the answer (an older CLI) → count as `references/complexity.md` §2 says.
79
79
  4. **Phase 3 slice:** ONE `orc graph ctx <declared_files> --for-slice --if-enabled --json --brief` → its `card` is the `graph` block, the OUTSIDE view. No card when the change stays inside one named file with no signature change (`../_shared/code-graph.md` §7). The return carries `graph_used`.
80
80
  5. **Phase M, before the suite:** `orc graph changes --files=<actual_files> --if-enabled --json --brief` — print its `tests_line`, run the files its `tests[]` names first, then the suite, then its `blast_line` VERBATIM. The CLI attaches every `risk` word's `why`.
81
- 6. **Phase M GREEN:** `orc graph update --notes-pending --files <actual_files> --if-enabled --json --brief` — ONE call for the update AND the notes batch (§6) — then `orc graph gain --run <this run> --if-enabled --json --brief`, `line` copied VERBATIM into the ship summary. It is an estimate with a range; never restate it as a saving.
81
+ 6. **Phase M GREEN:** `orc graph update --notes-pending --files <actual_files> --if-enabled --json --brief` — ONE call for the update AND the notes batch (§6) — then `orc graph gain --run <this run> --if-enabled --json --brief`, `line` copied VERBATIM into the card's `graph` row.
82
82
 
83
83
  ## Phase M — Smoke gate (build + test; blocks ship on red)
84
84
 
85
- After the executor return validates (`../_shared/return-validation.md` — including `done` with non-empty `unmet[]` = partial, and §6's worktree delta: a path changed outside `declared_files` is a violation whatever the return said), YOU run the smoke gate
85
+ After the executor return validates (`../_shared/return-validation.md` §1–§3 + each injected field's §; `done` + non-empty `unmet[]` = partial; §6's worktree delta: a path outside `declared_files` is a violation whatever the return said), YOU run the smoke gate
86
86
  per `../_shared/smoke-gate.md`: read-only build+test, with **the affected tests
87
87
  FIRST** (code-graph step 5; a runner that takes no file list → one line saying
88
- so), then build and suite once each, then the blast radius from the same
89
- `changes` answer, `risk` never without its `why`:
90
- `blast radius 2 symbols touched · callers 3 in 2 files · tests reach 2 · risk medium: <symbol> (fan-in 3, no test reaches it)`.
88
+ so), then build and suite once each, then the `blast_line`, `risk` never without its `why`.
91
89
  **GREEN** → code-graph step 6 → test-authoring ask, then ship. **RED** → never
92
- offer commit/ship; one repair re-dispatch, second red → STOP and surface.
90
+ offer commit/ship; the flaky check, then one repair re-dispatch, second red → STOP and surface.
93
91
  Docs-only → gate N/A, say so. `orc run inflight` FIRST — exit 2 REFUSES, because
94
92
  `a lane that re-dispatches over a live attempt` has broken the contract
95
- (`../_shared/return-validation.md` §0). **A `risk: high` row adds ONE option,
96
- never a phase:** an exported symbol with fan-in 3+ that no test reaches adds one
93
+ (`return-validation.md` §0). **A `risk: high` row adds ONE option,
94
+ never a phase** (H `mini.phase-m.risk-high`): an exported symbol with fan-in 3+ that no test reaches adds one
97
95
  option to the EXISTING end-of-run batch (mock example · test authoring · ship)
98
- — *a. dispatch `orc-reviewer-opus-5-med` on the diff (P0/P1 block the commit
96
+ — *a. dispatch `orc-reviewer-opus-5-low` with `../_shared/review-slice.md`* (H `any.ship.review-before-push`) *(P0/P1 block the commit
99
97
  offer once) · b. write a test in Phase T · c. ship anyway*. No new user turn;
100
98
  mini still skips full review.
101
99
 
102
100
  ## Phase X — Mock example + drift recovery (config `mock_example`, default ask)
103
101
 
104
- Canonical: `../_shared/drift-recovery.md` — load it when the phase fires. After
105
- a GREEN Phase M, before ship: `ask` → MANDATORY offer (never silently
106
- skipped/run) · `on` → build · `off` → skip. Deliverable
107
- `mock-examples/<change-slug>/` at project root — **never committed, never
108
- staged**. Drift → `DRIFT-FROM` handoff, hard cap 2 loops, then an honest
109
- unresolved report. Trace: `PHASE mock-example`, `DRIFT loop=<n>`.
102
+ After a GREEN Phase M, before ship (H `mini.phase-x.mock`): follow `../_shared/drift-recovery.md` (load it
103
+ when the phase fires) — the `mock-examples/<change-slug>/` deliverable, the
104
+ `DRIFT-FROM` loop and its cap. Trace: `PHASE mock-example`, `DRIFT loop=<n>`.
110
105
 
111
106
  ## Phase T — Test-authoring ask (opt-in; writes tests, never runs them)
112
107
 
113
108
  Same opt-in as full Phase 6.5 — mini **only asks** (never gates the ship).
114
109
  Default from `config.generate_tests`; at the end of a GREEN run ask whether to
115
- author test cases (files + TEST-PLAN.md + a curl bundle for HTTP APIs), saying
110
+ author test cases (H `mini.phase-t.testgen`; files + TEST-PLAN.md + a curl bundle for HTTP APIs), saying
116
111
  they are never run. Yes → dispatch `orc-test-author-opus-5-med` (subskill
117
- `../orc/subskills/orc-testgen/`) with `actual_files`, the definition-of-done,
118
- touched flows, constraints and stack; the manual deliverables land in
119
- **`test-generator/<change-slug>/` at the project root**. Validate that the
120
- returned `test_plan_path`/`curl_bundle_path` sit under that folder (else
121
- malformed → re-dispatch) and state the exact path. No → ship; either way this
122
- NEVER runs tests.
112
+ `../orc/subskills/orc-testgen/`) exactly as `../_shared/phases/testgen.md` (`full`
113
+ layer) says: the deliverables land in **`test-generator/<change-slug>/` at the
114
+ project root**, the returned paths are validated, and you state the exact path.
115
+ No → ship; either way this NEVER runs tests. Every end — ship or a red
116
+ STOP — prints the card (`../_shared/phases/summary.md` §End-of-run card).
123
117
 
124
118
  ## Behavior trace (always on)
125
119
 
126
- `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases` names the
127
- file and the layers). Lane token `mini`, tier **Build lanes** — per phase,
128
- batched to **3 packets** (intake+plan · execution · ship), each paired with the
129
- next phase's first dispatch. At run start write `log_dir/.current` =
130
- `run-mini-<slug>-<DDMMYY>-<HHMMSS>.txt` AND `touch the trace file` of that name
131
- in the SAME step. Nothing else about the protocol is restated here; a phase that
132
- ends with `zero new trace lines is a protocol violation`. Mini does NOT drop the
133
- trace. `OUTCOME … band=mini` per task.
120
+ `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases orc-mini --json` →
121
+ `trace_grammar` gives the verbs). Lane token `mini`, tier
122
+ **Build lanes** — batched to **3 packets** (intake+plan · execution ·
123
+ ship). At run start: `.current` = `run-mini-<slug>-…` AND `touch the trace file`, SAME step. Pipe each packet to `orc trace write --packet -`. A phase that ends with `zero new trace lines is a protocol violation`.
124
+ Mini does NOT drop the trace. `OUTCOME … band=mini` per task.
134
125
 
135
126
  ## Complexity read (replaces the scoring table) — `references/complexity.md`
136
127
 
137
128
  ONE line before dispatch, carrying its own NUMBERS. **The CLI computes it** —
138
- `complexity.line` from the Phase 1 call, printed VERBATIM. The four thresholds,
139
- the `(graph off)` form and why each number is that number: `references/complexity.md`.
140
- `complexity: mini-ok — 3 files · confident callers 4 in 2 files · tests reach 2 · risk none · cochange none`
141
- It is an OFFER: *1. switch to /orc (recommended — <the reason>) · 2. continue in
129
+ `complexity.line` from the Phase 1 call, printed VERBATIM. Thresholds, the
130
+ `(graph off)` form and their reasons: that reference.
131
+ It is an OFFER (H `mini.phase-1.complexity`): *1. switch to /orc (recommended — <the reason>) · 2. continue in
142
132
  mini*. Continuing writes the NUMBERS into the decision log, so `/orc-retro` can
143
133
  move a threshold instead of anyone arguing about it. Trace: `GATE complexity :: <the line>`.
144
134
 
@@ -160,51 +150,31 @@ mini skipped. Record the switch in the decision log.
160
150
 
161
151
  Models pinned in `.claude/agents/`; look one up here, never reconstruct a name (agent = skill-name + model-effort suffix). See `.claude/agents/MODEL-MAPPING.md`. `opus5_only: true` FORCES the right column and needs an Opus 5.5 main session — mini's cheap-lane premise is off while it is on (`../_shared/opus5-only.md`).
162
152
 
163
- **Extra (`extra_enabled`, `../_shared/extra-dispatch.md`):** mini's ONE executor may run off Claude. It has no score, so resolve the pinned executor's **BAND, both edges, and require them to agree** — a partially covering row keeps the run on Claude and the preflight says so. Print the `extra:` line at intake whenever the gate is on (P0: `a lane that sends work off Claude without saying so`); dispatch via `orc extra dispatch --task <file> --json` with the IDENTICAL slice; validate with `return-validation.md` **§2b, not §2** (⛔ SUBSTITUTION replaces the downgrade check); a failure runs `orc extra reconcile <task_id>` FIRST — a worktree that moved is RESUMED, never re-done — then falls back to the pinned Claude agent, announced. A cited-risk change never leaves Claude (`extra_risk_tasks`, default `off`) — and mini's complexity read is not a substitute for that gate.
153
+ **Extra (`extra_enabled`, `../_shared/extra-dispatch.md` — the procedure):** mini's ONE executor may run off Claude. Resolve the pinned executor's **BAND, both edges, and require them to agree** — else the run stays on Claude and the preflight says so. Print the `extra:` line at intake whenever the gate is on (P0: `a lane that sends work off Claude without saying so`). The IDENTICAL slice goes via `orc extra dispatch --task <file> --json`; validate with `return-validation.md` **§2b, not §2** (⛔ SUBSTITUTION); a failure runs `orc extra reconcile <task_id>` FIRST (a moved worktree is RESUMED, never re-done), then the pinned Claude agent, announced. `extra_risk_tasks` still keeps a cited-risk change on Claude — the complexity read never replaces that gate.
164
154
 
165
155
  | Role | Agent (dispatch this) | Model / effort | When `opus5_only` |
166
156
  |------|-----------------------|----------------|-------------------|
167
- | mini analysis (docs only) | `orc-analyze-mini-sonnet-5-high` | claude-sonnet-5 / high | `orc-analyze-mini-opus-5-med` |
168
- | mini planning | `orc-planner-mini-sonnet-5-high` | claude-sonnet-5 / high | `orc-planner-mini-opus-5-med` |
169
- | mini execution | `orc-executor-sonnet-5-high` | claude-sonnet-5 / high | `orc-executor-opus-5-low` |
157
+ | mini analysis (docs only) | `orc-analyze-mini-sonnet-5-high` | claude-sonnet-5-5 / high | `orc-analyze-mini-opus-5-med` |
158
+ | mini planning | `orc-planner-mini-sonnet-5-high` | claude-sonnet-5-5 / high | `orc-planner-mini-opus-5-med` |
159
+ | mini execution | `orc-executor-sonnet-5-high` | claude-sonnet-5-5 / high | `orc-executor-opus-5-low` |
170
160
  | test authoring (opt-in) | `orc-test-author-opus-5-med` | claude-opus-5-5 / medium | unchanged |
171
161
 
172
- ## Config
173
-
174
- **ONE resolver, and it is not you:** `orc lane config orc-mini --json`. Obey
175
- `effective`, print every line in `announce[]` VERBATIM at preflight, and honour
176
- `stops[]` before wave 1. Never re-derive a value, a precedence or an inertness
177
- from `.claude/orc.config.yaml` — a key this lane does not read is not in the
178
- answer, and a key another key shadows comes back already marked. Exit ≠ 0 → say
179
- the CLI is unavailable and fall back to `../_shared/config-precedence.md`'s
180
- documented defaults, out loud. Priorities and families:
181
- `../_shared/config-precedence.md`. Wave, scoring and scout keys never apply to
182
- mini and are not in the answer, so there is nothing to render or ask.
183
-
184
- ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
185
-
186
- `orc rules slice --lane orc-mini --json` is the ONLY assembler; never build
187
- the card here. It rides under the house rules and above the task —
188
- **house rules > your project's rules > ORC's own packs** — and its `line` prints
189
- VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
190
- never a silent choice) and `rules_overridden[]`.
191
- ## Calls
192
-
193
- **ONE catalogue, and it is not you:** `orc lane calls orc-mini --json` names every
194
- CLI call this lane makes, each with its exit-code contract, its cost, when to run
195
- it, and what an EMPTY answer means. Never invent a spelling, never re-word an
196
- exit code, and never re-derive a state word — the CLI's state words are the only
197
- state words, and **an exit code is an ANSWER wherever that contract says so, not
198
- a failure**. A call the answer does not name is a call this lane does not make.
199
- Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
200
- command you are about to run, out loud, before running it.
162
+ ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
163
+
164
+ - **Calls:** `orc lane calls orc-mini --json` names every call and its exit codes.
165
+ **An exit code is an ANSWER where it says so, not a failure.** Make no other call.
166
+ - **Config:** `orc lane config orc-mini --json`. Obey `effective`, print every line
167
+ in `announce[]` VERBATIM at preflight, and honour `stops[]` before wave 1.
168
+ Never merge `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`).
169
+ - **Rules:** `orc rules slice --lane orc-mini --json` is the ONLY assembler
170
+ (`../_shared/phases/rules.md`). Its `line` prints VERBATIM at preflight.
201
171
 
202
172
  ## TDD (ONE intake question — mini's whole TDD policy)
203
173
 
204
- At intake ask once:
174
+ At intake ask once (H `mini.intake.tdd`):
205
175
  *"Anchor this in plan-time acceptance tests (TDD — red tests first, implement
206
176
  to green)? [yes/no]"*. Yes → the planner slice carries `tdd: on` (the mini
207
- planner authors `tdd_spec` per requirement, **scoped by the same `disposition` set the full lane uses** — `new-surface | behavior-change | covered-by-existing | no-behavior | no-runner`, derived from the `facets`, same safety floor: a cited `risk[]` is never scoped out, so a constant or a translation string gets no test but an auth change always does). Mini keeps its SINGLE executor — no paired TDD task; that executor materializes the failing tests FIRST, then implements to green
177
+ planner authors `tdd_spec` per requirement, **scoped by the full lane's `disposition` set** — `new-surface | behavior-change | covered-by-existing | no-behavior | no-runner`, from the `facets`; a cited `risk[]` is never scoped out). Mini keeps its SINGLE executor — no paired TDD task; that executor materializes the failing tests FIRST, then implements to green
208
178
  (implement→test→repair, cap `tdd_loop_max`; emit `TDD-RED`/`TDD-GREEN` per
209
179
  iteration; cap hit → STOP + honest red report), and Phase M's smoke gate runs
210
180
  the TDD suite as part of build+test. Scoped-out requirements are named with their
@@ -215,9 +185,8 @@ reason at preflight — never silent. No → skip entirely; never re-ask.
215
185
  orc-mini dispatches the FAST variants (Sonnet 5 high): `orc-analyze-mini` and
216
186
  `orc-planner-mini`. The mini analyst is **doc-optional**: on real doc input it
217
187
  runs first, then the mini planner; on a merely ambiguous request, prefer one
218
- inline clarifying question over a cold analyst spawn. Always single-pass — **no
219
- deep mode, no scouts**; it escalates to `/orc-analyze` deep on its concrete
220
- thresholds and the user chooses. You never analyze or plan yourself.
188
+ inline clarifying question over a cold analyst spawn (single-pass, its own
189
+ escalation thresholds). You never analyze or plan yourself.
221
190
 
222
191
  **The planner slice carries `graph_facts`** — `map`, `impact`, `cochange` and
223
192
  the `generation`, or `null` when the graph is off (shape:
@@ -231,45 +200,28 @@ mini-analyst return: evidence spot-check + derivation lint; refuse
231
200
  take-into-build on open `UNVERIFIED`/missing `scope_closed`; `git_head` ≠
232
201
  HEAD at plan time → re-run the spot-check first. On mini-planner return: confirm
233
202
  every `disposition: exists` path with `orc graph ctx <paths> --if-enabled
234
- --json --brief`, FIVE at a time — exit 0 confirms, exit 4 or an unindexed path falls
203
+ --json --brief`, FIVE at a time — exit 4 or an unindexed path falls
235
204
  back to a Glob. Then recompute coverage (no orphan requirements), cycle +
236
205
  collision checks. Any miss → bounce (one retry, then escalate). At dispatch,
237
206
  append the task's `spec_invariants` to the slice's `constraints[]` verbatim.
238
207
 
239
208
  ## Wiki consult (if present)
240
209
 
241
- Same rule as the full skill — load `../_shared/phases/wiki-consult.md` at the
242
- planning/complexity-read step: compute the FRESH / `AGING` / STALE tier from
243
- `.claude/orc/wiki-meta.json` and `orc wiki status --json`, then **select PATHS,
244
- never bodies**. From `wiki/INDEX.md` pick 1–3 page paths by keyword
245
- (cross-cutting maps like `orc-reference-api-surface` when their domain applies)
246
- and put the PATHS in the planner and executor slices with *"Read these first:
247
- the TL;DR for orientation, `Contracts & shapes` for specifics"* plus
248
- `code > fresh wiki > stale wiki (hints) > model priors`. **You never read a page
249
- body into your own context.** **Emit `WIKI-CONSULT <tier> :: docs=<paths>`**. Crosslink: a task touching a
250
- boundary in `.claude/orc/crosslink/needs.json` gets the cached contract injected
251
- per that reference — advisory, never blocking. Mini never generates the wiki;
252
- after a code-changing run apply the passive stale-flag note only.
253
-
254
- **`none` is an answer — record it, never drop it.** `wiki_used: none` and
255
- `graph_used: none` from ANY return go into the checkpoint and the ship line
256
- (`knowledge: wiki 2 pages offered · used none · graph card 2 targets · used
257
- none`). Two runs in a row with `wiki_used: none` on FRESH pages → one line:
258
- `wiki: the selected pages were not used in 2 runs — check their TL;DRs
259
- (/orc-wiki)`. A signal, never a gate, never dropped for looking null.
260
-
261
- ## Shared artifacts, and what mini still enforces
262
-
263
- Mini writes to the SAME location as the full skill (`.claude/orc/run/`
264
- `{run-slug}/`), so a switch needs no migration. From the main hard rules: never
265
- implement yourself (the smoke gate is read-only) · every RUN-STATE artifact in
266
- the run subfolder, never the project root (the one exception is the opt-in
267
- `test-generator/<change-slug>/` deliverable, at the project root by design) ·
268
- validate every subagent return (malformed = failure) · report the dispatch log
269
- and remind the user to run `/usage` (never yourself) · **never offer commit on a
270
- red build** (Phase M enforces it).
210
+ Load `../_shared/phases/wiki-consult.md` at the planning/complexity-read step. It
211
+ owns the tier (`orc wiki status --json` → `.tier`), the ladder
212
+ `code > fresh wiki > stale wiki (hints) > model priors`, the lane delta
213
+ (select PATHS, never bodies: 1–3 from `wiki/INDEX.md`), `WIKI-CONSULT`, the crosslink injection,
214
+ the passive stale-flag and `wiki_used: none` / `graph_used: none` (§Step 5, the mini paragraph).
215
+ **You never read a page body into your own context.** Mini never generates the wiki.
216
+
217
+ ## Shared artifacts
218
+
219
+ All RUN STATE stays in `.claude/orc/run/{run-slug}/` (as full, so a switch needs no migration), never the project root —
220
+ only the opt-in `test-generator/<change-slug>/` and `mock-examples/`
221
+ deliverables sit there. Report the dispatch log and remind the user to run
222
+ `/usage` (never yourself).
271
223
 
272
224
  ## Waiting mid-run (`/orc-wait`)
273
225
 
274
226
  Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
275
- 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.
227
+ Checkpoint **full** · safe point **after the executor returns**.
@@ -31,10 +31,10 @@ O: GATE complexity :: complexity: mini-ok — 2 files · confident callers 1 in
31
31
 
32
32
  ## Phase 3 — Execute (ONE subagent)
33
33
  O: graph: --for-slice card (2 files) · wiki: 1 path (pointer, body never read here)
34
- O: → claude-sonnet-5 / high :: DISPATCH orc-executor-sonnet-5-high :: add --json flag
34
+ O: → claude-sonnet-5-5 / high :: DISPATCH orc-executor-sonnet-5-high :: add --json flag
35
35
  [executor edits cli/report.py + updates tests, returns actual_files + actual_model
36
36
  + evidence {`pytest tests/test_report.py`, exit 0, tail quoted} + empty unmet[]]
37
- O: VERIFY actual=claude-sonnet-5/high ✅ MATCH · evidence present ✓
37
+ O: VERIFY actual=claude-sonnet-5-5/high ✅ MATCH · evidence present ✓
38
38
 
39
39
  ## Phase M — Smoke gate (build + test; blocks ship on red)
40
40
  O: GRAPH-CHANGES → tests reached 1 file (call 1)
@@ -60,5 +60,7 @@ O: Self-QA plan: test-generator/report-json-flag/TEST-PLAN.md (committed on ship
60
60
  O: Current branch: feat/report-json. Commit? Push? PR?
61
61
  U: commit
62
62
  O: knowledge: wiki 1 page offered · used tests/test_report.py note · graph used 1 target
63
+ (risk none → no review option, so no `orc gotcha observe` call. A risk-high run
64
+ that took option a records each finding with it, `run` included.)
63
65
  O: [commits] Done. Usage: dispatch log below + run /usage for your limits.
64
66
  (Switch to full flow any time — the run folder + checkpoint are shared.)
@@ -1,16 +1,13 @@
1
1
  ---
2
2
  name: orc-pattern
3
3
  description: >
4
- Learn and cache a project's real code conventions per language so ORC executors
5
- write code that MATCHES the existing codebase instead of a generic template.
6
- Use for "/orc-pattern", "learn my code pattern", "codify conventions", or when
7
- ORC detects frontend/backend work with no cached pattern. Reconciles a generic
8
- best-practice playbook against the project's actual most-recently-modified files:
9
- the project's CONVENTIONS win, security/correctness INVARIANTS are always kept,
10
- conflicts are flagged. Writes .claude/orc/patterns/<lang>-pattern.md, reused by
11
- every future run. EXPENSIVE scan → consent-gated inside /orc (config
12
- pattern_findings), always allowed on explicit /orc-pattern. The orchestrator
13
- dispatches the codifier subagent — it never codifies itself.
4
+ Learn and cache a project's real code conventions per language, so ORC
5
+ executors write code that MATCHES the existing codebase. Use for
6
+ "/orc-pattern", "learn my code pattern", "codify conventions", or when ORC
7
+ detects frontend/backend work with no cached pattern. The project's
8
+ CONVENTIONS win; security/correctness INVARIANTS are always kept. Writes
9
+ .claude/orc/patterns/<lang>-pattern.md. EXPENSIVE scan: consent-gated inside
10
+ /orc.
14
11
  ---
15
12
 
16
13
  # ORC-PATTERN (code-pattern codifier)
@@ -65,21 +62,17 @@ Reconciliation is therefore cheap: you only ever override the *soft* half.
65
62
 
66
63
  ## Behavior trace (always on)
67
64
 
68
- `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases` names
69
- the file and the layers). Lane token `pattern`, tier **Single-dispatch** —
70
- exactly ONE end-of-run packet, dispatched solo before `.current` is deleted.
71
- At run start write `log_dir/.current` = `run-pattern-<slug>-<DDMMYY>-<HHMMSS>.txt` AND
72
- `touch the trace file` of that name in the SAME step.
73
- Nothing else about the protocol is restated here; a phase that ends with
74
- `zero new trace lines is a protocol violation`.
65
+ `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases orc-pattern --json` →
66
+ `trace_grammar` gives the verbs). Lane token `pattern`, tier
67
+ **Single-dispatch**. At run start write `log_dir/.current` =
68
+ `run-pattern-<slug>-<DDMMYY>-<HHMMSS>.txt` AND `touch the trace file` of that name
69
+ in the SAME step. A phase that ends with `zero new trace lines is a protocol violation`.
75
70
 
76
71
  ## Phases
77
72
 
78
- `orc lane phases orc-pattern --json` is this lane's pipeline: the ordered list, where
79
- each phase lives, and how much of it to read. **The CLI owns the order** — never
80
- derive it from the headings below, and never renumber or rename one without the
81
- manifest, because a `read: section` pointer names a HEADING and a renamed heading
82
- is a pointer into nothing.
73
+ `orc lane phases orc-pattern --json` is this lane's pipeline. **The CLI owns the order**:
74
+ never derive it from the headings below, and never rename or renumber one
75
+ without the manifest (`../_shared/lane-contract.md` §Phases).
83
76
 
84
77
  ## Phase 0 — Entry & auto-branch (on /orc-pattern)
85
78
 
@@ -126,29 +119,15 @@ the executor applies the playbook **invariants** (still blocking) and imitates t
126
119
  1–2 neighboring files it already reads for its slice. Cheap by construction,
127
120
  persists nothing. See `../orc/config.md`.
128
121
 
129
- ## Config
130
-
131
- **ONE resolver, and it is not you:** `orc lane config orc-pattern --json`. Obey
132
- `effective`, print every line in `announce[]` VERBATIM at preflight, and honour
133
- `stops[]` before wave 1. Never re-derive a value, a precedence or an inertness
134
- from `.claude/orc.config.yaml` — a key this lane does not read is not in the
135
- answer, and a key another key shadows comes back already marked. Exit ≠ 0 → say
136
- the CLI is unavailable and fall back to `../_shared/config-precedence.md`'s
137
- documented defaults, out loud. Priorities and families:
138
- `../_shared/config-precedence.md`.
139
-
140
- ## Calls
141
-
142
- **ONE catalogue, and it is not you:** `orc lane calls orc-pattern --json` names every
143
- CLI call this lane makes, each with its exit-code contract, its cost, when to run
144
- it, and what an EMPTY answer means. Never invent a spelling, never re-word an
145
- exit code, and never re-derive a state word — the CLI's state words are the only
146
- state words, and **an exit code is an ANSWER wherever that contract says so, not
147
- a failure**. A call the answer does not name is a call this lane does not make.
148
- Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
149
- command you are about to run, out loud, before running it.
150
-
151
- ## Waiting mid-run (`/orc-wait`)
152
-
153
- Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
154
- Checkpoint **none** · safe point **single dispatch**. Nothing here to checkpoint, so all three modes behave identically — say so rather than asking. Never begin a wait between a dispatch and its validated return, or before the smoke gate has reported.
122
+ ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
123
+
124
+ - **Calls:** `orc lane calls orc-pattern --json` names every call and its exit codes.
125
+ **An exit code is an ANSWER where it says so, not a failure.** Make no other call.
126
+ - **Config:** `orc lane config orc-pattern --json`. Obey `effective`, print every line
127
+ in `announce[]` VERBATIM at preflight, and honour `stops[]` before wave 1.
128
+ Never merge `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`).
129
+
130
+ ## Waiting mid-run (`/orc-wait`)
131
+
132
+ Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
133
+ Checkpoint **none** · safe point **single dispatch**.
@@ -1,20 +1,12 @@
1
1
  ---
2
2
  name: orc-poly
3
3
  description: >
4
- Poly-repo planning lane — plan ONE change that spans two or more repos
5
- (BE endpoint + FE UI, service + its gRPC consumer, etc.) without drift. Use
6
- for "/orc-poly", "plan this across both repos", "coordinate a change over
7
- these repos". Runs in the HOST repo (where you are); you paste the path of
8
- each PEER repo. It peeks at every repo's wiki + crosslink (read-only) — or,
9
- when a wiki is missing, asks you which folders/files to dig — gathers the
10
- cross-repo context by asking questions until intent is pinned, then writes
11
- a source-of-truth doc set (poly-context.md, interface-contract.md,
12
- poly-spec.md) into poly-repo-implementation/<slug>/. Each iteration offers:
13
- pass to orc-plan (splits ONE plan per repo, each written into its repo,
14
- all pinned to the frozen interface contract) · stop & chat · add more
15
- context. PEER source is READ-ONLY; the only peer write is the handoff plan.
16
- It never builds — it plans the split so each repo's later /orc run stays on
17
- contract.
4
+ Poly-repo planning lane — plan ONE change that spans two or more repos (BE
5
+ endpoint + FE UI, a service + its gRPC consumer) without drift. Use for
6
+ "/orc-poly", "plan this across both repos", "coordinate a change over these
7
+ repos". Runs in the HOST repo; you paste each PEER repo path. Writes the doc
8
+ set into poly-repo-implementation/<slug>/ and can split ONE plan per repo.
9
+ PEER source is READ-ONLY. It never builds.
18
10
  ---
19
11
 
20
12
  # ORC-POLY (poly-repo planning)
@@ -61,21 +53,17 @@ conflict, HOST wins — the same rule extended across the repository boundary.
61
53
 
62
54
  ## Behavior trace (always on)
63
55
 
64
- `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases` names
65
- the file and the layers). Lane token `poly`, tier **Single-dispatch** —
66
- exactly ONE end-of-run packet, dispatched solo before `.current` is deleted.
67
- At run start write `log_dir/.current` = `run-poly-<slug>-<DDMMYY>-<HHMMSS>.txt` AND
68
- `touch the trace file` of that name in the SAME step.
69
- Nothing else about the protocol is restated here; a phase that ends with
70
- `zero new trace lines is a protocol violation`.
56
+ `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases orc-poly --json` →
57
+ `trace_grammar` gives the verbs). Lane token `poly`, tier
58
+ **Single-dispatch**. At run start write `log_dir/.current` =
59
+ `run-poly-<slug>-<DDMMYY>-<HHMMSS>.txt` AND `touch the trace file` of that name
60
+ in the SAME step. A phase that ends with `zero new trace lines is a protocol violation`.
71
61
 
72
62
  ## Phases
73
63
 
74
- `orc lane phases orc-poly --json` is this lane's pipeline: the ordered list, where
75
- each phase lives, and how much of it to read. **The CLI owns the order** — never
76
- derive it from the headings below, and never renumber or rename one without the
77
- manifest, because a `read: section` pointer names a HEADING and a renamed heading
78
- is a pointer into nothing.
64
+ `orc lane phases orc-poly --json` is this lane's pipeline. **The CLI owns the order**:
65
+ never derive it from the headings below, and never rename or renumber one
66
+ without the manifest (`../_shared/lane-contract.md` §Phases).
79
67
 
80
68
  ## Phase P0 — Intake (identify HOST + PEERs + the change)
81
69
 
@@ -117,11 +105,10 @@ stops the chat and never falls back to another lane.
117
105
 
118
106
  - **HOST wiki:** probe existence with `orc wiki status` — the deterministic CLI
119
107
  in `../_shared/detecting-artifacts.md`, never an ad-hoc `find` (`.claude` is
120
- hidden). Present → compute the tier from `.claude/orc/wiki-meta.json` per
121
- `../orc-wiki/references/staleness.md` (FRESH/AGING/STALE).
122
- - **PEER wiki:** the `orc` CLI is CWD-scoped, so for a peer at another path read
123
- its `wiki/INDEX.md` + `wiki-meta.json` **directly at the peer path** (compute
124
- the tier the same way). Absent there → treat as no wiki.
108
+ hidden). Present → read the tier from `orc wiki status --json` → `.tier`
109
+ (FRESH/AGING/STALE; the CLI computes it — never by hand).
110
+ - **PEER wiki:** the same call with `--dir <peer>`; then read its
111
+ `wiki/INDEX.md` at the peer path. `state: none` there → treat as no wiki.
125
112
  - `WIKI-CONSULT tier=<FRESH|AGING|STALE|none> :: <repo>` on every read (emit
126
113
  even for `none`). `GATE knowledge <repo>=<wiki|ask>` per repo.
127
114
 
@@ -217,33 +204,17 @@ builds.
217
204
  - Reminder: to see usage limits, tell the user to run `/usage` (never invoke it
218
205
  programmatically).
219
206
 
220
- ## Config
221
-
222
- Resolve with `orc lane config orc-poly --json` and obey `effective`. Never merge
223
- `.claude/orc.config.yaml` yourself, and never re-derive a precedence. Exit ≠ 0 →
224
- say so and use `../_shared/config-precedence.md`'s documented defaults, out
225
- loud. Nothing this lane reads is contested, gated or a stop, so it owes no
226
- preflight line and has no gate to honour.
227
-
228
- ## Calls
229
-
230
- **ONE catalogue, and it is not you:** `orc lane calls orc-poly --json` names every
231
- CLI call this lane makes, each with its exit-code contract, its cost, when to run
232
- it, and what an EMPTY answer means. Never invent a spelling, never re-word an
233
- exit code, and never re-derive a state word — the CLI's state words are the only
234
- state words, and **an exit code is an ANSWER wherever that contract says so, not
235
- a failure**. A call the answer does not name is a call this lane does not make.
236
- Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
237
- command you are about to run, out loud, before running it.
238
-
239
- ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
240
-
241
- `orc rules slice --lane orc-poly --json` is the ONLY assembler; never build
242
- the card here. It rides under the house rules and above the task —
243
- **house rules > your project's rules > ORC's own packs** — and its `line` prints
244
- VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
245
- never a silent choice) and `rules_overridden[]`.
246
- ## Waiting mid-run (`/orc-wait`)
247
-
248
- Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
249
- Checkpoint **docset** · safe point **after a per-repo plan is written**. `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.
207
+ ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
208
+
209
+ - **Calls:** `orc lane calls orc-poly --json` names every call and its exit codes.
210
+ **An exit code is an ANSWER where it says so, not a failure.** Make no other call.
211
+ - **Config:** `orc lane config orc-poly --json`. Obey `effective`. Never merge
212
+ `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`). Nothing
213
+ here is contested, gated or a stop: no preflight line, no gate to honour.
214
+ - **Rules:** `orc rules slice --lane orc-poly --json` is the ONLY assembler
215
+ (`../_shared/phases/rules.md`). Its `line` prints VERBATIM at preflight.
216
+
217
+ ## Waiting mid-run (`/orc-wait`)
218
+
219
+ Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
220
+ Checkpoint **docset** · safe point **after a per-repo plan is written**.