@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,965 @@
1
+ """Canonical OMG security check engine."""
2
+ from __future__ import annotations
3
+
4
+ import ast
5
+ from collections import Counter
6
+ from datetime import datetime, timezone
7
+ from hashlib import sha256
8
+ import json
9
+ from pathlib import Path
10
+ import re
11
+ import subprocess
12
+ from typing import Any
13
+
14
+ from hooks.security_validators import ensure_path_within_dir
15
+ from plugins.dephealth.cve_scanner import scan_for_cves
16
+ from plugins.dephealth.license_checker import check_license_compatibility
17
+ from plugins.dephealth.manifest_detector import detect_manifests
18
+ from plugins.dephealth.vuln_analyzer import analyze_reachability
19
+ from runtime.adoption import CANONICAL_VERSION
20
+ from runtime.delta_classifier import classify_project_changes
21
+ from runtime.tracebank import record_trace
22
+
23
+
24
+ SEVERITY_ORDER = {
25
+ "critical": 0,
26
+ "high": 1,
27
+ "medium": 2,
28
+ "low": 3,
29
+ }
30
+
31
+ _PYTHON_AST_RULES: tuple[tuple[str, str, str, str], ...] = (
32
+ ("B602", "subprocess-shell-true", "high", "Avoid shell=True in subprocess calls."),
33
+ ("B307", "eval-use", "high", "Replace eval with explicit parsing."),
34
+ ("B102", "exec-use", "high", "Replace exec with explicit control flow."),
35
+ ("B301", "pickle-load", "high", "Avoid unsafe deserialization of pickle payloads."),
36
+ )
37
+
38
+ _SECRET_PATTERNS: tuple[tuple[str, re.Pattern[str], str, str], ...] = (
39
+ ("SEC001", re.compile(r"AKIA[0-9A-Z]{16}"), "high", "AWS access key-like token detected."),
40
+ ("SEC002", re.compile(r"-----BEGIN (?:RSA|EC|OPENSSH|DSA) PRIVATE KEY-----"), "critical", "Private key material detected."),
41
+ (
42
+ "SEC003",
43
+ re.compile(r"(?i)(?:secret|api[_-]?key|token|password)\s*[:=]\s*['\"][A-Za-z0-9_\-\+/=]{12,}['\"]"),
44
+ "high",
45
+ "Hard-coded secret-like credential detected.",
46
+ ),
47
+ )
48
+
49
+ _CONFIG_PATTERNS: tuple[tuple[str, re.Pattern[str], str, str], ...] = (
50
+ ("CFG001", re.compile(r"0\.0\.0\.0/0"), "high", "Wildcard ingress rule detected."),
51
+ ("CFG002", re.compile(r"(?i)verify\s*=\s*false"), "high", "TLS verification appears disabled."),
52
+ ("CFG003", re.compile(r"(?i)(?:ssl_verify|verify_ssl)\s*[:=]\s*false"), "high", "TLS verification appears disabled."),
53
+ ("CFG004", re.compile(r"(?i)allow_privilege_escalation\s*[:=]\s*true"), "high", "Privilege escalation enabled in runtime policy."),
54
+ ("CFG005", re.compile(r"(?i)publicly_accessible\s*=\s*true"), "medium", "Publicly accessible infrastructure flag enabled."),
55
+ )
56
+
57
+ _CONFIG_FILE_HINTS = (
58
+ ".tf",
59
+ ".tfvars",
60
+ ".yaml",
61
+ ".yml",
62
+ ".json",
63
+ ".env",
64
+ "dockerfile",
65
+ "kustomization",
66
+ "helm",
67
+ "policy",
68
+ "config",
69
+ )
70
+
71
+ _SBOM_ECOSYSTEM_PURL = {
72
+ "npm": "npm",
73
+ "PyPI": "pypi",
74
+ "crates.io": "cargo",
75
+ "Go": "golang",
76
+ "RubyGems": "gem",
77
+ }
78
+
79
+
80
+ def run_security_check(
81
+ *,
82
+ project_dir: str,
83
+ scope: str = ".",
84
+ include_live_enrichment: bool = False,
85
+ external_inputs: list[dict[str, Any]] | None = None,
86
+ waivers: list[dict[str, Any] | str] | None = None,
87
+ ) -> dict[str, Any]:
88
+ scope_path = _resolve_scope(project_dir, scope)
89
+ findings: list[dict[str, Any]] = []
90
+ manifests = detect_manifests(str(scope_path))
91
+ waiver_map = _normalize_waivers(waivers or [])
92
+
93
+ findings.extend(_scan_python_ast(scope_path))
94
+ findings.extend(_scan_secret_patterns(scope_path))
95
+ findings.extend(_scan_config_and_iac(scope_path))
96
+ findings.extend(_scan_dependency_health(scope_path, include_live_enrichment))
97
+ findings = _finalize_findings(findings, waiver_map)
98
+ findings.sort(key=lambda finding: (SEVERITY_ORDER.get(finding["severity"], 99), finding["id"]))
99
+
100
+ severity_counts = Counter(finding["severity"] for finding in findings)
101
+ source_counts = Counter(finding["source"] for finding in findings)
102
+ relative_scope = _display_scope(project_dir, scope_path)
103
+ delta = classify_project_changes(project_dir, touched_files=_delta_touched_files(project_dir, scope_path), goal="security check")
104
+ unresolved_high_risk = [
105
+ finding
106
+ for finding in findings
107
+ if finding.get("severity") in {"critical", "high"} and not finding.get("waived", False)
108
+ ]
109
+ provenance = _build_provenance(
110
+ scope=relative_scope,
111
+ manifests=manifests.manifests,
112
+ findings=findings,
113
+ include_live_enrichment=include_live_enrichment,
114
+ external_inputs=external_inputs or [],
115
+ )
116
+ trust_scores = _build_trust_scores(findings)
117
+ generated_at = datetime.now(timezone.utc).isoformat()
118
+ license_artifact = _build_license_artifact(
119
+ project_dir=project_dir,
120
+ scope_path=scope_path,
121
+ manifests=manifests,
122
+ generated_at=generated_at,
123
+ )
124
+ unresolved_risks = [
125
+ {
126
+ "finding_id": finding.get("finding_id"),
127
+ "id": finding.get("id"),
128
+ "severity": finding.get("severity"),
129
+ "exploitability": finding.get("exploitability", "unknown"),
130
+ "reachability": finding.get("reachability", "unknown"),
131
+ "waived": bool(finding.get("waived")),
132
+ "waiver_justification": finding.get("waiver_justification", ""),
133
+ "message": finding.get("message", ""),
134
+ }
135
+ for finding in findings
136
+ if finding.get("severity") in {"critical", "high"}
137
+ ]
138
+ trace = record_trace(
139
+ project_dir,
140
+ trace_type="security-check",
141
+ route="security-check",
142
+ status="error" if unresolved_high_risk else "ok",
143
+ plan={"scope": relative_scope, "delta_categories": delta["categories"]},
144
+ verify={"finding_count": len(findings), "unresolved_high_risk_count": len(unresolved_high_risk)},
145
+ failures=[finding["finding_id"] for finding in unresolved_high_risk],
146
+ rejections=[],
147
+ )
148
+ artifacts = _write_evidence_artifacts(
149
+ project_dir,
150
+ scope=relative_scope,
151
+ generated_at=generated_at,
152
+ findings=findings,
153
+ provenance=provenance,
154
+ trust_scores=trust_scores,
155
+ include_live_enrichment=include_live_enrichment,
156
+ waivers=waivers or [],
157
+ license_artifact=license_artifact,
158
+ manifests=manifests,
159
+ unresolved_risks=unresolved_risks,
160
+ )
161
+ return {
162
+ "schema": "SecurityCheckResult",
163
+ "status": "error" if unresolved_high_risk else "ok",
164
+ "scope": relative_scope,
165
+ "findings": findings,
166
+ "waivers": {
167
+ "requested": len(waivers or []),
168
+ "applied": len([finding for finding in findings if finding.get("waived")]),
169
+ },
170
+ "release_blocked": bool(unresolved_high_risk),
171
+ "unresolved_risks": unresolved_risks,
172
+ "security_scans": [
173
+ {
174
+ "tool": "security-check",
175
+ "path": artifacts["json_path"],
176
+ "sarif_path": artifacts["sarif_path"],
177
+ "sbom_path": artifacts["sbom_path"],
178
+ "license_path": artifacts["license_path"],
179
+ "findings": findings,
180
+ }
181
+ ],
182
+ "summary": {
183
+ "finding_count": len(findings),
184
+ "unresolved_high_risk_count": len(unresolved_high_risk),
185
+ "by_severity": dict(sorted(severity_counts.items())),
186
+ "by_source": dict(sorted(source_counts.items())),
187
+ "live_enrichment": include_live_enrichment,
188
+ "scan_status": "completed",
189
+ "manifest_count": len(manifests.manifests),
190
+ "delta_categories": delta["categories"],
191
+ },
192
+ "provenance": provenance,
193
+ "trust_scores": trust_scores,
194
+ "license": license_artifact,
195
+ "sbom": _build_sbom_payload(generated_at=generated_at, manifests=manifests),
196
+ "evidence": {
197
+ "path": artifacts["json_path"],
198
+ "json_path": artifacts["json_path"],
199
+ "sarif_path": artifacts["sarif_path"],
200
+ "sbom_path": artifacts["sbom_path"],
201
+ "license_path": artifacts["license_path"],
202
+ },
203
+ "trace": {"trace_id": trace["trace_id"], "path": trace["path"]},
204
+ }
205
+
206
+
207
+ def security_check(
208
+ *,
209
+ project_dir: str,
210
+ scope: str = ".",
211
+ include_live_enrichment: bool = False,
212
+ external_inputs: list[dict[str, Any]] | None = None,
213
+ waivers: list[dict[str, Any] | str] | None = None,
214
+ ) -> dict[str, Any]:
215
+ return run_security_check(
216
+ project_dir=project_dir,
217
+ scope=scope,
218
+ include_live_enrichment=include_live_enrichment,
219
+ external_inputs=external_inputs,
220
+ waivers=waivers,
221
+ )
222
+
223
+
224
+ def _resolve_scope(project_dir: str, scope: str) -> Path:
225
+ if not scope:
226
+ return Path(project_dir).resolve()
227
+ candidate = Path(scope)
228
+ if candidate.is_absolute():
229
+ return candidate.resolve()
230
+ base = Path(project_dir).resolve()
231
+ resolved = Path(ensure_path_within_dir(base, base / candidate))
232
+ return resolved
233
+
234
+
235
+ def _display_scope(project_dir: str, scope_path: Path) -> str:
236
+ base = Path(project_dir).resolve()
237
+ try:
238
+ return scope_path.relative_to(base).as_posix() or "."
239
+ except ValueError:
240
+ return str(scope_path)
241
+
242
+
243
+ def _delta_touched_files(project_dir: str, scope_path: Path) -> list[str]:
244
+ base = Path(project_dir).resolve()
245
+ if scope_path.is_file():
246
+ return [_display_scope(project_dir, scope_path)]
247
+ touched: list[str] = []
248
+ for path in sorted(scope_path.rglob("*")):
249
+ if not path.is_file():
250
+ continue
251
+ try:
252
+ rel = path.resolve().relative_to(base).as_posix()
253
+ except ValueError:
254
+ rel = str(path.resolve())
255
+ touched.append(rel)
256
+ if len(touched) >= 64:
257
+ break
258
+ return touched or [_display_scope(project_dir, scope_path)]
259
+
260
+
261
+ def _scan_python_ast(scope_path: Path) -> list[dict[str, Any]]:
262
+ findings: list[dict[str, Any]] = []
263
+ for py_file in _iter_python_files(scope_path):
264
+ try:
265
+ source = py_file.read_text(encoding="utf-8")
266
+ except OSError:
267
+ continue
268
+ findings.extend(_scan_python_file(py_file, source))
269
+ findings.extend(_run_bandit_if_available(scope_path))
270
+ return findings
271
+
272
+
273
+ def _scan_secret_patterns(scope_path: Path) -> list[dict[str, Any]]:
274
+ findings: list[dict[str, Any]] = []
275
+ for candidate in _iter_text_candidates(scope_path):
276
+ try:
277
+ source = candidate.read_text(encoding="utf-8")
278
+ except (OSError, UnicodeDecodeError):
279
+ continue
280
+ for line_no, line in enumerate(source.splitlines(), start=1):
281
+ for rule_id, pattern, severity, message in _SECRET_PATTERNS:
282
+ if not pattern.search(line):
283
+ continue
284
+ findings.append(
285
+ _finding(
286
+ rule_id=rule_id,
287
+ source_name="secret-scan",
288
+ category="secret",
289
+ severity=severity,
290
+ path=candidate,
291
+ line=line_no,
292
+ message=message,
293
+ recommendation="Move secrets to an approved secret manager or environment injection.",
294
+ snippet=line.strip(),
295
+ )
296
+ )
297
+ return findings
298
+
299
+
300
+ def _scan_config_and_iac(scope_path: Path) -> list[dict[str, Any]]:
301
+ findings: list[dict[str, Any]] = []
302
+ for candidate in _iter_text_candidates(scope_path):
303
+ lowered = candidate.name.lower()
304
+ rel_lower = candidate.as_posix().lower()
305
+ if not any(hint in lowered or hint in rel_lower for hint in _CONFIG_FILE_HINTS):
306
+ continue
307
+ try:
308
+ source = candidate.read_text(encoding="utf-8")
309
+ except (OSError, UnicodeDecodeError):
310
+ continue
311
+ for line_no, line in enumerate(source.splitlines(), start=1):
312
+ for rule_id, pattern, severity, message in _CONFIG_PATTERNS:
313
+ if not pattern.search(line):
314
+ continue
315
+ findings.append(
316
+ _finding(
317
+ rule_id=rule_id,
318
+ source_name="config-scan",
319
+ category="config",
320
+ severity=severity,
321
+ path=candidate,
322
+ line=line_no,
323
+ message=message,
324
+ recommendation="Apply least-privilege defaults and tighten network/transport policy.",
325
+ snippet=line.strip(),
326
+ )
327
+ )
328
+ return findings
329
+
330
+
331
+ def _iter_text_candidates(scope_path: Path) -> list[Path]:
332
+ if scope_path.is_file():
333
+ return [scope_path]
334
+ if not scope_path.exists():
335
+ return []
336
+ candidates: list[Path] = []
337
+ for path in sorted(scope_path.rglob("*")):
338
+ if not path.is_file():
339
+ continue
340
+ try:
341
+ size = path.stat().st_size
342
+ except OSError:
343
+ continue
344
+ if size > 1_000_000:
345
+ continue
346
+ if ".git" in path.parts or ".omg" in path.parts or "build" in path.parts:
347
+ continue
348
+ candidates.append(path)
349
+ return candidates
350
+
351
+
352
+ def _iter_python_files(scope_path: Path) -> list[Path]:
353
+ if scope_path.is_file():
354
+ return [scope_path] if scope_path.suffix == ".py" else []
355
+ if not scope_path.exists():
356
+ return []
357
+ return sorted(path for path in scope_path.rglob("*.py") if path.is_file())
358
+
359
+
360
+ def _scan_python_file(path: Path, source: str) -> list[dict[str, Any]]:
361
+ try:
362
+ tree = ast.parse(source)
363
+ except SyntaxError:
364
+ return []
365
+
366
+ findings: list[dict[str, Any]] = []
367
+ for node in ast.walk(tree):
368
+ if isinstance(node, ast.Call):
369
+ findings.extend(_call_findings(path, node, source))
370
+ return findings
371
+
372
+
373
+ def _call_findings(path: Path, node: ast.Call, source: str) -> list[dict[str, Any]]:
374
+ findings: list[dict[str, Any]] = []
375
+ callee = _call_name(node.func)
376
+ if callee in {"subprocess.run", "subprocess.Popen", "os.system"}:
377
+ if any(keyword.arg == "shell" and isinstance(keyword.value, ast.Constant) and keyword.value.value is True for keyword in node.keywords):
378
+ findings.append(
379
+ _finding(
380
+ rule_id="B602",
381
+ source_name="bandit-lite",
382
+ category="python_ast",
383
+ severity="high",
384
+ path=path,
385
+ line=getattr(node, "lineno", 1),
386
+ message="subprocess call uses shell=True",
387
+ recommendation="Avoid shell=True in subprocess calls.",
388
+ snippet=_source_line(source, getattr(node, "lineno", 1)),
389
+ )
390
+ )
391
+ if callee == "eval":
392
+ findings.append(
393
+ _finding(
394
+ rule_id="B307",
395
+ source_name="bandit-lite",
396
+ category="python_ast",
397
+ severity="high",
398
+ path=path,
399
+ line=getattr(node, "lineno", 1),
400
+ message="eval() detected",
401
+ recommendation="Replace eval with explicit parsing.",
402
+ snippet=_source_line(source, getattr(node, "lineno", 1)),
403
+ )
404
+ )
405
+ if callee == "exec":
406
+ findings.append(
407
+ _finding(
408
+ rule_id="B102",
409
+ source_name="bandit-lite",
410
+ category="python_ast",
411
+ severity="high",
412
+ path=path,
413
+ line=getattr(node, "lineno", 1),
414
+ message="exec() detected",
415
+ recommendation="Replace exec with explicit control flow.",
416
+ snippet=_source_line(source, getattr(node, "lineno", 1)),
417
+ )
418
+ )
419
+ if callee in {"pickle.load", "pickle.loads"}:
420
+ findings.append(
421
+ _finding(
422
+ rule_id="B301",
423
+ source_name="bandit-lite",
424
+ category="python_ast",
425
+ severity="high",
426
+ path=path,
427
+ line=getattr(node, "lineno", 1),
428
+ message="pickle deserialization detected",
429
+ recommendation="Avoid unsafe deserialization of pickle payloads.",
430
+ snippet=_source_line(source, getattr(node, "lineno", 1)),
431
+ )
432
+ )
433
+ return findings
434
+
435
+
436
+ def _call_name(func: ast.AST) -> str:
437
+ if isinstance(func, ast.Name):
438
+ return func.id
439
+ if isinstance(func, ast.Attribute):
440
+ prefix = _call_name(func.value)
441
+ return f"{prefix}.{func.attr}" if prefix else func.attr
442
+ return ""
443
+
444
+
445
+ def _source_line(source: str, line: int) -> str:
446
+ lines = source.splitlines()
447
+ if 1 <= line <= len(lines):
448
+ return lines[line - 1].strip()
449
+ return ""
450
+
451
+
452
+ def _run_bandit_if_available(scope_path: Path) -> list[dict[str, Any]]:
453
+ if not _command_exists("bandit"):
454
+ return []
455
+
456
+ cmd = ["bandit", "-r", str(scope_path), "-f", "json"]
457
+ proc = subprocess.run(cmd, capture_output=True, text=True, check=False, timeout=30)
458
+ if proc.returncode not in {0, 1}:
459
+ return []
460
+ try:
461
+ import json
462
+
463
+ payload = json.loads(proc.stdout or "{}")
464
+ except Exception:
465
+ return []
466
+
467
+ findings: list[dict[str, Any]] = []
468
+ for item in payload.get("results", []):
469
+ issue_severity = str(item.get("issue_severity", "LOW")).lower()
470
+ findings.append(
471
+ {
472
+ "id": str(item.get("test_id", "bandit")),
473
+ "source": "bandit",
474
+ "category": "python_ast",
475
+ "severity": "medium" if issue_severity == "medium" else ("critical" if issue_severity == "critical" else issue_severity),
476
+ "exploitability": "unknown",
477
+ "reachability": "unknown",
478
+ "evidence": {
479
+ "path": str(item.get("filename", "")),
480
+ "line": int(item.get("line_number", 1)),
481
+ "snippet": str(item.get("code", "")).strip(),
482
+ },
483
+ "recommendation": str(item.get("more_info", "")) or "Review Bandit finding and remediate.",
484
+ "message": str(item.get("issue_text", "Bandit finding")),
485
+ }
486
+ )
487
+ return findings
488
+
489
+
490
+ def _command_exists(command: str) -> bool:
491
+ from shutil import which
492
+
493
+ return which(command) is not None
494
+
495
+
496
+ def _scan_dependency_health(scope_path: Path, include_live_enrichment: bool) -> list[dict[str, Any]]:
497
+ manifests = detect_manifests(str(scope_path))
498
+ dependencies = [
499
+ {
500
+ "name": package.name,
501
+ "version": _normalize_version(package.version),
502
+ "ecosystem": _ecosystem_from_manifest(package.source_manifest),
503
+ }
504
+ for package in manifests.packages
505
+ if package.name
506
+ ]
507
+ if not dependencies or not include_live_enrichment:
508
+ return []
509
+
510
+ osv_result = scan_for_cves(dependencies, str(scope_path))
511
+ raw_results = osv_result.get("results", {})
512
+ findings: list[dict[str, Any]] = []
513
+ for dependency in dependencies:
514
+ package_name = dependency["name"]
515
+ for vuln in raw_results.get(package_name, []):
516
+ reachability = analyze_reachability(
517
+ {
518
+ "package": package_name,
519
+ "id": vuln.get("id", ""),
520
+ "summary": vuln.get("summary", ""),
521
+ "fixed_version": vuln.get("fixed_version", ""),
522
+ },
523
+ str(scope_path),
524
+ )
525
+ findings.append(
526
+ {
527
+ "id": str(vuln.get("id", "")),
528
+ "source": "osv",
529
+ "category": "dependency",
530
+ "severity": _normalize_severity(str(vuln.get("severity", "unknown"))),
531
+ "exploitability": _risk_to_exploitability(str(reachability.get("risk_level", ""))),
532
+ "reachability": _normalize_reachability(str(reachability.get("reachability", "unknown"))),
533
+ "evidence": {
534
+ "package": package_name,
535
+ "version": dependency["version"],
536
+ "fixed_version": str(vuln.get("fixed_version", "")),
537
+ "summary": str(vuln.get("summary", "")),
538
+ },
539
+ "recommendation": reachability.get("recommendation", "Upgrade the dependency to a fixed version."),
540
+ "message": str(vuln.get("summary", "")) or f"Known vulnerability in {package_name}",
541
+ }
542
+ )
543
+ return findings
544
+
545
+
546
+ def _risk_to_exploitability(risk_level: str) -> str:
547
+ lowered = risk_level.lower()
548
+ if lowered in {"critical", "high"}:
549
+ return "high"
550
+ if lowered == "medium":
551
+ return "medium"
552
+ if lowered == "low":
553
+ return "low"
554
+ return "unknown"
555
+
556
+
557
+ def _normalize_reachability(raw: str) -> str:
558
+ lowered = raw.lower()
559
+ if lowered in {"reachable", "potentially_reachable", "potentially-reachable"}:
560
+ return "reachable"
561
+ if lowered == "unreachable":
562
+ return "unreachable"
563
+ return "unknown"
564
+
565
+
566
+ def _normalize_version(version: str) -> str:
567
+ normalized = (version or "").strip()
568
+ for prefix in ("==", ">=", "<=", "~=", "^", ">"):
569
+ if normalized.startswith(prefix):
570
+ return normalized[len(prefix):].strip()
571
+ return normalized
572
+
573
+
574
+ def _ecosystem_from_manifest(manifest_path: str) -> str:
575
+ suffix = Path(manifest_path).name
576
+ return {
577
+ "package.json": "npm",
578
+ "requirements.txt": "PyPI",
579
+ "pyproject.toml": "PyPI",
580
+ "Cargo.toml": "crates.io",
581
+ "go.mod": "Go",
582
+ "Gemfile": "RubyGems",
583
+ }.get(suffix, "npm")
584
+
585
+
586
+ def _normalize_severity(raw: str) -> str:
587
+ lowered = raw.lower()
588
+ if "critical" in lowered:
589
+ return "critical"
590
+ if "high" in lowered:
591
+ return "high"
592
+ if "medium" in lowered or "moderate" in lowered:
593
+ return "medium"
594
+ if "low" in lowered:
595
+ return "low"
596
+ return "medium"
597
+
598
+
599
+ def _finding(
600
+ *,
601
+ rule_id: str,
602
+ source_name: str,
603
+ category: str,
604
+ severity: str,
605
+ path: Path,
606
+ line: int,
607
+ message: str,
608
+ recommendation: str,
609
+ snippet: str,
610
+ ) -> dict[str, Any]:
611
+ exploitability = "high" if severity in {"critical", "high"} else ("medium" if severity == "medium" else "low")
612
+ return {
613
+ "id": rule_id,
614
+ "source": source_name,
615
+ "category": category,
616
+ "severity": severity,
617
+ "exploitability": exploitability,
618
+ "reachability": "reachable",
619
+ "evidence": {
620
+ "path": str(path),
621
+ "line": line,
622
+ "snippet": snippet,
623
+ },
624
+ "recommendation": recommendation,
625
+ "message": message,
626
+ }
627
+
628
+
629
+ def _normalize_waivers(waivers: list[dict[str, Any] | str]) -> dict[str, str]:
630
+ normalized: dict[str, str] = {}
631
+ for waiver in waivers:
632
+ if isinstance(waiver, str):
633
+ key = waiver.strip()
634
+ if key:
635
+ normalized[key] = "waived"
636
+ continue
637
+ if not isinstance(waiver, dict):
638
+ continue
639
+ target = str(waiver.get("finding_id") or waiver.get("id") or "").strip()
640
+ if not target:
641
+ continue
642
+ justification = str(waiver.get("justification") or waiver.get("reason") or "waived").strip()
643
+ normalized[target] = justification
644
+ return normalized
645
+
646
+
647
+ def _finding_instance_id(finding: dict[str, Any]) -> str:
648
+ evidence = finding.get("evidence", {})
649
+ base = "|".join(
650
+ [
651
+ str(finding.get("id", "")),
652
+ str(evidence.get("path", "")),
653
+ str(evidence.get("line", "")),
654
+ str(finding.get("message", "")),
655
+ ]
656
+ )
657
+ digest = sha256(base.encode("utf-8")).hexdigest()
658
+ return f"{finding.get('id', 'SEC')}-{digest[:12]}"
659
+
660
+
661
+ def _finalize_findings(findings: list[dict[str, Any]], waiver_map: dict[str, str]) -> list[dict[str, Any]]:
662
+ finalized: list[dict[str, Any]] = []
663
+ for finding in findings:
664
+ item = dict(finding)
665
+ item["severity"] = _normalize_severity(str(item.get("severity", "medium")))
666
+ item.setdefault("exploitability", "unknown")
667
+ item.setdefault("reachability", "unknown")
668
+ item["exploitability"] = _normalize_exploitability(str(item.get("exploitability", "unknown")), item)
669
+ item["reachability"] = _normalize_reachability(str(item.get("reachability", "unknown")))
670
+ item["finding_id"] = _finding_instance_id(item)
671
+ justification = waiver_map.get(item["finding_id"]) or waiver_map.get(str(item.get("id", "")))
672
+ if justification:
673
+ item["waived"] = True
674
+ item["waiver_justification"] = justification
675
+ else:
676
+ item["waived"] = False
677
+ finalized.append(item)
678
+ return finalized
679
+
680
+
681
+ def _normalize_exploitability(raw: str, finding: dict[str, Any]) -> str:
682
+ lowered = raw.lower()
683
+ if lowered in {"high", "medium", "low"}:
684
+ return lowered
685
+ category = str(finding.get("category", "")).lower()
686
+ severity = str(finding.get("severity", "medium")).lower()
687
+ if category in {"secret", "python_ast"}:
688
+ return "high"
689
+ if severity in {"critical", "high"}:
690
+ return "high"
691
+ if severity == "medium":
692
+ return "medium"
693
+ if severity == "low":
694
+ return "low"
695
+ return "unknown"
696
+
697
+
698
+ def _build_provenance(
699
+ *,
700
+ scope: str,
701
+ manifests: list[Any],
702
+ findings: list[dict[str, Any]],
703
+ include_live_enrichment: bool,
704
+ external_inputs: list[dict[str, Any]],
705
+ ) -> list[dict[str, Any]]:
706
+ provenance = [
707
+ {
708
+ "source": "bandit-lite",
709
+ "scope": scope,
710
+ "mode": "static",
711
+ "finding_count": len([finding for finding in findings if finding["source"] == "bandit-lite"]),
712
+ },
713
+ {
714
+ "source": "manifest-detector",
715
+ "scope": scope,
716
+ "manifest_count": len(manifests),
717
+ "mode": "live" if include_live_enrichment else "offline",
718
+ },
719
+ ]
720
+ if include_live_enrichment:
721
+ provenance.append(
722
+ {
723
+ "source": "osv",
724
+ "scope": scope,
725
+ "mode": "live-enrichment",
726
+ }
727
+ )
728
+ if external_inputs:
729
+ provenance.append(
730
+ {
731
+ "source": "external-content",
732
+ "scope": scope,
733
+ "mode": "zero-trust",
734
+ "count": len(external_inputs),
735
+ }
736
+ )
737
+ return provenance
738
+
739
+
740
+ def _build_trust_scores(findings: list[dict[str, Any]]) -> dict[str, float]:
741
+ if not findings:
742
+ return {"overall": 1.0}
743
+ weighted = 0.0
744
+ for finding in findings:
745
+ severity = finding.get("severity", "medium")
746
+ weighted += {"critical": 0.4, "high": 0.25, "medium": 0.1, "low": 0.05}.get(str(severity), 0.1)
747
+ overall = max(0.0, round(1.0 - min(weighted, 0.95), 3))
748
+ return {"overall": overall}
749
+
750
+
751
+ def _timestamp_slug() -> str:
752
+ return datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
753
+
754
+
755
+ def _build_sarif_payload(findings: list[dict[str, Any]]) -> dict[str, Any]:
756
+ rules_by_id: dict[str, dict[str, Any]] = {}
757
+ results: list[dict[str, Any]] = []
758
+ for finding in findings:
759
+ rule_id = str(finding.get("id", "OMG000"))
760
+ if rule_id not in rules_by_id:
761
+ rules_by_id[rule_id] = {
762
+ "id": rule_id,
763
+ "name": str(finding.get("category", "security")),
764
+ "shortDescription": {"text": str(finding.get("message", "Security finding"))},
765
+ "help": {"text": str(finding.get("recommendation", "Review finding and remediate."))},
766
+ }
767
+ evidence = finding.get("evidence", {})
768
+ level = "warning"
769
+ if finding.get("severity") in {"critical", "high"}:
770
+ level = "error"
771
+ elif finding.get("severity") == "low":
772
+ level = "note"
773
+ location = {
774
+ "physicalLocation": {
775
+ "artifactLocation": {"uri": str(evidence.get("path", ""))},
776
+ "region": {"startLine": int(evidence.get("line", 1) or 1)},
777
+ }
778
+ }
779
+ result_payload: dict[str, Any] = {
780
+ "ruleId": rule_id,
781
+ "level": level,
782
+ "message": {"text": str(finding.get("message", "Security finding"))},
783
+ "partialFingerprints": {
784
+ "findingId": str(finding.get("finding_id", "")),
785
+ },
786
+ "properties": {
787
+ "severity": str(finding.get("severity", "medium")),
788
+ "exploitability": str(finding.get("exploitability", "unknown")),
789
+ "reachability": str(finding.get("reachability", "unknown")),
790
+ "waived": bool(finding.get("waived", False)),
791
+ },
792
+ "locations": [location],
793
+ }
794
+ if finding.get("waived"):
795
+ result_payload["suppressions"] = [
796
+ {
797
+ "kind": "inSource",
798
+ "justification": str(finding.get("waiver_justification", "waived")),
799
+ }
800
+ ]
801
+ results.append(result_payload)
802
+
803
+ return {
804
+ "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
805
+ "version": "2.1.0",
806
+ "runs": [
807
+ {
808
+ "tool": {
809
+ "driver": {
810
+ "name": "omg-security-check",
811
+ "version": CANONICAL_VERSION,
812
+ "rules": [rules_by_id[key] for key in sorted(rules_by_id.keys())],
813
+ }
814
+ },
815
+ "results": results,
816
+ }
817
+ ],
818
+ }
819
+
820
+
821
+ def _build_sbom_payload(*, generated_at: str, manifests: Any) -> dict[str, Any]:
822
+ components: list[dict[str, Any]] = []
823
+ for package in manifests.packages:
824
+ version = _normalize_version(package.version)
825
+ ecosystem = _ecosystem_from_manifest(package.source_manifest)
826
+ purl_type = _SBOM_ECOSYSTEM_PURL.get(ecosystem, "generic")
827
+ purl = f"pkg:{purl_type}/{package.name}"
828
+ if version:
829
+ purl = f"{purl}@{version}"
830
+ component = {
831
+ "type": "library",
832
+ "name": package.name,
833
+ "version": version,
834
+ "purl": purl,
835
+ }
836
+ components.append(component)
837
+ return {
838
+ "bomFormat": "CycloneDX",
839
+ "specVersion": "1.4",
840
+ "version": 1,
841
+ "metadata": {
842
+ "timestamp": generated_at,
843
+ "tools": [{"vendor": "OMG", "name": "omg-security-check", "version": CANONICAL_VERSION}],
844
+ },
845
+ "components": components,
846
+ }
847
+
848
+
849
+ def _build_license_artifact(*, project_dir: str, scope_path: Path, manifests: Any, generated_at: str) -> dict[str, Any]:
850
+ project_license = _detect_project_license(project_dir=project_dir, scope_path=scope_path)
851
+ dependencies = [{"name": package.name, "license": "UNKNOWN"} for package in manifests.packages]
852
+ compatibility = check_license_compatibility(project_license, dependencies)
853
+ packages_by_license: dict[str, list[str]] = {}
854
+ for dependency in dependencies:
855
+ package_name = str(dependency.get("name", "")).strip()
856
+ if not package_name:
857
+ continue
858
+ spdx_id = str(dependency.get("license", "UNKNOWN") or "UNKNOWN").strip() or "UNKNOWN"
859
+ packages_by_license.setdefault(spdx_id, []).append(package_name)
860
+
861
+ licenses = [
862
+ {
863
+ "name": spdx_id,
864
+ "spdx_id": spdx_id,
865
+ "packages": sorted(packages),
866
+ }
867
+ for spdx_id, packages in sorted(packages_by_license.items())
868
+ ]
869
+
870
+ if not licenses:
871
+ licenses = [{"name": project_license, "spdx_id": project_license, "packages": []}]
872
+
873
+ return {
874
+ "timestamp": generated_at,
875
+ "licenses": licenses,
876
+ "project_license": project_license,
877
+ "compatibility": compatibility,
878
+ }
879
+
880
+
881
+ def _detect_project_license(*, project_dir: str, scope_path: Path) -> str:
882
+ candidates = [scope_path / "package.json", Path(project_dir).resolve() / "package.json"]
883
+ for candidate in candidates:
884
+ if not candidate.exists():
885
+ continue
886
+ try:
887
+ payload = json.loads(candidate.read_text(encoding="utf-8"))
888
+ except (OSError, json.JSONDecodeError):
889
+ continue
890
+ if isinstance(payload, dict) and isinstance(payload.get("license"), str) and payload["license"].strip():
891
+ return str(payload["license"]).strip()
892
+ if (Path(project_dir).resolve() / "LICENSE").exists() or (Path(project_dir).resolve() / "LICENSE.md").exists():
893
+ return "MIT"
894
+ return "UNKNOWN"
895
+
896
+
897
+ def _write_json_file(path: Path, payload: dict[str, Any]) -> None:
898
+ path.parent.mkdir(parents=True, exist_ok=True)
899
+ path.write_text(json.dumps(payload, indent=2, ensure_ascii=True) + "\n", encoding="utf-8")
900
+
901
+
902
+ def _write_evidence_artifacts(
903
+ project_dir: str,
904
+ *,
905
+ scope: str,
906
+ generated_at: str,
907
+ findings: list[dict[str, Any]],
908
+ provenance: list[dict[str, Any]],
909
+ trust_scores: dict[str, float],
910
+ include_live_enrichment: bool,
911
+ waivers: list[dict[str, Any] | str],
912
+ license_artifact: dict[str, Any],
913
+ manifests: Any,
914
+ unresolved_risks: list[dict[str, Any]],
915
+ ) -> dict[str, str]:
916
+ stamp = _timestamp_slug()
917
+ evidence_dir = Path(project_dir) / ".omg" / "evidence"
918
+ evidence_dir.mkdir(parents=True, exist_ok=True)
919
+
920
+ json_rel = Path(".omg") / "evidence" / f"security-{stamp}.json"
921
+ sarif_rel = Path(".omg") / "evidence" / f"security-{stamp}.sarif"
922
+ sbom_rel = Path(".omg") / "evidence" / f"sbom-{stamp}.cdx.json"
923
+ license_rel = Path(".omg") / "evidence" / f"license-{stamp}.json"
924
+
925
+ unresolved_high_risk = [
926
+ finding
927
+ for finding in findings
928
+ if finding.get("severity") in {"critical", "high"} and not finding.get("waived", False)
929
+ ]
930
+
931
+ payload = {
932
+ "schema": "SecurityCheckEvidence",
933
+ "generated_at": generated_at,
934
+ "scope": scope,
935
+ "scan_status": "completed",
936
+ "live_enrichment": include_live_enrichment,
937
+ "findings": findings,
938
+ "waivers": waivers,
939
+ "unresolved_high_risk": [finding.get("finding_id") for finding in unresolved_high_risk],
940
+ "unresolved_risks": unresolved_risks,
941
+ "security_scans": [
942
+ {
943
+ "tool": "security-check",
944
+ "path": json_rel.as_posix(),
945
+ "findings": findings,
946
+ }
947
+ ],
948
+ "provenance": provenance,
949
+ "trust_scores": trust_scores,
950
+ "artifacts": {
951
+ "sarif_path": sarif_rel.as_posix(),
952
+ "sbom_path": sbom_rel.as_posix(),
953
+ "license_path": license_rel.as_posix(),
954
+ },
955
+ }
956
+ _write_json_file(Path(project_dir) / json_rel, payload)
957
+ _write_json_file(Path(project_dir) / sarif_rel, _build_sarif_payload(findings))
958
+ _write_json_file(Path(project_dir) / sbom_rel, _build_sbom_payload(generated_at=generated_at, manifests=manifests))
959
+ _write_json_file(Path(project_dir) / license_rel, license_artifact)
960
+ return {
961
+ "json_path": json_rel.as_posix(),
962
+ "sarif_path": sarif_rel.as_posix(),
963
+ "sbom_path": sbom_rel.as_posix(),
964
+ "license_path": license_rel.as_posix(),
965
+ }