@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,203 @@
1
+ # Reference — targeted refresh, the scan tier ladder, debt and usage (v0.46.0)
2
+
3
+ Loaded when the user asks for a refresh, or when `/orc-wiki refresh …` is the
4
+ entry. This is the half that makes a 2-line change cost 2 lines.
5
+
6
+ ## What already worked, and must not be rebuilt
7
+
8
+ - `orc wiki impact` already classifies every doc `CLEAN | TOUCHED | STRUCTURAL`
9
+ against **its own** `scanned_commit`.
10
+ - Delta refresh has been the default since v0.33.0.
11
+ - `orc wiki sync` is free and CLI-only.
12
+ - `computeWikiFreshness` already makes staleness coverage-relative.
13
+
14
+ Nothing here replaces any of it. `orc wiki plan` sits ON TOP of `impact` and
15
+ answers the question impact does not: **what to do about it, in what order, for
16
+ how much.**
17
+
18
+ ## Free repairs ALWAYS come before anything that costs money
19
+
20
+ A hard rule, in this order, every time:
21
+
22
+ | # | Step | Cost | Fixes |
23
+ |---|---|---|---|
24
+ | 1 | `orc wiki sync` | free | UNREGISTERED / drifted registration |
25
+ | 2 | regenerate `wiki/orc-orientation.md` | free | the derived doc every consumer reads first |
26
+ | 3 | crosslink-only backfill | free | tags publishable from already-anchored rows |
27
+ | 4 | targeted refresh | **money** | actual doc rot |
28
+
29
+ **A user must never be able to pay for something a free step would have fixed.**
30
+ `orc wiki plan` prints the available free repairs above the priced table; do the
31
+ same in prose, and never offer step 4 while a step 1–3 is outstanding.
32
+
33
+ ## `orc wiki plan` — the ranked, priced work list
34
+
35
+ Free, CLI, no model. Exit 0 nothing to do · 1 work pending, all light · 2 work
36
+ pending, at least one deep · 3 cannot compute.
37
+
38
+ **The ranking rule, and the reasons for it:**
39
+
40
+ 1. **`STRUCTURAL` always first.** A doc pointing at a file that no longer exists is
41
+ actively lying, and no cheaper step repairs it — a targeted refresh cannot
42
+ re-anchor blind, which is also why STRUCTURAL always takes the deep tier.
43
+ 2. **Then by use × delta**, where `used` is how many of the last 20 runs actually
44
+ put that doc into a slice. Refresh what gets read.
45
+ 3. **Zero-use docs sink to the bottom** with a retire hint. `used: ?` (no usage
46
+ data yet) is NOT zero-use and must never be ranked as dead.
47
+
48
+ Render what the CLI returns. **Never compute the order, the tier or the estimate
49
+ in this skill** — one engine, the same rule the wiki tier itself lives under
50
+ (`../../_shared/detecting-artifacts.md`).
51
+
52
+ ## Targeted refresh
53
+
54
+ ```
55
+ /orc-wiki refresh <doc>
56
+ /orc-wiki refresh --only api/refunds/**
57
+ /orc-wiki refresh --top 2
58
+ /orc-wiki refresh --all-touched (today's delta behaviour)
59
+ ```
60
+
61
+ It **skips Phase 0 branch detection and Phase 1 area planning entirely** — the doc
62
+ exists, so its coverage area is already in its own header. That skip is the whole
63
+ saving in wall-clock terms.
64
+
65
+ ```
66
+ R0 probe orc wiki plan --json (free)
67
+ R1 confirm the doc, the delta, the TIER, the token + $ estimate. ONE turn.
68
+ R2 scan ONE scan-task, at the tier the ladder resolved
69
+ R3 write doc body + crosslink tags (unchanged — per-scan-task rule)
70
+ R4 register orc wiki sync (free)
71
+ R5 integrity the existing self-check, scoped to the touched doc
72
+ ```
73
+
74
+ **No new pause mechanic.** The fixed pause every 5 scan-tasks still holds; a 1–2
75
+ task refresh simply never reaches it.
76
+
77
+ **Crosslink rules are unchanged:** tags publish per scan-task, no refresh path
78
+ bulk-deletes `wiki/crosslink/`, and the dead-tag sweep still runs per point.
79
+
80
+ ## The scan tier ladder (`wiki_scan_tier`, default `ladder`)
81
+
82
+ Every scan-task used to dispatch the most expensive scanner in the payload whether
83
+ the delta was 2 lines or 2000. Five rows, in order, first match wins:
84
+
85
+ | Condition | Tier | Agent |
86
+ |---|---|---|
87
+ | first scan of an area (no doc yet) | deep | `orc-wiki-scanner-opus-4-8-high` |
88
+ | `STRUCTURAL` | deep | `orc-wiki-scanner-opus-4-8-high` |
89
+ | ≥ `wiki_tier_deep_files` covered files touched (default 3) | deep | `orc-wiki-scanner-opus-4-8-high` |
90
+ | a new exported symbol in a covered file | deep | `orc-wiki-scanner-opus-4-8-high` |
91
+ | otherwise (small delta, no new surface) | **light** | **`orc-wiki-scanner-sonnet-5-high`** |
92
+
93
+ - **`opus5_only` needs no new pair.** It already forces the wiki scanner to
94
+ `orc-wiki-scanner-opus-5-med`, which already ships, so **both tiers collapse onto
95
+ that one agent** while the flag is on. `OPUS5_ONLY_ROLES` gains no row and no
96
+ phantom pair — see `../../_shared/opus5-only.md`.
97
+ - **`wiki_scan_tier: always_deep`** restores pre-v0.46.0 behaviour exactly.
98
+ - **NEVER SILENT.** The resolved tier is printed in `orc wiki plan` and in the R1
99
+ confirmation. A cheaper model is a decision the user sees, never a quiet
100
+ substitution.
101
+ - The light scanner escalates rather than under-delivers: a `needs_context` return
102
+ naming a new symbol or a missing anchor is re-run deep. That is cheap; a doc with
103
+ invented anchors is permanent.
104
+
105
+ **Expected saving:** a delta refresh where 3 of 4 docs have a one-or-two-file delta
106
+ goes from 4×deep to 1×deep + 3×light — roughly **40% off**, with the deep scan
107
+ still doing the work that needs it.
108
+
109
+ ## Budget cap (`wiki_refresh_budget`, default 0 = no cap)
110
+
111
+ Max scan-tasks per refresh run. A capped refresh is a **planned stop**, not an
112
+ interrupt:
113
+
114
+ ```
115
+ Refresh · budget reached
116
+ Done : 2 of 4 scan-tasks Left : 2 tasks, est. 73k tokens / $0.14
117
+ orc wiki sync ran. The wiki is REGISTERED and consistent right now.
118
+ The two remaining docs are AGING, not broken.
119
+ Continue any time: /orc-wiki refresh --top 2
120
+ ```
121
+
122
+ Stopping mid-refresh must leave a VALID wiki. That already holds — sync runs after
123
+ every scan-task and freshness is per-doc. This only makes the stop first-class.
124
+
125
+ **It is a different mechanic from the fixed pause every 5 scan-tasks. Do not merge
126
+ them.** The pause is a checkpoint you continue through; the budget is a ceiling you
127
+ stop at.
128
+
129
+ ## `orc wiki debt`
130
+
131
+ One line, for the habit: docs pending, tokens, dollars, oldest debt, tier, and the
132
+ reassurance that matters — *nothing is broken*. Exit 0 no debt · 1 debt exists · 3
133
+ no wiki.
134
+
135
+ Inside `/orc`, one preflight tail **only when debt exists**:
136
+
137
+ ```
138
+ wiki : FRESH — 4 docs pending refresh, 335k tok / $0.94
139
+ ```
140
+
141
+ **This is the real budget win** — not a cheaper full refresh, but a full refresh you
142
+ never need.
143
+
144
+ ## `orc wiki usage` and retirement (`wiki_retire_after_runs`, default 0 = never)
145
+
146
+ Since v0.41.0 every dispatch whose slice carried wiki material writes a `wiki:`
147
+ continuation and every return carries `wiki_used`. Two releases of clean
148
+ point-of-use attribution that nothing read back. `orc wiki usage --rebuild` reads
149
+ it into `.claude/orc/wiki-usage.json`.
150
+
151
+ > **Do NOT put usage in `wiki-meta.json`.** That manifest is 100% derived from doc
152
+ > headers and `orc wiki sync` is its only writer — a load-bearing rule. Usage comes
153
+ > from traces, so it gets its own file and its own writer.
154
+
155
+ Three things it unlocks: the ranking above · honest coverage on `orc wiki status`
156
+ (`14 registered · 8 in active use · 2 never used in 20 runs`) · and retirement.
157
+
158
+ When `wiki_retire_after_runs` is non-zero and a doc has been in no slice for that
159
+ many runs, OFFER retirement — never do it silently:
160
+
161
+ ```
162
+ 2 docs were never put into a slice in 20 runs. They cost money on every full
163
+ refresh — and context tokens whenever they ARE included.
164
+ Retire them? (moves to wiki/retired/, drops from INDEX.md and every plan.
165
+ Reversible. Never a delete.)
166
+ ```
167
+
168
+ **Retirement MOVES, never deletes**, and `orc wiki sync` re-derives `INDEX.md`
169
+ afterwards. A retired doc that turns out to matter is one `git mv` away.
170
+
171
+ ## The consent prompt gets a real number
172
+
173
+ ```
174
+ Before: ⚠ This is an EXPENSIVE, possibly multi-session scan. Continue?
175
+ After: ⚠ Full scan: 14 areas, est. 2.1M tokens / $3.80 → $6.10, 25–40 min,
176
+ 2 pause points, ~48% of a 5-hour window on Max 20x.
177
+ A targeted refresh of the 4 stale docs: 335k tokens / $0.94.
178
+ Continue with the full scan?
179
+ ```
180
+
181
+ The numbers come from `/orc-budget`'s engine (`orc wiki plan --json` carries them).
182
+ When there is no history yet, print `insufficient history` rather than a guess.
183
+
184
+ ## Later, opt-in: surgical section refresh — NOT in this release
185
+
186
+ Noted so it is not re-invented. A doc's sections each anchor to files; in principle
187
+ only the sections whose files changed need regenerating (~20% of the body). It
188
+ waits because it needs the wiki-doc header parser to carry a section→file map — one
189
+ of the GRAMMAR-shaped drift surfaces the contract lint cannot see — and because a
190
+ partial body rewrite can break the integrity self-check's anchoring rule. If it is
191
+ ever built: default off, and the integrity check still runs over the whole doc.
192
+
193
+ ## What must NOT change
194
+
195
+ - `orc wiki sync` stays the only writer of `wiki-meta.json` + `INDEX.md`, and stays
196
+ 100% derived from doc headers.
197
+ - `meta.scan_commit` stays the OLDEST doc's anchor, and nothing reads it as a tier.
198
+ - Edges come from `wiki_fresh_max` / `wiki_aging_max`. A hardcoded 10/30 is a bug.
199
+ - `computeWikiFreshness` stays the ONE engine. `plan`, `debt` and `usage` all call
200
+ it, and skills never compute a tier.
201
+ - Crosslink publish stays per-scan-task.
202
+ - A STRUCTURAL blind spot still degrades one step and never past AGING.
203
+ - The fixed pause every 5 scan-tasks is not configurable.
@@ -0,0 +1,19 @@
1
+ # Code-pattern pre-warm (opt-in — config `orc_wiki_pattern_findings: on`)
2
+
3
+ Default OFF. When on, after Phase 3 also **codify the code-pattern for every
4
+ detected FE/BE language** as a scan byproduct — pre-warming
5
+ `.claude/orc/patterns/<lang>-pattern.md` so later `/orc` runs never hit the
6
+ `pattern_findings` prompt.
7
+
8
+ Rules:
9
+
10
+ - Rides the wiki's existing scan-consent, so there is NO separate ask (hence
11
+ on/off only, no `ask` value).
12
+ - Per detected language (`../../orc-pattern/references/INDEX.md`): dispatch
13
+ `orc-pattern-codifier-sonnet-5-high` (`orc-pattern-codifier-opus-5-med` when
14
+ `opus5_only` — `../../_shared/opus5-only.md`) with the generic playbook + the
15
+ most-recently-modified real files; YOU write the returned pattern to the
16
+ cache.
17
+ - Never run tests or change project code; skip languages already cached and
18
+ un-drifted.
19
+ - Reuses the `orc-pattern` engine — you never codify yourself.
@@ -0,0 +1,288 @@
1
+ # Reference — Freshness, Staleness & Refresh
2
+
3
+ THE canonical freshness reference for the whole constellation. Every skill that
4
+ consults the wiki (orc, /orc-ultra, orc-mini, orc-fast, planners) follows the
5
+ rules here; this file is the single source of truth for the manifest format,
6
+ the tier thresholds, the refresh modes, and the precedence rule.
7
+
8
+ ## Precedence (source-of-truth contract)
9
+
10
+ **code > fresh wiki > stale wiki (hints) > model priors.** The wiki is a
11
+ DERIVED source of truth: on any conflict between a wiki claim and the actual
12
+ code, the code wins and the doc gets stale-flagged. Never let a confident wiki
13
+ claim override what a file actually shows; never let a model prior override a
14
+ fresh, evidence-anchored wiki claim without reading the code.
15
+
16
+ ## The manifest — `.claude/orc/wiki-meta.json`
17
+
18
+ Written **ONLY by the `orc wiki sync` CLI** — never by a model, never by a
19
+ consumer. The manifest is DERIVED data: every field it carries already lives in
20
+ the docs' own headers (schemas/wiki-doc.md), so deriving it is deterministic and
21
+ free, while authoring it from memory is neither. orc-wiki runs `orc wiki sync`
22
+ after every scan-task, at every pause, and at Phase 3; consumers only ever READ
23
+ it, and never persist the freshness status they compute from it (below) — that
24
+ status goes stale the moment anyone commits. Lives outside `templates/` next to
25
+ the pattern cache, so `orc update` never clobbers it.
26
+
27
+ > **Why the CLI owns this.** Registration was once the model's job at the end of
28
+ > orc-wiki's Phase 3 — the last step of a lane that pauses every 5 scan-tasks by
29
+ > design. Every run stopped at a pause left real docs on disk that nothing had
30
+ > indexed, invisible to every consumer and to `orc crosslink`. The one field no
31
+ > header carries is `commands` (discovered during the scan): sync preserves it
32
+ > across rebuilds and falls back to `package.json` scripts, and it is the only
33
+ > key a model may hand-edit.
34
+
35
+ ```json
36
+ {
37
+ "last_scan": "12-07-2026 14:32:05",
38
+ "scan_commit": "<full git hash — HEAD at scan time>",
39
+ "branch": "main",
40
+ "pages": 14,
41
+ "commands": {
42
+ "build": "npm run build",
43
+ "test_fast": "npm test",
44
+ "lint": "npm run lint"
45
+ },
46
+ "docs": [
47
+ {
48
+ "file": "wiki/orc-feature-orders.md",
49
+ "area": "orders",
50
+ "doc_type": "feature",
51
+ "covers": ["src/orders/**"],
52
+ "covered_files": { "src/orders/service.ts": "a1b2c3d" },
53
+ "scanned_commit": "<git hash>"
54
+ }
55
+ ]
56
+ }
57
+ ```
58
+
59
+ - `last_scan`: dd-mm-yyyy hh:mm:ss, local time.
60
+ - `scan_commit`: the anchor every staleness compute measures against.
61
+ - `commands`: the project's build/test/lint invocations, discovered ONCE during
62
+ the scan. Consumers (especially orc-fast's smoke gate) run these directly
63
+ instead of rediscovering the project's tooling every run. Omit keys the
64
+ project doesn't have; never guess.
65
+ - `docs` (v2 registry): one entry per wiki doc mirroring its header's
66
+ `covers` + `covered_files` (`wiki_schema: 2` docs). Purpose: ALL staleness
67
+ questions become answerable from ONE small JSON read + two git commands —
68
+ no doc opens. A manifest without `docs` is v1: consumers fall back to
69
+ doc-header reads; the next refresh writes the registry.
70
+
71
+ ## Computing freshness — COVERAGE-RELATIVE, and the CLI computes it (v0.41.0)
72
+
73
+ **Run `orc wiki status` (or `--json` to branch on `.tier`). Never compute the
74
+ tier by hand.** These are the RULES; the CLI is their only executor.
75
+
76
+ Freshness is **per doc, against its own coverage**:
77
+
78
+ ```
79
+ per-doc distance = git rev-list --count <doc.scanned_commit>..HEAD -- <that doc's covers/covered_files>
80
+ wiki tier = the WORST doc's tier
81
+ ```
82
+
83
+ | Tier | Condition |
84
+ |-------|--------------------|
85
+ | FRESH | distance < `wiki_fresh_max` (default 10) |
86
+ | AGING | `wiki_fresh_max` ≤ distance ≤ `wiki_aging_max` (default 30) |
87
+ | STALE | distance > `wiki_aging_max` |
88
+
89
+ Thresholds come from config (`wiki_fresh_max`, `wiki_aging_max`) — the CLI reads
90
+ them; a hardcoded 10/30 anywhere is a bug.
91
+
92
+ **A STRUCTURAL blind spot** — changed files that NO doc covers — degrades the
93
+ tier by exactly ONE step, never past AGING. That is a COVERAGE gap, not doc rot:
94
+ the docs on disk are still accurate, they just don't cover everything. (STALE
95
+ means "do not trust these docs", which a blind spot does not say. `orc wiki
96
+ impact` is where a blind spot escalates to a FULL-refresh recommendation.)
97
+
98
+ ### Why per-doc, and why this used to be permanently STALE
99
+
100
+ `wiki-meta.json`'s `scan_commit` is the **oldest** doc's anchor — deliberately,
101
+ as the conservative floor for the blind-spot sweep. But a DELTA refresh (the
102
+ default path) only re-scans TOUCHED docs, so untouched docs keep their original
103
+ `scanned_commit` and **that anchor can never move**. Measuring the tier from it
104
+ meant every refresh reported the same hash and an ever-growing distance:
105
+ permanently STALE, no matter how many times the user refreshed — the exact state
106
+ a refresh exists to clear.
107
+
108
+ Per-doc coverage also makes the answer semantically right: a doc about auth does
109
+ not rot because the README changed forty times. A doc is stale when commits
110
+ since its own anchor touched files it covers, and not before.
111
+
112
+ ## UNREGISTERED — docs without a manifest
113
+
114
+ If `wiki-meta.json` is ABSENT but `wiki/` has docs, the wiki is **UNREGISTERED**,
115
+ not missing and not stale. The docs may be perfectly current; nothing has indexed
116
+ them. Never treat this as a reason to re-scan — the fix is derived and free:
117
+
118
+ > "This wiki has {N} docs but no manifest, so nothing can read it. Run
119
+ > `orc wiki sync` — instant, no re-scan."
120
+
121
+ Consumers treat an unregistered wiki as STALE for precedence purposes (they
122
+ cannot prove freshness without an anchor) but must surface the sync fix, never a
123
+ refresh. `orc wiki status` names the state; `orc wiki sync --check` is the
124
+ read-only test. The same applies to a manifest that exists but won't parse
125
+ (CORRUPT) or that has drifted from the docs on disk (OUT OF SYNC) — one command
126
+ fixes all three.
127
+
128
+ **Do not conflate incomplete coverage with unregistered.** A scan stopped at a
129
+ pause has both: partial coverage (real, fix by resuming — costs money) and no
130
+ registration (fix with sync — free). Diagnose them separately; only the first
131
+ is worth spending on.
132
+
133
+ ## Per-skill reactions
134
+
135
+ | Tier | orc / /orc-ultra / planners | orc-mini | orc-fast |
136
+ |-------|-----------------------------|----------|----------|
137
+ | FRESH | silent | silent | proceed |
138
+ | AGING | one-line notice, proceed | one-line notice, proceed | one-line notice, proceed |
139
+ | STALE | prominent warning, continue (these lanes self-ground) | prominent warning, continue | **user gate** — see the orc-fast skill (refresh-then-continue recommended / drop to mini / continue anyway) |
140
+
141
+ ## Per-doc staleness (advisory second signal)
142
+
143
+ Each doc records `scanned_commit` and per-file `covered_files` hashes (v1 docs:
144
+ a single `covered_hash`). A doc is stale when the current state of any file in
145
+ `covered_files` differs from its recorded hash. Cheap to check via the manifest
146
+ registry, no re-scan needed. The doc-header `status: fresh|stale` flag is
147
+ ADVISORY only — it is flipped by the auto-flag hook below, which fires only on
148
+ ORC runs, so commits made outside ORC never flip it. The computed tier above is
149
+ always the authoritative check.
150
+
151
+ ## Refresh modes
152
+
153
+ 0. **Register-only (`orc wiki sync`)** — not a refresh at all, but it is the
154
+ right answer whenever the complaint is "ORC can't see my wiki". Re-derives
155
+ the manifest + INDEX from the doc headers. No scan, no cost, no doc changes.
156
+ Always try this BEFORE offering any mode below: a wiki that is merely
157
+ unregistered needs no re-scan, and re-scanning it wastes real money. Sync
158
+ also runs the **boundary detector** (references/crosslink.md): a non-empty
159
+ `## Contracts & shapes` table with zero `wiki/crosslink/` tags → prominent
160
+ warning + `--check` exit 1 (a documented boundary that never published), and
161
+ an N→0 tripwire when the manifest listed tags but the folder is now empty.
162
+ 1. **Delta (THE DEFAULT refresh path when a manifest exists — v0.33.0)** —
163
+ commit-scoped, probe-first. Step 1 is always the deterministic CLI probe
164
+ **`orc wiki impact`** (never an ad-hoc diff): it runs `git diff --name-only
165
+ <scan_commit>..HEAD` against the registry's `covers`/`covered_files` and
166
+ prints per-doc `CLEAN | TOUCHED (n) | STRUCTURAL` + a summary, with a
167
+ branchable exit code (0 clean · 1 can't compute · 2 delta · 3 full
168
+ recommended).
169
+ - **Exit 0 (CLEAN):** say so; nothing to refresh.
170
+ - **Exit 2 (small delta):** re-scan ONLY the touched docs → `orc wiki sync`
171
+ → regenerate the orientation doc (+ the atlas when crosslink is
172
+ configured) — both DERIVED and cheap, no new scan area. The delta pass
173
+ also runs the sweeps below.
174
+ - **Exit 3 (FULL recommended):** present the impact table and let the USER
175
+ decide — **never silently full**. The probe recommends full when ANY of:
176
+ TOUCHED docs > `wiki_delta_full_threshold` % of registered docs (config,
177
+ default 30) · STRUCTURAL (a doc's covered file is gone, or changed files
178
+ match NO doc's coverage — a blind spot a targeted refresh can't fix) ·
179
+ `scan_commit` more than `wiki_aging_max` commits behind HEAD. A delta
180
+ refresh of just the touched docs remains a valid, cheaper choice.
181
+ - **Exit 1 (can't compute):** the probe names the fix (sync / re-anchor);
182
+ fall back to offering full/selective with an honest cost note.
183
+ 2. **Full regenerate** — re-scan every area. Full cost warning. Timestamps all
184
+ docs fresh. Does NOT clear `wiki/` or `wiki/crosslink/` first: docs and tags
185
+ are overwritten per-area/per-point as each re-scan lands, so the crosslink
186
+ surface is never momentarily wiped (a full regenerate must never destroy the
187
+ boundary — hard rule 12). `wiki/crosslink/atlas.md` is likewise preserved
188
+ and regenerated at the end, never bulk-deleted.
189
+ 3. **Selective refresh** — list stale-flagged docs; user picks which to
190
+ re-scan. Only those spawn agents.
191
+ 4. **Pre-push diff-scan** — `git diff --name-only` against the push target;
192
+ find docs whose `covers` intersect the changed files; offer to refresh those
193
+ before commit.
194
+
195
+ **Coverage-gap sweep (delta refresh + integrity check):** changed files
196
+ matched by NO doc's `covers` = uncovered drift — the silent way a wiki becomes
197
+ a partial map while still reading FRESH. `orc wiki impact` surfaces these as
198
+ the STRUCTURAL blind spot; report them grouped by directory and
199
+ propose new areas/docs; the user consents per new area (rides the refresh
200
+ consent, no separate warning). Never silently ignore uncovered drift.
201
+
202
+ **Dead-doc sweep:** registry entries whose `covers` match ZERO existing files
203
+ (area deleted/moved) → offer per doc: archive to `wiki/archive/` (kept out of
204
+ INDEX.md) or delete. Never silent, never automatic.
205
+
206
+ **Dead-tag sweep (crosslink, beside the dead-doc sweep):** a `wiki/crosslink/`
207
+ tag whose `anchor` file no longer exists, or whose owning area was re-scanned
208
+ this pass and returned `crosslink_tags` WITHOUT it → offer archive/delete per
209
+ tag. This is the ONLY way a tag is retired — a refresh never bulk-deletes the
210
+ folder (references/crosslink.md preservation rule). Never silent, never automatic.
211
+
212
+ ## Post-ship refresh ask (big runs — full orc + /orc-ultra ship phase)
213
+
214
+ GUARD FIRST: only if `wiki/` exists AND contains > 0 docs. No wiki → completely
215
+ silent (no ask, no note).
216
+
217
+ A run counts as BIG when, judged by FINAL counts at ship time (so a medium run
218
+ that grew counts): tasks dispatched ≥ `wiki_refresh_ask_tasks` (default 3), OR
219
+ union of executors' touched files > `wiki_refresh_ask_files` (default 10), OR
220
+ waves > 1. Relevance check: if the run's touched files intersect ZERO docs'
221
+ `covers`, downgrade to the passive note regardless of size.
222
+
223
+ - **BIG** → right after ship, ask:
224
+ 1. **Refresh wiki now** *(recommended)* — incremental refresh (mode 1),
225
+ scoped to the docs this run staled.
226
+ 2. **Later** — print: "This was a big change — N wiki docs are now stale.
227
+ Refresh ASAP (/orc-wiki) or orc-fast and future runs will degrade." Stamp
228
+ `wiki_refresh_declined` in the checkpoint so /orc-retro can correlate.
229
+ - **Small runs** → the passive auto-flag note below only. No ask.
230
+
231
+ orc-mini keeps the passive note only (single-task lane); orc-fast never asks
232
+ (its preflight polices freshness on the way in).
233
+
234
+ ## Auto-flag hook (after orc / orc-mini runs)
235
+
236
+ GUARD FIRST: only act if `wiki/` exists AND contains > 0 files. On an empty/
237
+ absent wiki this hook is a silent no-op.
238
+
239
+ If guarded in:
240
+ 1. Take the files the orc run touched (from its dispatch/actual_files).
241
+ 2. Mark every wiki doc whose `covers` intersect those files as `status: stale`.
242
+ This is a metadata flip only — instant, free, no scanning.
243
+ 3. Tell the user: "N wiki docs are now stale from this change. Run
244
+ /orc-wiki to refresh when ready." Never auto-scan. (On a BIG full-lane run
245
+ the post-ship refresh ask above replaces this passive note.)
246
+
247
+ ## Cross-repo crosslink freshness (references/crosslink.md — advisory only)
248
+
249
+ A crosslink hint is trustworthy only if BOTH signals hold; the weakest wins,
250
+ `effective = min(Signal-A, Signal-B)`. Both are computed on read; the cache
251
+ stamp is a fallback INPUT, never a stored status.
252
+
253
+ - **Signal A — provider wiki tier.** The SAME git-commit-distance compute above,
254
+ run read-only in the linked repo's checkout (`git rev-list --count
255
+ <scan_commit>..HEAD` in `<repo_path>`), using the DEFAULT edges
256
+ (`wiki_fresh_max` 10 / `wiki_aging_max` 30) — we do not read the provider's
257
+ overrides. Provider not checked out or git fails → fall back to the
258
+ `source_tier` stamped in `.claude/orc/crosslink/cache/` at sync, "as of last
259
+ sync".
260
+ - **Signal B — snapshot age.** The ONLY day-based tier in the constellation
261
+ (two repos share no commit axis): `days = today − synced_at`, against
262
+ `crosslink_fresh_days` (default 10 → FRESH) and `crosslink_aging_days`
263
+ (default 15 → AGING; beyond → STALE).
264
+
265
+ Reaction is always advisory: label the injected surface with the effective tier
266
+ + "cross-repo hints, not verified", and warn on per-point drift — never block.
267
+ Precedence extends the local rule: `local code > local fresh wiki > cross-repo
268
+ fresh wiki (hints) > cross-repo stale wiki (weak hints) > model priors`.
269
+
270
+ ## Consume rule (main orc + orc-mini)
271
+
272
+ Before consulting the wiki during planning/scoring: determine existence with the
273
+ deterministic probe `orc wiki status` (per `../../_shared/detecting-artifacts.md`
274
+ — never an ad-hoc `find`; `.claude` is hidden). If present, compute the freshness
275
+ tier (above) and react per the
276
+ per-skill table, then read the relevant `orc-feature-*` / `orc-reference-*` /
277
+ `orc-architecture-overview.md` for the area being planned — selecting pages via
278
+ `wiki/INDEX.md` (one line per doc: type, status, description, keywords)
279
+ instead of globbing and skimming headers. Pull the cross-cutting reference
280
+ maps when they exist and the task touches their domain:
281
+ `orc-reference-api-surface` (route/endpoint inventory — the best planning
282
+ input for API work), `orc-reference-data-model` (tables/entities + owners),
283
+ `orc-reference-glossary` (domain terms — read it whenever the request uses
284
+ project jargon), `orc-reference-config-env` (env/config keys). In each doc the
285
+ `TL;DR` section is the cheap read; `Contracts & shapes` and `Testing map`
286
+ carry the file-anchored specifics. Apply the precedence rule above. If
287
+ `wiki/` is empty/absent, ignore entirely and plan as normal. The wiki is
288
+ purely additive.
@@ -0,0 +1,166 @@
1
+ # Schema — Crosslink Tag + Needs + Cache (cross-repo boundary index)
2
+
3
+ The machine-resolvable half of the wiki. Where `wiki/orc-*.md` docs are the
4
+ human narrative, crosslink files are a per-integration-point index that another
5
+ repo resolves **by tag**. See `references/crosslink.md` for the mechanics; this
6
+ file pins the shapes.
7
+
8
+ **Who writes what.** The tag FILES, needs, and cache are written by `orc-wiki`
9
+ (never by a model in a chat, never by the CLI) — they carry scanned contract
10
+ prose and evidence anchors, which takes a model. Tag files are emitted
11
+ **per-scan-task, together with the doc** (v0.24.0): each scan agent returns
12
+ `crosslink_tags` alongside its `doc_body` (schemas/wiki-doc.md) — either one tag
13
+ body per outward boundary point it found in the area's files, or the token
14
+ `none` + a one-line reason. The orchestrator writes the doc AND its tags, then
15
+ runs `orc wiki sync`. So the boundary accumulates from the FIRST scan-task,
16
+ however the run ends — a paused run has a live partial boundary matching its
17
+ live partial docs. `none` is an auditable claim ("area has no outward boundary"),
18
+ never silence. The `crosslink_provided` registry in the manifest is the
19
+ exception to model-authorship: it is a derived INDEX of those tag files, so
20
+ `orc wiki sync` builds it from their headers and nothing else ever writes it
21
+ (staleness.md).
22
+
23
+ ---
24
+
25
+ ## 1. Provider tag file — `wiki/crosslink/<kind>/<slug>.md`
26
+
27
+ One file per integration point this repo **provides**, emitted proactively as a
28
+ per-scan-task byproduct (whether or not any consumer exists) — from the source
29
+ the agent just read, not from doc prose. Committed — a consumer reads it from a
30
+ plain sibling checkout. Lives under project-root `wiki/crosslink/`, NOT
31
+ `.claude/orc/` (that holds only machine state). Overwritten per-point on
32
+ re-scan; a refresh NEVER bulk-deletes this folder (a vanished point is retired
33
+ only by the dead-tag sweep — references/staleness.md).
34
+
35
+ **Slug rule (Windows-safe, reversible):** the tag *identity* string uses `:` as
36
+ its separator (`service-c:grpc:billing.v1.CreateInvoice`) but a filename MUST
37
+ NOT contain `:`. The on-disk slug replaces every path/separator character:
38
+ `/` → `_`, `:` → `.`, space → `_`. `POST /v1/invoices` → `POST__v1_invoices.md`.
39
+ The header carries the original `tag` verbatim, so the identity round-trips
40
+ without parsing the filename.
41
+
42
+ **The KIND DIRECTORY is sanitized the same way (v0.34.5):** `/` → `-`, so the
43
+ catalog kind `auth/oidc` writes to `wiki/crosslink/auth-oidc/`. **The header
44
+ stays the identity** — `kind: auth/oidc` and `tag: auth/oidc:<name>` are kept
45
+ VERBATIM, and `orc wiki sync` reads `kind` from the header, never from the
46
+ directory name. A kind containing a raw `/` used to produce a nested path the
47
+ registry walk never saw: the tag was published, well-formed, on disk — and
48
+ invisible, with `orc wiki sync --check` still exiting 0. Sync now reads nested
49
+ directories too (so a pre-v0.34.5 wiki keeps its tag) and FAILS `--check` when
50
+ any tag file on disk does not reach the registry.
51
+
52
+ ```markdown
53
+ ---
54
+ crosslink_schema: 1
55
+ tag: grpc:billing.v1.CreateInvoice # identity WITHOUT the repo prefix (the
56
+ # consuming repo prefixes with the node name)
57
+ kind: grpc
58
+ surface: provided # provided | consumed
59
+ anchor: internal/billing/create.go:42 # real file+line (evidence-anchored)
60
+ content_hash: <short-hash> # hash of the contract BODY below; moves
61
+ # only when the anchored contract changes
62
+ scanned_commit: <git-hash>
63
+ ---
64
+
65
+ # billing.v1.CreateInvoice
66
+
67
+ ## Contract
68
+ <the boundary contract, evidence-anchored: request/response message or
69
+ route shape, field names + types, error codes — pulled from `anchor`.
70
+ A field the scan agent can't see in the anchored file is OMITTED, not guessed.>
71
+
72
+ ## Notes
73
+ <auth requirement, idempotency, versioning — anything a caller must honor.>
74
+ ```
75
+
76
+ `content_hash` is the drift axis: it is the hash of the `## Contract` body, and
77
+ it is refreshed whenever the anchored source file's recorded per-file hash moves
78
+ (the same per-file hashing the wiki already records at scan time).
79
+ A consumer compares its cached copy's `content_hash` against the provider's
80
+ current one — equal = clean, different = drifted, file gone = breaking change.
81
+
82
+ ---
83
+
84
+ ## 2. Provider registry — `crosslink_provided` in `wiki-meta.json`
85
+
86
+ A sibling array in the manifest, alongside `docs`, derived by `orc wiki sync`
87
+ from the tag-file headers — never hand-maintained. Per-point tag files are a
88
+ machine index, NOT prose docs — they must NOT enter `wiki/INDEX.md` or the `docs`
89
+ registry (that would corrupt the human index and the `pages` count); sync
90
+ enforces that by construction, since it only ever reads `wiki/crosslink/` into
91
+ this array. Shape:
92
+
93
+ ```json
94
+ {
95
+ "docs": [ ... ],
96
+ "crosslink_provided": [
97
+ {
98
+ "tag": "grpc:billing.v1.CreateInvoice",
99
+ "kind": "grpc",
100
+ "file": "wiki/crosslink/grpc/billing.v1.CreateInvoice.md",
101
+ "anchor": "internal/billing/create.go:42",
102
+ "content_hash": "<short-hash>"
103
+ }
104
+ ]
105
+ }
106
+ ```
107
+
108
+ The integrity self-check gains one crosslink rule (integrity-check.md): every
109
+ file under `wiki/crosslink/` has exactly one `crosslink_provided` entry and vice
110
+ versa; each entry's `anchor` file exists. `crosslink_provided` absent is no
111
+ longer assumed benign: it means EITHER the repo has no outward boundary (valid —
112
+ every scan-task returned `crosslink_tags: none`, and the final report says so)
113
+ OR a boundary is documented but unpublished (the bug). `orc wiki sync`
114
+ disambiguates deterministically by scanning doc bodies for a non-empty
115
+ `## Contracts & shapes` table (`boundary_rows`): rows present + zero tags →
116
+ prominent warning + `--check` exit 1 (references/integrity-check.md item 6,
117
+ references/staleness.md).
118
+
119
+ ---
120
+
121
+ ## 3. Consumer needs manifest — `.claude/orc/crosslink/needs.json`
122
+
123
+ Machine-authored by `orc-wiki` (NOT the CLI). The per-point tags THIS repo
124
+ actually depends on — the drift baseline. Committed (it is the record of what we
125
+ build against). Populated by walking call sites and matching them to linked
126
+ repos from `orc-crosslink.config.yaml`; the human never hand-lists tags.
127
+
128
+ ```json
129
+ {
130
+ "version": 1,
131
+ "needs": [
132
+ {
133
+ "node": "service-z-be", // linked repo (from the config)
134
+ "tag": "grpc:billing.v1.CreateInvoice",
135
+ "via": "grpc",
136
+ "discovered_at": "svc/pay.go:31" // OUR call site that created the need
137
+ }
138
+ ]
139
+ }
140
+ ```
141
+
142
+ ---
143
+
144
+ ## 4. Consumer cache — `.claude/orc/crosslink/cache/<node>/<kind>/<slug>.md`
145
+
146
+ Machine-authored mirror of the provider tag files this repo needs. **Gitignored**
147
+ — derived and regenerable. The durable source of record when the provider is not
148
+ checked out. Each cached file is the provider's tag file verbatim PLUS a sync
149
+ stamp block appended at the top:
150
+
151
+ ```markdown
152
+ <!-- crosslink-sync
153
+ synced_at: 12-07-2026 # date we mirrored it (Signal-B age axis)
154
+ source_node: service-z-be
155
+ source_content_hash: <short-hash> # provider content_hash AT sync (drift baseline)
156
+ source_tier: FRESH # provider wiki tier computed AT sync (Signal-A fallback)
157
+ source_scan_commit: <git-hash> # provider scan_commit AT sync
158
+ -->
159
+ --- <the provider tag file, verbatim> ---
160
+ ```
161
+
162
+ The stamp is a **fallback input to a computation**, never a stored status: the
163
+ effective tier is always computed on read (`min(Signal-A, Signal-B)` —
164
+ references/crosslink.md §freshness). `synced_at` drives Signal-B against
165
+ `crosslink_fresh_days` / `crosslink_aging_days`; `source_tier` is the Signal-A
166
+ fallback used only when the provider checkout is unavailable.