@azure-id/orc 0.55.0

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 (449) hide show
  1. package/CHANGELOG.md +2017 -0
  2. package/README-id.md +521 -0
  3. package/README.md +485 -0
  4. package/bin/build-agents.js +86 -0
  5. package/bin/cli.js +29050 -0
  6. package/bin/mockrun-catalog.js +267 -0
  7. package/bin/onboarding-content.js +172 -0
  8. package/bin/pricing.json +200 -0
  9. package/bin/providers.json +437 -0
  10. package/bin/ui.js +95 -0
  11. package/bin/verify-contracts.js +3277 -0
  12. package/bin/verify-package.js +498 -0
  13. package/bin/webui/api.js +1163 -0
  14. package/bin/webui/app.html +198 -0
  15. package/bin/webui/css/00-tokens.css +92 -0
  16. package/bin/webui/css/01-base.css +42 -0
  17. package/bin/webui/css/02-shell.css +103 -0
  18. package/bin/webui/css/03-components.css +462 -0
  19. package/bin/webui/css/04-motion.css +91 -0
  20. package/bin/webui/css/05-tour.css +100 -0
  21. package/bin/webui/css/06-responsive.css +108 -0
  22. package/bin/webui/css/panels/boundary.css +26 -0
  23. package/bin/webui/css/panels/challenge.css +151 -0
  24. package/bin/webui/css/panels/crosslink.css +194 -0
  25. package/bin/webui/css/panels/docs.css +254 -0
  26. package/bin/webui/css/panels/experiment.css +23 -0
  27. package/bin/webui/css/panels/extra.css +536 -0
  28. package/bin/webui/css/panels/flow.css +177 -0
  29. package/bin/webui/css/panels/handoff.css +67 -0
  30. package/bin/webui/css/panels/knowledge.css +86 -0
  31. package/bin/webui/css/panels/learn.css +154 -0
  32. package/bin/webui/css/panels/maintenance.css +55 -0
  33. package/bin/webui/css/panels/mockrun.css +268 -0
  34. package/bin/webui/css/panels/overview.css +100 -0
  35. package/bin/webui/css/panels/pact.css +43 -0
  36. package/bin/webui/css/panels/runs.css +105 -0
  37. package/bin/webui/css/panels/settings.css +227 -0
  38. package/bin/webui/css/panels/stats.css +87 -0
  39. package/bin/webui/fixtures/boundary.js +92 -0
  40. package/bin/webui/fixtures/challenge.js +825 -0
  41. package/bin/webui/fixtures/crosslink.js +31 -0
  42. package/bin/webui/fixtures/docs.js +982 -0
  43. package/bin/webui/fixtures/extra.js +1934 -0
  44. package/bin/webui/fixtures/flow.js +81 -0
  45. package/bin/webui/fixtures/handoff.js +35 -0
  46. package/bin/webui/fixtures/index.js +486 -0
  47. package/bin/webui/fixtures/knowledge.js +291 -0
  48. package/bin/webui/fixtures/maintenance.js +42 -0
  49. package/bin/webui/fixtures/mockrun.js +36 -0
  50. package/bin/webui/fixtures/pact.js +111 -0
  51. package/bin/webui/fixtures/runs.js +109 -0
  52. package/bin/webui/fixtures/settings.js +78 -0
  53. package/bin/webui/fixtures/shell.js +48 -0
  54. package/bin/webui/fixtures/stats.js +104 -0
  55. package/bin/webui/i18n/TERMS.md +134 -0
  56. package/bin/webui/i18n/en/banner.json +29 -0
  57. package/bin/webui/i18n/en/boundary.json +20 -0
  58. package/bin/webui/i18n/en/challenge.json +106 -0
  59. package/bin/webui/i18n/en/common.json +69 -0
  60. package/bin/webui/i18n/en/crosslink.json +69 -0
  61. package/bin/webui/i18n/en/docs.json +175 -0
  62. package/bin/webui/i18n/en/experiment.json +17 -0
  63. package/bin/webui/i18n/en/extra.json +313 -0
  64. package/bin/webui/i18n/en/flow.json +30 -0
  65. package/bin/webui/i18n/en/handoff.json +37 -0
  66. package/bin/webui/i18n/en/knowledge.json +141 -0
  67. package/bin/webui/i18n/en/learn.json +16 -0
  68. package/bin/webui/i18n/en/maintenance.json +52 -0
  69. package/bin/webui/i18n/en/mockrun.json +19 -0
  70. package/bin/webui/i18n/en/nav.json +19 -0
  71. package/bin/webui/i18n/en/overview.json +89 -0
  72. package/bin/webui/i18n/en/pact.json +36 -0
  73. package/bin/webui/i18n/en/runs.json +51 -0
  74. package/bin/webui/i18n/en/settings.json +49 -0
  75. package/bin/webui/i18n/en/stats.json +69 -0
  76. package/bin/webui/i18n/en/tour.json +33 -0
  77. package/bin/webui/i18n/id/banner.json +29 -0
  78. package/bin/webui/i18n/id/boundary.json +20 -0
  79. package/bin/webui/i18n/id/challenge.json +106 -0
  80. package/bin/webui/i18n/id/common.json +70 -0
  81. package/bin/webui/i18n/id/crosslink.json +69 -0
  82. package/bin/webui/i18n/id/docs.json +175 -0
  83. package/bin/webui/i18n/id/experiment.json +17 -0
  84. package/bin/webui/i18n/id/extra.json +313 -0
  85. package/bin/webui/i18n/id/flow.json +30 -0
  86. package/bin/webui/i18n/id/handoff.json +37 -0
  87. package/bin/webui/i18n/id/knowledge.json +141 -0
  88. package/bin/webui/i18n/id/learn.json +16 -0
  89. package/bin/webui/i18n/id/maintenance.json +52 -0
  90. package/bin/webui/i18n/id/mockrun.json +19 -0
  91. package/bin/webui/i18n/id/nav.json +19 -0
  92. package/bin/webui/i18n/id/overview.json +89 -0
  93. package/bin/webui/i18n/id/pact.json +36 -0
  94. package/bin/webui/i18n/id/runs.json +51 -0
  95. package/bin/webui/i18n/id/settings.json +49 -0
  96. package/bin/webui/i18n/id/stats.json +69 -0
  97. package/bin/webui/i18n/id/tour.json +33 -0
  98. package/bin/webui/js/00-core.js +115 -0
  99. package/bin/webui/js/01-i18n.js +149 -0
  100. package/bin/webui/js/02-ui.js +211 -0
  101. package/bin/webui/js/03-md.js +286 -0
  102. package/bin/webui/js/04-router.js +51 -0
  103. package/bin/webui/js/05-banners.js +172 -0
  104. package/bin/webui/js/06-edit.js +183 -0
  105. package/bin/webui/js/90-tour.js +488 -0
  106. package/bin/webui/js/91-shortcuts.js +126 -0
  107. package/bin/webui/js/99-boot.js +118 -0
  108. package/bin/webui/js/panels/boundary.js +104 -0
  109. package/bin/webui/js/panels/challenge.js +781 -0
  110. package/bin/webui/js/panels/crosslink.js +654 -0
  111. package/bin/webui/js/panels/docs.js +1338 -0
  112. package/bin/webui/js/panels/experiment.js +98 -0
  113. package/bin/webui/js/panels/extra.js +3011 -0
  114. package/bin/webui/js/panels/flow.js +297 -0
  115. package/bin/webui/js/panels/handoff.js +169 -0
  116. package/bin/webui/js/panels/knowledge.js +890 -0
  117. package/bin/webui/js/panels/learn.js +220 -0
  118. package/bin/webui/js/panels/maintenance.js +235 -0
  119. package/bin/webui/js/panels/mockrun.js +227 -0
  120. package/bin/webui/js/panels/overview.js +447 -0
  121. package/bin/webui/js/panels/pact.js +189 -0
  122. package/bin/webui/js/panels/runs.js +416 -0
  123. package/bin/webui/js/panels/settings.js +573 -0
  124. package/bin/webui/js/panels/stats.js +378 -0
  125. package/bin/webui/serve.js +557 -0
  126. package/mock-run/INDEX.md +106 -0
  127. package/mock-run/a-normal-day.md +587 -0
  128. package/mock-run/context-combiner.md +100 -0
  129. package/mock-run/extra-recovery.md +330 -0
  130. package/mock-run/extra-slots.md +177 -0
  131. package/mock-run/media/README.md +43 -0
  132. package/mock-run/orc-aftermath.md +392 -0
  133. package/mock-run/orc-boundary.md +356 -0
  134. package/mock-run/orc-brainstorm.md +177 -0
  135. package/mock-run/orc-budget.md +534 -0
  136. package/mock-run/orc-challenge-council.md +262 -0
  137. package/mock-run/orc-challenge.md +416 -0
  138. package/mock-run/orc-cli.md +200 -0
  139. package/mock-run/orc-diy.md +129 -0
  140. package/mock-run/orc-doc.md +448 -0
  141. package/mock-run/orc-explain.md +86 -0
  142. package/mock-run/orc-export.md +423 -0
  143. package/mock-run/orc-extra.md +392 -0
  144. package/mock-run/orc-fast.md +106 -0
  145. package/mock-run/orc-grill.md +151 -0
  146. package/mock-run/orc-handoff.md +480 -0
  147. package/mock-run/orc-pact.md +421 -0
  148. package/mock-run/orc-pattern.md +112 -0
  149. package/mock-run/orc-plan.md +108 -0
  150. package/mock-run/orc-pr-setup.md +126 -0
  151. package/mock-run/orc-quick.md +113 -0
  152. package/mock-run/orc-route.md +93 -0
  153. package/mock-run/orc-ui.md +125 -0
  154. package/mock-run/orc-ultra.md +103 -0
  155. package/mock-run/orc.md +157 -0
  156. package/mock-run/the-example-project.md +55 -0
  157. package/package.json +39 -0
  158. package/templates/agents/MODEL-MAPPING.md +168 -0
  159. package/templates/agents/orc-advisor-fable-5.md +50 -0
  160. package/templates/agents/orc-advisor-opus-5-xhigh.md +56 -0
  161. package/templates/agents/orc-analyst-fable-5.md +115 -0
  162. package/templates/agents/orc-analyze-mini-opus-5-med.md +60 -0
  163. package/templates/agents/orc-analyze-mini-sonnet-5-high.md +58 -0
  164. package/templates/agents/orc-challenge-advisor-opus-5-med.md +75 -0
  165. package/templates/agents/orc-challenge-contrarian-opus-5-high.md +110 -0
  166. package/templates/agents/orc-challenge-executor-opus-5-med.md +114 -0
  167. package/templates/agents/orc-challenge-expansionist-opus-5-med.md +112 -0
  168. package/templates/agents/orc-challenge-judge-opus-5-high.md +132 -0
  169. package/templates/agents/orc-challenge-outsider-opus-5-low.md +109 -0
  170. package/templates/agents/orc-challenge-principles-opus-5-high.md +109 -0
  171. package/templates/agents/orc-challenge-reader-opus-5-low.md +90 -0
  172. package/templates/agents/orc-claude-writer-opus-4-8-high.md +53 -0
  173. package/templates/agents/orc-claude-writer-opus-5-med.md +55 -0
  174. package/templates/agents/orc-context-combiner-opus-5-high.md +88 -0
  175. package/templates/agents/orc-doc-checker-opus-5-low.md +108 -0
  176. package/templates/agents/orc-doc-writer-opus-5-med.md +134 -0
  177. package/templates/agents/orc-executor-haiku-4-5.md +113 -0
  178. package/templates/agents/orc-executor-opus-4-7-high.md +114 -0
  179. package/templates/agents/orc-executor-opus-4-7-med.md +114 -0
  180. package/templates/agents/orc-executor-opus-4-8-high.md +114 -0
  181. package/templates/agents/orc-executor-opus-5-high.md +114 -0
  182. package/templates/agents/orc-executor-opus-5-low.md +114 -0
  183. package/templates/agents/orc-executor-opus-5-med.md +114 -0
  184. package/templates/agents/orc-executor-sonnet-4-6-high.md +114 -0
  185. package/templates/agents/orc-executor-sonnet-4-6-med.md +114 -0
  186. package/templates/agents/orc-executor-sonnet-5-high.md +114 -0
  187. package/templates/agents/orc-judge-fable-5.md +79 -0
  188. package/templates/agents/orc-judge-opus-5-xhigh.md +85 -0
  189. package/templates/agents/orc-learn-writer-opus-5-low.md +73 -0
  190. package/templates/agents/orc-pattern-codifier-opus-5-med.md +65 -0
  191. package/templates/agents/orc-pattern-codifier-sonnet-5-high.md +63 -0
  192. package/templates/agents/orc-planner-fable-5.md +152 -0
  193. package/templates/agents/orc-planner-mini-opus-5-med.md +69 -0
  194. package/templates/agents/orc-planner-mini-sonnet-5-high.md +67 -0
  195. package/templates/agents/orc-planner-opus-5-med.md +160 -0
  196. package/templates/agents/orc-retro-opus-5-med.md +73 -0
  197. package/templates/agents/orc-retro-sonnet-5-high.md +72 -0
  198. package/templates/agents/orc-reviewer-fable-5.md +57 -0
  199. package/templates/agents/orc-reviewer-opus-5-med.md +60 -0
  200. package/templates/agents/orc-scout-opus-5-low.md +40 -0
  201. package/templates/agents/orc-scout-sonnet-4-6-high.md +39 -0
  202. package/templates/agents/orc-system-analyst-opus-5-high.md +120 -0
  203. package/templates/agents/orc-test-author-opus-5-med.md +71 -0
  204. package/templates/agents/orc-trace-writer-haiku-4-5.md +107 -0
  205. package/templates/agents/orc-verifier-opus-5-med.md +69 -0
  206. package/templates/agents/orc-wiki-scanner-opus-4-8-high.md +79 -0
  207. package/templates/agents/orc-wiki-scanner-opus-5-med.md +81 -0
  208. package/templates/agents/orc-wiki-scanner-sonnet-5-high.md +106 -0
  209. package/templates/commands/orc-aftermath.md +49 -0
  210. package/templates/commands/orc-analyze.md +21 -0
  211. package/templates/commands/orc-boundary.md +46 -0
  212. package/templates/commands/orc-brainstorm.md +51 -0
  213. package/templates/commands/orc-budget.md +54 -0
  214. package/templates/commands/orc-challenge.md +58 -0
  215. package/templates/commands/orc-claude.md +14 -0
  216. package/templates/commands/orc-diy.md +13 -0
  217. package/templates/commands/orc-doc.md +128 -0
  218. package/templates/commands/orc-explain.md +20 -0
  219. package/templates/commands/orc-export.md +46 -0
  220. package/templates/commands/orc-fast.md +15 -0
  221. package/templates/commands/orc-grill.md +40 -0
  222. package/templates/commands/orc-handoff.md +52 -0
  223. package/templates/commands/orc-learn.md +17 -0
  224. package/templates/commands/orc-mini.md +12 -0
  225. package/templates/commands/orc-pact.md +44 -0
  226. package/templates/commands/orc-pattern.md +15 -0
  227. package/templates/commands/orc-plan.md +22 -0
  228. package/templates/commands/orc-poly.md +21 -0
  229. package/templates/commands/orc-pr-driver.md +30 -0
  230. package/templates/commands/orc-pr-setup.md +31 -0
  231. package/templates/commands/orc-quick.md +33 -0
  232. package/templates/commands/orc-retro.md +17 -0
  233. package/templates/commands/orc-route.md +41 -0
  234. package/templates/commands/orc-ultra.md +17 -0
  235. package/templates/commands/orc-verify.md +11 -0
  236. package/templates/commands/orc-wiki.md +42 -0
  237. package/templates/commands/orc.md +16 -0
  238. package/templates/hooks/orc-effort-guard.js +178 -0
  239. package/templates/hooks/orc-statusline.js +305 -0
  240. package/templates/hooks/orc-trace.js +471 -0
  241. package/templates/hooks/orc-update-lib.js +125 -0
  242. package/templates/skills/_shared/README.md +50 -0
  243. package/templates/skills/_shared/detecting-artifacts.md +90 -0
  244. package/templates/skills/_shared/drift-recovery.md +98 -0
  245. package/templates/skills/_shared/extra-dispatch.md +1051 -0
  246. package/templates/skills/_shared/fable5-override.md +56 -0
  247. package/templates/skills/_shared/fallback-handoff.md +42 -0
  248. package/templates/skills/_shared/gh-stack-commands.md +65 -0
  249. package/templates/skills/_shared/gotchas.md +177 -0
  250. package/templates/skills/_shared/interview.md +144 -0
  251. package/templates/skills/_shared/lane-suspend.md +82 -0
  252. package/templates/skills/_shared/opus5-only.md +131 -0
  253. package/templates/skills/_shared/pr-templates.md +106 -0
  254. package/templates/skills/_shared/read-ladder.md +54 -0
  255. package/templates/skills/_shared/return-validation.md +145 -0
  256. package/templates/skills/_shared/smoke-gate.md +28 -0
  257. package/templates/skills/_shared/stack-plan.md +135 -0
  258. package/templates/skills/_shared/untrusted-input.md +63 -0
  259. package/templates/skills/context-combiner/SKILL.md +187 -0
  260. package/templates/skills/context-combiner/schemas/combined-report.md +78 -0
  261. package/templates/skills/context-combiner/schemas/combined-requirement-spec.md +87 -0
  262. package/templates/skills/orc/README.md +150 -0
  263. package/templates/skills/orc/SKILL.md +526 -0
  264. package/templates/skills/orc/config.md +389 -0
  265. package/templates/skills/orc/examples/full-run-mock.md +73 -0
  266. package/templates/skills/orc/references/analyst-gates.md +124 -0
  267. package/templates/skills/orc/references/effort-and-mode.md +224 -0
  268. package/templates/skills/orc/references/house-rules.md +20 -0
  269. package/templates/skills/orc/references/intake.md +120 -0
  270. package/templates/skills/orc/references/log-protocol.md +39 -0
  271. package/templates/skills/orc/references/pattern-gate.md +89 -0
  272. package/templates/skills/orc/references/plan-handoff.md +84 -0
  273. package/templates/skills/orc/references/preflight-report.md +220 -0
  274. package/templates/skills/orc/references/security-checklist.md +39 -0
  275. package/templates/skills/orc/references/stop-and-resume.md +160 -0
  276. package/templates/skills/orc/references/trace-protocol.md +314 -0
  277. package/templates/skills/orc/references/ultra-mode.md +123 -0
  278. package/templates/skills/orc/references/wave-grouping.md +121 -0
  279. package/templates/skills/orc/references/wiki-consult.md +177 -0
  280. package/templates/skills/orc/schemas/checkpoint.md +122 -0
  281. package/templates/skills/orc/schemas/intent-spec.md +42 -0
  282. package/templates/skills/orc/schemas/planning-output.md +279 -0
  283. package/templates/skills/orc/subskills/orc-checkpoint/SKILL.md +55 -0
  284. package/templates/skills/orc/subskills/orc-execution/SKILL.md +72 -0
  285. package/templates/skills/orc/subskills/orc-execution/core.md +151 -0
  286. package/templates/skills/orc/subskills/orc-execution/subagent.md +13 -0
  287. package/templates/skills/orc/subskills/orc-planner/SKILL.md +264 -0
  288. package/templates/skills/orc/subskills/orc-planner-mini/SKILL.md +121 -0
  289. package/templates/skills/orc/subskills/orc-pr/SKILL.md +51 -0
  290. package/templates/skills/orc/subskills/orc-pr/pr.md +22 -0
  291. package/templates/skills/orc/subskills/orc-pr/stack-gate.md +108 -0
  292. package/templates/skills/orc/subskills/orc-review-verify/SKILL.md +76 -0
  293. package/templates/skills/orc/subskills/orc-review-verify/core.md +135 -0
  294. package/templates/skills/orc/subskills/orc-review-verify/subagent.md +7 -0
  295. package/templates/skills/orc/subskills/orc-testgen/SKILL.md +45 -0
  296. package/templates/skills/orc/subskills/orc-testgen/core.md +59 -0
  297. package/templates/skills/orc/subskills/orc-testgen/subagent.md +7 -0
  298. package/templates/skills/orc-advisor/SKILL.md +60 -0
  299. package/templates/skills/orc-aftermath/SKILL.md +136 -0
  300. package/templates/skills/orc-aftermath/references/report.md +95 -0
  301. package/templates/skills/orc-analyze/SKILL.md +220 -0
  302. package/templates/skills/orc-analyze/examples/analyze-mock.md +42 -0
  303. package/templates/skills/orc-analyze/references/branching.md +51 -0
  304. package/templates/skills/orc-analyze/references/deep-mode.md +27 -0
  305. package/templates/skills/orc-analyze/references/thin-input.md +77 -0
  306. package/templates/skills/orc-analyze/schemas/report-audit.md +83 -0
  307. package/templates/skills/orc-analyze/schemas/report-prose.md +63 -0
  308. package/templates/skills/orc-analyze/schemas/report-requirement.md +78 -0
  309. package/templates/skills/orc-analyze/schemas/requirement-spec.md +77 -0
  310. package/templates/skills/orc-analyze-mini/SKILL.md +112 -0
  311. package/templates/skills/orc-analyze-mini/examples/quick-analysis-mock.md +31 -0
  312. package/templates/skills/orc-boundary/SKILL.md +208 -0
  313. package/templates/skills/orc-boundary/references/card.md +78 -0
  314. package/templates/skills/orc-boundary/references/gate.md +113 -0
  315. package/templates/skills/orc-brainstorm/SKILL.md +339 -0
  316. package/templates/skills/orc-brainstorm/references/brainstorm-doc.md +133 -0
  317. package/templates/skills/orc-brainstorm/references/lenses.md +152 -0
  318. package/templates/skills/orc-budget/SKILL.md +225 -0
  319. package/templates/skills/orc-budget/references/corpus.md +87 -0
  320. package/templates/skills/orc-challenge/README.md +142 -0
  321. package/templates/skills/orc-challenge/SKILL.md +255 -0
  322. package/templates/skills/orc-challenge/examples/code-module.md +110 -0
  323. package/templates/skills/orc-challenge/examples/council-full-roster.md +273 -0
  324. package/templates/skills/orc-challenge/examples/tsd-two-iterations.md +213 -0
  325. package/templates/skills/orc-challenge/references/conservation.md +107 -0
  326. package/templates/skills/orc-challenge/references/council.md +315 -0
  327. package/templates/skills/orc-challenge/references/cycle-state.md +185 -0
  328. package/templates/skills/orc-challenge/references/dimensions.md +121 -0
  329. package/templates/skills/orc-challenge/references/fix-brief.md +130 -0
  330. package/templates/skills/orc-challenge/references/intake.md +171 -0
  331. package/templates/skills/orc-challenge/references/kinds.md +44 -0
  332. package/templates/skills/orc-challenge/references/plain-english.md +98 -0
  333. package/templates/skills/orc-challenge/references/rubric.md +109 -0
  334. package/templates/skills/orc-challenge/references/sealed-slice.md +97 -0
  335. package/templates/skills/orc-challenge/references/verdict-doc.md +154 -0
  336. package/templates/skills/orc-claude/SKILL.md +199 -0
  337. package/templates/skills/orc-claude/examples/claude-run-mock.md +65 -0
  338. package/templates/skills/orc-claude/references/refresh.md +76 -0
  339. package/templates/skills/orc-claude/references/template.md +109 -0
  340. package/templates/skills/orc-diy/README.md +142 -0
  341. package/templates/skills/orc-diy/SKILL.md +70 -0
  342. package/templates/skills/orc-diy/references/blocks/analyze.md +24 -0
  343. package/templates/skills/orc-diy/references/blocks/execution.md +42 -0
  344. package/templates/skills/orc-diy/references/blocks/extra.md +55 -0
  345. package/templates/skills/orc-diy/references/blocks/header.md +55 -0
  346. package/templates/skills/orc-diy/references/blocks/mock-example.md +22 -0
  347. package/templates/skills/orc-diy/references/blocks/pattern.md +18 -0
  348. package/templates/skills/orc-diy/references/blocks/planning.md +34 -0
  349. package/templates/skills/orc-diy/references/blocks/review.md +18 -0
  350. package/templates/skills/orc-diy/references/blocks/scoring.md +16 -0
  351. package/templates/skills/orc-diy/references/blocks/security.md +25 -0
  352. package/templates/skills/orc-diy/references/blocks/ship.md +25 -0
  353. package/templates/skills/orc-diy/references/blocks/summary.md +18 -0
  354. package/templates/skills/orc-diy/references/blocks/testgen.md +17 -0
  355. package/templates/skills/orc-diy/references/blocks/trace.md +28 -0
  356. package/templates/skills/orc-diy/references/blocks/verify.md +25 -0
  357. package/templates/skills/orc-diy/references/blocks/wiki.md +26 -0
  358. package/templates/skills/orc-diy/references/compile.md +59 -0
  359. package/templates/skills/orc-diy/references/flow-schema.md +100 -0
  360. package/templates/skills/orc-diy/references/locked-blocks.md +37 -0
  361. package/templates/skills/orc-doc/README.md +229 -0
  362. package/templates/skills/orc-doc/SKILL.md +444 -0
  363. package/templates/skills/orc-doc/examples/orc-doc-prd-run.md +325 -0
  364. package/templates/skills/orc-doc/references/chunking.md +527 -0
  365. package/templates/skills/orc-doc/references/gates.md +311 -0
  366. package/templates/skills/orc-doc/references/generation-rules.md +122 -0
  367. package/templates/skills/orc-doc/references/house-rules.md +170 -0
  368. package/templates/skills/orc-doc/references/import-targets.md +40 -0
  369. package/templates/skills/orc-doc/references/plain-language.md +66 -0
  370. package/templates/skills/orc-doc/references/portable-markdown.md +74 -0
  371. package/templates/skills/orc-doc/references/resume-protocol.md +228 -0
  372. package/templates/skills/orc-doc/references/templates/collaboration.md +118 -0
  373. package/templates/skills/orc-doc/references/templates/prd.md +133 -0
  374. package/templates/skills/orc-doc/references/templates/report.md +102 -0
  375. package/templates/skills/orc-doc/references/templates/tsd.md +122 -0
  376. package/templates/skills/orc-doc/references/templates/workflow.md +112 -0
  377. package/templates/skills/orc-explain/SKILL.md +57 -0
  378. package/templates/skills/orc-export/SKILL.md +154 -0
  379. package/templates/skills/orc-fast/SKILL.md +188 -0
  380. package/templates/skills/orc-grill/SKILL.md +207 -0
  381. package/templates/skills/orc-grill/references/grill-doc.md +105 -0
  382. package/templates/skills/orc-handoff/SKILL.md +204 -0
  383. package/templates/skills/orc-handoff/references/handoff-log.md +67 -0
  384. package/templates/skills/orc-handoff/references/surfaces.md +88 -0
  385. package/templates/skills/orc-judge/SKILL.md +82 -0
  386. package/templates/skills/orc-learn/SKILL.md +156 -0
  387. package/templates/skills/orc-learn/examples/learn-run-mock.md +61 -0
  388. package/templates/skills/orc-learn/references/deepen.md +70 -0
  389. package/templates/skills/orc-learn/references/refresh.md +65 -0
  390. package/templates/skills/orc-learn/references/template-knowledge.md +83 -0
  391. package/templates/skills/orc-learn/references/template-learning.md +67 -0
  392. package/templates/skills/orc-mini/SKILL.md +226 -0
  393. package/templates/skills/orc-mini/examples/mini-run-mock.md +50 -0
  394. package/templates/skills/orc-pact/SKILL.md +218 -0
  395. package/templates/skills/orc-pact/references/gate.md +70 -0
  396. package/templates/skills/orc-pact/references/ledger.md +99 -0
  397. package/templates/skills/orc-pattern/SKILL.md +124 -0
  398. package/templates/skills/orc-pattern/references/INDEX.md +73 -0
  399. package/templates/skills/orc-pattern/references/be-django.md +80 -0
  400. package/templates/skills/orc-pattern/references/be-express.md +82 -0
  401. package/templates/skills/orc-pattern/references/be-fastapi.md +107 -0
  402. package/templates/skills/orc-pattern/references/be-go.md +96 -0
  403. package/templates/skills/orc-pattern/references/be-nestjs.md +86 -0
  404. package/templates/skills/orc-pattern/references/be-postgres.md +98 -0
  405. package/templates/skills/orc-pattern/references/fe-a11y.md +36 -0
  406. package/templates/skills/orc-pattern/references/fe-angular.md +87 -0
  407. package/templates/skills/orc-pattern/references/fe-nextjs.md +65 -0
  408. package/templates/skills/orc-pattern/references/fe-perf.md +39 -0
  409. package/templates/skills/orc-pattern/references/fe-react.md +83 -0
  410. package/templates/skills/orc-pattern/references/fe-vue.md +75 -0
  411. package/templates/skills/orc-pattern/schemas/pattern-doc.md +62 -0
  412. package/templates/skills/orc-poly/SKILL.md +216 -0
  413. package/templates/skills/orc-poly/examples/poly-run-mock.md +51 -0
  414. package/templates/skills/orc-poly/references/gather.md +70 -0
  415. package/templates/skills/orc-poly/references/poly-spec.md +84 -0
  416. package/templates/skills/orc-pr-driver/README.md +349 -0
  417. package/templates/skills/orc-pr-driver/SKILL.md +167 -0
  418. package/templates/skills/orc-pr-driver/references/conflict-playbook.md +78 -0
  419. package/templates/skills/orc-pr-driver/references/green-gate.md +105 -0
  420. package/templates/skills/orc-pr-driver/references/orc-run-split.md +99 -0
  421. package/templates/skills/orc-pr-setup/README.md +436 -0
  422. package/templates/skills/orc-pr-setup/SKILL.md +184 -0
  423. package/templates/skills/orc-pr-setup/references/certainty-gate.md +66 -0
  424. package/templates/skills/orc-pr-setup/references/layer-taxonomy.md +67 -0
  425. package/templates/skills/orc-quick/README.md +423 -0
  426. package/templates/skills/orc-quick/SKILL.md +306 -0
  427. package/templates/skills/orc-quick/references/context-doc.md +114 -0
  428. package/templates/skills/orc-quick/references/dispatch-gate.md +163 -0
  429. package/templates/skills/orc-quick/references/gh-mode.md +127 -0
  430. package/templates/skills/orc-retro/SKILL.md +222 -0
  431. package/templates/skills/orc-retro/examples/retro-mock.md +171 -0
  432. package/templates/skills/orc-route/SKILL.md +165 -0
  433. package/templates/skills/orc-verify/SKILL.md +86 -0
  434. package/templates/skills/orc-verify/examples/verify-mock.md +33 -0
  435. package/templates/skills/orc-wiki/README.md +325 -0
  436. package/templates/skills/orc-wiki/SKILL.md +322 -0
  437. package/templates/skills/orc-wiki/examples/wiki-run-mock.md +37 -0
  438. package/templates/skills/orc-wiki/references/claude-md-injection.md +61 -0
  439. package/templates/skills/orc-wiki/references/crosslink-compile.md +39 -0
  440. package/templates/skills/orc-wiki/references/crosslink-kinds.md +57 -0
  441. package/templates/skills/orc-wiki/references/crosslink.md +284 -0
  442. package/templates/skills/orc-wiki/references/extra.md +79 -0
  443. package/templates/skills/orc-wiki/references/integrity-check.md +86 -0
  444. package/templates/skills/orc-wiki/references/orientation.md +51 -0
  445. package/templates/skills/orc-wiki/references/partial-refresh.md +203 -0
  446. package/templates/skills/orc-wiki/references/pattern-prewarm.md +19 -0
  447. package/templates/skills/orc-wiki/references/staleness.md +288 -0
  448. package/templates/skills/orc-wiki/schemas/crosslink-tag.md +166 -0
  449. package/templates/skills/orc-wiki/schemas/wiki-doc.md +120 -0
