@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,65 +1,55 @@
1
- # Phase — Effort & scoring (id: `scoring`)
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
- ## Effort, dispatch style, scoring (load ../../orc/references/effort-and-mode.md)
18
-
19
- Emit `PHASE scoring start`. Refine effort; recommend **sequential** vs
20
- **parallel** dispatch (worktrees for high-effort independent features) — user
21
- confirms. Dispatch style is **intra-wave concurrency only**: waves are computed
22
- regardless of style (sequential runs have waves too, see wave-grouping.md), so
23
- the batch pause always binds to wave numbers. **Batch-pause schedule (deterministic, not a cadence hint):** the plan
24
- has K waves — ask "pause after every wave / every 2nd / run straight through?"
25
- and SHOW the resulting stop list ("will pause after waves [list]"); a 2-wave
26
- plan plainly offers "pause after wave 1". Store it as `pause_schedule`, recompute
27
- each wave's `is_batch_pause` (last wave never pauses). **Facet-validation gate
28
- (deterministic):** recompute `breadth` + `fan_in`/`fan_out` from the plan; a
29
- mismatch or an uncited `risk` entry bounces the plan (grounding mechanics).
30
- **Score every task** from its `facets` via the fixed formula, map to the model
31
- ladder, show the facet vector + arithmetic table, and emit `SCORE task=<id>
32
- score=<n> band=<band> model=<m> facets=<vector> :: <reason>` per task; a score
33
- override needs a written reason (logged). **With `extra_enabled`** the table gains
34
- a `via` column and its head can name TWO tables (effort-and-mode.md); a foreign
35
- task's `SCORE` appends `via=extra:<profile>` and `model=` is the FOREIGN model id.
36
- **Cited-risk hold-back (deterministic, beside the facet gate):** a foreign-routed
37
- task with a non-empty `risk[]` is HELD BACK to its Claude band (`extra_risk_tasks`
38
- defaults to `off`) and every one is LISTED with its cited risk — a silently
39
- held-back task is indistinguishable from a forgotten one. Use the wiki's "Notes for planning" to sharpen
40
- core/isolated + risk factors. **Tag each task's pattern domain+language**
41
- (+ secondary `db: postgres`) per `../../orc/references/pattern-gate.md`. Ask: "Any
42
- anticipated escalations, or run straight through?" Emit `PHASE scoring end`.
43
-
44
- <!-- /orc:layer -->
45
-
46
- <!-- orc:layer composed -->
47
-
48
- ## Phase: Task scoring → executor selection
49
-
50
- <!-- diy:when scoring=on -->
51
- Score each task 0–100 with the full lane's rubric (see the scoring section of
52
- `.claude/skills/orc/SKILL.md`), then dispatch the executor agent from THIS
53
- compiled table — it is already clipped to this flow's session tier; never
54
- substitute a preset from `config.md`:
55
-
56
- {{score_table}}
57
- <!-- /diy:when -->
58
- <!-- diy:when scoring=off -->
59
- Scoring is DISABLED in this flow. Skip the rubric entirely: EVERY execution
60
- task dispatches to **{{fixed_executor}}**. Wave grouping, declared-files
61
- conflict rules, and slice construction are unchanged — scoring off changes
62
- model selection only, never scheduling.
63
- <!-- /diy:when -->
64
-
65
- <!-- /orc:layer -->
1
+ # Phase — Effort & scoring (id: `scoring`)
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
+ ## Effort, dispatch style, scoring (load ../../orc/references/effort-and-mode.md)
8
+
9
+ Emit `PHASE scoring start`. Refine effort; recommend **sequential** vs
10
+ **parallel** dispatch (worktrees for high-effort independent features) — user
11
+ confirms (H `orc.phase-2.execution`). Dispatch style is **intra-wave concurrency only**: waves are computed
12
+ regardless of style (sequential runs have waves too, see wave-grouping.md), so
13
+ the batch pause always binds to wave numbers. **Batch-pause schedule (deterministic, not a cadence hint):** the plan
14
+ has K waves — ask (H `orc.phase-2.pause`) "pause after every wave / every 2nd / run straight through?"
15
+ and SHOW the resulting stop list ("will pause after waves [list]"); a 2-wave
16
+ plan plainly offers "pause after wave 1". Store it as `pause_schedule`, recompute
17
+ each wave's `is_batch_pause` (last wave never pauses). **Facet-validation gate
18
+ (deterministic):** recompute `breadth` + `fan_in`/`fan_out` from the plan; a
19
+ mismatch or an uncited `risk` entry bounces the plan (grounding mechanics).
20
+ **Score every task** from its `facets` via the fixed formula, map to the model
21
+ ladder, show the facet vector + arithmetic table, and emit `SCORE task=<id>
22
+ score=<n> band=<band> model=<m> facets=<vector> :: <reason>` per task; a score
23
+ override needs a written reason (logged). **With `extra_enabled`** the table gains
24
+ a `via` column and its head can name TWO tables (effort-and-mode.md); a foreign
25
+ task's `SCORE` appends `via=extra:<profile>` and `model=` is the FOREIGN model id.
26
+ **Cited-risk hold-back (deterministic, beside the facet gate):** a foreign-routed
27
+ task with a non-empty `risk[]` is HELD BACK to its Claude band (`extra_risk_tasks`
28
+ defaults to `off`) and every one is LISTED with its cited risk — a silently
29
+ held-back task is indistinguishable from a forgotten one. Use the wiki's "Notes for planning" to sharpen
30
+ core/isolated + risk factors. **Tag each task's pattern domain+language**
31
+ (+ secondary `db: postgres`) per `../../orc/references/pattern-gate.md`. Ask: "Any
32
+ anticipated escalations, or run straight through?" Emit `PHASE scoring end`.
33
+
34
+ <!-- /orc:layer -->
35
+
36
+ <!-- orc:layer composed -->
37
+
38
+ ## Phase: Task scoring → executor selection
39
+
40
+ <!-- diy:when scoring=on -->
41
+ Score each task 0–100 with the full lane's rubric (see the scoring section of
42
+ `.claude/skills/orc/SKILL.md`), then dispatch the executor agent from THIS
43
+ compiled table — it is already clipped to this flow's session tier; never
44
+ substitute a preset from `config.md`:
45
+
46
+ {{score_table}}
47
+ <!-- /diy:when -->
48
+ <!-- diy:when scoring=off -->
49
+ Scoring is DISABLED in this flow. Skip the rubric entirely: EVERY execution
50
+ task dispatches to **{{fixed_executor}}**. Wave grouping, declared-files
51
+ conflict rules, and slice construction are unchanged — scoring off changes
52
+ model selection only, never scheduling.
53
+ <!-- /diy:when -->
54
+
55
+ <!-- /orc:layer -->
@@ -1,50 +1,46 @@
1
- # Phase — Security pass (id: `security-checklist`)
2
-
3
- > **Library file.** Canonical since v1.0.0 W12; it was under the `orc` skill's
4
- > private `references/`, and another lane already reached across into it. Read
5
- > by `orc`, `orc-diy`. Layers declared: `core` only — single-layer because an
6
- > opt-in pass either runs its checklist or does not run. `orc lane phases
7
- > <lane> --json` names the file and the layers to read.
8
-
9
- <!-- orc:layer core -->
10
- ## Reference — Security-Pass Checklist (Phase 5.5, opt-in)
11
-
12
- Loaded ONLY when the Phase 5.5 security pass fires (config `security_review`
13
- `on`/`ask` + a task scored ≥ 70 in the run). Passed to the reviewer as
14
- `security_checklist[]` — the worker sweeps ONLY the run's changed files against
15
- these items, wrapping Semgrep if it is already installed (never installing it).
16
-
17
- Severity mapping (same P0–P3 ladder): an item the DIFF makes exploitable = P0 ·
18
- a hardening gap on a touched path = P1 · defense-in-depth suggestions = P2/P3.
19
-
20
- ## Checklist (OWASP/STRIDE-derived, impact-ordered — the closed set; never extend ad hoc)
21
-
22
- 1. **Injection** — SQL/NoSQL/command/LDAP built from user input without
23
- parameterization or a safe builder anywhere in the diff.
24
- 2. **Broken auth on new surface** — any new endpoint/route/handler reachable
25
- without the auth check its siblings carry (spoofing).
26
- 3. **Broken authorization** — object/record access without an ownership or role
27
- check (IDOR); privilege boundaries crossed by the new code (elevation).
28
- 4. **Secrets in code** — credentials, tokens, keys, or connection strings
29
- hardcoded or logged; secrets reaching client bundles or responses
30
- (information disclosure).
31
- 5. **Unvalidated input** — request bodies/params/headers/files used before
32
- schema validation; mass-assignment of writable model fields (tampering).
33
- 6. **Injection into output** — XSS via unescaped user data in HTML/JS contexts;
34
- unsafe redirects/headers from user input.
35
- 7. **Insecure data handling** — sensitive data stored/transmitted unencrypted,
36
- PII in logs, cache keys/values leaking secrets.
37
- 8. **CSRF/replay on state changes** — new state-changing browser endpoints
38
- without CSRF protection; missing idempotency where retries can double-apply
39
- (repudiation/tampering).
40
- 9. **Resource exhaustion** — new unbounded loops/queries/uploads/allocations an
41
- attacker controls (denial of service): missing pagination, no timeout, no
42
- size cap.
43
- 10. **Dependency risk** — a newly added dependency that is unmaintained,
44
- typosquat-suspicious, or pulled for something the stdlib/project already does.
45
- 11. **Error-path leaks** — stack traces, internal paths, or raw driver errors
46
- surfaced to callers by the new error handling.
47
- 12. **Crypto misuse** — home-rolled hashing/encryption, weak algorithms (MD5,
48
- SHA1 for passwords), missing salts, static IVs in the diff.
49
-
50
- <!-- /orc:layer -->
1
+ # Phase — Security pass (id: `security-checklist`)
2
+
3
+ > **Library file** (`orc`, `orc-diy`), `core` only: an opt-in pass runs its checklist or does not run.
4
+
5
+ <!-- orc:layer core -->
6
+ ## Reference — Security-Pass Checklist (Phase 5.5, opt-in)
7
+
8
+ Loaded ONLY when the Phase 5.5 security pass fires (config `security_review`
9
+ `on`/`ask` + a task scored ≥ 70 in the run). Passed to the reviewer as
10
+ `security_checklist[]` — the worker sweeps ONLY the run's changed files against
11
+ these items, wrapping Semgrep if it is already installed (never installing it).
12
+
13
+ Severity mapping (same P0–P3 ladder): an item the DIFF makes exploitable = P0 ·
14
+ a hardening gap on a touched path = P1 · defense-in-depth suggestions = P2/P3.
15
+
16
+ ## Checklist (OWASP/STRIDE-derived, impact-ordered — the closed set; never extend ad hoc)
17
+
18
+ 1. **Injection** — SQL/NoSQL/command/LDAP built from user input without
19
+ parameterization or a safe builder anywhere in the diff.
20
+ 2. **Broken auth on new surface** — any new endpoint/route/handler reachable
21
+ without the auth check its siblings carry (spoofing).
22
+ 3. **Broken authorization** — object/record access without an ownership or role
23
+ check (IDOR); privilege boundaries crossed by the new code (elevation).
24
+ 4. **Secrets in code** — credentials, tokens, keys, or connection strings
25
+ hardcoded or logged; secrets reaching client bundles or responses
26
+ (information disclosure).
27
+ 5. **Unvalidated input** — request bodies/params/headers/files used before
28
+ schema validation; mass-assignment of writable model fields (tampering).
29
+ 6. **Injection into output** — XSS via unescaped user data in HTML/JS contexts;
30
+ unsafe redirects/headers from user input.
31
+ 7. **Insecure data handling** — sensitive data stored/transmitted unencrypted,
32
+ PII in logs, cache keys/values leaking secrets.
33
+ 8. **CSRF/replay on state changes** — new state-changing browser endpoints
34
+ without CSRF protection; missing idempotency where retries can double-apply
35
+ (repudiation/tampering).
36
+ 9. **Resource exhaustion** — new unbounded loops/queries/uploads/allocations an
37
+ attacker controls (denial of service): missing pagination, no timeout, no
38
+ size cap.
39
+ 10. **Dependency risk** — a newly added dependency that is unmaintained,
40
+ typosquat-suspicious, or pulled for something the stdlib/project already does.
41
+ 11. **Error-path leaks** — stack traces, internal paths, or raw driver errors
42
+ surfaced to callers by the new error handling.
43
+ 12. **Crypto misuse** — home-rolled hashing/encryption, weak algorithms (MD5,
44
+ SHA1 for passwords), missing salts, static IVs in the diff.
45
+
46
+ <!-- /orc:layer -->
@@ -1,55 +1,45 @@
1
- # Phase — Security pass (opt-in) (id: `security`)
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
- ## Security pass (opt-in)
18
-
19
- Only when config `security_review` is `on`/`ask` (default `off`) AND a task
20
- scored **≥ 70** (reuses the risk floor). `ask` → one P0 prompt; `on` →
21
- silent. Dispatch the reviewer with `phase=security` + changed files +
22
- `security-checklist.md` (load only now). Same ladder, same
23
- hard-rule-5 handling; report-only.
24
-
25
- <!-- /orc:layer -->
26
-
27
- <!-- orc:layer composed -->
28
-
29
- ## Phase: Security pass
30
-
31
- <!-- diy:when security=off -->
32
- The security pass is OFF in this flow — skip silently.
33
- <!-- /diy:when -->
34
- <!-- diy:when security=ask -->
35
- When at least one task scored at or above the risk floor (70), ask the user
36
- once after review whether to run the security pass; on yes, run it exactly as
37
- the full lane's Phase 5.5 (reviewer re-dispatched with the checklist from
38
- `.claude/skills/_shared/phases/security-checklist.md`, sweeping only the
39
- run's changed files).
40
- <!-- /diy:when -->
41
- <!-- diy:when security=on -->
42
- When at least one task scored at or above the risk floor (70), dispatch the
43
- security pass without asking — the full lane's Phase 5.5 with the checklist
44
- from `.claude/skills/_shared/phases/security-checklist.md`, sweeping only the
45
- run's changed files.
46
- <!-- /diy:when -->
47
- <!-- diy:when security=always -->
48
- Dispatch the security pass on EVERY run of this flow, regardless of task
49
- scores — the full lane's Phase 5.5 with the checklist from
50
- `.claude/skills/_shared/phases/security-checklist.md`, sweeping only the
51
- run's changed files. (This flow removes the risk-floor trigger, not the
52
- pass's mechanics.)
53
- <!-- /diy:when -->
54
-
55
- <!-- /orc:layer -->
1
+ # Phase — Security pass (opt-in) (id: `security`)
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
+ ## Security pass (opt-in)
8
+
9
+ Only when config `security_review` is `on`/`ask` (default `off`) AND a task
10
+ scored **≥ 70** (reuses the risk floor). `ask` → one P0 prompt (H `orc.phase-5-5.security`); `on` →
11
+ silent. Dispatch the reviewer with `phase=security` + changed files +
12
+ `security-checklist.md` (load only now). Same ladder, same
13
+ hard-rule-5 handling; report-only.
14
+
15
+ <!-- /orc:layer -->
16
+
17
+ <!-- orc:layer composed -->
18
+
19
+ ## Phase: Security pass
20
+
21
+ <!-- diy:when security=off -->
22
+ The security pass is OFF in this flow — skip silently.
23
+ <!-- /diy:when -->
24
+ <!-- diy:when security=ask -->
25
+ When at least one task scored at or above the risk floor (70), ask the user
26
+ once after review (H `orc.phase-5-5.security`) whether to run the security pass; on yes, run it exactly as
27
+ the full lane's Phase 5.5 (reviewer re-dispatched with the checklist from
28
+ `.claude/skills/_shared/phases/security-checklist.md`, sweeping only the
29
+ run's changed files).
30
+ <!-- /diy:when -->
31
+ <!-- diy:when security=on -->
32
+ When at least one task scored at or above the risk floor (70), dispatch the
33
+ security pass without asking — the full lane's Phase 5.5 with the checklist
34
+ from `.claude/skills/_shared/phases/security-checklist.md`, sweeping only the
35
+ run's changed files.
36
+ <!-- /diy:when -->
37
+ <!-- diy:when security=always -->
38
+ Dispatch the security pass on EVERY run of this flow, regardless of task
39
+ scores — the full lane's Phase 5.5 with the checklist from
40
+ `.claude/skills/_shared/phases/security-checklist.md`, sweeping only the
41
+ run's changed files. (This flow removes the risk-floor trigger, not the
42
+ pass's mechanics.)
43
+ <!-- /diy:when -->
44
+
45
+ <!-- /orc:layer -->
@@ -1,16 +1,6 @@
1
1
  # Phase — Ship (id: `ship`)
