@azure-id/orc 0.56.1 → 1.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 (162) hide show
  1. package/CHANGELOG.md +219 -0
  2. package/README-id.md +49 -107
  3. package/README.md +694 -719
  4. package/bin/build-agents.js +18 -11
  5. package/bin/cli.js +33699 -29855
  6. package/bin/onboarding-content.js +0 -3
  7. package/bin/test-run.js +491 -0
  8. package/bin/verify-contracts.js +4330 -3277
  9. package/bin/verify-package.js +76 -6
  10. package/bin/webui/api.js +1201 -1163
  11. package/bin/webui/app.html +210 -198
  12. package/bin/webui/css/06-responsive.css +120 -108
  13. package/bin/webui/css/panels/extra.css +29 -0
  14. package/bin/webui/css/panels/lanes.css +134 -0
  15. package/bin/webui/css/panels/settings.css +79 -3
  16. package/bin/webui/css/panels/wait.css +123 -0
  17. package/bin/webui/fixtures/extra.js +2036 -1934
  18. package/bin/webui/fixtures/flow.js +2 -2
  19. package/bin/webui/fixtures/index.js +510 -486
  20. package/bin/webui/fixtures/lanes.js +218 -0
  21. package/bin/webui/fixtures/settings.js +261 -34
  22. package/bin/webui/fixtures/stats.js +3 -3
  23. package/bin/webui/fixtures/wait.js +97 -0
  24. package/bin/webui/i18n/TERMS.md +135 -134
  25. package/bin/webui/i18n/en/extra.json +345 -313
  26. package/bin/webui/i18n/en/lanes.json +29 -0
  27. package/bin/webui/i18n/en/nav.json +21 -19
  28. package/bin/webui/i18n/en/overview.json +2 -0
  29. package/bin/webui/i18n/en/settings.json +16 -5
  30. package/bin/webui/i18n/en/wait.json +41 -0
  31. package/bin/webui/i18n/id/extra.json +345 -313
  32. package/bin/webui/i18n/id/lanes.json +29 -0
  33. package/bin/webui/i18n/id/nav.json +21 -19
  34. package/bin/webui/i18n/id/overview.json +2 -0
  35. package/bin/webui/i18n/id/settings.json +15 -4
  36. package/bin/webui/i18n/id/wait.json +41 -0
  37. package/bin/webui/js/01-i18n.js +151 -149
  38. package/bin/webui/js/panels/extra.js +3199 -3011
  39. package/bin/webui/js/panels/lanes.js +259 -0
  40. package/bin/webui/js/panels/overview.js +10 -0
  41. package/bin/webui/js/panels/settings.js +149 -3
  42. package/bin/webui/js/panels/wait.js +253 -0
  43. package/package.json +39 -39
  44. package/templates/agents/MODEL-MAPPING.md +23 -35
  45. package/templates/agents/orc-executor-opus-4-7-high.md +1 -1
  46. package/templates/agents/orc-executor-opus-4-7-med.md +1 -1
  47. package/templates/agents/orc-executor-opus-4-8-high.md +1 -1
  48. package/templates/agents/orc-executor-opus-5-high.md +1 -1
  49. package/templates/agents/orc-executor-opus-5-low.md +1 -1
  50. package/templates/agents/orc-executor-opus-5-med.md +1 -1
  51. package/templates/agents/orc-retro-opus-5-med.md +73 -73
  52. package/templates/agents/orc-retro-sonnet-5-high.md +72 -72
  53. package/templates/agents/orc-trace-writer-haiku-4-5.md +107 -107
  54. package/templates/commands/orc-route.md +1 -1
  55. package/templates/commands/orc-wait.md +19 -0
  56. package/templates/commands/orc.md +1 -1
  57. package/templates/hooks/orc-statusline.js +39 -0
  58. package/templates/skills/_shared/README.md +7 -3
  59. package/templates/skills/_shared/config-precedence.md +198 -0
  60. package/templates/skills/_shared/drift-recovery.md +1 -1
  61. package/templates/skills/_shared/extra-dispatch.md +159 -7
  62. package/templates/skills/_shared/interview.md +1 -1
  63. package/templates/skills/_shared/opus5-only.md +9 -7
  64. package/templates/skills/_shared/phases/README.md +82 -0
  65. package/templates/skills/{orc/references → _shared/phases}/analyst-gates.md +15 -3
  66. package/templates/skills/_shared/phases/execution.md +143 -0
  67. package/templates/skills/{orc/references → _shared/phases}/house-rules.md +13 -1
  68. package/templates/skills/{orc/references → _shared/phases}/intake.md +15 -2
  69. package/templates/skills/_shared/phases/mock-example.md +56 -0
  70. package/templates/skills/{orc/references → _shared/phases}/plan-handoff.md +16 -3
  71. package/templates/skills/_shared/phases/planning.md +135 -0
  72. package/templates/skills/_shared/phases/preflight.md +98 -0
  73. package/templates/skills/_shared/phases/review.md +53 -0
  74. package/templates/skills/_shared/phases/scoring.md +65 -0
  75. package/templates/skills/{orc/references → _shared/phases}/security-checklist.md +12 -1
  76. package/templates/skills/_shared/phases/security.md +55 -0
  77. package/templates/skills/_shared/phases/ship.md +88 -0
  78. package/templates/skills/{orc/references/stop-and-resume.md → _shared/phases/stop-resume.md} +169 -160
  79. package/templates/skills/_shared/phases/summary.md +48 -0
  80. package/templates/skills/_shared/phases/testgen.md +51 -0
  81. package/templates/skills/{orc/references/trace-protocol.md → _shared/phases/trace.md} +49 -6
  82. package/templates/skills/_shared/phases/verify.md +70 -0
  83. package/templates/skills/{orc/references → _shared/phases}/wave-grouping.md +14 -2
  84. package/templates/skills/{orc/references → _shared/phases}/wiki-consult.md +13 -1
  85. package/templates/skills/_shared/read-ladder.md +48 -0
  86. package/templates/skills/_shared/wait.md +240 -0
  87. package/templates/skills/context-combiner/SKILL.md +214 -187
  88. package/templates/skills/orc/README.md +148 -150
  89. package/templates/skills/orc/SKILL.md +75 -358
  90. package/templates/skills/orc/config.md +137 -389
  91. package/templates/skills/orc/examples/full-run-mock.md +1 -1
  92. package/templates/skills/orc/references/effort-and-mode.md +16 -18
  93. package/templates/skills/orc/references/phases/intake.md +47 -0
  94. package/templates/skills/orc/references/phases/integration.md +19 -0
  95. package/templates/skills/orc/references/preflight-report.md +4 -4
  96. package/templates/skills/orc/references/ultra-mode.md +117 -123
  97. package/templates/skills/orc/schemas/planning-output.md +279 -279
  98. package/templates/skills/orc/subskills/orc-planner/SKILL.md +260 -264
  99. package/templates/skills/orc/subskills/orc-pr/stack-gate.md +4 -1
  100. package/templates/skills/orc-aftermath/SKILL.md +158 -136
  101. package/templates/skills/orc-analyze/SKILL.md +252 -220
  102. package/templates/skills/orc-analyze/references/branching.md +51 -51
  103. package/templates/skills/orc-analyze/references/thin-input.md +1 -1
  104. package/templates/skills/orc-analyze-mini/SKILL.md +128 -112
  105. package/templates/skills/orc-boundary/SKILL.md +249 -208
  106. package/templates/skills/orc-brainstorm/SKILL.md +377 -339
  107. package/templates/skills/orc-budget/SKILL.md +248 -225
  108. package/templates/skills/orc-challenge/README.md +1 -1
  109. package/templates/skills/orc-challenge/SKILL.md +298 -255
  110. package/templates/skills/orc-challenge/examples/council-full-roster.md +1 -1
  111. package/templates/skills/orc-claude/SKILL.md +221 -199
  112. package/templates/skills/orc-diy/README.md +2 -1
  113. package/templates/skills/orc-diy/SKILL.md +132 -68
  114. package/templates/skills/orc-diy/references/blocks/analyze.md +1 -1
  115. package/templates/skills/orc-diy/references/compile.md +21 -7
  116. package/templates/skills/orc-diy/references/flow-schema.md +2 -2
  117. package/templates/skills/orc-doc/SKILL.md +49 -7
  118. package/templates/skills/orc-explain/SKILL.md +24 -0
  119. package/templates/skills/orc-export/SKILL.md +31 -5
  120. package/templates/skills/orc-fast/SKILL.md +218 -185
  121. package/templates/skills/orc-grill/SKILL.md +238 -207
  122. package/templates/skills/orc-handoff/SKILL.md +223 -204
  123. package/templates/skills/orc-learn/SKILL.md +181 -156
  124. package/templates/skills/orc-mini/SKILL.md +47 -24
  125. package/templates/skills/orc-pact/SKILL.md +255 -218
  126. package/templates/skills/orc-pattern/SKILL.md +154 -124
  127. package/templates/skills/orc-poly/SKILL.md +242 -216
  128. package/templates/skills/orc-poly/references/gather.md +1 -1
  129. package/templates/skills/orc-pr-driver/SKILL.md +196 -167
  130. package/templates/skills/orc-pr-driver/references/orc-run-split.md +1 -1
  131. package/templates/skills/orc-pr-setup/SKILL.md +212 -184
  132. package/templates/skills/orc-quick/README.md +2 -2
  133. package/templates/skills/orc-quick/SKILL.md +51 -13
  134. package/templates/skills/orc-quick/references/dispatch-gate.md +2 -3
  135. package/templates/skills/orc-retro/SKILL.md +249 -222
  136. package/templates/skills/orc-retro/examples/retro-mock.md +171 -171
  137. package/templates/skills/orc-route/SKILL.md +188 -165
  138. package/templates/skills/orc-verify/SKILL.md +103 -84
  139. package/templates/skills/orc-wait/SKILL.md +163 -0
  140. package/templates/skills/orc-wiki/SKILL.md +60 -206
  141. package/templates/skills/orc-wiki/references/phases/phase-0.md +71 -0
  142. package/templates/skills/orc-wiki/references/phases/phase-1.md +35 -0
  143. package/templates/skills/orc-wiki/references/phases/phase-2.md +52 -0
  144. package/templates/skills/orc-wiki/references/phases/phase-3.md +57 -0
  145. package/templates/skills/orc-wiki/references/phases/phase-3c.md +36 -0
  146. package/templates/agents/orc-advisor-fable-5.md +0 -50
  147. package/templates/agents/orc-analyst-fable-5.md +0 -115
  148. package/templates/agents/orc-judge-fable-5.md +0 -79
  149. package/templates/agents/orc-planner-fable-5.md +0 -152
  150. package/templates/agents/orc-reviewer-fable-5.md +0 -57
  151. package/templates/skills/_shared/fable5-override.md +0 -56
  152. package/templates/skills/orc-diy/references/blocks/execution.md +0 -42
  153. package/templates/skills/orc-diy/references/blocks/mock-example.md +0 -22
  154. package/templates/skills/orc-diy/references/blocks/planning.md +0 -34
  155. package/templates/skills/orc-diy/references/blocks/review.md +0 -18
  156. package/templates/skills/orc-diy/references/blocks/scoring.md +0 -16
  157. package/templates/skills/orc-diy/references/blocks/security.md +0 -25
  158. package/templates/skills/orc-diy/references/blocks/ship.md +0 -25
  159. package/templates/skills/orc-diy/references/blocks/summary.md +0 -18
  160. package/templates/skills/orc-diy/references/blocks/testgen.md +0 -17
  161. package/templates/skills/orc-diy/references/blocks/trace.md +0 -28
  162. package/templates/skills/orc-diy/references/blocks/verify.md +0 -25
