@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
@@ -2,16 +2,11 @@
2
2
  name: orc-analyze
3
3
  description: >
4
4
  System Analyst for ORC. Use for "/orc-analyze", "analyze this doc for scope
5
- X", or "analyze this requirement against the code" — turning a requirement (a
6
- document, PDF by path or pasted, OR a plain-language request) into a precise,
7
- code-grounded requirement set BEFORE any planning. Bounds the deliverable to
8
- exactly the asked scope, pulls related adjacent scopes in only as anchored
9
- "do not build" context, maps each requirement to real files with
10
- quote-anchored file:line evidence, and challenges the user with recommended
11
- options. Opt-in DEEP mode adds a scout-driven code sweep, verify-every-claim,
12
- and alternatives + risks. Also auto-triggers inside /orc on a doc or
13
- ambiguous requirement. The orchestrator dispatches this to a subagent — it
14
- never analyzes itself.
5
+ X", or "analyze this requirement against the code". Turns a document (PDF by
6
+ path or pasted) or a plain-language request into a scope-bounded,
7
+ code-grounded requirement set with quote-anchored file:line evidence BEFORE
8
+ any planning, and challenges the user with recommended options. Opt-in DEEP
9
+ mode adds a scout-driven code sweep. Also auto-triggers inside /orc on a doc.
15
10
  ---
16
11
 
17
12
  # ORC-ANALYZE (System Analyst)
@@ -79,24 +74,20 @@ the user meant.
79
74
 
80
75
  ## Behavior trace (always on)
81
76
 
82
- `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases` names
83
- the file and the layers). Lane token `analyze`, tier **Single-dispatch** —
84
- exactly ONE end-of-run packet, dispatched solo before `.current` is deleted.
85
- At run start write `log_dir/.current` = `run-analyze-<slug>-<DDMMYY>-<HHMMSS>.txt` AND
86
- `touch the trace file` of that name in the SAME step.
87
- Nothing else about the protocol is restated here; a phase that ends with
88
- `zero new trace lines is a protocol violation`.
77
+ `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases orc-analyze --json` →
78
+ `trace_grammar` gives the verbs). Lane token `analyze`, tier
79
+ **Single-dispatch**. At run start write `log_dir/.current` =
80
+ `run-analyze-<slug>-<DDMMYY>-<HHMMSS>.txt` AND `touch the trace file` of that name
81
+ in the SAME step. A phase that ends with `zero new trace lines is a protocol violation`.
89
82
 
90
83
  `context-combiner` is a PHASE of this run, not a lane: its `DISPATCH`/`RETURN`,
91
84
  its Phase D verdicts and its conservation-gate result fold into THIS packet.
92
85
 
93
86
  ## Phases
94
87
 
95
- `orc lane phases orc-analyze --json` is this lane's pipeline: the ordered list, where
96
- each phase lives, and how much of it to read. **The CLI owns the order** — never
97
- derive it from the headings below, and never renumber or rename one without the
98
- manifest, because a `read: section` pointer names a HEADING and a renamed heading
99
- is a pointer into nothing.
88
+ `orc lane phases orc-analyze --json` is this lane's pipeline. **The CLI owns the order**:
89
+ never derive it from the headings below, and never rename or renumber one
90
+ without the manifest (`../_shared/lane-contract.md` §Phases).
100
91
 
101
92
  ## Phase A — Ingest & detect source mode
102
93
 
@@ -133,12 +124,11 @@ offer wording, the auto-consume back here: `references/thin-input.md`.
133
124
 
134
125
  ## Phase A′ — Standard vs Deep gate (default STANDARD)
135
126
 
136
- Before reconciliation, offer the depth choice (config `default_analysis_depth`
137
- presets the default; the run still confirms): deep = wider sweep, verify every
138
- claim, more questions, alternatives with trade-offs, noticeably more tokens;
139
- standard = faster, verifies the stated floor (hard rule 4). Mention the
140
- zero-token default switch `orc config set default_analysis_depth deep`. Deep
141
- requires explicit consent — never auto-escalates — and is **two-pass with
127
+ Before reconciliation, offer the depth choice (H `any.analysis.depth`). Config
128
+ `default_analysis_depth` presets it; mention the free switch `orc config set
129
+ default_analysis_depth deep`. Deep = wider sweep, verify every claim, more
130
+ questions, alternatives, more tokens; standard = faster, the hard rule 4 floor.
131
+ Deep needs explicit consent EVERY run (never auto) and is **two-pass with
142
132
  scouts**: load `references/deep-mode.md`. Standard is single-pass.