@@ -0,0 +1,447 @@
1
+ "use strict";
2
+ /* panels/overview.js — orc ui client
3
+ FINDING_ROUTE (a caution routes to the panel that can CLEAR it), the
4
+ attention list, the stat tiles.
5
+
6
+ Loaded by app.html in the order its numeric prefix names. Classic
7
+ script, no import/export: an ES module import carries no query string,
8
+ and every static request here needs the per-launch session token. */
9
+
10
+
11
+ /* ================================================================ OVERVIEW == */
12
+
13
+ /* WHERE A PROBLEM IS ACTUALLY FIXED (v0.43.6).
14
+ `orc doctor` reports every problem in one list, and the panel used to send
15
+ the whole list to Maintenance with a single "Open Maintenance" button. That
16
+ is right for the install-footprint findings — version skew, orphans, missing
17
+ files, unwired hooks — because `orc update` / `doctor --fix` really is where
18
+ those are repaired. It was WRONG for the ones whose fix lives on another
19
+ panel, and `diy-stale` was the one people hit: the flow is recompiled with
20
+ `orc diy compile`, which is a button on FLOW. Sending them to Maintenance
21
+ pointed at a page with no control for the thing it was complaining about.
22
+
23
+ So the routing is a table keyed on the finding id the CLI already emits.
24
+ `null` means there is nothing to press anywhere — a dangling trace pointer
25
+ clears itself on the next run, and offering a button for it would be a lie. */
26
+ const FINDING_ROUTE = {
27
+ "diy-stale": { panel: "flow", cta: "overview.item.diyStale.cta" },
28
+ "trace-pointer-dangling": { panel: null },
29
+ // v0.46.0. Correct by the rule, not by default: `export-stale` is cleared by
30
+ // `orc export`, which IS a CLI write Maintenance can run — so Maintenance is
31
+ // genuinely the panel that can clear it, not merely the fallback.
32
+ "export-stale": { panel: "maintenance", cta: "overview.item.exportStale.cta" },
33
+ "pact-broken": { panel: "pact", cta: "overview.item.pactBroken.cta" },
34
+ // v0.48.1. Same rule again: `orc doc audit` and `orc doc ship` are both on
35
+ // DOCS, so that is where a drifted document has to send you.
36
+ "doc-drifted": { panel: "docs", cta: "overview.item.docDrifted.cta" },
37
+ "boundary-refuse": { panel: "boundary", cta: "overview.item.boundaryRefuse.cta" },
38
+ // v0.49.1. Same rule a third time. `orc wiki sync` is a BUTTON on Knowledge
39
+ // and it is free, and `orc wiki plan` (which ranks the refresh) is the card
40
+ // directly above it — so Knowledge is genuinely the panel that can clear
41
+ // both, not merely the fallback.
42
+ "wiki-unregistered": { panel: "knowledge", cta: "overview.item.wikiUnregistered.cta" },
43
+ "wiki-debt": { panel: "knowledge", cta: "overview.item.wikiDebt.cta" },
44
+ // v0.50.0. `orc doctor` collapses the whole `orc extra` subsystem into ONE
45
+ // finding carrying the count and the ids — a doctor that recited eleven ids
46
+ // for a subsystem most repos never arm is a doctor people learn to scroll
47
+ // past. It routes to Extra because that is where every one of them is
48
+ // rendered beside the connection it is about, and where the connection test
49
+ // that clears most of them lives.
50
+ "extra-findings": { panel: "extra", cta: "overview.item.extraFindings.cta" },
51
+ };
52
+ const DEFAULT_FINDING_ROUTE = { panel: "maintenance", cta: "overview.item.doctor.cta" };
53
+ const findingRoute = (id) => FINDING_ROUTE[id] || DEFAULT_FINDING_ROUTE;
54
+
55
+ PANELS.overview = function (host) {
56
+ head(host, t("overview.title"), t("overview.sub"));
57
+ section(
58
+ host,
59
+ () => read("/api/overview").then((r) => r.data),
60
+ (d) => {
61
+ const out = frag();
62
+ const doctor = d.doctor || {};
63
+ const w = d.wiki || {};
64
+ const p = d.patterns || {};
65
+ // Rows since v0.49.2: `{ slug, updated_ms, lane }`. Everything that only
66
+ // wants a count still reads `.length`.
67
+ const waiting = d.waiting || [];
68
+ const findings = doctor.findings || [];
69
+
70
+ /* --- the tiles ------------------------------------------------------ */
71
+ const stats = el("div", "grid grid-3");
72
+ stats.append(
73
+ statTile(
74
+ t("overview.tile.install"),
75
+ doctor.ok ? t("overview.tile.installHealthy") : tn(findings.length, "overview.tile.installIssues"),
76
+ doctor.installed_version
77
+ ? t("overview.tile.installNote", { payload: doctor.installed_version, cli: doctor.package_version })
78
+ : "",
79
+ doctor.ok ? "ok" : "warn",
80
+ doctor.ok ? null : "maintenance"
81
+ )
82
+ );
83
+ stats.append(
84
+ statTile(
85
+ t("overview.tile.wiki"),
86
+ // TIER and STATE are CLI vocabulary (FRESH / AGING / STALE /
87
+ // unregistered) — the words the docs and every other lane use. They
88
+ // are shown as-is in both languages; only the sentence under them is
89
+ // translated.
90
+ w.state === "registered" ? w.tier || t("overview.tile.wikiUnknown") : String(w.state || "none").toUpperCase(),
91
+ w.state === "registered"
92
+ ? t("overview.tile.wikiNote", { docs: w.docs, scan: w.last_scan || "?" })
93
+ : t("overview.tile.wikiNone"),
94
+ w.tier === "FRESH" ? "ok" : w.tier === "AGING" ? "warn" : w.state === "none" ? "" : "bad",
95
+ "knowledge"
96
+ )
97
+ );
98
+ stats.append(
99
+ statTile(
100
+ t("overview.tile.waiting"),
101
+ String(waiting.length),
102
+ t("overview.tile.waitingNote", { n: d.runs_total || 0 }),
103
+ waiting.length ? "warn" : "ok",
104
+ "runs"
105
+ )
106
+ );
107
+ const langs = (p.patterns || []).map((x) => x.lang);
108
+ stats.append(
109
+ statTile(
110
+ t("overview.tile.patterns"),
111
+ String(langs.length),
112
+ langs.length ? langs.join(", ") : t("overview.tile.patternsNone"),
113
+ langs.length ? "ok" : "",
114
+ "knowledge"
115
+ )
116
+ );
117
+
118
+ /* v0.46.0 — three chips repeating the CLI's OWN state words. A chip with
119
+ nothing to say still renders its good state: an absent chip and a
120
+ healthy one must never look the same. */
121
+ const pc = d.pact;
122
+ const bc = d.boundary;
123
+ const wd = d.wiki_debt;
124
+ stats.append(
125
+ statTile(
126
+ t("overview.tile.pact"),
127
+ pc && pc.ok
128
+ ? (pc.counts.BROKEN ? pc.counts.BROKEN + " BROKEN" : pc.counts.DRIFTED ? pc.counts.DRIFTED + " DRIFTED" : pc.counts.HOLDING + " HOLDING")
129
+ : t("overview.tile.none"),
130
+ pc && pc.ok ? t("overview.tile.pactNote", { n: pc.entries, u: pc.counts.UNCHECKABLE }) : t("overview.tile.pactNone"),
131
+ pc && pc.ok ? (pc.counts.BROKEN ? "bad" : pc.counts.DRIFTED ? "warn" : "ok") : "",
132
+ pc && pc.ok ? "pact" : null
133
+ )
134
+ );
135
+ stats.append(
136
+ statTile(
137
+ t("overview.tile.boundary"),
138
+ bc && bc.cards && bc.cards.length
139
+ ? (bc.counts.REFUSE ? bc.counts.REFUSE + " REFUSE" : bc.counts.ESCALATE ? bc.counts.ESCALATE + " ESCALATE" : bc.counts.EXECUTE + " EXECUTE")
140
+ : t("overview.tile.none"),
141
+ bc && bc.cards && bc.cards.length ? t("overview.tile.boundaryNote", { n: bc.cards.length, stale: bc.stale }) : t("overview.tile.boundaryNone"),
142
+ bc && bc.cards && bc.cards.length ? (bc.counts.REFUSE ? "bad" : bc.counts.ESCALATE ? "warn" : "ok") : "",
143
+ bc && bc.cards && bc.cards.length ? "boundary" : null
144
+ )
145
+ );
146
+ stats.append(
147
+ statTile(
148
+ t("overview.tile.debt"),
149
+ wd && wd.ok && wd.pending ? String(wd.pending) : "0",
150
+ wd && wd.ok && wd.pending
151
+ ? t("overview.tile.debtNote", { tier: wd.tier, tok: kTokUi((wd.tokens || {}).input + (wd.tokens || {}).cache_write + (wd.tokens || {}).cache_read + (wd.tokens || {}).output) })
152
+ : t("overview.tile.debtNone"),
153
+ wd && wd.ok && wd.pending ? "warn" : "ok",
154
+ "knowledge"
155
+ )
156
+ );
157
+
158
+ // The version check crosses the network, so it must never hold up the
159
+ // tiles beside it: the tile renders in its pending state and fills itself
160
+ // in when the answer lands.
161
+ const vt = statTile(t("overview.tile.version"), t("common.checking"), t("overview.tile.versionChecking"), "");
162
+ vt.classList.add("stat-pending");
163
+ stats.append(vt);
164
+ versionInfo()
165
+ .then((v) => {
166
+ const s = versionState(v);
167
+ vt.classList.remove("stat-pending");
168
+ vt.replaceChildren();
169
+ vt.append(el("div", "stat-label", t("overview.tile.version")));
170
+ const val = el("div", "stat-value" + (s.kind ? " stat-" + s.kind : ""));
171
+ val.append(document.createTextNode(v && v.version ? "v" + v.version : "?"), chip(s.label, s.kind));
172
+ vt.append(val, el("div", "stat-note", s.note));
173
+ })
174
+ .catch(() => {
175
+ vt.classList.remove("stat-pending");
176
+ vt.replaceChildren(
177
+ el("div", "stat-label", t("overview.tile.version")),
178
+ el("div", "stat-value", "?"),
179
+ el("div", "stat-note", t("overview.tile.versionFailed"))
180
+ );
181
+ });
182
+ out.append(stats);
183
+
184
+ /* --- worth doing ----------------------------------------------------
185
+ One list, in severity order, of everything that wants a decision — and
186
+ every row carries the panel where the fix actually is. This is the
187
+ panel's answer to "what now", and it is the only place the wiki tier
188
+ turns into advice instead of a colour. */
189
+ out.append(attentionCard(d, findings));
190
+
191
+ /* --- waiting runs --------------------------------------------------- */
192
+ if (waiting.length) {
193
+ const c = card(t("overview.waiting.title"));
194
+ c.append(el("div", "note", t("overview.waiting.note")));
195
+ const list = el("div", "run-list");
196
+ for (const r of waiting) {
197
+ // The CARD CONTRACT (v0.49.2). `.run-card` is a four-column grid —
198
+ // caret, chip, mid, age — and this row used to append three children
199
+ // with no caret, so the chip landed in the 16px caret column and
200
+ // printed over an 88px-wide slug. One column short is not a rounding
201
+ // error; it is the whole card. This row navigates rather than expands,
202
+ // so it declares `.no-caret` and fills the three columns that variant
203
+ // has, in order.
204
+ const b = el("button", "run-card no-caret");
205
+ b.type = "button";
206
+ b.append(chip("waiting", "warn"));
207
+ const mid = el("div", "run-mid");
208
+ mid.append(el("div", "run-slug", r.slug));
209
+ mid.append(el("div", "run-where", r.lane ? r.lane + " · " + t("overview.waiting.where") : t("overview.waiting.where")));
210
+ b.append(mid, el("div", "run-age", r.updated_ms ? t("overview.waiting.since", { age: relAge(r.updated_ms) }) : ""));
211
+ b.addEventListener("click", () => {
212
+ location.hash = "#/runs?slug=" + encodeURIComponent(r.slug);
213
+ });
214
+ list.append(b);
215
+ // A CAUTION ROUTES TO THE PANEL THAT CAN CLEAR IT — and here the panel
216
+ // that can clear it is this one. A waiting run is what blocks the
217
+ // upgrade preview, so the way out sits beside the thing complaining.
218
+ const done = el("button", "btn btn-sm btn-ghost", t("runs.close.button"));
219
+ done.type = "button";
220
+ done.addEventListener("click", (ev) => {
221
+ ev.stopPropagation();
222
+ confirmRunClose(r.slug, () => route());
223
+ });
224
+ const act = el("div", "row-actions run-card-actions");
225
+ act.append(done);
226
+ list.append(act);
227
+ }
228
+ c.append(list);
229
+ out.append(c);
230
+ }
231
+
232
+ /* --- v0.54.0: foreign dispatches that never reported back ------------
233
+ ONE LINE, and only when there is something to say. Money was spent and
234
+ work is half-done, and nothing will look at it again unless somebody is
235
+ told. It ROUTES to the panel that can clear it (Extra ▸ Recovery) — it
236
+ never resumes anything, because continuing a third party's unfinished
237
+ write without asking is the same class of act as routing off Claude
238
+ without saying so. */
239
+ const ej = d.extra_journal;
240
+ if (ej && ej.orphans) {
241
+ const c = card(t("overview.extraOrphan.title"));
242
+ c.append(el("div", "note", t("overview.extraOrphan.note")));
243
+ // `.no-caret` — this row NAVIGATES rather than expands, and every
244
+ // `.run-card` variant declares its own column count (v0.49.2). A card
245
+ // one column short is not a rounding error; it is the whole card.
246
+ const b = el("button", "run-card no-caret");
247
+ b.type = "button";
248
+ b.append(chip(tn(ej.orphans, "overview.extraOrphan.chip"), "bad"));
249
+ const mid = el("div", "run-mid");
250
+ mid.append(el("div", "run-slug", t("overview.extraOrphan.slug")));
251
+ mid.append(el("div", "run-where", t("overview.extraOrphan.where")));
252
+ b.append(mid, el("div", "run-age", ""));
253
+ b.addEventListener("click", () => {
254
+ location.hash = "#/extra";
255
+ });
256
+ c.append(b);
257
+ out.append(c);
258
+ }
259
+
260
+ /* --- the raw doctor list -------------------------------------------
261
+ Kept below the actionable card, because it is the EVIDENCE: the exact
262
+ message the CLI printed, unedited and untranslated, so what you read
263
+ here is what you would read in a terminal. */
264
+ if (!doctor.ok && findings.length) {
265
+ const c = card(t("overview.doctor.title"));
266
+ for (const f of findings) {
267
+ const row = el("div", "finding");
268
+ row.append(chip(f.fixable ? t("overview.doctor.fixable") : t("overview.doctor.manual"), f.fixable ? "info" : "warn"));
269
+ const detail = el("div");
270
+ detail.append(el("div", null, f.message));
271
+ const r = findingRoute(f.id);
272
+ if (r.panel) {
273
+ const go = el("button", "btn btn-ghost btn-sm", t(r.cta));
274
+ go.type = "button";
275
+ go.addEventListener("click", () => (location.hash = "#/" + r.panel));
276
+ detail.append(go);
277
+ } else {
278
+ detail.append(el("div", "note", t("overview.attention.nothingToDo")));
279
+ }
280
+ row.append(detail);
281
+ c.append(row);
282
+ }
283
+ out.append(c);
284
+ }
285
+
286
+ /* --- where things are ----------------------------------------------- */
287
+ const paths = card(t("overview.paths.title"));
288
+ const where = d.where || {};
289
+ paths.append(
290
+ kvList(
291
+ [
292
+ [t("overview.paths.project"), where.project_root],
293
+ [t("overview.paths.config"), where.config],
294
+ [t("overview.paths.skills"), where.skills],
295
+ [t("overview.paths.runs"), where.run_dir],
296
+ [t("overview.paths.traces"), where.log_dir],
297
+ ],
298
+ true
299
+ )
300
+ );
301
+ out.append(paths);
302
+
303
+ const know = card(t("overview.know.title"));
304
+ know.append(
305
+ kvList([
306
+ [t("overview.know.patterns"), langs.join(", ") || t("common.none")],
307
+ [t("overview.know.tags"), w.crosslink_tags === undefined ? "" : String(w.crosslink_tags)],
308
+ // `state` and `reason` are the CLI's — shown verbatim.
309
+ [t("overview.know.diy"), d.diy ? `${d.diy.state} — ${d.diy.reason}` : ""],
310
+ ])
311
+ );
312
+ out.append(know);
313
+
314
+ return out;
315
+ }
316
+ );
317
+ };
318
+
319
+ // The actionable list. Each entry is {kind, title, body, panel, cta} and knows
320
+ // where its fix lives — never a blanket "go to Maintenance".
321
+ function attentionCard(d, findings) {
322
+ const w = d.wiki || {};
323
+ const p = d.patterns || {};
324
+ const items = [];
325
+
326
+ // 1. Install findings, routed per id.
327
+ for (const f of findings) {
328
+ const r = findingRoute(f.id);
329
+ if (f.id === "diy-stale") {
330
+ items.push({
331
+ kind: "warn",
332
+ title: t("overview.item.diyStale.title"),
333
+ body: t("overview.item.diyStale.body"),
334
+ evidence: d.diy && d.diy.reason,
335
+ panel: "flow",
336
+ cta: t("overview.item.diyStale.cta"),
337
+ });
338
+ } else if (r.panel) {
339
+ items.push({
340
+ kind: f.fixable ? "warn" : "bad",
341
+ // A doctor finding is already a sentence written for a human — using it
342
+ // as the title beats paraphrasing it into something less exact.
343
+ title: f.message,
344
+ panel: r.panel,
345
+ cta: t(r.cta),
346
+ });
347
+ }
348
+ }
349
+
350
+ // 2. The wiki. THIS is the recommendation the panel was missing: an AGING
351
+ // wiki is not an error, it is the moment a refresh is still cheap.
352
+ if (!w.state || w.state === "none") {
353
+ items.push({ kind: "info", title: t("overview.item.wikiNone.title"), body: t("overview.item.wikiNone.body"), panel: "knowledge", cta: t("overview.item.wikiNone.cta") });
354
+ } else if (w.state !== "registered") {
355
+ items.push({ kind: "warn", title: t("overview.item.wikiUnregistered.title"), body: t("overview.item.wikiUnregistered.body"), panel: "knowledge", cta: t("overview.item.wikiUnregistered.cta") });
356
+ } else if (w.tier === "AGING") {
357
+ items.push({
358
+ kind: "warn",
359
+ title: t("overview.item.wikiAging.title"),
360
+ body: t("overview.item.wikiAging.body"),
361
+ evidence: (w.reasons || [])[0],
362
+ panel: "knowledge",
363
+ cta: t("overview.item.wikiAging.cta"),
364
+ });
365
+ } else if (w.tier && w.tier !== "FRESH") {
366
+ items.push({
367
+ kind: "bad",
368
+ title: t("overview.item.wikiStale.title"),
369
+ body: t("overview.item.wikiStale.body"),
370
+ evidence: (w.reasons || [])[0],
371
+ panel: "knowledge",
372
+ cta: t("overview.item.wikiStale.cta"),
373
+ });
374
+ }
375
+
376
+ // 3. No cached pattern — not a fault, but the cheapest quality win there is.
377
+ if (!(p.patterns || []).length)
378
+ items.push({ kind: "info", title: t("overview.item.patterns.title"), body: t("overview.item.patterns.body"), panel: "knowledge", cta: t("overview.item.patterns.cta") });
379
+
380
+ // 4. Runs left waiting.
381
+ if ((d.waiting || []).length)
382
+ items.push({
383
+ kind: "warn",
384
+ title: tn((d.waiting || []).length, "overview.item.waiting.title"),
385
+ body: t("overview.item.waiting.body"),
386
+ panel: "runs",
387
+ cta: t("overview.item.waiting.cta"),
388
+ });
389
+
390
+ const c = card(t("overview.attention.title"), chip(String(items.length), items.length ? "warn" : "ok"));
391
+ c.id = "attention-card";
392
+
393
+ if (!items.length) {
394
+ const ok = el("div", "all-clear");
395
+ ok.append(el("div", "all-clear-mark", "✓"));
396
+ const txt = el("div");
397
+ txt.append(el("div", "all-clear-title", t("overview.attention.allClear")));
398
+ txt.append(el("div", "note", t("overview.attention.allClearHint")));
399
+ ok.append(txt);
400
+ c.append(ok);
401
+ }
402
+
403
+ const list = el("div", "todo-list");
404
+ const order = { bad: 0, warn: 1, info: 2 };
405
+ items.sort((a, b) => (order[a.kind] || 3) - (order[b.kind] || 3));
406
+ for (const it of items) {
407
+ const row = el("button", "todo todo-" + it.kind);
408
+ row.type = "button";
409
+ row.append(el("span", "todo-mark"));
410
+ const mid = el("div", "todo-body");
411
+ mid.append(el("div", "todo-title", it.title));
412
+ if (it.body) mid.append(el("div", "todo-text", it.body));
413
+ // The CLI's own words for WHY, kept verbatim under our explanation.
414
+ if (it.evidence) mid.append(el("div", "todo-evidence", it.evidence));
415
+ row.append(mid, el("span", "todo-cta", it.cta));
416
+ row.addEventListener("click", () => (location.hash = "#/" + it.panel));
417
+ list.append(row);
418
+ }
419
+ if (items.length) c.append(list);
420
+
421
+ // The update offer is appended asynchronously so a slow network check never
422
+ // delays the list — it arrives as one more row when the answer does.
423
+ versionInfo()
424
+ .then((v) => {
425
+ if (!v || !v.update_available) return;
426
+ const row = el("button", "todo todo-info todo-late");
427
+ row.type = "button";
428
+ row.append(el("span", "todo-mark"));
429
+ const mid = el("div", "todo-body");
430
+ mid.append(el("div", "todo-title", t("overview.item.update.title", { latest: v.latest })));
431
+ mid.append(el("div", "todo-text", t("overview.item.update.body", { version: v.version })));
432
+ row.append(mid, el("span", "todo-cta", t("overview.item.update.cta")));
433
+ row.addEventListener("click", () => (location.hash = "#/maintenance"));
434
+ if (!list.isConnected) c.append(list);
435
+ list.append(row);
436
+ const count = c.querySelector(".card-head .chip");
437
+ if (count) {
438
+ count.textContent = String(list.children.length);
439
+ count.className = "chip chip-warn";
440
+ }
441
+ const clear = c.querySelector(".all-clear");
442
+ if (clear) clear.remove();
443
+ })
444
+ .catch(() => {});
445
+
446
+ return c;
447
+ }
@@ -0,0 +1,189 @@
1
+ "use strict";
2
+ /* panels/pact.js — orc ui client
3
+ The invariant ledger. HOLDING/DRIFTED/UNCHECKABLE/BROKEN are the CLI's words,
4
+ rendered verbatim.
5
+
6
+ Loaded by app.html in the order its numeric prefix names. Classic
7
+ script, no import/export: an ES module import carries no query string,
8
+ and every static request here needs the per-launch session token. */
9
+
10
+ // Worst first, always. A ledger sorted by id buries the one entry that needs a
11
+ // decision under four that do not.
12
+ const PACT_KIND = { BROKEN: "bad", DRIFTED: "warn", UNCHECKABLE: "warn", HOLDING: "ok" };
13
+ const PACT_ORDER_UI = ["BROKEN", "DRIFTED", "UNCHECKABLE", "HOLDING"];
14
+
15
+ PANELS.pact = function (host) {
16
+ head(host, t("pact.title"), t("pact.sub"));
17
+ const body = el("div", "stack");
18
+ host.append(body);
19
+ renderPact(body);
20
+ };
21
+
22
+ async function renderPact(body) {
23
+ body.replaceChildren(skeleton(5));
24
+ const [pactRes, boundRes, afterRes] = await Promise.all([
25
+ read("/api/pact").catch(() => ({ data: null })),
26
+ read("/api/boundary").catch(() => ({ data: null })),
27
+ read("/api/aftermath").catch(() => ({ data: null })),
28
+ ]);
29
+ const d = pactRes.data;
30
+ const out = frag();
31
+
32
+ if (!d || !d.ok || !d.rows || !d.rows.length) {
33
+ const c = card(t("pact.title"));
34
+ c.append(empty(t("pact.none"), t("pact.noneHint")));
35
+ c.append(laneCommand("/orc-pact", t("pact.cmdHarvestWhy")));
36
+ out.append(c);
37
+ body.replaceChildren(out);
38
+ return;
39
+ }
40
+
41
+ // --- the summary row, in the CLI's own words
42
+ const sum = card(t("pact.summary"), pactActions(body, d));
43
+ const chips = el("div", "row-actions");
44
+ for (const s of PACT_ORDER_UI) {
45
+ const n = (d.counts || {})[s] || 0;
46
+ if (!n && s !== "HOLDING") continue;
47
+ chips.append(chip(`${n} ${s}`, PACT_KIND[s], s === "BROKEN"));
48
+ }
49
+ sum.append(chips);
50
+ sum.append(kvList([[t("pact.field.ledger"), d.ledger], [t("pact.field.doc"), d.doc]], true));
51
+ if (!d.doc_exists) sum.append(el("div", "note", t("pact.docMissing")));
52
+ sum.append(el("div", "note", t("pact.uncheckableNote")));
53
+ out.append(sum);
54
+
55
+ // --- one card per promise, worst state first (the CLI already sorted them)
56
+ for (const r of d.rows) {
57
+ const c = card(null);
58
+ const headRow = el("div", "row-actions");
59
+ headRow.append(chip(r.state, PACT_KIND[r.state], r.state === "BROKEN"));
60
+ headRow.append(el("span", "mono dim", r.id));
61
+ c.append(headRow);
62
+ c.append(el("div", "promise", r.statement));
63
+ c.append(el("div", "note", r.why));
64
+
65
+ const rows = [];
66
+ if (r.anchors && r.anchors.length) rows.push([t("pact.field.anchors"), r.anchors.join(", ")]);
67
+ rows.push([t("pact.field.check"), r.check && r.check.ref ? `${r.check.kind} — ${r.check.ref}` : t("pact.field.checkManual")]);
68
+ if (r.origin) rows.push([t("pact.field.origin"), `${r.origin.lane || "?"}${r.origin.run ? " · " + r.origin.run : ""}`]);
69
+ rows.push([t("pact.field.confidence"), r.confidence]);
70
+ if (r.verified_commit) rows.push([t("pact.field.verified"), String(r.verified_commit).slice(0, 10)]);
71
+ c.append(kvList(rows));
72
+
73
+ if (r.last_check && r.last_check.status === "fail")
74
+ c.append(el("div", "note bad", t("pact.lastCheckFailed", { at: r.last_check.at })));
75
+
76
+ // ALSO FLAGGED BY — three lanes agreeing is the strongest signal ORC can
77
+ // produce, and in a terminal you only ever see one lane at a time. This is
78
+ // the whole reason the panel is worth building.
79
+ const also = alsoFlagged(r, boundRes.data, afterRes.data);
80
+ if (also.length) {
81
+ const box = el("div", "also");
82
+ box.append(el("div", "also-head", t("pact.alsoFlagged")));
83
+ for (const a of also) {
84
+ const line = el("div", "also-row");
85
+ line.append(chip(a.chip, a.kind));
86
+ line.append(el("span", null, a.text));
87
+ if (a.panel) {
88
+ const b = el("button", "btn btn-ghost btn-sm", t("common.open"));
89
+ b.type = "button";
90
+ b.addEventListener("click", () => (location.hash = "#/" + a.panel));
91
+ line.append(b);
92
+ }
93
+ box.append(line);
94
+ }
95
+ c.append(box);
96
+ }
97
+
98
+ // A re-check is FREE (it runs the user's own command), so it is a button.
99
+ if (r.check && r.check.ref) {
100
+ const act = el("div", "row-actions");
101
+ const b = el("button", "btn btn-sm", t("pact.recheckOne"));
102
+ b.type = "button";
103
+ b.addEventListener("click", () => confirmPactCheck([r], body));
104
+ act.append(b);
105
+ act.append(el("span", "note", "orc pact check " + r.id));
106
+ c.append(act);
107
+ }
108
+ if (r.history && r.history.length > 1)
109
+ c.append(
110
+ collapsible({
111
+ title: t("pact.history"),
112
+ count: String(r.history.length),
113
+ collapsed: true,
114
+ content: kvList(r.history.map((h) => [h.at, `${h.status} @ ${String(h.commit || "").slice(0, 10)}`])),
115
+ })
116
+ );
117
+ out.append(c);
118
+ }
119
+
120
+ out.append(laneCommand("/orc-pact", t("pact.cmdReconcileWhy")));
121
+ body.replaceChildren(out);
122
+ }
123
+
124
+ // The cross-panel agreement line. Deliberately conservative: it only claims an
125
+ // overlap it can SEE (a shared file path, a named pact id), never a guess.
126
+ function alsoFlagged(row, boundary, after) {
127
+ const out = [];
128
+ const files = (row.anchors || []).map((a) => String(a).split(":")[0]);
129
+ for (const c of (boundary && boundary.cards) || []) {
130
+ if (c.verdict === "EXECUTE") continue;
131
+ if (!files.some((f) => f === c.area || f.startsWith(c.area + "/"))) continue;
132
+ out.push({ chip: c.verdict, kind: c.verdict === "REFUSE" ? "bad" : "warn", text: t("pact.alsoBoundary", { area: c.area }), panel: "boundary" });
133
+ }
134
+ for (const r of (after && after.runs) || [])
135
+ for (const s of r.signals || [])
136
+ if ((s.ids || []).includes(row.id))
137
+ out.push({ chip: r.grade, kind: "warn", text: t("pact.alsoAftermath", { slug: r.slug }), panel: "runs" });
138
+ return out;
139
+ }
140
+
141
+ function pactActions(body, d) {
142
+ const wrap = el("div", "row-actions");
143
+ const drifted = (d.rows || []).filter((r) => (r.state === "DRIFTED" || r.state === "BROKEN") && r.check && r.check.ref);
144
+ if (drifted.length) {
145
+ const b = el("button", "btn btn-sm", tn(drifted.length, "pact.recheckAll"));
146
+ b.type = "button";
147
+ b.addEventListener("click", () => confirmPactCheck(drifted, body));
148
+ wrap.append(b);
149
+ }
150
+ const s = el("button", "btn btn-ghost btn-sm", t("pact.syncDoc"));
151
+ s.type = "button";
152
+ s.addEventListener("click", async () => {
153
+ const r = await post("/api/pact/sync", {});
154
+ toast(r.ok ? t("pact.syncOk") : t("common.writeFail"), r.ok ? "ok" : "bad", r.output);
155
+ renderPact(body);
156
+ });
157
+ wrap.append(s);
158
+ return wrap;
159
+ }
160
+
161
+ // A COUNT IS NOT CONSENT: the confirmation names every id it is about to run,
162
+ // and shows the exact command.
163
+ function confirmPactCheck(rows, body) {
164
+ const b = frag();
165
+ b.append(el("p", null, tn(rows.length, "pact.confirmBody")));
166
+ const list = el("ul", "file-list");
167
+ for (const r of rows) {
168
+ const li = el("li");
169
+ li.append(el("span", "mono", r.id + " "));
170
+ li.append(el("span", null, r.check.ref));
171
+ list.append(li);
172
+ }
173
+ b.append(list);
174
+ b.append(el("div", "note", t("pact.confirmNote")));
175
+ const cmd = rows.length === 1 ? "orc pact check " + rows[0].id : "orc pact check";
176
+ b.append(el("pre", "cmd", cmd));
177
+ modal({
178
+ title: t("pact.confirmTitle"),
179
+ body: b,
180
+ actions: {
181
+ [t("common.cancel")]: null,
182
+ [t("pact.confirmGo")]: async () => {
183
+ const r = await post("/api/pact/check", rows.length === 1 ? { id: rows[0].id } : {});
184
+ toast(r.ok ? t("pact.checkDone") : t("pact.checkFound"), r.ok ? "ok" : "warn", r.output);
185
+ renderPact(body);
186
+ },
187
+ },
188
+ });
189
+ }