@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
@@ -4,22 +4,20 @@ Canonical procedure for validating a spawned agent's return. Every ORC lane
4
4
  (full, mini, fast, wiki, diy) runs this on EVERY return; a malformed return is
5
5
  a failure (requeue/re-dispatch with reason — lane sets the retry cap).
6
6
 
7
+ **Read the SECTION, not the file.** Every return: §1–§3. Then ONLY the § of
8
+ each field the slice carried — §4 `pattern`, §5 `tdd_spec`, §5b wiki, §5b.1
9
+ graph cards, §5c the rules card, §5d `repro`. §2b only for a foreign return. §0
10
+ only before a re-dispatch. §6 only after a wave. §7 only on a repair loop. The §
11
+ numbers are anchors: never renumber or rename a § heading.
12
+
7
13
  ## 0. Is the previous attempt still ALIVE? (v1.2.0) — BEFORE anything else
8
14
 
9
15
  > **`a lane that re-dispatches over a live attempt` has broken this contract.**
10
16
 
11
17
  **A Task error does not kill the agent behind it.** Claude Code's tool call can
12
18
  fail, time out, or be cut off mid-turn while the subagent it started keeps
13
- running — and keeps writing files. Every rule below this line ends in
14
- "re-dispatch", and every one of them silently assumed a failed call meant a dead
15
- agent. It does not.
16
-
17
- What that costs, measured: one graded `/orc-quick` entry put THREE
18
- `orc-executor-opus-5-low` agents on the SAME task — 50m19s, 115m22s and
19
- 100m53s, **266 minutes of Opus 5 for one authorised dispatch**, all editing the
20
- same files, inside a 2h04m window. The second was dispatched 4m19s after the
21
- first, while the first was still working. The hook had recorded all three; no
22
- lane had ever read that record.
19
+ running — and keeps writing files. Every rule below ends in "re-dispatch";
20
+ none of them may assume that a failed call means a dead agent.
23
21
 
24
22
  ### The rule
25
23
 
@@ -49,8 +47,7 @@ A usage limit, an API error, a dropped connection or a `Ctrl+C` between a
49
47
  dispatch and its return says **nothing** about the agent. Treat it as §0 exit 2
50
48
  and ask. A lane that classifies an interruption as a failure re-dispatches into
51
49
  a live agent, gets interrupted again sooner because it is now paying twice, and
52
- the loop tightens on itself — which is exactly how the 266-minute entry
53
- happened.
50
+ the loop tightens on itself.
54
51
 
55
52
  ### What refusing looks like
56
53
 
@@ -102,64 +99,14 @@ is on the wrong model.)
102
99
 
103
100
  ## 2b. A FOREIGN return — the SUBSTITUTION check (v0.50.0)
104
101
 