@@ -1,184 +1,212 @@
1
- ---
2
- name: orc-pr-setup
3
- description: >
4
- Stacked-PR PLANNER. Use for "/orc-pr-setup", "plan the stacked PRs", "split
5
- this change into stacked pull requests", "where do the PR cut lines go".
6
- Decides the LAYERING of a big change — ordered layers, each with a purpose, a
7
- value class, an explicit file list, a measured LoC/file budget and a
8
- dependency reason — and writes stacked-pr/<slug>/stack-plan.md. Runs
9
- INDEPENDENTLY (no orchestrator needed) and is also the lane ORC's ship phase
10
- hands off to when a change is too big for one PR. It NEVER touches git
11
- history: no branches, no commits, no pushes — that is orc-pr-driver's job.
12
- P0 HARD GATE: when a boundary is uncertain it STOPS and asks, one decision at
13
- a time, and records the answer.
14
- ---
15
-
16
- # ORC-PR-SETUP (stacked-PR planner)
17
-
18
- Big PRs are not reviewed, they are rubber-stamped. A 3k-LoC / 40-file diff is
19
- unreviewable, so review is weak, merges are big-bang, and reverts are painful.
20
- GitHub's **stacked pull requests** fix the mechanics — an ordered chain of PRs in
21
- one repo, each targeting the branch below it, each reviewable on its own.
22
-
23
- The mechanics are the easy half. **The hard part is deciding where the cut lines
24
- go**, and that is this skill's entire job: decide the layering correctly, prove
25
- each layer stands alone, and **refuse to guess**.
26
-
27
- This lane **plans only**. It writes one markdown file and stops. Every branch,
28
- commit, push and merge belongs to `/orc-pr-driver`.
29
-
30
- **Tier.** Not effort-gated (the effort guard matches the exact skill name `orc`),
31
- so it runs at whatever tier the chat is on. Layering judgment is better at Opus
32
- high; it is correct at any tier.
33
-
34
- **Human guide:** this skill's own `README.md` (what a stack is, the whole
35
- workflow, the plan file field by field, FAQ) — point the USER there when they ask
36
- how any of this works; never load it to drive the run.
37
-
38
- **Load at their phase, never preloaded:**
39
- `../_shared/gh-stack-commands.md` (preflight + command surface) ·
40
- `../_shared/stack-plan.md` (plan location, schema, budget math, `STACK-FROM`) ·
41
- `../_shared/pr-templates.md` (template resolution) ·
42
- `references/layer-taxonomy.md` (where the cut lines go) ·
43
- `references/certainty-gate.md` (the P0 gate + red flags).
44
-
45
- ## Hard rules
46
-
47
- 1. **Never touches git history.** No branch, no commit, no push, no PR. Reads
48
- git (`diff --numstat`, `status`, `log`) only.
49
- 2. **P0 HARD GATE — uncertainty ASKS.** Every candidate boundary is classified
50
- CERTAIN or UNCERTAIN (`references/certainty-gate.md`). Every UNCERTAIN stops
51
- the lane and asks the user, **one decision at a time**, with the cost of each
52
- option and a recommendation. Never a silent default, never "I assumed and
53
- noted it".
54
- 3. **Every layer needs a purpose and a value class.** No purpose → it is not a
55
- layer, it is part of another one.
56
- 4. **Budgets are measured, not estimated** (`../_shared/stack-plan.md`): real
57
- `git diff --numstat` numbers, exclusions applied, ceilings from config.
58
- 5. **Every answer is recorded** under `## Decisions` in the plan — that is the
59
- audit trail and what makes the plan re-runnable after compaction.
60
- 6. **A ticket is required.** Branch names and layer titles derive from it. No
61
- ticket after asking once → stop and recommend one regular PR.
62
-
63
- ## Phase S0 — Preflight (probe, never assume)
64
-
65
- Per `../_shared/gh-stack-commands.md`: `gh` present and 2.0 · authed ·
66
- `github/gh-stack` installed (offer the install if not) · **same repo, not a
67
- fork** (a fork is a hard STOP cross-fork stacks are unsupported) · trunk name ·
68
- branch protections / required checks (this is where "N layers = N CI runs"
69
- becomes a real number) · merge queue present? Report the block in a few lines.
70
-
71
- Any hard fail say which check failed and recommend ONE regular PR. Do not
72
- plan a stack that cannot be submitted.
73
-
74
- ## Phase S1 Intake (ticket, entry mode, template)
75
-
76
- 1. **Ticket** ask for it if it was not given. Required (hard rule 6).
77
- 2. **Entry mode** (`../_shared/stack-plan.md`) exactly two:
78
- - **`greenfield`** — nothing written yet; the input is a spec / TSD / ticket.
79
- - **`orc-run`** the change already exists in the worktree (ORC built it, or
80
- the user did). The split is **file-granular only**; hunk surgery is
81
- forbidden.
82
- Detect it: a dirty worktree with real changes `orc-run`; a clean tree
83
- `greenfield`. Say which mode you picked. An already-open fat PR is out of
84
- scope say so and recommend one regular PR.
85
- 3. **`STACK-FROM` handoff?** If the invocation points at a
86
- `stacked-pr/<slug>/STACK-FROM.md`, read it and skip everything it carries
87
- (ticket, slug, entry mode, template, surface, run dir). `BUILD-GREEN: false`
88
- is a **hard stop** — never plan a stack over a red build.
89
- 4. **PR template** — resolve per `../_shared/pr-templates.md` (ORC template
90
- project CLAUDE.md recommend three options). The user declining every
91
- option means the **stack is skipped** say so and stop; the change ships as
92
- one regular PR.
93
- 5. Derive `<slug>` (kebab-case, from the ticket or the change).
94
-
95
- ## Phase S2 Inventory (the real numbers)
96
-
97
- - `orc-run`: `git diff --numstat` (staged + unstaged) every changed file with
98
- its additions/deletions. Apply the exclusion list from
99
- `../_shared/stack-plan.md`, keeping excluded files in a separate LISTED bucket.
100
- - `greenfield`: enumerate the files the change WILL touch from the spec, and
101
- estimate each one's size marked as estimates, refined by the driver.
102
- - Build the **dependency graph** between those files (imports/callers, schema
103
- reader, type consumer). A `RUN-DIR` from a `STACK-FROM` handoff gives you
104
- ORC's per-task `declared_files` and `depends_on` — use it; it is better
105
- evidence than a fresh guess.
106
- - Report: total LoC, total files, excluded count, and how many layers the
107
- ceilings imply.
108
-
109
- ## Phase S3 Tier-assign
110
-
111
- Map every file to a taxonomy tier per `references/layer-taxonomy.md` (framework
112
- tiers first data/schema store domain adapter wiring → transport →
113
- async tests-at-scale docs/flag; generic fallback for unlisted stacks). A
114
- file that fits no tier is an UNCERTAIN, not a guess.
115
-
116
- ## Phase S4Cut (the P0 gate lives here)
117
-
118
- Group tiers into layers under the config ceilings (`stacked_pr_loc`,
119
- `stacked_pr_files`, `stacked_pr_max_layers`). **Ordering principle: dependency
120
- direction = stack direction.** Layer N may depend only on layers < N; the bottom
121
- is the widest blast radius and the least reversible (schema), the top is the
122
- thinnest (docs, flag flip).
123
-
124
- At **every seam**, run the certainty classifier (`references/certainty-gate.md`).
125
- CERTAINproceed silently. UNCERTAIN **STOP and ask**, one decision at a
126
- time, showing both candidate boundaries, the LoC/file/CI cost of each, the
127
- review-experience consequence, and a recommended option. Record the answer.
128
-
129
- Component and handler are **different layers by default** — even when both are
130
- small and were written in the same sitting. Same for handler vs async consumer,
131
- and migration vs the code that reads the new column.
132
-
133
- ## Phase S5 Validate the plan (all seven, explicitly)
134
-
135
- | # | Check | Fail → |
136
- |---|-------|--------|
137
- | 1 | every layer `stacked_pr_loc` | split, or log an accepted exception |
138
- | 2 | every layer `stacked_pr_files` (soft target = half) | same |
139
- | 3 | every layer has a purpose + value class (FOUNDATION names its consumer) | merge it into its consumer |
140
- | 4 | component/handler and migration/reader are separated | re-cut |
141
- | 5 | dependency order is acyclic and bottom-up | ask which seam breaks the cycle |
142
- | 6 | every layer can plausibly **build + test on its own base** | re-cut, or ask |
143
- | 7 | layer count `stacked_pr_max_layers` (+2 with an override, beyond → STOP) | multiple stacks or a phased release |
144
-
145
- Check 6 is REASONED here and **verified for real by the driver** say so, never
146
- claim it as proven.
147
-
148
- ## Phase S6 — Emit the plan, then stop
149
-
150
- Write `stacked-pr/<slug>/stack-plan.md` exactly per the schema in
151
- `../_shared/stack-plan.md`, including per-layer draft PR titles/bodies built from
152
- the resolved template, `## Decisions` (every P0 answer) and `## Accepted
153
- exceptions`. Then:
154
-
155
- 1. Show the layer table in chat (# · branch · purpose · value · files · LoC).
156
- 2. State plainly that **nothing has been created yet** — no branches, no PRs.
157
- 3. Offer the handoff: write `stacked-pr/<slug>/STACK-FROM.md`
158
- (`STACK-FROM: orc-pr-setup`, per `../_shared/stack-plan.md`) and tell the user
159
- to run **`/orc-pr-driver`** — human approval sits exactly here, before any git
160
- surgery.
161
-
162
- ## Behavior trace (PERMANENT every ORC entry point traces; always on)
163
-
164
- Resolve `log_dir` (`../orc/config.md` default ← `.claude/orc.config.yaml`) at
165
- start and follow `../orc/references/trace-protocol.md`: write
166
- `log_dir/.current` = `run-prsetup-<slug>-<DDMMYY>-<HHMMSS>.txt` and
167
- `touch the trace file` of that name in the SAME step, first. Narration is
168
- dispatched, not remembered collect the events with their REAL timestamps
169
- (`PHASE S0..S6`, `GATE stack-certainty pass|bounce` per seam decision,
170
- `QUESTION count=<n>`, `FINISH`) plus `decisions` (the WHY: every boundary the
171
- user chose, verbatim), dispatch the trace writer ONCE at run end (the
172
- single-dispatch-lane packet), then delete `.current`. A phase ending with
173
- `zero new trace lines is a protocol violation`.
174
-
175
- ## Boundaries
176
-
177
- - **Plans only.** Never a branch, commit, push, PR, or `gh stack` write command.
178
- - **Never guesses a seam.** Uncertainty is a question, not an assumption.
179
- - **Never fake-splits** an unsplittable atom, and never games the budget.
180
- - Out of scope: splitting an already-open PR (`gh stack link` retrofit), and
181
- cross-repo stacks (unsupported by GitHub use `/orc-poly` for cross-repo
182
- planning).
183
- - Reminder: to see usage limits, tell the user to run `/usage` (never invoke it
184
- programmatically).
1
+ ---
2
+ name: orc-pr-setup
3
+ description: >
4
+ Stacked-PR PLANNER. Use for "/orc-pr-setup", "plan the stacked PRs", "split
5
+ this change into stacked pull requests", "where do the PR cut lines go".
6
+ Decides the LAYERING of a big change — ordered layers, each with a purpose, a
7
+ value class, an explicit file list, a measured LoC/file budget and a
8
+ dependency reason — and writes stacked-pr/<slug>/stack-plan.md. Runs
9
+ INDEPENDENTLY (no orchestrator needed) and is also the lane ORC's ship phase
10
+ hands off to when a change is too big for one PR. It NEVER touches git
11
+ history: no branches, no commits, no pushes — that is orc-pr-driver's job.
12
+ P0 HARD GATE: when a boundary is uncertain it STOPS and asks, one decision at
13
+ a time, and records the answer.
14
+ ---
15
+
16
+ # ORC-PR-SETUP (stacked-PR planner)
17
+
18
+ Big PRs are not reviewed, they are rubber-stamped. A 3k-LoC / 40-file diff is
19
+ unreviewable, so review is weak, merges are big-bang, and reverts are painful.
20
+ GitHub's **stacked pull requests** fix the mechanics — an ordered chain of PRs in
21
+ one repo, each targeting the branch below it, each reviewable on its own.
22
+
23
+ The mechanics are the easy half. **The hard part is deciding where the cut lines
24
+ go**, and that is this skill's entire job: decide the layering correctly, prove
25
+ each layer stands alone, and **refuse to guess**.
26
+
27
+ This lane **plans only**. It writes one markdown file and stops. Every branch,
28
+ commit, push and merge belongs to `/orc-pr-driver`.
29
+
30
+ **Tier.** Not effort-gated (the effort guard matches the exact skill name `orc`),
31
+ so it runs at whatever tier the chat is on. Layering judgment is better at Opus
32
+ high; it is correct at any tier.
33
+
34
+ **Human guide:** this skill's own `README.md` (what a stack is, the whole
35
+ workflow, the plan file field by field, FAQ) — point the USER there when they ask
36
+ how any of this works; never load it to drive the run.
37
+
38
+ **Load at their phase, never preloaded:**
39
+ `../_shared/gh-stack-commands.md` (preflight + command surface) ·
40
+ `../_shared/stack-plan.md` (plan location, schema, budget math, `STACK-FROM`) ·
41
+ `../_shared/pr-templates.md` (template resolution) ·
42
+ `references/layer-taxonomy.md` (where the cut lines go) ·
43
+ `references/certainty-gate.md` (the P0 gate + red flags).
44
+
45
+ ## Hard rules
46
+
47
+ 1. **Never touches git history.** No branch, no commit, no push, no PR. Reads
48
+ git (`diff --numstat`, `status`, `log`) only.
49
+ 2. **P0 HARD GATE — uncertainty ASKS.** Every candidate boundary is classified
50
+ CERTAIN or UNCERTAIN (`references/certainty-gate.md`). Every UNCERTAIN stops
51
+ the lane and asks the user, **one decision at a time**, with the cost of each
52
+ option and a recommendation. Never a silent default, never "I assumed and
53
+ noted it".
54
+ 3. **Every layer needs a purpose and a value class.** No purpose → it is not a
55
+ layer, it is part of another one.
56
+ 4. **Budgets are measured, not estimated** (`../_shared/stack-plan.md`): real
57
+ `git diff --numstat` numbers, exclusions applied, ceilings from config.
58
+ 5. **Every answer is recorded** under `## Decisions` in the plan — that is the
59
+ audit trail and what makes the plan re-runnable after compaction.
60
+ 6. **A ticket is required.** Branch names and layer titles derive from it. No
61
+ ticket after asking once → stop and recommend one regular PR.
62
+
63
+ ## Phases
64
+
65
+ `orc lane phases orc-pr-setup --json` is this lane's pipeline: the ordered list, where
66
+ each phase lives, and how much of it to read. **The CLI owns the order** — never
67
+ derive it from the headings below, and never renumber or rename one without the
68
+ manifest, because a `read: section` pointer names a HEADING and a renamed heading
69
+ is a pointer into nothing.
70
+
71
+ ## Phase S0 Preflight (probe, never assume)
72
+
73
+ Per `../_shared/gh-stack-commands.md`: `gh` present and ≥ 2.0 · authed ·
74
+ `github/gh-stack` installed (offer the install if not) · **same repo, not a
75
+ fork** (a fork is a hard STOP — cross-fork stacks are unsupported) · trunk name ·
76
+ branch protections / required checks (this is where "N layers = N CI runs"
77
+ becomes a real number) · merge queue present? Report the block in a few lines.
78
+
79
+ Any hard fail say which check failed and recommend ONE regular PR. Do not
80
+ plan a stack that cannot be submitted.
81
+
82
+ The SHAPE of these steps the order, and the four rules that make it worth
83
+ having is `../_shared/phases/preflight.md` (`core`). The probes
84
+ themselves are this lane's own and stay here.
85
+
86
+ ## Phase S1 Intake (ticket, entry mode, template)
87
+
88
+ 1. **Ticket** — ask for it if it was not given. Required (hard rule 6).
89
+ 2. **Entry mode** (`../_shared/stack-plan.md`) exactly two:
90
+ - **`greenfield`** nothing written yet; the input is a spec / TSD / ticket.
91
+ - **`orc-run`** the change already exists in the worktree (ORC built it, or
92
+ the user did). The split is **file-granular only**; hunk surgery is
93
+ forbidden.
94
+ Detect it: a dirty worktree with real changes → `orc-run`; a clean tree →
95
+ `greenfield`. Say which mode you picked. An already-open fat PR is out of
96
+ scope — say so and recommend one regular PR.
97
+ 3. **`STACK-FROM` handoff?** If the invocation points at a
98
+ `stacked-pr/<slug>/STACK-FROM.md`, read it and skip everything it carries
99
+ (ticket, slug, entry mode, template, surface, run dir). `BUILD-GREEN: false`
100
+ is a **hard stop** never plan a stack over a red build.
101
+ 4. **PR template**resolve per `../_shared/pr-templates.md` (ORC template
102
+ project CLAUDE.md recommend three options). The user declining every
103
+ option means the **stack is skipped** say so and stop; the change ships as
104
+ one regular PR.
105
+ 5. Derive `<slug>` (kebab-case, from the ticket or the change).
106
+
107
+ ## Phase S2 — Inventory (the real numbers)
108
+
109
+ - `orc-run`: `git diff --numstat` (staged + unstaged) → every changed file with
110
+ its additions/deletions. Apply the exclusion list from
111
+ `../_shared/stack-plan.md`, keeping excluded files in a separate LISTED bucket.
112
+ - `greenfield`: enumerate the files the change WILL touch from the spec, and
113
+ estimate each one's size marked as estimates, refined by the driver.
114
+ - Build the **dependency graph** between those files (imports/callers, schema
115
+ reader, type → consumer). A `RUN-DIR` from a `STACK-FROM` handoff gives you
116
+ ORC's per-task `declared_files` and `depends_on` use it; it is better
117
+ evidence than a fresh guess.
118
+ - Report: total LoC, total files, excluded count, and how many layers the
119
+ ceilings imply.
120
+
121
+ ## Phase S3 Tier-assign
122
+
123
+ Map every file to a taxonomy tier per `references/layer-taxonomy.md` (framework
124
+ tiers first data/schema store domain → adapter → wiring → transport →
125
+ asynctests-at-scaledocs/flag; generic fallback for unlisted stacks). A
126
+ file that fits no tier is an UNCERTAIN, not a guess.
127
+
128
+ ## Phase S4 — Cut (the P0 gate lives here)
129
+
130
+ Group tiers into layers under the config ceilings (`stacked_pr_loc`,
131
+ `stacked_pr_files`, `stacked_pr_max_layers`). **Ordering principle: dependency
132
+ direction = stack direction.** Layer N may depend only on layers < N; the bottom
133
+ is the widest blast radius and the least reversible (schema), the top is the
134
+ thinnest (docs, flag flip).
135
+
136
+ At **every seam**, run the certainty classifier (`references/certainty-gate.md`).
137
+ CERTAIN proceed silently. UNCERTAIN **STOP and ask**, one decision at a
138
+ time, showing both candidate boundaries, the LoC/file/CI cost of each, the
139
+ review-experience consequence, and a recommended option. Record the answer.
140
+
141
+ Component and handler are **different layers by default** even when both are
142
+ small and were written in the same sitting. Same for handler vs async consumer,
143
+ and migration vs the code that reads the new column.
144
+
145
+ ## Phase S5 Validate the plan (all seven, explicitly)
146
+
147
+ | # | Check | Fail → |
148
+ |---|-------|--------|
149
+ | 1 | every layer ≤ `stacked_pr_loc` | split, or log an accepted exception |
150
+ | 2 | every layer ≤ `stacked_pr_files` (soft target = half) | same |
151
+ | 3 | every layer has a purpose + value class (FOUNDATION names its consumer) | merge it into its consumer |
152
+ | 4 | component/handler and migration/reader are separated | re-cut |
153
+ | 5 | dependency order is acyclic and bottom-up | ask which seam breaks the cycle |
154
+ | 6 | every layer can plausibly **build + test on its own base** | re-cut, or ask |
155
+ | 7 | layer count `stacked_pr_max_layers` (+2 with an override, beyond STOP) | multiple stacks or a phased release |
156
+
157
+ Check 6 is REASONED here and **verified for real by the driver** say so, never
158
+ claim it as proven.
159
+
160
+ ## Phase S6 — Emit the plan, then stop
161
+
162
+ Write `stacked-pr/<slug>/stack-plan.md` exactly per the schema in
163
+ `../_shared/stack-plan.md`, including per-layer draft PR titles/bodies built from
164
+ the resolved template, `## Decisions` (every P0 answer) and `## Accepted
165
+ exceptions`. Then:
166
+
167
+ 1. Show the layer table in chat (# · branch · purpose · value · files · LoC).
168
+ 2. State plainly that **nothing has been created yet** no branches, no PRs.
169
+ 3. Offer the handoff: write `stacked-pr/<slug>/STACK-FROM.md`
170
+ (`STACK-FROM: orc-pr-setup`, per `../_shared/stack-plan.md`) and tell the user
171
+ to run **`/orc-pr-driver`** human approval sits exactly here, before any git
172
+ surgery.
173
+
174
+ ## Behavior trace (always on)
175
+
176
+ `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases` names
177
+ the file and the layers). Lane token `prsetup`, tier **Single-dispatch**
178
+ exactly ONE end-of-run packet, dispatched solo before `.current` is deleted.
179
+ At run start write `log_dir/.current` = `run-prsetup-<slug>-<DDMMYY>-<HHMMSS>.txt` AND
180
+ `touch the trace file` of that name in the SAME step.
181
+ Nothing else about the protocol is restated here; a phase that ends with
182
+ `zero new trace lines is a protocol violation`.
183
+
184
+ ## Boundaries
185
+
186
+ - **Plans only.** Never a branch, commit, push, PR, or `gh stack` write command.
187
+ - **Never guesses a seam.** Uncertainty is a question, not an assumption.
188
+ - **Never fake-splits** an unsplittable atom, and never games the budget.
189
+ - Out of scope: splitting an already-open PR (`gh stack link` retrofit), and
190
+ cross-repo stacks (unsupported by GitHub — use `/orc-poly` for cross-repo
191
+ planning).
192
+ - Reminder: to see usage limits, tell the user to run `/usage` (never invoke it
193
+ programmatically).
194
+
195
+ ## Config
196
+
197
+ Resolve with `orc lane config orc-pr-setup --json` and obey `effective`. Never merge
198
+ `.claude/orc.config.yaml` yourself, and never re-derive a precedence. Exit ≠ 0 →
199
+ say so and use `../_shared/config-precedence.md`'s documented defaults, out
200
+ loud. Nothing this lane reads is contested, gated or a stop, so it owes no
201
+ preflight line and has no gate to honour.
202
+
203
+ ## Calls
204
+
205
+ **ONE catalogue, and it is not you:** `orc lane calls orc-pr-setup --json` names every
206
+ CLI call this lane makes, each with its exit-code contract, its cost, when to run
207
+ it, and what an EMPTY answer means. Never invent a spelling, never re-word an
208
+ exit code, and never re-derive a state word — the CLI's state words are the only
209
+ state words, and **an exit code is an ANSWER wherever that contract says so, not
210
+ a failure**. A call the answer does not name is a call this lane does not make.
211
+ Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
212
+ command you are about to run, out loud, before running it.
@@ -383,8 +383,8 @@ Because two things were dispatched. A dig that turns into a fix is one entry
383
383
  with two agents — so two questions. The count follows dispatches, not requests.
