@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
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
"channel": "public",
|
|
4
4
|
"hosts": [
|
|
5
5
|
"claude",
|
|
6
|
-
"codex"
|
|
7
|
-
"gemini",
|
|
8
|
-
"kimi"
|
|
6
|
+
"codex"
|
|
9
7
|
],
|
|
10
|
-
"contract_version": "2.1.
|
|
8
|
+
"contract_version": "2.1.4",
|
|
11
9
|
"artifacts": [
|
|
12
10
|
{
|
|
13
11
|
"path": "bundle/.agents/skills/omg/AGENTS.fragment.md",
|
|
@@ -199,7 +197,7 @@
|
|
|
199
197
|
},
|
|
200
198
|
{
|
|
201
199
|
"path": "bundle/.claude-plugin/marketplace.json",
|
|
202
|
-
"sha256": "
|
|
200
|
+
"sha256": "db469d08d23b0473462773072387a5d8c0cc2427c604a98d47e874b034b72bff"
|
|
203
201
|
},
|
|
204
202
|
{
|
|
205
203
|
"path": "bundle/.claude-plugin/mcp.json",
|
|
@@ -207,15 +205,7 @@
|
|
|
207
205
|
},
|
|
208
206
|
{
|
|
209
207
|
"path": "bundle/.claude-plugin/plugin.json",
|
|
210
|
-
"sha256": "
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
"path": "bundle/.gemini/settings.json",
|
|
214
|
-
"sha256": "14208140297f635cc5155cfe063c9b8a6193a3d0a264e0686cf3b80789208f27"
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
"path": "bundle/.kimi/mcp.json",
|
|
218
|
-
"sha256": "14208140297f635cc5155cfe063c9b8a6193a3d0a264e0686cf3b80789208f27"
|
|
208
|
+
"sha256": "2179506ae3d7cfa3d9c7d1f88a1723ac4cec146ae574bd06c91688a3caca70e6"
|
|
219
209
|
},
|
|
220
210
|
{
|
|
221
211
|
"path": "bundle/.mcp.json",
|
|
@@ -223,7 +213,7 @@
|
|
|
223
213
|
},
|
|
224
214
|
{
|
|
225
215
|
"path": "bundle/OMG_COMPAT_CONTRACT.md",
|
|
226
|
-
"sha256": "
|
|
216
|
+
"sha256": "6d0727a754dc8a813e4c3e65fa3a4b70bde23fdd13686742e98fd4b29f495f79"
|
|
227
217
|
},
|
|
228
218
|
{
|
|
229
219
|
"path": "bundle/plugins/advanced/commands/OMG:code-review.md",
|
|
@@ -267,103 +257,103 @@
|
|
|
267
257
|
},
|
|
268
258
|
{
|
|
269
259
|
"path": "bundle/plugins/advanced/plugin.json",
|
|
270
|
-
"sha256": "
|
|
260
|
+
"sha256": "44259d1cbddcc7e5b21af598e886e782bc42d82d1da3d23dea4da3f4b144386f"
|
|
271
261
|
},
|
|
272
262
|
{
|
|
273
263
|
"path": "bundle/registry/bundles/algorithms.yaml",
|
|
274
|
-
"sha256": "
|
|
264
|
+
"sha256": "1cf6305c2826838a805f42ed2d773a2cf428d9ff5abb542e09cb86da2e3b46e5"
|
|
275
265
|
},
|
|
276
266
|
{
|
|
277
267
|
"path": "bundle/registry/bundles/api-twin.yaml",
|
|
278
|
-
"sha256": "
|
|
268
|
+
"sha256": "1128f7cdcade155b11014c7899a3c206ef8f071091cb469300b91cc5ef5fda82"
|
|
279
269
|
},
|
|
280
270
|
{
|
|
281
271
|
"path": "bundle/registry/bundles/claim-judge.yaml",
|
|
282
|
-
"sha256": "
|
|
272
|
+
"sha256": "7905b72d44fb41d4868d6b64700016fef87991729f16f9f4805de0ee673b595b"
|
|
283
273
|
},
|
|
284
274
|
{
|
|
285
275
|
"path": "bundle/registry/bundles/control-plane.yaml",
|
|
286
|
-
"sha256": "
|
|
276
|
+
"sha256": "99002393ae686f02f1a8a2cf14805a60855969a394aef176ed844ebad9a99638"
|
|
287
277
|
},
|
|
288
278
|
{
|
|
289
279
|
"path": "bundle/registry/bundles/data-lineage.yaml",
|
|
290
|
-
"sha256": "
|
|
280
|
+
"sha256": "84dd116c083a5cdb5372d5a033ae67f465751f4bc141728e3259a1c49316ecd8"
|
|
291
281
|
},
|
|
292
282
|
{
|
|
293
283
|
"path": "bundle/registry/bundles/delta-classifier.yaml",
|
|
294
|
-
"sha256": "
|
|
284
|
+
"sha256": "ac910410dfff607768990227343b82526c645eeb986ad0bfd676e2fddd742898"
|
|
295
285
|
},
|
|
296
286
|
{
|
|
297
287
|
"path": "bundle/registry/bundles/eval-gate.yaml",
|
|
298
|
-
"sha256": "
|
|
288
|
+
"sha256": "240662404dbc7faffcfa4de0e7d52c8a355a71b66e79bc341abbf0416a420617"
|
|
299
289
|
},
|
|
300
290
|
{
|
|
301
291
|
"path": "bundle/registry/bundles/health.yaml",
|
|
302
|
-
"sha256": "
|
|
292
|
+
"sha256": "6fe31aa7cdb335921579fec96e8fe253b89458ddc9c4c846d7d145f9cfcac104"
|
|
303
293
|
},
|
|
304
294
|
{
|
|
305
295
|
"path": "bundle/registry/bundles/hook-governor.yaml",
|
|
306
|
-
"sha256": "
|
|
296
|
+
"sha256": "d273f00af67c85e7cb8700a095889b686b8b46c62248a871f5a5b36564759d77"
|
|
307
297
|
},
|
|
308
298
|
{
|
|
309
299
|
"path": "bundle/registry/bundles/incident-replay.yaml",
|
|
310
|
-
"sha256": "
|
|
300
|
+
"sha256": "8ff449760c2d2d70cdf584e22eaf2d1a4ad06e91bbb3fea67072fe7d5c167245"
|
|
311
301
|
},
|
|
312
302
|
{
|
|
313
303
|
"path": "bundle/registry/bundles/lsp-pack.yaml",
|
|
314
|
-
"sha256": "
|
|
304
|
+
"sha256": "8a9cee8d7074c75e64abb1a083d68bb441f386d2497d1b3d48d476278c0adf0c"
|
|
315
305
|
},
|
|
316
306
|
{
|
|
317
307
|
"path": "bundle/registry/bundles/mcp-fabric.yaml",
|
|
318
|
-
"sha256": "
|
|
308
|
+
"sha256": "7d1dac6fea6b81c6355de3910adc4b33244406c4e75ac5784ea457cabd922aeb"
|
|
319
309
|
},
|
|
320
310
|
{
|
|
321
311
|
"path": "bundle/registry/bundles/plan-council.yaml",
|
|
322
|
-
"sha256": "
|
|
312
|
+
"sha256": "bd3534610fcf95be4f592097e085cbc6e157b36465e80724b22860ad9131c426"
|
|
323
313
|
},
|
|
324
314
|
{
|
|
325
315
|
"path": "bundle/registry/bundles/preflight.yaml",
|
|
326
|
-
"sha256": "
|
|
316
|
+
"sha256": "4f047a339b865f48d938fe1210c16c6f81fd5997b8f9b8873c47f951a661d5be"
|
|
327
317
|
},
|
|
328
318
|
{
|
|
329
319
|
"path": "bundle/registry/bundles/proof-gate.yaml",
|
|
330
|
-
"sha256": "
|
|
320
|
+
"sha256": "692480c9a8c3506c05cdfbdb6a3f54fe5b190e0ceb1b7316d7c1a56b6f34a646"
|
|
331
321
|
},
|
|
332
322
|
{
|
|
333
323
|
"path": "bundle/registry/bundles/remote-supervisor.yaml",
|
|
334
|
-
"sha256": "
|
|
324
|
+
"sha256": "58d56c21926f80d1f62dabc77de467c87df27c46d6aa9823ad8b613866ffcefe"
|
|
335
325
|
},
|
|
336
326
|
{
|
|
337
327
|
"path": "bundle/registry/bundles/robotics.yaml",
|
|
338
|
-
"sha256": "
|
|
328
|
+
"sha256": "9bce82dabd4128e590e088213cef59243636579088191226554beb72667c4c10"
|
|
339
329
|
},
|
|
340
330
|
{
|
|
341
331
|
"path": "bundle/registry/bundles/secure-worktree-pipeline.yaml",
|
|
342
|
-
"sha256": "
|
|
332
|
+
"sha256": "d522283991cb96a75a468c70398654476bad289fe01c62e629d8503afcf9f9c3"
|
|
343
333
|
},
|
|
344
334
|
{
|
|
345
335
|
"path": "bundle/registry/bundles/security-check.yaml",
|
|
346
|
-
"sha256": "
|
|
336
|
+
"sha256": "fcfe957e3a69fd3fc6fad57013b7d34420afea1f25ac9c5c2b8a1ec3cdcdfda6"
|
|
347
337
|
},
|
|
348
338
|
{
|
|
349
339
|
"path": "bundle/registry/bundles/test-intent-lock.yaml",
|
|
350
|
-
"sha256": "
|
|
340
|
+
"sha256": "589cdecb474e3da150697ae81cab06ad5306c323d1b34871c5b6f88b70259d46"
|
|
351
341
|
},
|
|
352
342
|
{
|
|
353
343
|
"path": "bundle/registry/bundles/tracebank.yaml",
|
|
354
|
-
"sha256": "
|
|
344
|
+
"sha256": "ee468665d4d54ad96fe73af7742aa36b3d6d830706c60259470822c9e55c6889"
|
|
355
345
|
},
|
|
356
346
|
{
|
|
357
347
|
"path": "bundle/registry/bundles/vision.yaml",
|
|
358
|
-
"sha256": "
|
|
348
|
+
"sha256": "1642c21746608cf3809916c6bfa65e1768e3421fb24b9f649fd8e4322ac83eb9"
|
|
359
349
|
},
|
|
360
350
|
{
|
|
361
351
|
"path": "bundle/registry/omg-capability.schema.json",
|
|
362
|
-
"sha256": "
|
|
352
|
+
"sha256": "660fb7ca3d26ba472065bc5174098337e862f89684ce22774f5ea3dec9560457"
|
|
363
353
|
},
|
|
364
354
|
{
|
|
365
355
|
"path": "bundle/settings.json",
|
|
366
|
-
"sha256": "
|
|
356
|
+
"sha256": "5cd958ecb7840484976b3854d3aca5e93ccf78dc11bf8f5785901956e1417cd5"
|
|
367
357
|
}
|
|
368
358
|
]
|
|
369
359
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Install OMG for OpenCode
|
|
2
|
+
|
|
3
|
+
## Fast Path
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @trac3er/oh-my-god
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
If `opencode` is already on `PATH`, OMG wires `omg-control` into OpenCode's MCP config during install using the managed OMG Python runtime.
|
|
10
|
+
|
|
11
|
+
## Manual Path
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
git clone https://github.com/trac3er00/OMG
|
|
15
|
+
cd OMG
|
|
16
|
+
./OMG-setup.sh install --mode=omg-only --preset=interop
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Verify
|
|
20
|
+
|
|
21
|
+
- OpenCode is supported as a compatibility host in v1 (not a canonical contract host)
|
|
22
|
+
- global config path: `~/.config/opencode/opencode.json`
|
|
23
|
+
- project config path: `opencode.json`
|
|
24
|
+
- MCP entries use the `mcp` key (not `mcpServers`)
|
|
25
|
+
- plugin discovery reads `.opencode/plugins/`
|
|
26
|
+
|
|
27
|
+
## Notes
|
|
28
|
+
|
|
29
|
+
- OpenCode consumes OMG through compatibility-host MCP registration
|
|
30
|
+
- canonical v1 contract hosts remain Claude Code and Codex
|
package/docs/proof.md
CHANGED
|
@@ -9,12 +9,21 @@ OMG keeps verification visible instead of burying it in implementation details.
|
|
|
9
9
|
|
|
10
10
|
- Runtime evidence root: `.omg/evidence/`
|
|
11
11
|
- Doctor output: `.omg/evidence/doctor.json`
|
|
12
|
+
- Plugin diagnostics: `.omg/evidence/plugin-diagnostics.json` (via `diagnose-plugins`)
|
|
12
13
|
- Security-check artifacts: `.omg/evidence/security-check-*.json`
|
|
13
14
|
- Trust and external input artifacts: `.omg/evidence/trust-*.json`
|
|
14
15
|
- Truth bundles:
|
|
15
16
|
- `claim-judge`: `.omg/evidence/claim-judge-*.json` (verifies claim-to-evidence mapping)
|
|
16
17
|
- `test-intent-lock`: `.omg/evidence/test-intent-lock-*.json` (verifies test-to-intent alignment)
|
|
17
18
|
- `proof-gate`: `.omg/evidence/proof-gate-*.json` (verifies final release readiness)
|
|
19
|
+
- Release execution primitives required by `omg release readiness`:
|
|
20
|
+
- run coordinator state: `.omg/state/release_run_coordinator/<run_id>.json`
|
|
21
|
+
- TDD lock evidence: `.omg/state/test-intent-lock/*.json`
|
|
22
|
+
- rollback manifest: `.omg/state/rollback_manifest/*.json`
|
|
23
|
+
- session health: `.omg/state/session_health/<run_id>.json`
|
|
24
|
+
- council verdicts: `.omg/state/council_verdicts/<run_id>.json`
|
|
25
|
+
- Forge starter proof (`proof_backed: true`): `.omg/evidence/forge-specialists-*.json`
|
|
26
|
+
- Release readiness machine output includes `checks.execution_primitives` with `missing`, `invalid`, and `evidence_paths`
|
|
18
27
|
- Browser evidence: `.omg/evidence/browser-*.png` and `.omg/evidence/browser-*.json` (Playwright-backed verification)
|
|
19
28
|
- Canonical browser command: `/OMG:browser` with `/OMG:playwright` as a compatibility alias
|
|
20
29
|
- Trace records and evidence links: `.omg/tracebank/events.jsonl`, `.omg/tracebank/evidence-links.jsonl`
|
|
@@ -28,6 +37,7 @@ OMG keeps verification visible instead of burying it in implementation details.
|
|
|
28
37
|
|----------|------|--------|------------|------------|---------------|
|
|
29
38
|
| Claude Code | Canonical | host-native | host-native | yes | primary |
|
|
30
39
|
| Codex | Canonical | yes | yes | yes | primary |
|
|
40
|
+
| OpenCode | Compatibility | yes | yes | yes | supported |
|
|
31
41
|
| Gemini | Compatibility | yes | yes | yes | supported |
|
|
32
42
|
| Kimi | Compatibility | yes | yes | yes | supported |
|
|
33
43
|
|
|
@@ -35,6 +45,7 @@ OMG keeps verification visible instead of burying it in implementation details.
|
|
|
35
45
|
|
|
36
46
|
- Native setup writes `.omg/state/adoption-report.json`
|
|
37
47
|
- Native setup writes `.omg/state/cli-config.yaml`
|
|
48
|
+
- Plugin allowlist: `.omg/state/plugins-allowlist.yaml`
|
|
38
49
|
- `OMG-only` and `coexist` are both covered in setup tests
|
|
39
50
|
- Canonical modes: `chill`, `focused`, `exploratory`
|
|
40
51
|
- OMC, OMX, and Superpowers references stay limited to compatibility and adoption guidance
|
|
@@ -16,10 +16,22 @@ Use this checklist before making OMG public or cutting a release tag.
|
|
|
16
16
|
|
|
17
17
|
## Verification
|
|
18
18
|
|
|
19
|
+
- [ ] `python3 scripts/sync-release-identity.py --check` — authored surfaces in sync
|
|
20
|
+
- [ ] `python3 scripts/validate-release-identity.py --scope all --forbid-version 2.1.1` — full identity validation
|
|
21
|
+
- `python3 scripts/omg.py diagnose-plugins --format json` exits 0
|
|
19
22
|
- `python3 scripts/omg.py contract validate` passes
|
|
23
|
+
- `python3 scripts/omg.py validate --format json` includes `plugin_compatibility` check
|
|
20
24
|
- `python3 scripts/omg.py contract compile --host claude --host codex --channel public --output-root <tmp>` passes
|
|
21
25
|
- `python3 scripts/omg.py contract compile --host claude --host codex --channel enterprise --output-root <tmp>` passes
|
|
22
26
|
- `python3 scripts/omg.py release readiness --channel dual --output-root <tmp>` passes
|
|
27
|
+
- Release readiness fails with machine-readable blockers unless all execution primitives are present and valid:
|
|
28
|
+
- run coordinator state: `.omg/state/release_run_coordinator/<run_id>.json`
|
|
29
|
+
- TDD proof-chain lock evidence: `.omg/state/test-intent-lock/*.json` (linked to run id or lock id)
|
|
30
|
+
- rollback manifest: `.omg/state/rollback_manifest/*.json`
|
|
31
|
+
- session health state: `.omg/state/session_health/<run_id>.json`
|
|
32
|
+
- council verdicts: `.omg/state/council_verdicts/<run_id>.json`
|
|
33
|
+
- Forge starter proof (`proof_backed: true`): `.omg/evidence/forge-specialists-*.json`
|
|
34
|
+
- Release readiness output exposes primitive evidence paths in `checks.execution_primitives.evidence_paths`
|
|
23
35
|
- Truth bundles (`claim-judge`, `test-intent-lock`, `proof-gate`) are verified and present in `registry/bundles/`
|
|
24
36
|
- `plan-council` role is compiled and verified in `registry/bundles/`
|
|
25
37
|
- `python3 scripts/check-omg-standalone-clean.py` passes
|
|
@@ -29,7 +41,8 @@ Use this checklist before making OMG public or cutting a release tag.
|
|
|
29
41
|
## Docs
|
|
30
42
|
|
|
31
43
|
- README matches the current product surface
|
|
32
|
-
- install guides for Claude Code and
|
|
44
|
+
- install guides for Claude Code, Codex, and OpenCode are current
|
|
45
|
+
- OpenCode provider module exists at `runtime/providers/opencode_provider.py`
|
|
33
46
|
- proof page includes current verification evidence
|
|
34
47
|
- changelog includes the release entry
|
|
35
48
|
|
package/hooks/_agent_registry.py
CHANGED
|
@@ -224,6 +224,8 @@ INTENT_ROUTING = {
|
|
|
224
224
|
"INTENT_EXPLORE": "explore", # explore/find → fast search agent
|
|
225
225
|
"INTENT_REVIEW": "reviewer", # review/audit → code review agent
|
|
226
226
|
"INTENT_QUICK": "quick_task", # quick/simple → fast task agent
|
|
227
|
+
# Clarification intent (Task 3) — halts mutation-capable execution
|
|
228
|
+
"INTENT_CLARIFICATION": None, # clarification needed → halt (no agent dispatch)
|
|
227
229
|
}
|
|
228
230
|
|
|
229
231
|
# Core agent model preferences. NOT keyword-matched — used by orchestration pipeline only. model_version is informational (not passed to CLI).
|
package/hooks/firewall.py
CHANGED
|
@@ -7,23 +7,234 @@ one centralized decision model.
|
|
|
7
7
|
import json
|
|
8
8
|
import os
|
|
9
9
|
import sys
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from typing import Any
|
|
10
12
|
|
|
11
13
|
HOOKS_DIR = os.path.dirname(__file__)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
PROJECT_ROOT = os.path.dirname(HOOKS_DIR)
|
|
15
|
+
for path in (HOOKS_DIR, PROJECT_ROOT):
|
|
16
|
+
if path not in sys.path:
|
|
17
|
+
sys.path.insert(0, path)
|
|
14
18
|
|
|
15
|
-
from _common import setup_crash_handler, json_input, deny_decision, is_bypass_mode
|
|
19
|
+
from _common import setup_crash_handler, json_input, deny_decision, is_bypass_mode, get_project_dir # pyright: ignore[reportImplicitRelativeImport]
|
|
16
20
|
|
|
17
21
|
# Fail-closed: deny on crash (security hook)
|
|
18
22
|
setup_crash_handler("firewall", fail_closed=True)
|
|
19
23
|
|
|
20
24
|
try:
|
|
21
|
-
from policy_engine import evaluate_bash_command, to_pretool_hook_output
|
|
25
|
+
from policy_engine import evaluate_bash_command, to_pretool_hook_output, scan_mutation_command, ask, deny # pyright: ignore[reportImplicitRelativeImport]
|
|
26
|
+
from runtime.defense_state import DefenseState
|
|
27
|
+
from runtime.session_health import compute_session_health
|
|
28
|
+
from runtime.mutation_gate import check_mutation_allowed
|
|
29
|
+
from runtime.tool_plan_gate import journal_mutation_bash
|
|
22
30
|
except Exception as _import_err:
|
|
23
31
|
print(f"OMG firewall: policy_engine import failed: {_import_err}", file=sys.stderr)
|
|
24
32
|
deny_decision(f"OMG firewall crash: policy_engine import failed: {_import_err}. Denying for safety.")
|
|
25
33
|
sys.exit(0)
|
|
26
34
|
|
|
35
|
+
|
|
36
|
+
def _enrich_risk_context(decision, payload: dict[str, object]):
|
|
37
|
+
try:
|
|
38
|
+
project_dir = os.environ.get("CLAUDE_PROJECT_DIR", os.getcwd())
|
|
39
|
+
run_id = _resolve_run_id(payload)
|
|
40
|
+
|
|
41
|
+
suffixes: list[str] = []
|
|
42
|
+
defense_risk = _read_defense_risk(project_dir)
|
|
43
|
+
if defense_risk:
|
|
44
|
+
suffixes.append(f"defense risk={defense_risk}")
|
|
45
|
+
|
|
46
|
+
council_signal = _read_council_signal(project_dir, run_id)
|
|
47
|
+
if council_signal:
|
|
48
|
+
suffixes.append(council_signal)
|
|
49
|
+
|
|
50
|
+
if suffixes:
|
|
51
|
+
decision.reason = f"{decision.reason} [{'; '.join(suffixes)}]".strip()
|
|
52
|
+
except Exception:
|
|
53
|
+
return decision
|
|
54
|
+
return decision
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _resolve_run_id(payload: dict[str, object]) -> str:
|
|
58
|
+
if isinstance(payload, dict):
|
|
59
|
+
run_id = payload.get("run_id")
|
|
60
|
+
if isinstance(run_id, str) and run_id.strip():
|
|
61
|
+
return run_id.strip()
|
|
62
|
+
tool_input = payload.get("tool_input")
|
|
63
|
+
if isinstance(tool_input, dict):
|
|
64
|
+
metadata = tool_input.get("metadata")
|
|
65
|
+
if isinstance(metadata, dict):
|
|
66
|
+
metadata_run_id = metadata.get("run_id")
|
|
67
|
+
if isinstance(metadata_run_id, str) and metadata_run_id.strip():
|
|
68
|
+
return metadata_run_id.strip()
|
|
69
|
+
env_run_id = os.environ.get("OMG_RUN_ID", "")
|
|
70
|
+
return env_run_id.strip()
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def _resolve_active_run_id(project_dir: str) -> str:
|
|
74
|
+
active_run_path = Path(project_dir) / ".omg" / "shadow" / "active-run"
|
|
75
|
+
if not active_run_path.exists():
|
|
76
|
+
return ""
|
|
77
|
+
try:
|
|
78
|
+
return active_run_path.read_text(encoding="utf-8").strip()
|
|
79
|
+
except OSError:
|
|
80
|
+
return ""
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _read_defense_risk(project_dir: str) -> str:
|
|
84
|
+
path = Path(project_dir) / ".omg" / "state" / "defense_state" / "current.json"
|
|
85
|
+
if not path.exists():
|
|
86
|
+
return ""
|
|
87
|
+
try:
|
|
88
|
+
payload = json.loads(path.read_text(encoding="utf-8"))
|
|
89
|
+
except (OSError, json.JSONDecodeError):
|
|
90
|
+
return ""
|
|
91
|
+
if not isinstance(payload, dict):
|
|
92
|
+
return ""
|
|
93
|
+
return str(payload.get("risk_level", "")).strip().lower()
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def _read_council_signal(project_dir: str, run_id: str) -> str:
|
|
97
|
+
if not run_id:
|
|
98
|
+
return ""
|
|
99
|
+
path = Path(project_dir) / ".omg" / "state" / "council_verdicts" / f"{run_id}.json"
|
|
100
|
+
if not path.exists():
|
|
101
|
+
return ""
|
|
102
|
+
try:
|
|
103
|
+
payload = json.loads(path.read_text(encoding="utf-8"))
|
|
104
|
+
except (OSError, json.JSONDecodeError):
|
|
105
|
+
return ""
|
|
106
|
+
if not isinstance(payload, dict):
|
|
107
|
+
return ""
|
|
108
|
+
|
|
109
|
+
verdicts = payload.get("verdicts")
|
|
110
|
+
if not isinstance(verdicts, dict):
|
|
111
|
+
return ""
|
|
112
|
+
evidence = verdicts.get("evidence_completeness")
|
|
113
|
+
if not isinstance(evidence, dict):
|
|
114
|
+
return ""
|
|
115
|
+
verdict = str(evidence.get("verdict", "")).strip().lower()
|
|
116
|
+
findings = evidence.get("findings")
|
|
117
|
+
findings_count = len(findings) if isinstance(findings, list) else 0
|
|
118
|
+
if not verdict:
|
|
119
|
+
return ""
|
|
120
|
+
return f"council evidence={verdict} findings={findings_count}"
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def _read_clarification_state(project_dir: str, run_id: str) -> dict[str, object]:
|
|
124
|
+
if not run_id:
|
|
125
|
+
return {
|
|
126
|
+
"requires_clarification": False,
|
|
127
|
+
"intent_class": "",
|
|
128
|
+
"clarification_prompt": "",
|
|
129
|
+
"confidence": 0.0,
|
|
130
|
+
}
|
|
131
|
+
path = Path(project_dir) / ".omg" / "state" / "intent_gate" / f"{run_id}.json"
|
|
132
|
+
if not path.exists():
|
|
133
|
+
return {
|
|
134
|
+
"requires_clarification": False,
|
|
135
|
+
"intent_class": "",
|
|
136
|
+
"clarification_prompt": "",
|
|
137
|
+
"confidence": 0.0,
|
|
138
|
+
}
|
|
139
|
+
try:
|
|
140
|
+
payload = json.loads(path.read_text(encoding="utf-8"))
|
|
141
|
+
except (OSError, json.JSONDecodeError):
|
|
142
|
+
return {
|
|
143
|
+
"requires_clarification": False,
|
|
144
|
+
"intent_class": "",
|
|
145
|
+
"clarification_prompt": "",
|
|
146
|
+
"confidence": 0.0,
|
|
147
|
+
}
|
|
148
|
+
if not isinstance(payload, dict):
|
|
149
|
+
return {
|
|
150
|
+
"requires_clarification": False,
|
|
151
|
+
"intent_class": "",
|
|
152
|
+
"clarification_prompt": "",
|
|
153
|
+
"confidence": 0.0,
|
|
154
|
+
}
|
|
155
|
+
prompt = " ".join(str(payload.get("clarification_prompt", "")).split())
|
|
156
|
+
try:
|
|
157
|
+
confidence = float(payload.get("confidence", 0.0))
|
|
158
|
+
except (TypeError, ValueError):
|
|
159
|
+
confidence = 0.0
|
|
160
|
+
return {
|
|
161
|
+
"requires_clarification": bool(payload.get("requires_clarification") is True),
|
|
162
|
+
"intent_class": str(payload.get("intent_class", "")).strip(),
|
|
163
|
+
"clarification_prompt": prompt,
|
|
164
|
+
"confidence": round(max(0.0, min(1.0, confidence)), 2),
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def _clarification_reason(clarification_prompt: str) -> str:
|
|
169
|
+
prompt = " ".join(str(clarification_prompt or "").split())
|
|
170
|
+
if prompt:
|
|
171
|
+
return f"Clarification required before mutation: {prompt}"
|
|
172
|
+
return "Clarification required before mutation: provide the missing intent details."
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def _to_float(value: Any, default: float) -> float:
|
|
176
|
+
try:
|
|
177
|
+
return float(value)
|
|
178
|
+
except (TypeError, ValueError):
|
|
179
|
+
return default
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def _mutating_defense_decision(
|
|
183
|
+
*,
|
|
184
|
+
project_dir: str,
|
|
185
|
+
cmd: str,
|
|
186
|
+
run_id: str,
|
|
187
|
+
):
|
|
188
|
+
scan = scan_mutation_command(cmd)
|
|
189
|
+
defense_state = DefenseState(project_dir).update(
|
|
190
|
+
injection_hits=int(_to_float(scan.get("injection_hits"), 0.0)),
|
|
191
|
+
contamination_score=_to_float(scan.get("contamination_score"), 0.0),
|
|
192
|
+
overthinking_score=_to_float(scan.get("overthinking_score"), 0.0),
|
|
193
|
+
premature_fixer_score=_to_float(scan.get("premature_fixer_score"), 0.0),
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
resolved_run_id = run_id.strip() or _resolve_active_run_id(project_dir) or "default"
|
|
197
|
+
session_health = compute_session_health(project_dir, run_id=resolved_run_id)
|
|
198
|
+
|
|
199
|
+
contamination = _to_float(session_health.get("contamination_risk"), _to_float(defense_state.get("contamination_score"), 0.0))
|
|
200
|
+
overthinking = _to_float(session_health.get("overthinking_score"), _to_float(defense_state.get("overthinking_score"), 0.0))
|
|
201
|
+
premature_fixer = _to_float(defense_state.get("premature_fixer_score"), 0.0)
|
|
202
|
+
health_action = str(session_health.get("recommended_action", "continue"))
|
|
203
|
+
thresholds = session_health.get("thresholds") if isinstance(session_health, dict) else {}
|
|
204
|
+
contamination_thresholds = thresholds.get("contamination_risk") if isinstance(thresholds, dict) else {}
|
|
205
|
+
overthinking_thresholds = thresholds.get("overthinking_score") if isinstance(thresholds, dict) else {}
|
|
206
|
+
reflect_contamination = _to_float(contamination_thresholds.get("reflect") if isinstance(contamination_thresholds, dict) else None, 0.05)
|
|
207
|
+
reflect_overthinking = _to_float(overthinking_thresholds.get("reflect") if isinstance(overthinking_thresholds, dict) else None, 0.15)
|
|
208
|
+
reflect_triggers = session_health.get("reflect_triggers") if isinstance(session_health, dict) else {}
|
|
209
|
+
contamination_trigger = bool(reflect_triggers.get("contamination")) if isinstance(reflect_triggers, dict) else contamination > reflect_contamination
|
|
210
|
+
overthinking_trigger = bool(reflect_triggers.get("overthinking")) if isinstance(reflect_triggers, dict) else overthinking > reflect_overthinking
|
|
211
|
+
pause_required = bool(session_health.get("defense_pause_required") is True) if isinstance(session_health, dict) else (contamination_trigger or overthinking_trigger)
|
|
212
|
+
signal_text = ", ".join(str(item) for item in scan.get("signals", []) if str(item)) or "none"
|
|
213
|
+
context = (
|
|
214
|
+
f"defense hits={int(_to_float(defense_state.get('injection_hits'), 0.0))} "
|
|
215
|
+
f"contamination={contamination:.4f} overthinking={overthinking:.4f} "
|
|
216
|
+
f"premature_fixer={premature_fixer:.4f} "
|
|
217
|
+
f"session_health={health_action} signals={signal_text}"
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
if health_action == "block":
|
|
221
|
+
return deny(
|
|
222
|
+
f"Blocked: mutation denied by defense/session-health reducer [{context}]",
|
|
223
|
+
"high",
|
|
224
|
+
["defense-reducer", "session-health"],
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
if pause_required or contamination_trigger or overthinking_trigger:
|
|
228
|
+
return ask(
|
|
229
|
+
"Pause: mutation requires reflection before execution "
|
|
230
|
+
f"[{context}; thresholds contamination>{reflect_contamination:.2f} "
|
|
231
|
+
f"overthinking>{reflect_overthinking:.2f}]",
|
|
232
|
+
"high",
|
|
233
|
+
["reflect", "defense-reducer", "session-health"],
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
return None
|
|
237
|
+
|
|
27
238
|
data = json_input()
|
|
28
239
|
|
|
29
240
|
tool = data.get("tool_name", "")
|
|
@@ -36,11 +247,59 @@ if not cmd:
|
|
|
36
247
|
|
|
37
248
|
decision = evaluate_bash_command(cmd)
|
|
38
249
|
|
|
250
|
+
tool_input = data.get("tool_input")
|
|
251
|
+
metadata = tool_input.get("metadata") if isinstance(tool_input, dict) else None
|
|
252
|
+
lock_id = tool_input.get("lock_id") if isinstance(tool_input, dict) else None
|
|
253
|
+
if not isinstance(lock_id, str) and isinstance(metadata, dict):
|
|
254
|
+
lock_id = metadata.get("lock_id")
|
|
255
|
+
run_id = _resolve_run_id(data)
|
|
256
|
+
|
|
257
|
+
gate_result = check_mutation_allowed(
|
|
258
|
+
tool="Bash",
|
|
259
|
+
file_path=cmd,
|
|
260
|
+
project_dir=get_project_dir(),
|
|
261
|
+
lock_id=lock_id if isinstance(lock_id, str) else None,
|
|
262
|
+
command=cmd,
|
|
263
|
+
run_id=run_id or None,
|
|
264
|
+
metadata=metadata if isinstance(metadata, dict) else None,
|
|
265
|
+
)
|
|
266
|
+
is_mutation_capable = str(gate_result.get("reason", "")) != "tool is read-only for mutation gate"
|
|
267
|
+
clarification_state = _read_clarification_state(get_project_dir(), run_id)
|
|
268
|
+
if is_mutation_capable:
|
|
269
|
+
defense_decision = _mutating_defense_decision(
|
|
270
|
+
project_dir=get_project_dir(),
|
|
271
|
+
cmd=cmd,
|
|
272
|
+
run_id=run_id,
|
|
273
|
+
)
|
|
274
|
+
if defense_decision is not None:
|
|
275
|
+
decision = defense_decision
|
|
276
|
+
|
|
277
|
+
if clarification_state.get("requires_clarification") is True and is_mutation_capable:
|
|
278
|
+
deny_decision(_clarification_reason(str(clarification_state.get("clarification_prompt", ""))))
|
|
279
|
+
sys.exit(0)
|
|
280
|
+
|
|
281
|
+
if is_mutation_capable and gate_result.get("status") == "blocked":
|
|
282
|
+
deny_decision(str(gate_result.get("reason", "mutation denied by test intent lock gate")))
|
|
283
|
+
sys.exit(0)
|
|
284
|
+
|
|
285
|
+
decision = _enrich_risk_context(decision, data)
|
|
286
|
+
|
|
39
287
|
# In bypass-permission mode, only enforce hard denials (critical safety).
|
|
40
288
|
# Skip "ask" decisions so the user is not prompted for confirmation.
|
|
41
289
|
if is_bypass_mode(data) and decision.action != "deny":
|
|
42
290
|
sys.exit(0)
|
|
43
291
|
|
|
292
|
+
if decision.action == "allow" and is_mutation_capable:
|
|
293
|
+
try:
|
|
294
|
+
journal_mutation_bash(
|
|
295
|
+
project_dir=get_project_dir(),
|
|
296
|
+
command=cmd,
|
|
297
|
+
run_id=run_id or None,
|
|
298
|
+
metadata=metadata if isinstance(metadata, dict) else None,
|
|
299
|
+
)
|
|
300
|
+
except Exception:
|
|
301
|
+
pass
|
|
302
|
+
|
|
44
303
|
out = to_pretool_hook_output(decision)
|
|
45
304
|
if out:
|
|
46
305
|
json.dump(out, sys.stdout)
|
|
@@ -38,7 +38,7 @@ try:
|
|
|
38
38
|
get_feature_flag,
|
|
39
39
|
_resolve_project_dir,
|
|
40
40
|
check_performance_budget,
|
|
41
|
-
PRE_TOOL_INJECT_MAX_MS,
|
|
41
|
+
PRE_TOOL_INJECT_MAX_MS as pre_tool_inject_max_ms,
|
|
42
42
|
)
|
|
43
43
|
except ImportError:
|
|
44
44
|
import importlib
|
|
@@ -48,7 +48,7 @@ except ImportError:
|
|
|
48
48
|
get_feature_flag = _common.get_feature_flag
|
|
49
49
|
_resolve_project_dir = _common._resolve_project_dir
|
|
50
50
|
check_performance_budget = _common.check_performance_budget
|
|
51
|
-
|
|
51
|
+
pre_tool_inject_max_ms = _common.PRE_TOOL_INJECT_MAX_MS
|
|
52
52
|
|
|
53
53
|
setup_crash_handler("intentgate-keyword-detector", fail_closed=False)
|
|
54
54
|
|
|
@@ -64,6 +64,18 @@ KEYWORD_INTENT_MAP = {
|
|
|
64
64
|
"search": "INTENT_SEARCH",
|
|
65
65
|
"stop": "INTENT_STOP",
|
|
66
66
|
"crazy": "INTENT_CRAZY",
|
|
67
|
+
"auth": "INTENT_AUTH_SETUP",
|
|
68
|
+
"login": "INTENT_AUTH_SETUP",
|
|
69
|
+
"credentials": "INTENT_AUTH_SETUP",
|
|
70
|
+
"setup my credentials": "INTENT_AUTH_SETUP",
|
|
71
|
+
"setup credentials": "INTENT_AUTH_SETUP",
|
|
72
|
+
"remember my settings": "INTENT_PREFERENCE_MEMORY",
|
|
73
|
+
"remember settings": "INTENT_PREFERENCE_MEMORY",
|
|
74
|
+
"preferences": "INTENT_PREFERENCE_MEMORY",
|
|
75
|
+
"memory style": "INTENT_PREFERENCE_MEMORY",
|
|
76
|
+
"setup preferences": "INTENT_AMBIGUOUS_CONFIG",
|
|
77
|
+
"configure preferences": "INTENT_AMBIGUOUS_CONFIG",
|
|
78
|
+
"remember setup": "INTENT_AMBIGUOUS_CONFIG",
|
|
67
79
|
}
|
|
68
80
|
|
|
69
81
|
|
|
@@ -179,7 +191,7 @@ if detected_intents:
|
|
|
179
191
|
# PERFORMANCE BUDGET CHECK
|
|
180
192
|
# ═══════════════════════════════════════════════════════════
|
|
181
193
|
elapsed_ms = (time.time() - start_time) * 1000
|
|
182
|
-
check_performance_budget("intentgate-keyword-detector", elapsed_ms,
|
|
194
|
+
check_performance_budget("intentgate-keyword-detector", elapsed_ms, pre_tool_inject_max_ms)
|
|
183
195
|
|
|
184
196
|
# ═══════════════════════════════════════════════════════════
|
|
185
197
|
# OUTPUT
|