@trac3er/oh-my-god 2.0.4 → 2.0.7

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 (668) hide show
  1. package/.agents/skills/omg/AGENTS.fragment.md +57 -4
  2. package/.agents/skills/omg/algorithms/SKILL.md +11 -0
  3. package/.agents/skills/omg/algorithms/openai.yaml +11 -0
  4. package/.agents/skills/omg/api-twin/SKILL.md +11 -0
  5. package/.agents/skills/omg/api-twin/openai.yaml +12 -0
  6. package/.agents/skills/omg/claim-judge/SKILL.md +11 -0
  7. package/.agents/skills/omg/claim-judge/openai.yaml +13 -0
  8. package/.agents/skills/omg/codex-rules.md +33 -0
  9. package/.agents/skills/omg/control-plane/SKILL.md +1 -1
  10. package/.agents/skills/omg/control-plane/openai.yaml +1 -1
  11. package/.agents/skills/omg/data-lineage/SKILL.md +11 -0
  12. package/.agents/skills/omg/data-lineage/openai.yaml +12 -0
  13. package/.agents/skills/omg/delta-classifier/SKILL.md +11 -0
  14. package/.agents/skills/omg/delta-classifier/openai.yaml +12 -0
  15. package/.agents/skills/omg/eval-gate/SKILL.md +11 -0
  16. package/.agents/skills/omg/eval-gate/openai.yaml +12 -0
  17. package/.agents/skills/omg/health/SKILL.md +11 -0
  18. package/.agents/skills/omg/health/openai.yaml +11 -0
  19. package/.agents/skills/omg/hook-governor/SKILL.md +1 -1
  20. package/.agents/skills/omg/hook-governor/openai.yaml +1 -1
  21. package/.agents/skills/omg/incident-replay/SKILL.md +11 -0
  22. package/.agents/skills/omg/incident-replay/openai.yaml +12 -0
  23. package/.agents/skills/omg/lsp-pack/SKILL.md +1 -1
  24. package/.agents/skills/omg/lsp-pack/openai.yaml +1 -1
  25. package/.agents/skills/omg/mcp-fabric/SKILL.md +1 -1
  26. package/.agents/skills/omg/mcp-fabric/openai.yaml +1 -1
  27. package/.agents/skills/omg/plan-council/SKILL.md +11 -0
  28. package/.agents/skills/omg/plan-council/openai.yaml +12 -0
  29. package/.agents/skills/omg/preflight/SKILL.md +11 -0
  30. package/.agents/skills/omg/preflight/openai.yaml +12 -0
  31. package/.agents/skills/omg/proof-gate/SKILL.md +11 -0
  32. package/.agents/skills/omg/proof-gate/openai.yaml +13 -0
  33. package/.agents/skills/omg/remote-supervisor/SKILL.md +11 -0
  34. package/.agents/skills/omg/remote-supervisor/openai.yaml +12 -0
  35. package/.agents/skills/omg/robotics/SKILL.md +11 -0
  36. package/.agents/skills/omg/robotics/openai.yaml +11 -0
  37. package/.agents/skills/omg/secure-worktree-pipeline/SKILL.md +1 -1
  38. package/.agents/skills/omg/secure-worktree-pipeline/openai.yaml +1 -1
  39. package/.agents/skills/omg/security-check/SKILL.md +11 -0
  40. package/.agents/skills/omg/security-check/openai.yaml +13 -0
  41. package/.agents/skills/omg/test-intent-lock/SKILL.md +11 -0
  42. package/.agents/skills/omg/test-intent-lock/openai.yaml +13 -0
  43. package/.agents/skills/omg/tracebank/SKILL.md +11 -0
  44. package/.agents/skills/omg/tracebank/openai.yaml +12 -0
  45. package/.agents/skills/omg/vision/SKILL.md +11 -0
  46. package/.agents/skills/omg/vision/openai.yaml +11 -0
  47. package/.claude-plugin/marketplace.json +5 -5
  48. package/.claude-plugin/plugin.json +1 -1
  49. package/.claude-plugin/scripts/uninstall.sh +2 -2
  50. package/.mcp.json +0 -22
  51. package/CHANGELOG.md +13 -0
  52. package/OMG-setup.sh +64 -14
  53. package/OMG_COMPAT_CONTRACT.md +1 -1
  54. package/README.md +8 -6
  55. package/agents/omg-security-auditor.md +1 -1
  56. package/artifacts/release/.agents/skills/omg/AGENTS.fragment.md +52 -0
  57. package/artifacts/release/.agents/skills/omg/algorithms/SKILL.md +11 -0
  58. package/artifacts/release/.agents/skills/omg/algorithms/openai.yaml +11 -0
  59. package/artifacts/release/.agents/skills/omg/api-twin/SKILL.md +11 -0
  60. package/artifacts/release/.agents/skills/omg/api-twin/openai.yaml +12 -0
  61. package/artifacts/release/.agents/skills/omg/codex-mcp.toml +4 -0
  62. package/artifacts/release/.agents/skills/omg/codex-rules.md +29 -0
  63. package/artifacts/release/.agents/skills/omg/control-plane/SKILL.md +11 -0
  64. package/artifacts/release/.agents/skills/omg/control-plane/openai.yaml +14 -0
  65. package/artifacts/release/.agents/skills/omg/data-lineage/SKILL.md +11 -0
  66. package/artifacts/release/.agents/skills/omg/data-lineage/openai.yaml +12 -0
  67. package/artifacts/release/.agents/skills/omg/delta-classifier/SKILL.md +11 -0
  68. package/artifacts/release/.agents/skills/omg/delta-classifier/openai.yaml +12 -0
  69. package/artifacts/release/.agents/skills/omg/eval-gate/SKILL.md +11 -0
  70. package/artifacts/release/.agents/skills/omg/eval-gate/openai.yaml +12 -0
  71. package/artifacts/release/.agents/skills/omg/health/SKILL.md +11 -0
  72. package/artifacts/release/.agents/skills/omg/health/openai.yaml +11 -0
  73. package/artifacts/release/.agents/skills/omg/hook-governor/SKILL.md +11 -0
  74. package/artifacts/release/.agents/skills/omg/hook-governor/openai.yaml +11 -0
  75. package/artifacts/release/.agents/skills/omg/incident-replay/SKILL.md +11 -0
  76. package/artifacts/release/.agents/skills/omg/incident-replay/openai.yaml +12 -0
  77. package/artifacts/release/.agents/skills/omg/lsp-pack/SKILL.md +11 -0
  78. package/artifacts/release/.agents/skills/omg/lsp-pack/openai.yaml +11 -0
  79. package/artifacts/release/.agents/skills/omg/mcp-fabric/SKILL.md +11 -0
  80. package/artifacts/release/.agents/skills/omg/mcp-fabric/openai.yaml +13 -0
  81. package/artifacts/release/.agents/skills/omg/preflight/SKILL.md +11 -0
  82. package/artifacts/release/.agents/skills/omg/preflight/openai.yaml +12 -0
  83. package/artifacts/release/.agents/skills/omg/remote-supervisor/SKILL.md +11 -0
  84. package/artifacts/release/.agents/skills/omg/remote-supervisor/openai.yaml +12 -0
  85. package/artifacts/release/.agents/skills/omg/robotics/SKILL.md +11 -0
  86. package/artifacts/release/.agents/skills/omg/robotics/openai.yaml +11 -0
  87. package/artifacts/release/.agents/skills/omg/secure-worktree-pipeline/SKILL.md +11 -0
  88. package/artifacts/release/.agents/skills/omg/secure-worktree-pipeline/openai.yaml +12 -0
  89. package/artifacts/release/.agents/skills/omg/security-check/SKILL.md +11 -0
  90. package/artifacts/release/.agents/skills/omg/security-check/openai.yaml +13 -0
  91. package/artifacts/release/.agents/skills/omg/tracebank/SKILL.md +11 -0
  92. package/artifacts/release/.agents/skills/omg/tracebank/openai.yaml +12 -0
  93. package/artifacts/release/.agents/skills/omg/vision/SKILL.md +11 -0
  94. package/artifacts/release/.agents/skills/omg/vision/openai.yaml +11 -0
  95. package/artifacts/release/.claude-plugin/marketplace.json +36 -0
  96. package/artifacts/release/.claude-plugin/plugin.json +23 -0
  97. package/artifacts/release/.mcp.json +40 -0
  98. package/artifacts/release/OMG_COMPAT_CONTRACT.md +92 -0
  99. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/AGENTS.fragment.md +52 -0
  100. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/algorithms/SKILL.md +11 -0
  101. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/algorithms/openai.yaml +11 -0
  102. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/api-twin/SKILL.md +11 -0
  103. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/api-twin/openai.yaml +12 -0
  104. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/codex-mcp.toml +4 -0
  105. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/codex-rules.md +29 -0
  106. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/control-plane/SKILL.md +11 -0
  107. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/control-plane/openai.yaml +14 -0
  108. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/data-lineage/SKILL.md +11 -0
  109. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/data-lineage/openai.yaml +12 -0
  110. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/delta-classifier/SKILL.md +11 -0
  111. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/delta-classifier/openai.yaml +12 -0
  112. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/eval-gate/SKILL.md +11 -0
  113. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/eval-gate/openai.yaml +12 -0
  114. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/health/SKILL.md +11 -0
  115. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/health/openai.yaml +11 -0
  116. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/hook-governor/SKILL.md +11 -0
  117. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/hook-governor/openai.yaml +11 -0
  118. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/incident-replay/SKILL.md +11 -0
  119. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/incident-replay/openai.yaml +12 -0
  120. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/lsp-pack/SKILL.md +11 -0
  121. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/lsp-pack/openai.yaml +11 -0
  122. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/mcp-fabric/SKILL.md +11 -0
  123. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/mcp-fabric/openai.yaml +13 -0
  124. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/preflight/SKILL.md +11 -0
  125. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/preflight/openai.yaml +12 -0
  126. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/remote-supervisor/SKILL.md +11 -0
  127. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/remote-supervisor/openai.yaml +12 -0
  128. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/robotics/SKILL.md +11 -0
  129. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/robotics/openai.yaml +11 -0
  130. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/secure-worktree-pipeline/SKILL.md +11 -0
  131. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/secure-worktree-pipeline/openai.yaml +12 -0
  132. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/security-check/SKILL.md +11 -0
  133. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/security-check/openai.yaml +13 -0
  134. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/tracebank/SKILL.md +11 -0
  135. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/tracebank/openai.yaml +12 -0
  136. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/vision/SKILL.md +11 -0
  137. package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/vision/openai.yaml +11 -0
  138. package/artifacts/release/dist/enterprise/bundle/OMG_COMPAT_CONTRACT.md +92 -0
  139. package/artifacts/release/dist/enterprise/bundle/registry/bundles/algorithms.yaml +45 -0
  140. package/artifacts/release/dist/enterprise/bundle/registry/bundles/api-twin.yaml +48 -0
  141. package/artifacts/release/dist/enterprise/bundle/registry/bundles/control-plane.yaml +151 -0
  142. package/artifacts/release/dist/enterprise/bundle/registry/bundles/data-lineage.yaml +47 -0
  143. package/artifacts/release/dist/enterprise/bundle/registry/bundles/delta-classifier.yaml +47 -0
  144. package/artifacts/release/dist/enterprise/bundle/registry/bundles/eval-gate.yaml +47 -0
  145. package/artifacts/release/dist/enterprise/bundle/registry/bundles/health.yaml +45 -0
  146. package/artifacts/release/dist/enterprise/bundle/registry/bundles/hook-governor.yaml +97 -0
  147. package/artifacts/release/dist/enterprise/bundle/registry/bundles/incident-replay.yaml +47 -0
  148. package/artifacts/release/dist/enterprise/bundle/registry/bundles/lsp-pack.yaml +48 -0
  149. package/artifacts/release/dist/enterprise/bundle/registry/bundles/mcp-fabric.yaml +53 -0
  150. package/artifacts/release/dist/enterprise/bundle/registry/bundles/preflight.yaml +48 -0
  151. package/artifacts/release/dist/enterprise/bundle/registry/bundles/remote-supervisor.yaml +49 -0
  152. package/artifacts/release/dist/enterprise/bundle/registry/bundles/robotics.yaml +45 -0
  153. package/artifacts/release/dist/enterprise/bundle/registry/bundles/secure-worktree-pipeline.yaml +54 -0
  154. package/artifacts/release/dist/enterprise/bundle/registry/bundles/security-check.yaml +50 -0
  155. package/artifacts/release/dist/enterprise/bundle/registry/bundles/tracebank.yaml +47 -0
  156. package/artifacts/release/dist/enterprise/bundle/registry/bundles/vision.yaml +45 -0
  157. package/artifacts/release/dist/enterprise/bundle/registry/omg-capability.schema.json +296 -0
  158. package/artifacts/release/dist/enterprise/manifest.json +243 -0
  159. package/artifacts/release/dist/public/bundle/.agents/skills/omg/AGENTS.fragment.md +7 -0
  160. package/artifacts/release/dist/public/bundle/.agents/skills/omg/algorithms/SKILL.md +11 -0
  161. package/artifacts/release/dist/public/bundle/.agents/skills/omg/algorithms/openai.yaml +11 -0
  162. package/artifacts/release/dist/public/bundle/.agents/skills/omg/api-twin/SKILL.md +11 -0
  163. package/artifacts/release/dist/public/bundle/.agents/skills/omg/api-twin/openai.yaml +12 -0
  164. package/artifacts/release/dist/public/bundle/.agents/skills/omg/codex-mcp.toml +4 -0
  165. package/artifacts/release/dist/public/bundle/.agents/skills/omg/control-plane/SKILL.md +11 -0
  166. package/artifacts/release/dist/public/bundle/.agents/skills/omg/control-plane/openai.yaml +14 -0
  167. package/artifacts/release/dist/public/bundle/.agents/skills/omg/data-lineage/SKILL.md +11 -0
  168. package/artifacts/release/dist/public/bundle/.agents/skills/omg/data-lineage/openai.yaml +12 -0
  169. package/artifacts/release/dist/public/bundle/.agents/skills/omg/delta-classifier/SKILL.md +11 -0
  170. package/artifacts/release/dist/public/bundle/.agents/skills/omg/delta-classifier/openai.yaml +12 -0
  171. package/artifacts/release/dist/public/bundle/.agents/skills/omg/eval-gate/SKILL.md +11 -0
  172. package/artifacts/release/dist/public/bundle/.agents/skills/omg/eval-gate/openai.yaml +12 -0
  173. package/artifacts/release/dist/public/bundle/.agents/skills/omg/health/SKILL.md +11 -0
  174. package/artifacts/release/dist/public/bundle/.agents/skills/omg/health/openai.yaml +11 -0
  175. package/artifacts/release/dist/public/bundle/.agents/skills/omg/hook-governor/SKILL.md +11 -0
  176. package/artifacts/release/dist/public/bundle/.agents/skills/omg/hook-governor/openai.yaml +11 -0
  177. package/artifacts/release/dist/public/bundle/.agents/skills/omg/incident-replay/SKILL.md +11 -0
  178. package/artifacts/release/dist/public/bundle/.agents/skills/omg/incident-replay/openai.yaml +12 -0
  179. package/artifacts/release/dist/public/bundle/.agents/skills/omg/lsp-pack/SKILL.md +11 -0
  180. package/artifacts/release/dist/public/bundle/.agents/skills/omg/lsp-pack/openai.yaml +11 -0
  181. package/artifacts/release/dist/public/bundle/.agents/skills/omg/mcp-fabric/SKILL.md +11 -0
  182. package/artifacts/release/dist/public/bundle/.agents/skills/omg/mcp-fabric/openai.yaml +13 -0
  183. package/artifacts/release/dist/public/bundle/.agents/skills/omg/preflight/SKILL.md +11 -0
  184. package/artifacts/release/dist/public/bundle/.agents/skills/omg/preflight/openai.yaml +12 -0
  185. package/artifacts/release/dist/public/bundle/.agents/skills/omg/remote-supervisor/SKILL.md +11 -0
  186. package/artifacts/release/dist/public/bundle/.agents/skills/omg/remote-supervisor/openai.yaml +12 -0
  187. package/artifacts/release/dist/public/bundle/.agents/skills/omg/robotics/SKILL.md +11 -0
  188. package/artifacts/release/dist/public/bundle/.agents/skills/omg/robotics/openai.yaml +11 -0
  189. package/artifacts/release/dist/public/bundle/.agents/skills/omg/secure-worktree-pipeline/SKILL.md +11 -0
  190. package/artifacts/release/dist/public/bundle/.agents/skills/omg/secure-worktree-pipeline/openai.yaml +12 -0
  191. package/artifacts/release/dist/public/bundle/.agents/skills/omg/security-check/SKILL.md +11 -0
  192. package/artifacts/release/dist/public/bundle/.agents/skills/omg/security-check/openai.yaml +13 -0
  193. package/artifacts/release/dist/public/bundle/.agents/skills/omg/tracebank/SKILL.md +11 -0
  194. package/artifacts/release/dist/public/bundle/.agents/skills/omg/tracebank/openai.yaml +12 -0
  195. package/artifacts/release/dist/public/bundle/.agents/skills/omg/vision/SKILL.md +11 -0
  196. package/artifacts/release/dist/public/bundle/.agents/skills/omg/vision/openai.yaml +11 -0
  197. package/artifacts/release/dist/public/bundle/.claude-plugin/marketplace.json +36 -0
  198. package/artifacts/release/dist/public/bundle/.claude-plugin/plugin.json +23 -0
  199. package/artifacts/release/dist/public/bundle/.mcp.json +40 -0
  200. package/artifacts/release/dist/public/bundle/OMG_COMPAT_CONTRACT.md +92 -0
  201. package/artifacts/release/dist/public/bundle/registry/bundles/algorithms.yaml +45 -0
  202. package/artifacts/release/dist/public/bundle/registry/bundles/api-twin.yaml +48 -0
  203. package/artifacts/release/dist/public/bundle/registry/bundles/control-plane.yaml +151 -0
  204. package/artifacts/release/dist/public/bundle/registry/bundles/data-lineage.yaml +47 -0
  205. package/artifacts/release/dist/public/bundle/registry/bundles/delta-classifier.yaml +47 -0
  206. package/artifacts/release/dist/public/bundle/registry/bundles/eval-gate.yaml +47 -0
  207. package/artifacts/release/dist/public/bundle/registry/bundles/health.yaml +45 -0
  208. package/artifacts/release/dist/public/bundle/registry/bundles/hook-governor.yaml +97 -0
  209. package/artifacts/release/dist/public/bundle/registry/bundles/incident-replay.yaml +47 -0
  210. package/artifacts/release/dist/public/bundle/registry/bundles/lsp-pack.yaml +48 -0
  211. package/artifacts/release/dist/public/bundle/registry/bundles/mcp-fabric.yaml +53 -0
  212. package/artifacts/release/dist/public/bundle/registry/bundles/preflight.yaml +48 -0
  213. package/artifacts/release/dist/public/bundle/registry/bundles/remote-supervisor.yaml +49 -0
  214. package/artifacts/release/dist/public/bundle/registry/bundles/robotics.yaml +45 -0
  215. package/artifacts/release/dist/public/bundle/registry/bundles/secure-worktree-pipeline.yaml +54 -0
  216. package/artifacts/release/dist/public/bundle/registry/bundles/security-check.yaml +50 -0
  217. package/artifacts/release/dist/public/bundle/registry/bundles/tracebank.yaml +47 -0
  218. package/artifacts/release/dist/public/bundle/registry/bundles/vision.yaml +45 -0
  219. package/artifacts/release/dist/public/bundle/registry/omg-capability.schema.json +296 -0
  220. package/artifacts/release/dist/public/bundle/settings.json +526 -0
  221. package/artifacts/release/dist/public/manifest.json +255 -0
  222. package/artifacts/release/registry/bundles/algorithms.yaml +45 -0
  223. package/artifacts/release/registry/bundles/api-twin.yaml +48 -0
  224. package/artifacts/release/registry/bundles/control-plane.yaml +151 -0
  225. package/artifacts/release/registry/bundles/data-lineage.yaml +47 -0
  226. package/artifacts/release/registry/bundles/delta-classifier.yaml +47 -0
  227. package/artifacts/release/registry/bundles/eval-gate.yaml +47 -0
  228. package/artifacts/release/registry/bundles/health.yaml +45 -0
  229. package/artifacts/release/registry/bundles/hook-governor.yaml +97 -0
  230. package/artifacts/release/registry/bundles/incident-replay.yaml +47 -0
  231. package/artifacts/release/registry/bundles/lsp-pack.yaml +48 -0
  232. package/artifacts/release/registry/bundles/mcp-fabric.yaml +53 -0
  233. package/artifacts/release/registry/bundles/preflight.yaml +48 -0
  234. package/artifacts/release/registry/bundles/remote-supervisor.yaml +49 -0
  235. package/artifacts/release/registry/bundles/robotics.yaml +45 -0
  236. package/artifacts/release/registry/bundles/secure-worktree-pipeline.yaml +54 -0
  237. package/artifacts/release/registry/bundles/security-check.yaml +50 -0
  238. package/artifacts/release/registry/bundles/tracebank.yaml +47 -0
  239. package/artifacts/release/registry/bundles/vision.yaml +45 -0
  240. package/artifacts/release/registry/omg-capability.schema.json +296 -0
  241. package/artifacts/release/settings.json +594 -0
  242. package/build/lib/agents/__init__.py +1 -0
  243. package/build/lib/agents/designer.md +67 -0
  244. package/build/lib/agents/explore.md +60 -0
  245. package/build/lib/agents/model_roles.py +196 -0
  246. package/build/lib/agents/omg-api-builder.md +23 -0
  247. package/build/lib/agents/omg-architect-mode.md +41 -0
  248. package/build/lib/agents/omg-architect.md +13 -0
  249. package/build/lib/agents/omg-backend-engineer.md +41 -0
  250. package/build/lib/agents/omg-critic.md +16 -0
  251. package/build/lib/agents/omg-database-engineer.md +41 -0
  252. package/build/lib/agents/omg-escalation-router.md +17 -0
  253. package/build/lib/agents/omg-executor.md +12 -0
  254. package/build/lib/agents/omg-frontend-designer.md +41 -0
  255. package/build/lib/agents/omg-implement-mode.md +49 -0
  256. package/build/lib/agents/omg-infra-engineer.md +41 -0
  257. package/build/lib/agents/omg-qa-tester.md +16 -0
  258. package/build/lib/agents/omg-research-mode.md +41 -0
  259. package/build/lib/agents/omg-security-auditor.md +41 -0
  260. package/build/lib/agents/omg-testing-engineer.md +41 -0
  261. package/build/lib/agents/plan.md +80 -0
  262. package/build/lib/agents/quick_task.md +64 -0
  263. package/build/lib/agents/reviewer.md +83 -0
  264. package/build/lib/agents/task.md +71 -0
  265. package/build/lib/commands/OMG:ai-commit.md +113 -0
  266. package/build/lib/commands/OMG:api-twin.md +22 -0
  267. package/build/lib/commands/OMG:arch.md +313 -0
  268. package/build/lib/commands/OMG:ccg.md +22 -0
  269. package/build/lib/commands/OMG:compat.md +57 -0
  270. package/build/lib/commands/OMG:cost.md +181 -0
  271. package/build/lib/commands/OMG:crazy.md +125 -0
  272. package/build/lib/commands/OMG:create-agent.md +183 -0
  273. package/build/lib/commands/OMG:deps.md +248 -0
  274. package/build/lib/commands/OMG:doctor.md +37 -0
  275. package/build/lib/commands/OMG:domain-init.md +11 -0
  276. package/build/lib/commands/OMG:escalate.md +52 -0
  277. package/build/lib/commands/OMG:health-check.md +45 -0
  278. package/build/lib/commands/OMG:init.md +134 -0
  279. package/build/lib/commands/OMG:mode.md +44 -0
  280. package/build/lib/commands/OMG:preflight.md +26 -0
  281. package/build/lib/commands/OMG:project-init.md +11 -0
  282. package/build/lib/commands/OMG:ralph-start.md +43 -0
  283. package/build/lib/commands/OMG:ralph-stop.md +23 -0
  284. package/build/lib/commands/OMG:security-check.md +28 -0
  285. package/build/lib/commands/OMG:session-branch.md +85 -0
  286. package/build/lib/commands/OMG:session-fork.md +53 -0
  287. package/build/lib/commands/OMG:session-merge.md +134 -0
  288. package/build/lib/commands/OMG:setup.md +78 -0
  289. package/build/lib/commands/OMG:stats.md +225 -0
  290. package/build/lib/commands/OMG:teams.md +39 -0
  291. package/build/lib/commands/OMG:theme.md +44 -0
  292. package/build/lib/commands/__init__.py +1 -0
  293. package/build/lib/control_plane/__init__.py +2 -0
  294. package/build/lib/control_plane/openapi.yaml +260 -0
  295. package/build/lib/control_plane/server.py +147 -0
  296. package/build/lib/control_plane/service.py +222 -0
  297. package/build/lib/hooks/__init__.py +0 -0
  298. package/build/lib/hooks/_agent_registry.py +423 -0
  299. package/build/lib/hooks/_analytics.py +291 -0
  300. package/build/lib/hooks/_budget.py +31 -0
  301. package/build/lib/hooks/_common.py +569 -0
  302. package/build/lib/hooks/_compression_optimizer.py +119 -0
  303. package/build/lib/hooks/_cost_ledger.py +176 -0
  304. package/build/lib/hooks/_learnings.py +126 -0
  305. package/build/lib/hooks/_memory.py +103 -0
  306. package/build/lib/hooks/_protected_context.py +150 -0
  307. package/build/lib/hooks/_token_counter.py +221 -0
  308. package/build/lib/hooks/branch_manager.py +236 -0
  309. package/build/lib/hooks/budget_governor.py +232 -0
  310. package/build/lib/hooks/circuit-breaker.py +270 -0
  311. package/build/lib/hooks/compression_feedback.py +254 -0
  312. package/build/lib/hooks/config-guard.py +216 -0
  313. package/build/lib/hooks/context_pressure.py +53 -0
  314. package/build/lib/hooks/credential_store.py +1020 -0
  315. package/build/lib/hooks/fetch-rate-limits.py +212 -0
  316. package/build/lib/hooks/firewall.py +48 -0
  317. package/build/lib/hooks/hashline-formatter-bridge.py +224 -0
  318. package/build/lib/hooks/hashline-injector.py +273 -0
  319. package/build/lib/hooks/hashline-validator.py +216 -0
  320. package/build/lib/hooks/idle-detector.py +95 -0
  321. package/build/lib/hooks/intentgate-keyword-detector.py +188 -0
  322. package/build/lib/hooks/magic-keyword-router.py +195 -0
  323. package/build/lib/hooks/policy_engine.py +641 -0
  324. package/build/lib/hooks/post-tool-failure.py +19 -0
  325. package/build/lib/hooks/post-write.py +219 -0
  326. package/build/lib/hooks/post_write.py +46 -0
  327. package/build/lib/hooks/pre-compact.py +398 -0
  328. package/build/lib/hooks/pre-tool-inject.py +98 -0
  329. package/build/lib/hooks/prompt-enhancer.py +672 -0
  330. package/build/lib/hooks/quality-runner.py +191 -0
  331. package/build/lib/hooks/query.py +512 -0
  332. package/build/lib/hooks/secret-guard.py +61 -0
  333. package/build/lib/hooks/secret_audit.py +144 -0
  334. package/build/lib/hooks/security_validators.py +75 -0
  335. package/build/lib/hooks/session-end-capture.py +137 -0
  336. package/build/lib/hooks/session-start.py +277 -0
  337. package/build/lib/hooks/setup_wizard.py +646 -0
  338. package/build/lib/hooks/shadow_manager.py +344 -0
  339. package/build/lib/hooks/state_migration.py +225 -0
  340. package/build/lib/hooks/stop-gate.py +7 -0
  341. package/build/lib/hooks/stop_dispatcher.py +945 -0
  342. package/build/lib/hooks/test-validator.py +361 -0
  343. package/build/lib/hooks/test_generator_hook.py +123 -0
  344. package/build/lib/hooks/todo-state-tracker.py +114 -0
  345. package/build/lib/hooks/tool-ledger.py +149 -0
  346. package/build/lib/hooks/trust_review.py +585 -0
  347. package/build/lib/plugins/README.md +60 -0
  348. package/build/lib/plugins/__init__.py +1 -0
  349. package/build/lib/plugins/advanced/commands/OMG:code-review.md +114 -0
  350. package/build/lib/plugins/advanced/commands/OMG:deep-plan.md +265 -0
  351. package/build/lib/plugins/advanced/commands/OMG:handoff.md +115 -0
  352. package/build/lib/plugins/advanced/commands/OMG:learn.md +110 -0
  353. package/build/lib/plugins/advanced/commands/OMG:maintainer.md +31 -0
  354. package/build/lib/plugins/advanced/commands/OMG:ralph-start.md +43 -0
  355. package/build/lib/plugins/advanced/commands/OMG:ralph-stop.md +23 -0
  356. package/build/lib/plugins/advanced/commands/OMG:security-review.md +16 -0
  357. package/build/lib/plugins/advanced/commands/OMG:sequential-thinking.md +20 -0
  358. package/build/lib/plugins/advanced/commands/OMG:ship.md +46 -0
  359. package/build/lib/plugins/advanced/plugin.json +87 -0
  360. package/build/lib/plugins/core/plugin.json +145 -0
  361. package/build/lib/plugins/dephealth/__init__.py +0 -0
  362. package/build/lib/plugins/dephealth/cve_scanner.py +188 -0
  363. package/build/lib/plugins/dephealth/license_checker.py +135 -0
  364. package/build/lib/plugins/dephealth/manifest_detector.py +423 -0
  365. package/build/lib/plugins/dephealth/vuln_analyzer.py +169 -0
  366. package/build/lib/plugins/testgen/__init__.py +0 -0
  367. package/build/lib/plugins/testgen/codamosa_engine.py +402 -0
  368. package/build/lib/plugins/testgen/edge_case_synthesizer.py +184 -0
  369. package/build/lib/plugins/testgen/framework_detector.py +271 -0
  370. package/build/lib/plugins/testgen/skeleton_generator.py +219 -0
  371. package/build/lib/plugins/viz/__init__.py +0 -0
  372. package/build/lib/plugins/viz/ast_parser.py +139 -0
  373. package/build/lib/plugins/viz/diagram_generator.py +192 -0
  374. package/build/lib/plugins/viz/graph_builder.py +444 -0
  375. package/build/lib/plugins/viz/native_parsers.py +259 -0
  376. package/build/lib/plugins/viz/regex_parser.py +112 -0
  377. package/build/lib/registry/__init__.py +1 -0
  378. package/build/lib/registry/bundles/algorithms.yaml +45 -0
  379. package/build/lib/registry/bundles/api-twin.yaml +48 -0
  380. package/build/lib/registry/bundles/claim-judge.yaml +49 -0
  381. package/build/lib/registry/bundles/control-plane.yaml +151 -0
  382. package/build/lib/registry/bundles/data-lineage.yaml +47 -0
  383. package/build/lib/registry/bundles/delta-classifier.yaml +47 -0
  384. package/build/lib/registry/bundles/eval-gate.yaml +47 -0
  385. package/build/lib/registry/bundles/health.yaml +45 -0
  386. package/build/lib/registry/bundles/hook-governor.yaml +97 -0
  387. package/build/lib/registry/bundles/incident-replay.yaml +47 -0
  388. package/build/lib/registry/bundles/lsp-pack.yaml +48 -0
  389. package/build/lib/registry/bundles/mcp-fabric.yaml +53 -0
  390. package/build/lib/registry/bundles/plan-council.yaml +51 -0
  391. package/build/lib/registry/bundles/preflight.yaml +48 -0
  392. package/build/lib/registry/bundles/proof-gate.yaml +49 -0
  393. package/build/lib/registry/bundles/remote-supervisor.yaml +49 -0
  394. package/build/lib/registry/bundles/robotics.yaml +45 -0
  395. package/build/lib/registry/bundles/secure-worktree-pipeline.yaml +54 -0
  396. package/build/lib/registry/bundles/security-check.yaml +50 -0
  397. package/build/lib/registry/bundles/test-intent-lock.yaml +49 -0
  398. package/build/lib/registry/bundles/tracebank.yaml +47 -0
  399. package/build/lib/registry/bundles/vision.yaml +45 -0
  400. package/build/lib/registry/omg-capability.schema.json +296 -0
  401. package/build/lib/registry/verify_artifact.py +90 -0
  402. package/build/lib/runtime/__init__.py +32 -0
  403. package/build/lib/runtime/adapters/__init__.py +13 -0
  404. package/build/lib/runtime/adapters/claude.py +63 -0
  405. package/build/lib/runtime/adapters/gpt.py +56 -0
  406. package/build/lib/runtime/adapters/local.py +56 -0
  407. package/build/lib/runtime/adoption.py +212 -0
  408. package/build/lib/runtime/api_twin.py +450 -0
  409. package/build/lib/runtime/asset_loader.py +62 -0
  410. package/build/lib/runtime/business_workflow.py +234 -0
  411. package/build/lib/runtime/claim_judge.py +95 -0
  412. package/build/lib/runtime/cli_provider.py +85 -0
  413. package/build/lib/runtime/compat.py +1459 -0
  414. package/build/lib/runtime/contract_compiler.py +1918 -0
  415. package/build/lib/runtime/custom_agent_loader.py +366 -0
  416. package/build/lib/runtime/data_lineage.py +73 -0
  417. package/build/lib/runtime/delta_classifier.py +81 -0
  418. package/build/lib/runtime/dispatcher.py +47 -0
  419. package/build/lib/runtime/domain_packs.py +46 -0
  420. package/build/lib/runtime/ecosystem.py +371 -0
  421. package/build/lib/runtime/eval_gate.py +96 -0
  422. package/build/lib/runtime/guide_assert.py +45 -0
  423. package/build/lib/runtime/incident_replay.py +47 -0
  424. package/build/lib/runtime/legacy_compat.py +7 -0
  425. package/build/lib/runtime/mcp_config_writers.py +233 -0
  426. package/build/lib/runtime/mcp_lifecycle.py +175 -0
  427. package/build/lib/runtime/mcp_memory_server.py +135 -0
  428. package/build/lib/runtime/memory_parsers/__init__.py +0 -0
  429. package/build/lib/runtime/memory_parsers/chatgpt_parser.py +257 -0
  430. package/build/lib/runtime/memory_parsers/claude_import.py +107 -0
  431. package/build/lib/runtime/memory_parsers/export.py +97 -0
  432. package/build/lib/runtime/memory_parsers/gemini_import.py +91 -0
  433. package/build/lib/runtime/memory_parsers/kimi_import.py +91 -0
  434. package/build/lib/runtime/memory_store.py +215 -0
  435. package/build/lib/runtime/omc_compat.py +7 -0
  436. package/build/lib/runtime/omg_compat_contract_snapshot.json +916 -0
  437. package/build/lib/runtime/omg_contract_snapshot.json +916 -0
  438. package/build/lib/runtime/omg_mcp_server.py +212 -0
  439. package/build/lib/runtime/playwright_pack.py +169 -0
  440. package/build/lib/runtime/preflight.py +117 -0
  441. package/build/lib/runtime/proof_chain.py +228 -0
  442. package/build/lib/runtime/proof_gate.py +163 -0
  443. package/build/lib/runtime/providers/__init__.py +0 -0
  444. package/build/lib/runtime/providers/codex_provider.py +102 -0
  445. package/build/lib/runtime/providers/gemini_provider.py +109 -0
  446. package/build/lib/runtime/providers/kimi_provider.py +132 -0
  447. package/build/lib/runtime/remote_supervisor.py +64 -0
  448. package/build/lib/runtime/runtime_profile.py +61 -0
  449. package/build/lib/runtime/security_check.py +965 -0
  450. package/build/lib/runtime/subagent_dispatcher.py +469 -0
  451. package/build/lib/runtime/team_router.py +1167 -0
  452. package/build/lib/runtime/test_intent_lock.py +91 -0
  453. package/build/lib/runtime/tmux_session_manager.py +169 -0
  454. package/build/lib/runtime/tracebank.py +95 -0
  455. package/build/lib/runtime/untrusted_content.py +269 -0
  456. package/commands/OMG:doctor.md +37 -0
  457. package/commands/OMG:preflight.md +1 -1
  458. package/commands/__init__.py +1 -0
  459. package/control_plane/__init__.py +2 -0
  460. package/control_plane/openapi.yaml +260 -0
  461. package/control_plane/server.py +147 -0
  462. package/control_plane/service.py +222 -0
  463. package/dist/enterprise/bundle/.agents/skills/omg/AGENTS.fragment.md +50 -3
  464. package/dist/enterprise/bundle/.agents/skills/omg/algorithms/SKILL.md +11 -0
  465. package/dist/enterprise/bundle/.agents/skills/omg/algorithms/openai.yaml +11 -0
  466. package/dist/enterprise/bundle/.agents/skills/omg/api-twin/SKILL.md +11 -0
  467. package/dist/enterprise/bundle/.agents/skills/omg/api-twin/openai.yaml +12 -0
  468. package/dist/enterprise/bundle/.agents/skills/omg/codex-rules.md +29 -0
  469. package/dist/enterprise/bundle/.agents/skills/omg/data-lineage/SKILL.md +11 -0
  470. package/dist/enterprise/bundle/.agents/skills/omg/data-lineage/openai.yaml +12 -0
  471. package/dist/enterprise/bundle/.agents/skills/omg/delta-classifier/SKILL.md +11 -0
  472. package/dist/enterprise/bundle/.agents/skills/omg/delta-classifier/openai.yaml +12 -0
  473. package/dist/enterprise/bundle/.agents/skills/omg/eval-gate/SKILL.md +11 -0
  474. package/dist/enterprise/bundle/.agents/skills/omg/eval-gate/openai.yaml +12 -0
  475. package/dist/enterprise/bundle/.agents/skills/omg/health/SKILL.md +11 -0
  476. package/dist/enterprise/bundle/.agents/skills/omg/health/openai.yaml +11 -0
  477. package/dist/enterprise/bundle/.agents/skills/omg/incident-replay/SKILL.md +11 -0
  478. package/dist/enterprise/bundle/.agents/skills/omg/incident-replay/openai.yaml +12 -0
  479. package/dist/enterprise/bundle/.agents/skills/omg/preflight/SKILL.md +11 -0
  480. package/dist/enterprise/bundle/.agents/skills/omg/preflight/openai.yaml +12 -0
  481. package/dist/enterprise/bundle/.agents/skills/omg/remote-supervisor/SKILL.md +11 -0
  482. package/dist/enterprise/bundle/.agents/skills/omg/remote-supervisor/openai.yaml +12 -0
  483. package/dist/enterprise/bundle/.agents/skills/omg/robotics/SKILL.md +11 -0
  484. package/dist/enterprise/bundle/.agents/skills/omg/robotics/openai.yaml +11 -0
  485. package/dist/enterprise/bundle/.agents/skills/omg/security-check/SKILL.md +11 -0
  486. package/dist/enterprise/bundle/.agents/skills/omg/security-check/openai.yaml +13 -0
  487. package/dist/enterprise/bundle/.agents/skills/omg/tracebank/SKILL.md +11 -0
  488. package/dist/enterprise/bundle/.agents/skills/omg/tracebank/openai.yaml +12 -0
  489. package/dist/enterprise/bundle/.agents/skills/omg/vision/SKILL.md +11 -0
  490. package/dist/enterprise/bundle/.agents/skills/omg/vision/openai.yaml +11 -0
  491. package/dist/enterprise/bundle/.claude-plugin/marketplace.json +5 -5
  492. package/dist/enterprise/bundle/.claude-plugin/plugin.json +1 -1
  493. package/dist/enterprise/bundle/OMG_COMPAT_CONTRACT.md +1 -1
  494. package/dist/enterprise/bundle/plugins/advanced/commands/OMG:code-review.md +114 -0
  495. package/dist/enterprise/bundle/plugins/advanced/commands/OMG:deep-plan.md +221 -0
  496. package/dist/enterprise/bundle/plugins/advanced/commands/OMG:handoff.md +115 -0
  497. package/dist/enterprise/bundle/plugins/advanced/commands/OMG:learn.md +110 -0
  498. package/dist/enterprise/bundle/plugins/advanced/commands/OMG:maintainer.md +31 -0
  499. package/dist/enterprise/bundle/plugins/advanced/commands/OMG:ralph-start.md +43 -0
  500. package/dist/enterprise/bundle/plugins/advanced/commands/OMG:ralph-stop.md +23 -0
  501. package/dist/enterprise/bundle/plugins/advanced/commands/OMG:security-review.md +16 -0
  502. package/dist/enterprise/bundle/plugins/advanced/commands/OMG:sequential-thinking.md +20 -0
  503. package/dist/enterprise/bundle/plugins/advanced/commands/OMG:ship.md +46 -0
  504. package/dist/enterprise/bundle/plugins/advanced/plugin.json +87 -0
  505. package/dist/enterprise/bundle/registry/bundles/algorithms.yaml +45 -0
  506. package/dist/enterprise/bundle/registry/bundles/api-twin.yaml +48 -0
  507. package/dist/enterprise/bundle/registry/bundles/control-plane.yaml +151 -0
  508. package/dist/enterprise/bundle/registry/bundles/data-lineage.yaml +47 -0
  509. package/dist/enterprise/bundle/registry/bundles/delta-classifier.yaml +47 -0
  510. package/dist/enterprise/bundle/registry/bundles/eval-gate.yaml +47 -0
  511. package/dist/enterprise/bundle/registry/bundles/health.yaml +45 -0
  512. package/dist/enterprise/bundle/registry/bundles/hook-governor.yaml +97 -0
  513. package/dist/enterprise/bundle/registry/bundles/incident-replay.yaml +47 -0
  514. package/dist/enterprise/bundle/registry/bundles/lsp-pack.yaml +48 -0
  515. package/dist/enterprise/bundle/registry/bundles/mcp-fabric.yaml +53 -0
  516. package/dist/enterprise/bundle/registry/bundles/preflight.yaml +48 -0
  517. package/dist/enterprise/bundle/registry/bundles/remote-supervisor.yaml +49 -0
  518. package/dist/enterprise/bundle/registry/bundles/robotics.yaml +45 -0
  519. package/dist/enterprise/bundle/registry/bundles/secure-worktree-pipeline.yaml +54 -0
  520. package/dist/enterprise/bundle/registry/bundles/security-check.yaml +50 -0
  521. package/dist/enterprise/bundle/registry/bundles/tracebank.yaml +47 -0
  522. package/dist/enterprise/bundle/registry/bundles/vision.yaml +45 -0
  523. package/dist/enterprise/bundle/registry/omg-capability.schema.json +296 -0
  524. package/dist/enterprise/bundle/settings.json +233 -5
  525. package/dist/enterprise/manifest.json +216 -12
  526. package/dist/public/bundle/.agents/skills/omg/AGENTS.fragment.md +50 -3
  527. package/dist/public/bundle/.agents/skills/omg/algorithms/SKILL.md +11 -0
  528. package/dist/public/bundle/.agents/skills/omg/algorithms/openai.yaml +11 -0
  529. package/dist/public/bundle/.agents/skills/omg/api-twin/SKILL.md +11 -0
  530. package/dist/public/bundle/.agents/skills/omg/api-twin/openai.yaml +12 -0
  531. package/dist/public/bundle/.agents/skills/omg/codex-rules.md +29 -0
  532. package/dist/public/bundle/.agents/skills/omg/data-lineage/SKILL.md +11 -0
  533. package/dist/public/bundle/.agents/skills/omg/data-lineage/openai.yaml +12 -0
  534. package/dist/public/bundle/.agents/skills/omg/delta-classifier/SKILL.md +11 -0
  535. package/dist/public/bundle/.agents/skills/omg/delta-classifier/openai.yaml +12 -0
  536. package/dist/public/bundle/.agents/skills/omg/eval-gate/SKILL.md +11 -0
  537. package/dist/public/bundle/.agents/skills/omg/eval-gate/openai.yaml +12 -0
  538. package/dist/public/bundle/.agents/skills/omg/health/SKILL.md +11 -0
  539. package/dist/public/bundle/.agents/skills/omg/health/openai.yaml +11 -0
  540. package/dist/public/bundle/.agents/skills/omg/incident-replay/SKILL.md +11 -0
  541. package/dist/public/bundle/.agents/skills/omg/incident-replay/openai.yaml +12 -0
  542. package/dist/public/bundle/.agents/skills/omg/preflight/SKILL.md +11 -0
  543. package/dist/public/bundle/.agents/skills/omg/preflight/openai.yaml +12 -0
  544. package/dist/public/bundle/.agents/skills/omg/remote-supervisor/SKILL.md +11 -0
  545. package/dist/public/bundle/.agents/skills/omg/remote-supervisor/openai.yaml +12 -0
  546. package/dist/public/bundle/.agents/skills/omg/robotics/SKILL.md +11 -0
  547. package/dist/public/bundle/.agents/skills/omg/robotics/openai.yaml +11 -0
  548. package/dist/public/bundle/.agents/skills/omg/security-check/SKILL.md +11 -0
  549. package/dist/public/bundle/.agents/skills/omg/security-check/openai.yaml +13 -0
  550. package/dist/public/bundle/.agents/skills/omg/tracebank/SKILL.md +11 -0
  551. package/dist/public/bundle/.agents/skills/omg/tracebank/openai.yaml +12 -0
  552. package/dist/public/bundle/.agents/skills/omg/vision/SKILL.md +11 -0
  553. package/dist/public/bundle/.agents/skills/omg/vision/openai.yaml +11 -0
  554. package/dist/public/bundle/.claude-plugin/marketplace.json +5 -5
  555. package/dist/public/bundle/.claude-plugin/plugin.json +1 -1
  556. package/dist/public/bundle/OMG_COMPAT_CONTRACT.md +1 -1
  557. package/dist/public/bundle/plugins/advanced/commands/OMG:code-review.md +114 -0
  558. package/dist/public/bundle/plugins/advanced/commands/OMG:deep-plan.md +221 -0
  559. package/dist/public/bundle/plugins/advanced/commands/OMG:handoff.md +115 -0
  560. package/dist/public/bundle/plugins/advanced/commands/OMG:learn.md +110 -0
  561. package/dist/public/bundle/plugins/advanced/commands/OMG:maintainer.md +31 -0
  562. package/dist/public/bundle/plugins/advanced/commands/OMG:ralph-start.md +43 -0
  563. package/dist/public/bundle/plugins/advanced/commands/OMG:ralph-stop.md +23 -0
  564. package/dist/public/bundle/plugins/advanced/commands/OMG:security-review.md +16 -0
  565. package/dist/public/bundle/plugins/advanced/commands/OMG:sequential-thinking.md +20 -0
  566. package/dist/public/bundle/plugins/advanced/commands/OMG:ship.md +46 -0
  567. package/dist/public/bundle/plugins/advanced/plugin.json +87 -0
  568. package/dist/public/bundle/registry/bundles/algorithms.yaml +45 -0
  569. package/dist/public/bundle/registry/bundles/api-twin.yaml +48 -0
  570. package/dist/public/bundle/registry/bundles/control-plane.yaml +151 -0
  571. package/dist/public/bundle/registry/bundles/data-lineage.yaml +47 -0
  572. package/dist/public/bundle/registry/bundles/delta-classifier.yaml +47 -0
  573. package/dist/public/bundle/registry/bundles/eval-gate.yaml +47 -0
  574. package/dist/public/bundle/registry/bundles/health.yaml +45 -0
  575. package/dist/public/bundle/registry/bundles/hook-governor.yaml +97 -0
  576. package/dist/public/bundle/registry/bundles/incident-replay.yaml +47 -0
  577. package/dist/public/bundle/registry/bundles/lsp-pack.yaml +48 -0
  578. package/dist/public/bundle/registry/bundles/mcp-fabric.yaml +53 -0
  579. package/dist/public/bundle/registry/bundles/preflight.yaml +48 -0
  580. package/dist/public/bundle/registry/bundles/remote-supervisor.yaml +49 -0
  581. package/dist/public/bundle/registry/bundles/robotics.yaml +45 -0
  582. package/dist/public/bundle/registry/bundles/secure-worktree-pipeline.yaml +54 -0
  583. package/dist/public/bundle/registry/bundles/security-check.yaml +50 -0
  584. package/dist/public/bundle/registry/bundles/tracebank.yaml +47 -0
  585. package/dist/public/bundle/registry/bundles/vision.yaml +45 -0
  586. package/dist/public/bundle/registry/omg-capability.schema.json +296 -0
  587. package/dist/public/bundle/settings.json +232 -4
  588. package/dist/public/manifest.json +216 -12
  589. package/docs/assets/omg-hud.svg +32 -0
  590. package/docs/install/claude-code.md +31 -0
  591. package/docs/install/codex.md +29 -0
  592. package/docs/migration/native-adoption.md +57 -0
  593. package/docs/proof.md +65 -0
  594. package/docs/release-checklist.md +40 -0
  595. package/docs/transcripts/crazy.md +17 -0
  596. package/docs/transcripts/setup.md +25 -0
  597. package/hooks/policy_engine.py +122 -17
  598. package/hooks/setup_wizard.py +52 -12
  599. package/hooks/shadow_manager.py +27 -0
  600. package/package.json +2 -2
  601. package/plugins/README.md +5 -1
  602. package/plugins/__init__.py +1 -0
  603. package/plugins/advanced/commands/OMG:deep-plan.md +50 -6
  604. package/plugins/advanced/commands/OMG:ship.md +1 -1
  605. package/plugins/advanced/plugin.json +1 -10
  606. package/plugins/core/plugin.json +7 -1
  607. package/pyproject.toml +39 -3
  608. package/registry/__init__.py +1 -0
  609. package/registry/bundles/algorithms.yaml +45 -0
  610. package/registry/bundles/api-twin.yaml +48 -0
  611. package/registry/bundles/claim-judge.yaml +49 -0
  612. package/registry/bundles/control-plane.yaml +151 -0
  613. package/registry/bundles/data-lineage.yaml +47 -0
  614. package/registry/bundles/delta-classifier.yaml +47 -0
  615. package/registry/bundles/eval-gate.yaml +47 -0
  616. package/registry/bundles/health.yaml +45 -0
  617. package/registry/bundles/hook-governor.yaml +97 -0
  618. package/registry/bundles/incident-replay.yaml +47 -0
  619. package/registry/bundles/lsp-pack.yaml +48 -0
  620. package/registry/bundles/mcp-fabric.yaml +53 -0
  621. package/registry/bundles/plan-council.yaml +51 -0
  622. package/registry/bundles/preflight.yaml +48 -0
  623. package/registry/bundles/proof-gate.yaml +49 -0
  624. package/registry/bundles/remote-supervisor.yaml +49 -0
  625. package/registry/bundles/robotics.yaml +45 -0
  626. package/registry/bundles/secure-worktree-pipeline.yaml +54 -0
  627. package/registry/bundles/security-check.yaml +50 -0
  628. package/registry/bundles/test-intent-lock.yaml +49 -0
  629. package/registry/bundles/tracebank.yaml +47 -0
  630. package/registry/bundles/vision.yaml +45 -0
  631. package/registry/omg-capability.schema.json +296 -0
  632. package/registry/verify_artifact.py +90 -0
  633. package/runtime/adapters/claude.py +3 -0
  634. package/runtime/adapters/gpt.py +3 -0
  635. package/runtime/adapters/local.py +3 -0
  636. package/runtime/adoption.py +1 -1
  637. package/runtime/api_twin.py +334 -14
  638. package/runtime/asset_loader.py +62 -0
  639. package/runtime/business_workflow.py +14 -0
  640. package/runtime/claim_judge.py +95 -0
  641. package/runtime/compat.py +142 -2
  642. package/runtime/contract_compiler.py +1270 -50
  643. package/runtime/data_lineage.py +73 -0
  644. package/runtime/delta_classifier.py +81 -0
  645. package/runtime/domain_packs.py +12 -0
  646. package/runtime/ecosystem.py +1 -1
  647. package/runtime/eval_gate.py +96 -0
  648. package/runtime/incident_replay.py +47 -0
  649. package/runtime/mcp_config_writers.py +12 -0
  650. package/runtime/mcp_lifecycle.py +31 -9
  651. package/runtime/mcp_memory_server.py +1 -1
  652. package/runtime/omg_compat_contract_snapshot.json +1 -1
  653. package/runtime/omg_contract_snapshot.json +1 -1
  654. package/runtime/omg_mcp_server.py +16 -9
  655. package/runtime/playwright_pack.py +169 -0
  656. package/runtime/preflight.py +66 -1
  657. package/runtime/proof_chain.py +228 -0
  658. package/runtime/proof_gate.py +163 -0
  659. package/runtime/remote_supervisor.py +64 -0
  660. package/runtime/security_check.py +626 -8
  661. package/runtime/team_router.py +6 -6
  662. package/runtime/test_intent_lock.py +91 -0
  663. package/runtime/tracebank.py +95 -0
  664. package/runtime/untrusted_content.py +172 -5
  665. package/scripts/check-omg-public-ready.py +77 -0
  666. package/scripts/omg.py +207 -3
  667. package/scripts/verify-standalone.sh +7 -0
  668. package/settings.json +233 -5
