@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
@@ -1,32 +1,27 @@
1
- # Phase — House rules (id: `house-rules`)
2
-
3
- > **Library file.** Canonical since v1.0.0 W12; it was under the `orc` skill's
4
- > private `references/`, and other lanes already reached across into it. Read
5
- > by `orc`, `orc-mini`, `orc-fast`, `orc-quick`, `orc-doc`. Layers declared:
6
- > `core` only — single-layer because it is a standing card injected VERBATIM
7
- > into a slice — a layered card would be a different card. `orc lane phases
8
- > <lane> --json` names the file and the layers to read.
9
-
10
- <!-- orc:layer core -->
11
- ## ORC House Rules (standing behavioral card)
12
-
13
- Injected LITERALLY into every executor slice as `house_rules` — never a file
14
- pointer. Keep the card ≤ 10 lines: it rides in EVERY dispatch, so every
15
- redundant line is paid on every spawn. Do NOT add rules the slice contract
16
- already enforces (constraints, pattern-matching, stay-in-slice, invariant
17
- re-check) — duplication dilutes.
18
-
19
- ## The card (inject exactly the lines between the markers)
20
-
21
- <!-- card-start -->
22
- HOUSE RULES (standing, apply to every change):
23
- 1. Surgical changes only — touch nothing orthogonal to your task, even "easy wins".
24
- 2. Simplicity first — no speculative abstraction, no config for needs that don't exist yet.
25
- 3. No unrequested scope — build exactly what the task asks, nothing extra.
26
- 4. Prefer the boring solution — the obvious approach over the clever one, every time.
27
- 5. Never claim what you haven't observed — name a file/symbol/behavior only after reading it this session; mark inferences as inferences.
28
- 6. An honest partial beats a false done — report what's unmet, never round up.
29
- 7. Never revert, discard or rewrite files you did not write — `git checkout/restore/reset/stash/clean` are forbidden in your slice; an impossible assertion is `unmet`, never something to make true.
30
- <!-- card-end -->
31
-
32
- <!-- /orc:layer -->
1
+ # Phase — House rules (id: `house-rules`)
2
+
3
+ > **Library file** (`orc`, `orc-mini`, `orc-fast`, `orc-quick`, `orc-doc`), `core` only: a standing card injected VERBATIM into a slice — a layered card would be a different card.
4
+
5
+ <!-- orc:layer core -->
6
+ ## ORC House Rules (standing behavioral card)
7
+
8
+ Injected LITERALLY into every executor slice as `house_rules` — never a file
9
+ pointer. Keep the card ≤ 10 lines: it rides in EVERY dispatch, so every
10
+ redundant line is paid on every spawn. Do NOT add rules the slice contract
11
+ already enforces (constraints, pattern-matching, stay-in-slice, invariant
12
+ re-check) — duplication dilutes.
13
+
14
+ ## The card (inject exactly the lines between the markers)
15
+
16
+ <!-- card-start -->
17
+ HOUSE RULES (standing, apply to every change):
18
+ 1. Surgical changes only — touch nothing orthogonal to your task, even "easy wins".
19
+ 2. Simplicity first — no speculative abstraction, no config for needs that don't exist yet.
20
+ 3. No unrequested scope — build exactly what the task asks, nothing extra.
21
+ 4. Prefer the boring solution — the obvious approach over the clever one, every time.
22
+ 5. Never claim what you haven't observed — name a file/symbol/behavior only after reading it this session; mark inferences as inferences.
23
+ 6. An honest partial beats a false done — report what's unmet, never round up.
24
+ 7. Never revert, discard or rewrite files you did not write — `git checkout/restore/reset/stash/clean` are forbidden in your slice; an impossible assertion is `unmet`, never something to make true.
25
+ <!-- card-end -->
26
+
27
+ <!-- /orc:layer -->
@@ -1,133 +1,127 @@
1
- # Phase — Intake (id: `intake`)
2
-
3
- > **Library file.** Canonical since v1.0.0 W12; it was under the `orc` skill's
4
- > private `references/`, and other lanes already reached across into it. Read
5
- > by `orc`, `orc-mini`, `orc-diy`, `orc-challenge`. Layers: `core` and `full`
6
- > — `core` is the intake procedure every lane runs; `full` is /orc's own Phase
7
- > 0, which adds the analyst branch, the poly-spec split-and-STOP and the run-
8
- > folder open. `orc lane phases <lane> --json` names the file and the layers
9
- > to read.
10
-
11
- <!-- orc:layer core -->
12
- ## Reference — Phase 0 Intake
13
-
14
- Goal: extract just enough that the intent-spec can't be misread, then get out of
15
- the way. A wrong understanding parallelized is worse than a wrong understanding
16
- done serially. Never interrogate; never ask what the repo can tell you.
17
-
18
- **Before anything — plan-input trigger (see `plan-handoff.md`):** if the run
19
- input IS a plan (pasted planning-output, a `plan-{name}.md` path, or an
20
- `orc/planner/{name}/` checkpoint), do NOT run intake — switch to the plan-handoff
21
- entry contract (`plan-handoff.md`): bootstrap the trace, schema-
22
- validate, apply the `plan_head` staleness valve, re-run the full Phase 1 exit
23
- gate in this session, relay `open_questions[]`, then continue at Phase 2. A plain
24
- prose request is not a plan — run intake normally.
25
-
26
- **Before intake questions — analyst auto-trigger (see SKILL.md Phase 0):** if the
27
- input includes a document OR the requirement is ambiguous/underspecified, dispatch
28
- the System Analyst FIRST (doc-optional; standard/deep gate; scouts in deep mode).
29
- It resolves scope + accuracy with evidence-or-mark and recommended-option
30
- questions before any intent-spec is drafted. When it hands back "take into build",
31
- its confirmed spec feeds Phase 1 planning.
32
-
33
- ## Step 0 — Create the run folder FIRST
34
-
35
- Before anything else, derive a `{run-slug}` from the user's request (short,
36
- lowercased, hyphenated intent name, e.g. "merchant-notifications") and create
37
- `.claude/orc/run/{run-slug}/` (config `run_dir`). ALL run artifacts
38
- (intent-spec, checkpoint, state-of-play, decision log) live here — never in the
39
- project root, never loose in run/. If a folder with that slug exists, append a
40
- short timestamp.
41
-
42
- ## Step 1 — Rough-size (picks the question tier)
43
-
44
- Fast read: how many distinct feature areas does the request imply? Use the
45
- request text + a quick repo glance. If genuinely unclear, ask ONE sizing
46
- question ("roughly how big — a small change, a feature, or multiple features?").
47
- This is a rough size for tier selection only; the REAL effort estimate happens
48
- in Phase 2 with the intent-spec in hand.
49
-
50
- ## Step 2 — Tiered questions (ask in ONE batched round)
51
-
52
- **Always (even small tasks):**
53
- 1. In one or two sentences, what should exist when this is done that doesn't now?
54
- 2. What's explicitly *out* of scope?
55
-
56
- **Add for medium+:**
57
- 3. How will we know it's done — what should work/pass?
58
- (→ becomes Phase 6 verify's acceptance criteria)
59
- 4. Anything the code must respect or avoid — patterns to follow, libraries not
60
- to add, files not to touch? (→ hard rules in every worker slice)
61
-
62
- **Add for high / multi-feature:**
63
- 5. What existing parts of the system does this touch that it must not break?
64
- (→ feeds the conflict graph / integration surface)
65
- 6. Anything you're unsure about or expect to change mid-build?
66
- (→ pre-empts mid-run escalations)
67
-
68
- Infer stack, test framework, file layout, existing patterns from the repo.
69
- Only intent, scope, and priorities are askable.
70
-
71
- ## Step 3 — Draft the intent-spec
72
-
73
- Write `run/{run-slug}/intent-spec.md` per `schemas/intent-spec.md`. Restate the
74
- user's intent in YOUR words — restating is what surfaces misreadings.
75
-
76
- ## Step 3.5 — Repo cross-check of the draft (evidence-or-mark, proportional)
77
-
78
- Before showing the spec, cross-check its claims against the repo — the direct
79
- path (no analyst) is the only lane where a spec can reach planning ungrounded.
80
- Same vocabulary as the analyst: confirm or tag `UNVERIFIED`, never silently
81
- assume.
82
-
83
- - **What to check:** every file, module, command, or existing behavior the
84
- draft NAMES — in Definition of done, Constraints, and Integration surface.
85
- A quick Glob/Grep per item; you are confirming the noun exists as described,
86
- not analyzing it.
87
- - **Proportional to the tier:** 2-question tier → check named files/modules
88
- only. 4/6-question tiers → full pass over the three sections above.
89
- - **Anything unconfirmable gets an `UNVERIFIED` tag in the spec** and the tags
90
- become ONE batched question in the sign-off round ("These I could not confirm
91
- in the repo: … — confirm, correct, or drop?"). Never more than one round.
92
- - **Escalation valve:** more than 3 tags means the request is under-grounded
93
- for a direct intake — stretching intake into a second analyst is the one thing
94
- not to do. Two exits, and they answer DIFFERENT questions. Offer them in this
95
- order; the user chooses:
96
- 1. **`/orc-grill`** — when the **intent** is unclear ("I want notifications",
97
- "something is wrong with refunds"). A conversation: minutes, no scan, no
98
- scout tokens. It comes back with a scoped idea, and its exit 2 feeds
99
- `orc-analyze` directly.
100
- 2. **`/orc-analyze`** (requirement mode) — when the intent is clear but its
101
- **grounding in the code** is not. A scan: tokens, evidence, `file:line`.
102
-
103
- Naming them in that order matters: a scan cannot fix a vague intent, it can
104
- only re-ask it at scan prices.
105
- (The standalone planner has the same valve: a request below its plannable
106
- floor routes to the analyst instead of being planned thin — no side door.)
107
-
108
- ## Question rounds that run long — borrow the interview format
109
-
110
- The tiers above are a fixed questionnaire, which is right for a request that
111
- arrives well-formed. When a tier's round runs long or the answers keep opening
112
- new questions, switch that round to the frontier format in
113
- `../../_shared/interview.md`: ask every question whose prerequisites are settled
114
- in ONE round (never two questions where one depends on the other), each in the
115
- shape `❓ **Q1** — **<title>**: <body>` with the recommendation alone on a `➡️`
116
- line. Two rules from that contract still bind here — resolve FACTS yourself
117
- before asking (wiki → pattern → gotchas), and never adopt a DECISION by default.
118
- Same primitive, a different front door; do not fork a second version of it.
119
-
120
- ## Step 4 — Sign-off
121
-
122
- Ask: hard gate (nothing proceeds until explicit approval) or soft (proceed
123
- unless objection)? **Default when unspecified: GATE.**
124
- Show the spec. Gate mode: wait for approval or edits. Soft: proceed after
125
- showing unless the user objects.
126
-
127
- ## Fresh-session reconfirm
128
-
129
- When resuming a run in a fresh session, show a ONE-LINE reconfirm of the
130
- intent-spec's scope ("Resuming: <one-line scope>. Still correct?") before
131
- continuing. Catches requirements that changed between sessions, costs one line.
132
-
133
- <!-- /orc:layer -->
1
+ # Phase — Intake (id: `intake`)
2
+
3
+ > **Library file** (`orc`, `orc-mini`, `orc-diy`, `orc-challenge`). `core` = the intake every lane runs; `full` = /orc's Phase 0 (adds the analyst branch, the poly-spec split-and-STOP and the run-folder open).
4
+
5
+ <!-- orc:layer core -->
6
+ ## Reference — Phase 0 Intake
7
+
8
+ Goal: extract just enough that the intent-spec can't be misread, then get out of
9
+ the way. A wrong understanding parallelized is worse than a wrong understanding
10
+ done serially. Never interrogate; never ask what the repo can tell you.
11
+
12
+ **Before anything — plan-input trigger (see `plan-handoff.md`):** if the run
13
+ input IS a plan (pasted planning-output, a `plan-{name}.md` path, or an
14
+ `orc/planner/{name}/` checkpoint), do NOT run intake — switch to the plan-handoff
15
+ entry contract (`plan-handoff.md`): bootstrap the trace, schema-
16
+ validate, apply the `plan_head` staleness valve, re-run the full Phase 1 exit
17
+ gate in this session, relay `open_questions[]`, then continue at Phase 2. A plain
18
+ prose request is not a plan — run intake normally.
19
+
20
+ **Before intake questions — analyst auto-trigger (see SKILL.md Phase 0):** if the
21
+ input includes a document OR the requirement is ambiguous/underspecified, dispatch
22
+ the System Analyst FIRST (doc-optional; standard/deep gate; scouts in deep mode).
23
+ It resolves scope + accuracy with evidence-or-mark and recommended-option
24
+ questions before any intent-spec is drafted. When it hands back "take into build",
25
+ its confirmed spec feeds Phase 1 planning.
26
+
27
+ ## Step 0 — Create the run folder FIRST
28
+
29
+ Before anything else, derive a `{run-slug}` from the user's request (short,
30
+ lowercased, hyphenated intent name, e.g. "merchant-notifications") and create
31
+ `.claude/orc/run/{run-slug}/` (config `run_dir`). ALL run artifacts
32
+ (intent-spec, checkpoint, state-of-play, decision log) live here — never in the
33
+ project root, never loose in run/. If a folder with that slug exists, append a
34
+ short timestamp.
35
+
36
+ ## Step 1 — Rough-size (picks the question tier)
37
+
38
+ Fast read: how many distinct feature areas does the request imply? Use the
39
+ request text + a quick repo glance. If genuinely unclear, ask ONE sizing
40
+ question ("roughly how big — a small change, a feature, or multiple features?").
41
+ This is a rough size for tier selection only; the REAL effort estimate happens
42
+ in Phase 2 with the intent-spec in hand.
43
+
44
+ ## Step 2 — Tiered questions (ask in ONE batched round)
45
+
46
+ **Always (even small tasks):**
47
+ 1. In one or two sentences, what should exist when this is done that doesn't now?
48
+ 2. What's explicitly *out* of scope?
49
+
50
+ **Add for medium+:**
51
+ 3. How will we know it's done — what should work/pass?
52
+ (→ becomes Phase 6 verify's acceptance criteria)
53
+ 4. Anything the code must respect or avoid — patterns to follow, libraries not
54
+ to add, files not to touch? (→ hard rules in every worker slice)
55
+
56
+ **Add for high / multi-feature:**
57
+ 5. What existing parts of the system does this touch that it must not break?
58
+ (→ feeds the conflict graph / integration surface)
59
+ 6. Anything you're unsure about or expect to change mid-build?
60
+ (→ pre-empts mid-run escalations)
61
+
62
+ Infer stack, test framework, file layout, existing patterns from the repo.
63
+ Only intent, scope, and priorities are askable.
64
+
65
+ ## Step 3 — Draft the intent-spec
66
+
67
+ Write `run/{run-slug}/intent-spec.md` per `schemas/intent-spec.md`. Restate the
68
+ user's intent in YOUR words — restating is what surfaces misreadings.
69
+
70
+ ## Step 3.5 — Repo cross-check of the draft (evidence-or-mark, proportional)
71
+
72
+ Before showing the spec, cross-check its claims against the repo — the direct
73
+ path (no analyst) is the only lane where a spec can reach planning ungrounded.
74
+ Same vocabulary as the analyst: confirm or tag `UNVERIFIED`, never silently
75
+ assume.
76
+
77
+ - **What to check:** every file, module, command, or existing behavior the
78
+ draft NAMES — in Definition of done, Constraints, and Integration surface.
79
+ A quick Glob/Grep per item; you are confirming the noun exists as described,
80
+ not analyzing it.
81
+ - **Proportional to the tier:** 2-question tier → check named files/modules
82
+ only. 4/6-question tiers → full pass over the three sections above.
83
+ - **Anything unconfirmable gets an `UNVERIFIED` tag in the spec** and the tags
84
+ become ONE batched question in the sign-off round ("These I could not confirm
85
+ in the repo: … — confirm, correct, or drop?"). Never more than one round.
86
+ - **Escalation valve:** more than 3 tags means the request is under-grounded
87
+ for a direct intake — stretching intake into a second analyst is the one thing
88
+ not to do. Two exits, and they answer DIFFERENT questions. Offer them in this
89
+ order; the user chooses:
90
+ 1. **`/orc-grill`** — when the **intent** is unclear ("I want notifications",
91
+ "something is wrong with refunds"). A conversation: minutes, no scan, no
92
+ scout tokens. It comes back with a scoped idea, and its exit 2 feeds
93
+ `orc-analyze` directly.
94
+ 2. **`/orc-analyze`** (requirement mode) — when the intent is clear but its
95
+ **grounding in the code** is not. A scan: tokens, evidence, `file:line`.
96
+
97
+ Naming them in that order matters: a scan cannot fix a vague intent, it can
98
+ only re-ask it at scan prices.
99
+ (The standalone planner has the same valve: a request below its plannable
100
+ floor routes to the analyst instead of being planned thin — no side door.)
101
+
102
+ ## Question rounds that run long — borrow the interview format
103
+
104
+ The tiers above are a fixed questionnaire, which is right for a request that
105
+ arrives well-formed. When a tier's round runs long or the answers keep opening
106
+ new questions, switch that round to the frontier format in
107
+ `../../_shared/interview.md`: ask every question whose prerequisites are settled
108
+ in ONE round (never two questions where one depends on the other), each in the
109
+ shape `❓ **Q1** — **<title>**: <body>` with the recommendation alone on a `➡️`
110
+ line. Two rules from that contract still bind here — resolve FACTS yourself
111
+ before asking (wiki → pattern → gotchas), and never adopt a DECISION by default.
112
+ Same primitive, a different front door; do not fork a second version of it.
113
+
114
+ ## Step 4 — Sign-off
115
+
116
+ Ask: hard gate (nothing proceeds until explicit approval) or soft (proceed
117
+ unless objection)? **Default when unspecified: GATE.**
118
+ Show the spec. Gate mode: wait for approval or edits. Soft: proceed after
119
+ showing unless the user objects.
120
+
121
+ ## Fresh-session reconfirm
122
+
123
+ When resuming a run in a fresh session, show a ONE-LINE reconfirm of the
124
+ intent-spec's scope ("Resuming: <one-line scope>. Still correct?") before
125
+ continuing. Catches requirements that changed between sessions, costs one line.
126
+
127
+ <!-- /orc:layer -->
@@ -1,56 +1,46 @@
1
- # Phase — Mock example + drift recovery (id: `mock-example`)
2
-
3
- > **Shared phase file.** Moved out of `orc/SKILL.md` at v1.0.0 W12, and into
4
- > this library at W13 when `orc-diy` became its second reader. A spine is loaded
5
- > IN FULL when its skill activates; this is loaded when the phase fires, and most
6
- > runs skip most phases.
7
- >
8
- > **Two layers, and a lane reads exactly one.** `full` is `/orc`'s procedure.
9
- > `composed` is what `orc diy compile` stitches — the same phase expressed as
10
- > `<!-- diy:when -->` variants over a composed flow, NOT a second copy of the
11
- > procedure. Reading the wrong one is the failure `README.md` names: a lane
12
- > doing a phase its product promise says it does differently.
13
- > `orc lane phases <lane> --json` names the layer for each lane.
14
-
15
- <!-- orc:layer full -->
16
-
17
- ## Mock example + drift recovery (config `mock_example`)
18
-
19
- Load `../drift-recovery.md` (canonical). Only after a GREEN Phase 6,
20
- before ship: `ask` (default) → the offer is MANDATORY (never silently skipped,
21
- never silently run); `on` → build; `off` → skip. Deliverable:
22
- `mock-examples/<change-slug>/` at the project root (`EXAMPLE.md` + one minimal
23
- runnable artifact; mocked inputs only) — **NEVER committed**. After the user
24
- runs it, ONE question: matches expectation? [yes / drift: <describe>]. On
25
- drift → `DRIFT-FROM` handoff → analyze-mini gap analysis → mini planner patch
26
- plan → scored dispatch → re-verify → re-offer; **hard cap 2 loops**, then an
27
- honest unresolved report. Emit `DRIFT loop=<n>` per loop; end-of-phase packet.
28
-
29
- <!-- /orc:layer -->
30
-
31
- <!-- orc:layer composed -->
32
-
33
- ## Phase: Mock example (after a green verify, before ship)
34
-
35
- <!-- diy:when mock_example=off -->
36
- The mock-example phase is DISABLED in this flow. Skip silently.
37
- <!-- /diy:when -->
38
- <!-- diy:when mock_example=ask -->
39
- After the verify/smoke gate is GREEN and BEFORE any ship action, the offer is
40
- MANDATORY (never silently skipped, never silently run): follow
41
- `.claude/skills/_shared/drift-recovery.md` — build
42
- `mock-examples/<change-slug>/` (EXAMPLE.md + one minimal runnable mocked
43
- artifact) only on a yes. After the user runs it, ask the one drift question;
44
- on drift run the `DRIFT-FROM` recovery loop (hard cap 2, then an honest
45
- unresolved report). `mock-examples/` is NEVER staged by the ship phase.
46
- <!-- /diy:when -->
47
- <!-- diy:when mock_example=on -->
48
- After the verify/smoke gate is GREEN and BEFORE any ship action, build the
49
- mocked example without asking, per
50
- `.claude/skills/_shared/drift-recovery.md`: `mock-examples/<change-slug>/`
51
- (EXAMPLE.md + one minimal runnable mocked artifact; mocked inputs only). Then
52
- ask the one drift question; on drift run the `DRIFT-FROM` recovery loop (hard
53
- cap 2). `mock-examples/` is NEVER staged by the ship phase.
54
- <!-- /diy:when -->
55
-
56
- <!-- /orc:layer -->
1
+ # Phase — Mock example + drift recovery (id: `mock-example`)
2
+
3
+ > **Shared phase file** — read when the phase fires. A lane reads ONE layer: `full` (`/orc`) or `composed` (the `<!-- diy:when -->` variants `orc diy compile` stitches). `orc lane phases <lane> --json` names it.
4
+
5
+ <!-- orc:layer full -->
6
+
7
+ ## Mock example + drift recovery (config `mock_example`)
8
+
9
+ Load `../drift-recovery.md` (canonical). Only after a GREEN Phase 6,
10
+ before ship: `ask` (default) → the offer (H `orc.phase-6-7.mock`) is MANDATORY (never silently skipped,
11
+ never silently run); `on` → build; `off` → skip. Deliverable:
12
+ `mock-examples/<change-slug>/` at the project root (`EXAMPLE.md` + one minimal
13
+ runnable artifact; mocked inputs only) — **NEVER committed**. After the user
14
+ runs it, ONE question: matches expectation? [yes / drift: <describe>]. On
15
+ drift → `DRIFT-FROM` handoff → analyze-mini gap analysis → mini planner patch
16
+ plan → scored dispatch → re-verify → re-offer; **hard cap 2 loops**, then an
17
+ honest unresolved report. Emit `DRIFT loop=<n>` per loop; end-of-phase packet.
18
+
19
+ <!-- /orc:layer -->
20
+
21
+ <!-- orc:layer composed -->
22
+
23
+ ## Phase: Mock example (after a green verify, before ship)
24
+
25
+ <!-- diy:when mock_example=off -->
26
+ The mock-example phase is DISABLED in this flow. Skip silently.
27
+ <!-- /diy:when -->
28
+ <!-- diy:when mock_example=ask -->
29
+ After the verify/smoke gate is GREEN and BEFORE any ship action, the offer is
30
+ MANDATORY (never silently skipped, never silently run): follow
31
+ `.claude/skills/_shared/drift-recovery.md` — build
32
+ `mock-examples/<change-slug>/` (EXAMPLE.md + one minimal runnable mocked
33
+ artifact) only on a yes. After the user runs it, ask the one drift question;
34
+ on drift run the `DRIFT-FROM` recovery loop (hard cap 2, then an honest
35
+ unresolved report). `mock-examples/` is NEVER staged by the ship phase.
36
+ <!-- /diy:when -->
37
+ <!-- diy:when mock_example=on -->
38
+ After the verify/smoke gate is GREEN and BEFORE any ship action, build the
39
+ mocked example without asking, per
40
+ `.claude/skills/_shared/drift-recovery.md`: `mock-examples/<change-slug>/`
41
+ (EXAMPLE.md + one minimal runnable mocked artifact; mocked inputs only). Then
42
+ ask the one drift question; on drift run the `DRIFT-FROM` recovery loop (hard
43
+ cap 2). `mock-examples/` is NEVER staged by the ship phase.
44
+ <!-- /diy:when -->
45
+
46
+ <!-- /orc:layer -->