384
384
 
385
385
  **"I have `opus5_only: true`. Why is Sonnet still offered?"**
386
- Because this lane ignores it. `opus5_only`, `fable5_*` and
387
- `rubric_bands_override` do nothing here. You always choose. A one-word typo fix
386
+ Because this lane ignores it. `opus5_only` and `rubric_bands_override` do
387
+ nothing here. You always choose. A one-word typo fix
388
388
  should not go to the biggest model because a global setting said so.
389
389
 
390
390
  **"It said DOWNGRADE. What happened?"**
@@ -60,8 +60,8 @@ add steps.
60
60
  ## Nothing can override this lane
61
61
 
62
62
  orc-quick is standalone. These config keys **do nothing here**:
63
- `opus5_only` · `fable5_enabled` / `fable5_roles` · `rubric_bands_override` ·
64
- `extra_resume` · `extra_on_failure` · `extra_fallback_agent`.
63
+ `opus5_only` · `rubric_bands_override` · `extra_resume` · `extra_on_failure` ·
64
+ `extra_fallback_agent`.
65
65
 
66
66
  The user always picks the agent. See `../_shared/opus5-only.md` — orc-quick is
67
67
  listed there as the one exception. Say this at the gate if `opus5_only` is on,
@@ -76,6 +76,14 @@ stay on Claude. See `references/dispatch-gate.md` and
76
76
 