@@ -0,0 +1,1459 @@
1
+ """OMG standalone legacy-compat dispatcher.
2
+
3
+ Primary namespace is `compat/*` while legacy `omg/*` aliases remain supported.
4
+ """
5
+ from __future__ import annotations
6
+
7
+ from collections import Counter
8
+ from datetime import datetime, timezone
9
+ import json
10
+ import os
11
+ from pathlib import Path
12
+ import re
13
+ import sys
14
+ from typing import Any
15
+
16
+ from hooks.policy_engine import evaluate_bash_command
17
+ from lab.pipeline import run_pipeline
18
+ from runtime.adoption import CANONICAL_VERSION
19
+ from runtime.dispatcher import dispatch_runtime
20
+ from runtime.security_check import run_security_check
21
+ from runtime.team_router import TeamDispatchRequest, dispatch_team
22
+
23
+ CONTRACT_SNAPSHOT_SCHEMA = "OmgCompatContractSnapshot"
24
+ LEGACY_CONTRACT_SNAPSHOT_SCHEMA = "OmgCompatContractSnapshot"
25
+ CONTRACT_SNAPSHOT_VERSION = CANONICAL_VERSION
26
+ LEGACY_SNAPSHOT_VERSION = "0.9.0"
27
+ GAP_REPORT_SCHEMA = "OmgCompatGapReport"
28
+ LEGACY_GAP_REPORT_SCHEMA = "OmgCompatGapReport"
29
+ RESULT_SCHEMA = "OmgCompatResult"
30
+ LEGACY_RESULT_SCHEMA = "OmgCompatResult"
31
+ DEFAULT_CONTRACT_SNAPSHOT_PATH = "runtime/omg_compat_contract_snapshot.json"
32
+ LEGACY_CONTRACT_SNAPSHOT_PATH = "runtime/omg_contract_snapshot.json"
33
+ DEFAULT_GAP_REPORT_PATH = ".omg/evidence/omg-compat-gap.json"
34
+ LEGACY_GAP_REPORT_PATH = ".omg/evidence/compat-gap.json"
35
+ DEFAULT_AUDIT_LEDGER_PATH = ".omg/state/ledger/omg-compat-audit.jsonl"
36
+ LEGACY_AUDIT_LEDGER_PATH = ".omg/state/ledger/compat-audit.jsonl"
37
+ DEFAULT_EVENT_DISPATCH = "compat_dispatch"
38
+ DEFAULT_EVENT_REQUEST = "compat_dispatch_request"
39
+ LEGACY_EVENT_ALIASES: dict[str, str] = {
40
+ DEFAULT_EVENT_DISPATCH: "omg_dispatch",
41
+ DEFAULT_EVENT_REQUEST: "omg_dispatch_request",
42
+ }
43
+
44
+ MAX_PROBLEM_CHARS = 4000
45
+ MAX_CONTEXT_CHARS = 12000
46
+ MAX_EXPECTED_OUTCOME_CHARS = 3000
47
+ MAX_FILES_PER_REQUEST = 50
48
+ MAX_FILE_PATH_CHARS = 260
49
+ WINDOWS_ABS_PATH_RE = re.compile(r"^[A-Za-z]:[\\/]")
50
+
51
+
52
+ def _now() -> str:
53
+ return datetime.now(timezone.utc).isoformat()
54
+
55
+
56
+ def _project_dir(project_dir: str | None) -> str:
57
+ return project_dir or os.environ.get("CLAUDE_PROJECT_DIR", os.getcwd())
58
+
59
+
60
+ def _is_safe_relative_path(file_path: str) -> bool:
61
+ normalized = file_path.replace("\\", "/")
62
+ if not normalized or normalized.startswith(("/", "~")) or normalized.startswith("//"):
63
+ return False
64
+ if WINDOWS_ABS_PATH_RE.match(file_path):
65
+ return False
66
+ parts = [part for part in normalized.split("/") if part not in {"", "."}]
67
+ return ".." not in parts
68
+
69
+
70
+ LEGACY_SKILL_ROUTES: dict[str, str] = {
71
+ "analyze": "maintainer",
72
+ "autopilot": "runtime_ship",
73
+ "beads": "maintainer",
74
+ "build-fix": "runtime_ship",
75
+ "cancel": "cancel",
76
+ "ccg": "ccg",
77
+ "claude-flow": "ccg",
78
+ "claude-mem": "memory",
79
+ "code-review": "review",
80
+ "compound-engineering": "ccg",
81
+ "compounding-engineering": "ccg",
82
+ "configure-notifications": "health",
83
+ "configure-openclaw": "health",
84
+ "deepinit": "init",
85
+ "external-context": "teams",
86
+ "hooks-mastery": "health",
87
+ "hud": "health",
88
+ "learn-about-omg": "learn",
89
+ "learner": "learn",
90
+ "mcp-setup": "health",
91
+ "memsearch": "memory",
92
+ "note": "memory",
93
+ "omg-doctor": "health",
94
+ "omg-help": "help",
95
+ "omg-setup": "init",
96
+ "omg-teams": "teams",
97
+ "pipeline": "pipeline",
98
+ "plan": "plan",
99
+ "planning-with-files": "plan",
100
+ "project-session-manager": "memory",
101
+ "ralph": "runtime_ship",
102
+ "ralph-wiggum": "runtime_ship",
103
+ "ralph-init": "init",
104
+ "ralplan": "plan",
105
+ "release": "runtime_ship",
106
+ "review": "review",
107
+ "sci-omg": "maintainer",
108
+ "security-review": "security_check",
109
+ "skill": "learn",
110
+ "omg-superpowers": "plan",
111
+ "tdd": "plan",
112
+ "team": "teams",
113
+ "trace": "maintainer",
114
+ "ultrapilot": "runtime_ship",
115
+ "ultraqa": "review",
116
+ "ultrawork": "runtime_ship",
117
+ "writer-memory": "memory",
118
+ }
119
+ # Backward-compatible export
120
+ OMG_COMPAT_SKILL_ROUTES = LEGACY_SKILL_ROUTES
121
+
122
+ ROUTE_MATURITY: dict[str, str] = {
123
+ "teams": "native",
124
+ "ccg": "native",
125
+ "runtime_ship": "native",
126
+ "pipeline": "native",
127
+ "memory": "native",
128
+ "init": "native",
129
+ "health": "native",
130
+ "help": "native",
131
+ "review": "native",
132
+ "plan": "native",
133
+ "secure": "native",
134
+ "security_check": "native",
135
+ "learn": "native",
136
+ "maintainer": "native",
137
+ "cancel": "native",
138
+ }
139
+
140
+ SKILL_MATURITY_OVERRIDES: dict[str, str] = {
141
+ # Next-phase native promotion batch
142
+ "autopilot": "native",
143
+ "ralph": "native",
144
+ "ultrapilot": "native",
145
+ "ultrawork": "native",
146
+ "review": "native",
147
+ "code-review": "native",
148
+ "ultraqa": "native",
149
+ "release": "native",
150
+ "tdd": "native",
151
+ "plan": "native",
152
+ "ralplan": "native",
153
+ # Final bridge -> native promotion batch
154
+ "analyze": "native",
155
+ "build-fix": "native",
156
+ "learn-about-omg": "native",
157
+ "learner": "native",
158
+ "note": "native",
159
+ "project-session-manager": "native",
160
+ "sci-omg": "native",
161
+ "skill": "native",
162
+ "trace": "native",
163
+ "writer-memory": "native",
164
+ # Ecosystem imports promoted as first-class native routes
165
+ "omg-superpowers": "native",
166
+ "ralph-wiggum": "native",
167
+ "claude-flow": "native",
168
+ "claude-mem": "native",
169
+ "memsearch": "native",
170
+ "beads": "native",
171
+ "planning-with-files": "native",
172
+ "hooks-mastery": "native",
173
+ "compound-engineering": "native",
174
+ "compounding-engineering": "native",
175
+ }
176
+
177
+ ROUTE_INPUTS: dict[str, dict[str, Any]] = {
178
+ "teams": {"required": ["problem"], "optional": ["context", "files", "expected_outcome"]},
179
+ "ccg": {"required": ["problem"], "optional": ["context", "files", "expected_outcome"]},
180
+ "runtime_ship": {"required": ["problem"], "optional": ["expected_outcome"]},
181
+ "pipeline": {"required": ["problem"], "optional": ["context"]},
182
+ "memory": {"required": ["problem"], "optional": ["context"]},
183
+ "init": {"required": [], "optional": ["problem"]},
184
+ "health": {"required": [], "optional": ["problem"]},
185
+ "help": {"required": [], "optional": []},
186
+ "review": {"required": ["problem"], "optional": ["context", "files"]},
187
+ "plan": {"required": ["problem"], "optional": ["expected_outcome"]},
188
+ "secure": {"required": ["problem"], "optional": []},
189
+ "security_check": {"required": [], "optional": ["problem"]},
190
+ "learn": {"required": ["problem"], "optional": ["context"]},
191
+ "maintainer": {"required": ["problem"], "optional": ["context"]},
192
+ "cancel": {"required": [], "optional": []},
193
+ }
194
+
195
+ ROUTE_OUTPUTS: dict[str, dict[str, Any]] = {
196
+ "teams": {"schema": "TeamDispatchResult"},
197
+ "ccg": {"schema": "TeamDispatchResult"},
198
+ "runtime_ship": {"schema": "RuntimeDispatchResult"},
199
+ "pipeline": {"schema": "LabPipelineResult"},
200
+ "memory": {"schema": "StateMutationResult"},
201
+ "init": {"schema": "BootstrapResult"},
202
+ "health": {"schema": "HealthSnapshot"},
203
+ "help": {"schema": "CompatibilityHelp"},
204
+ "review": {"schema": "TeamDispatchResult"},
205
+ "plan": {"schema": "PlanningArtifacts"},
206
+ "secure": {"schema": "PolicyDecision"},
207
+ "security_check": {"schema": "SecurityCheckResult"},
208
+ "learn": {"schema": "LearningArtifact"},
209
+ "maintainer": {"schema": "MaintainerCompatArtifact"},
210
+ "cancel": {"schema": "CancelResult"},
211
+ }
212
+
213
+ ROUTE_SIDE_EFFECTS: dict[str, list[str]] = {
214
+ "teams": [],
215
+ "ccg": [],
216
+ "runtime_ship": [],
217
+ "pipeline": [],
218
+ "memory": [".omg/state/working-memory.md", ".omg/state/session.json (psm only)"],
219
+ "init": [".omg/state/*", ".omg/idea.yml", ".omg/policy.yaml", ".omg/runtime.yaml"],
220
+ "health": [],
221
+ "help": [],
222
+ "review": [],
223
+ "plan": [".omg/state/_plan.md", ".omg/state/_checklist.md", ".omg/idea.yml"],
224
+ "secure": [],
225
+ "security_check": [],
226
+ "learn": [".omg/state/working-memory.md"],
227
+ "maintainer": [".omg/evidence/compat-*.json"],
228
+ "cancel": [".omg/shadow/active-run (removed when exists)"],
229
+ }
230
+
231
+ SKILL_OUTPUT_SCHEMA_OVERRIDES: dict[str, str] = {
232
+ "review": "ReviewSynthesis",
233
+ "code-review": "ReviewSynthesis",
234
+ "ultraqa": "ReviewSynthesis",
235
+ "analyze": "AnalysisCompatArtifact",
236
+ "trace": "AnalysisCompatArtifact",
237
+ "sci-omg": "AnalysisCompatArtifact",
238
+ "project-session-manager": "SessionState",
239
+ }
240
+
241
+ SKILL_SIDE_EFFECT_OVERRIDES: dict[str, list[str]] = {
242
+ "autopilot": [".omg/state/persistent-mode.json"],
243
+ "ralph": [".omg/state/persistent-mode.json"],
244
+ "ralph-wiggum": [".omg/state/persistent-mode.json"],
245
+ "ultrapilot": [".omg/state/persistent-mode.json"],
246
+ "ultrawork": [".omg/state/persistent-mode.json"],
247
+ "release": [".omg/evidence/release-draft.md"],
248
+ "build-fix": [".omg/state/build-fix.md"],
249
+ "analyze": [".omg/evidence/analysis-analyze.json"],
250
+ "trace": [".omg/evidence/analysis-trace.json"],
251
+ "sci-omg": [".omg/evidence/analysis-sci-omg.json"],
252
+ "project-session-manager": [".omg/state/session.json"],
253
+ "learn-about-omg": [".omg/knowledge/learning/learn-about-omg.md"],
254
+ "learner": [".omg/knowledge/learning/learner.md"],
255
+ "skill": [".omg/knowledge/learning/skill.md"],
256
+ "note": [".omg/knowledge/notes.md"],
257
+ "writer-memory": [".omg/knowledge/writer-memory.md"],
258
+ "omg-superpowers": [".omg/state/_plan.md", ".omg/state/_checklist.md"],
259
+ "planning-with-files": [".omg/state/_plan.md", ".omg/state/_checklist.md"],
260
+ "claude-mem": [".omg/state/working-memory.md"],
261
+ "memsearch": [".omg/state/working-memory.md"],
262
+ "beads": [".omg/evidence/compat-beads.json"],
263
+ "hooks-mastery": [],
264
+ "claude-flow": [],
265
+ "compound-engineering": [],
266
+ "compounding-engineering": [],
267
+ }
268
+
269
+ SKILL_ROUTE_NOTES: dict[str, str] = {
270
+ "omg-teams": "Legacy tmux worker dispatch replaced by internal Team router.",
271
+ "project-session-manager": "Session metadata maintained in .omg/state/session.json.",
272
+ "omg-setup": "Bootstraps OMG standalone state and baseline config files.",
273
+ "omg-doctor": "Health checks run against OMG standalone layout.",
274
+ "pipeline": "Routes to OMG lab policy+pipeline executor.",
275
+ "release": "Routes to runtime ship and emits release draft artifact.",
276
+ "tdd": "Generates plan/checklist scaffolding for red-green-refactor workflow.",
277
+ "security-review": "Deprecated alias to the canonical OMG security-check engine.",
278
+ "build-fix": "Creates targeted fix checklist and routes execution to runtime.",
279
+ "analyze": "Writes structured analysis evidence artifact.",
280
+ "trace": "Writes trace evidence artifact for debugging chain.",
281
+ "learner": "Writes learning note into .omg/knowledge/learning.",
282
+ "writer-memory": "Writes long-form memory artifact for writing workflows.",
283
+ "omg-superpowers": "Imports TDD-first planning discipline into OMG plan route.",
284
+ "ralph-wiggum": "Persistent iteration loop via runtime persistent-mode state.",
285
+ "claude-flow": "Maps to CCG route for multi-agent orchestration semantics.",
286
+ "claude-mem": "Maps to memory route for durable working-context updates.",
287
+ "memsearch": "Maps to memory route for retrieval-oriented context search workflow.",
288
+ "beads": "Maps to maintainer route for context engineering artifacts.",
289
+ "planning-with-files": "Strengthens file-native planning artifacts in .omg/state.",
290
+ "hooks-mastery": "Maps to health route for hook quality and readiness checks.",
291
+ "compound-engineering": "Maps to CCG route for compounding, iterative orchestration.",
292
+ "compounding-engineering": "Alias to compound-engineering orchestration route.",
293
+ }
294
+
295
+
296
+ def _contract_for(skill: str, route: str) -> dict[str, Any]:
297
+ outputs = dict(ROUTE_OUTPUTS.get(route, {"schema": "Unknown"}))
298
+ if skill in SKILL_OUTPUT_SCHEMA_OVERRIDES:
299
+ outputs["schema"] = SKILL_OUTPUT_SCHEMA_OVERRIDES[skill]
300
+ side_effects = SKILL_SIDE_EFFECT_OVERRIDES.get(skill, ROUTE_SIDE_EFFECTS.get(route, []))
301
+ return {
302
+ "skill": skill,
303
+ "route": route,
304
+ "maturity": SKILL_MATURITY_OVERRIDES.get(skill, ROUTE_MATURITY.get(route, "bridge")),
305
+ "inputs": ROUTE_INPUTS.get(route, {"required": [], "optional": []}),
306
+ "outputs": outputs,
307
+ "side_effects": side_effects,
308
+ "notes": SKILL_ROUTE_NOTES.get(skill, ""),
309
+ }
310
+
311
+
312
+ LEGACY_SKILL_CONTRACTS: dict[str, dict[str, Any]] = {
313
+ skill: _contract_for(skill, route) for skill, route in LEGACY_SKILL_ROUTES.items()
314
+ }
315
+ # Backward-compatible export
316
+ OMG_COMPAT_SKILL_CONTRACTS = LEGACY_SKILL_CONTRACTS
317
+
318
+
319
+ def list_compat_skills() -> list[str]:
320
+ return sorted(LEGACY_SKILL_ROUTES.keys())
321
+
322
+
323
+ def list_compat_skill_contracts() -> list[dict[str, Any]]:
324
+ return [LEGACY_SKILL_CONTRACTS[name] for name in list_compat_skills()]
325
+
326
+
327
+ def get_compat_skill_contract(skill: str) -> dict[str, Any] | None:
328
+ return LEGACY_SKILL_CONTRACTS.get(skill)
329
+
330
+
331
+ def build_contract_snapshot_payload(*, include_generated_at: bool = True) -> dict[str, Any]:
332
+ payload: dict[str, Any] = {
333
+ "schema": CONTRACT_SNAPSHOT_SCHEMA,
334
+ "contract_version": CONTRACT_SNAPSHOT_VERSION,
335
+ "count": len(LEGACY_SKILL_CONTRACTS),
336
+ "contracts": list_compat_skill_contracts(),
337
+ }
338
+ if include_generated_at:
339
+ payload["generated_at"] = _now()
340
+ return payload
341
+
342
+
343
+ def migrate_contract_snapshot_payload(payload: dict[str, Any]) -> tuple[dict[str, Any], list[str]]:
344
+ migrated = dict(payload)
345
+ migrations: list[str] = []
346
+
347
+ if "schema" not in migrated:
348
+ migrated["schema"] = LEGACY_CONTRACT_SNAPSHOT_SCHEMA
349
+ migrations.append("assign-missing-schema:legacy-omg")
350
+
351
+ if migrated.get("schema") == LEGACY_CONTRACT_SNAPSHOT_SCHEMA:
352
+ migrated["schema"] = CONTRACT_SNAPSHOT_SCHEMA
353
+ migrations.append("migrate-schema-legacy-to-omg")
354
+
355
+ if "contract_version" not in migrated:
356
+ migrated["contract_version"] = LEGACY_SNAPSHOT_VERSION
357
+ migrations.append("assign-missing-contract-version:0.9.0")
358
+
359
+ if migrated.get("contract_version") == LEGACY_SNAPSHOT_VERSION:
360
+ # v0.9.0 lacked explicit schema/version constraints.
361
+ migrated["schema"] = CONTRACT_SNAPSHOT_SCHEMA
362
+ migrated["contract_version"] = CONTRACT_SNAPSHOT_VERSION
363
+ migrations.append(f"migrate-0.9.0-to-{CONTRACT_SNAPSHOT_VERSION}")
364
+
365
+ return migrated, migrations
366
+
367
+
368
+ def build_compat_gap_report(project_dir: str | None = None) -> dict[str, Any]:
369
+ root = _project_dir(project_dir)
370
+ _ensure_state_layout(root)
371
+ contracts = list_compat_skill_contracts()
372
+ maturity_counts = Counter(c["maturity"] for c in contracts)
373
+ route_counts = Counter(c["route"] for c in contracts)
374
+ bridge_skills = [c["skill"] for c in contracts if c["maturity"] != "native"]
375
+ report = {
376
+ "schema": GAP_REPORT_SCHEMA,
377
+ "generated_at": _now(),
378
+ "total_skills": len(contracts),
379
+ "maturity_counts": dict(sorted(maturity_counts.items())),
380
+ "route_counts": dict(sorted(route_counts.items())),
381
+ "native_skills": sorted(c["skill"] for c in contracts if c["maturity"] == "native"),
382
+ "bridge_skills": sorted(bridge_skills),
383
+ }
384
+ out = os.path.join(root, DEFAULT_GAP_REPORT_PATH)
385
+ with open(out, "w", encoding="utf-8") as f:
386
+ json.dump(report, f, indent=2, ensure_ascii=True)
387
+ legacy_out = os.path.join(root, LEGACY_GAP_REPORT_PATH)
388
+ if legacy_out != out:
389
+ with open(legacy_out, "w", encoding="utf-8") as f:
390
+ json.dump(report, f, indent=2, ensure_ascii=True)
391
+ report["report_path"] = out
392
+ report["legacy_report_path"] = legacy_out
393
+ return report
394
+
395
+
396
+ def _result(
397
+ *,
398
+ skill: str,
399
+ route: str,
400
+ status: str = "ok",
401
+ routed_to: str = "",
402
+ findings: list[str] | None = None,
403
+ actions: list[str] | None = None,
404
+ artifacts: list[str] | None = None,
405
+ result: dict[str, Any] | None = None,
406
+ ) -> dict[str, Any]:
407
+ return {
408
+ "schema": RESULT_SCHEMA,
409
+ "status": status,
410
+ "skill": skill,
411
+ "route": route,
412
+ "routed_to": routed_to,
413
+ "contract": get_compat_skill_contract(skill) or {},
414
+ "findings": findings or [],
415
+ "actions": actions or [],
416
+ "artifacts": artifacts or [],
417
+ "result": result or {},
418
+ "generated_at": _now(),
419
+ }
420
+
421
+
422
+ def _ensure_state_layout(project_dir: str) -> None:
423
+ for rel in ["state", "knowledge", "evidence", "trust", "shadow"]:
424
+ os.makedirs(os.path.join(project_dir, ".omg", rel), exist_ok=True)
425
+
426
+
427
+ def _append_audit_event(project_dir: str, event: dict[str, Any]) -> None:
428
+ _ensure_state_layout(project_dir)
429
+ ledger_dir = os.path.join(project_dir, ".omg", "state", "ledger")
430
+ os.makedirs(ledger_dir, exist_ok=True)
431
+ payload = dict(event)
432
+ payload.setdefault("ts", _now())
433
+ payloads = [payload]
434
+ event_name = str(payload.get("event", ""))
435
+ if event_name in LEGACY_EVENT_ALIASES:
436
+ legacy_payload = dict(payload)
437
+ legacy_payload["event"] = LEGACY_EVENT_ALIASES[event_name]
438
+ legacy_payload["alias_of"] = event_name
439
+ payloads.append(legacy_payload)
440
+ for rel in (DEFAULT_AUDIT_LEDGER_PATH, LEGACY_AUDIT_LEDGER_PATH):
441
+ ledger_path = os.path.join(project_dir, rel)
442
+ os.makedirs(os.path.dirname(ledger_path), exist_ok=True)
443
+ with open(ledger_path, "a", encoding="utf-8") as f:
444
+ for one in payloads:
445
+ f.write(json.dumps(one, ensure_ascii=True) + "\n")
446
+
447
+
448
+ def validate_compat_request(
449
+ *,
450
+ skill: str,
451
+ problem: str,
452
+ context: str,
453
+ files: list[str] | None,
454
+ expected_outcome: str,
455
+ ) -> tuple[bool, str]:
456
+ if skill not in LEGACY_SKILL_ROUTES:
457
+ return False, f"Unknown skill: {skill}"
458
+
459
+ if len(problem) > MAX_PROBLEM_CHARS:
460
+ return False, f"problem too long (max {MAX_PROBLEM_CHARS})"
461
+ if len(context) > MAX_CONTEXT_CHARS:
462
+ return False, f"context too long (max {MAX_CONTEXT_CHARS})"
463
+ if len(expected_outcome) > MAX_EXPECTED_OUTCOME_CHARS:
464
+ return False, f"expected_outcome too long (max {MAX_EXPECTED_OUTCOME_CHARS})"
465
+
466
+ route = LEGACY_SKILL_ROUTES[skill]
467
+ required = set(ROUTE_INPUTS.get(route, {}).get("required", []))
468
+ if "problem" in required and not problem.strip():
469
+ return False, "problem is required for this skill"
470
+
471
+ file_list = files or []
472
+ if len(file_list) > MAX_FILES_PER_REQUEST:
473
+ return False, f"too many files (max {MAX_FILES_PER_REQUEST})"
474
+ for file_path in file_list:
475
+ if not isinstance(file_path, str) or not file_path:
476
+ return False, "invalid file path: must be non-empty string"
477
+ if "\x00" in file_path:
478
+ return False, "invalid file path: contains null byte"
479
+ if len(file_path) > MAX_FILE_PATH_CHARS:
480
+ return False, f"invalid file path: exceeds {MAX_FILE_PATH_CHARS} chars"
481
+ if file_path != file_path.strip():
482
+ return False, "invalid file path: leading/trailing whitespace is not allowed"
483
+ if not _is_safe_relative_path(file_path):
484
+ return False, "invalid file path: must be a safe relative path"
485
+
486
+ return True, "ok"
487
+
488
+
489
+ def _write_if_missing(path: str, content: str) -> None:
490
+ if os.path.exists(path):
491
+ return
492
+ os.makedirs(os.path.dirname(path), exist_ok=True)
493
+ with open(path, "w", encoding="utf-8") as f:
494
+ f.write(content)
495
+
496
+
497
+ def _append_memory(project_dir: str, message: str) -> str:
498
+ _ensure_state_layout(project_dir)
499
+ wm_path = os.path.join(project_dir, ".omg", "state", "working-memory.md")
500
+ ts = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%SZ")
501
+ line = f"- [{ts}] {message}\n"
502
+ with open(wm_path, "a", encoding="utf-8") as f:
503
+ f.write(line)
504
+ return wm_path
505
+
506
+
507
+ def _update_session_state(project_dir: str, message: str) -> str:
508
+ _ensure_state_layout(project_dir)
509
+ session_path = os.path.join(project_dir, ".omg", "state", "session.json")
510
+ payload: dict[str, Any] = {"last_updated": _now(), "entries": []}
511
+ if os.path.exists(session_path):
512
+ try:
513
+ with open(session_path, "r", encoding="utf-8") as f:
514
+ data = json.load(f)
515
+ if isinstance(data, dict):
516
+ payload = data
517
+ except Exception:
518
+ pass
519
+ payload.setdefault("entries", [])
520
+ if not isinstance(payload["entries"], list):
521
+ payload["entries"] = []
522
+ payload["entries"].append({"ts": _now(), "message": message})
523
+ payload["entries"] = payload["entries"][-100:]
524
+ payload["last_updated"] = _now()
525
+ with open(session_path, "w", encoding="utf-8") as f:
526
+ json.dump(payload, f, indent=2, ensure_ascii=True)
527
+ return session_path
528
+
529
+
530
+ def _append_knowledge_note(project_dir: str, rel_path: str, line: str) -> str:
531
+ _ensure_state_layout(project_dir)
532
+ full = os.path.join(project_dir, ".omg", rel_path)
533
+ os.makedirs(os.path.dirname(full), exist_ok=True)
534
+ with open(full, "a", encoding="utf-8") as f:
535
+ f.write(line.rstrip() + "\n")
536
+ return full
537
+
538
+
539
+ def _write_learning_artifact(project_dir: str, skill: str, message: str, context: str) -> str:
540
+ path = os.path.join(project_dir, ".omg", "knowledge", "learning", f"{skill}.md")
541
+ os.makedirs(os.path.dirname(path), exist_ok=True)
542
+ with open(path, "a", encoding="utf-8") as f:
543
+ f.write(f"## {_now()}\n")
544
+ f.write(f"- skill: {skill}\n")
545
+ f.write(f"- message: {message}\n")
546
+ if context:
547
+ f.write(f"- context: {context}\n")
548
+ f.write("\n")
549
+ return path
550
+
551
+
552
+ def _write_analysis_artifact(project_dir: str, skill: str, message: str, context: str, files: list[str]) -> str:
553
+ _ensure_state_layout(project_dir)
554
+ out = os.path.join(project_dir, ".omg", "evidence", f"analysis-{skill}.json")
555
+ payload = {
556
+ "schema": "AnalysisCompatArtifact",
557
+ "skill": skill,
558
+ "generated_at": _now(),
559
+ "problem": message,
560
+ "context": context,
561
+ "files": files,
562
+ "findings": [
563
+ "Structured analysis generated by OMG compat dispatcher.",
564
+ "Use review/teams routes for deeper remediation proposals.",
565
+ ],
566
+ }
567
+ with open(out, "w", encoding="utf-8") as f:
568
+ json.dump(payload, f, indent=2, ensure_ascii=True)
569
+ return out
570
+
571
+
572
+ def _write_maintainer_artifact(project_dir: str, skill: str, problem: str) -> str:
573
+ _ensure_state_layout(project_dir)
574
+ out_path = os.path.join(project_dir, ".omg", "evidence", f"compat-{skill}.json")
575
+ payload = {
576
+ "schema": "MaintainerCompatArtifact",
577
+ "skill": skill,
578
+ "generated_at": _now(),
579
+ "summary": problem or f"compat route for {skill}",
580
+ "signals": {
581
+ "triage": "unverified",
582
+ "release_notes": "unverified",
583
+ "review": "unverified",
584
+ },
585
+ }
586
+ with open(out_path, "w", encoding="utf-8") as f:
587
+ json.dump(payload, f, indent=2, ensure_ascii=True)
588
+ return out_path
589
+
590
+
591
+ def _init_bootstrap(project_dir: str, reason: str) -> list[str]:
592
+ _ensure_state_layout(project_dir)
593
+ profile_path = os.path.join(project_dir, ".omg", "state", "profile.yaml")
594
+ idea_path = os.path.join(project_dir, ".omg", "idea.yml")
595
+ policy_path = os.path.join(project_dir, ".omg", "policy.yaml")
596
+ runtime_path = os.path.join(project_dir, ".omg", "runtime.yaml")
597
+ plan_path = os.path.join(project_dir, ".omg", "state", "_plan.md")
598
+ checklist_path = os.path.join(project_dir, ".omg", "state", "_checklist.md")
599
+ qg_path = os.path.join(project_dir, ".omg", "state", "quality-gate.json")
600
+
601
+ _write_if_missing(
602
+ profile_path,
603
+ "name: omg-project\n"
604
+ "description: initialized by OMG standalone compat bootstrap\n"
605
+ "language: unknown\n"
606
+ "framework: unknown\n",
607
+ )
608
+ _write_if_missing(
609
+ idea_path,
610
+ "goal: \"\"\n"
611
+ "constraints: []\n"
612
+ "acceptance: []\n"
613
+ "risk:\n"
614
+ " security: []\n"
615
+ " performance: []\n"
616
+ " compatibility: []\n"
617
+ "evidence_required:\n"
618
+ " tests: []\n"
619
+ " security_scans: []\n"
620
+ " reproducibility: []\n"
621
+ " artifacts: []\n",
622
+ )
623
+ _write_if_missing(
624
+ policy_path,
625
+ "mode: warn_and_run\ncritical_block: true\n",
626
+ )
627
+ _write_if_missing(
628
+ runtime_path,
629
+ "default: claude\navailable:\n - claude\n - gpt\n - local\n",
630
+ )
631
+ _write_if_missing(
632
+ plan_path,
633
+ "# Compat Plan\n"
634
+ f"goal: {reason or 'bootstrap'}\n"
635
+ "CHANGE_BUDGET=small\n",
636
+ )
637
+ _write_if_missing(
638
+ checklist_path,
639
+ "- [ ] define goal\n- [ ] run verification\n- [ ] ship with evidence\n",
640
+ )
641
+ if not os.path.exists(qg_path):
642
+ with open(qg_path, "w", encoding="utf-8") as f:
643
+ json.dump({"lint": "pytest -q", "test": "pytest -q"}, f, indent=2, ensure_ascii=True)
644
+ return [
645
+ os.path.relpath(profile_path, project_dir),
646
+ os.path.relpath(idea_path, project_dir),
647
+ os.path.relpath(policy_path, project_dir),
648
+ os.path.relpath(runtime_path, project_dir),
649
+ os.path.relpath(plan_path, project_dir),
650
+ os.path.relpath(checklist_path, project_dir),
651
+ os.path.relpath(qg_path, project_dir),
652
+ ]
653
+
654
+
655
+ def _health_snapshot(project_dir: str) -> dict[str, Any]:
656
+ p = Path(project_dir)
657
+ omg_root = p / ".omg"
658
+ checks = [
659
+ {"name": "python>=3.8", "ok": sys.version_info >= (3, 8)},
660
+ {"name": ".omg exists", "ok": omg_root.exists()},
661
+ {"name": ".omg/state exists", "ok": (omg_root / "state").exists()},
662
+ {"name": ".omg/idea.yml exists", "ok": (omg_root / "idea.yml").exists()},
663
+ {"name": ".omg/policy.yaml exists", "ok": (omg_root / "policy.yaml").exists()},
664
+ ]
665
+ all_ok = all(c["ok"] for c in checks)
666
+ return {
667
+ "project_dir": str(p),
668
+ "status": "pass" if all_ok else "warn",
669
+ "checks": checks,
670
+ "omg_exists": omg_root.exists(),
671
+ "state_exists": (omg_root / "state").exists(),
672
+ "knowledge_exists": (omg_root / "knowledge").exists(),
673
+ "evidence_exists": (omg_root / "evidence").exists(),
674
+ }
675
+
676
+
677
+ def _doctor_check(name: str, *, ok: bool, message: str, required: bool = True) -> dict[str, Any]:
678
+ if ok:
679
+ status = "ok"
680
+ elif required:
681
+ status = "blocker"
682
+ else:
683
+ status = "warning"
684
+ return {"name": name, "status": status, "message": message, "required": required}
685
+
686
+
687
+ def run_doctor(*, root_dir: Path | None = None) -> dict[str, Any]:
688
+ """Canonical install/runtime verification engine.
689
+
690
+ Called by both ``omg doctor`` CLI and the ``omg-doctor`` compat route.
691
+ """
692
+ from runtime.contract_compiler import _check_version_identity_drift
693
+
694
+ repo_root = root_dir or Path(__file__).resolve().parent.parent
695
+ checks: list[dict[str, Any]] = []
696
+
697
+ # 1. Python version >= 3.10
698
+ py_ok = sys.version_info >= (3, 10)
699
+ checks.append(_doctor_check(
700
+ "python_version",
701
+ ok=py_ok,
702
+ message=f"Python {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}"
703
+ + ("" if py_ok else " (requires >=3.10)"),
704
+ ))
705
+
706
+ # 2. fastmcp availability
707
+ fastmcp_ok = False
708
+ fastmcp_msg = ""
709
+ try:
710
+ import importlib
711
+ importlib.import_module("fastmcp")
712
+ fastmcp_ok = True
713
+ fastmcp_msg = "fastmcp importable"
714
+ except ImportError:
715
+ fastmcp_msg = "fastmcp not installed — required for MCP server"
716
+ checks.append(_doctor_check("fastmcp", ok=fastmcp_ok, message=fastmcp_msg))
717
+
718
+ # 3. omg-control reachable (stdio config present in .mcp.json)
719
+ mcp_json_path = repo_root / ".mcp.json"
720
+ omg_control_ok = False
721
+ omg_control_msg = ".mcp.json not found"
722
+ if mcp_json_path.exists():
723
+ try:
724
+ with open(mcp_json_path, "r", encoding="utf-8") as f:
725
+ mcp_data = json.load(f)
726
+ servers = mcp_data.get("mcpServers", {})
727
+ if "omg-control" in servers:
728
+ ctrl = servers["omg-control"]
729
+ if ctrl.get("command"):
730
+ omg_control_ok = True
731
+ omg_control_msg = f"omg-control configured (stdio: {ctrl['command']})"
732
+ else:
733
+ omg_control_ok = True
734
+ omg_control_msg = "omg-control configured (non-stdio)"
735
+ else:
736
+ omg_control_msg = "omg-control not found in .mcp.json mcpServers"
737
+ except (json.JSONDecodeError, KeyError) as exc:
738
+ omg_control_msg = f".mcp.json parse error: {exc}"
739
+ checks.append(_doctor_check("omg_control_reachable", ok=omg_control_ok, message=omg_control_msg))
740
+
741
+ # 4. Policy files present
742
+ policy_path = repo_root / ".omg" / "policy.yaml"
743
+ commands_dir = repo_root / "commands"
744
+ policy_ok = policy_path.exists() or commands_dir.exists()
745
+ if policy_path.exists() and commands_dir.exists():
746
+ policy_msg = "policy.yaml and commands/ present"
747
+ elif policy_path.exists():
748
+ policy_msg = "policy.yaml present (commands/ missing)"
749
+ elif commands_dir.exists():
750
+ policy_msg = "commands/ present (policy.yaml missing)"
751
+ else:
752
+ policy_msg = "neither policy.yaml nor commands/ found"
753
+ checks.append(_doctor_check("policy_files", ok=policy_ok, message=policy_msg))
754
+
755
+ # 5. Metadata drift (release identity)
756
+ drift_result = _check_version_identity_drift(repo_root)
757
+ drift_ok = drift_result.get("status") == "ok"
758
+ drift_blockers = drift_result.get("blockers", [])
759
+ drift_msg = "all version surfaces aligned" if drift_ok else f"{len(drift_blockers)} drift(s): {'; '.join(drift_blockers[:3])}"
760
+ checks.append(_doctor_check("metadata_drift", ok=drift_ok, message=drift_msg))
761
+
762
+ # 6. Compiled bundles exist (optional)
763
+ bundles_dir = repo_root / "dist"
764
+ bundles_ok = bundles_dir.exists() and any(bundles_dir.iterdir()) if bundles_dir.exists() else False
765
+ bundles_msg = "dist/ contains compiled bundles" if bundles_ok else "dist/ missing or empty"
766
+ checks.append(_doctor_check("compiled_bundles", ok=bundles_ok, message=bundles_msg, required=False))
767
+
768
+ # 7. Host compatibility (optional)
769
+ claude_dir = os.environ.get("CLAUDE_DIR", os.path.expanduser("~/.claude"))
770
+ host_ok = os.path.isdir(claude_dir)
771
+ host_msg = f"host config dir exists ({claude_dir})" if host_ok else f"host config dir not found ({claude_dir})"
772
+ checks.append(_doctor_check("host_compatibility", ok=host_ok, message=host_msg, required=False))
773
+
774
+ # 8. HTTP memory — optional, never required
775
+ memory_msg = "HTTP memory not configured (optional)"
776
+ if mcp_json_path.exists():
777
+ try:
778
+ with open(mcp_json_path, "r", encoding="utf-8") as f:
779
+ mcp_data = json.load(f)
780
+ mem_cfg = mcp_data.get("mcpServers", {}).get("omg-memory", {})
781
+ if mem_cfg.get("type") == "http" and mem_cfg.get("url"):
782
+ memory_msg = f"omg-memory configured at {mem_cfg['url']} (optional, not probed)"
783
+ except (json.JSONDecodeError, KeyError):
784
+ pass
785
+ checks.append(_doctor_check("memory_reachable", ok=True, message=memory_msg, required=False))
786
+
787
+ # 9. Managed runtime venv (optional)
788
+ managed_venv_path = Path(claude_dir) / "omg-runtime" / ".venv"
789
+ venv_ok = managed_venv_path.exists()
790
+ venv_msg = f"managed venv at {managed_venv_path}" if venv_ok else f"managed venv not found at {managed_venv_path} (install via OMG-setup.sh)"
791
+ checks.append(_doctor_check("managed_runtime", ok=venv_ok, message=venv_msg, required=False))
792
+
793
+ has_blocker = any(c["status"] == "blocker" for c in checks)
794
+ return {
795
+ "schema": "DoctorResult",
796
+ "status": "fail" if has_blocker else "pass",
797
+ "checks": checks,
798
+ "version": CANONICAL_VERSION,
799
+ }
800
+
801
+
802
+ def _write_release_artifact(project_dir: str, message: str) -> str:
803
+ _ensure_state_layout(project_dir)
804
+ out = os.path.join(project_dir, ".omg", "evidence", "release-draft.md")
805
+ if not os.path.exists(out):
806
+ with open(out, "w", encoding="utf-8") as f:
807
+ f.write("# Release Draft\n\n")
808
+ with open(out, "a", encoding="utf-8") as f:
809
+ f.write(f"- {_now()}: {message}\n")
810
+ return out
811
+
812
+
813
+ def _write_build_fix_artifact(project_dir: str, message: str) -> str:
814
+ _ensure_state_layout(project_dir)
815
+ out = os.path.join(project_dir, ".omg", "state", "build-fix.md")
816
+ with open(out, "a", encoding="utf-8") as f:
817
+ f.write(f"## {_now()}\n")
818
+ f.write(f"- target: {message}\n")
819
+ f.write("- checklist:\n")
820
+ f.write(" - reproduce failure\n")
821
+ f.write(" - implement minimal fix\n")
822
+ f.write(" - run focused tests\n")
823
+ f.write(" - run full regression\n\n")
824
+ return out
825
+
826
+
827
+ def _write_persistent_state(
828
+ project_dir: str,
829
+ *,
830
+ mode: str,
831
+ goal: str,
832
+ context: str,
833
+ expected_outcome: str,
834
+ runtime_result: dict[str, Any],
835
+ ) -> str:
836
+ _ensure_state_layout(project_dir)
837
+ path = os.path.join(project_dir, ".omg", "state", "persistent-mode.json")
838
+ payload: dict[str, Any] = {
839
+ "schema": "PersistentModeState",
840
+ "mode": mode,
841
+ "status": "active",
842
+ "goal": goal,
843
+ "context": context,
844
+ "expected_outcome": expected_outcome,
845
+ "started_at": _now(),
846
+ "last_updated": _now(),
847
+ "last_runtime_status": runtime_result.get("status", "unknown"),
848
+ "history": [],
849
+ }
850
+ if os.path.exists(path):
851
+ try:
852
+ with open(path, "r", encoding="utf-8") as f:
853
+ current = json.load(f)
854
+ if isinstance(current, dict):
855
+ payload.update(current)
856
+ except Exception:
857
+ pass
858
+ payload.setdefault("history", [])
859
+ if not isinstance(payload["history"], list):
860
+ payload["history"] = []
861
+ payload["mode"] = mode
862
+ payload["status"] = "active"
863
+ payload["goal"] = goal
864
+ payload["context"] = context
865
+ payload["expected_outcome"] = expected_outcome
866
+ payload["last_updated"] = _now()
867
+ payload["last_runtime_status"] = runtime_result.get("status", "unknown")
868
+ payload["history"].append(
869
+ {
870
+ "ts": _now(),
871
+ "event": "dispatch",
872
+ "goal": goal,
873
+ "runtime_status": runtime_result.get("status", "unknown"),
874
+ }
875
+ )
876
+ payload["history"] = payload["history"][-200:]
877
+ with open(path, "w", encoding="utf-8") as f:
878
+ json.dump(payload, f, indent=2, ensure_ascii=True)
879
+ return path
880
+
881
+
882
+ def _run_dual_review(
883
+ problem: str,
884
+ context: str,
885
+ files: list[str],
886
+ expected_outcome: str,
887
+ ) -> dict[str, Any]:
888
+ codex_req = TeamDispatchRequest(
889
+ target="codex",
890
+ problem=f"review: {problem}",
891
+ context=context,
892
+ files=files,
893
+ expected_outcome=expected_outcome,
894
+ )
895
+ ccg_req = TeamDispatchRequest(
896
+ target="ccg",
897
+ problem=f"cross-check: {problem}",
898
+ context=context,
899
+ files=files,
900
+ expected_outcome=expected_outcome,
901
+ )
902
+ codex = dispatch_team(codex_req).to_dict()
903
+ ccg = dispatch_team(ccg_req).to_dict()
904
+ merged_actions: list[str] = []
905
+ seen = set()
906
+ for source in (codex.get("actions", []), ccg.get("actions", [])):
907
+ for action in source:
908
+ if action not in seen:
909
+ seen.add(action)
910
+ merged_actions.append(action)
911
+ synthesis = {
912
+ "schema": "ReviewSynthesis",
913
+ "status": "ok",
914
+ "tracks": {"codex": codex, "ccg": ccg},
915
+ "summary": [
916
+ "Dual-track review executed (codex + ccg).",
917
+ f"Merged action count: {len(merged_actions)}",
918
+ ],
919
+ "actions": merged_actions,
920
+ }
921
+ return synthesis
922
+
923
+
924
+ def _ensure_plan_artifacts(project_dir: str, goal: str) -> list[str]:
925
+ _ensure_state_layout(project_dir)
926
+ plan_path = os.path.join(project_dir, ".omg", "state", "_plan.md")
927
+ checklist_path = os.path.join(project_dir, ".omg", "state", "_checklist.md")
928
+ idea_path = os.path.join(project_dir, ".omg", "idea.yml")
929
+ _write_if_missing(
930
+ plan_path,
931
+ "# Deep Plan\n"
932
+ f"goal: {goal or 'compat planning'}\n"
933
+ "CHANGE_BUDGET=small\n"
934
+ "phases:\n"
935
+ "- foundation\n- implementation\n- verification\n",
936
+ )
937
+ _write_if_missing(
938
+ checklist_path,
939
+ "- [ ] write failing test\n- [ ] implement minimal fix\n- [ ] run tests\n",
940
+ )
941
+ _write_if_missing(
942
+ idea_path,
943
+ "goal: \"compat-plan\"\n"
944
+ "constraints: []\n"
945
+ "acceptance: []\n"
946
+ "risk:\n"
947
+ " security: []\n"
948
+ " performance: []\n"
949
+ " compatibility: []\n"
950
+ "evidence_required:\n"
951
+ " tests: []\n"
952
+ " security_scans: []\n"
953
+ " reproducibility: []\n"
954
+ " artifacts: []\n",
955
+ )
956
+ return [
957
+ os.path.relpath(plan_path, project_dir),
958
+ os.path.relpath(checklist_path, project_dir),
959
+ os.path.relpath(idea_path, project_dir),
960
+ ]
961
+
962
+
963
+ def _ensure_tdd_artifacts(project_dir: str, goal: str) -> list[str]:
964
+ _ensure_state_layout(project_dir)
965
+ plan_path = os.path.join(project_dir, ".omg", "state", "_plan.md")
966
+ checklist_path = os.path.join(project_dir, ".omg", "state", "_checklist.md")
967
+ idea_path = os.path.join(project_dir, ".omg", "idea.yml")
968
+ with open(plan_path, "w", encoding="utf-8") as f:
969
+ f.write(
970
+ "# TDD Plan\n"
971
+ f"goal: {goal or 'tdd workflow'}\n"
972
+ "CHANGE_BUDGET=small\n"
973
+ "workflow:\n"
974
+ "- red: write failing test\n"
975
+ "- green: minimal implementation\n"
976
+ "- refactor: clean while tests stay green\n"
977
+ )
978
+ with open(checklist_path, "w", encoding="utf-8") as f:
979
+ f.write(
980
+ "- [ ] red: create failing test for target behavior\n"
981
+ "- [ ] red: run targeted test and confirm failure reason\n"
982
+ "- [ ] green: write minimal code to pass test\n"
983
+ "- [ ] green: re-run targeted test and confirm pass\n"
984
+ "- [ ] refactor: clean implementation without behavior change\n"
985
+ "- [ ] verify: run full test suite\n"
986
+ )
987
+ _write_if_missing(
988
+ idea_path,
989
+ "goal: \"tdd\"\n"
990
+ "constraints: []\n"
991
+ "acceptance: []\n"
992
+ "risk:\n"
993
+ " security: []\n"
994
+ " performance: []\n"
995
+ " compatibility: []\n"
996
+ "evidence_required:\n"
997
+ " tests: []\n"
998
+ " security_scans: []\n"
999
+ " reproducibility: []\n"
1000
+ " artifacts: []\n",
1001
+ )
1002
+ return [
1003
+ os.path.relpath(plan_path, project_dir),
1004
+ os.path.relpath(checklist_path, project_dir),
1005
+ os.path.relpath(idea_path, project_dir),
1006
+ ]
1007
+
1008
+
1009
+ def dispatch_compat_skill(
1010
+ *,
1011
+ skill: str,
1012
+ problem: str = "",
1013
+ context: str = "",
1014
+ files: list[str] | None = None,
1015
+ expected_outcome: str = "",
1016
+ project_dir: str | None = None,
1017
+ ) -> dict[str, Any]:
1018
+ normalized = skill.strip()
1019
+ root = _project_dir(project_dir)
1020
+
1021
+ def _emit(payload: dict[str, Any]) -> dict[str, Any]:
1022
+ _append_audit_event(
1023
+ root,
1024
+ {
1025
+ "event": DEFAULT_EVENT_DISPATCH,
1026
+ "skill": normalized,
1027
+ "route": payload.get("route", ""),
1028
+ "status": payload.get("status", "unknown"),
1029
+ "routed_to": payload.get("routed_to", ""),
1030
+ "problem_chars": len(problem),
1031
+ "context_chars": len(context),
1032
+ "file_count": len(files or []),
1033
+ },
1034
+ )
1035
+ return payload
1036
+
1037
+ def _res(**kwargs: Any) -> dict[str, Any]:
1038
+ return _emit(_result(**kwargs))
1039
+
1040
+ if not normalized:
1041
+ return _res(
1042
+ skill=skill,
1043
+ route="unknown",
1044
+ status="error",
1045
+ findings=["Missing skill name."],
1046
+ actions=["Provide --skill value."],
1047
+ )
1048
+
1049
+ route = LEGACY_SKILL_ROUTES.get(normalized)
1050
+ if route is None:
1051
+ return _res(
1052
+ skill=normalized,
1053
+ route="unknown",
1054
+ status="error",
1055
+ findings=[f"Unsupported skill: {normalized}"],
1056
+ actions=["Use `omg compat list` to see supported skill names."],
1057
+ )
1058
+
1059
+ is_valid, reason = validate_compat_request(
1060
+ skill=normalized,
1061
+ problem=problem,
1062
+ context=context,
1063
+ files=files,
1064
+ expected_outcome=expected_outcome,
1065
+ )
1066
+ if not is_valid:
1067
+ return _res(
1068
+ skill=normalized,
1069
+ route=route,
1070
+ status="error",
1071
+ findings=[f"Invalid request: {reason}"],
1072
+ actions=["Adjust inputs and retry."],
1073
+ )
1074
+
1075
+ _append_audit_event(
1076
+ root,
1077
+ {
1078
+ "event": DEFAULT_EVENT_REQUEST,
1079
+ "skill": normalized,
1080
+ "route": route,
1081
+ "problem_chars": len(problem),
1082
+ "context_chars": len(context),
1083
+ "file_count": len(files or []),
1084
+ },
1085
+ )
1086
+
1087
+ msg = problem or f"compat dispatch via {normalized}"
1088
+ file_list = files or []
1089
+
1090
+ if route == "teams":
1091
+ req = TeamDispatchRequest(
1092
+ target="auto",
1093
+ problem=msg,
1094
+ context=context,
1095
+ files=file_list,
1096
+ expected_outcome=expected_outcome,
1097
+ )
1098
+ team = dispatch_team(req).to_dict()
1099
+ return _res(
1100
+ skill=normalized,
1101
+ route=route,
1102
+ routed_to=str(team.get("evidence", {}).get("target", "")),
1103
+ findings=["Team route dispatched."],
1104
+ actions=["Review findings and apply selected actions."],
1105
+ result=team,
1106
+ )
1107
+
1108
+ if route == "ccg":
1109
+ req = TeamDispatchRequest(
1110
+ target="ccg",
1111
+ problem=msg,
1112
+ context=context,
1113
+ files=file_list,
1114
+ expected_outcome=expected_outcome,
1115
+ )
1116
+ ccg = dispatch_team(req).to_dict()
1117
+ return _res(
1118
+ skill=normalized,
1119
+ route=route,
1120
+ routed_to="ccg",
1121
+ findings=["CCG route dispatched."],
1122
+ actions=["Review merged action plan."],
1123
+ result=ccg,
1124
+ )
1125
+
1126
+ if route == "runtime_ship":
1127
+ runtime = dispatch_runtime(
1128
+ "claude",
1129
+ {"goal": msg, "constraints": [], "acceptance": [expected_outcome] if expected_outcome else []},
1130
+ )
1131
+ status = "ok" if runtime.get("status") == "ok" else "error"
1132
+ artifacts: list[str] = []
1133
+ if normalized in {"autopilot", "ralph", "ultrapilot", "ultrawork"}:
1134
+ persistent = _write_persistent_state(
1135
+ root,
1136
+ mode=normalized,
1137
+ goal=msg,
1138
+ context=context,
1139
+ expected_outcome=expected_outcome,
1140
+ runtime_result=runtime,
1141
+ )
1142
+ artifacts.append(os.path.relpath(persistent, root))
1143
+ if normalized == "release" and status == "ok":
1144
+ rel = _write_release_artifact(root, msg)
1145
+ artifacts.append(os.path.relpath(rel, root))
1146
+ if normalized == "build-fix" and status == "ok":
1147
+ build_fix = _write_build_fix_artifact(root, msg)
1148
+ artifacts.append(os.path.relpath(build_fix, root))
1149
+ return _res(
1150
+ skill=normalized,
1151
+ route=route,
1152
+ status=status,
1153
+ routed_to="claude",
1154
+ findings=["Runtime dispatch completed." if status == "ok" else "Runtime dispatch failed."],
1155
+ actions=[
1156
+ "Inspect runtime response and continue.",
1157
+ "If persistent mode is active, keep iterating until checklist completion.",
1158
+ ],
1159
+ result=runtime,
1160
+ artifacts=artifacts,
1161
+ )
1162
+
1163
+ if route == "pipeline":
1164
+ pipeline = run_pipeline(
1165
+ {
1166
+ "dataset": {"source": "clean-source", "license": "mit"},
1167
+ "base_model": {"source": "open-model", "allow_distill": True},
1168
+ "target_metric": 0.7,
1169
+ "simulated_metric": 0.8,
1170
+ "evaluation_notes": f"compat:{normalized}",
1171
+ }
1172
+ )
1173
+ status = "ok" if pipeline.get("status") in {"ready", "published"} else "error"
1174
+ return _res(
1175
+ skill=normalized,
1176
+ route=route,
1177
+ status=status,
1178
+ findings=["Pipeline route executed."],
1179
+ actions=["Use `omg lab eval` when evaluation is ready."],
1180
+ result=pipeline,
1181
+ )
1182
+
1183
+ if route == "memory":
1184
+ if normalized == "project-session-manager":
1185
+ session = _update_session_state(root, msg)
1186
+ return _res(
1187
+ skill=normalized,
1188
+ route=route,
1189
+ findings=["Session state updated."],
1190
+ actions=["Use session state to continue long-running work."],
1191
+ artifacts=[os.path.relpath(session, root)],
1192
+ )
1193
+ if normalized == "writer-memory":
1194
+ writer = _append_knowledge_note(
1195
+ root,
1196
+ "knowledge/writer-memory.md",
1197
+ f"- [{_now()}] {msg}",
1198
+ )
1199
+ return _res(
1200
+ skill=normalized,
1201
+ route=route,
1202
+ findings=["Writer memory updated."],
1203
+ actions=["Reuse writer-memory notes for long-form drafting."],
1204
+ artifacts=[os.path.relpath(writer, root)],
1205
+ )
1206
+ if normalized == "note":
1207
+ note = _append_knowledge_note(
1208
+ root,
1209
+ "knowledge/notes.md",
1210
+ f"- [{_now()}] {msg}",
1211
+ )
1212
+ return _res(
1213
+ skill=normalized,
1214
+ route=route,
1215
+ findings=["Note appended to knowledge log."],
1216
+ actions=["Review notes during planning and handoff."],
1217
+ artifacts=[os.path.relpath(note, root)],
1218
+ )
1219
+ wm_path = _append_memory(root, msg)
1220
+ return _res(
1221
+ skill=normalized,
1222
+ route=route,
1223
+ findings=["Working memory updated."],
1224
+ actions=["Continue work with refreshed context."],
1225
+ artifacts=[os.path.relpath(wm_path, root)],
1226
+ )
1227
+
1228
+ if route == "init":
1229
+ artifacts = _init_bootstrap(root, msg)
1230
+ return _res(
1231
+ skill=normalized,
1232
+ route=route,
1233
+ findings=["OMG layout initialized."],
1234
+ actions=["Run `omg compat run --skill omg-doctor` to verify health."],
1235
+ artifacts=artifacts,
1236
+ )
1237
+
1238
+ if route == "health":
1239
+ if normalized == "omg-doctor":
1240
+ doctor_result = run_doctor(root_dir=Path(root))
1241
+ snapshot = {
1242
+ "project_dir": root,
1243
+ "status": doctor_result["status"],
1244
+ "checks": doctor_result["checks"],
1245
+ }
1246
+ return _res(
1247
+ skill=normalized,
1248
+ route=route,
1249
+ findings=["Doctor verification completed."],
1250
+ actions=["Fix any blocker checks before shipping."],
1251
+ result=snapshot,
1252
+ )
1253
+ snapshot = _health_snapshot(root)
1254
+ return _res(
1255
+ skill=normalized,
1256
+ route=route,
1257
+ findings=["Health snapshot generated."],
1258
+ actions=["Create missing .omg folders if any field is false."],
1259
+ result=snapshot,
1260
+ )
1261
+
1262
+ if route == "help":
1263
+ return _res(
1264
+ skill=normalized,
1265
+ route=route,
1266
+ findings=["Compatibility help generated."],
1267
+ actions=["Run `omg compat list`, `omg compat contract --all`, then `omg compat run --skill <name>`."],
1268
+ result={
1269
+ "supported_skills": list_compat_skills(),
1270
+ "gap_report_hint": DEFAULT_GAP_REPORT_PATH,
1271
+ },
1272
+ )
1273
+
1274
+ if route == "review":
1275
+ if normalized in {"review", "code-review", "ultraqa"}:
1276
+ review = _run_dual_review(msg, context, file_list, expected_outcome)
1277
+ routed_to = "codex+ccg"
1278
+ findings = ["Dual-track review route dispatched."]
1279
+ else:
1280
+ req = TeamDispatchRequest(
1281
+ target="codex",
1282
+ problem=f"review: {msg}",
1283
+ context=context,
1284
+ files=file_list,
1285
+ expected_outcome=expected_outcome,
1286
+ )
1287
+ review = dispatch_team(req).to_dict()
1288
+ routed_to = "codex"
1289
+ findings = ["Review route dispatched."]
1290
+ return _res(
1291
+ skill=normalized,
1292
+ route=route,
1293
+ routed_to=routed_to,
1294
+ findings=findings,
1295
+ actions=["Address high-risk findings first."],
1296
+ result=review,
1297
+ )
1298
+
1299
+ if route == "plan":
1300
+ if normalized == "tdd":
1301
+ artifacts = _ensure_tdd_artifacts(root, msg)
1302
+ findings = ["TDD artifacts are ready (red-green-refactor)."]
1303
+ actions = ["Execute checklist in strict red -> green -> refactor order."]
1304
+ else:
1305
+ artifacts = _ensure_plan_artifacts(root, msg)
1306
+ findings = ["Plan artifacts are ready."]
1307
+ actions = ["Refine _plan/_checklist then execute with evidence."]
1308
+ return _res(
1309
+ skill=normalized,
1310
+ route=route,
1311
+ findings=findings,
1312
+ actions=actions,
1313
+ artifacts=artifacts,
1314
+ )
1315
+
1316
+ if route == "secure":
1317
+ decision = evaluate_bash_command(problem or "echo safe")
1318
+ return _res(
1319
+ skill=normalized,
1320
+ route=route,
1321
+ findings=["Security policy evaluation completed."],
1322
+ actions=["If action is deny, revise command and retry."],
1323
+ result=decision.to_dict(),
1324
+ )
1325
+
1326
+ if route == "security_check":
1327
+ check = run_security_check(
1328
+ project_dir=root,
1329
+ scope=msg or ".",
1330
+ include_live_enrichment=False,
1331
+ )
1332
+ return _res(
1333
+ skill=normalized,
1334
+ route=route,
1335
+ findings=["Canonical OMG security check completed."],
1336
+ actions=["Review high-severity findings before ship/release."],
1337
+ result=check,
1338
+ )
1339
+
1340
+ if route == "learn":
1341
+ if normalized in {"learn-about-omg", "learner", "skill"}:
1342
+ learn_path = _write_learning_artifact(root, normalized, msg, context)
1343
+ return _res(
1344
+ skill=normalized,
1345
+ route=route,
1346
+ findings=["Learning artifact recorded."],
1347
+ actions=["Promote stable patterns from learning artifacts into reusable commands/skills."],
1348
+ artifacts=[os.path.relpath(learn_path, root)],
1349
+ )
1350
+ note_path = _append_memory(root, f"learn: {msg}")
1351
+ return _res(
1352
+ skill=normalized,
1353
+ route=route,
1354
+ findings=["Learning note recorded."],
1355
+ actions=["Review .omg/state/working-memory.md for accumulated insights."],
1356
+ artifacts=[os.path.relpath(note_path, root)],
1357
+ )
1358
+
1359
+ if route == "maintainer":
1360
+ if normalized in {"analyze", "trace", "sci-omg"}:
1361
+ artifact = _write_analysis_artifact(root, normalized, msg, context, file_list)
1362
+ return _res(
1363
+ skill=normalized,
1364
+ route=route,
1365
+ findings=["Analysis artifact generated."],
1366
+ actions=["Use findings to create targeted fix/review tasks."],
1367
+ artifacts=[os.path.relpath(artifact, root)],
1368
+ )
1369
+ artifact = _write_maintainer_artifact(root, normalized, msg)
1370
+ return _res(
1371
+ skill=normalized,
1372
+ route=route,
1373
+ findings=["Maintainer artifact generated."],
1374
+ actions=["Attach artifact to maintainer workflow or release notes."],
1375
+ artifacts=[os.path.relpath(artifact, root)],
1376
+ )
1377
+
1378
+ if route == "cancel":
1379
+ active_path = os.path.join(root, ".omg", "shadow", "active-run")
1380
+ if os.path.exists(active_path):
1381
+ os.remove(active_path)
1382
+ persistent_path = os.path.join(root, ".omg", "state", "persistent-mode.json")
1383
+ if os.path.exists(persistent_path):
1384
+ try:
1385
+ with open(persistent_path, "r", encoding="utf-8") as f:
1386
+ persistent = json.load(f)
1387
+ if isinstance(persistent, dict):
1388
+ persistent["status"] = "cancelled"
1389
+ persistent["last_updated"] = _now()
1390
+ with open(persistent_path, "w", encoding="utf-8") as f:
1391
+ json.dump(persistent, f, indent=2, ensure_ascii=True)
1392
+ except Exception:
1393
+ pass
1394
+ return _res(
1395
+ skill=normalized,
1396
+ route=route,
1397
+ findings=["Active run state cleared."],
1398
+ actions=["Start a new run when ready."],
1399
+ )
1400
+
1401
+ return _res(
1402
+ skill=normalized,
1403
+ route=route,
1404
+ status="error",
1405
+ findings=["Route exists but has no handler."],
1406
+ actions=["Implement missing handler."],
1407
+ )
1408
+
1409
+
1410
+ def list_omg_skills() -> list[str]:
1411
+ return list_compat_skills()
1412
+
1413
+
1414
+ def list_omg_skill_contracts() -> list[dict[str, Any]]:
1415
+ return list_compat_skill_contracts()
1416
+
1417
+
1418
+ def get_omg_skill_contract(skill: str) -> dict[str, Any] | None:
1419
+ return get_compat_skill_contract(skill)
1420
+
1421
+
1422
+ def build_omg_gap_report(project_dir: str | None = None) -> dict[str, Any]:
1423
+ return build_compat_gap_report(project_dir)
1424
+
1425
+
1426
+ def validate_omg_request(
1427
+ *,
1428
+ skill: str,
1429
+ problem: str,
1430
+ context: str,
1431
+ files: list[str] | None,
1432
+ expected_outcome: str,
1433
+ ) -> tuple[bool, str]:
1434
+ return validate_compat_request(
1435
+ skill=skill,
1436
+ problem=problem,
1437
+ context=context,
1438
+ files=files,
1439
+ expected_outcome=expected_outcome,
1440
+ )
1441
+
1442
+
1443
+ def dispatch_omg_skill(
1444
+ *,
1445
+ skill: str,
1446
+ problem: str = "",
1447
+ context: str = "",
1448
+ files: list[str] | None = None,
1449
+ expected_outcome: str = "",
1450
+ project_dir: str | None = None,
1451
+ ) -> dict[str, Any]:
1452
+ return dispatch_compat_skill(
1453
+ skill=skill,
1454
+ problem=problem,
1455
+ context=context,
1456
+ files=files,
1457
+ expected_outcome=expected_outcome,
1458
+ project_dir=project_dir,
1459
+ )