@azure-id/orc 1.9.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/CHANGELOG.md +390 -0
  2. package/README-id.md +20 -36
  3. package/README.md +24 -34
  4. package/bin/build-agents.js +206 -109
  5. package/bin/cli.js +760 -62
  6. package/bin/gotcha-import.js +1081 -0
  7. package/bin/gotcha.js +1286 -0
  8. package/bin/graph-query.js +1 -1
  9. package/bin/graph.js +717 -717
  10. package/bin/habit.js +1453 -0
  11. package/bin/mockrun-catalog.js +281 -276
  12. package/bin/onboarding-content.js +4 -4
  13. package/bin/pricing.json +207 -200
  14. package/bin/run-undo.js +398 -0
  15. package/bin/trace-write.js +657 -0
  16. package/bin/verify-contracts.js +527 -81
  17. package/bin/verify-package.js +58 -11
  18. package/bin/webui/api.js +26 -0
  19. package/bin/webui/app.html +239 -232
  20. package/bin/webui/css/00-tokens.css +110 -92
  21. package/bin/webui/css/04-motion.css +249 -152
  22. package/bin/webui/css/06-responsive.css +203 -178
  23. package/bin/webui/css/panels/behaviour.css +205 -0
  24. package/bin/webui/css/panels/knowledge.css +563 -116
  25. package/bin/webui/fixtures/behaviour.js +532 -0
  26. package/bin/webui/fixtures/extra.js +2036 -2036
  27. package/bin/webui/fixtures/hookui.js +5 -5
  28. package/bin/webui/fixtures/index.js +34 -0
  29. package/bin/webui/fixtures/knowledge.js +7 -1
  30. package/bin/webui/fixtures/settings.js +305 -305
  31. package/bin/webui/fixtures/stats.js +16 -0
  32. package/bin/webui/i18n/en/behaviour.json +143 -0
  33. package/bin/webui/i18n/en/knowledge.json +117 -2
  34. package/bin/webui/i18n/en/nav.json +25 -24
  35. package/bin/webui/i18n/en/tour.json +37 -35
  36. package/bin/webui/i18n/id/behaviour.json +143 -0
  37. package/bin/webui/i18n/id/knowledge.json +117 -2
  38. package/bin/webui/i18n/id/nav.json +25 -24
  39. package/bin/webui/i18n/id/tour.json +37 -35
  40. package/bin/webui/js/01-i18n.js +155 -154
  41. package/bin/webui/js/90-tour.js +498 -494
  42. package/bin/webui/js/91-shortcuts.js +126 -126
  43. package/bin/webui/js/99-boot.js +121 -118
  44. package/bin/webui/js/panels/behaviour.js +1022 -0
  45. package/bin/webui/js/panels/knowledge.js +552 -7
  46. package/bin/webui/js/panels/overview.js +13 -4
  47. package/mock-run/INDEX.md +109 -107
  48. package/mock-run/context-combiner.md +100 -100
  49. package/mock-run/gotcha-import.md +118 -0
  50. package/mock-run/habits.md +129 -0
  51. package/mock-run/orc-budget.md +534 -534
  52. package/mock-run/orc-challenge-council.md +262 -262
  53. package/mock-run/orc-quick.md +6 -1
  54. package/mock-run/orc-ultra.md +103 -103
  55. package/package.json +1 -1
  56. package/templates/agents/MODEL-MAPPING.md +49 -49
  57. package/templates/agents/orc-advisor-opus-5-xhigh.md +50 -56
  58. package/templates/agents/orc-analyze-mini-opus-5-med.md +55 -60
  59. package/templates/agents/orc-analyze-mini-sonnet-5-high.md +55 -58
  60. package/templates/agents/orc-challenge-advisor-opus-5-med.md +75 -75
  61. package/templates/agents/orc-challenge-contrarian-opus-5-high.md +110 -110
  62. package/templates/agents/orc-challenge-executor-opus-5-med.md +114 -114
  63. package/templates/agents/orc-challenge-expansionist-opus-5-med.md +112 -112
  64. package/templates/agents/orc-challenge-judge-opus-5-high.md +132 -132
  65. package/templates/agents/orc-challenge-outsider-opus-5-low.md +109 -109
  66. package/templates/agents/orc-challenge-principles-opus-5-high.md +109 -109
  67. package/templates/agents/orc-challenge-reader-opus-5-low.md +90 -90
  68. package/templates/agents/orc-claude-writer-opus-4-8-high.md +48 -53
  69. package/templates/agents/orc-claude-writer-opus-5-med.md +48 -55
  70. package/templates/agents/orc-context-combiner-opus-5-high.md +78 -88
  71. package/templates/agents/orc-doc-checker-opus-5-low.md +108 -108
  72. package/templates/agents/orc-doc-writer-opus-5-med.md +134 -134
  73. package/templates/agents/orc-executor-haiku-4-5.md +14 -6
  74. package/templates/agents/orc-executor-opus-4-7-high.md +14 -6
  75. package/templates/agents/orc-executor-opus-4-7-med.md +14 -6
  76. package/templates/agents/orc-executor-opus-4-8-high.md +14 -6
  77. package/templates/agents/orc-executor-opus-5-high.md +15 -7
  78. package/templates/agents/orc-executor-opus-5-low.md +15 -7
  79. package/templates/agents/orc-executor-opus-5-med.md +15 -7
  80. package/templates/agents/orc-executor-sonnet-4-6-high.md +14 -6
  81. package/templates/agents/orc-executor-sonnet-4-6-med.md +14 -6
  82. package/templates/agents/orc-executor-sonnet-5-high.md +14 -6
  83. package/templates/agents/orc-graph-noter-sonnet-4-6-med.md +1 -10
  84. package/templates/agents/orc-judge-opus-5-xhigh.md +81 -85
  85. package/templates/agents/orc-learn-writer-opus-5-low.md +67 -73
  86. package/templates/agents/orc-pattern-codifier-opus-5-med.md +58 -65
  87. package/templates/agents/orc-pattern-codifier-sonnet-5-high.md +58 -63
  88. package/templates/agents/orc-planner-mini-opus-5-med.md +4 -7
  89. package/templates/agents/orc-planner-mini-sonnet-5-high.md +2 -3
  90. package/templates/agents/orc-planner-opus-5-med.md +157 -160
  91. package/templates/agents/orc-recon-opus-5-low.md +3 -10
  92. package/templates/agents/orc-recon-sonnet-4-6-med.md +1 -8
  93. package/templates/agents/orc-retro-opus-5-med.md +8 -10
  94. package/templates/agents/orc-retro-sonnet-5-high.md +6 -7
  95. package/templates/agents/orc-reviewer-opus-5-med.md +96 -60
  96. package/templates/agents/orc-scout-opus-5-low.md +35 -40
  97. package/templates/agents/orc-scout-sonnet-4-6-high.md +35 -39
  98. package/templates/agents/orc-system-analyst-opus-5-high.md +115 -120
  99. package/templates/agents/orc-test-author-opus-5-med.md +70 -71
  100. package/templates/agents/orc-test-designer-opus-5-high.md +158 -158
  101. package/templates/agents/orc-test-interpreter-opus-5-low.md +130 -130
  102. package/templates/agents/orc-trace-writer-haiku-4-5.md +3 -7
  103. package/templates/agents/orc-verifier-opus-5-med.md +77 -69
  104. package/templates/agents/orc-wiki-scanner-opus-4-8-high.md +74 -79
  105. package/templates/agents/orc-wiki-scanner-opus-5-med.md +74 -81
  106. package/templates/agents/orc-wiki-scanner-sonnet-5-high.md +97 -106
  107. package/templates/commands/orc-analyze.md +13 -21
  108. package/templates/commands/orc-fast.md +10 -15
  109. package/templates/commands/orc-poly.md +12 -21
  110. package/templates/commands/orc-pr-driver.md +11 -30
  111. package/templates/commands/orc-pr-setup.md +10 -31
  112. package/templates/commands/orc-route.md +11 -41
  113. package/templates/commands/orc-test.md +5 -60
  114. package/templates/commands/orc-ultra.md +17 -17
  115. package/templates/commands/orc-verify.md +11 -11
  116. package/templates/hooks/README.md +36 -2
  117. package/templates/hooks/orc-effort-guard.js +178 -178
  118. package/templates/hooks/orc-session-hook.js +264 -0
  119. package/templates/hooks/orc-statusline.js +9 -7
  120. package/templates/skills/_shared/README.md +9 -0
  121. package/templates/skills/_shared/code-graph.md +48 -56
  122. package/templates/skills/_shared/config-precedence.md +200 -198
  123. package/templates/skills/_shared/extra-dispatch.md +1331 -1346
  124. package/templates/skills/_shared/gotchas.md +228 -177
  125. package/templates/skills/_shared/habits.md +101 -0
  126. package/templates/skills/_shared/lane-contract.md +84 -0
  127. package/templates/skills/_shared/opus5-only.md +8 -8
  128. package/templates/skills/_shared/phases/README.md +142 -83
  129. package/templates/skills/_shared/phases/analyst-gates.md +125 -136
  130. package/templates/skills/_shared/phases/execution.md +8 -14
  131. package/templates/skills/_shared/phases/house-rules.md +27 -32
  132. package/templates/skills/_shared/phases/intake.md +127 -133
  133. package/templates/skills/_shared/phases/mock-example.md +46 -56
  134. package/templates/skills/_shared/phases/plan-handoff.md +91 -97
  135. package/templates/skills/_shared/phases/planning.md +7 -17
  136. package/templates/skills/_shared/phases/preflight.md +19 -42
  137. package/templates/skills/_shared/phases/review.md +23 -27
  138. package/templates/skills/_shared/phases/rules.md +18 -42
  139. package/templates/skills/_shared/phases/scoring.md +55 -65
  140. package/templates/skills/_shared/phases/security-checklist.md +46 -50
  141. package/templates/skills/_shared/phases/security.md +45 -55
  142. package/templates/skills/_shared/phases/ship.md +6 -15
  143. package/templates/skills/_shared/phases/stop-resume.md +2 -5
  144. package/templates/skills/_shared/phases/summary.md +73 -48
  145. package/templates/skills/_shared/phases/testgen.md +41 -51
  146. package/templates/skills/_shared/phases/trace-verbs.md +433 -0
  147. package/templates/skills/_shared/phases/trace.md +136 -367
  148. package/templates/skills/_shared/phases/verify.md +62 -70
  149. package/templates/skills/_shared/phases/wave-grouping.md +128 -133
  150. package/templates/skills/_shared/phases/wiki-consult.md +10 -6
  151. package/templates/skills/_shared/read-ladder.md +2 -55
  152. package/templates/skills/_shared/return-validation.md +17 -70
  153. package/templates/skills/_shared/review-slice.md +79 -0
  154. package/templates/skills/_shared/smoke-gate.md +46 -28
  155. package/templates/skills/context-combiner/SKILL.md +16 -45
  156. package/templates/skills/context-combiner/schemas/combined-report.md +78 -78
  157. package/templates/skills/orc/README.md +2 -2
  158. package/templates/skills/orc/SKILL.md +41 -69
  159. package/templates/skills/orc/config.md +9 -9
  160. package/templates/skills/orc/examples/full-run-mock.md +73 -73
  161. package/templates/skills/orc/references/effort-and-mode.md +222 -222
  162. package/templates/skills/orc/references/pattern-gate.md +89 -89
  163. package/templates/skills/orc/references/phases/intake.md +41 -47
  164. package/templates/skills/orc/references/phases/integration.md +13 -19
  165. package/templates/skills/orc/references/preflight-report.md +10 -11
  166. package/templates/skills/orc/references/ultra-mode.md +11 -9
  167. package/templates/skills/orc/subskills/orc-execution/SKILL.md +27 -73
  168. package/templates/skills/orc/subskills/orc-execution/core.md +12 -99
  169. package/templates/skills/orc/subskills/orc-execution/subagent.md +14 -13
  170. package/templates/skills/orc/subskills/orc-planner/SKILL.md +2 -2
  171. package/templates/skills/orc/subskills/orc-planner-mini/SKILL.md +121 -121
  172. package/templates/skills/orc/subskills/orc-review-verify/SKILL.md +35 -76
  173. package/templates/skills/orc/subskills/orc-review-verify/core.md +52 -135
  174. package/templates/skills/orc/subskills/orc-review-verify/subagent.md +7 -7
  175. package/templates/skills/orc/subskills/orc-testgen/SKILL.md +34 -45
  176. package/templates/skills/orc/subskills/orc-testgen/core.md +20 -59
  177. package/templates/skills/orc/subskills/orc-testgen/subagent.md +7 -7
  178. package/templates/skills/orc-advisor/SKILL.md +56 -60
  179. package/templates/skills/orc-analyze/SKILL.md +32 -68
  180. package/templates/skills/orc-analyze/examples/analyze-mock.md +42 -42
  181. package/templates/skills/orc-analyze/schemas/report-audit.md +84 -83
  182. package/templates/skills/orc-analyze/schemas/report-prose.md +64 -63
  183. package/templates/skills/orc-analyze/schemas/report-requirement.md +78 -78
  184. package/templates/skills/orc-analyze-mini/SKILL.md +35 -70
  185. package/templates/skills/orc-challenge/README.md +142 -142
  186. package/templates/skills/orc-challenge/examples/council-full-roster.md +273 -273
  187. package/templates/skills/orc-challenge/references/council.md +315 -315
  188. package/templates/skills/orc-challenge/references/intake.md +171 -171
  189. package/templates/skills/orc-claude/SKILL.md +14 -14
  190. package/templates/skills/orc-diy/README.md +174 -143
  191. package/templates/skills/orc-diy/SKILL.md +23 -74
  192. package/templates/skills/orc-diy/references/blocks/pattern.md +18 -18
  193. package/templates/skills/orc-diy/references/flow-schema.md +1 -1
  194. package/templates/skills/orc-doc/README.md +229 -229
  195. package/templates/skills/orc-doc/examples/orc-doc-prd-run.md +325 -325
  196. package/templates/skills/orc-doc/references/chunking.md +527 -527
  197. package/templates/skills/orc-fast/SKILL.md +45 -73
  198. package/templates/skills/orc-judge/SKILL.md +77 -82
  199. package/templates/skills/orc-learn/SKILL.md +14 -14
  200. package/templates/skills/orc-learn/examples/learn-run-mock.md +61 -61
  201. package/templates/skills/orc-mini/SKILL.md +65 -113
  202. package/templates/skills/orc-pattern/SKILL.md +27 -48
  203. package/templates/skills/orc-poly/SKILL.md +32 -61
  204. package/templates/skills/orc-pr-driver/SKILL.md +25 -51
  205. package/templates/skills/orc-pr-driver/references/green-gate.md +113 -105
  206. package/templates/skills/orc-pr-setup/SKILL.md +20 -45
  207. package/templates/skills/orc-quick/README.md +43 -2
  208. package/templates/skills/orc-quick/SKILL.md +76 -107
  209. package/templates/skills/orc-quick/references/dispatch-gate.md +16 -5
  210. package/templates/skills/orc-quick/references/gh-mode.md +48 -1
  211. package/templates/skills/orc-quick/references/look.md +3 -1
  212. package/templates/skills/orc-retro/SKILL.md +19 -18
  213. package/templates/skills/orc-retro/examples/retro-mock.md +1 -1
  214. package/templates/skills/orc-route/SKILL.md +25 -45
  215. package/templates/skills/orc-test/SKILL.md +16 -37
  216. package/templates/skills/orc-verify/SKILL.md +21 -39
  217. package/templates/skills/orc-verify/examples/verify-mock.md +33 -33
  218. package/templates/skills/orc-wait/SKILL.md +156 -163
  219. package/templates/skills/orc-wiki/references/extra.md +1 -1
  220. package/templates/skills/orc-wiki/references/phases/phase-0.md +1 -6
  221. package/templates/skills/orc-wiki/references/phases/phase-1.md +1 -6
  222. package/templates/skills/orc-wiki/references/phases/phase-2.md +1 -6
  223. package/templates/skills/orc-wiki/references/phases/phase-3.md +1 -6
  224. package/templates/skills/orc-wiki/references/phases/phase-3c.md +1 -6
