@trac3er/oh-my-god 2.1.0 → 2.1.4

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 (371) hide show
  1. package/.agents/skills/omg/AGENTS.fragment.md +2 -2
  2. package/.agents/skills/omg/algorithms/SKILL.md +1 -1
  3. package/.agents/skills/omg/algorithms/openai.yaml +1 -1
  4. package/.agents/skills/omg/api-twin/SKILL.md +1 -1
  5. package/.agents/skills/omg/api-twin/openai.yaml +1 -1
  6. package/.agents/skills/omg/claim-judge/SKILL.md +1 -1
  7. package/.agents/skills/omg/claim-judge/openai.yaml +1 -1
  8. package/.agents/skills/omg/codex-rules.md +1 -1
  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 +1 -1
  12. package/.agents/skills/omg/data-lineage/openai.yaml +1 -1
  13. package/.agents/skills/omg/delta-classifier/SKILL.md +1 -1
  14. package/.agents/skills/omg/delta-classifier/openai.yaml +1 -1
  15. package/.agents/skills/omg/eval-gate/SKILL.md +1 -1
  16. package/.agents/skills/omg/eval-gate/openai.yaml +1 -1
  17. package/.agents/skills/omg/health/SKILL.md +1 -1
  18. package/.agents/skills/omg/health/openai.yaml +1 -1
  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 +1 -1
  22. package/.agents/skills/omg/incident-replay/openai.yaml +1 -1
  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 +1 -1
  28. package/.agents/skills/omg/plan-council/openai.yaml +1 -1
  29. package/.agents/skills/omg/preflight/SKILL.md +1 -1
  30. package/.agents/skills/omg/preflight/openai.yaml +1 -1
  31. package/.agents/skills/omg/proof-gate/SKILL.md +1 -1
  32. package/.agents/skills/omg/proof-gate/openai.yaml +1 -1
  33. package/.agents/skills/omg/remote-supervisor/SKILL.md +1 -1
  34. package/.agents/skills/omg/remote-supervisor/openai.yaml +1 -1
  35. package/.agents/skills/omg/robotics/SKILL.md +1 -1
  36. package/.agents/skills/omg/robotics/openai.yaml +1 -1
  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 +1 -1
  40. package/.agents/skills/omg/security-check/openai.yaml +1 -1
  41. package/.agents/skills/omg/test-intent-lock/SKILL.md +1 -1
  42. package/.agents/skills/omg/test-intent-lock/openai.yaml +1 -1
  43. package/.agents/skills/omg/tracebank/SKILL.md +1 -1
  44. package/.agents/skills/omg/tracebank/openai.yaml +1 -1
  45. package/.agents/skills/omg/vision/SKILL.md +1 -1
  46. package/.agents/skills/omg/vision/openai.yaml +1 -1
  47. package/.claude-plugin/marketplace.json +3 -3
  48. package/.claude-plugin/plugin.json +1 -1
  49. package/CHANGELOG.md +16 -0
  50. package/CLI-ADAPTER-MAP.md +3 -3
  51. package/OMG-setup.sh +114 -1
  52. package/OMG_COMPAT_CONTRACT.md +1 -1
  53. package/README.md +2 -1
  54. package/artifacts/release/.claude-plugin/marketplace.json +3 -3
  55. package/artifacts/release/.claude-plugin/plugin.json +1 -1
  56. package/artifacts/release/OMG_COMPAT_CONTRACT.md +1 -1
  57. package/artifacts/release/dist/enterprise/bundle/.claude-plugin/marketplace.json +3 -3
  58. package/artifacts/release/dist/enterprise/bundle/.claude-plugin/plugin.json +1 -1
  59. package/artifacts/release/dist/enterprise/bundle/OMG_COMPAT_CONTRACT.md +1 -1
  60. package/artifacts/release/dist/enterprise/bundle/plugins/advanced/plugin.json +26 -9
  61. package/artifacts/release/dist/enterprise/bundle/registry/bundles/algorithms.yaml +1 -1
  62. package/artifacts/release/dist/enterprise/bundle/registry/bundles/api-twin.yaml +1 -1
  63. package/artifacts/release/dist/enterprise/bundle/registry/bundles/claim-judge.yaml +1 -1
  64. package/artifacts/release/dist/enterprise/bundle/registry/bundles/control-plane.yaml +1 -1
  65. package/artifacts/release/dist/enterprise/bundle/registry/bundles/data-lineage.yaml +1 -1
  66. package/artifacts/release/dist/enterprise/bundle/registry/bundles/delta-classifier.yaml +1 -1
  67. package/artifacts/release/dist/enterprise/bundle/registry/bundles/eval-gate.yaml +1 -1
  68. package/artifacts/release/dist/enterprise/bundle/registry/bundles/health.yaml +1 -1
  69. package/artifacts/release/dist/enterprise/bundle/registry/bundles/hook-governor.yaml +1 -1
  70. package/artifacts/release/dist/enterprise/bundle/registry/bundles/incident-replay.yaml +1 -1
  71. package/artifacts/release/dist/enterprise/bundle/registry/bundles/lsp-pack.yaml +1 -1
  72. package/artifacts/release/dist/enterprise/bundle/registry/bundles/mcp-fabric.yaml +1 -1
  73. package/artifacts/release/dist/enterprise/bundle/registry/bundles/plan-council.yaml +1 -1
  74. package/artifacts/release/dist/enterprise/bundle/registry/bundles/preflight.yaml +1 -1
  75. package/artifacts/release/dist/enterprise/bundle/registry/bundles/proof-gate.yaml +1 -1
  76. package/artifacts/release/dist/enterprise/bundle/registry/bundles/remote-supervisor.yaml +1 -1
  77. package/artifacts/release/dist/enterprise/bundle/registry/bundles/robotics.yaml +1 -1
  78. package/artifacts/release/dist/enterprise/bundle/registry/bundles/secure-worktree-pipeline.yaml +1 -1
  79. package/artifacts/release/dist/enterprise/bundle/registry/bundles/security-check.yaml +1 -1
  80. package/artifacts/release/dist/enterprise/bundle/registry/bundles/test-intent-lock.yaml +1 -1
  81. package/artifacts/release/dist/enterprise/bundle/registry/bundles/tracebank.yaml +1 -1
  82. package/artifacts/release/dist/enterprise/bundle/registry/bundles/vision.yaml +1 -1
  83. package/artifacts/release/dist/enterprise/bundle/registry/omg-capability.schema.json +1 -1
  84. package/artifacts/release/dist/enterprise/bundle/settings.json +3 -3
  85. package/artifacts/release/dist/enterprise/manifest.json +30 -40
  86. package/artifacts/release/dist/public/bundle/.claude-plugin/marketplace.json +3 -3
  87. package/artifacts/release/dist/public/bundle/.claude-plugin/plugin.json +1 -1
  88. package/artifacts/release/dist/public/bundle/OMG_COMPAT_CONTRACT.md +1 -1
  89. package/artifacts/release/dist/public/bundle/plugins/advanced/plugin.json +26 -9
  90. package/artifacts/release/dist/public/bundle/registry/bundles/algorithms.yaml +1 -1
  91. package/artifacts/release/dist/public/bundle/registry/bundles/api-twin.yaml +1 -1
  92. package/artifacts/release/dist/public/bundle/registry/bundles/claim-judge.yaml +1 -1
  93. package/artifacts/release/dist/public/bundle/registry/bundles/control-plane.yaml +1 -1
  94. package/artifacts/release/dist/public/bundle/registry/bundles/data-lineage.yaml +1 -1
  95. package/artifacts/release/dist/public/bundle/registry/bundles/delta-classifier.yaml +1 -1
  96. package/artifacts/release/dist/public/bundle/registry/bundles/eval-gate.yaml +1 -1
  97. package/artifacts/release/dist/public/bundle/registry/bundles/health.yaml +1 -1
  98. package/artifacts/release/dist/public/bundle/registry/bundles/hook-governor.yaml +1 -1
  99. package/artifacts/release/dist/public/bundle/registry/bundles/incident-replay.yaml +1 -1
  100. package/artifacts/release/dist/public/bundle/registry/bundles/lsp-pack.yaml +1 -1
  101. package/artifacts/release/dist/public/bundle/registry/bundles/mcp-fabric.yaml +1 -1
  102. package/artifacts/release/dist/public/bundle/registry/bundles/plan-council.yaml +1 -1
  103. package/artifacts/release/dist/public/bundle/registry/bundles/preflight.yaml +1 -1
  104. package/artifacts/release/dist/public/bundle/registry/bundles/proof-gate.yaml +1 -1
  105. package/artifacts/release/dist/public/bundle/registry/bundles/remote-supervisor.yaml +1 -1
  106. package/artifacts/release/dist/public/bundle/registry/bundles/robotics.yaml +1 -1
  107. package/artifacts/release/dist/public/bundle/registry/bundles/secure-worktree-pipeline.yaml +1 -1
  108. package/artifacts/release/dist/public/bundle/registry/bundles/security-check.yaml +1 -1
  109. package/artifacts/release/dist/public/bundle/registry/bundles/test-intent-lock.yaml +1 -1
  110. package/artifacts/release/dist/public/bundle/registry/bundles/tracebank.yaml +1 -1
  111. package/artifacts/release/dist/public/bundle/registry/bundles/vision.yaml +1 -1
  112. package/artifacts/release/dist/public/bundle/registry/omg-capability.schema.json +1 -1
  113. package/artifacts/release/dist/public/bundle/settings.json +3 -3
  114. package/artifacts/release/dist/public/manifest.json +30 -40
  115. package/artifacts/release/plugins/advanced/plugin.json +26 -9
  116. package/artifacts/release/registry/bundles/algorithms.yaml +1 -1
  117. package/artifacts/release/registry/bundles/api-twin.yaml +1 -1
  118. package/artifacts/release/registry/bundles/claim-judge.yaml +1 -1
  119. package/artifacts/release/registry/bundles/control-plane.yaml +1 -1
  120. package/artifacts/release/registry/bundles/data-lineage.yaml +1 -1
  121. package/artifacts/release/registry/bundles/delta-classifier.yaml +1 -1
  122. package/artifacts/release/registry/bundles/eval-gate.yaml +1 -1
  123. package/artifacts/release/registry/bundles/health.yaml +1 -1
  124. package/artifacts/release/registry/bundles/hook-governor.yaml +1 -1
  125. package/artifacts/release/registry/bundles/incident-replay.yaml +1 -1
  126. package/artifacts/release/registry/bundles/lsp-pack.yaml +1 -1
  127. package/artifacts/release/registry/bundles/mcp-fabric.yaml +1 -1
  128. package/artifacts/release/registry/bundles/plan-council.yaml +1 -1
  129. package/artifacts/release/registry/bundles/preflight.yaml +1 -1
  130. package/artifacts/release/registry/bundles/proof-gate.yaml +1 -1
  131. package/artifacts/release/registry/bundles/remote-supervisor.yaml +1 -1
  132. package/artifacts/release/registry/bundles/robotics.yaml +1 -1
  133. package/artifacts/release/registry/bundles/secure-worktree-pipeline.yaml +1 -1
  134. package/artifacts/release/registry/bundles/security-check.yaml +1 -1
  135. package/artifacts/release/registry/bundles/test-intent-lock.yaml +1 -1
  136. package/artifacts/release/registry/bundles/tracebank.yaml +1 -1
  137. package/artifacts/release/registry/bundles/vision.yaml +1 -1
  138. package/artifacts/release/registry/omg-capability.schema.json +1 -1
  139. package/artifacts/release/settings.json +3 -3
  140. package/build/lib/commands/OMG:profile-review.md +43 -0
  141. package/build/lib/commands/OMG:validate.md +59 -0
  142. package/build/lib/control_plane/service.py +40 -1
  143. package/build/lib/hooks/_agent_registry.py +2 -0
  144. package/build/lib/hooks/firewall.py +263 -4
  145. package/build/lib/hooks/intentgate-keyword-detector.py +15 -3
  146. package/build/lib/hooks/policy_engine.py +77 -0
  147. package/build/lib/hooks/prompt-enhancer.py +146 -0
  148. package/build/lib/hooks/session-end-capture.py +374 -6
  149. package/build/lib/hooks/session-start.py +13 -35
  150. package/build/lib/hooks/setup_wizard.py +333 -1
  151. package/build/lib/hooks/shadow_manager.py +111 -2
  152. package/build/lib/hooks/stop_dispatcher.py +108 -4
  153. package/build/lib/plugins/advanced/plugin.json +26 -9
  154. package/build/lib/plugins/core/plugin.json +44 -11
  155. package/build/lib/registry/bundles/algorithms.yaml +1 -1
  156. package/build/lib/registry/bundles/api-twin.yaml +1 -1
  157. package/build/lib/registry/bundles/claim-judge.yaml +1 -1
  158. package/build/lib/registry/bundles/control-plane.yaml +1 -1
  159. package/build/lib/registry/bundles/data-lineage.yaml +1 -1
  160. package/build/lib/registry/bundles/delta-classifier.yaml +1 -1
  161. package/build/lib/registry/bundles/eval-gate.yaml +1 -1
  162. package/build/lib/registry/bundles/health.yaml +1 -1
  163. package/build/lib/registry/bundles/hook-governor.yaml +1 -1
  164. package/build/lib/registry/bundles/incident-replay.yaml +1 -1
  165. package/build/lib/registry/bundles/lsp-pack.yaml +1 -1
  166. package/build/lib/registry/bundles/mcp-fabric.yaml +1 -1
  167. package/build/lib/registry/bundles/plan-council.yaml +1 -1
  168. package/build/lib/registry/bundles/preflight.yaml +1 -1
  169. package/build/lib/registry/bundles/proof-gate.yaml +1 -1
  170. package/build/lib/registry/bundles/remote-supervisor.yaml +1 -1
  171. package/build/lib/registry/bundles/robotics.yaml +1 -1
  172. package/build/lib/registry/bundles/secure-worktree-pipeline.yaml +1 -1
  173. package/build/lib/registry/bundles/security-check.yaml +1 -1
  174. package/build/lib/registry/bundles/test-intent-lock.yaml +1 -1
  175. package/build/lib/registry/bundles/tracebank.yaml +1 -1
  176. package/build/lib/registry/bundles/vision.yaml +1 -1
  177. package/build/lib/registry/omg-capability.schema.json +1 -1
  178. package/build/lib/runtime/adoption.py +1 -1
  179. package/build/lib/runtime/background_verification.py +62 -0
  180. package/build/lib/runtime/claim_judge.py +165 -5
  181. package/build/lib/runtime/compat.py +15 -1
  182. package/build/lib/runtime/context_engine.py +261 -4
  183. package/build/lib/runtime/contract_compiler.py +370 -93
  184. package/build/lib/runtime/defense_state.py +79 -8
  185. package/build/lib/runtime/delta_classifier.py +80 -2
  186. package/build/lib/runtime/evidence_query.py +56 -4
  187. package/build/lib/runtime/evidence_registry.py +16 -0
  188. package/build/lib/runtime/evidence_requirements.py +47 -0
  189. package/build/lib/runtime/forge_agents.py +179 -9
  190. package/build/lib/runtime/forge_contracts.py +208 -2
  191. package/build/lib/runtime/interaction_journal.py +318 -42
  192. package/build/lib/runtime/memory_store.py +134 -1
  193. package/build/lib/runtime/mutation_gate.py +57 -11
  194. package/build/lib/runtime/omg_compat_contract_snapshot.json +2 -2
  195. package/build/lib/runtime/omg_mcp_server.py +14 -4
  196. package/build/lib/runtime/preflight.py +14 -0
  197. package/build/lib/runtime/profile_io.py +294 -0
  198. package/build/lib/runtime/proof_gate.py +122 -7
  199. package/build/lib/runtime/release_run_coordinator.py +339 -0
  200. package/build/lib/runtime/release_surfaces.py +243 -0
  201. package/build/lib/runtime/rollback_manifest.py +136 -0
  202. package/build/lib/runtime/router_critics.py +50 -0
  203. package/build/lib/runtime/runtime_contracts.py +137 -0
  204. package/build/lib/runtime/security_check.py +16 -0
  205. package/build/lib/runtime/session_health.py +60 -16
  206. package/build/lib/runtime/team_router.py +156 -13
  207. package/build/lib/runtime/test_intent_lock.py +102 -0
  208. package/build/lib/runtime/tool_plan_gate.py +249 -24
  209. package/build/lib/runtime/validate.py +194 -0
  210. package/build/lib/runtime/verification_controller.py +52 -2
  211. package/commands/OMG:diagnose-plugins.md +33 -0
  212. package/commands/OMG:profile-review.md +43 -0
  213. package/commands/OMG:setup.md +4 -1
  214. package/commands/OMG:validate.md +59 -0
  215. package/control_plane/service.py +40 -1
  216. package/dist/enterprise/bundle/.claude-plugin/marketplace.json +3 -3
  217. package/dist/enterprise/bundle/.claude-plugin/plugin.json +1 -1
  218. package/dist/enterprise/bundle/OMG_COMPAT_CONTRACT.md +1 -1
  219. package/dist/enterprise/bundle/plugins/advanced/plugin.json +26 -9
  220. package/dist/enterprise/bundle/registry/bundles/algorithms.yaml +1 -1
  221. package/dist/enterprise/bundle/registry/bundles/api-twin.yaml +1 -1
  222. package/dist/enterprise/bundle/registry/bundles/claim-judge.yaml +1 -1
  223. package/dist/enterprise/bundle/registry/bundles/control-plane.yaml +1 -1
  224. package/dist/enterprise/bundle/registry/bundles/data-lineage.yaml +1 -1
  225. package/dist/enterprise/bundle/registry/bundles/delta-classifier.yaml +1 -1
  226. package/dist/enterprise/bundle/registry/bundles/eval-gate.yaml +1 -1
  227. package/dist/enterprise/bundle/registry/bundles/health.yaml +1 -1
  228. package/dist/enterprise/bundle/registry/bundles/hook-governor.yaml +1 -1
  229. package/dist/enterprise/bundle/registry/bundles/incident-replay.yaml +1 -1
  230. package/dist/enterprise/bundle/registry/bundles/lsp-pack.yaml +1 -1
  231. package/dist/enterprise/bundle/registry/bundles/mcp-fabric.yaml +1 -1
  232. package/dist/enterprise/bundle/registry/bundles/plan-council.yaml +1 -1
  233. package/dist/enterprise/bundle/registry/bundles/preflight.yaml +1 -1
  234. package/dist/enterprise/bundle/registry/bundles/proof-gate.yaml +1 -1
  235. package/dist/enterprise/bundle/registry/bundles/remote-supervisor.yaml +1 -1
  236. package/dist/enterprise/bundle/registry/bundles/robotics.yaml +1 -1
  237. package/dist/enterprise/bundle/registry/bundles/secure-worktree-pipeline.yaml +1 -1
  238. package/dist/enterprise/bundle/registry/bundles/security-check.yaml +1 -1
  239. package/dist/enterprise/bundle/registry/bundles/test-intent-lock.yaml +1 -1
  240. package/dist/enterprise/bundle/registry/bundles/tracebank.yaml +1 -1
  241. package/dist/enterprise/bundle/registry/bundles/vision.yaml +1 -1
  242. package/dist/enterprise/bundle/registry/omg-capability.schema.json +1 -1
  243. package/dist/enterprise/bundle/settings.json +3 -3
  244. package/dist/enterprise/manifest.json +30 -40
  245. package/dist/oh_my_god-2.1.4-py3-none-any.whl +0 -0
  246. package/dist/oh_my_god-2.1.4.tar.gz +0 -0
  247. package/dist/public/bundle/.claude-plugin/marketplace.json +3 -3
  248. package/dist/public/bundle/.claude-plugin/plugin.json +1 -1
  249. package/dist/public/bundle/OMG_COMPAT_CONTRACT.md +1 -1
  250. package/dist/public/bundle/plugins/advanced/plugin.json +26 -9
  251. package/dist/public/bundle/registry/bundles/algorithms.yaml +1 -1
  252. package/dist/public/bundle/registry/bundles/api-twin.yaml +1 -1
  253. package/dist/public/bundle/registry/bundles/claim-judge.yaml +1 -1
  254. package/dist/public/bundle/registry/bundles/control-plane.yaml +1 -1
  255. package/dist/public/bundle/registry/bundles/data-lineage.yaml +1 -1
  256. package/dist/public/bundle/registry/bundles/delta-classifier.yaml +1 -1
  257. package/dist/public/bundle/registry/bundles/eval-gate.yaml +1 -1
  258. package/dist/public/bundle/registry/bundles/health.yaml +1 -1
  259. package/dist/public/bundle/registry/bundles/hook-governor.yaml +1 -1
  260. package/dist/public/bundle/registry/bundles/incident-replay.yaml +1 -1
  261. package/dist/public/bundle/registry/bundles/lsp-pack.yaml +1 -1
  262. package/dist/public/bundle/registry/bundles/mcp-fabric.yaml +1 -1
  263. package/dist/public/bundle/registry/bundles/plan-council.yaml +1 -1
  264. package/dist/public/bundle/registry/bundles/preflight.yaml +1 -1
  265. package/dist/public/bundle/registry/bundles/proof-gate.yaml +1 -1
  266. package/dist/public/bundle/registry/bundles/remote-supervisor.yaml +1 -1
  267. package/dist/public/bundle/registry/bundles/robotics.yaml +1 -1
  268. package/dist/public/bundle/registry/bundles/secure-worktree-pipeline.yaml +1 -1
  269. package/dist/public/bundle/registry/bundles/security-check.yaml +1 -1
  270. package/dist/public/bundle/registry/bundles/test-intent-lock.yaml +1 -1
  271. package/dist/public/bundle/registry/bundles/tracebank.yaml +1 -1
  272. package/dist/public/bundle/registry/bundles/vision.yaml +1 -1
  273. package/dist/public/bundle/registry/omg-capability.schema.json +1 -1
  274. package/dist/public/bundle/settings.json +3 -3
  275. package/dist/public/manifest.json +30 -40
  276. package/docs/install/opencode.md +30 -0
  277. package/docs/proof.md +11 -0
  278. package/docs/release-checklist.md +14 -1
  279. package/hooks/_agent_registry.py +2 -0
  280. package/hooks/firewall.py +263 -4
  281. package/hooks/intentgate-keyword-detector.py +15 -3
  282. package/hooks/policy_engine.py +77 -0
  283. package/hooks/prompt-enhancer.py +146 -0
  284. package/hooks/session-end-capture.py +374 -6
  285. package/hooks/session-start.py +13 -35
  286. package/hooks/setup_wizard.py +342 -2
  287. package/hooks/shadow_manager.py +111 -2
  288. package/hooks/stop_dispatcher.py +108 -4
  289. package/hud/omg-hud.mjs +30 -6
  290. package/lab/pipeline.py +197 -26
  291. package/package.json +1 -1
  292. package/plugins/advanced/plugin.json +26 -9
  293. package/plugins/core/plugin.json +51 -12
  294. package/pyproject.toml +10 -2
  295. package/registry/bundles/algorithms.yaml +1 -1
  296. package/registry/bundles/api-twin.yaml +1 -1
  297. package/registry/bundles/claim-judge.yaml +1 -1
  298. package/registry/bundles/control-plane.yaml +1 -1
  299. package/registry/bundles/data-lineage.yaml +1 -1
  300. package/registry/bundles/delta-classifier.yaml +1 -1
  301. package/registry/bundles/eval-gate.yaml +1 -1
  302. package/registry/bundles/health.yaml +1 -1
  303. package/registry/bundles/hook-governor.yaml +1 -1
  304. package/registry/bundles/incident-replay.yaml +1 -1
  305. package/registry/bundles/lsp-pack.yaml +1 -1
  306. package/registry/bundles/mcp-fabric.yaml +1 -1
  307. package/registry/bundles/plan-council.yaml +1 -1
  308. package/registry/bundles/preflight.yaml +1 -1
  309. package/registry/bundles/proof-gate.yaml +1 -1
  310. package/registry/bundles/remote-supervisor.yaml +1 -1
  311. package/registry/bundles/robotics.yaml +1 -1
  312. package/registry/bundles/secure-worktree-pipeline.yaml +1 -1
  313. package/registry/bundles/security-check.yaml +1 -1
  314. package/registry/bundles/test-intent-lock.yaml +1 -1
  315. package/registry/bundles/tracebank.yaml +1 -1
  316. package/registry/bundles/vision.yaml +1 -1
  317. package/registry/omg-capability.schema.json +1 -1
  318. package/runtime/adoption.py +7 -5
  319. package/runtime/background_verification.py +62 -0
  320. package/runtime/claim_judge.py +165 -5
  321. package/runtime/compat.py +48 -1
  322. package/runtime/context_engine.py +261 -4
  323. package/runtime/contract_compiler.py +370 -93
  324. package/runtime/defense_state.py +79 -8
  325. package/runtime/delta_classifier.py +80 -2
  326. package/runtime/evidence_query.py +56 -4
  327. package/runtime/evidence_registry.py +16 -0
  328. package/runtime/evidence_requirements.py +47 -0
  329. package/runtime/forge_agents.py +179 -9
  330. package/runtime/forge_contracts.py +208 -2
  331. package/runtime/hook_governor.py +19 -1
  332. package/runtime/interaction_journal.py +318 -42
  333. package/runtime/memory_store.py +134 -1
  334. package/runtime/mutation_gate.py +57 -11
  335. package/runtime/omg_compat_contract_snapshot.json +2 -2
  336. package/runtime/omg_mcp_server.py +14 -4
  337. package/runtime/plugin_diagnostics.py +248 -0
  338. package/runtime/plugin_interop.py +1007 -0
  339. package/runtime/preflight.py +14 -0
  340. package/runtime/profile_io.py +294 -0
  341. package/runtime/proof_gate.py +122 -7
  342. package/runtime/providers/opencode_provider.py +94 -0
  343. package/runtime/release_run_coordinator.py +339 -0
  344. package/runtime/release_surfaces.py +243 -0
  345. package/runtime/rollback_manifest.py +136 -0
  346. package/runtime/router_critics.py +50 -0
  347. package/runtime/runtime_contracts.py +137 -0
  348. package/runtime/security_check.py +16 -0
  349. package/runtime/session_health.py +60 -16
  350. package/runtime/team_router.py +156 -13
  351. package/runtime/test_intent_lock.py +102 -0
  352. package/runtime/tool_plan_gate.py +218 -19
  353. package/runtime/validate.py +289 -0
  354. package/runtime/verification_controller.py +52 -2
  355. package/scripts/omg.py +306 -3
  356. package/scripts/prepare-release-proof-fixtures.py +191 -7
  357. package/scripts/print-canonical-version.py +80 -0
  358. package/scripts/sync-release-identity.py +476 -0
  359. package/scripts/validate-release-identity.py +246 -0
  360. package/scripts/verify-standalone.sh +3 -0
  361. package/settings.json +3 -3
  362. package/templates/plugins-allowlist.yaml +19 -0
  363. package/artifacts/release/dist/enterprise/bundle/.gemini/settings.json +0 -11
  364. package/artifacts/release/dist/enterprise/bundle/.kimi/mcp.json +0 -11
  365. package/artifacts/release/dist/public/bundle/.gemini/settings.json +0 -11
  366. package/artifacts/release/dist/public/bundle/.kimi/mcp.json +0 -11
  367. package/build/lib/yaml.py +0 -321
  368. package/dist/enterprise/bundle/.gemini/settings.json +0 -11
  369. package/dist/enterprise/bundle/.kimi/mcp.json +0 -11
  370. package/dist/public/bundle/.gemini/settings.json +0 -11
  371. package/dist/public/bundle/.kimi/mcp.json +0 -11