77
77
  ---
78
78
 
79
+ ## Phases
80
+
81
+ `orc lane phases orc-quick --json` is this lane's pipeline: the ordered list, where
82
+ each phase lives, and how much of it to read. **The CLI owns the order** — never
83
+ derive it from the headings below, and never renumber or rename one without the
84
+ manifest, because a `read: section` pointer names a HEADING and a renamed heading
85
+ is a pointer into nothing.
86
+
79
87
  ## Q0 — Preflight (ONE time per session, silent, nothing can stop the run)
80
88
 
81
89
  1. **Config.** Read `log_dir` only. Read no other key.
@@ -103,6 +111,10 @@ stay on Claude. See `references/dispatch-gate.md` and
103
111
 
104
112
  ---
105
113
 
114
+ The SHAPE of these steps — the order, and the four rules that make it worth
115
+ having — is `../_shared/phases/preflight.md` (`core`). The probes
116
+ themselves are this lane's own and stay here.
117
+
106
118
  ## Q1 — LOOK (silent — no questions here)
107
119
 
108
120
  **Sort the request.** Does it only read, or does it write? What needs to be
@@ -190,7 +202,7 @@ Rules:
190
202
 
191
203
  Put in the slice: the change sketch, the Q2 answers, 2–3 acceptance bullets,