@@ -22,11 +22,11 @@ mixed-model table:
22
22
  | `[90,100]` | `orc-executor-opus-5-med` |
23
23
 
24
24
  Two bands, sharing the 90 edge with the default table's top two rows. Since
25
- v1.0.0 the default table's high end is ALREADY Opus 5 with effort as the dial,
25
+ v1.0.0 the default table's high end is ALREADY Opus 5.5 with effort as the dial,
26
26
  so this mode differs from it only below 65 — a third band here would be a
27
27
  distinction the default table stopped making.
28
28
 
29
- **Fixed roles** — dispatch the Opus 5 variant **instead of** the default role
29
+ **Fixed roles** — dispatch the Opus 5.5 variant **instead of** the default role
30
30
  agent: same task slice, same return contract, same phase.
31
31
 
32
32
  | Role | Default agent | Opus-5-only variant |
@@ -41,14 +41,14 @@ agent: same task slice, same return contract, same phase.
41
41
  | claude write | `orc-claude-writer-opus-4-8-high` | `orc-claude-writer-opus-5-med` |
42
42
  | retro mine | `orc-retro-sonnet-5-high` | `orc-retro-opus-5-med` |
43
43
 
44
- The nine roles already pinned to `claude-opus-5` — analyst, planner, reviewer,
44
+ The nine roles already pinned to `claude-opus-5-5` — analyst, planner, reviewer,
45
45
  verifier, test-author, combiner, learn-writer, advisor, judge — are already