@@ -0,0 +1,243 @@
1
+ """Shared release surface inventory.
2
+
3
+ Single audited source of truth for all version surfaces in the OMG project.
4
+ This module describes WHERE version strings appear and HOW to find/update them.
5
+
6
+ It does NOT import runtime.adoption or encode the canonical version value.
7
+ The canonical version lives solely in runtime/adoption.py:CANONICAL_VERSION.
8
+
9
+ Consumers:
10
+ - scripts/sync-release-identity.py (sync/check flow)
11
+ - runtime/contract_compiler.py (drift gate)
12
+ - tests/test_trust_release_identity.py (parity assertions)
13
+ """
14
+ from __future__ import annotations
15
+
16
+ from dataclasses import dataclass
17
+ from typing import Union
18
+
19
+ # ── Valid surface type identifiers ──────────────────────────────────────────
20
+
21
+ SURFACE_TYPES = frozenset({
22
+ "json_key_path",
23
+ "regex_line",
24
+ "yaml_line",
25
+ "frontmatter_field",
26
+ "changelog_header",
27
+ "shell_literal",
28
+ "js_literal",
29
+ "banner_literal",
30
+ })
31
+
32
+
33
+ @dataclass(frozen=True)
34
+ class AuthoredSurface:
35
+ """A version surface in an authored source file.
36
+
37
+ Attributes:
38
+ file_path: Relative path from repo root.
39
+ surface_type: One of SURFACE_TYPES.
40
+ field: For json_key_path — list of str/int keys to navigate.
41
+ For regex_line/shell_literal/js_literal/banner_literal — regex pattern.
42
+ For yaml_line/frontmatter_field — the YAML field name.
43
+ For changelog_header — regex pattern matching the header.
44
+ description: Human-readable description of this surface.
45
+ """
46
+
47
+ file_path: str
48
+ surface_type: str
49
+ field: Union[list[Union[str, int]], str]
50
+ description: str = ""
51
+
52
+
53
+ # ── Explicit YAML bundle names (22 files) ──────────────────────────────────
54
+
55
+ _BUNDLE_NAMES: tuple[str, ...] = (
56
+ "algorithms",
57
+ "api-twin",
58
+ "claim-judge",
59
+ "control-plane",
60
+ "data-lineage",
61
+ "delta-classifier",
62
+ "eval-gate",
63
+ "health",
64
+ "hook-governor",
65
+ "incident-replay",
66
+ "lsp-pack",
67
+ "mcp-fabric",
68
+ "plan-council",
69
+ "preflight",
70
+ "proof-gate",
71
+ "remote-supervisor",
72
+ "robotics",
73
+ "secure-worktree-pipeline",
74
+ "security-check",
75
+ "test-intent-lock",
76
+ "tracebank",
77
+ "vision",
78
+ )
79
+
80
+
81
+ # ── Authored surfaces: explicit, no dynamic discovery ──────────────────────
82
+
83
+ AUTHORED_SURFACES: list[AuthoredSurface] = [
84
+ # ── JSON key paths (10 fields across 7 files) ──
85
+ AuthoredSurface(
86
+ "package.json", "json_key_path", ["version"],
87
+ "npm package version",
88
+ ),
89
+ AuthoredSurface(
90
+ "settings.json", "json_key_path", ["_omg", "_version"],
91
+ "OMG settings version",
92
+ ),
93
+ AuthoredSurface(
94
+ "settings.json", "json_key_path", ["_omg", "generated", "contract_version"],
95
+ "OMG generated contract version",
96
+ ),
97
+ AuthoredSurface(
98
+ ".claude-plugin/plugin.json", "json_key_path", ["version"],
99
+ "Claude plugin version",
100
+ ),
101
+ AuthoredSurface(
102
+ ".claude-plugin/marketplace.json", "json_key_path", ["version"],
103
+ "marketplace top-level version",
104
+ ),
105
+ AuthoredSurface(
106
+ ".claude-plugin/marketplace.json", "json_key_path", ["metadata", "version"],
107
+ "marketplace metadata version",
108
+ ),
109
+ AuthoredSurface(
110
+ ".claude-plugin/marketplace.json", "json_key_path", ["plugins", 0, "version"],
111
+ "marketplace plugins[0] version",
112
+ ),
113
+ AuthoredSurface(
114
+ "plugins/core/plugin.json", "json_key_path", ["version"],
115
+ "core plugin version",
116
+ ),
117
+ AuthoredSurface(
118
+ "plugins/advanced/plugin.json", "json_key_path", ["version"],
119
+ "advanced plugin version",
120
+ ),
121
+ AuthoredSurface(
122
+ "registry/omg-capability.schema.json", "json_key_path", ["version"],
123
+ "capability schema version",
124
+ ),
125
+
126
+ # ── Regex line (pyproject.toml) ──
127
+ AuthoredSurface(
128
+ "pyproject.toml", "regex_line", r'^version = "(.+?)"',
129
+ "Python package version",
130
+ ),
131
+
132
+ # ── YAML bundles (22 files) ──
133
+ *[
134
+ AuthoredSurface(
135
+ f"registry/bundles/{name}.yaml", "yaml_line", "version",
136
+ f"{name} bundle version",
137
+ )
138
+ for name in _BUNDLE_NAMES
139
+ ],
140
+
141
+ # ── Changelog ──
142
+ AuthoredSurface(
143
+ "CHANGELOG.md", "changelog_header", r'^## \[?(\d+\.\d+\.\d+)\]?',
144
+ "latest release header",
145
+ ),
146
+
147
+ # ── 6 previously missing authored surfaces ──
148
+
149
+ # 1. OMG_COMPAT_CONTRACT.md — frontmatter version: field (line 3)
150
+ AuthoredSurface(
151
+ "OMG_COMPAT_CONTRACT.md", "frontmatter_field", "version",
152
+ "compat contract frontmatter version",
153
+ ),
154
+
155
+ # 2. CLI-ADAPTER-MAP.md — 3 docs example version markers
156
+ AuthoredSurface(
157
+ "CLI-ADAPTER-MAP.md", "regex_line",
158
+ r'^- \*\*Version:\*\* `(\d+\.\d+\.\d+)`',
159
+ "docs example: version badge (line 165)",
160
+ ),
161
+ AuthoredSurface(
162
+ "CLI-ADAPTER-MAP.md", "regex_line",
163
+ r'^\s*"version":\s*"(\d+\.\d+\.\d+)"',
164
+ "docs example: JSON version literal (line 209)",
165
+ ),
166
+ AuthoredSurface(
167
+ "CLI-ADAPTER-MAP.md", "regex_line",
168
+ r'^CANONICAL_VERSION\s*=\s*"(\d+\.\d+\.\d+)"',
169
+ "docs example: Python constant (line 241)",
170
+ ),
171
+
172
+ # 3. OMG-setup.sh — VERSION="..." shell literal (line 8)
173
+ AuthoredSurface(
174
+ "OMG-setup.sh", "shell_literal", r'^VERSION="(.+?)"',
175
+ "setup script version variable",
176
+ ),
177
+
178
+ # 4. hud/omg-hud.mjs — JS fallback literal (line 90)
179
+ AuthoredSurface(
180
+ "hud/omg-hud.mjs", "js_literal", r'return "(\d+\.\d+\.\d+)"',
181
+ "HUD fallback version literal",
182
+ ),
183
+
184
+ # 5. .claude-plugin/scripts/install.sh — installer banner literal (line 22)
185
+ AuthoredSurface(
186
+ ".claude-plugin/scripts/install.sh", "banner_literal",
187
+ r'v(\d+\.\d+\.\d+)',
188
+ "installer banner version",
189
+ ),
190
+
191
+ # 6. runtime/omg_compat_contract_snapshot.json — contract_version field
192
+ AuthoredSurface(
193
+ "runtime/omg_compat_contract_snapshot.json", "json_key_path",
194
+ ["contract_version"],
195
+ "compat contract snapshot version",
196
+ ),
197
+ ]
198
+
199
+
200
+ # ── Derived (generated) surface directories ────────────────────────────────
201
+ # These are validation-only targets — not authored, but must be checked for
202
+ # stale version residue after a bump.
203
+
204
+ DERIVED_SURFACE_DIRS: list[str] = [
205
+ "dist/",
206
+ "artifacts/release/",
207
+ "build/lib/",
208
+ ]
209
+
210
+
211
+ # ── Scoped residue targets ─────────────────────────────────────────────────
212
+ # Specific files/dirs inside generated trees where stale version residue
213
+ # must be rejected after a version bump.
214
+
215
+ SCOPED_RESIDUE_TARGETS: list[str] = [
216
+ "dist/public/manifest.json",
217
+ "dist/enterprise/manifest.json",
218
+ "dist/public/bundle/",
219
+ "dist/enterprise/bundle/",
220
+ "artifacts/release/",
221
+ "build/lib/",
222
+ ]
223
+
224
+
225
+ # ── Helpers ─────────────────────────────────────────────────────────────────
226
+
227
+ def get_authored_paths() -> list[str]:
228
+ """Return deduplicated list of file paths from AUTHORED_SURFACES.
229
+
230
+ Preserves insertion order; useful for disk-existence checks.
231
+ """
232
+ seen: set[str] = set()
233
+ paths: list[str] = []
234
+ for surface in AUTHORED_SURFACES:
235
+ if surface.file_path not in seen:
236
+ seen.add(surface.file_path)
237
+ paths.append(surface.file_path)
238
+ return paths
239
+
240
+
241
+ def get_derived_dirs() -> list[str]:
242
+ """Return all generated directory paths."""
243
+ return list(DERIVED_SURFACE_DIRS)
@@ -0,0 +1,136 @@
1
+ from __future__ import annotations
2
+
3
+ from datetime import datetime, timezone
4
+ import json
5
+ from pathlib import Path
6
+ from typing import Any
7
+
8
+
9
+ def _utc_now() -> str:
10
+ return datetime.now(timezone.utc).isoformat()
11
+
12
+
13
+ def create_rollback_manifest(run_id: str, step_id: str) -> dict[str, Any]:
14
+ return {
15
+ "schema": "RollbackManifest",
16
+ "schema_version": "1.0.0",
17
+ "run_id": run_id,
18
+ "step_id": step_id,
19
+ "created_at": _utc_now(),
20
+ "updated_at": _utc_now(),
21
+ "local_restores": [],
22
+ "compensating_actions": [],
23
+ "side_effects": [],
24
+ }
25
+
26
+
27
+ def classify_side_effect(tool: str, metadata: dict[str, Any] | None = None) -> dict[str, Any]:
28
+ payload = metadata or {}
29
+ if tool in {"write", "edit", "multiedit"}:
30
+ return {
31
+ "category": "local_file",
32
+ "decision": "reversible",
33
+ "reversible": True,
34
+ "reason": "local file shadow restore",
35
+ }
36
+
37
+ command = str(payload.get("command", "")).strip().lower()
38
+ if tool == "bash":
39
+ if any(token in command for token in ("rm -rf /", "mkfs", "fdisk", "wipefs", "dd if=")):
40
+ return {
41
+ "category": "irreversible",
42
+ "decision": "blocked",
43
+ "reversible": False,
44
+ "reason": "destructive side effect",
45
+ }
46
+
47
+ if "git commit" in command:
48
+ return {
49
+ "category": "git_commit",
50
+ "decision": "reversible",
51
+ "reversible": True,
52
+ "reason": "compensate with git revert",
53
+ "default_compensation": "git revert --no-edit <commit>",
54
+ }
55
+
56
+ if any(token in command for token in ("curl ", "wget ", "http ")):
57
+ compensation = payload.get("compensating_action")
58
+ if _has_compensating_action(compensation):
59
+ return {
60
+ "category": "network_request",
61
+ "decision": "reversible",
62
+ "reversible": True,
63
+ "reason": "declared compensating action",
64
+ }
65
+ return {
66
+ "category": "irreversible",
67
+ "decision": "escalation_required",
68
+ "reversible": False,
69
+ "reason": "network request missing compensation",
70
+ }
71
+
72
+ return {
73
+ "category": "irreversible",
74
+ "decision": "escalation_required",
75
+ "reversible": False,
76
+ "reason": "undeclared or unknown side effect",
77
+ }
78
+
79
+
80
+ def record_local_restore(manifest: dict[str, Any], file_path: str, status: str, reason: str = "") -> None:
81
+ local_restores = manifest.setdefault("local_restores", [])
82
+ local_restores.append(
83
+ {
84
+ "file_path": file_path,
85
+ "status": status,
86
+ "reason": reason,
87
+ "recorded_at": _utc_now(),
88
+ }
89
+ )
90
+ manifest["updated_at"] = _utc_now()
91
+
92
+
93
+ def record_compensating_action(
94
+ manifest: dict[str, Any],
95
+ effect_type: str,
96
+ action: str,
97
+ command: str,
98
+ status: str = "declared",
99
+ ) -> None:
100
+ actions = manifest.setdefault("compensating_actions", [])
101
+ actions.append(
102
+ {
103
+ "effect_type": effect_type,
104
+ "action": action,
105
+ "command": command,
106
+ "status": status,
107
+ "recorded_at": _utc_now(),
108
+ }
109
+ )
110
+ manifest["updated_at"] = _utc_now()
111
+
112
+
113
+ def record_side_effect(manifest: dict[str, Any], classification: dict[str, Any]) -> None:
114
+ effects = manifest.setdefault("side_effects", [])
115
+ effects.append(dict(classification))
116
+ manifest["updated_at"] = _utc_now()
117
+
118
+
119
+ def write_rollback_manifest(project_dir: str, manifest: dict[str, Any]) -> str:
120
+ run_id = str(manifest.get("run_id", "unknown")).strip() or "unknown"
121
+ step_id = str(manifest.get("step_id", "unknown")).strip() or "unknown"
122
+ out_dir = Path(project_dir) / ".omg" / "state" / "rollback_manifest"
123
+ out_dir.mkdir(parents=True, exist_ok=True)
124
+ out_path = out_dir / f"{run_id}-{step_id}.json"
125
+ tmp_path = out_path.with_name(f"{out_path.name}.tmp")
126
+ tmp_path.write_text(json.dumps(manifest, indent=2, ensure_ascii=True) + "\n", encoding="utf-8")
127
+ tmp_path.replace(out_path)
128
+ return str(out_path)
129
+
130
+
131
+ def _has_compensating_action(payload: Any) -> bool:
132
+ if not isinstance(payload, dict):
133
+ return False
134
+ action = str(payload.get("action", "")).strip()
135
+ command = str(payload.get("command", "")).strip()
136
+ return bool(action and command)
@@ -161,6 +161,54 @@ def _run_hallucination_auditor(
161
161
  }