192
204
  the wiki **paths**, the cached pattern (whole text), the `house_rules` card
193
- (`../orc/references/house-rules.md`, whole text), PR comments with their
205
+ (`../_shared/phases/house-rules.md`, whole text), PR comments with their
194
206
  `file:line`, and a short-return rule (fields only, no long prose).
195
207
 
196
208
  For an **ad-hoc** dispatch, also tell the agent to report its own
@@ -286,14 +298,14 @@ One folder per thread. **One file inside. Never a second file.**
286
298
  re-open a thread, and when the user asks you to read it.
287
299
  - Full shape and examples: `references/context-doc.md`.
288
300
 
289
- ## Behavior trace (always on — same as every lane)
301
+ ## Behavior trace (always on)
290
302
 
291
- Follow `../orc/references/trace-protocol.md`. orc-quick is the **Iterative**
292
- tier: **one packet per finished numbered entry**, plus the `FINISH` packet at
293
- the end. Build the packet as the entry closes, with each event's REAL time, then
294
- dispatch `orc-trace-writer-haiku-4-5` paired with the next entry's first
295
- dispatch. The `FINISH` packet must come back BEFORE you delete `.current`. An
296
- entry that ends with zero new trace lines is a protocol violation.
303
+ `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases` names
304
+ the file and the layers). Lane token `quick`, tier **Iterative**
305
+ ONE packet per finished numbered entry, paired with the next entry's first
306
+ dispatch, plus the `FINISH` packet.
307
+ Nothing else about the protocol is restated here; a phase that ends with
308
+ `zero new trace lines is a protocol violation`.
297
309
 