143
133
 
144
134
  ## Phase B — Bound scope
@@ -216,44 +206,18 @@ another RELATED doc (multi-analyze loop → combiner once 2+ related analyses
216
206
  exist). Menu rules, relatedness gate, combiner handling:
217
207
  `references/branching.md`.
218
208
 
219
- ## Mini variant
220
-
221
- For the fast lane, `orc-analyze-mini` (Sonnet 5 high) does a shallower version
222
- of the same flow: doc-optional intake, the same evidence-or-mark + floor (a)+(b)
223
- + triage rules — but **no deep mode and no scouts** (always single-pass), and
224
- concrete escalation thresholds to the full analyst. Used by orc-mini. Same
225
- artifacts, same output contract; trimmed depth. See that skill.
226
-
227
- ## Config
228
-
229
- **ONE resolver, and it is not you:** `orc lane config orc-analyze --json`. Obey
230
- `effective`, print every line in `announce[]` VERBATIM at preflight, and honour
231
- `stops[]` before wave 1. Never re-derive a value, a precedence or an inertness
232
- from `.claude/orc.config.yaml` — a key this lane does not read is not in the
233
- answer, and a key another key shadows comes back already marked. Exit ≠ 0 → say
234
- the CLI is unavailable and fall back to `../_shared/config-precedence.md`'s
235
- documented defaults, out loud. Priorities and families:
236
- `../_shared/config-precedence.md`.
237
-
238
- ## Calls
239
-
240
- **ONE catalogue, and it is not you:** `orc lane calls orc-analyze --json` names every
241
- CLI call this lane makes, each with its exit-code contract, its cost, when to run
242
- it, and what an EMPTY answer means. Never invent a spelling, never re-word an
243
- exit code, and never re-derive a state word — the CLI's state words are the only
244
- state words, and **an exit code is an ANSWER wherever that contract says so, not
245
- a failure**. A call the answer does not name is a call this lane does not make.
246
- Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
247
- command you are about to run, out loud, before running it.
248
-
249
- ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
250
-
251
- `orc rules slice --lane orc-analyze --json` is the ONLY assembler; never build
252
- the card here. It rides under the house rules and above the task —
253
- **house rules > your project's rules > ORC's own packs** — and its `line` prints
254
- VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
255
- never a silent choice) and `rules_overridden[]`.
209
+ ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
210
+
211
+ - **Calls:** `orc lane calls orc-analyze --json` names every call and its exit codes.
212
+ **An exit code is an ANSWER where it says so, not a failure.** Make no other call.
213
+ - **Config:** `orc lane config orc-analyze --json`. Obey `effective`, print every line
214
+ in `announce[]` VERBATIM at preflight, and honour `stops[]` before wave 1.
215
+ Never merge `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`).
216
+ - **Habits:** `habits{}` in that answer → `../_shared/habits.md`; else ignore `(H …)`.
217
+ - **Rules:** `orc rules slice --lane orc-analyze --json` is the ONLY assembler
218
+ (`../_shared/phases/rules.md`). Its `line` prints VERBATIM at preflight.
219
+
256
220
  ## Waiting mid-run (`/orc-wait`)
257
221
 
258
222
  Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
259
- Checkpoint **full** · safe point **after the analyst returns**. `soft` FORCES that checkpoint and does NOT stop if the write fails; `hard` skips it and can lose an in-flight return. Never begin a wait between a dispatch and its validated return, or before the smoke gate has reported.
223
+ Checkpoint **full** · safe point **after the analyst returns**.
@@ -1,7 +1,8 @@
1
1
  # Template — Analyst Report (AUDIT mode)
2
2
 
3
3
  Human-readable source of truth. You review and confirm this; the machine spec
4
- is derived from it. Written to analyst_report/{analysis-name}/report.md.
4
+ is derived from it. Written to `<analyzer_dir>/{analysis-name}/report.md`;
5
+ COPIED to `<report_out_dir>/{analysis-name}/` only on the stop-here branch.
5
6
 