162
162
 
163
163
 
164
+ def _run_evidence_completeness(
165
+ candidate: dict[str, Any],
166
+ context_packet: dict[str, Any],
167
+ project_dir: str,
168
+ ) -> dict[str, Any]:
169
+ output_text = _extract_output_text(candidate).lower()
170
+ artifact_pointers = context_packet.get("artifact_pointers")
171
+ pointers: list[str] = []
172
+ if isinstance(artifact_pointers, list):
173
+ pointers = [str(item).strip() for item in artifact_pointers if isinstance(item, str) and str(item).strip()]
174
+
175
+ required_claim_tokens = ("implemented", "fixed", "tested", "verified", "release")
176
+ expects_evidence = any(token in output_text for token in required_claim_tokens)
177
+
178
+ existing_pointers: list[str] = []
179
+ missing_pointers: list[str] = []
180
+ for pointer in pointers:
181
+ full_path = os.path.join(project_dir, pointer.lstrip("./"))
182
+ if os.path.exists(full_path):
183
+ existing_pointers.append(pointer)
184
+ else:
185
+ missing_pointers.append(pointer)
186
+
187
+ findings: list[str] = []
188
+ if missing_pointers:
189
+ findings.append("missing evidence artifacts: " + ", ".join(missing_pointers[:6]))
190
+
191
+ if expects_evidence and not existing_pointers:
192
+ findings.append("claim-like output requires evidence artifacts but none were present")
193
+ return {"verdict": "fail", "findings": findings, "confidence": 0.92}
194
+
195
+ if findings:
196
+ return {"verdict": "warn", "findings": findings, "confidence": 0.76}
197
+
198
+ if existing_pointers:
199
+ return {
200
+ "verdict": "pass",
201
+ "findings": ["required evidence artifacts are present in bounded context packet"],
202
+ "confidence": 0.84,
203
+ }
204
+
205
+ return {
206
+ "verdict": "pass",
207
+ "findings": ["no evidence artifacts required for non-assertive output"],
208
+ "confidence": 0.78,
209
+ }
210
+
211
+
164
212
  def run_critics(candidate: dict[str, object], context_packet: dict[str, object], project_dir: str) -> dict[str, dict[str, Any]]:
165
213
  bounded_context = {
166
214
  "summary": context_packet.get("summary", ""),
@@ -173,7 +221,9 @@ def run_critics(candidate: dict[str, object], context_packet: dict[str, object],
173
221
 
174
222
  skeptic = _run_skeptic(candidate, bounded_context)
175
223
  hallucination_auditor = _run_hallucination_auditor(candidate, bounded_context, project_dir)
224
+ evidence_completeness = _run_evidence_completeness(candidate, bounded_context, project_dir)
176
225
  return {
177
226
  "skeptic": skeptic,
178
227
  "hallucination_auditor": hallucination_auditor,
228
+ "evidence_completeness": evidence_completeness,
179
229
  }
@@ -8,9 +8,14 @@ from typing import TypedDict, cast
8
8
 
9
9
  _MODULES = (
10
10
  "verification_controller",
11
+ "release_run_coordinator",
11
12
  "interaction_journal",
12
13
  "context_engine",
13
14
  "defense_state",
15
+ "session_health",
16
+ "council_verdicts",
17
+ "rollback_manifest",
18
+ "release_run",
14
19
  )
15
20
 
16
21
  _STATUS_VALUES = frozenset({"pending", "running", "ok", "error", "blocked"})
@@ -43,6 +48,11 @@ def schema_versions() -> dict[str, SchemaVersion]:
43
48
  "version": "1.0.0",
44
49
  "required_fields": base_required + ["blockers", "evidence_links", "progress"],
45
50
  },
51
+ "release_run_coordinator": {
52
+ "schema_name": "ReleaseRunCoordinatorState",
53
+ "version": "1.0.0",
54
+ "required_fields": base_required + ["phase", "resolution_source", "resolution_reason"],
55
+ },
46
56
  "interaction_journal": {
47
57
  "schema_name": "InteractionJournalState",
48
58
  "version": "1.0.0",
@@ -58,6 +68,43 @@ def schema_versions() -> dict[str, SchemaVersion]:
58
68
  "version": "1.0.0",
59
69
  "required_fields": base_required + ["controls", "findings"],
60
70
  },
71
+ "session_health": {
72
+ "schema_name": "SessionHealth",
73
+ "version": "1.0.0",
74
+ "required_fields": base_required + [
75
+ "contamination_risk",
76
+ "overthinking_score",
77
+ "context_health",
78
+ "verification_status",
79
+ "recommended_action",
80
+ ],
81
+ },
82
+ "council_verdicts": {
83
+ "schema_name": "CouncilVerdicts",
84
+ "version": "1.0.0",
85
+ "required_fields": base_required + ["verdicts", "verification_status"],
86
+ },
87
+ "rollback_manifest": {
88
+ "schema_name": "RollbackManifest",
89
+ "version": "1.0.0",
90
+ "required_fields": base_required + [
91
+ "step_id",
92
+ "local_restores",
93
+ "compensating_actions",
94
+ "side_effects",
95
+ ],
96
+ },
97
+ "release_run": {
98
+ "schema_name": "ReleaseRunState",
99
+ "version": "1.0.0",
100
+ "required_fields": base_required + [
101
+ "phase",
102
+ "resolution_source",
103
+ "resolution_reason",
104
+ "release_evidence",
105
+ "health_action",
106
+ ],
107
+ },
61
108
  }