2
2
 
3
- > **Shared phase file.** Moved out of `orc/SKILL.md` at v1.0.0 W12, and into
4
- > this library at W13 when `orc-diy` became its second reader. A spine is loaded
5
- > IN FULL when its skill activates; this is loaded when the phase fires, and most
6
- > runs skip most phases.
7
- >
8
- > **Two layers, and a lane reads exactly one.** `full` is `/orc`'s procedure.
9
- > `composed` is what `orc diy compile` stitches — the same phase expressed as
10
- > `<!-- diy:when -->` variants over a composed flow, NOT a second copy of the
11
- > procedure. Reading the wrong one is the failure `README.md` names: a lane
12
- > doing a phase its product promise says it does differently.
13
- > `orc lane phases <lane> --json` names the layer for each lane.
3
+ > **Shared phase file** — read when the phase fires. A lane reads ONE layer: `full` (`/orc`) or `composed` (the `<!-- diy:when -->` variants `orc diy compile` stitches). `orc lane phases <lane> --json` names it.
14
4
 
15
5
  <!-- orc:layer full -->
16
6
 
@@ -23,7 +13,7 @@ Emit `PHASE ship start`. Show current branch.
23
13
  (`git diff --numstat`, exclusions applied) vs config `stacked_pr_loc`/
