@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
@@ -46,6 +46,7 @@ const required = [
46
46
  "bin/webui/css/panels/mockrun.css",
47
47
  "bin/webui/css/panels/maintenance.css",
48
48
  "bin/webui/css/panels/pact.css",
49
+ "bin/webui/css/panels/behaviour.css",
49
50
  "bin/webui/css/panels/boundary.css",
50
51
  "bin/webui/css/panels/wait.css",
51
52
  "bin/webui/css/panels/hookui.css",
@@ -78,6 +79,7 @@ const required = [
78
79
  "bin/webui/js/panels/experiment.js",
79
80
  "bin/webui/js/panels/maintenance.js",
80
81
  "bin/webui/js/panels/pact.js",
82
+ "bin/webui/js/panels/behaviour.js",
81
83
  "bin/webui/js/panels/boundary.js",
82
84
  "bin/webui/js/panels/wait.js",
83
85
  "bin/webui/js/panels/hookui.js",
@@ -101,6 +103,7 @@ const required = [
101
103
  "bin/webui/fixtures/runs.js",
102
104
  "bin/webui/fixtures/stats.js",
103
105
  "bin/webui/fixtures/pact.js",
106
+ "bin/webui/fixtures/behaviour.js",
104
107
  "bin/webui/fixtures/boundary.js",
105
108
  "bin/webui/fixtures/wait.js",
106
109
  "bin/webui/fixtures/hookui.js",
@@ -136,6 +139,7 @@ const required = [
136
139
  "bin/webui/i18n/en/mockrun.json",
137
140
  "bin/webui/i18n/en/maintenance.json",
138
141
  "bin/webui/i18n/en/pact.json",
142
+ "bin/webui/i18n/en/behaviour.json",
139
143
  "bin/webui/i18n/en/boundary.json",
140
144
  "bin/webui/i18n/en/wait.json",
141
145
  "bin/webui/i18n/en/hookui.json",
@@ -162,6 +166,7 @@ const required = [
162
166
  "bin/webui/i18n/id/mockrun.json",
163
167
  "bin/webui/i18n/id/maintenance.json",
164
168
  "bin/webui/i18n/id/pact.json",
169
+ "bin/webui/i18n/id/behaviour.json",
165
170
  "bin/webui/i18n/id/boundary.json",
166
171
  "bin/webui/i18n/id/wait.json",
167
172
  "bin/webui/i18n/id/hookui.json",
@@ -202,6 +207,22 @@ const required = [
202
207
  // the only answer that says WHY a THIN map is thin. Without it the status
203
208
  // line still says THIN and names a command that is not there.
204
209
  "bin/graph-audit.js",
210
+ // v2.0.0 W2 — the habit engine. `orc habit` requires it, and so do
211
+ // `orc lane config` and `orc config list` when `habits` is not off — a publish
212
+ // that drops it breaks the resolver for every lane that turned habits on.
213
+ "bin/habit.js",
214
+ // v2.0.0 W4 / W6a — the gotchas engine and its importers. `orc gotcha` and
215
+ // `orc lane config` require the first; `import`, `sync`, `orc pr threads`
216
+ // and `orc ci failed` require the second. A publish that drops the importer
217
+ // makes every review step's sync fail — silently, because a sync never blocks.
218
+ "bin/gotcha.js",
219
+ "bin/gotcha-import.js",
220
+ // v2.0.0 T21 — the trace pen. `orc trace write` requires it; a publish that
221
+ // drops it sends every lane to the Haiku fallback on every phase close.
222
+ "bin/trace-write.js",
223
+ // v2.0.0 W6b — `orc run snapshot` + `orc undo`. A publish that drops it
224
+ // leaves every end-of-run card printing an undo command that crashes.
225
+ "bin/run-undo.js",
205
226
 
206
227
  // The two DATED data files (v0.50.0). Both ship inside the package and both
207
228
  // are load-bearing on absence rather than on content: without the catalog
@@ -368,6 +389,18 @@ const required = [
368
389
  // trimmed lane reading a full-lane procedure.
369
390
  "templates/skills/_shared/phases/README.md",
370
391
  "templates/skills/_shared/phases/trace.md",
392
+ // v2.0.0 T1 — the CLOSED verb table, split out of trace.md and read on
393
+ // demand. A publish missing it leaves every lane's fallback for a verb not
394
+ // in `trace_grammar` pointing at nothing.
395
+ "templates/skills/_shared/phases/trace-verbs.md",
396
+ // v2.0.0 T3 — the common text of the coding-lane spine blocks. A publish
397
+ // missing it leaves every exit ≠ 0 fallback pointing at nothing.
398
+ "templates/skills/_shared/lane-contract.md",
399
+ // v2.0.0 W3 — the lane side of habits, read on demand. A publish missing it
400
+ // leaves every `(H <qid>)` mark pointing at nothing once habits is on.
401
+ "templates/skills/_shared/habits.md",
402
+ // v2.0.0 W5a — the one review slice, read on demand at a review dispatch.
403
+ "templates/skills/_shared/review-slice.md",
371
404
  "templates/skills/_shared/phases/preflight.md",
372
405
  "templates/skills/_shared/phases/stop-resume.md",
373
406
  // v1.0.0 W12 — the seven files that were already SHARED while living in one
@@ -431,8 +464,10 @@ const required = [
431
464
  // v1.8.0 — the code graph's notes writer (Layer 2).
432
465
  "templates/agents/orc-graph-noter-sonnet-4-6-med.md",
433
466
  // Core non-generated agents — named explicitly so a dropped file is REPORTED
434
- // by name, not merely absorbed by the count floor. (The 8 executor agents are
435
- // checked separately by `build-agents.js --check`.)
467
+ // by name, not merely absorbed by the count floor. (The 10 executor agents are
468
+ // checked separately by `build-agents.js --check`. v2.0.0 T15: the 16 model
469
+ // twins below are GENERATED too — from agents-src/twins/ — and `--check`
470
+ // guards their content; this list still guards that each one ships.)
436
471
  "templates/agents/orc-system-analyst-opus-5-high.md",
437
472
  "templates/agents/orc-planner-opus-5-med.md",
438
473
  "templates/agents/orc-reviewer-opus-5-med.md",
@@ -469,7 +504,7 @@ const required = [
469
504
  // v0.47.0 — the three /orc-challenge agents. All THREE must ship: a cycle that
470
505
  // cannot dispatch the reader silently loses D4, and one that cannot dispatch
471
506
  // the advisor turns a FAIL into a list with no order. All three are already
472
- // Opus 5, so `opus5_only` needs no twin for any of them.
507
+ // Opus 5.5, so `opus5_only` needs no twin for any of them.
473
508
  "templates/agents/orc-challenge-judge-opus-5-high.md",
474
509
  "templates/agents/orc-challenge-advisor-opus-5-med.md",
475
510
  "templates/agents/orc-challenge-reader-opus-5-low.md",
@@ -479,7 +514,7 @@ const required = [
479
514
  // first-principles thinker disputes the goal itself, and the expansionist is
480
515
  // the only lens not looking for a defect. All five must ship: a roster lens
481
516
  // that cannot be dispatched is a NOT-RUN row a user paid to select, and rule
482
- // 15 makes that loud rather than silent. All five are claude-opus-5, so
517
+ // 15 makes that loud rather than silent. All five are claude-opus-5-5, so
483
518
  // `opus5_only` adds NO pair and the floor moves by exactly five.
484
519
  "templates/agents/orc-challenge-contrarian-opus-5-high.md",
485
520
  "templates/agents/orc-challenge-outsider-opus-5-low.md",
@@ -489,7 +524,7 @@ const required = [
489
524
  // v0.48.0 — the two /orc-doc agents. BOTH must ship: a write wave that cannot
490
525
  // dispatch the writer has nothing to assemble, and a check wave that cannot
491
526
  // dispatch the checker silently turns the only judgment step into the free
492
- // lint. Both are already Opus 5, so `opus5_only` adds no twin for either.
527
+ // lint. Both are already Opus 5.5, so `opus5_only` adds no twin for either.
493
528
  "templates/agents/orc-doc-writer-opus-5-med.md",
494
529
  "templates/agents/orc-doc-checker-opus-5-low.md",
495
530
  // v1.5.0 - /orc-test's two agents, and they are two INSTRUMENTS rather than
@@ -498,7 +533,7 @@ const required = [
498
533
  // interpreter is `low` because a harder-thinking interpreter reasons its way
499
534
  // to why a leaked stack trace is probably fine in staging, which is exactly
500
535
  // the gap it exists to find. Nothing may ever upgrade the interpreter. Both
501
- // are claude-opus-5, so `opus5_only` adds NO pair and the floor moves by two.
536
+ // are claude-opus-5-5, so `opus5_only` adds NO pair and the floor moves by two.
502
537
  "templates/agents/orc-test-designer-opus-5-high.md",
503
538
  "templates/agents/orc-test-interpreter-opus-5-low.md",
504
539
  // v1.2.1 — the status line explained for the person reading it, in
@@ -522,6 +557,9 @@ const required = [
522
557
  // the ORCHESTRATOR. Ships wired but OFF; `read_gate` arms it.
523
558
  "templates/hooks/orc-read-gate.js",
524
559
  "templates/hooks/orc-trace.js",
560
+ // v2.0.0 W6c — the session hook: the bell at a run's turn end (Q8, `notify`,
561
+ // off by default) and the run pointer after a compaction (Q9).
562
+ "templates/hooks/orc-session-hook.js",
525
563
  ];
526
564
 
527
565
  const missing = [];
@@ -569,7 +607,7 @@ const agentCount = walkCount(path.join(ROOT, "templates/agents"), ".md");
569
607
  // tier of the same one. The reader is `low` on purpose (a harder-thinking reader
570
608
  // papers over exactly the gaps D4 measures), the judge is `high` because D2 is
571
609
  // the only dimension no computer can reach, and the advisor is `medium` because
572
- // grouping findings is pattern work. All three are claude-opus-5, so `opus5_only`
610
+ // grouping findings is pattern work. All three are claude-opus-5-5, so `opus5_only`
573
611
  // adds NO pair and the floor moves by exactly three.
574
612
  // v0.48.0: +1 skill (orc-doc) and +2 agents. The split follows v0.47.0's rule —
575
613
  // an agent exists when it is a DIFFERENT INSTRUMENT, not a tier of the same one.
@@ -577,13 +615,13 @@ const agentCount = walkCount(path.join(ROOT, "templates/agents"), ".md");
577
615
  // LINE RANGE and has `Read` only. The checker is `low` on purpose (a
578
616
  // harder-thinking checker reasons its way past a gap a real reader would trip
579
617
  // on — the challenge cold reader's reasoning), so nothing may upgrade it. Both
580
- // are claude-opus-5, so `opus5_only` adds NO pair and the floor moves by two.
618
+ // are claude-opus-5-5, so `opus5_only` adds NO pair and the floor moves by two.
581
619
  // v0.49.1: +0 skills and +5 agents — THE COUNCIL. Same rule as v0.47.0, applied
582
620
  // five times: each of these is a DIFFERENT INSTRUMENT, not a tier of one. The
583
621
  // outsider is `low` and the contrarian is `high` for the same class of reason
584
622
  // the cold reader is `low` — effort here is a MEASUREMENT choice, not a cost
585
623
  // one, and a key that let either be tuned would be a key that let the
586
- // instrument be broken. All five are claude-opus-5, so `opus5_only` adds NO
624
+ // instrument be broken. All five are claude-opus-5-5, so `opus5_only` adds NO
587
625
  // pair and the floor moves by exactly five.
588
626
  // v1.0.0 W3: +0 skills and -5 agents — the Fable 5 role override is REMOVED.
589
627
  // It is the first time this floor has ever gone DOWN, and the reason it may is
@@ -624,13 +662,22 @@ function scanEncoding(dir, hits) {
624
662
  if (!fs.existsSync(dir)) return;
625
663
  const st = fs.statSync(dir);
626
664
  if (st.isFile()) {
627
- let text;
665
+ let buf;
628
666
  try {
629
- text = fs.readFileSync(dir, "utf8");
667
+ buf = fs.readFileSync(dir);
630
668
  } catch (_) {
631
669
  return; // unreadable → not our concern here
632
670
  }
633
671
  const rel = path.relative(ROOT, dir).replace(/\\/g, "/");
672
+ // v2.0.0 Q10 — a raw 0x00 byte. Grep and ripgrep then treat the WHOLE file as
673
+ // binary and stop reporting matches after it, so every agent that greps the
674
+ // file gets a partial answer. Write the "\u0000" escape instead.
675
+ const nul = buf.indexOf(0);
676
+ if (nul >= 0) {
677
+ hits.push(`${rel} (raw NUL byte at offset ${nul} — write the "\\u0000" escape)`);
678
+ return;
679
+ }
680
+ const text = buf.toString("utf8");
634
681
  // Reference U+FFFD via escape, never as a literal, so this scanner does not
635
682
  // flag its own source.
636
683
  if (text.includes(REPL)) hits.push(`${rel} (U+FFFD replacement char — corrupted bytes)`);
package/bin/webui/api.js CHANGED
@@ -453,6 +453,22 @@ const READS = {
453
453
  "/api/test/ui": () => ["test", "ui", "tools"],
454
454
  "/api/patterns": () => ["pattern", "status"],
455
455
  "/api/gotchas": () => ["gotcha", "list"],
456
+ // v2.0.0 W7 — the Behaviour panel. Every one is a CLI read, and every exit
457
+ // code is DATA: `habit show` 0 · 1 no ASK lines yet · 3 `habits: off`;
458
+ // `habit log` 0 · 1 empty; `gotcha card` 0 · 1 no match (an ANSWER: no card);
459
+ // `gotcha quality` 0 · 1 below the 5-review floor. The window is DROPPED
460
+ // unless it is one of the three the CLI knows — a query string is user input.
461
+ "/api/habits": (q) => (["30d", "90d", "all"].includes(String(q.window || "")) ? ["habit", "show", "--window", String(q.window)] : ["habit", "show"]),
462
+ "/api/habits/log": () => ["habit", "log", "--limit", "40"],
463
+ "/api/habits/states": () => ["habit", "log", "--states"],
464
+ "/api/habits/points": () => ["habit", "points"],
465
+ "/api/gotcha/card": (q) => ["gotcha", "card", "--files", String(q.files || ""), "--full"],
466
+ // The panel window (30d · 90d · all) in the days `gotcha quality --window` takes.
467
+ "/api/gotcha/quality": (q) => {
468
+ const days = { "30d": "30", "90d": "90", all: "3650" }[String(q.window || "")];
469
+ return days ? ["gotcha", "quality", "--window", days] : ["gotcha", "quality"];
470
+ },
471
+ "/api/gotcha/candidates": () => ["gotcha", "list", "--candidates"],
456
472
  "/api/stats": (q) => (q.since ? ["stats", "--since", String(q.since)] : ["stats"]),
457
473
  "/api/diy": () => ["diy", "show"],
458
474
  "/api/crosslink": () => ["crosslink", "list"],
@@ -555,6 +571,16 @@ const WRITES = {
555
571
  "/api/graph/update": () => ["graph", "update"],
556
572
  "/api/wiki/usage/rebuild": () => ["wiki", "usage", "--rebuild"],
557
573
  "/api/gotcha/prune": () => ["gotcha", "prune"],
574
+ // v2.0.0 W7 — the Behaviour panel writes. FREE, local and reversible: each
575
+ // one changes `.claude/orc/habits-state.json` only (or promotes ONE gotcha
576
+ // candidate), and each is a person's click on a confirmation that names the
577
+ // command. `--by panel` is how the history says who made the change. The
578
+ // learning switch itself is `/api/config/set` — no second route for it.
579
+ "/api/habit/accept": (b) => ["habit", "accept", String(b.id), "--by", "panel"],
580
+ "/api/habit/decline": (b) => (b.never ? ["habit", "decline", String(b.id), "--never", "--by", "panel"] : ["habit", "decline", String(b.id), "--by", "panel"]),
581
+ "/api/habit/forget": (b) => ["habit", "forget", String(b.id), "--by", "panel"],
582
+ "/api/habit/reset": (b) => ["habit", "reset", String(b.id), "--by", "panel"],
583
+ "/api/gotcha/accept": (b) => ["gotcha", "accept", String(b.id)],
558
584
  "/api/pact/check": (b) => (b.id ? ["pact", "check", String(b.id)] : ["pact", "check"]),
559
585
  "/api/pact/sync": () => ["pact", "sync"],
560
586
  // The surface id, the key and the value all come from the browser — and all