105
- A foreign worker (`orc extra dispatch`, `_shared/extra-dispatch.md`) is not a
106
- Claude subagent. It has no injected system-prompt model-id line, so **it cannot
107
- carry `actual_model`** — and §2 must not be faked for it. A foreign return that
108
- claimed an `actual_model` would be claiming evidence that does not exist.
109
-
110
- It carries instead, and every one of these is quoted from the wire rather than
111
- assumed:
112
-
113
- - `engine` (`api` | `claude-shim` | `cli`), `provider`, `profile`
114
- - `model_requested` — what the route row asked for
115
- - **`model_reported`** — the `model` field the endpoint echoed back
116
- - `usage` — the four token kinds, never blended, **or `null`**
117
-
118
- **`model_reported != model_requested` is ⛔ SUBSTITUTION**, surfaced to the user
119
- exactly as ⛔ DOWNGRADE is today and never silently accepted. It is the only
120
- defence against an aggregator quietly serving something else. `unknown` is a
121
- valid, honest value and is reported as `unknown` — **never as a match**.
122
-
123
- **A clean model check is not a clean answer.** An aggregator's *provider-level*
124
- fallback is on by default and it PRESERVES the model id, so the substitution
125
- check reads clean while the code went to a different company. Engine `api`
126
- records the response's `provider` echo and reports **⚠ REROUTE**; the other two
127
- engines cannot see it at all, and their `served_by_note` says so. An absent
128
- measurement is never a pass.
129
-
130
- **`usage: null` is not four zeros.** A worker that reported no token counts
131
- (engine `cli` frequently) returns `null` plus a note. `{0,0,0,0}` would tell
132
- `/orc-budget` the run was free. Engine `api`'s `cache_write: 0` is the opposite
133
- case — a real measurement — so the two must never be normalised together.
134
-
135
- **The fence is per-engine, and the return says which one it had.** Engine `api`
136
- ENFORCES `declared_files`; engines `claude-shim` and `cli` ASK. A return
137
- carrying `fence: {declared_files: false}` means the list was an instruction, not
138
- a rule — treat §6 below as the only real check, and say so to the user rather
139
- than reporting a constraint that was never applied.
140
-
141
- **A RESUMED foreign dispatch owes three more fields** (v0.54.0). The dispatch
142
- return sets `resume_expected: true`, so the obligation is never inferred:
143
-
144
- - **`resume_state`** — `continued` · `restarted` · `no-op`. Absent on a slice
145
- with no `resumed_from` is correct; **absent on a resume slice is MALFORMED.**
146
- A return claiming `restarted` while `preexisting[]` was non-empty is a
147
- FINDING, not a failure — it is how `/orc-retro` learns which providers ignore
148
- a resume preamble, so surface it rather than treating it as a bad return.
149
- - **`preexisting_read[]`** — which pre-existing files the worker actually
150
- opened. Quoted like `wiki_used`: **what it did, never what the dispatcher
151
- assumed.** An EMPTY list on a resume whose `preexisting[]` was not empty is an
152
- honest and informative return — it says the worker ignored the preamble — and
153
- it must be surfaced, never dropped.
154
- - **`journal_fidelity`** — relayed from the dispatch return (`per-turn` |
155
- `streamed-opaque`), so a validator never reports `streamed-opaque` evidence as
156
- if it had per-turn tool attribution.
157
-
158
- Everything else in this file applies to a foreign return unchanged: the
159
- honest-status rules, the pattern attestation, the TDD attestation, the wiki
160
- attestation, and above all **§6, the worktree delta** — which is engine-blind
161
- because it reads the worktree rather than the return, and is therefore what
162
- makes a foreign executor safe at all.
102
+ Read this § only when `extra_enabled` and the return came from `orc extra
103
+ dispatch`. A foreign worker has no system-prompt model-id line, so **it cannot
104
+ carry `actual_model`** — never fake §2 for it. **`model_reported !=
105
+ model_requested` is ⛔ SUBSTITUTION**, surfaced exactly as ⛔ DOWNGRADE. A
106
+ RESUMED foreign dispatch also owes `resume_state`, `preexisting_read[]` and
107
+ `journal_fidelity`. The full check — the wire fields, ⚠ REROUTE, `usage: null`,
108
+ the per-engine fence and the resume fields — is `extra-dispatch.md`
109
+ §The return contract delta. Every other § of this file applies unchanged.
163
110
 
164
111
  ## 3. Honest-status rules (executor returns)
165
112
 