6
7
  ```markdown
7
8
  # Analysis Report — {analysis-name}
@@ -1,6 +1,7 @@
1
1
  # Template — Analyst Report (PROSE mode)
2
2
 
3
- Human-readable source of truth. Written to analyst_report/{analysis-name}/report.md.
3
+ Human-readable source of truth. Written to `<analyzer_dir>/{analysis-name}/report.md`;
4
+ COPIED to `<report_out_dir>/{analysis-name}/` only on the stop-here branch.
4
5
 
5
6
  ```markdown
6
7
  # Analysis Report — {analysis-name}
@@ -1,19 +1,12 @@
1
1
  ---
2
2
  name: orc-analyze-mini
3
3
  description: >
4
- Fast-lane System Analyst for ORC-MINI (Sonnet 5, high effort). Turns a
5
- requirement — a document (PDF by path or pasted) OR a plain-language request —
6
- into a scope-bounded, code-grounded requirement report + derived spec: bounds
7
- the deliverable to exactly the asked scope (other scopes never become tasks),
8
- maps each requirement to real files with quote-anchored file:line evidence —
9
- or marks it an ASSUMPTION and turns it into a question — and challenges the
10
- user with recommended options. Use for "/orc-analyze-mini", "quickly analyze
11
- this doc", "fast doc analysis", "quick requirement check", "fast requirement
12
- analysis", or when orc-mini meets a document or an ambiguous requirement.
13
- Distinct from /orc-analyze: ALWAYS single-pass — NO deep mode, NO scouts —
14
- trading depth for speed and tokens; switch to /orc-analyze (deep) when you
15
- need a wider code sweep, verify-every-claim, or alternatives with trade-offs.
16
- The orchestrator dispatches this to a subagent — it never analyzes itself.
4
+ Fast-lane System Analyst for ORC-MINI (Sonnet 5, high effort). Use for
5
+ "/orc-analyze-mini", "quickly analyze this doc", "fast doc analysis", "quick
6
+ requirement check", "fast requirement analysis", or when orc-mini meets a
7
+ document or an ambiguous requirement. Writes a scope-bounded requirement
8
+ report with file:line evidence. ALWAYS single-pass — NO deep mode, NO scouts;
9
+ use /orc-analyze for depth.
17
10
  ---
18
11
 
19
12
  # ORC-ANALYZE-MINI
@@ -39,48 +32,37 @@ for the formats; this skill does not duplicate them.
39
32
  silently dropped.
40
33
  - **No deep mode, no scouts.** Always single-pass.
41
34
  - **Concrete escalation thresholds** (recommend the full `/orc-analyze`, Opus
42
- 4.8 high, and let the user choose — the boundary is not self-assessed vibes):
35
+ 5.5 high, and let the user choose — the boundary is not self-assessed vibes):
43
36
  source doc > ~10 pages, OR > 12 in-scope requirements, OR > 3 conflict rows,
44
37
  OR audit mode with > 5 stale-premise rows.
45
38
  - **Model:** Sonnet 5, high effort.
46
39
 
47
40
  ## What's identical
48
41
 
42
+ The full analyst's **hard rules 2, 3, 3a, 4a, 5 and 6** apply unchanged
43
+ (`../orc-analyze/SKILL.md` §Hard rules): quote-anchored evidence-or-mark with
44
+ `searched:` on absence claims, the read ladder (`../_shared/read-ladder.md`),
45
+ recommended-option challenges, two perimeters with the **Additional context (do
46
+ not build)** section, and a spec derived from the confirmed report (with the Evidence column and the
47
+ Assumptions & Open Questions section). Anchored context is self-read (no
48
+ scouts). Also the same:
49
+
49
50
  - **Doc-optional intake:** auto-detect + confirm mode — prose / audit
