@azure-id/orc 1.9.2 → 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 (172) hide show
  1. package/CHANGELOG.md +321 -0
  2. package/README-id.md +21 -36
  3. package/README.md +25 -36
  4. package/bin/build-agents.js +117 -20
  5. package/bin/cli.js +725 -29
  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/run-undo.js +398 -0
  13. package/bin/trace-write.js +657 -0
  14. package/bin/verify-contracts.js +525 -79
  15. package/bin/verify-package.js +51 -4
  16. package/bin/webui/api.js +26 -0
  17. package/bin/webui/app.html +239 -232
  18. package/bin/webui/css/00-tokens.css +110 -92
  19. package/bin/webui/css/04-motion.css +87 -0
  20. package/bin/webui/css/06-responsive.css +203 -178
  21. package/bin/webui/css/panels/behaviour.css +205 -0
  22. package/bin/webui/fixtures/behaviour.js +532 -0
  23. package/bin/webui/fixtures/index.js +34 -0
  24. package/bin/webui/fixtures/knowledge.js +7 -1
  25. package/bin/webui/fixtures/stats.js +16 -0
  26. package/bin/webui/i18n/en/behaviour.json +143 -0
  27. package/bin/webui/i18n/en/nav.json +25 -24
  28. package/bin/webui/i18n/en/tour.json +37 -35
  29. package/bin/webui/i18n/id/behaviour.json +143 -0
  30. package/bin/webui/i18n/id/nav.json +25 -24
  31. package/bin/webui/i18n/id/tour.json +37 -35
  32. package/bin/webui/js/01-i18n.js +155 -154
  33. package/bin/webui/js/90-tour.js +498 -494
  34. package/bin/webui/js/91-shortcuts.js +126 -126
  35. package/bin/webui/js/99-boot.js +121 -118
  36. package/bin/webui/js/panels/behaviour.js +1022 -0
  37. package/mock-run/INDEX.md +109 -107
  38. package/mock-run/gotcha-import.md +118 -0
  39. package/mock-run/habits.md +129 -0
  40. package/mock-run/orc-quick.md +6 -1
  41. package/package.json +1 -1
  42. package/templates/agents/MODEL-MAPPING.md +7 -7
  43. package/templates/agents/orc-advisor-opus-5-xhigh.md +1 -7
  44. package/templates/agents/orc-analyze-mini-opus-5-med.md +1 -6
  45. package/templates/agents/orc-analyze-mini-sonnet-5-high.md +1 -4
  46. package/templates/agents/orc-claude-writer-opus-4-8-high.md +48 -53
  47. package/templates/agents/orc-claude-writer-opus-5-med.md +1 -8
  48. package/templates/agents/orc-context-combiner-opus-5-high.md +1 -11
  49. package/templates/agents/orc-executor-haiku-4-5.md +14 -6
  50. package/templates/agents/orc-executor-opus-4-7-high.md +14 -6
  51. package/templates/agents/orc-executor-opus-4-7-med.md +14 -6
  52. package/templates/agents/orc-executor-opus-4-8-high.md +14 -6
  53. package/templates/agents/orc-executor-opus-5-high.md +14 -6
  54. package/templates/agents/orc-executor-opus-5-low.md +14 -6
  55. package/templates/agents/orc-executor-opus-5-med.md +14 -6
  56. package/templates/agents/orc-executor-sonnet-4-6-high.md +14 -6
  57. package/templates/agents/orc-executor-sonnet-4-6-med.md +14 -6
  58. package/templates/agents/orc-executor-sonnet-5-high.md +14 -6
  59. package/templates/agents/orc-graph-noter-sonnet-4-6-med.md +1 -10
  60. package/templates/agents/orc-judge-opus-5-xhigh.md +5 -9
  61. package/templates/agents/orc-learn-writer-opus-5-low.md +1 -7
  62. package/templates/agents/orc-pattern-codifier-opus-5-med.md +1 -8
  63. package/templates/agents/orc-pattern-codifier-sonnet-5-high.md +58 -63
  64. package/templates/agents/orc-planner-mini-opus-5-med.md +1 -4
  65. package/templates/agents/orc-planner-mini-sonnet-5-high.md +1 -2
  66. package/templates/agents/orc-planner-opus-5-med.md +1 -4
  67. package/templates/agents/orc-recon-opus-5-low.md +1 -8
  68. package/templates/agents/orc-recon-sonnet-4-6-med.md +1 -8
  69. package/templates/agents/orc-retro-opus-5-med.md +6 -8
  70. package/templates/agents/orc-retro-sonnet-5-high.md +6 -7
  71. package/templates/agents/orc-reviewer-opus-5-med.md +52 -16
  72. package/templates/agents/orc-scout-opus-5-low.md +1 -6
  73. package/templates/agents/orc-scout-sonnet-4-6-high.md +35 -39
  74. package/templates/agents/orc-system-analyst-opus-5-high.md +1 -6
  75. package/templates/agents/orc-test-author-opus-5-med.md +4 -5
  76. package/templates/agents/orc-trace-writer-haiku-4-5.md +3 -7
  77. package/templates/agents/orc-verifier-opus-5-med.md +16 -8
  78. package/templates/agents/orc-wiki-scanner-opus-4-8-high.md +74 -79
  79. package/templates/agents/orc-wiki-scanner-opus-5-med.md +1 -8
  80. package/templates/agents/orc-wiki-scanner-sonnet-5-high.md +97 -106
  81. package/templates/commands/orc-analyze.md +13 -21
  82. package/templates/commands/orc-fast.md +10 -15
  83. package/templates/commands/orc-poly.md +12 -21
  84. package/templates/commands/orc-pr-driver.md +11 -30
  85. package/templates/commands/orc-pr-setup.md +10 -31
  86. package/templates/commands/orc-route.md +11 -41
  87. package/templates/commands/orc-test.md +5 -60
  88. package/templates/hooks/README.md +34 -0
  89. package/templates/hooks/orc-session-hook.js +264 -0
  90. package/templates/hooks/orc-statusline.js +3 -1
  91. package/templates/skills/_shared/README.md +9 -0
  92. package/templates/skills/_shared/code-graph.md +47 -55
  93. package/templates/skills/_shared/config-precedence.md +3 -1
  94. package/templates/skills/_shared/extra-dispatch.md +73 -88
  95. package/templates/skills/_shared/gotchas.md +228 -177
  96. package/templates/skills/_shared/habits.md +101 -0
  97. package/templates/skills/_shared/lane-contract.md +84 -0
  98. package/templates/skills/_shared/phases/README.md +142 -83
  99. package/templates/skills/_shared/phases/analyst-gates.md +10 -21
  100. package/templates/skills/_shared/phases/execution.md +8 -14
  101. package/templates/skills/_shared/phases/house-rules.md +27 -32
  102. package/templates/skills/_shared/phases/intake.md +127 -133
  103. package/templates/skills/_shared/phases/mock-example.md +46 -56
  104. package/templates/skills/_shared/phases/plan-handoff.md +91 -97
  105. package/templates/skills/_shared/phases/planning.md +7 -17
  106. package/templates/skills/_shared/phases/preflight.md +19 -42
  107. package/templates/skills/_shared/phases/review.md +23 -27
  108. package/templates/skills/_shared/phases/rules.md +18 -42
  109. package/templates/skills/_shared/phases/scoring.md +55 -65
  110. package/templates/skills/_shared/phases/security-checklist.md +46 -50
  111. package/templates/skills/_shared/phases/security.md +45 -55
  112. package/templates/skills/_shared/phases/ship.md +6 -15
  113. package/templates/skills/_shared/phases/stop-resume.md +2 -5
  114. package/templates/skills/_shared/phases/summary.md +73 -48
  115. package/templates/skills/_shared/phases/testgen.md +41 -51
  116. package/templates/skills/_shared/phases/trace-verbs.md +433 -0
  117. package/templates/skills/_shared/phases/trace.md +136 -367
  118. package/templates/skills/_shared/phases/verify.md +62 -70
  119. package/templates/skills/_shared/phases/wave-grouping.md +128 -133
  120. package/templates/skills/_shared/phases/wiki-consult.md +10 -6
  121. package/templates/skills/_shared/read-ladder.md +2 -55
  122. package/templates/skills/_shared/return-validation.md +17 -70
  123. package/templates/skills/_shared/review-slice.md +79 -0
  124. package/templates/skills/_shared/smoke-gate.md +46 -28
  125. package/templates/skills/context-combiner/SKILL.md +15 -44
  126. package/templates/skills/orc/SKILL.md +34 -62
  127. package/templates/skills/orc/references/pattern-gate.md +89 -89
  128. package/templates/skills/orc/references/phases/intake.md +41 -47
  129. package/templates/skills/orc/references/phases/integration.md +13 -19
  130. package/templates/skills/orc/references/preflight-report.md +8 -9
  131. package/templates/skills/orc/references/ultra-mode.md +8 -6
  132. package/templates/skills/orc/subskills/orc-execution/SKILL.md +27 -73
  133. package/templates/skills/orc/subskills/orc-execution/core.md +12 -99
  134. package/templates/skills/orc/subskills/orc-execution/subagent.md +14 -13
  135. package/templates/skills/orc/subskills/orc-review-verify/SKILL.md +11 -52
  136. package/templates/skills/orc/subskills/orc-review-verify/core.md +52 -135
  137. package/templates/skills/orc/subskills/orc-review-verify/subagent.md +7 -7
  138. package/templates/skills/orc/subskills/orc-testgen/SKILL.md +11 -22
  139. package/templates/skills/orc/subskills/orc-testgen/core.md +20 -59
  140. package/templates/skills/orc/subskills/orc-testgen/subagent.md +7 -7
  141. package/templates/skills/orc-advisor/SKILL.md +56 -60
  142. package/templates/skills/orc-analyze/SKILL.md +30 -66
  143. package/templates/skills/orc-analyze/schemas/report-audit.md +2 -1
  144. package/templates/skills/orc-analyze/schemas/report-prose.md +2 -1
  145. package/templates/skills/orc-analyze-mini/SKILL.md +35 -70
  146. package/templates/skills/orc-diy/README.md +31 -0
  147. package/templates/skills/orc-diy/SKILL.md +23 -74
  148. package/templates/skills/orc-diy/references/blocks/pattern.md +18 -18
  149. package/templates/skills/orc-fast/SKILL.md +44 -72
  150. package/templates/skills/orc-judge/SKILL.md +77 -82
  151. package/templates/skills/orc-mini/SKILL.md +61 -109
  152. package/templates/skills/orc-pattern/SKILL.md +27 -48
  153. package/templates/skills/orc-poly/SKILL.md +32 -61
  154. package/templates/skills/orc-pr-driver/SKILL.md +25 -51
  155. package/templates/skills/orc-pr-driver/references/green-gate.md +113 -105
  156. package/templates/skills/orc-pr-setup/SKILL.md +20 -45
  157. package/templates/skills/orc-quick/README.md +43 -2
  158. package/templates/skills/orc-quick/SKILL.md +76 -107
  159. package/templates/skills/orc-quick/references/dispatch-gate.md +16 -5
  160. package/templates/skills/orc-quick/references/gh-mode.md +48 -1
  161. package/templates/skills/orc-quick/references/look.md +3 -1
  162. package/templates/skills/orc-retro/SKILL.md +19 -18
  163. package/templates/skills/orc-retro/examples/retro-mock.md +1 -1
  164. package/templates/skills/orc-route/SKILL.md +25 -45
  165. package/templates/skills/orc-test/SKILL.md +16 -37
  166. package/templates/skills/orc-verify/SKILL.md +14 -32
  167. package/templates/skills/orc-wait/SKILL.md +156 -163
  168. package/templates/skills/orc-wiki/references/phases/phase-0.md +1 -6
  169. package/templates/skills/orc-wiki/references/phases/phase-1.md +1 -6
  170. package/templates/skills/orc-wiki/references/phases/phase-2.md +1 -6
  171. package/templates/skills/orc-wiki/references/phases/phase-3.md +1 -6
  172. 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.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