298
310
  Ad-hoc dispatches are not named `orc-*`, so the hook writes no `SPAWN`/`RETURN`
299
311
  for them. You still emit `DISPATCH … adhoc=true` and `VERIFY` yourself, and the
@@ -301,8 +313,29 @@ downgrade check still works from the agent's own report.
301
313
 
302
314
  ## Config
303
315
 
304
- Read `log_dir` only. orc-quick has no config key of its own and ignores every
305
- dispatch-forcing key. Command entry only.
316
+ **ONE resolver, and it is not you:** `orc lane config orc-quick --json`. Obey
317
+ `effective`, print every line in `announce[]` VERBATIM at preflight, and honour
318
+ `stops[]` before wave 1. Never re-derive a value, a precedence or an inertness
319
+ from `.claude/orc.config.yaml` — a key this lane does not read is not in the
320
+ answer, and a key another key shadows comes back already marked. Exit ≠ 0 → say
321
+ the CLI is unavailable and fall back to `../_shared/config-precedence.md`'s
322
+ documented defaults, out loud. Priorities and families:
323
+ `../_shared/config-precedence.md`.
324
+
325
+ orc-quick has no config key of its own and ignores every dispatch-forcing key —
326
+ which is why five of them come back INERT with a reason. Say that at the gate;
327
+ see "Nothing can override this lane" above.
328
+
329
+ ## Calls
330
+
331
+ **ONE catalogue, and it is not you:** `orc lane calls orc-quick --json` names every
332
+ CLI call this lane makes, each with its exit-code contract, its cost, when to run
333
+ it, and what an EMPTY answer means. Never invent a spelling, never re-word an
334
+ exit code, and never re-derive a state word — the CLI's state words are the only
335
+ state words, and **an exit code is an ANSWER wherever that contract says so, not
336
+ a failure**. A call the answer does not name is a call this lane does not make.
337
+ Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
338
+ command you are about to run, out loud, before running it.
306
339
 