50
- (documents) or **requirement** (NO doc; the user's request is the source of
51
- truth, reconciled against code).
52
- - **Evidence-or-mark, quote-anchored:** every code claim / interpretation is
53
- grounded with `file:line — "verbatim snippet"` (a ref with no quote
54
- auto-downgrades to `UNVERIFIED`), OR tagged `ASSUMPTION`/`UNVERIFIED` and
55
- turned into a question — never a silent guess. **Absence claims**
56
- (missing/buildable) carry `searched:` — the concrete globs/greps run.
57
- - **The read ladder:** locate → outline → range → full, escalating only as far as
58
- the question needs (`../_shared/read-ladder.md`). Trimmed depth is not a lower
59
- evidence floor — it is fewer wasted full reads reaching the same anchors.
60
- - **Recommended-option challenges:** each challenge is a 2–3 option set with one
61
- flagged recommended option + reason (blocking one at a time, advisory batched).
62
- - Two perimeters: the deliverable stays scope X (Y/Z never become tasks), but
63
- anchored, non-actionable adjacent context is gathered when an in-scope item
64
- depends on it — touchpoint-bounded, self-read (no scouts), each item anchored to
65
- the requirement it serves + labeled "do not build". Same **Additional context
66
- (do not build)** section in report + spec. Unanchored context is dropped.
67
- - Two artifacts, spec derived from the confirmed report, same folder
68
- `orc/analyzer/{analysis-name}/` (internal; copied out only on report-only),
69
- including the Evidence column and Assumptions & Open Questions section. The
70
- spec is stamped with `git_head` + `dirty` for plan-time staleness detection.
51
+ (documents) or **requirement** (NO doc; the request is the source of truth).
52
+ - Same folder `orc/analyzer/{analysis-name}/` (internal; copied out only on
53
+ report-only). The spec is stamped with `git_head` + `dirty` for plan-time
54
+ staleness detection.
71
55
  - Same branch: report-only, or take into build (hand both files to orc-mini,
72
- which continues with the mini planner) — orc-mini runs the same evidence
73
- spot-check + derivation lint gates as the full lane before building.
56
+ which continues with the mini planner and runs the same evidence spot-check +
57
+ derivation lint gates).
74
58
 
75
59
  ## Behavior trace (always on)
76
60
 
77
- `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases` names
78
- the file and the layers). Lane token `analyze`, tier **Single-dispatch** —
79
- exactly ONE end-of-run packet, dispatched solo before `.current` is deleted.
80
- At run start write `log_dir/.current` = `run-analyze-<slug>-<DDMMYY>-<HHMMSS>.txt` AND
81
- `touch the trace file` of that name in the SAME step.
82
- Nothing else about the protocol is restated here; a phase that ends with
83
- `zero new trace lines is a protocol violation`.
61
+ `../_shared/phases/trace.md` (`core`, at run start; `orc lane phases orc-analyze-mini --json` →
62
+ `trace_grammar` gives the verbs). Lane token `analyze`, tier
63
+ **Single-dispatch**. At run start write `log_dir/.current` =
64
+ `run-analyze-<slug>-<DDMMYY>-<HHMMSS>.txt` AND `touch the trace file` of that name
65
+ in the SAME step. A phase that ends with `zero new trace lines is a protocol violation`.
84
66
 
85
67
  ## Workflow checkpoint (gate before deriving the spec)
86
68
 
@@ -108,29 +90,12 @@ survived. Return exactly:
108
90
 
109
91
  Never build or spawn.
110
92
 
111
- ## Config
112
-
113
- Resolve with `orc lane config orc-analyze-mini --json` and obey `effective`. Never merge
114
- `.claude/orc.config.yaml` yourself, and never re-derive a precedence. Exit ≠ 0 →
115
- say so and use `../_shared/config-precedence.md`'s documented defaults, out
116
- loud. Nothing this lane reads is contested, gated or a stop, so it owes no
117
- preflight line and has no gate to honour.
118
-
119
- ## Calls
120
-
121
- **ONE catalogue, and it is not you:** `orc lane calls orc-analyze-mini --json` names every
122
- CLI call this lane makes, each with its exit-code contract, its cost, when to run
123
- it, and what an EMPTY answer means. Never invent a spelling, never re-word an
124
- exit code, and never re-derive a state word — the CLI's state words are the only
125
- state words, and **an exit code is an ANSWER wherever that contract says so, not
126
- a failure**. A call the answer does not name is a call this lane does not make.
127
- Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
128
- command you are about to run, out loud, before running it.
129
-
130
- ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
131
-
132
- `orc rules slice --lane orc-analyze-mini --json` is the ONLY assembler; never build
133
- the card here. It rides under the house rules and above the task —
134
- **house rules > your project's rules > ORC's own packs** — and its `line` prints
135
- VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
136
- never a silent choice) and `rules_overridden[]`.
93
+ ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
94
+
95
+ - **Calls:** `orc lane calls orc-analyze-mini --json` names every call and its exit codes.
96
+ **An exit code is an ANSWER where it says so, not a failure.** Make no other call.
97
+ - **Config:** `orc lane config orc-analyze-mini --json`. Obey `effective`. Never merge
98
+ `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`). Nothing
99
+ here is contested, gated or a stop: no preflight line, no gate to honour.
100
+ - **Rules:** `orc rules slice --lane orc-analyze-mini --json` is the ONLY assembler
101
+ (`../_shared/phases/rules.md`). Its `line` prints VERBATIM at preflight.
@@ -98,6 +98,37 @@ installed orc skill, stitches `.claude/orc/diy/FLOW-COMPILED.md`, and stamps
98
98
  `orc diy compile`, and offers the regular `/orc` lane for the request at