62
109
 
63
110
 
@@ -88,6 +135,74 @@ def read_run_state(project_dir: str, module: str, run_id: str) -> JsonObject | N
88
135
  return None
89
136
 
90
137
 
138
+ def read_defense_state(
139
+ project_dir: str,
140
+ run_id: str | None = None,
141
+ *,
142
+ compat: bool = False,
143
+ ) -> JsonObject | None:
144
+ root = Path(project_dir)
145
+ active_run_id = _resolve_active_run_id(root, run_id)
146
+ if active_run_id:
147
+ payload = _read_payload(root / ".omg" / "state" / "defense_state" / f"{active_run_id}.json")
148
+ if payload is not None:
149
+ return payload
150
+
151
+ payload = _read_payload(root / ".omg" / "state" / "defense_state" / "current.json")
152
+ if payload is not None:
153
+ return payload
154
+
155
+ if compat or not active_run_id:
156
+ return _read_payload(root / ".omg" / "state" / "defense_state" / "latest.json")
157
+ return None
158
+
159
+
160
+ def read_session_health(
161
+ project_dir: str,
162
+ run_id: str | None = None,
163
+ *,
164
+ compat: bool = False,
165
+ ) -> JsonObject | None:
166
+ root = Path(project_dir)
167
+ active_run_id = _resolve_active_run_id(root, run_id)
168
+ if active_run_id:
169
+ payload = _read_payload(root / ".omg" / "state" / "session_health" / f"{active_run_id}.json")
170
+ if payload is not None:
171
+ return payload
172
+
173
+ if compat or not active_run_id:
174
+ return _read_payload(root / ".omg" / "state" / "session_health" / "latest.json")
175
+ return None
176
+
177
+
178
+ def read_context_packet(project_dir: str, *, compat: bool = False) -> JsonObject | None:
179
+ root = Path(project_dir)
180
+ payload = _read_payload(root / ".omg" / "state" / "context_engine_packet.json")
181
+ if payload is not None:
182
+ return payload
183
+ if compat:
184
+ return _read_payload(root / ".omg" / "state" / "context_engine" / "latest.json")
185
+ return None
186
+
187
+
188
+ def read_council_verdicts(
189
+ project_dir: str,
190
+ run_id: str | None = None,
191
+ *,
192
+ compat: bool = False,
193
+ ) -> JsonObject | None:
194
+ root = Path(project_dir)
195
+ active_run_id = _resolve_active_run_id(root, run_id)
196
+ if active_run_id:
197
+ payload = _read_payload(root / ".omg" / "state" / "council_verdicts" / f"{active_run_id}.json")
198
+ if payload is not None:
199
+ return payload
200
+
201
+ if compat or not active_run_id:
202
+ return _read_payload(root / ".omg" / "state" / "council_verdicts" / "latest.json")
203
+ return None
204
+
205
+
91
206
  def _normalize_payload(module: str, run_id: str, payload: JsonObject) -> JsonObject:
92
207
  metadata = schema_versions()[module]
93
208
  state = dict(payload)
@@ -101,6 +216,28 @@ def _normalize_payload(module: str, run_id: str, payload: JsonObject) -> JsonObj
101
216
  return state
102
217
 
103
218
 
219
+ def _resolve_active_run_id(project_dir: Path, run_id: str | None) -> str:
220
+ candidate = _to_str(run_id, "").strip()
221
+ if candidate:
222
+ return candidate
223
+
224
+ candidate = os.environ.get("OMG_RUN_ID", "").strip()
225
+ if candidate:
226
+ return candidate
227
+
228
+ for path in (
229
+ project_dir / ".omg" / "state" / "defense_state" / "current.json",
230
+ project_dir / ".omg" / "state" / "context_engine_packet.json",
231
+ ):
232
+ payload = _read_payload(path)
233
+ if payload is None:
234
+ continue
235
+ candidate = _to_str(payload.get("run_id"), "").strip()
236
+ if candidate:
237
+ return candidate
238
+ return ""
239
+
240
+
104
241
  def _read_payload(path: Path) -> JsonObject | None:
105
242
  if not path.exists():
106
243
  return None
@@ -3,6 +3,7 @@ from __future__ import annotations
3
3
 
4
4
  import ast
5
5
  from collections import Counter