@@ -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.
@@ -3,12 +3,10 @@ name: orc
3
3
  description: >
4
4
  Use when orchestrating a multi-task build through a full pipeline: intake →
5
5
  planning → scored parallel execution → review → verify → ship. Triggers:
6
- "orchestrate this", "build this in parallel", "run this with subagents",
7
- "use orc", or any request to take a feature/spec from intent to PR with
8
- subagents. Routes planning to Superpowers, OpenSpec, or its own planner;
9
- schedules conflict-free waves; scores each task to pick the cheapest capable
10
- model; checkpoints eagerly; survives compaction and fresh-session resume.
11
- Stack-agnostic.
6
+ "orchestrate this", "build this in parallel", "run this with subagents", "use
7
+ orc", or any request to take a feature/spec from intent to PR with subagents.
8
+ Scores each task to pick the cheapest capable model, and survives compaction
9
+ and fresh-session resume. Stack-agnostic.
12
10
  ---
13
11
 
14
12
  # ORC (orchestrator spine)
@@ -81,7 +79,7 @@ trigger points; emit `GATE` trace lines.
81
79
 
82
80
  ## Dispatch via named agents (not prose)
83
81
 
84
- **`orc run inflight` before ANY re-dispatch** (0 clear · 1 in-flight · 2 unknown).
82
+ **`orc run inflight` before ANY re-dispatch.**
85
83
  A Task error does not kill the agent behind it, and exit 2 REFUSES by default —