@@ -0,0 +1,79 @@
1
+ # The review slice — the ONE shape every lane uses
2
+
3
+ > **On demand.** Read this file ONLY when a review dispatch is about to be built
4
+ > (`/orc` Phase 5 and its composed DIY layer, `orc-review-verify/core.md`, the
5
+ > `/orc-quick` review offer, the `/orc-mini` risk-high option, the `/orc-pr-driver`
6
+ > per-layer gate, `/orc-ultra` gate 3). One slice, so a review in quick is the
7
+ > same review as in `/orc`. The procedure and the return live in the agent file
8
+ > (`.claude/agents/orc-reviewer-opus-5-med.md`), never here.
9
+
10
+ Slice fields: changed_files[] · diff_ranges[] · acceptance_criteria[] · constraints[] · code_pattern · invariants[] · validation_gate[] · fe_rules[] · security_checklist[] · graph_changes · tool_findings[] · gotcha_card · rules_card · previous_findings[] · mode
11
+
12
+ ## §1 R1 — the free check (before ANY review dispatch)
13
+
14
+ The free check always runs before the paid one. On the changed files only:
15
+
16
+ 1. Run the project's OWN lint and type check. Take the commands from
17
+ `wiki-meta.json` `commands`; else the `package.json` scripts named `lint` /
18
+ `typecheck`; else the `pyproject` / `Makefile` targets of those names; else
19
+ `sonar-scanner` when the project already has it. **Never invent a command.
20
+ Never install tooling.** No command found → `tool_findings[]` is empty; say so
21
+ in one line.
22
+ 2. Run `orc rules lint --diff` (free, zero tokens).
23
+ 3. Keep only the output lines that land on a changed file → `tool_findings[]`
24
+ (`{tool, location, message}`). **The reviewer must not re-report them.**
25
+
26
+ `/orc-ultra` gate 3 reuses this step (it does not run a second copy); a fix wave
27
+ that changed files re-runs it first.
28
+
29
+ ## §2 The fields
30
+
31
+ | Field | Source |
32
+ |---|---|
33
+ | `changed_files[]`, `diff_ranges[]` | git — `diff_ranges` are the changed line ranges per file (R2) |
34
+ | `acceptance_criteria[]`, `constraints[]` | the plan / the quick entry |
35
+ | `code_pattern`, `invariants[]`, `validation_gate[]` | the pattern cache (or null / empty) |
36
+ | `fe_rules[]`, `security_checklist[]` | FE diffs / `mode: security` only, else empty |
37
+ | `graph_changes` | `orc graph changes --if-enabled --json` — **keeps its rows: no `--brief` here** |
38
+ | `tool_findings[]` | §1 |
39
+ | `gotcha_card` | `orc gotcha card --files <changed csv> --lane <lane> --json` → `text` |
40
+ | `rules_card` | `orc rules slice --lane <lane> --json` → `text` (a lane with no rules → null) |
41
+ | `previous_findings[]` | the checkpoint, on a re-review ONLY (R9), each with its outcome |
42
+ | `mode` | `review` · `disprove` · `security` |
43
+
44
+ - **`graph_changes`** (`code-graph.md` §7): the symbols THIS diff's hunks overlap,
45
+ each with its callers, its tests and a risk word that carries its own reason.
46
+ The reviewer is handed `symbols[].caller_files` and reads them.
47
+ It replaces a whole-file `orc graph impact` here: a file card reports every symbol in
48
+ a touched file, and a symbol nobody edited is not a finding. An unchanged caller of
49
+ a changed signature is a finding candidate, anchored like any other.
50
+ - **`gotcha_card` is ALWAYS built** when anything matches — no switch removes it
51
+ (`gotcha_card_budget` is only its size). Exit 1 (no match) → null, the normal
52
+ case. Its header counts what the budget dropped; never cut it silently.
53
+ The session hook ALSO hands it to every `orc-reviewer-*`, `orc-verifier-*` and
54
+ `orc-judge-*` at `SubagentStart` (v2.0.2), so a slice that forgot it still has it.
55
+ Before the card, run `orc gotcha sync --json` (it is due at most once per
56
+ `gotcha_sync_hours`); exit 2 (a CLI that has no `sync`) or any failure → go on.
57
+ - **`mode: disprove`** carries only the P0/P1 findings to test and their files.
58
+
59
+ ## §3 After the return — the after-filter (R10)
60
+
61
+ The reviewer reports EVERY finding. Then, before the ladder acts:
62
+
63
+ 1. Pipe the findings to `orc gotcha filter --findings - --json`. It drops P2/P3
64
+ that a `suppress` gotcha names, folds P3 above 5 into `+N similar`, and applies
65
+ the category noise budget. **It never removes a P0 or P1.** Keep its `kept`;
66
+ list its `removed[]` (each with the `by` id) in the run summary — a count is
67
+ not consent.
68
+ 2. `pre_existing: true` findings (on a line outside `diff_ranges`) go to their own
69
+ bucket. They never gate.
70
+ 3. A P0/P1 with no `scenario`, or with `confidence: low`, becomes P2.
71
+ 4. Findings that share a `group` are ONE fix: the P0 fix, the P1 ask and the P2
72
+ batch are made per group (R7).
73
+
74
+ 5. At review close, record one observation per finding and emit the
75
+ `FINDING-OUTCOME` line — `gotchas.md` §10 "Review close" (`/orc` Phase 7,
76
+ `/orc-mini` after its risk option, `/orc-quick` after the review offer).
77
+
78
+ **Superpowers path** (DE-13): after the Superpowers review skill returns, run
79
+ this §3 on its findings too, outcomes included — never a second reviewer dispatch.
@@ -1,28 +1,46 @@
1
- # Smoke gate (read-only build + test ship gate)
2
-
3
- Canonical procedure for the smoke gate run by orc-mini (Phase M) and orc-fast
4
- (Phase F3). The gate is the orchestrator's INDEPENDENT check — the executor's
5
- `evidence` is a claim; your run is the verification (when they disagree, say
6
- so). Running build+test is read-only and is NOT implementation: you still
7
- never write code.
8
-
9
- ## Procedure
10
-
11
- 1. Discover the commands: prefer the wiki manifest's `commands` block when it
12
- exists (recorded at scan time — don't rediscover tooling); otherwise detect
13
- the stack's build + test runner once and say which you chose.
14
- 2. Run build, then the fast test suite, once each.
15
- 3. Verdict (emit the `VERDICT pass|fail` trace line):
16
- - **GREEN** → proceed to the lane's next step (test-ask / ship).
17
- - **RED** → **never offer commit/ship.** Surface the failure verbatim, then
18
- ONE repair round: re-dispatch the SAME executor with the failing output
19
- as `failure_reason`, and re-run this gate. A second RED → STOP and
20
- surface; the lane names its escalation options (mini: stop; fast:
21
- escalate to orc-mini / switch to full `/orc` / stop).
22
- - **No runnable build/test** (docs-only repo) → say so explicitly; the
23
- gate is N/A — never silently skip it.
24
-
25
- ## What it is not
26
-
27
- Smoke, not verification: no findings classification, no criteria matrix, no
28
- severity ladder. A run that needs that depth belongs in the full lane.
1
+ # Smoke gate (read-only build + test ship gate)
2
+
3
+ Canonical procedure for the smoke gate run by orc-mini (Phase M) and orc-fast
4
+ (Phase F3). The gate is the orchestrator's INDEPENDENT check — the executor's
5
+ `evidence` is a claim; your run is the verification (when they disagree, say
6
+ so). Running build+test is read-only and is NOT implementation: you still
7
+ never write code.
8
+
9
+ ## Procedure
10
+
11
+ 1. Discover the commands: prefer the wiki manifest's `commands` block when it
12
+ exists (recorded at scan time — don't rediscover tooling); otherwise detect
13
+ the stack's build + test runner once and say which you chose.
14
+ 2. Run build, then the fast test suite, once each.
15
+ 3. Verdict (emit the `VERDICT pass|fail` trace line):
16
+ - **GREEN** → proceed to the lane's next step (test-ask / ship).
17
+ - **RED** → **never offer commit/ship.** Run the flaky check first
18
+ (§Flaky). Still red → surface the failure verbatim, then
19
+ ONE repair round: re-dispatch the SAME executor with the failing output
20
+ as `failure_reason`, and re-run this gate. A second RED → STOP and
21
+ surface; the lane names its escalation options (mini: stop; fast:
22
+ escalate to orc-mini / switch to full `/orc` / stop).
23
+ - **No runnable build/test** (docs-only repo) → say so explicitly; the
24
+ gate is N/A — never silently skip it.
25
+
26
+ ## Flaky — before any repair round
27
+
28
+ **Everywhere a test runs** (this gate, `/orc-quick` §3.2, `/orc` verify's TDD
29
+ gate, every repair loop): a RED test run gets ONE identical re-run of ONLY the
30
+ failing tests, before any repair. Save both outputs, then ask the CLI — never
31
+ judge it yourself:
32
+
33
+ `orc ci flaky --first <log> --rerun <log> [--rerun-exit <n>] --json`
34
+
35
+ - `--first` alone names the failing tests to re-run (`tests_failed[]`).
36
+ - Exit 0 = **FLAKY**: every failing test passed on the re-run. Emit its
37
+ `gate_line` (`GATE flaky :: <tests>`), report the tests, and do NOT start a
38
+ repair round. A flaky run is not red and does not use a round.
39
+ - Exit 1 = red (a test failed again, did not run, or the re-run exited ≠ 0) →
40
+ the repair round as usual. Exit 3 = no test name in the log → red.
41
+ - One re-run only. Never re-run until green.
42
+
43
+ ## What it is not
44
+
45
+ Smoke, not verification: no findings classification, no criteria matrix, no
46
+ severity ladder. A run that needs that depth belongs in the full lane.
@@ -1,20 +1,10 @@
1
1
  ---
2
2
  name: context-combiner
3
3
  description: >
4
- Combines 2+ RELATED, already-confirmed ORC analyses (from orc-analyze) into
5
- ONE merged, deduped, conflict-resolved requirement context before build. Use
6
- when the user analyzed multiple related documents within the same scope and
7
- chose "pass to context-combiner" at orc-analyze's Phase F. Verifies the source
8
- analyses actually overlap (shared files/requirements/scope) and challenges the
9
- user if they look unrelated; pools ALL source requirements into one table and
10
- reconciles them (exact/semantic duplicates, partial overlaps split — never
11
- collapsed, conflicts, ordering) one issue at a time; proves NOTHING WAS LOST
12
- via a source coverage matrix and a 100% coverage gate before handoff;
13
- spot-checks inherited evidence and marks stale anchors; writes
14
- combined-report.md + combined-requirement-spec.md, which reuse the
15
- requirement-spec schema, so the planner/build pipeline is unchanged. Full
16
- lane only. The orchestrator DISPATCHES this to a subagent — it never
17
- combines itself, and the combiner never spawns subagents.
4
+ Internal to /orc: merges 2+ RELATED, confirmed orc-analyze analyses into ONE
5
+ deduped, conflict-resolved requirement context. Dispatched when the user picks
6
+ "pass to context-combiner" at orc-analyze's Phase F.
7
+ disable-model-invocation: true
18
8
  ---
19
9
 
20
10
  # CONTEXT-COMBINER
@@ -31,7 +21,7 @@ it were a single analysis — with PROOF that no source requirement was lost.
31
21
  ## Hard rules
32
22
 
33
23
  1. **Dispatched, not self-run.** The orchestrator coordinates; the Combiner
34
- subagent (Opus 5 high) reads the specs and reconciles them against each
24
+ subagent (Opus 5.5 high) reads the specs and reconciles them against each
35
25
  other. The combiner NEVER builds and NEVER spawns subagents.
36
26
  2. **Related only — verify + challenge.** The user asserted relatedness at the
37
27
  Phase F gate, but the combiner MUST verify real overlap (shared files,
@@ -80,11 +70,9 @@ it were a single analysis — with PROOF that no source requirement was lost.
80
70
 
81
71
  ## Phases
82
72
 
83
- `orc lane phases context-combiner --json` is this lane's pipeline: the ordered list, where
84
- each phase lives, and how much of it to read. **The CLI owns the order** — never
85
- derive it from the headings below, and never renumber or rename one without the
86
- manifest, because a `read: section` pointer names a HEADING and a renamed heading
87
- is a pointer into nothing.
73
+ `orc lane phases context-combiner --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).
88
76
 
89
77
  ## Phase A — Load sources
90
78
  Read every source `requirement-spec.md` (2+) the orchestrator hands you, plus
@@ -194,29 +182,12 @@ withheld until the open conflict is resolved and coverage is complete.
194
182
  ## No mini variant
195
183
  Full lane only. `orc-analyze-mini` / `orc-mini` do not use the combiner.
196
184
 
197
- ## Config
185
+ ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
198
186
 
199
- Resolve with `orc lane config context-combiner --json` and obey `effective`. Never merge
200
- `.claude/orc.config.yaml` yourself, and never re-derive a precedence. Exit ≠ 0 →
201
- say so and use `../_shared/config-precedence.md`'s documented defaults, out
202
- loud. Nothing this lane reads is contested, gated or a stop, so it owes no
203
- preflight line and has no gate to honour.
204
-
205
- ## Calls
206
-
207
- **ONE catalogue, and it is not you:** `orc lane calls context-combiner --json` names every
208
- CLI call this lane makes, each with its exit-code contract, its cost, when to run
209
- it, and what an EMPTY answer means. Never invent a spelling, never re-word an
210
- exit code, and never re-derive a state word — the CLI's state words are the only
211
- state words, and **an exit code is an ANSWER wherever that contract says so, not
212
- a failure**. A call the answer does not name is a call this lane does not make.
213
- Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
214
- command you are about to run, out loud, before running it.
215
-
216
- ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
217
-
218
- `orc rules slice --lane context-combiner --json` is the ONLY assembler; never build
219
- the card here. It rides under the house rules and above the task —
220
- **house rules > your project's rules > ORC's own packs** — and its `line` prints
221
- VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
222
- never a silent choice) and `rules_overridden[]`.
187
+ - **Calls:** `orc lane calls context-combiner --json` names every call and its exit codes.
188
+ **An exit code is an ANSWER where it says so, not a failure.** Make no other call.
189
+ - **Config:** `orc lane config context-combiner --json`. Obey `effective`. Never merge
190
+ `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`). Nothing
191
+ here is contested, gated or a stop: no preflight line, no gate to honour.
192
+ - **Rules:** `orc rules slice --lane context-combiner --json` is the ONLY assembler
193
+ (`../_shared/phases/rules.md`). Its `line` prints VERBATIM at preflight.
@@ -1,78 +1,78 @@
1
- # Template — Combined Analysis Report
2
-
3
- Human-readable source of truth for a MERGE of 2+ related analyses. Written to
4
- orc/analyzer/combined-{name}/combined-report.md. Copied OUT to
5
- {report_out_dir}/combined-{name}/ on "stop here".
6
-
7
- ```markdown
8
- # Combined Analysis Report — {combined-name}
9
- kind: combined
10
- combined_from: [analysis-A, analysis-B, ...] # source analysis names
11
- scope: <the shared scope X these analyses live in>
12
- combined_at: DDMMYY HH:MM:SS
13
- combined_against: <git HEAD short sha the evidence spot-check ran against>
14
- model: opus-5-high # the RESOLVED model of the combiner that produced
15
- # this — never copied from here
16
-
17
- ## Relatedness check
18
- How the source analyses overlap — shared files, overlapping requirements,
19
- shared scope. If overlap was weak, the user was challenged and their decision
20
- is recorded here.
21
- - Shared files: web/reports/x (analysis-A R1, analysis-B R2)
22
- - Overlapping requirement: both add export to the reports module
23
- - Verdict: related (confirmed) | combined-anyway (user override) | ...
24
-
25
- ## Merged requirements (deduped, ordered)
26
- Every row carries file:line evidence inherited from the source spec (the
27
- combiner trusts confirmed specs; it does not re-derive the code) — spot-checked
28
- against `combined_against`; anchors that no longer match are marked STALE and
29
- were challenged, never silently carried. SEMANTIC-DUPLICATE merges quote both
30
- original statements. PARTIAL-OVERLAP rows are split (shared + residue), never
31
- collapsed. `Depth` is shown when sources differ in depth.
32
-
33
- | # | Requirement (merged) | From | Depth | Code reality | Evidence (file:line) | Files/modules | Status |
34
- |---|----------------------|------|-------|--------------|----------------------|---------------|--------|
35
- | 1 | "add CSV export" | A.R1 | deep | HTML only | web/reports/view.x:30 | web/reports/x | buildable |
36
- | 2 | "reuse report auth" | A.R2, B.R3 (dedup) | standard | guard present | web/reports/routes.x:12 (STALE — user chose proceed) | web/reports/x | exists |
37
-
38
- ## Source coverage matrix (conservation proof)
39
- EVERY source requirement ID appears exactly once with exactly one Outcome.
40
- `dropped` requires a recorded user decision in combine-decisions.md. The gate
41
- below must show coverage_pct: 100 before this report can hand off to build.
42
-
43
- | Source ID | Outcome | Merged as | Decision ref |
44
- |-----------|---------|-----------|--------------|
45
- | A.R1 | merged | #1 | — |
46
- | A.R2 | deduped-into | #2 | — |
47
- | B.R2 | conflict-resolved | #3 | combine-decisions.md #2 |
48
- | B.R3 | deduped-into | #2 | — |
49
- | B.R4 | dropped | — | combine-decisions.md #4 (user: superseded by A.R1) |
50
-
51
- - source requirements total: {N} · accounted: {N} · coverage_pct: 100
52
-
53
- ## Additional context (do not build)
54
- Anchored, non-actionable context merged from the sources — each item re-pointed at
55
- the merged requirement it serves. Dedupe ONLY when the evidence anchor is the same
56
- file:line AND the notes convey the same constraint — near-identical notes are kept,
57
- both, with their own From tags. Read for understanding; never a task. Omit this
58
- whole section if no source carried context.
59
- | Anchor (merged #) | From | From scope | Dependency | Touchpoint to respect | Evidence (file:line) |
60
- |-------------------|------|-----------|------------|-----------------------|----------------------|
61
- | 1 (CSV export) | A.ctx | reporting (Y) | consumes-output | report query already paginates; export must page too | web/reports/query.x:44 |
62
-
63
- ## Cross-scope conflicts & decisions
64
- Every conflict/duplicate/partial-overlap/ordering issue found across sources
65
- (including contradictory resolved assumptions), each raised as a
66
- recommended-option challenge and resolved. Decisions are also checkpointed
67
- eagerly in combine-decisions.md.
68
- - CONFLICT (resolved): A.R4 wants offset paging, B.R2 wants cursor — user chose cursor.
69
- - DUPLICATE (merged): A.R2 and B.R3 both reuse auth — merged into #2.
70
- - PARTIAL-OVERLAP (split): A.R5 subsumes B.R1 — shared row #4, A-only residue row #5.
71
- - ORDERING (structured): before: #1 (A export) → after: #6 (B schedule).
72
-
73
- ## Open questions (block handoff until resolved)
74
- - (none) | UNRESOLVED: ... — combiner refuses build handoff while any remain.
75
-
76
- ## Handoff readiness
77
- - complete: yes/no (coverage_pct == 100, all conflicts resolved, no open UNRESOLVED)
78
- ```
1
+ # Template — Combined Analysis Report
2
+
3
+ Human-readable source of truth for a MERGE of 2+ related analyses. Written to
4
+ orc/analyzer/combined-{name}/combined-report.md. Copied OUT to
5
+ {report_out_dir}/combined-{name}/ on "stop here".
6
+
7
+ ```markdown
8
+ # Combined Analysis Report — {combined-name}
9
+ kind: combined
10
+ combined_from: [analysis-A, analysis-B, ...] # source analysis names
11
+ scope: <the shared scope X these analyses live in>
12
+ combined_at: DDMMYY HH:MM:SS
13
+ combined_against: <git HEAD short sha the evidence spot-check ran against>
14
+ model: opus-5-5-high # the RESOLVED model of the combiner that produced
15
+ # this — never copied from here
16
+
17
+ ## Relatedness check
18
+ How the source analyses overlap — shared files, overlapping requirements,
19
+ shared scope. If overlap was weak, the user was challenged and their decision
20
+ is recorded here.
21
+ - Shared files: web/reports/x (analysis-A R1, analysis-B R2)
22
+ - Overlapping requirement: both add export to the reports module
23
+ - Verdict: related (confirmed) | combined-anyway (user override) | ...
24
+
25
+ ## Merged requirements (deduped, ordered)
26
+ Every row carries file:line evidence inherited from the source spec (the
27
+ combiner trusts confirmed specs; it does not re-derive the code) — spot-checked
28
+ against `combined_against`; anchors that no longer match are marked STALE and
29
+ were challenged, never silently carried. SEMANTIC-DUPLICATE merges quote both
30
+ original statements. PARTIAL-OVERLAP rows are split (shared + residue), never
31
+ collapsed. `Depth` is shown when sources differ in depth.
32
+
33
+ | # | Requirement (merged) | From | Depth | Code reality | Evidence (file:line) | Files/modules | Status |
34
+ |---|----------------------|------|-------|--------------|----------------------|---------------|--------|
35
+ | 1 | "add CSV export" | A.R1 | deep | HTML only | web/reports/view.x:30 | web/reports/x | buildable |
36
+ | 2 | "reuse report auth" | A.R2, B.R3 (dedup) | standard | guard present | web/reports/routes.x:12 (STALE — user chose proceed) | web/reports/x | exists |
37
+
38
+ ## Source coverage matrix (conservation proof)
39
+ EVERY source requirement ID appears exactly once with exactly one Outcome.
40
+ `dropped` requires a recorded user decision in combine-decisions.md. The gate
41
+ below must show coverage_pct: 100 before this report can hand off to build.
42
+
43
+ | Source ID | Outcome | Merged as | Decision ref |
44
+ |-----------|---------|-----------|--------------|
45
+ | A.R1 | merged | #1 | — |
46
+ | A.R2 | deduped-into | #2 | — |
47
+ | B.R2 | conflict-resolved | #3 | combine-decisions.md #2 |
48
+ | B.R3 | deduped-into | #2 | — |
49
+ | B.R4 | dropped | — | combine-decisions.md #4 (user: superseded by A.R1) |
50
+
51
+ - source requirements total: {N} · accounted: {N} · coverage_pct: 100
52
+
53
+ ## Additional context (do not build)
54
+ Anchored, non-actionable context merged from the sources — each item re-pointed at
55
+ the merged requirement it serves. Dedupe ONLY when the evidence anchor is the same
56
+ file:line AND the notes convey the same constraint — near-identical notes are kept,
57
+ both, with their own From tags. Read for understanding; never a task. Omit this
58
+ whole section if no source carried context.
59
+ | Anchor (merged #) | From | From scope | Dependency | Touchpoint to respect | Evidence (file:line) |
60
+ |-------------------|------|-----------|------------|-----------------------|----------------------|
61
+ | 1 (CSV export) | A.ctx | reporting (Y) | consumes-output | report query already paginates; export must page too | web/reports/query.x:44 |
62
+
63
+ ## Cross-scope conflicts & decisions
64
+ Every conflict/duplicate/partial-overlap/ordering issue found across sources
65
+ (including contradictory resolved assumptions), each raised as a
66
+ recommended-option challenge and resolved. Decisions are also checkpointed
67
+ eagerly in combine-decisions.md.
68
+ - CONFLICT (resolved): A.R4 wants offset paging, B.R2 wants cursor — user chose cursor.
69
+ - DUPLICATE (merged): A.R2 and B.R3 both reuse auth — merged into #2.
70
+ - PARTIAL-OVERLAP (split): A.R5 subsumes B.R1 — shared row #4, A-only residue row #5.
71
+ - ORDERING (structured): before: #1 (A export) → after: #6 (B schedule).
72
+
73
+ ## Open questions (block handoff until resolved)
74
+ - (none) | UNRESOLVED: ... — combiner refuses build handoff while any remain.
75
+
76
+ ## Handoff readiness
77
+ - complete: yes/no (coverage_pct == 100, all conflicts resolved, no open UNRESOLVED)
78
+ ```
@@ -94,11 +94,11 @@ codifier: 9 language playbooks + a11y/perf rule packs), `context-combiner`
94
94
  ## Key behaviors to know
95
95
 
96
96
  - **The orchestrator NEVER implements — it always spawns scored subagents,
97
- even for tiny tasks.** Orchestrator (Opus 4.8 high, or Opus 5 / Fable 5 at
97
+ even for tiny tasks.** Orchestrator (Opus 4.8 high, or Opus 5.5 / Fable 5 at
98
98
  medium+) only coordinates; each task's 0–100 score (computed arithmetically
99
99
  from the planner's per-task `facets`) maps to a named executor agent via the
100
100
  single 6-band table in `config.md` (`rubric_bands` = report granularity only),
101
- Haiku 4.5 [0,30) → Opus 5 low [65,90) → Opus 5 medium [90,100].
101
+ Haiku 4.5 [0,30) → Opus 5.5 low [65,90) → Opus 5.5 medium [90,100].
102
102
  - **Every executor slice carries** the intent-spec constraints, the task's
103
103
  sliced acceptance criteria, the standing
104
104
  house-rules card, and — when a code-pattern is resolved — your project's