99
99
  hand. `/orc-diy compile` in a session just runs the same CLI compiler.
100
100
 
101
+ ### Where the compiled flow comes from (maintainer view)
102
+
103
+ You never read these; `orc diy compile` does, once, and stitches the result
104
+ into `FLOW-COMPILED.md`. The table is here so a maintainer can see the
105
+ provenance of a compiled phase without reading the compiler — `orc lane phases
106
+ orc-diy --json` is the authoritative version and marks every row below
107
+ `when: compile-time`.
108
+
109
+ Eleven phases come from the shared library, as that file's `composed` LAYER —
110
+ NOT its `full` layer, which is `/orc`'s procedure for the same phase:
111
+ `../_shared/phases/trace.md` · `../_shared/phases/planning.md` ·
112
+ `../_shared/phases/scoring.md` · `../_shared/phases/execution.md` ·
113
+ `../_shared/phases/review.md` · `../_shared/phases/security.md` ·
114
+ `../_shared/phases/verify.md` · `../_shared/phases/testgen.md` ·
115
+ `../_shared/phases/mock-example.md` · `../_shared/phases/ship.md` ·
116
+ `../_shared/phases/summary.md`.
117
+
118
+ Five have no counterpart anywhere else in the payload and stay this lane's own:
119
+ `references/blocks/header.md` (the tier self-gate), `wiki.md`, `analyze.md`,
120
+ `pattern.md` and `extra.md`. They are composition prose about a decision only a
121
+ composed flow makes, so there is nothing to share them WITH.
122
+
123
+ Four more are pointed at from inside those stitched layers rather than stitched
124
+ themselves: `../_shared/phases/intake.md`,
125
+ `../_shared/phases/wave-grouping.md`,
126
+ `../_shared/phases/security-checklist.md` and
127
+ `../_shared/phases/stop-resume.md`.
128
+
129
+ The stitch ORDER is the compiler's `order` array and is documented in
130
+ `references/compile.md`; a golden test holds the three lists together.
131
+
101
132
  ## 4. Run
102
133
 