24
14
  `stacked_pr_files`. Under threshold or `stacked_pr: off` → silent, ship normally
25
15
  (`GATE stack-gate pass :: under-threshold`). Tripped → surface report + ONE P0
26
- question (stack into layers? or one regular PR?) in the SAME round as its two
16
+ question (H `orc.phase-8.stack`: stack into layers? or one regular PR?) in the SAME round as its two
27
17
  prerequisites — **a ticket** and a resolved PR template
28
18
  (`_shared/pr-templates.md`; none found → recommend three options). No ticket, no
29
19
  template, or "no" → **one regular PR, never re-asked**. "Yes" → commit on the
@@ -36,7 +26,7 @@ GREEN surface in `orc handoff surfaces --json`, say so —
36
26
  *"2 of these were changes a PM could have made alone — `/orc-handoff` next time."*
37
27
  That sentence is how anyone finds out that lane exists.
38
28
 
39
- Then ask together: **commit? push? create PR?** (PR: ticket +
29
+ Then ask together (H `orc.phase-8.ship`): **commit? push? create PR?** (PR: ticket +
40
30
  title + target branch; generate from `../../orc/subskills/orc-pr/pr.md`). If Phase 6.5 ran,
41
31
  commit `test-generator/<change-slug>/` too (a user deliverable, never gitignored).
42
32
  **`mock-examples/` is NEVER staged** (drift-recovery.md; no `.gitignore` edit —
@@ -46,10 +36,11 @@ On success: delete the ephemeral decision log; KEEP checkpoint + dispatch log.
46
36
  run changed; point at `/orc-wiki`. **Post-ship refresh ask** (BIG runs, /orc +
47
37
  /orc-ultra — the `wiki_refresh_ask_tasks`/`_files` triggers and full rules in
48
38
  `../../orc-wiki/references/staleness.md`): upgrade the passive note to **"Refresh
49
- wiki now?"**; on "later" print the prominent stale warning and stamp
39
+ wiki now?"** (H `orc.phase-8.wiki-refresh`); on "later" print the prominent stale warning and stamp
50
40
  `wiki_refresh_declined` in the checkpoint. Then ALWAYS show the completion
51
41
  usage report — /usage limits + the full dispatch log (model/effort/score per
52
- subagent). The user must always know what the run cost. **Code graph
42
+ subagent). The user must always know what the run cost. A `proposal` in
43
+ `habits{}` → its ONE line joins that report (`../habits.md` §3). **Code graph
53
44
  (`../code-graph.md` §5–§6):** run `orc graph update --if-enabled` once more —
54
45
  fix rounds move code — and emit `GRAPH-UPDATE`; then run `orc graph notes pending
55
46
  --files <every path the run changed> --at end --if-enabled` — exit 0 → one noter
@@ -1,9 +1,6 @@
1
1
  # Phase — Stop, usage report, resume (id: `stop-resume`)
2
2
 
3
- > **Library file.** Canonical since v1.0.0 W11; it was
4
- > the `orc` skill's own `stop-and-resume` reference. Layers declared: `core` only — the stop
5
- > sequence is identical in every lane that stops, and the lane-specific half
6
- > (which moments are MANDATORY stops) is already a per-lane rule in the spine.
3
+ > **Library file**, `core` only: the stop sequence is identical in every lane that stops; which moments are MANDATORY stops is a per-lane rule in the spine.
7
4
 
8
5
  <!-- orc:layer core -->
9
6
 
@@ -41,7 +38,7 @@ boundary is not.
41
38
  4. **Usage report** (see below).
42
39
  5. **Generate the resume block** (see below) — regenerate FRESH at every stop,
43
40
  never reuse an old one. It is printed inline AND is the body of `RESUME.md`.
44
- 6. Tell the user: what's done / remaining, then BOTH continue paths:
41
+ 6. Tell the user: what's done / remaining, then BOTH continue paths (H `any.stop.where`):
45
42
  "Reply **continue** here, or paste the block below in a **fresh session**
46
43
  (recommended if this conversation is long — cheaper and cleaner than
47
44
  dragging this context forward)."
@@ -1,48 +1,73 @@
1
- # Phase — Summary (id: `summary`)
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
- ## Summary
18
-
19
- Emit `PHASE summary start`. Report: tasks/waves/dispatches (scores + overrides), escalations,
20
- needs_context events, findings by severity (P0/P1 resolved; P2 itemized; P3
21
- counted), verify result, authored tests when 6.5 ran, repo state + branch,
22
- stale_review flags. Then ONE question: **"Apply the P2 fix-batch? The P3
23
- cosmetics too?"** — never fix unasked. Emit `PHASE summary end`.
24
-
25
- <!-- /orc:layer -->
26
-
27
- <!-- orc:layer composed -->
28
-
29
- ## Phase: Summary
30
-
31
- <!-- diy:when summary=off -->
32
- No summary phase: end after ship with a single line (tasks done / gate color
33
- / ship action taken) plus usage, and note which phases this flow skipped.
34
- <!-- /diy:when -->
35
- <!-- diy:when summary=short -->
36
- Short summary: one paragraph — what was built, gate results, ship action,
37
- skipped phases, and usage. No per-task breakdown.
38
- <!-- /diy:when -->
39
- <!-- diy:when summary=full -->
40
- Full summary exactly as the full lane's final phase: per-task outcomes with
41
- models used, findings outcomes, verify results, ship action, skipped
42
- phases, and usage.
43
- <!-- /diy:when -->
44
-
45
- Always name the phases this flow skipped by config — the user must never
46
- mistake a DIY run for a full-lane run.
47
-
48
- <!-- /orc:layer -->
1
+ # Phase — Summary (id: `summary`)
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
+ ## Summary
8
+
9
+ Emit `PHASE summary start`. Report: tasks/waves/dispatches (scores + overrides), escalations,
10
+ needs_context events, findings by severity (P0/P1 resolved; P2 itemized by
11
+ `group`; P3 counted; `pre_existing` in its own non-gating bucket; the
12
+ after-filter's `removed[]`, each with the id that removed it), verify result,
13
+ authored tests when 6.5 ran, repo state + branch,
14
+ stale_review flags. Then ONE question: **"Apply the P2 fix-batch? The P3
15
+ cosmetics too?"** (H `orc.phase-7.p2-batch` · `orc.phase-7.p3-batch`) — never fix unasked.
16
+ A yes dispatches ONE fix per `group` (R7), never one per finding. Then record
17
+ each Phase 5 finding's outcome and emit `FINDING-OUTCOME` (`../gotchas.md` §10
18
+ "Review close"). Print the card (§End-of-run card), then emit `PHASE summary end`.
19
+
20
+ <!-- /orc:layer -->
21
+
22
+ <!-- orc:layer composed -->
23
+
24
+ ## Phase: Summary
25
+
26
+ <!-- diy:when summary=off -->
27
+ No summary phase: end after ship with a single line (tasks done / gate color
28
+ / ship action taken) plus usage, and note which phases this flow skipped.
29
+ <!-- /diy:when -->
30
+ <!-- diy:when summary=short -->
31
+ Short summary: one paragraph — what was built, gate results, ship action,
32
+ skipped phases, and usage. No per-task breakdown.
33
+ <!-- /diy:when -->
34
+ <!-- diy:when summary=full -->
35
+ Full summary exactly as the full lane's final phase: per-task outcomes with
36
+ models used, findings outcomes, verify results, ship action, skipped
37
+ phases, and usage.
38
+ <!-- /diy:when -->
39
+
40
+ Always name the phases this flow skipped by config — the user must never
41
+ mistake a DIY run for a full-lane run. The run ends with the card
42
+ (`.claude/skills/_shared/phases/summary.md` §End-of-run card).
43
+
44
+ <!-- /orc:layer -->
45
+
46
+ ## End-of-run card
47
+
48
+ **ONE template, the same shape in every coding lane.** `/orc` and `/orc-diy`
49
+ print it at the end of the summary; `/orc-mini`, `/orc-fast` and `/orc-quick`
50
+ point here and print it at their end — a green ship, a red STOP, or a quick
51
+ entry that wrote code. Every detail goes BELOW the card, never above it.
52
+
53
+ ```
54
+ ✅ Fixed the null charge on guest checkout — 3 files, tests 14 passed (2 affected first)
55
+ review 2 findings · 1 fixed · 1 disputed (recorded) gotchas 1 recorded (G-044)
56
+ risk low — callers 3 in 2 files, tests reach 2 habits 1 proposal below
57
+ flaky 1 test passed on the re-run (no repair round) graph <gain line>
58
+ undo orc undo --run <run-slug> next commit? (your usual: review → commit)
59
+ ```
60
+
61
+ - **Line 1 is the outcome.** Start with ✅ (done), ⚠ (partial) or ⛔ (red). Then
62
+ say what happened, the files and the tests. The first sentence answers "what
63
+ happened?".
64
+ - **A row shows only when it has something.** Never print an empty row.
65
+ - **The `undo` row always shows on a run that wrote code:**
66
+ `orc undo --run <run-slug>` — never `git checkout -- .`, which also discards
67
+ the user's own edits. No `checkpoint.json` with `actual_files` → add
68
+ `--files <actual_files>`. No snapshot (not a git repository) → say
69
+ `undo none — no snapshot`. The command only PRINTS the undo; `--apply` runs
70
+ it. The lane never runs it itself.
71
+ - **Copy the CLI's words.** `risk` is the `blast_line` with its `why`;
72
+ `graph` is the `orc graph gain` `line`, VERBATIM — an estimate with a range,
73
+ never restated as a saving. `flaky` is the `GATE flaky` tests.