6
+ from importlib import import_module
6
7
  from datetime import datetime, timezone
7
8
  from hashlib import sha256
8
9
  import json
@@ -102,6 +103,7 @@ def run_security_check(
102
103
  source_counts = Counter(finding["source"] for finding in findings)
103
104
  relative_scope = _display_scope(project_dir, scope_path)
104
105
  delta = classify_project_changes(project_dir, touched_files=_delta_touched_files(project_dir, scope_path), goal="security check")
106
+ evidence_requirements = _requirements_for_profile(delta.get("evidence_profile"))
105
107
  unresolved_high_risk = [
106
108
  finding
107
109
  for finding in findings
@@ -191,7 +193,10 @@ def run_security_check(
191
193
  "scan_status": "completed",
192
194
  "manifest_count": len(manifests.manifests),
193
195
  "delta_categories": delta["categories"],
196
+ "delta_evidence_profile": delta.get("evidence_profile"),
197
+ "evidence_requirements": evidence_requirements,
194
198
  },
199
+ "evidence_requirements": evidence_requirements,
195
200
  "provenance": provenance,
196
201
  "trust_scores": trust_scores,
197
202
  "license": license_artifact,
@@ -207,6 +212,17 @@ def run_security_check(
207
212
  }
208
213
 
209
214
 
215
+ def _requirements_for_profile(evidence_profile: str | None) -> list[str]:
216
+ module = import_module("runtime.evidence_requirements")
217
+ resolver = getattr(module, "requirements_for_profile", None)
218
+ if callable(resolver):
219
+ resolved = resolver(evidence_profile)
220
+ if isinstance(resolved, (list, tuple, set)):
221
+ return [str(item) for item in resolved]
222
+ full = getattr(module, "FULL_REQUIREMENTS", [])
223
+ return [str(item) for item in full]
224
+
225
+
210
226
  def security_check(
211
227
  *,
212
228
  project_dir: str,