86
84
  `a lane that re-dispatches over a live attempt` has broken the contract. Canonical: `_shared/return-validation.md` §0.
87
85
 
@@ -100,59 +98,35 @@ resolves to its Opus 5.5 agent, FORCING over everything below — `_shared/opus5
100
98
  Caveat: a subagent's model can't exceed the MAIN session's tier — run the main
101
99
  session on Opus or the Opus pins silently fall back (the original "wrong model" bug).
102
100
 
103
- ## Config (read at run start)
104
-
105
- **ONE resolver, and it is not you:** `orc lane config orc --json`. Obey
106
- `effective`, print every line in `announce[]` VERBATIM at preflight, and honour
107
- `stops[]` before wave 1. Never re-derive a value, a precedence or an inertness
108
- from `.claude/orc.config.yaml` — a key this lane does not read is not in the
109
- answer, and a key another key shadows comes back already marked. Exit ≠ 0 → say
110
- the CLI is unavailable and fall back to `../_shared/config-precedence.md`'s
111
- documented defaults, out loud. Priorities and families:
112
- `../_shared/config-precedence.md`.
113
-
114
- ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
115
-
116
- `orc rules slice --lane orc --json` is the ONLY assembler; never build
117
- the card here. It rides under the house rules and above the task —
118
- **house rules > your project's rules > ORC's own packs** — and its `line` prints
119
- VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
120
- never a silent choice) and `rules_overridden[]`.
121
- ## Calls
122
-
123
- **ONE catalogue, and it is not you:** `orc lane calls orc --json` names every
124
- CLI call this lane makes, each with its exit-code contract, its cost, when to run
125
- it, and what an EMPTY answer means. Never invent a spelling, never re-word an
126
- exit code, and never re-derive a state word — the CLI's state words are the only
127
- state words, and **an exit code is an ANSWER wherever that contract says so, not
128
- a failure**. A call the answer does not name is a call this lane does not make.
129
- Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
130
- command you are about to run, out loud, before running it.
101
+ ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
102
+
103
+ - **Calls:** `orc lane calls orc --json` names every call and its exit codes.
104
+ **An exit code is an ANSWER where it says so, not a failure.** Make no other call.
105
+ - **Config:** `orc lane config orc --json`. Obey `effective`, print every line
106
+ in `announce[]` VERBATIM at preflight, and honour `stops[]` before wave 1.
107
+ Never merge `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`).
108
+ - **Rules:** `orc rules slice --lane orc --json` is the ONLY assembler
109
+ (`../_shared/phases/rules.md`). Its `line` prints VERBATIM at preflight.
131
110
 
132
111
  ## Behavior trace (PERMANENT — always on, no config toggle)
133
112
 
134
- Follow `../_shared/phases/trace.md` (ALWAYS load it at run start). The
135
- `orc-trace.js` hook writes the `SPAWN`/`RETURN`/`PHASE-EDGE` skeleton
136
- deterministically; the rich narrative is **dispatched, never remembered** — every
137
- `emit <VERB>` step below means RECORD that event, with its REAL timestamp, into
138
- the current **phase packet**; you never append a trace line yourself. Run start:
139
- create `log_dir`, write `log_dir/.current` = `run-orc-<slug>-<DDMMYY>-<HHMMSS>.txt`
140
- AND `touch the trace file` of that name in the SAME step; store `trace_path`.
113
+ Follow `../_shared/phases/trace.md` (ALWAYS load it at run start; pairing rule,
114
+ packet shape and run end are there). Lane token `orc`, tier **Build lanes**. The
115
+ `orc-trace.js` hook writes the `SPAWN`/`RETURN`/`PHASE-EDGE` skeleton; the
116
+ narrative is **dispatched, never remembered** — every `emit <VERB>` step below
117
+ means RECORD that event, with its REAL timestamp, into the current **phase packet**. Run start: create `log_dir`, write `log_dir/.current`
118
+ = `run-orc-<slug>-<DDMMYY>-<HHMMSS>.txt` AND `touch the trace file` of that name
119
+ in the SAME step; store `trace_path`.
141
120
  **Under `ultra_mode` the lane segment is `ultra`, not `orc`** (`run-ultra-<slug>-…`)
142
121
  — the filename IS the per-lane data, so an ultra run named `orc` is counted as a
143
122
  plain `/orc` run forever, hiding the costliest lane in every usage report.
144
- **Phase close = dispatch `orc-trace-writer-haiku-4-5`** with that packet
145
- (`phase`, `events[]`, and `decisions` — the WHY: scoring rationale, the user's
146
- answers VERBATIM, what you rejected; `run_meta` on the FIRST packet only).
147
- **Pairing rule:** issue phase N's writer dispatch in the SAME tool block as phase
148
- N+1's first dispatch (a phase with no next dispatch sends it solo, before its
149
- user-facing output); the first packet is solo + synchronous — it repairs a
150
- hook-bootstrapped filename. `DISPATCH`/`VERIFY` models are derived from the agent
151
- NAME and checked against each return's `actual_model`/`actual_effort` — surface
152
- any ⛔ DOWNGRADE to the user, not just into the packet. A phase ending with
153
- `zero new trace lines is a protocol violation` — build and dispatch its packet
154
- NOW, with the events' real stamps. Run end (Phase 8 or abort): the `FINISH`
155
- packet goes out and RETURNS, then delete `log_dir/.current`.
123
+ **Phase close = `orc trace write --packet -`** (exit ≠ 0 → `orc-trace-writer-haiku-4-5`).
124
+ The first packet is solo — it repairs a hook-bootstrap filename.
125
+ `DISPATCH`/`VERIFY` models are derived from the agent NAME and checked against
126
+ each return's `actual_model`/`actual_effort` — surface any ⛔ DOWNGRADE to the
127
+ user, not just into the packet. A phase ending with
128
+ `zero new trace lines is a protocol violation` — build and write its packet
129
+ NOW, with the events' real stamps.
156
130
 
157
131
  ## Extra — a band that executes OFF Claude (config `extra_enabled`, default false)
158
132
 
@@ -175,7 +149,7 @@ review/verify re-check the invariants + `validation_gate[]` lines. Load
175
149
  ## Ultra lane (`/orc-ultra`)
176
150
 
177
151
  `/orc-ultra` sets `ultra_mode: true` RUN-SCOPED (never persisted): full pipeline
178
- + Opus 4.8 max Advisor (Phase U0) + three judge gates + forced overrides (deep
152
+ + Opus 5.5 xhigh Advisor (Phase U0) + three judge gates + forced overrides (deep
179
153
  analyze, pattern/testgen/security on, executor tier floor); never on plain
180
154
  `/orc` or orc-mini. Load `references/ultra-mode.md` at Phase 0 when ultra_mode;
181
155
  orc-advisor / orc-judge load at their dispatch points.
@@ -214,10 +188,9 @@ them; they are never dispatched as subagents).
214
188
 
215
189
  ## Phases
216
190
 
217
- `orc lane phases orc --json` **is** the pipeline — the CLI owns the list and
218
- its order, and this table is the human index of it. Never derive the order
219
- from these filenames; a second idea of the pipeline is the drift the manifest
220
- exists to prevent.
191
+ `orc lane phases orc --json` **is** the pipeline; this table is only its human
192
+ index. **The CLI owns the order**: never derive it from these filenames
193
+ (`../_shared/lane-contract.md` §Phases).
221
194
 
222
195
  **Read a row when its phase fires, not on activation.** Every row is
223
196
  `on-phase` — this spine deliberately carries no `always` phase pointer. **Read
@@ -228,8 +201,7 @@ each row.
228
201
 
229
202
  W13 gave those ten a second reader (`orc-diy`), so they moved to
230
203
  `_shared/phases/`. Intake and Integration have one consumer each and stay home
231
- — a file with one consumer stays home. W14 (`orc-mini`/`orc-fast`) is what adds
232
- a `trim` layer beside the `full` one.
204
+ — a file with one consumer stays home.
233
205
 
234
206
  | # | Phase | File | Read | Trace |
235
207
  |---|-------|------|------|-------|
@@ -252,4 +224,4 @@ their config key is resolved by `orc lane config orc --json`, never read raw.
252
224
  ## Waiting mid-run (`/orc-wait`)
253
225
 
254
226
  Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
255
- Checkpoint **full** · safe point **wave or phase edge**. `soft` FORCES that checkpoint and does NOT stop if the write fails; `hard` skips it and can lose an in-flight return. Never begin a wait between a dispatch and its validated return, or before the smoke gate has reported.
227
+ Checkpoint **full** · safe point **wave or phase edge**.