103
134
  ```
@@ -1,14 +1,12 @@
1
1
  ---
2
2
  name: orc-diy
3
3
  description: >
4
- User-composable ORC lane. Use for "/orc-diy" or "run my custom orc flow".
5
- The pipeline shape (analyze/review/verify/security/testgen on-off, scoring
6
- or a fixed executor, autonomy, ship mode, session tier) is configured
7
- ENTIRELY through the `orc diy` CLI and compiled into a flow file —
8
- never configured in-session. HARD-GATED: no config or a stale compile →
9
- this skill never runs the custom flow; it explains the CLI steps and offers
10
- plain /orc instead. "/orc-diy compile" re-runs the deterministic CLI
11
- compiler. See references/flow-schema.md and references/compile.md.
4
+ User-composable ORC lane. Use for "/orc-diy" or "run my custom orc flow". The
5
+ pipeline shape is configured ENTIRELY through the `orc diy` CLI and compiled
6
+ into a flow file — never configured in-session. HARD-GATED: no config or a
7
+ stale compile → this skill never runs the custom flow; it explains the CLI
8
+ steps and offers plain /orc instead. "/orc-diy compile" re-runs the
9
+ deterministic CLI compiler.
12
10
  ---
13
11
 
14
12
  # ORC-DIY (stub — gate + dispatcher)
@@ -59,65 +57,23 @@ as it says. Do not consult this stub again for the rest of the run, and do
59
57
  not load orc's SKILL.md as a spine (the compiled flow already references the
60
58
  exact orc subskills and schemas it needs).
61
59
 
62
- ## Where the compiled flow comes from
63
-
64
- You never read these; `orc diy compile` does, once, and stitches the result
65
- into `FLOW-COMPILED.md`. The table is here so a maintainer can see the
66
- provenance of a compiled phase without reading the compiler — `orc lane phases
67
- orc-diy --json` is the authoritative version and marks every row below
68
- `when: compile-time`.
69
-
70
- Eleven phases come from the shared library, as that file's `composed` LAYER —
71
- NOT its `full` layer, which is `/orc`'s procedure for the same phase:
72
- `../_shared/phases/trace.md` · `../_shared/phases/planning.md` ·
73
- `../_shared/phases/scoring.md` · `../_shared/phases/execution.md` ·
74
- `../_shared/phases/review.md` · `../_shared/phases/security.md` ·
75
- `../_shared/phases/verify.md` · `../_shared/phases/testgen.md` ·
76
- `../_shared/phases/mock-example.md` · `../_shared/phases/ship.md` ·
77
- `../_shared/phases/summary.md`.
78
-
79
- Five have no counterpart anywhere else in the payload and stay this lane's own:
80
- `references/blocks/header.md` (the tier self-gate), `wiki.md`, `analyze.md`,
81
- `pattern.md` and `extra.md`. They are composition prose about a decision only a
82
- composed flow makes, so there is nothing to share them WITH.
83
-
84
- Four more are pointed at from inside those stitched layers rather than stitched
85
- themselves: `../_shared/phases/intake.md`,
86
- `../_shared/phases/wave-grouping.md`,
87
- `../_shared/phases/security-checklist.md` and
88
- `../_shared/phases/stop-resume.md`.
89
-
90
- The stitch ORDER is the compiler's `order` array and is documented in
91
- `references/compile.md`; a golden test holds the three lists together.
92
-
93
-
94
- ## Config
95
-
96
- **ONE resolver, and it is not you:** `orc lane config orc-diy --json`. Obey
97
- `effective`, print every line in `announce[]` VERBATIM at preflight, and honour
98
- `stops[]` before wave 1. Never re-derive a value, a precedence or an inertness
99
- from `.claude/orc.config.yaml` — a key this lane does not read is not in the
100
- answer, and a key another key shadows comes back already marked. Exit ≠ 0 → say
101
- the CLI is unavailable and fall back to `../_shared/config-precedence.md`'s
102
- documented defaults, out loud. Priorities and families:
103
- `../_shared/config-precedence.md`.
60
+ ## Lane contract (`../_shared/lane-contract.md` — read it ONLY when a call exits ≠ 0)
61
+
62
+ - **Calls:** `orc lane calls orc-diy --json` names every call and its exit codes.
63
+ **An exit code is an ANSWER where it says so, not a failure.** Make no other call.
64
+ - **Config:** `orc lane config orc-diy --json`. Obey `effective`, print every line
65
+ in `announce[]` VERBATIM at preflight, and honour `stops[]` before wave 1.
66
+ Never merge `.claude/orc.config.yaml` yourself (`../_shared/config-precedence.md`).
67
+ - **Habits:** `habits{}` in the config answer → read `../_shared/habits.md`. No
68
+ `habits{}` → ignore every `(H …)` mark.
69
+ - **Rules:** `orc rules slice --lane orc-diy --json` is the ONLY assembler
70
+ (`../_shared/phases/rules.md`). Its `line` prints VERBATIM at preflight.
104
71
 
105
72
  The flow SHAPE is not in that answer: it is compile-owned and lives in
106
73
  `flow.lock.json`. The resolver answers for everything else this lane still
107
74
  reads, and `extra` is the same split — the flow decides WHETHER, the resolver
108
75
  still decides WHERE.
109
76
 
110
- ## Calls
111
-
112
- **ONE catalogue, and it is not you:** `orc lane calls orc-diy --json` names every
113
- CLI call this lane makes, each with its exit-code contract, its cost, when to run
114
- it, and what an EMPTY answer means. Never invent a spelling, never re-word an
115
- exit code, and never re-derive a state word — the CLI's state words are the only
116
- state words, and **an exit code is an ANSWER wherever that contract says so, not
117
- a failure**. A call the answer does not name is a call this lane does not make.
118
- Exit ≠ 0 from the catalogue itself → say the CLI is unavailable and name the
119
- command you are about to run, out loud, before running it.
120
-
121
77
  ## Hard rules
122
78
 
123
79
  1. The compiled flow is a build artifact — NEVER edit
@@ -126,16 +82,9 @@ command you are about to run, out loud, before running it.
126
82
  `orc diy set` + `orc diy compile`, both run by the user.
127
83
  2. Fail closed: any gate ambiguity = STALE, with the reason shown.
128
84
  3. The fallback ask is ONE question with two outcomes (`/orc` or stop) —
129
- never a menu, never a silent fallback.
130
-
131
- ## Rules — the anti-slop card (`../_shared/phases/rules.md`)
132
-
133
- `orc rules slice --lane orc-diy --json` is the ONLY assembler; never build
134
- the card here. It rides under the house rules and above the task —
135
- **house rules > your project's rules > ORC's own packs** — and its `line` prints
136
- VERBATIM at preflight. Returns gain `rules_applied[]`, `rules_conflicts[]` (a gap,
137
- never a silent choice) and `rules_overridden[]`.
138
- ## Waiting mid-run (`/orc-wait`)
139
-
140
- Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
141
- Checkpoint **full** · safe point **compiled 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.
85
+ never a menu, never a silent fallback.
86
+
87
+ ## Waiting mid-run (`/orc-wait`)
88
+
89
+ Canonical: `../_shared/wait.md`. **`a lane that waits without a hand-back` has broken this contract.**
90
+ Checkpoint **full** · safe point **compiled phase edge**.
@@ -1,18 +1,18 @@
1
- ## Phase: Code-pattern findings
2
-
3
- <!-- diy:when pattern=off -->
4
- Code-pattern codification is OFF: executors run language-agnostic (security/
5
- correctness invariants still enforced; conventions imitate neighbor files).
6
- Never prompt about patterns. A cached pattern under `.claude/orc/patterns/`
7
- is still injected if present — cache hits are always silent.
8
- <!-- /diy:when -->
9
- <!-- diy:when pattern=ask -->
10
- On an FE/BE pattern-cache miss at dispatch time, ask the user once: learn the
11
- house style via the `.claude/skills/orc-pattern/SKILL.md` flow, or proceed
12
- language-agnostic. Cache hits are used silently.
13
- <!-- /diy:when -->
14
- <!-- diy:when pattern=on -->
15
- On an FE/BE pattern-cache miss at dispatch time, auto-codify without asking:
16
- run the `.claude/skills/orc-pattern/SKILL.md` flow, then inject the cached
17
- pattern literally into executor slices. Cache hits are used silently.
18
- <!-- /diy:when -->
1
+ ## Phase: Code-pattern findings
2
+
3
+ <!-- diy:when pattern=off -->
4
+ Code-pattern codification is OFF: executors run language-agnostic (security/
5
+ correctness invariants still enforced; conventions imitate neighbor files).
6
+ Never prompt about patterns. A cached pattern under `.claude/orc/patterns/`
7
+ is still injected if present — cache hits are always silent.
8
+ <!-- /diy:when -->
9
+ <!-- diy:when pattern=ask -->
10
+ On an FE/BE pattern-cache miss at dispatch time, ask the user once (H `orc.phase-3.pattern`): learn the
11
+ house style via the `.claude/skills/orc-pattern/SKILL.md` flow, or proceed
12
+ language-agnostic. Cache hits are used silently.
13
+ <!-- /diy:when -->
14
+ <!-- diy:when pattern=on -->
15
+ On an FE/BE pattern-cache miss at dispatch time, auto-codify without asking:
16
+ run the `.claude/skills/orc-pattern/SKILL.md` flow, then inject the cached
17
+ pattern literally into executor slices. Cache hits are used silently.
18
+ <!-- /diy:when -->