46
46
  compliant and dispatch unchanged (their efforts are NOT rewritten by this mode).
47
47
 
48
48
  **The wiki scan tier ladder (v0.46.0) adds NO row here, and needs no new pair.**
49
49
  Off, the ladder picks deep or light per delta. ON, this mode already forces the
50
50
  wiki scanner to `orc-wiki-scanner-opus-5-med` — so **both tiers collapse onto that
51
- one shipped agent** and the ladder simply stops applying. A cheaper Opus 5 scanner
51
+ one shipped agent** and the ladder simply stops applying. A cheaper Opus 5.5 scanner
52
52
  variant for the light tier does not exist and must never be added: a pair for a
53
53
  tier that cannot occur while the flag is on is exactly the phantom this table
54
54
  exists to prevent. Ladder: `../orc-wiki/references/partial-refresh.md`.
@@ -58,7 +58,7 @@ exists to prevent. Ladder: `../orc-wiki/references/partial-refresh.md`.
58
58
  - **`orc-trace-writer-haiku-4-5` stays Haiku 4.5.** It transcribes a packet the
59
59
  orchestrator hands it — no reasoning, no source reads. It is never in the
60
60
  roster.
61
- - **`orc-graph-noter-sonnet-4-6-med` is not dispatched at all.** It has no Opus 5
61
+ - **`orc-graph-noter-sonnet-4-6-med` is not dispatched at all.** It has no Opus 5.5
62
62
  variant: under the mode a code lane skips graph notes and prints
63
63
  `graph notes: skipped (opus5_only)` (`code-graph.md` §6). The graph's structure
64
64
  layer costs no model, so nothing else about the graph changes.
@@ -73,7 +73,7 @@ exists to prevent. Ladder: `../orc-wiki/references/partial-refresh.md`.
73
73
  the lane SAYS so at the gate (`orc-quick ignores opus5_only — both options are
74
74
  live`), because a shadowed setting must never be silent in either direction.
75
75
  - **`/orc-challenge` — UNAFFECTED, not exempt.** All three of its agents are
76
- already `claude-opus-5` (judge high, advisor medium, reader low), so the mode
76
+ already `claude-opus-5-5` (judge high, advisor medium, reader low), so the mode
77
77
  has nothing to force: zero new pairs, no rename churn, no roster row. The
78
78
  reader's `low` effort is a MEASUREMENT choice, not a cost one — a
79
79
  harder-thinking cold reader reasons around exactly the gaps D4 exists to find