307
340
  ## Rules this lane always keeps
308
341
 
@@ -310,4 +343,9 @@ Never implement yourself · ask the gate before every dispatch · check every
310
343
  return (broken = failure) · never offer commit while tests are red · never undo
311
344
  the user's files · write the doc before the offers · stage only the task's files
312
345
  · never write anything to GitHub · tell the user to run `/usage` (never run it
313
- yourself).
346
+ yourself).
347
+
348
+ ## Waiting mid-run (`/orc-wait`)
349
+
350
+ Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
351
+ Checkpoint **entry** · safe point **after an entry closes**. `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.
@@ -108,9 +108,8 @@ orc-quick has no score bands to tune. Mark the row
108
108
  2. **Never sticky.** Do not carry the last answer into the next entry.
109
109
  3. **Already answered is not skipped.** If the user wrote "use opus 5 low", the
110
110
  gate is satisfied — say which one you are using, in one line.
111
- 4. **No config can ANSWER this menu.** `opus5_only`, `fable5_enabled` /
112
- `fable5_roles`, `rubric_bands_override` and `extra_resume` are all inert in
113
- this lane. If one is on, say so at the gate so the user is not confused:
111
+ 4. **No config can ANSWER this menu.** `opus5_only`, `rubric_bands_override`
112
+ and `extra_resume` are all inert in this lane. If one is on, say so at the gate so the user is not confused:
114
113
  ```
115
114
  (orc-quick ignores opus5_only — both options are live)
116
115
  ```