@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.
- package/.agents/skills/omg/AGENTS.fragment.md +2 -2
- package/.agents/skills/omg/algorithms/SKILL.md +1 -1
- package/.agents/skills/omg/algorithms/openai.yaml +1 -1
- package/.agents/skills/omg/api-twin/SKILL.md +1 -1
- package/.agents/skills/omg/api-twin/openai.yaml +1 -1
- package/.agents/skills/omg/claim-judge/SKILL.md +1 -1
- package/.agents/skills/omg/claim-judge/openai.yaml +1 -1
- package/.agents/skills/omg/codex-rules.md +1 -1
- package/.agents/skills/omg/control-plane/SKILL.md +1 -1
- package/.agents/skills/omg/control-plane/openai.yaml +1 -1
- package/.agents/skills/omg/data-lineage/SKILL.md +1 -1
- package/.agents/skills/omg/data-lineage/openai.yaml +1 -1
- package/.agents/skills/omg/delta-classifier/SKILL.md +1 -1
- package/.agents/skills/omg/delta-classifier/openai.yaml +1 -1
- package/.agents/skills/omg/eval-gate/SKILL.md +1 -1
- package/.agents/skills/omg/eval-gate/openai.yaml +1 -1
- package/.agents/skills/omg/health/SKILL.md +1 -1
- package/.agents/skills/omg/health/openai.yaml +1 -1
- package/.agents/skills/omg/hook-governor/SKILL.md +1 -1
- package/.agents/skills/omg/hook-governor/openai.yaml +1 -1
- package/.agents/skills/omg/incident-replay/SKILL.md +1 -1
- package/.agents/skills/omg/incident-replay/openai.yaml +1 -1
- package/.agents/skills/omg/lsp-pack/SKILL.md +1 -1
- package/.agents/skills/omg/lsp-pack/openai.yaml +1 -1
- package/.agents/skills/omg/mcp-fabric/SKILL.md +1 -1
- package/.agents/skills/omg/mcp-fabric/openai.yaml +1 -1
- package/.agents/skills/omg/plan-council/SKILL.md +1 -1
- package/.agents/skills/omg/plan-council/openai.yaml +1 -1
- package/.agents/skills/omg/preflight/SKILL.md +1 -1
- package/.agents/skills/omg/preflight/openai.yaml +1 -1
- package/.agents/skills/omg/proof-gate/SKILL.md +1 -1
- package/.agents/skills/omg/proof-gate/openai.yaml +1 -1
- package/.agents/skills/omg/remote-supervisor/SKILL.md +1 -1
- package/.agents/skills/omg/remote-supervisor/openai.yaml +1 -1
- package/.agents/skills/omg/robotics/SKILL.md +1 -1
- package/.agents/skills/omg/robotics/openai.yaml +1 -1
- package/.agents/skills/omg/secure-worktree-pipeline/SKILL.md +1 -1
- package/.agents/skills/omg/secure-worktree-pipeline/openai.yaml +1 -1
- package/.agents/skills/omg/security-check/SKILL.md +1 -1
- package/.agents/skills/omg/security-check/openai.yaml +1 -1
- package/.agents/skills/omg/test-intent-lock/SKILL.md +1 -1
- package/.agents/skills/omg/test-intent-lock/openai.yaml +1 -1
- package/.agents/skills/omg/tracebank/SKILL.md +1 -1
- package/.agents/skills/omg/tracebank/openai.yaml +1 -1
- package/.agents/skills/omg/vision/SKILL.md +1 -1
- package/.agents/skills/omg/vision/openai.yaml +1 -1
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +16 -0
- package/CLI-ADAPTER-MAP.md +3 -3
- package/OMG-setup.sh +114 -1
- package/OMG_COMPAT_CONTRACT.md +1 -1
- package/README.md +2 -1
- package/artifacts/release/.claude-plugin/marketplace.json +3 -3
- package/artifacts/release/.claude-plugin/plugin.json +1 -1
- package/artifacts/release/OMG_COMPAT_CONTRACT.md +1 -1
- package/artifacts/release/dist/enterprise/bundle/.claude-plugin/marketplace.json +3 -3
- package/artifacts/release/dist/enterprise/bundle/.claude-plugin/plugin.json +1 -1
- package/artifacts/release/dist/enterprise/bundle/OMG_COMPAT_CONTRACT.md +1 -1
- package/artifacts/release/dist/enterprise/bundle/plugins/advanced/plugin.json +26 -9
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/algorithms.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/api-twin.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/claim-judge.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/control-plane.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/data-lineage.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/delta-classifier.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/eval-gate.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/health.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/hook-governor.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/incident-replay.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/lsp-pack.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/mcp-fabric.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/plan-council.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/preflight.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/proof-gate.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/remote-supervisor.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/robotics.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/secure-worktree-pipeline.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/security-check.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/test-intent-lock.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/tracebank.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/vision.yaml +1 -1
- package/artifacts/release/dist/enterprise/bundle/registry/omg-capability.schema.json +1 -1
- package/artifacts/release/dist/enterprise/bundle/settings.json +3 -3
- package/artifacts/release/dist/enterprise/manifest.json +30 -40
- package/artifacts/release/dist/public/bundle/.claude-plugin/marketplace.json +3 -3
- package/artifacts/release/dist/public/bundle/.claude-plugin/plugin.json +1 -1
- package/artifacts/release/dist/public/bundle/OMG_COMPAT_CONTRACT.md +1 -1
- package/artifacts/release/dist/public/bundle/plugins/advanced/plugin.json +26 -9
- package/artifacts/release/dist/public/bundle/registry/bundles/algorithms.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/api-twin.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/claim-judge.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/control-plane.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/data-lineage.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/delta-classifier.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/eval-gate.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/health.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/hook-governor.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/incident-replay.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/lsp-pack.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/mcp-fabric.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/plan-council.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/preflight.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/proof-gate.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/remote-supervisor.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/robotics.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/secure-worktree-pipeline.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/security-check.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/test-intent-lock.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/tracebank.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/bundles/vision.yaml +1 -1
- package/artifacts/release/dist/public/bundle/registry/omg-capability.schema.json +1 -1
- package/artifacts/release/dist/public/bundle/settings.json +3 -3
- package/artifacts/release/dist/public/manifest.json +30 -40
- package/artifacts/release/plugins/advanced/plugin.json +26 -9
- package/artifacts/release/registry/bundles/algorithms.yaml +1 -1
- package/artifacts/release/registry/bundles/api-twin.yaml +1 -1
- package/artifacts/release/registry/bundles/claim-judge.yaml +1 -1
- package/artifacts/release/registry/bundles/control-plane.yaml +1 -1
- package/artifacts/release/registry/bundles/data-lineage.yaml +1 -1
- package/artifacts/release/registry/bundles/delta-classifier.yaml +1 -1
- package/artifacts/release/registry/bundles/eval-gate.yaml +1 -1
- package/artifacts/release/registry/bundles/health.yaml +1 -1
- package/artifacts/release/registry/bundles/hook-governor.yaml +1 -1
- package/artifacts/release/registry/bundles/incident-replay.yaml +1 -1
- package/artifacts/release/registry/bundles/lsp-pack.yaml +1 -1
- package/artifacts/release/registry/bundles/mcp-fabric.yaml +1 -1
- package/artifacts/release/registry/bundles/plan-council.yaml +1 -1
- package/artifacts/release/registry/bundles/preflight.yaml +1 -1
- package/artifacts/release/registry/bundles/proof-gate.yaml +1 -1
- package/artifacts/release/registry/bundles/remote-supervisor.yaml +1 -1
- package/artifacts/release/registry/bundles/robotics.yaml +1 -1
- package/artifacts/release/registry/bundles/secure-worktree-pipeline.yaml +1 -1
- package/artifacts/release/registry/bundles/security-check.yaml +1 -1
- package/artifacts/release/registry/bundles/test-intent-lock.yaml +1 -1
- package/artifacts/release/registry/bundles/tracebank.yaml +1 -1
- package/artifacts/release/registry/bundles/vision.yaml +1 -1
- package/artifacts/release/registry/omg-capability.schema.json +1 -1
- package/artifacts/release/settings.json +3 -3
- package/build/lib/commands/OMG:profile-review.md +43 -0
- package/build/lib/commands/OMG:validate.md +59 -0
- package/build/lib/control_plane/service.py +40 -1
- package/build/lib/hooks/_agent_registry.py +2 -0
- package/build/lib/hooks/firewall.py +263 -4
- package/build/lib/hooks/intentgate-keyword-detector.py +15 -3
- package/build/lib/hooks/policy_engine.py +77 -0
- package/build/lib/hooks/prompt-enhancer.py +146 -0
- package/build/lib/hooks/session-end-capture.py +374 -6
- package/build/lib/hooks/session-start.py +13 -35
- package/build/lib/hooks/setup_wizard.py +333 -1
- package/build/lib/hooks/shadow_manager.py +111 -2
- package/build/lib/hooks/stop_dispatcher.py +108 -4
- package/build/lib/plugins/advanced/plugin.json +26 -9
- package/build/lib/plugins/core/plugin.json +44 -11
- package/build/lib/registry/bundles/algorithms.yaml +1 -1
- package/build/lib/registry/bundles/api-twin.yaml +1 -1
- package/build/lib/registry/bundles/claim-judge.yaml +1 -1
- package/build/lib/registry/bundles/control-plane.yaml +1 -1
- package/build/lib/registry/bundles/data-lineage.yaml +1 -1
- package/build/lib/registry/bundles/delta-classifier.yaml +1 -1
- package/build/lib/registry/bundles/eval-gate.yaml +1 -1
- package/build/lib/registry/bundles/health.yaml +1 -1
- package/build/lib/registry/bundles/hook-governor.yaml +1 -1
- package/build/lib/registry/bundles/incident-replay.yaml +1 -1
- package/build/lib/registry/bundles/lsp-pack.yaml +1 -1
- package/build/lib/registry/bundles/mcp-fabric.yaml +1 -1
- package/build/lib/registry/bundles/plan-council.yaml +1 -1
- package/build/lib/registry/bundles/preflight.yaml +1 -1
- package/build/lib/registry/bundles/proof-gate.yaml +1 -1
- package/build/lib/registry/bundles/remote-supervisor.yaml +1 -1
- package/build/lib/registry/bundles/robotics.yaml +1 -1
- package/build/lib/registry/bundles/secure-worktree-pipeline.yaml +1 -1
- package/build/lib/registry/bundles/security-check.yaml +1 -1
- package/build/lib/registry/bundles/test-intent-lock.yaml +1 -1
- package/build/lib/registry/bundles/tracebank.yaml +1 -1
- package/build/lib/registry/bundles/vision.yaml +1 -1
- package/build/lib/registry/omg-capability.schema.json +1 -1
- package/build/lib/runtime/adoption.py +1 -1
- package/build/lib/runtime/background_verification.py +62 -0
- package/build/lib/runtime/claim_judge.py +165 -5
- package/build/lib/runtime/compat.py +15 -1
- package/build/lib/runtime/context_engine.py +261 -4
- package/build/lib/runtime/contract_compiler.py +370 -93
- package/build/lib/runtime/defense_state.py +79 -8
- package/build/lib/runtime/delta_classifier.py +80 -2
- package/build/lib/runtime/evidence_query.py +56 -4
- package/build/lib/runtime/evidence_registry.py +16 -0
- package/build/lib/runtime/evidence_requirements.py +47 -0
- package/build/lib/runtime/forge_agents.py +179 -9
- package/build/lib/runtime/forge_contracts.py +208 -2
- package/build/lib/runtime/interaction_journal.py +318 -42
- package/build/lib/runtime/memory_store.py +134 -1
- package/build/lib/runtime/mutation_gate.py +57 -11
- package/build/lib/runtime/omg_compat_contract_snapshot.json +2 -2
- package/build/lib/runtime/omg_mcp_server.py +14 -4
- package/build/lib/runtime/preflight.py +14 -0
- package/build/lib/runtime/profile_io.py +294 -0
- package/build/lib/runtime/proof_gate.py +122 -7
- package/build/lib/runtime/release_run_coordinator.py +339 -0
- package/build/lib/runtime/release_surfaces.py +243 -0
- package/build/lib/runtime/rollback_manifest.py +136 -0
- package/build/lib/runtime/router_critics.py +50 -0
- package/build/lib/runtime/runtime_contracts.py +137 -0
- package/build/lib/runtime/security_check.py +16 -0
- package/build/lib/runtime/session_health.py +60 -16
- package/build/lib/runtime/team_router.py +156 -13
- package/build/lib/runtime/test_intent_lock.py +102 -0
- package/build/lib/runtime/tool_plan_gate.py +249 -24
- package/build/lib/runtime/validate.py +194 -0
- package/build/lib/runtime/verification_controller.py +52 -2
- package/commands/OMG:diagnose-plugins.md +33 -0
- package/commands/OMG:profile-review.md +43 -0
- package/commands/OMG:setup.md +4 -1
- package/commands/OMG:validate.md +59 -0
- package/control_plane/service.py +40 -1
- package/dist/enterprise/bundle/.claude-plugin/marketplace.json +3 -3
- package/dist/enterprise/bundle/.claude-plugin/plugin.json +1 -1
- package/dist/enterprise/bundle/OMG_COMPAT_CONTRACT.md +1 -1
- package/dist/enterprise/bundle/plugins/advanced/plugin.json +26 -9
- package/dist/enterprise/bundle/registry/bundles/algorithms.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/api-twin.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/claim-judge.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/control-plane.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/data-lineage.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/delta-classifier.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/eval-gate.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/health.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/hook-governor.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/incident-replay.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/lsp-pack.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/mcp-fabric.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/plan-council.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/preflight.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/proof-gate.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/remote-supervisor.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/robotics.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/secure-worktree-pipeline.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/security-check.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/test-intent-lock.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/tracebank.yaml +1 -1
- package/dist/enterprise/bundle/registry/bundles/vision.yaml +1 -1
- package/dist/enterprise/bundle/registry/omg-capability.schema.json +1 -1
- package/dist/enterprise/bundle/settings.json +3 -3
- package/dist/enterprise/manifest.json +30 -40
- package/dist/oh_my_god-2.1.4-py3-none-any.whl +0 -0
- package/dist/oh_my_god-2.1.4.tar.gz +0 -0
- package/dist/public/bundle/.claude-plugin/marketplace.json +3 -3
- package/dist/public/bundle/.claude-plugin/plugin.json +1 -1
- package/dist/public/bundle/OMG_COMPAT_CONTRACT.md +1 -1
- package/dist/public/bundle/plugins/advanced/plugin.json +26 -9
- package/dist/public/bundle/registry/bundles/algorithms.yaml +1 -1
- package/dist/public/bundle/registry/bundles/api-twin.yaml +1 -1
- package/dist/public/bundle/registry/bundles/claim-judge.yaml +1 -1
- package/dist/public/bundle/registry/bundles/control-plane.yaml +1 -1
- package/dist/public/bundle/registry/bundles/data-lineage.yaml +1 -1
- package/dist/public/bundle/registry/bundles/delta-classifier.yaml +1 -1
- package/dist/public/bundle/registry/bundles/eval-gate.yaml +1 -1
- package/dist/public/bundle/registry/bundles/health.yaml +1 -1
- package/dist/public/bundle/registry/bundles/hook-governor.yaml +1 -1
- package/dist/public/bundle/registry/bundles/incident-replay.yaml +1 -1
- package/dist/public/bundle/registry/bundles/lsp-pack.yaml +1 -1
- package/dist/public/bundle/registry/bundles/mcp-fabric.yaml +1 -1
- package/dist/public/bundle/registry/bundles/plan-council.yaml +1 -1
- package/dist/public/bundle/registry/bundles/preflight.yaml +1 -1
- package/dist/public/bundle/registry/bundles/proof-gate.yaml +1 -1
- package/dist/public/bundle/registry/bundles/remote-supervisor.yaml +1 -1
- package/dist/public/bundle/registry/bundles/robotics.yaml +1 -1
- package/dist/public/bundle/registry/bundles/secure-worktree-pipeline.yaml +1 -1
- package/dist/public/bundle/registry/bundles/security-check.yaml +1 -1
- package/dist/public/bundle/registry/bundles/test-intent-lock.yaml +1 -1
- package/dist/public/bundle/registry/bundles/tracebank.yaml +1 -1
- package/dist/public/bundle/registry/bundles/vision.yaml +1 -1
- package/dist/public/bundle/registry/omg-capability.schema.json +1 -1
- package/dist/public/bundle/settings.json +3 -3
- package/dist/public/manifest.json +30 -40
- package/docs/install/opencode.md +30 -0
- package/docs/proof.md +11 -0
- package/docs/release-checklist.md +14 -1
- package/hooks/_agent_registry.py +2 -0
- package/hooks/firewall.py +263 -4
- package/hooks/intentgate-keyword-detector.py +15 -3
- package/hooks/policy_engine.py +77 -0
- package/hooks/prompt-enhancer.py +146 -0
- package/hooks/session-end-capture.py +374 -6
- package/hooks/session-start.py +13 -35
- package/hooks/setup_wizard.py +342 -2
- package/hooks/shadow_manager.py +111 -2
- package/hooks/stop_dispatcher.py +108 -4
- package/hud/omg-hud.mjs +30 -6
- package/lab/pipeline.py +197 -26
- package/package.json +1 -1
- package/plugins/advanced/plugin.json +26 -9
- package/plugins/core/plugin.json +51 -12
- package/pyproject.toml +10 -2
- package/registry/bundles/algorithms.yaml +1 -1
- package/registry/bundles/api-twin.yaml +1 -1
- package/registry/bundles/claim-judge.yaml +1 -1
- package/registry/bundles/control-plane.yaml +1 -1
- package/registry/bundles/data-lineage.yaml +1 -1
- package/registry/bundles/delta-classifier.yaml +1 -1
- package/registry/bundles/eval-gate.yaml +1 -1
- package/registry/bundles/health.yaml +1 -1
- package/registry/bundles/hook-governor.yaml +1 -1
- package/registry/bundles/incident-replay.yaml +1 -1
- package/registry/bundles/lsp-pack.yaml +1 -1
- package/registry/bundles/mcp-fabric.yaml +1 -1
- package/registry/bundles/plan-council.yaml +1 -1
- package/registry/bundles/preflight.yaml +1 -1
- package/registry/bundles/proof-gate.yaml +1 -1
- package/registry/bundles/remote-supervisor.yaml +1 -1
- package/registry/bundles/robotics.yaml +1 -1
- package/registry/bundles/secure-worktree-pipeline.yaml +1 -1
- package/registry/bundles/security-check.yaml +1 -1
- package/registry/bundles/test-intent-lock.yaml +1 -1
- package/registry/bundles/tracebank.yaml +1 -1
- package/registry/bundles/vision.yaml +1 -1
- package/registry/omg-capability.schema.json +1 -1
- package/runtime/adoption.py +7 -5
- package/runtime/background_verification.py +62 -0
- package/runtime/claim_judge.py +165 -5
- package/runtime/compat.py +48 -1
- package/runtime/context_engine.py +261 -4
- package/runtime/contract_compiler.py +370 -93
- package/runtime/defense_state.py +79 -8
- package/runtime/delta_classifier.py +80 -2
- package/runtime/evidence_query.py +56 -4
- package/runtime/evidence_registry.py +16 -0
- package/runtime/evidence_requirements.py +47 -0
- package/runtime/forge_agents.py +179 -9
- package/runtime/forge_contracts.py +208 -2
- package/runtime/hook_governor.py +19 -1
- package/runtime/interaction_journal.py +318 -42
- package/runtime/memory_store.py +134 -1
- package/runtime/mutation_gate.py +57 -11
- package/runtime/omg_compat_contract_snapshot.json +2 -2
- package/runtime/omg_mcp_server.py +14 -4
- package/runtime/plugin_diagnostics.py +248 -0
- package/runtime/plugin_interop.py +1007 -0
- package/runtime/preflight.py +14 -0
- package/runtime/profile_io.py +294 -0
- package/runtime/proof_gate.py +122 -7
- package/runtime/providers/opencode_provider.py +94 -0
- package/runtime/release_run_coordinator.py +339 -0
- package/runtime/release_surfaces.py +243 -0
- package/runtime/rollback_manifest.py +136 -0
- package/runtime/router_critics.py +50 -0
- package/runtime/runtime_contracts.py +137 -0
- package/runtime/security_check.py +16 -0
- package/runtime/session_health.py +60 -16
- package/runtime/team_router.py +156 -13
- package/runtime/test_intent_lock.py +102 -0
- package/runtime/tool_plan_gate.py +218 -19
- package/runtime/validate.py +289 -0
- package/runtime/verification_controller.py +52 -2
- package/scripts/omg.py +306 -3
- package/scripts/prepare-release-proof-fixtures.py +191 -7
- package/scripts/print-canonical-version.py +80 -0
- package/scripts/sync-release-identity.py +476 -0
- package/scripts/validate-release-identity.py +246 -0
- package/scripts/verify-standalone.sh +3 -0
- package/settings.json +3 -3
- package/templates/plugins-allowlist.yaml +19 -0
- package/artifacts/release/dist/enterprise/bundle/.gemini/settings.json +0 -11
- package/artifacts/release/dist/enterprise/bundle/.kimi/mcp.json +0 -11
- package/artifacts/release/dist/public/bundle/.gemini/settings.json +0 -11
- package/artifacts/release/dist/public/bundle/.kimi/mcp.json +0 -11
- package/build/lib/yaml.py +0 -321
- package/dist/enterprise/bundle/.gemini/settings.json +0 -11
- package/dist/enterprise/bundle/.kimi/mcp.json +0 -11
- package/dist/public/bundle/.gemini/settings.json +0 -11
- 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,
|