@@ -102,7 +102,7 @@ mode is neither shadowed nor shadowing — it is simply **NOT CONSULTED** for th
102
102
  work extra took:
103
103
 
104
104
  - **a scored task** — an extra route row covering that score outranks the mode;
105
- every score no row covers still resolves on the Opus 5 ladder.
105
+ every score no row covers still resolves on the Opus 5.5 ladder.
106
106
  - **a POSITION** (v0.55.0 — `quick-executor`, `fast-executor`, `doc-writer`,
107
107
  `doc-checker`, `wiki-scanner-deep`, `wiki-scanner-light`) — an extra slot row
108
108
  holding that position outranks the mode's variant of that slot's agent; **a
@@ -121,7 +121,7 @@ POSITION, not the model.
121
121
  ## Tier honesty
122
122
 
123
123
  A subagent can never outrank the main session. With the mode ON, EVERY dispatch
124
- needs an Opus 5 main session — not just the top executor band. On a lower
124
+ needs an Opus 5.5 main session — not just the top executor band. On a lower
125
125
  session every role silently falls back to the session model and the tier-honesty
126
126
  rule (`return-validation.md`) reports a downgrade on **every** return. That is
127
127
  correct behavior, not a bug: hooks cannot block on model, only on effort, so the
@@ -1,83 +1,142 @@
1
- # `_shared/phases/` — one copy of a phase, and a manifest per lane
2
-
3
- This directory is NOT a skill and NOT a lane. It holds the single canonical copy
4
- of a phase that **two or more lanes run**. A lane's spine keeps its identity, its
5
- trigger, its own hard rules and its own phases — and for a shared phase it keeps
6
- only a POINTER plus that lane's own deltas.
7
-
8
- **The CLI owns the pipeline, not the prose.** `orc lane phases <lane> [--json]`
9
- is the manifest: the ordered phase list, the file each phase lives in, the layers
10
- that lane reads, the catalogued calls it makes, and when to read it. A skill
11
- never derives the phase list or its order from these filenames — the same rule
12
- the Flow stepper follows, for the same reason: *a second idea of the pipeline is
13
- the drift this exists to make impossible.*
14
-
15
- ## What belongs here — the rule is mechanical
16
-
17
- > A file under `templates/skills/<lane>/` that a file in a DIFFERENT lane already
18
- > points at belongs here. **A file with exactly one consumer stays home.**
19
-
20
- That is auditable by grep, which is what makes it a lint rather than an opinion.
21
- `bin/verify-contracts.js` asserts both halves: nothing under a lane folder may be
22
- pointed at from another lane, and every file here must be claimed by **≥2 lanes**.
23
-
24
- Centralizing a one-consumer file is centralizing for its own sake, and it costs a
25
- lane its own wording for nothing.
26
-
27
- ## The layer set is CLOSED
28
-
29
- A phase file may be cut into layers with the same marker grammar `orc diy
30
- compile` already parses (`<!-- diy:when key=value -->`):
31
-
32
- ```markdown
33
- <!-- orc:layer core -->
34
- Every lane that runs this phase does this. Never optional.
35
- <!-- /orc:layer -->
36
-
37
- <!-- orc:layer trim -->
38
- orc-mini / orc-fast: ONE executor, no waves. This is a REDUCTION and it is
39
- deliberate — do not read the `full` layer here.
40
- <!-- /orc:layer -->
41
- ```
42
-
43
- | Layer | Read by | Meaning |
44
- |---|---|---|
45
- | `core` | every lane running this phase | the invariant. Never optional |
46
- | `full` | `/orc`, `/orc-ultra` | the complete procedure |
47
- | `trim` | `orc-mini`, `orc-fast` | an explicit REDUCTION, stated as one |
48
- | `composed` | `orc-diy` | what `orc diy compile` stitches |
49
-
50
- **Four names, closed. A fifth layer is a lint failure, not a feature** — free
51
- markers are drift with extra steps. A lane reads `core` plus at most one other
52
- layer, and `orc lane phases` tells it which.
53
-
54
- **Why the set exists at all:** the single biggest way this library breaks ORC is
55
- `orc-mini` reading a shared `review.md` written for the full lane and starting to
56
- do a full code review. Mini's product promise is that it *skips* review.
57
- Centralizing without layers does not just cost tokens — it changes behaviour. So
58
- **a `trim` layer must say what it drops and that dropping it is deliberate.**
59
-
60
- **A single-layer file is a legitimate answer.** `trace.md` and `stop-resume.md`
61
- declare `core` only: their procedure really is identical in every lane that runs
62
- them, and what varies is DATA (the tier table, the lane token), not prose. Cutting
63
- them into layers to look symmetrical would be inventing structure the phase does
64
- not have.
65
-
66
- ## Pointer discipline
67
-
68
- Every pointer a spine adds declares `when` and `read` — the partial-read rules in
69
- `../read-ladder.md`. `on-phase` is the default; `always` must be justified in the
70
- release's findings; a `read:` names a HEADING and **never a line number**
71
- (`/orc-doc` rule 2 — a stored line number is a wrong line number one edit later).
72
-
73
- ## What is here
74
-
75
- | File | id | Layers | Lanes |
76
- |---|---|---|---|
77
- | `trace.md` | `trace` | `core` | every trace-owning lane (28) |
78
- | `preflight.md` | `preflight` | `core`, `full` | the silent-probe lanes (15) |
79
- | `stop-resume.md` | `stop-resume` | `core` | `orc`, `orc-wiki`, `orc-diy` |
80
- | `rules.md` | `rules` | `core` | every lane that writes words or code (28) — **never `orc-doc`** |
81
-
82
- `orc lane phases --all --json` is the authoritative list; this table is a
83
- human index of it.
1
+ # `_shared/phases/` — one copy of a phase, and a manifest per lane
2
+
3
+ This directory is NOT a skill and NOT a lane. It holds the single canonical copy
4
+ of a phase that **two or more lanes run**. A lane's spine keeps its identity, its
5
+ trigger, its own hard rules and its own phases — and for a shared phase it keeps
6
+ only a POINTER plus that lane's own deltas.
7
+
8
+ **The CLI owns the pipeline, not the prose.** `orc lane phases <lane> [--json]`
9
+ is the manifest: the ordered phase list, the file each phase lives in, the layers
10
+ that lane reads, the catalogued calls it makes, and when to read it. A skill
11
+ never derives the phase list or its order from these filenames — the same rule
12
+ the Flow stepper follows, for the same reason: *a second idea of the pipeline is
13
+ the drift this exists to make impossible.*
14
+
15
+ ## What belongs here — the rule is mechanical
16
+
17
+ > A file under `templates/skills/<lane>/` that a file in a DIFFERENT lane already
18
+ > points at belongs here. **A file with exactly one consumer stays home.**
19
+
20
+ That is auditable by grep, which is what makes it a lint rather than an opinion.
21
+ `bin/verify-contracts.js` asserts both halves: nothing under a lane folder may be
22
+ pointed at from another lane, and every file here must be claimed by **≥2 lanes**.
23
+
24
+ Centralizing a one-consumer file is centralizing for its own sake, and it costs a
25
+ lane its own wording for nothing.
26
+
27
+ ## The layer set is CLOSED
28
+
29
+ A phase file may be cut into layers with the same marker grammar `orc diy
30
+ compile` already parses (`<!-- diy:when key=value -->`):
31
+
32
+ ```markdown
33
+ <!-- orc:layer core -->
34
+ Every lane that runs this phase does this. Never optional.
35
+ <!-- /orc:layer -->
36
+
37
+ <!-- orc:layer trim -->
38
+ orc-mini / orc-fast: ONE executor, no waves. This is a REDUCTION and it is
39
+ deliberate — do not read the `full` layer here.
40
+ <!-- /orc:layer -->
41
+ ```
42
+
43
+ | Layer | Read by | Meaning |
44
+ |---|---|---|
45
+ | `core` | every lane running this phase | the invariant. Never optional |
46
+ | `full` | `/orc`, `/orc-ultra` | the complete procedure |
47
+ | `trim` | `orc-mini`, `orc-fast` | an explicit REDUCTION, stated as one |
48
+ | `composed` | `orc-diy` | what `orc diy compile` stitches |
49
+
50
+ **Four names, closed. A fifth layer is a lint failure, not a feature** — free
51
+ markers are drift with extra steps. A lane reads `core` plus at most one other
52
+ layer, and `orc lane phases` tells it which.
53
+
54
+ **Why the set exists at all:** the single biggest way this library breaks ORC is
55
+ `orc-mini` reading a shared `review.md` written for the full lane and starting to
56
+ do a full code review. Mini's product promise is that it *skips* review.
57
+ Centralizing without layers does not just cost tokens — it changes behaviour. So
58
+ **a `trim` layer must say what it drops and that dropping it is deliberate.**
59
+
60
+ **A single-layer file is a legitimate answer.** `trace.md` and `stop-resume.md`
61
+ declare `core` only: their procedure really is identical in every lane that runs
62
+ them, and what varies is DATA (the tier table, the lane token), not prose. Cutting
63
+ them into layers to look symmetrical would be inventing structure the phase does
64
+ not have.
65
+
66
+ ## Pointer discipline — the partial-read rules (v1.0.0 W10)
67
+
68
+ Every pointer a spine adds declares `when` and `read`. `on-phase` is the
69
+ default; `always` must be justified in the release's findings; a `read:` names
70
+ a HEADING and **never a line number** (`/orc-doc` rule 2 — a stored line number
71
+ is a wrong line number one edit later). **Rule of 2.0.0:** every new shared file
72
+ is `on-phase` or `on-demand`, never `always`, and a new CLI answer is brief by
73
+ default (the full rows only on request). This section is for the
74
+ ORCHESTRATOR; an executor or a recon agent reads only `../read-ladder.md`.
75
+
76
+ ### Reading ORC's own payload
77
+
78
+ The read ladder (`../read-ladder.md`) is about reading the PROJECT. It
79
+ applies unchanged to reading ORC's own files, and it has to: a lane manifest of
80
+ pointers that every lane dutifully reads whole is MORE round-trips than the prose it replaced, for the
81
+ same bytes. Centralizing prose and then reading all of it is a slower payload,
82
+ not a smaller one.
83
+
84
+ So every pointer a lane carries declares three things.
85
+
86
+ | Declaration | Values | Means |
87
+ |---|---|---|
88
+ | `when` | `always` · `on-phase` · `on-state` · `on-demand` · `compile-time` | WHETHER to open it at all |
89
+ | `read` | `layer` · `section` · `whole` | HOW MUCH to open |
90
+ | `layers` | `core` · `full` · `trim` · `composed` | WHICH part, when `read: layer` |
91
+
92
+ #### The five rules that make it honest
93
+
94
+ 1. **`on-phase` is the default, and `always` must be justified.** A file every
95
+ lane always loads has saved nothing by moving. Each `always` pointer is
96
+ named in the wave that adds it.
97
+ 2. **`read: section` names a HEADING, never a line number.** A stored line
98
+ number is a wrong line number one edit later; a heading anchor survives an
99
+ edit above it. This is why a shared file's headings are part of its
100
+ contract — renaming one breaks every pointer into it.
101
+ 3. **A trimmed lane reads `core` plus its OWN layer, and never the `full`
102
+ layer.** Reading a neighbouring layer "for context" is the bleed this rule
103
+ exists to stop: the layer boundary is the product promise, not a suggestion.
104
+ 4. **The two exceptions of `../read-ladder.md` carry over unchanged.** A file
105
+ you will EDIT is read in full, first, always; and output a gate parses is read whole.
106
+ 5. **`compile-time` is not a run-time read at all.** `orc-diy` is a declared
107
+ reader of ten shared phases and opens none of them during a run: the `orc
108
+ diy compile` CLI reads their `composed` layer once and stitches it into
109
+ `FLOW-COMPILED.md`, which is the only spine that run then follows. Saying
110
+ `on-phase` there would describe a read that never happens, and a manifest
111
+ that describes a run nobody performs is the drift it exists to prevent
112
+ (v1.0.0 W13).
113
+
114
+ #### The honest limit
115
+
116
+ A partial read saves round-trips and bytes for the lanes that SKIP a phase. It
117
+ does **not** make a phase cheaper for the lane that runs it — that lane reads
118
+ its layers whole. Any claim otherwise has to show the measurement.
119
+
120
+ ### Why the ladder exists
121
+
122
+ ORC's cost is dominated by parallel reading, not by thinking: up to `max_scouts`
123
+ scouts at once, a wiki scan that is expensive by design, and every executor in a
124
+ wave opening its declared files. A role that opens a 900-line file to learn one
125
+ function's shape has spent the run's budget on bytes nobody needed. Reading more
126
+ is not understanding more.
127
+
128
+ What a lane INVOKES, and what each exit code means, is not in this file: that is
129
+ `orc lane calls <lane> --json`, whose catalogue is the one copy of every call
130
+ two or more lanes share.
131
+
132
+ ## What is here
133
+
134
+ | File | id | Layers | Lanes |
135
+ |---|---|---|---|
136
+ | `trace.md` | `trace` | `core` | every trace-owning lane (28) |
137
+ | `preflight.md` | `preflight` | `core`, `full` | the silent-probe lanes (15) |
138
+ | `stop-resume.md` | `stop-resume` | `core` | `orc`, `orc-wiki`, `orc-diy` |
139
+ | `rules.md` | `rules` | `core` | every lane that writes words or code (28) — **never `orc-doc`** |
140
+
141
+ `orc lane phases --all --json` is the authoritative list; this table is a
142
+ human index of it.
@@ -1,136 +1,125 @@
1
- # Phase — Analyst & plan gates (id: `analyst-gates`)
2
-
3
- > **Library file.** Canonical since v1.0.0 W12; it was under the `orc` skill's
4
- > private `references/`, and other lanes already reached across into it. Read
5
- > by `orc`, `orc-analyze`, `orc-mini`. Layers declared: `core` only — single-
6
- > layer because these are the orchestrator-side gates on a returned analysis
7
- > or plan, and a trimmed lane runs fewer of them rather than different ones.
8
- > `orc lane phases <lane> --json` names the file and the layers to read.
9
-
10
- <!-- orc:layer core -->
11
- ## Reference — Analyst, Combiner & Plan Gates (orchestrator side)
12
-
13
- The orchestrator's deterministic gates around the analyst, the
14
- context-combiner, and the planner. The roles themselves are defined in
15
- `../../orc-analyze/SKILL.md`, `../../context-combiner/SKILL.md`, and
16
- `../../orc/subskills/orc-planner/SKILL.md` — this file is what YOU do around their
17
- dispatches and returns. Load at Phase 0 (analyst dispatch) and Phase 1
18
- (planner return). Emit a `GATE` trace line (pass|bounce) per check when
19
- logging.
20
-
21
- ## Deep-mode scout dispatch (yours)
22
-
23
- When the analyst runs in deep mode it returns a `scout_plan` (pass 1). You then
24
- dispatch ≤ `config.max_scouts` (default 3) parallel
25
- `orc-scout-sonnet-4-6-high` agents (`orc-scout-opus-5-low` when `opus5_only`
26
- — `../../_shared/opus5-only.md`; scouts fan out in PARALLEL, so this is the
27
- mode's largest single cost multiplier) — one coverage area each, read-only — and
28
- re-dispatch the analyst WITH their evidence bundles for pass 2. Same "return a
29
- request → you re-slice → re-dispatch" shape as `needs_context`. You never
30
- analyze; you only dispatch and relay.
31
-
32
- ## Analyst-return gates (deterministic, before any build option)
33
-
34
- 1. **Evidence spot-check:** Glob every `files[]` path in the spec +
35
- Grep-verify the quoted snippet on **EVERY quote-anchored ref, whatever its
36
- `status`** (v0.34.6). It used to check only `exists|conflict` — but the two
37
- statuses a GOOD audit most often produces are `resolved` (a challenged row
38
- the user decided) and `buildable` (the actual work), so a correctly-triaged
39
- analysis was the one the gate barely checked: a real spec had zero
40
- `exists|conflict` rows, so the mandated verification covered 0 of 5 refs and
41
- a `file:5` citing a quote that lives at `file:4` went through. It is one
42
- Grep per ref, and it is the ONLY mechanical defence against a wrong line
43
- number reaching the planner. Note the causal shape: that ref started as a
44
- line RANGE with no quote (auto-UNVERIFIED per hard rule 2); narrowing it to
45
- one line + quote was the CORRECT fix and is what introduced the off-by-one —
46
- tightening evidence granularity is itself an error surface, so the gate has
47
- to be what catches it.
48
- 2. **Derivation lint:** R# ids, statuses, and context-anchor set must match
49
- between report.md and requirement-spec.md.
50
-
51
- Any miss → bounce to the analyst with the miss list (one retry, then escalate
52
- to the user). Refuse take-into-build when the spec has open `UNVERIFIED` or
53
- lacks `scope_closed: true` (a one-Grep check).
54
-
55
- ## Combiner tracking (yours; full lane only)
56
-
57
- `context-combiner` (`orc-context-combiner-opus-5-high` — Opus 5 high, v0.34.0)
58
- merges 2+ RELATED, already-confirmed
59
- analyses from the same run into ONE combined requirement-spec before build.
60
-
61
- - **Track the analysis set:** hold the confirmed spec paths of every analysis
62
- this run in run state (survives checkpoint/resume).
63
- - When the user picks "pass to context-combiner" at orc-analyze's Phase F
64
- branch menu (offered only once 2+ analyses exist), dispatch
65
- `orc-context-combiner-opus-5-high` with that list.
66
- - The return carries `combined_spec_path` + `coverage_pct` (conservation
67
- proof — every source requirement accounted for; must be 100) + `dropped[]` +
68
- `stale_evidence[]` + `handoff_ready` — or `combined: false` if the user chose
69
- keep-separate at the combiner's relatedness challenge (then fall back to
70
- per-analysis stop/build).
71
- - Offer the build option ONLY when `handoff_ready` is true (the combiner sets
72
- it false when `coverage_pct` < 100 OR a conflict is open). On build, continue
73
- at Phase 1 with the combined spec exactly like a single requirement-spec.
74
-
75
- You never combine; you only track, dispatch, and relay.
76
-
77
- ## Spec staleness valve (Phase 1, before dispatching the planner)
78
-
79
- If the requirement-spec's `git_head` ≠ current HEAD (analysis and build in
80
- different sessions), re-run the analyst evidence spot-check (paths + quotes)
81
- BEFORE dispatching the planner; on misses offer re-analyze vs
82
- proceed-with-flagged.
83
-
84
- ## Phase 1 exit gate (deterministic, before scoring)
85
-
86
- 1. **Grounding spot-check:** Glob every path the plan marks
87
- `disposition: exists`. A task whose declared paths lack `grounding[]`
88
- entries counts as a miss.
89
- 2. **Coverage check:** recompute the planner's coverage echo — every in-scope
90
- spec R# / intent-spec DoD line must appear in ≥ 1 task's `requirements[]`;
91
- an `orphan` requirement is a miss (the user may explicitly descope instead).
92
- 3. **Graph checks:** cycle detection over `depends_on` + same-file collision
93
- over `declared_files` (two tasks sharing a file need a serializing dep or a
94
- merge). Both trivial at ≤ 20 tasks — never trust the planner's self-check
95
- alone.
96
- 4. **TDD/test-task collision (v0.34.4):** a `tdd_spec` entry whose target file
97
- is in the `declared_files` of a task whose `facets.test_surface` is
98
- `new-tests` is a miss. The paired TDD task materializes `tdd_spec` BEFORE the
99
- task it guards, so that task's planned work is already on disk and
100
- green by the time its wave opens — leaving only bad options (dispatch a
101
- no-op, silently drop promised coverage, or re-slice mid-run). The planner
102
- authored both mechanisms and folds them together itself: extend the
103
- materialized file, never re-author it.
104
- 5. **TDD disposition gate (v0.41.0)** — this gate is what lets TDD be skipped
105
- safely. Skipping a test is cheap to claim and expensive to get wrong, so
106
- every skip must be checkable, and it is checked in BOTH directions: a rule
107
- that only ever prevents tests is a rule that deletes coverage.
108
- - `disposition` outside the closed set
109
- `new-surface | behavior-change | covered-by-existing | no-behavior | no-runner`
110
- → miss. (Absent on a pre-v0.41.0 plan → derive from `kind`; never bounce an
111
- old plan — see the legacy exception below.)
112
- - `covered-by-existing` **without a resolvable `covered_by`** → miss. Glob the
113
- cited `path` exactly as check 1 does for `disposition: exists`. "A test
114
- already covers this" is the one claim that, if false, silently removes
115
- coverage the run promised.
116
- - `no-behavior` whose task has `facets.test_surface != none` → miss
117
- (self-contradiction: the planner said the surface is testable and that it
118
- isn't).
119
- - **Safety floor:** any entry that is `covered-by-existing` or `no-behavior`
120
- on a task with non-empty `facets.risk[]` → miss, no exceptions. Auth,
121
- money, migration, security, concurrency and data-integrity requirements do
122
- not ride on another test's coincidence.
123
- - `new-surface` / `behavior-change` missing `skeleton` or `given_when_then`
124
- → miss.
125
- - A disposition that DEVIATES from the derivation table in
126
- `../../orc/schemas/planning-output.md` without a `reason` → miss. The derivation
127
- is the default; departing from it is the thing that needs justifying.
128
-
129
- Any miss → the plan is malformed: bounce it back to the planner WITH the miss
130
- list (one retry), then escalate to the user. **Legacy exception:** a
131
- pre-v0.7.0 plan resumed from an old checkpoint has no `grounding[]`
132
- (pre-v0.9.0: no `requirements[]`/`spec_invariants[]`; pre-v0.41.0: no
133
- `disposition`) — resume it without the
134
- missing checks; never bounce an old plan.
135
-
136
- <!-- /orc:layer -->
1
+ # Phase — Analyst & plan gates (id: `analyst-gates`)
2
+
3
+ > **Library file** (`orc`, `orc-analyze`, `orc-mini`), `core` only: the orchestrator-side gates on a returned analysis or plan — a trimmed lane runs fewer of them, never different ones.
4
+
5
+ <!-- orc:layer core -->
6
+ ## Reference — Analyst, Combiner & Plan Gates (orchestrator side)
7
+
8
+ The orchestrator's deterministic gates around the analyst, the
9
+ context-combiner, and the planner. The roles themselves are defined in
10
+ `../../orc-analyze/SKILL.md`, `../../context-combiner/SKILL.md`, and
11
+ `../../orc/subskills/orc-planner/SKILL.md` — this file is what YOU do around their
12
+ dispatches and returns. Load at Phase 0 (analyst dispatch) and Phase 1
13
+ (planner return). Emit a `GATE` trace line (pass|bounce) per check when
14
+ logging.
15
+
16
+ ## Deep-mode scout dispatch (yours)
17
+
18
+ When the analyst runs in deep mode it returns a `scout_plan` (pass 1). You then
19
+ dispatch ≤ `config.max_scouts` (default 3) parallel
20
+ `orc-scout-sonnet-4-6-high` agents (`orc-scout-opus-5-low` when `opus5_only`
21
+ — `../../_shared/opus5-only.md`; scouts fan out in PARALLEL, so this is the
22
+ mode's largest single cost multiplier) — one coverage area each, read-only — and
23
+ re-dispatch the analyst WITH their evidence bundles for pass 2. Same "return a
24
+ request → you re-slice → re-dispatch" shape as `needs_context`. You never
25
+ analyze; you only dispatch and relay.
26
+
27
+ ## Analyst-return gates (deterministic, before any build option)
28
+
29
+ 1. **Evidence spot-check:** Glob every `files[]` path in the spec +
30
+ Grep-verify the quoted snippet on **EVERY quote-anchored ref, whatever its
31
+ `status`** — `resolved` and `buildable` included: they are the rows a GOOD
32
+ audit produces most. It is one Grep per ref, and it is the ONLY mechanical defence against a wrong line
33
+ number reaching the planner. Note the causal shape: that ref started as a
34
+ line RANGE with no quote (auto-UNVERIFIED per hard rule 2); narrowing it to
35
+ one line + quote was the CORRECT fix and is what introduced the off-by-one —
36
+ tightening evidence granularity is itself an error surface, so the gate has
37
+ to be what catches it.
38
+ 2. **Derivation lint:** R# ids, statuses, and context-anchor set must match
39
+ between report.md and requirement-spec.md.
40
+
41
+ Any miss → bounce to the analyst with the miss list (one retry, then escalate
42
+ to the user). Refuse take-into-build when the spec has open `UNVERIFIED` or
43
+ lacks `scope_closed: true` (a one-Grep check).
44
+
45
+ ## Combiner tracking (yours; full lane only)
46
+
47
+ `context-combiner` (`orc-context-combiner-opus-5-high` — Opus 5.5 high)
48
+ merges 2+ RELATED, already-confirmed
49
+ analyses from the same run into ONE combined requirement-spec before build.
50
+
51
+ - **Track the analysis set:** hold the confirmed spec paths of every analysis
52
+ this run in run state (survives checkpoint/resume).
53
+ - When the user picks "pass to context-combiner" at orc-analyze's Phase F
54
+ branch menu (offered only once 2+ analyses exist), dispatch
55
+ `orc-context-combiner-opus-5-high` with that list.
56
+ - The return carries `combined_spec_path` + `coverage_pct` (conservation
57
+ proof — every source requirement accounted for; must be 100) + `dropped[]` +
58
+ `stale_evidence[]` + `handoff_ready` — or `combined: false` if the user chose
59
+ keep-separate at the combiner's relatedness challenge (then fall back to
60
+ per-analysis stop/build).
61
+ - Offer the build option ONLY when `handoff_ready` is true (the combiner sets
62
+ it false when `coverage_pct` < 100 OR a conflict is open). On build, continue
63
+ at Phase 1 with the combined spec exactly like a single requirement-spec.
64
+
65
+ You never combine; you only track, dispatch, and relay.
66
+
67
+ ## Spec staleness valve (Phase 1, before dispatching the planner)
68
+
69
+ If the requirement-spec's `git_head` ≠ current HEAD (analysis and build in
70
+ different sessions), re-run the analyst evidence spot-check (paths + quotes)
71
+ BEFORE dispatching the planner; on misses offer re-analyze vs
72
+ proceed-with-flagged.
73
+
74
+ ## Phase 1 exit gate (deterministic, before scoring)
75
+
76
+ 1. **Grounding spot-check:** Glob every path the plan marks
77
+ `disposition: exists`. A task whose declared paths lack `grounding[]`
78
+ entries counts as a miss.
79
+ 2. **Coverage check:** recompute the planner's coverage echo — every in-scope
80
+ spec R# / intent-spec DoD line must appear in ≥ 1 task's `requirements[]`;
81
+ an `orphan` requirement is a miss (the user may explicitly descope instead).
82
+ 3. **Graph checks:** cycle detection over `depends_on` + same-file collision
83
+ over `declared_files` (two tasks sharing a file need a serializing dep or a
84
+ merge). Both trivial at ≤ 20 tasks — never trust the planner's self-check
85
+ alone.
86
+ 4. **TDD/test-task collision:** a `tdd_spec` entry whose target file
87
+ is in the `declared_files` of a task whose `facets.test_surface` is
88
+ `new-tests` is a miss. The paired TDD task materializes `tdd_spec` BEFORE the
89
+ task it guards, so that task's planned work is already on disk and
90
+ green by the time its wave opens — leaving only bad options (dispatch a
91
+ no-op, silently drop promised coverage, or re-slice mid-run). The planner
92
+ authored both mechanisms and folds them together itself: extend the
93
+ materialized file, never re-author it.
94
+ 5. **TDD disposition gate** — this gate is what lets TDD be skipped
95
+ safely. Skipping a test is cheap to claim and expensive to get wrong, so
96
+ every skip must be checkable, and it is checked in BOTH directions: a rule
97
+ that only ever prevents tests is a rule that deletes coverage.
98
+ - `disposition` outside the closed set
99
+ `new-surface | behavior-change | covered-by-existing | no-behavior | no-runner`
100
+ → miss. (No `disposition` on an entry → derive it from `kind`; never bounce
101
+ the plan — see the legacy exception below.)
102
+ - `covered-by-existing` **without a resolvable `covered_by`** → miss. Glob the
103
+ cited `path` exactly as check 1 does for `disposition: exists`. "A test
104
+ already covers this" is the one claim that, if false, silently removes
105
+ coverage the run promised.
106
+ - `no-behavior` whose task has `facets.test_surface != none` → miss
107
+ (self-contradiction: the planner said the surface is testable and that it
108
+ isn't).
109
+ - **Safety floor:** any entry that is `covered-by-existing` or `no-behavior`
110
+ on a task with non-empty `facets.risk[]` → miss, no exceptions. Auth,
111
+ money, migration, security, concurrency and data-integrity requirements do
112
+ not ride on another test's coincidence.
113
+ - `new-surface` / `behavior-change` missing `skeleton` or `given_when_then`
114
+ → miss.
115
+ - A disposition that DEVIATES from the derivation table in
116
+ `../../orc/schemas/planning-output.md` without a `reason` → miss. The derivation
117
+ is the default; departing from it is the thing that needs justifying.
118
+
119
+ Any miss → the plan is malformed: bounce it back to the planner WITH the miss
120
+ list (one retry), then escalate to the user. **Legacy exception:** a
121
+ plan resumed from an old checkpoint may lack `grounding[]`,
122
+ `requirements[]`/`spec_invariants[]` or `disposition` — resume it without the
123
+ missing checks; never bounce an old plan.
124
+
125
+ <!-- /orc:layer -->
@@ -1,16 +1,6 @@
1
1
  # Phase — Execution (id: `execution`)
2
2
 
3
- > **Shared phase file.** Moved out of `orc/SKILL.md` at v1.0.0 W12, and into
4
- > this library at W13 when `orc-diy` became its second reader. A spine is loaded
5
- > IN FULL when its skill activates; this is loaded when the phase fires, and most
6
- > runs skip most phases.
7
- >
8
- > **Two layers, and a lane reads exactly one.** `full` is `/orc`'s procedure.
9
- > `composed` is what `orc diy compile` stitches — the same phase expressed as
10
- > `<!-- diy:when -->` variants over a composed flow, NOT a second copy of the
11
- > procedure. Reading the wrong one is the failure `README.md` names: a lane
12
- > doing a phase its product promise says it does differently.
13
- > `orc lane phases <lane> --json` names the layer for each lane.
3
+ > **Shared phase file** — read when the phase fires. A lane reads ONE layer: `full` (`/orc`) or `composed` (the `<!-- diy:when -->` variants `orc diy compile` stitches). `orc lane phases <lane> --json` names it.
14
4
 
15
5
  <!-- orc:layer full -->
16
6
 
@@ -60,8 +50,12 @@ the codifier); hold resolved patterns in run state.
60
50
  `trace_extras[]` entry VERBATIM into the packet — the CLI composes them, and the
61
51
  hook emits NO `SPAWN`/`RETURN` for a foreign worker, so they are the whole record.
62
52
  2. Record worker milestone pings (they bound what a mid-wave stop can save).
63
- 3. Collect returns; VALIDATE each (emit `VERIFY <task> actual=<model>/<effort>`
64
- ✅ MATCH / ⛔ DOWNGRADE per return — surface any downgrade to the user).
53
+ 3. Collect returns; VALIDATE each — read `_shared/return-validation.md` §1–§3,
54
+ then ONLY the § of each field the slice carried (§4 `pattern`, §5 `tdd_spec`,
55
+ §5b wiki, §5b.1 graph, §5c `rules_card`, §5d `repro`); §0 only before a
56
+ re-dispatch, §6 only after the wave, §7 only on a repair loop. Emit
57
+ `VERIFY <task> actual=<model>/<effort>` ✅ MATCH / ⛔ DOWNGRADE per return —
58
+ surface any downgrade to the user.
65
59
  **A FOREIGN return runs `_shared/return-validation.md` §2b INSTEAD of §2** — it
66
60
  has no injected model-id line, so it cannot carry `actual_model` and faking one
67
61
  claims evidence that does not exist; ⛔ SUBSTITUTION replaces the downgrade
@@ -106,7 +100,7 @@ invalidates a DONE task → re-run once, then set every reverse-`depends_on`
106
100
  consumer to `stale_review`. **Worker failure/garbage/timeout:** flag +
107
101
  continue the wave; audit and re-dispatch at the next batch checkpoint
108
102
 
109
- **Before any re-dispatch, run `orc run inflight`** (0 clear · 1 in-flight · 2 unknown). A Task error does not kill the agent behind it, and exit 2 REFUSES by default — `a lane that re-dispatches over a live attempt` has broken the contract. Canonical: `../return-validation.md`.
103
+ **Before any re-dispatch, run `orc run inflight`** (0 clear · 1 in-flight · 2 unknown). A Task error does not kill the agent behind it, and exit 2 REFUSES by default — `a lane that re-dispatches over a live attempt` has broken the contract. Canonical: `../return-validation.md` §0.
110
104
  (`requeued`, retry_count++). Hard retry cap 2 → STOP and surface.
111
105
 
112
106
  <!-- /orc:layer -->