@trac3er/oh-my-god 2.0.4 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/omg/AGENTS.fragment.md +57 -4
- package/.agents/skills/omg/algorithms/SKILL.md +11 -0
- package/.agents/skills/omg/algorithms/openai.yaml +11 -0
- package/.agents/skills/omg/api-twin/SKILL.md +11 -0
- package/.agents/skills/omg/api-twin/openai.yaml +12 -0
- package/.agents/skills/omg/claim-judge/SKILL.md +11 -0
- package/.agents/skills/omg/claim-judge/openai.yaml +13 -0
- package/.agents/skills/omg/codex-rules.md +33 -0
- 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 +11 -0
- package/.agents/skills/omg/data-lineage/openai.yaml +12 -0
- package/.agents/skills/omg/delta-classifier/SKILL.md +11 -0
- package/.agents/skills/omg/delta-classifier/openai.yaml +12 -0
- package/.agents/skills/omg/eval-gate/SKILL.md +11 -0
- package/.agents/skills/omg/eval-gate/openai.yaml +12 -0
- package/.agents/skills/omg/health/SKILL.md +11 -0
- package/.agents/skills/omg/health/openai.yaml +11 -0
- 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 +11 -0
- package/.agents/skills/omg/incident-replay/openai.yaml +12 -0
- 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 +11 -0
- package/.agents/skills/omg/plan-council/openai.yaml +12 -0
- package/.agents/skills/omg/preflight/SKILL.md +11 -0
- package/.agents/skills/omg/preflight/openai.yaml +12 -0
- package/.agents/skills/omg/proof-gate/SKILL.md +11 -0
- package/.agents/skills/omg/proof-gate/openai.yaml +13 -0
- package/.agents/skills/omg/remote-supervisor/SKILL.md +11 -0
- package/.agents/skills/omg/remote-supervisor/openai.yaml +12 -0
- package/.agents/skills/omg/robotics/SKILL.md +11 -0
- package/.agents/skills/omg/robotics/openai.yaml +11 -0
- 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 +11 -0
- package/.agents/skills/omg/security-check/openai.yaml +13 -0
- package/.agents/skills/omg/test-intent-lock/SKILL.md +11 -0
- package/.agents/skills/omg/test-intent-lock/openai.yaml +13 -0
- package/.agents/skills/omg/tracebank/SKILL.md +11 -0
- package/.agents/skills/omg/tracebank/openai.yaml +12 -0
- package/.agents/skills/omg/vision/SKILL.md +11 -0
- package/.agents/skills/omg/vision/openai.yaml +11 -0
- package/.claude-plugin/marketplace.json +5 -5
- package/.claude-plugin/plugin.json +1 -1
- package/.claude-plugin/scripts/uninstall.sh +2 -2
- package/.mcp.json +0 -22
- package/CHANGELOG.md +13 -0
- package/OMG-setup.sh +64 -14
- package/OMG_COMPAT_CONTRACT.md +1 -1
- package/README.md +8 -6
- package/agents/omg-security-auditor.md +1 -1
- package/artifacts/release/.agents/skills/omg/AGENTS.fragment.md +52 -0
- package/artifacts/release/.agents/skills/omg/algorithms/SKILL.md +11 -0
- package/artifacts/release/.agents/skills/omg/algorithms/openai.yaml +11 -0
- package/artifacts/release/.agents/skills/omg/api-twin/SKILL.md +11 -0
- package/artifacts/release/.agents/skills/omg/api-twin/openai.yaml +12 -0
- package/artifacts/release/.agents/skills/omg/codex-mcp.toml +4 -0
- package/artifacts/release/.agents/skills/omg/codex-rules.md +29 -0
- package/artifacts/release/.agents/skills/omg/control-plane/SKILL.md +11 -0
- package/artifacts/release/.agents/skills/omg/control-plane/openai.yaml +14 -0
- package/artifacts/release/.agents/skills/omg/data-lineage/SKILL.md +11 -0
- package/artifacts/release/.agents/skills/omg/data-lineage/openai.yaml +12 -0
- package/artifacts/release/.agents/skills/omg/delta-classifier/SKILL.md +11 -0
- package/artifacts/release/.agents/skills/omg/delta-classifier/openai.yaml +12 -0
- package/artifacts/release/.agents/skills/omg/eval-gate/SKILL.md +11 -0
- package/artifacts/release/.agents/skills/omg/eval-gate/openai.yaml +12 -0
- package/artifacts/release/.agents/skills/omg/health/SKILL.md +11 -0
- package/artifacts/release/.agents/skills/omg/health/openai.yaml +11 -0
- package/artifacts/release/.agents/skills/omg/hook-governor/SKILL.md +11 -0
- package/artifacts/release/.agents/skills/omg/hook-governor/openai.yaml +11 -0
- package/artifacts/release/.agents/skills/omg/incident-replay/SKILL.md +11 -0
- package/artifacts/release/.agents/skills/omg/incident-replay/openai.yaml +12 -0
- package/artifacts/release/.agents/skills/omg/lsp-pack/SKILL.md +11 -0
- package/artifacts/release/.agents/skills/omg/lsp-pack/openai.yaml +11 -0
- package/artifacts/release/.agents/skills/omg/mcp-fabric/SKILL.md +11 -0
- package/artifacts/release/.agents/skills/omg/mcp-fabric/openai.yaml +13 -0
- package/artifacts/release/.agents/skills/omg/preflight/SKILL.md +11 -0
- package/artifacts/release/.agents/skills/omg/preflight/openai.yaml +12 -0
- package/artifacts/release/.agents/skills/omg/remote-supervisor/SKILL.md +11 -0
- package/artifacts/release/.agents/skills/omg/remote-supervisor/openai.yaml +12 -0
- package/artifacts/release/.agents/skills/omg/robotics/SKILL.md +11 -0
- package/artifacts/release/.agents/skills/omg/robotics/openai.yaml +11 -0
- package/artifacts/release/.agents/skills/omg/secure-worktree-pipeline/SKILL.md +11 -0
- package/artifacts/release/.agents/skills/omg/secure-worktree-pipeline/openai.yaml +12 -0
- package/artifacts/release/.agents/skills/omg/security-check/SKILL.md +11 -0
- package/artifacts/release/.agents/skills/omg/security-check/openai.yaml +13 -0
- package/artifacts/release/.agents/skills/omg/tracebank/SKILL.md +11 -0
- package/artifacts/release/.agents/skills/omg/tracebank/openai.yaml +12 -0
- package/artifacts/release/.agents/skills/omg/vision/SKILL.md +11 -0
- package/artifacts/release/.agents/skills/omg/vision/openai.yaml +11 -0
- package/artifacts/release/.claude-plugin/marketplace.json +36 -0
- package/artifacts/release/.claude-plugin/plugin.json +23 -0
- package/artifacts/release/.mcp.json +40 -0
- package/artifacts/release/OMG_COMPAT_CONTRACT.md +92 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/AGENTS.fragment.md +52 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/algorithms/SKILL.md +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/algorithms/openai.yaml +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/api-twin/SKILL.md +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/api-twin/openai.yaml +12 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/codex-mcp.toml +4 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/codex-rules.md +29 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/control-plane/SKILL.md +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/control-plane/openai.yaml +14 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/data-lineage/SKILL.md +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/data-lineage/openai.yaml +12 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/delta-classifier/SKILL.md +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/delta-classifier/openai.yaml +12 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/eval-gate/SKILL.md +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/eval-gate/openai.yaml +12 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/health/SKILL.md +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/health/openai.yaml +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/hook-governor/SKILL.md +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/hook-governor/openai.yaml +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/incident-replay/SKILL.md +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/incident-replay/openai.yaml +12 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/lsp-pack/SKILL.md +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/lsp-pack/openai.yaml +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/mcp-fabric/SKILL.md +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/mcp-fabric/openai.yaml +13 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/preflight/SKILL.md +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/preflight/openai.yaml +12 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/remote-supervisor/SKILL.md +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/remote-supervisor/openai.yaml +12 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/robotics/SKILL.md +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/robotics/openai.yaml +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/secure-worktree-pipeline/SKILL.md +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/secure-worktree-pipeline/openai.yaml +12 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/security-check/SKILL.md +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/security-check/openai.yaml +13 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/tracebank/SKILL.md +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/tracebank/openai.yaml +12 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/vision/SKILL.md +11 -0
- package/artifacts/release/dist/enterprise/bundle/.agents/skills/omg/vision/openai.yaml +11 -0
- package/artifacts/release/dist/enterprise/bundle/OMG_COMPAT_CONTRACT.md +92 -0
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/algorithms.yaml +45 -0
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/api-twin.yaml +48 -0
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/control-plane.yaml +151 -0
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/data-lineage.yaml +47 -0
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/delta-classifier.yaml +47 -0
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/eval-gate.yaml +47 -0
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/health.yaml +45 -0
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/hook-governor.yaml +97 -0
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/incident-replay.yaml +47 -0
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/lsp-pack.yaml +48 -0
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/mcp-fabric.yaml +53 -0
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/preflight.yaml +48 -0
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/remote-supervisor.yaml +49 -0
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/robotics.yaml +45 -0
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/secure-worktree-pipeline.yaml +54 -0
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/security-check.yaml +50 -0
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/tracebank.yaml +47 -0
- package/artifacts/release/dist/enterprise/bundle/registry/bundles/vision.yaml +45 -0
- package/artifacts/release/dist/enterprise/bundle/registry/omg-capability.schema.json +296 -0
- package/artifacts/release/dist/enterprise/manifest.json +243 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/AGENTS.fragment.md +7 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/algorithms/SKILL.md +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/algorithms/openai.yaml +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/api-twin/SKILL.md +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/api-twin/openai.yaml +12 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/codex-mcp.toml +4 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/control-plane/SKILL.md +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/control-plane/openai.yaml +14 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/data-lineage/SKILL.md +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/data-lineage/openai.yaml +12 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/delta-classifier/SKILL.md +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/delta-classifier/openai.yaml +12 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/eval-gate/SKILL.md +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/eval-gate/openai.yaml +12 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/health/SKILL.md +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/health/openai.yaml +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/hook-governor/SKILL.md +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/hook-governor/openai.yaml +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/incident-replay/SKILL.md +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/incident-replay/openai.yaml +12 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/lsp-pack/SKILL.md +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/lsp-pack/openai.yaml +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/mcp-fabric/SKILL.md +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/mcp-fabric/openai.yaml +13 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/preflight/SKILL.md +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/preflight/openai.yaml +12 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/remote-supervisor/SKILL.md +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/remote-supervisor/openai.yaml +12 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/robotics/SKILL.md +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/robotics/openai.yaml +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/secure-worktree-pipeline/SKILL.md +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/secure-worktree-pipeline/openai.yaml +12 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/security-check/SKILL.md +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/security-check/openai.yaml +13 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/tracebank/SKILL.md +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/tracebank/openai.yaml +12 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/vision/SKILL.md +11 -0
- package/artifacts/release/dist/public/bundle/.agents/skills/omg/vision/openai.yaml +11 -0
- package/artifacts/release/dist/public/bundle/.claude-plugin/marketplace.json +36 -0
- package/artifacts/release/dist/public/bundle/.claude-plugin/plugin.json +23 -0
- package/artifacts/release/dist/public/bundle/.mcp.json +40 -0
- package/artifacts/release/dist/public/bundle/OMG_COMPAT_CONTRACT.md +92 -0
- package/artifacts/release/dist/public/bundle/registry/bundles/algorithms.yaml +45 -0
- package/artifacts/release/dist/public/bundle/registry/bundles/api-twin.yaml +48 -0
- package/artifacts/release/dist/public/bundle/registry/bundles/control-plane.yaml +151 -0
- package/artifacts/release/dist/public/bundle/registry/bundles/data-lineage.yaml +47 -0
- package/artifacts/release/dist/public/bundle/registry/bundles/delta-classifier.yaml +47 -0
- package/artifacts/release/dist/public/bundle/registry/bundles/eval-gate.yaml +47 -0
- package/artifacts/release/dist/public/bundle/registry/bundles/health.yaml +45 -0
- package/artifacts/release/dist/public/bundle/registry/bundles/hook-governor.yaml +97 -0
- package/artifacts/release/dist/public/bundle/registry/bundles/incident-replay.yaml +47 -0
- package/artifacts/release/dist/public/bundle/registry/bundles/lsp-pack.yaml +48 -0
- package/artifacts/release/dist/public/bundle/registry/bundles/mcp-fabric.yaml +53 -0
- package/artifacts/release/dist/public/bundle/registry/bundles/preflight.yaml +48 -0
- package/artifacts/release/dist/public/bundle/registry/bundles/remote-supervisor.yaml +49 -0
- package/artifacts/release/dist/public/bundle/registry/bundles/robotics.yaml +45 -0
- package/artifacts/release/dist/public/bundle/registry/bundles/secure-worktree-pipeline.yaml +54 -0
- package/artifacts/release/dist/public/bundle/registry/bundles/security-check.yaml +50 -0
- package/artifacts/release/dist/public/bundle/registry/bundles/tracebank.yaml +47 -0
- package/artifacts/release/dist/public/bundle/registry/bundles/vision.yaml +45 -0
- package/artifacts/release/dist/public/bundle/registry/omg-capability.schema.json +296 -0
- package/artifacts/release/dist/public/bundle/settings.json +526 -0
- package/artifacts/release/dist/public/manifest.json +255 -0
- package/artifacts/release/registry/bundles/algorithms.yaml +45 -0
- package/artifacts/release/registry/bundles/api-twin.yaml +48 -0
- package/artifacts/release/registry/bundles/control-plane.yaml +151 -0
- package/artifacts/release/registry/bundles/data-lineage.yaml +47 -0
- package/artifacts/release/registry/bundles/delta-classifier.yaml +47 -0
- package/artifacts/release/registry/bundles/eval-gate.yaml +47 -0
- package/artifacts/release/registry/bundles/health.yaml +45 -0
- package/artifacts/release/registry/bundles/hook-governor.yaml +97 -0
- package/artifacts/release/registry/bundles/incident-replay.yaml +47 -0
- package/artifacts/release/registry/bundles/lsp-pack.yaml +48 -0
- package/artifacts/release/registry/bundles/mcp-fabric.yaml +53 -0
- package/artifacts/release/registry/bundles/preflight.yaml +48 -0
- package/artifacts/release/registry/bundles/remote-supervisor.yaml +49 -0
- package/artifacts/release/registry/bundles/robotics.yaml +45 -0
- package/artifacts/release/registry/bundles/secure-worktree-pipeline.yaml +54 -0
- package/artifacts/release/registry/bundles/security-check.yaml +50 -0
- package/artifacts/release/registry/bundles/tracebank.yaml +47 -0
- package/artifacts/release/registry/bundles/vision.yaml +45 -0
- package/artifacts/release/registry/omg-capability.schema.json +296 -0
- package/artifacts/release/settings.json +594 -0
- package/build/lib/agents/__init__.py +1 -0
- package/build/lib/agents/designer.md +67 -0
- package/build/lib/agents/explore.md +60 -0
- package/build/lib/agents/model_roles.py +196 -0
- package/build/lib/agents/omg-api-builder.md +23 -0
- package/build/lib/agents/omg-architect-mode.md +41 -0
- package/build/lib/agents/omg-architect.md +13 -0
- package/build/lib/agents/omg-backend-engineer.md +41 -0
- package/build/lib/agents/omg-critic.md +16 -0
- package/build/lib/agents/omg-database-engineer.md +41 -0
- package/build/lib/agents/omg-escalation-router.md +17 -0
- package/build/lib/agents/omg-executor.md +12 -0
- package/build/lib/agents/omg-frontend-designer.md +41 -0
- package/build/lib/agents/omg-implement-mode.md +49 -0
- package/build/lib/agents/omg-infra-engineer.md +41 -0
- package/build/lib/agents/omg-qa-tester.md +16 -0
- package/build/lib/agents/omg-research-mode.md +41 -0
- package/build/lib/agents/omg-security-auditor.md +41 -0
- package/build/lib/agents/omg-testing-engineer.md +41 -0
- package/build/lib/agents/plan.md +80 -0
- package/build/lib/agents/quick_task.md +64 -0
- package/build/lib/agents/reviewer.md +83 -0
- package/build/lib/agents/task.md +71 -0
- package/build/lib/commands/OMG:ai-commit.md +113 -0
- package/build/lib/commands/OMG:api-twin.md +22 -0
- package/build/lib/commands/OMG:arch.md +313 -0
- package/build/lib/commands/OMG:ccg.md +22 -0
- package/build/lib/commands/OMG:compat.md +57 -0
- package/build/lib/commands/OMG:cost.md +181 -0
- package/build/lib/commands/OMG:crazy.md +125 -0
- package/build/lib/commands/OMG:create-agent.md +183 -0
- package/build/lib/commands/OMG:deps.md +248 -0
- package/build/lib/commands/OMG:doctor.md +37 -0
- package/build/lib/commands/OMG:domain-init.md +11 -0
- package/build/lib/commands/OMG:escalate.md +52 -0
- package/build/lib/commands/OMG:health-check.md +45 -0
- package/build/lib/commands/OMG:init.md +134 -0
- package/build/lib/commands/OMG:mode.md +44 -0
- package/build/lib/commands/OMG:preflight.md +26 -0
- package/build/lib/commands/OMG:project-init.md +11 -0
- package/build/lib/commands/OMG:ralph-start.md +43 -0
- package/build/lib/commands/OMG:ralph-stop.md +23 -0
- package/build/lib/commands/OMG:security-check.md +28 -0
- package/build/lib/commands/OMG:session-branch.md +85 -0
- package/build/lib/commands/OMG:session-fork.md +53 -0
- package/build/lib/commands/OMG:session-merge.md +134 -0
- package/build/lib/commands/OMG:setup.md +78 -0
- package/build/lib/commands/OMG:stats.md +225 -0
- package/build/lib/commands/OMG:teams.md +39 -0
- package/build/lib/commands/OMG:theme.md +44 -0
- package/build/lib/commands/__init__.py +1 -0
- package/build/lib/control_plane/__init__.py +2 -0
- package/build/lib/control_plane/openapi.yaml +260 -0
- package/build/lib/control_plane/server.py +147 -0
- package/build/lib/control_plane/service.py +222 -0
- package/build/lib/hooks/__init__.py +0 -0
- package/build/lib/hooks/_agent_registry.py +423 -0
- package/build/lib/hooks/_analytics.py +291 -0
- package/build/lib/hooks/_budget.py +31 -0
- package/build/lib/hooks/_common.py +569 -0
- package/build/lib/hooks/_compression_optimizer.py +119 -0
- package/build/lib/hooks/_cost_ledger.py +176 -0
- package/build/lib/hooks/_learnings.py +126 -0
- package/build/lib/hooks/_memory.py +103 -0
- package/build/lib/hooks/_protected_context.py +150 -0
- package/build/lib/hooks/_token_counter.py +221 -0
- package/build/lib/hooks/branch_manager.py +236 -0
- package/build/lib/hooks/budget_governor.py +232 -0
- package/build/lib/hooks/circuit-breaker.py +270 -0
- package/build/lib/hooks/compression_feedback.py +254 -0
- package/build/lib/hooks/config-guard.py +216 -0
- package/build/lib/hooks/context_pressure.py +53 -0
- package/build/lib/hooks/credential_store.py +1020 -0
- package/build/lib/hooks/fetch-rate-limits.py +212 -0
- package/build/lib/hooks/firewall.py +48 -0
- package/build/lib/hooks/hashline-formatter-bridge.py +224 -0
- package/build/lib/hooks/hashline-injector.py +273 -0
- package/build/lib/hooks/hashline-validator.py +216 -0
- package/build/lib/hooks/idle-detector.py +95 -0
- package/build/lib/hooks/intentgate-keyword-detector.py +188 -0
- package/build/lib/hooks/magic-keyword-router.py +195 -0
- package/build/lib/hooks/policy_engine.py +641 -0
- package/build/lib/hooks/post-tool-failure.py +19 -0
- package/build/lib/hooks/post-write.py +219 -0
- package/build/lib/hooks/post_write.py +46 -0
- package/build/lib/hooks/pre-compact.py +398 -0
- package/build/lib/hooks/pre-tool-inject.py +98 -0
- package/build/lib/hooks/prompt-enhancer.py +672 -0
- package/build/lib/hooks/quality-runner.py +191 -0
- package/build/lib/hooks/query.py +512 -0
- package/build/lib/hooks/secret-guard.py +61 -0
- package/build/lib/hooks/secret_audit.py +144 -0
- package/build/lib/hooks/security_validators.py +75 -0
- package/build/lib/hooks/session-end-capture.py +137 -0
- package/build/lib/hooks/session-start.py +277 -0
- package/build/lib/hooks/setup_wizard.py +646 -0
- package/build/lib/hooks/shadow_manager.py +344 -0
- package/build/lib/hooks/state_migration.py +225 -0
- package/build/lib/hooks/stop-gate.py +7 -0
- package/build/lib/hooks/stop_dispatcher.py +945 -0
- package/build/lib/hooks/test-validator.py +361 -0
- package/build/lib/hooks/test_generator_hook.py +123 -0
- package/build/lib/hooks/todo-state-tracker.py +114 -0
- package/build/lib/hooks/tool-ledger.py +149 -0
- package/build/lib/hooks/trust_review.py +585 -0
- package/build/lib/plugins/README.md +60 -0
- package/build/lib/plugins/__init__.py +1 -0
- package/build/lib/plugins/advanced/commands/OMG:code-review.md +114 -0
- package/build/lib/plugins/advanced/commands/OMG:deep-plan.md +265 -0
- package/build/lib/plugins/advanced/commands/OMG:handoff.md +115 -0
- package/build/lib/plugins/advanced/commands/OMG:learn.md +110 -0
- package/build/lib/plugins/advanced/commands/OMG:maintainer.md +31 -0
- package/build/lib/plugins/advanced/commands/OMG:ralph-start.md +43 -0
- package/build/lib/plugins/advanced/commands/OMG:ralph-stop.md +23 -0
- package/build/lib/plugins/advanced/commands/OMG:security-review.md +16 -0
- package/build/lib/plugins/advanced/commands/OMG:sequential-thinking.md +20 -0
- package/build/lib/plugins/advanced/commands/OMG:ship.md +46 -0
- package/build/lib/plugins/advanced/plugin.json +87 -0
- package/build/lib/plugins/core/plugin.json +145 -0
- package/build/lib/plugins/dephealth/__init__.py +0 -0
- package/build/lib/plugins/dephealth/cve_scanner.py +188 -0
- package/build/lib/plugins/dephealth/license_checker.py +135 -0
- package/build/lib/plugins/dephealth/manifest_detector.py +423 -0
- package/build/lib/plugins/dephealth/vuln_analyzer.py +169 -0
- package/build/lib/plugins/testgen/__init__.py +0 -0
- package/build/lib/plugins/testgen/codamosa_engine.py +402 -0
- package/build/lib/plugins/testgen/edge_case_synthesizer.py +184 -0
- package/build/lib/plugins/testgen/framework_detector.py +271 -0
- package/build/lib/plugins/testgen/skeleton_generator.py +219 -0
- package/build/lib/plugins/viz/__init__.py +0 -0
- package/build/lib/plugins/viz/ast_parser.py +139 -0
- package/build/lib/plugins/viz/diagram_generator.py +192 -0
- package/build/lib/plugins/viz/graph_builder.py +444 -0
- package/build/lib/plugins/viz/native_parsers.py +259 -0
- package/build/lib/plugins/viz/regex_parser.py +112 -0
- package/build/lib/registry/__init__.py +1 -0
- package/build/lib/registry/bundles/algorithms.yaml +45 -0
- package/build/lib/registry/bundles/api-twin.yaml +48 -0
- package/build/lib/registry/bundles/claim-judge.yaml +49 -0
- package/build/lib/registry/bundles/control-plane.yaml +151 -0
- package/build/lib/registry/bundles/data-lineage.yaml +47 -0
- package/build/lib/registry/bundles/delta-classifier.yaml +47 -0
- package/build/lib/registry/bundles/eval-gate.yaml +47 -0
- package/build/lib/registry/bundles/health.yaml +45 -0
- package/build/lib/registry/bundles/hook-governor.yaml +97 -0
- package/build/lib/registry/bundles/incident-replay.yaml +47 -0
- package/build/lib/registry/bundles/lsp-pack.yaml +48 -0
- package/build/lib/registry/bundles/mcp-fabric.yaml +53 -0
- package/build/lib/registry/bundles/plan-council.yaml +51 -0
- package/build/lib/registry/bundles/preflight.yaml +48 -0
- package/build/lib/registry/bundles/proof-gate.yaml +49 -0
- package/build/lib/registry/bundles/remote-supervisor.yaml +49 -0
- package/build/lib/registry/bundles/robotics.yaml +45 -0
- package/build/lib/registry/bundles/secure-worktree-pipeline.yaml +54 -0
- package/build/lib/registry/bundles/security-check.yaml +50 -0
- package/build/lib/registry/bundles/test-intent-lock.yaml +49 -0
- package/build/lib/registry/bundles/tracebank.yaml +47 -0
- package/build/lib/registry/bundles/vision.yaml +45 -0
- package/build/lib/registry/omg-capability.schema.json +296 -0
- package/build/lib/registry/verify_artifact.py +90 -0
- package/build/lib/runtime/__init__.py +32 -0
- package/build/lib/runtime/adapters/__init__.py +13 -0
- package/build/lib/runtime/adapters/claude.py +63 -0
- package/build/lib/runtime/adapters/gpt.py +56 -0
- package/build/lib/runtime/adapters/local.py +56 -0
- package/build/lib/runtime/adoption.py +212 -0
- package/build/lib/runtime/api_twin.py +450 -0
- package/build/lib/runtime/asset_loader.py +62 -0
- package/build/lib/runtime/business_workflow.py +234 -0
- package/build/lib/runtime/claim_judge.py +95 -0
- package/build/lib/runtime/cli_provider.py +85 -0
- package/build/lib/runtime/compat.py +1459 -0
- package/build/lib/runtime/contract_compiler.py +1918 -0
- package/build/lib/runtime/custom_agent_loader.py +366 -0
- package/build/lib/runtime/data_lineage.py +73 -0
- package/build/lib/runtime/delta_classifier.py +81 -0
- package/build/lib/runtime/dispatcher.py +47 -0
- package/build/lib/runtime/domain_packs.py +46 -0
- package/build/lib/runtime/ecosystem.py +371 -0
- package/build/lib/runtime/eval_gate.py +96 -0
- package/build/lib/runtime/guide_assert.py +45 -0
- package/build/lib/runtime/incident_replay.py +47 -0
- package/build/lib/runtime/legacy_compat.py +7 -0
- package/build/lib/runtime/mcp_config_writers.py +233 -0
- package/build/lib/runtime/mcp_lifecycle.py +175 -0
- package/build/lib/runtime/mcp_memory_server.py +135 -0
- package/build/lib/runtime/memory_parsers/__init__.py +0 -0
- package/build/lib/runtime/memory_parsers/chatgpt_parser.py +257 -0
- package/build/lib/runtime/memory_parsers/claude_import.py +107 -0
- package/build/lib/runtime/memory_parsers/export.py +97 -0
- package/build/lib/runtime/memory_parsers/gemini_import.py +91 -0
- package/build/lib/runtime/memory_parsers/kimi_import.py +91 -0
- package/build/lib/runtime/memory_store.py +215 -0
- package/build/lib/runtime/omc_compat.py +7 -0
- package/build/lib/runtime/omg_compat_contract_snapshot.json +916 -0
- package/build/lib/runtime/omg_contract_snapshot.json +916 -0
- package/build/lib/runtime/omg_mcp_server.py +212 -0
- package/build/lib/runtime/playwright_pack.py +169 -0
- package/build/lib/runtime/preflight.py +117 -0
- package/build/lib/runtime/proof_chain.py +228 -0
- package/build/lib/runtime/proof_gate.py +163 -0
- package/build/lib/runtime/providers/__init__.py +0 -0
- package/build/lib/runtime/providers/codex_provider.py +102 -0
- package/build/lib/runtime/providers/gemini_provider.py +109 -0
- package/build/lib/runtime/providers/kimi_provider.py +132 -0
- package/build/lib/runtime/remote_supervisor.py +64 -0
- package/build/lib/runtime/runtime_profile.py +61 -0
- package/build/lib/runtime/security_check.py +965 -0
- package/build/lib/runtime/subagent_dispatcher.py +469 -0
- package/build/lib/runtime/team_router.py +1167 -0
- package/build/lib/runtime/test_intent_lock.py +91 -0
- package/build/lib/runtime/tmux_session_manager.py +169 -0
- package/build/lib/runtime/tracebank.py +95 -0
- package/build/lib/runtime/untrusted_content.py +269 -0
- package/commands/OMG:doctor.md +37 -0
- package/commands/OMG:preflight.md +1 -1
- package/commands/__init__.py +1 -0
- package/control_plane/__init__.py +2 -0
- package/control_plane/openapi.yaml +260 -0
- package/control_plane/server.py +147 -0
- package/control_plane/service.py +222 -0
- package/dist/enterprise/bundle/.agents/skills/omg/AGENTS.fragment.md +50 -3
- package/dist/enterprise/bundle/.agents/skills/omg/algorithms/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/algorithms/openai.yaml +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/api-twin/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/api-twin/openai.yaml +12 -0
- package/dist/enterprise/bundle/.agents/skills/omg/codex-rules.md +29 -0
- package/dist/enterprise/bundle/.agents/skills/omg/data-lineage/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/data-lineage/openai.yaml +12 -0
- package/dist/enterprise/bundle/.agents/skills/omg/delta-classifier/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/delta-classifier/openai.yaml +12 -0
- package/dist/enterprise/bundle/.agents/skills/omg/eval-gate/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/eval-gate/openai.yaml +12 -0
- package/dist/enterprise/bundle/.agents/skills/omg/health/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/health/openai.yaml +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/incident-replay/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/incident-replay/openai.yaml +12 -0
- package/dist/enterprise/bundle/.agents/skills/omg/preflight/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/preflight/openai.yaml +12 -0
- package/dist/enterprise/bundle/.agents/skills/omg/remote-supervisor/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/remote-supervisor/openai.yaml +12 -0
- package/dist/enterprise/bundle/.agents/skills/omg/robotics/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/robotics/openai.yaml +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/security-check/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/security-check/openai.yaml +13 -0
- package/dist/enterprise/bundle/.agents/skills/omg/tracebank/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/tracebank/openai.yaml +12 -0
- package/dist/enterprise/bundle/.agents/skills/omg/vision/SKILL.md +11 -0
- package/dist/enterprise/bundle/.agents/skills/omg/vision/openai.yaml +11 -0
- package/dist/enterprise/bundle/.claude-plugin/marketplace.json +5 -5
- 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/commands/OMG:code-review.md +114 -0
- package/dist/enterprise/bundle/plugins/advanced/commands/OMG:deep-plan.md +221 -0
- package/dist/enterprise/bundle/plugins/advanced/commands/OMG:handoff.md +115 -0
- package/dist/enterprise/bundle/plugins/advanced/commands/OMG:learn.md +110 -0
- package/dist/enterprise/bundle/plugins/advanced/commands/OMG:maintainer.md +31 -0
- package/dist/enterprise/bundle/plugins/advanced/commands/OMG:ralph-start.md +43 -0
- package/dist/enterprise/bundle/plugins/advanced/commands/OMG:ralph-stop.md +23 -0
- package/dist/enterprise/bundle/plugins/advanced/commands/OMG:security-review.md +16 -0
- package/dist/enterprise/bundle/plugins/advanced/commands/OMG:sequential-thinking.md +20 -0
- package/dist/enterprise/bundle/plugins/advanced/commands/OMG:ship.md +46 -0
- package/dist/enterprise/bundle/plugins/advanced/plugin.json +87 -0
- package/dist/enterprise/bundle/registry/bundles/algorithms.yaml +45 -0
- package/dist/enterprise/bundle/registry/bundles/api-twin.yaml +48 -0
- package/dist/enterprise/bundle/registry/bundles/control-plane.yaml +151 -0
- package/dist/enterprise/bundle/registry/bundles/data-lineage.yaml +47 -0
- package/dist/enterprise/bundle/registry/bundles/delta-classifier.yaml +47 -0
- package/dist/enterprise/bundle/registry/bundles/eval-gate.yaml +47 -0
- package/dist/enterprise/bundle/registry/bundles/health.yaml +45 -0
- package/dist/enterprise/bundle/registry/bundles/hook-governor.yaml +97 -0
- package/dist/enterprise/bundle/registry/bundles/incident-replay.yaml +47 -0
- package/dist/enterprise/bundle/registry/bundles/lsp-pack.yaml +48 -0
- package/dist/enterprise/bundle/registry/bundles/mcp-fabric.yaml +53 -0
- package/dist/enterprise/bundle/registry/bundles/preflight.yaml +48 -0
- package/dist/enterprise/bundle/registry/bundles/remote-supervisor.yaml +49 -0
- package/dist/enterprise/bundle/registry/bundles/robotics.yaml +45 -0
- package/dist/enterprise/bundle/registry/bundles/secure-worktree-pipeline.yaml +54 -0
- package/dist/enterprise/bundle/registry/bundles/security-check.yaml +50 -0
- package/dist/enterprise/bundle/registry/bundles/tracebank.yaml +47 -0
- package/dist/enterprise/bundle/registry/bundles/vision.yaml +45 -0
- package/dist/enterprise/bundle/registry/omg-capability.schema.json +296 -0
- package/dist/enterprise/bundle/settings.json +233 -5
- package/dist/enterprise/manifest.json +216 -12
- package/dist/public/bundle/.agents/skills/omg/AGENTS.fragment.md +50 -3
- package/dist/public/bundle/.agents/skills/omg/algorithms/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/algorithms/openai.yaml +11 -0
- package/dist/public/bundle/.agents/skills/omg/api-twin/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/api-twin/openai.yaml +12 -0
- package/dist/public/bundle/.agents/skills/omg/codex-rules.md +29 -0
- package/dist/public/bundle/.agents/skills/omg/data-lineage/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/data-lineage/openai.yaml +12 -0
- package/dist/public/bundle/.agents/skills/omg/delta-classifier/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/delta-classifier/openai.yaml +12 -0
- package/dist/public/bundle/.agents/skills/omg/eval-gate/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/eval-gate/openai.yaml +12 -0
- package/dist/public/bundle/.agents/skills/omg/health/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/health/openai.yaml +11 -0
- package/dist/public/bundle/.agents/skills/omg/incident-replay/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/incident-replay/openai.yaml +12 -0
- package/dist/public/bundle/.agents/skills/omg/preflight/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/preflight/openai.yaml +12 -0
- package/dist/public/bundle/.agents/skills/omg/remote-supervisor/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/remote-supervisor/openai.yaml +12 -0
- package/dist/public/bundle/.agents/skills/omg/robotics/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/robotics/openai.yaml +11 -0
- package/dist/public/bundle/.agents/skills/omg/security-check/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/security-check/openai.yaml +13 -0
- package/dist/public/bundle/.agents/skills/omg/tracebank/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/tracebank/openai.yaml +12 -0
- package/dist/public/bundle/.agents/skills/omg/vision/SKILL.md +11 -0
- package/dist/public/bundle/.agents/skills/omg/vision/openai.yaml +11 -0
- package/dist/public/bundle/.claude-plugin/marketplace.json +5 -5
- 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/commands/OMG:code-review.md +114 -0
- package/dist/public/bundle/plugins/advanced/commands/OMG:deep-plan.md +221 -0
- package/dist/public/bundle/plugins/advanced/commands/OMG:handoff.md +115 -0
- package/dist/public/bundle/plugins/advanced/commands/OMG:learn.md +110 -0
- package/dist/public/bundle/plugins/advanced/commands/OMG:maintainer.md +31 -0
- package/dist/public/bundle/plugins/advanced/commands/OMG:ralph-start.md +43 -0
- package/dist/public/bundle/plugins/advanced/commands/OMG:ralph-stop.md +23 -0
- package/dist/public/bundle/plugins/advanced/commands/OMG:security-review.md +16 -0
- package/dist/public/bundle/plugins/advanced/commands/OMG:sequential-thinking.md +20 -0
- package/dist/public/bundle/plugins/advanced/commands/OMG:ship.md +46 -0
- package/dist/public/bundle/plugins/advanced/plugin.json +87 -0
- package/dist/public/bundle/registry/bundles/algorithms.yaml +45 -0
- package/dist/public/bundle/registry/bundles/api-twin.yaml +48 -0
- package/dist/public/bundle/registry/bundles/control-plane.yaml +151 -0
- package/dist/public/bundle/registry/bundles/data-lineage.yaml +47 -0
- package/dist/public/bundle/registry/bundles/delta-classifier.yaml +47 -0
- package/dist/public/bundle/registry/bundles/eval-gate.yaml +47 -0
- package/dist/public/bundle/registry/bundles/health.yaml +45 -0
- package/dist/public/bundle/registry/bundles/hook-governor.yaml +97 -0
- package/dist/public/bundle/registry/bundles/incident-replay.yaml +47 -0
- package/dist/public/bundle/registry/bundles/lsp-pack.yaml +48 -0
- package/dist/public/bundle/registry/bundles/mcp-fabric.yaml +53 -0
- package/dist/public/bundle/registry/bundles/preflight.yaml +48 -0
- package/dist/public/bundle/registry/bundles/remote-supervisor.yaml +49 -0
- package/dist/public/bundle/registry/bundles/robotics.yaml +45 -0
- package/dist/public/bundle/registry/bundles/secure-worktree-pipeline.yaml +54 -0
- package/dist/public/bundle/registry/bundles/security-check.yaml +50 -0
- package/dist/public/bundle/registry/bundles/tracebank.yaml +47 -0
- package/dist/public/bundle/registry/bundles/vision.yaml +45 -0
- package/dist/public/bundle/registry/omg-capability.schema.json +296 -0
- package/dist/public/bundle/settings.json +232 -4
- package/dist/public/manifest.json +216 -12
- package/docs/assets/omg-hud.svg +32 -0
- package/docs/install/claude-code.md +31 -0
- package/docs/install/codex.md +29 -0
- package/docs/migration/native-adoption.md +57 -0
- package/docs/proof.md +65 -0
- package/docs/release-checklist.md +40 -0
- package/docs/transcripts/crazy.md +17 -0
- package/docs/transcripts/setup.md +25 -0
- package/hooks/policy_engine.py +122 -17
- package/hooks/setup_wizard.py +52 -12
- package/hooks/shadow_manager.py +27 -0
- package/package.json +2 -2
- package/plugins/README.md +5 -1
- package/plugins/__init__.py +1 -0
- package/plugins/advanced/commands/OMG:deep-plan.md +50 -6
- package/plugins/advanced/commands/OMG:ship.md +1 -1
- package/plugins/advanced/plugin.json +1 -10
- package/plugins/core/plugin.json +7 -1
- package/pyproject.toml +39 -3
- package/registry/__init__.py +1 -0
- package/registry/bundles/algorithms.yaml +45 -0
- package/registry/bundles/api-twin.yaml +48 -0
- package/registry/bundles/claim-judge.yaml +49 -0
- package/registry/bundles/control-plane.yaml +151 -0
- package/registry/bundles/data-lineage.yaml +47 -0
- package/registry/bundles/delta-classifier.yaml +47 -0
- package/registry/bundles/eval-gate.yaml +47 -0
- package/registry/bundles/health.yaml +45 -0
- package/registry/bundles/hook-governor.yaml +97 -0
- package/registry/bundles/incident-replay.yaml +47 -0
- package/registry/bundles/lsp-pack.yaml +48 -0
- package/registry/bundles/mcp-fabric.yaml +53 -0
- package/registry/bundles/plan-council.yaml +51 -0
- package/registry/bundles/preflight.yaml +48 -0
- package/registry/bundles/proof-gate.yaml +49 -0
- package/registry/bundles/remote-supervisor.yaml +49 -0
- package/registry/bundles/robotics.yaml +45 -0
- package/registry/bundles/secure-worktree-pipeline.yaml +54 -0
- package/registry/bundles/security-check.yaml +50 -0
- package/registry/bundles/test-intent-lock.yaml +49 -0
- package/registry/bundles/tracebank.yaml +47 -0
- package/registry/bundles/vision.yaml +45 -0
- package/registry/omg-capability.schema.json +296 -0
- package/registry/verify_artifact.py +90 -0
- package/runtime/adapters/claude.py +3 -0
- package/runtime/adapters/gpt.py +3 -0
- package/runtime/adapters/local.py +3 -0
- package/runtime/adoption.py +1 -1
- package/runtime/api_twin.py +334 -14
- package/runtime/asset_loader.py +62 -0
- package/runtime/business_workflow.py +14 -0
- package/runtime/claim_judge.py +95 -0
- package/runtime/compat.py +142 -2
- package/runtime/contract_compiler.py +1270 -50
- package/runtime/data_lineage.py +73 -0
- package/runtime/delta_classifier.py +81 -0
- package/runtime/domain_packs.py +12 -0
- package/runtime/ecosystem.py +1 -1
- package/runtime/eval_gate.py +96 -0
- package/runtime/incident_replay.py +47 -0
- package/runtime/mcp_config_writers.py +12 -0
- package/runtime/mcp_lifecycle.py +31 -9
- package/runtime/mcp_memory_server.py +1 -1
- package/runtime/omg_compat_contract_snapshot.json +1 -1
- package/runtime/omg_contract_snapshot.json +1 -1
- package/runtime/omg_mcp_server.py +16 -9
- package/runtime/playwright_pack.py +169 -0
- package/runtime/preflight.py +66 -1
- package/runtime/proof_chain.py +228 -0
- package/runtime/proof_gate.py +163 -0
- package/runtime/remote_supervisor.py +64 -0
- package/runtime/security_check.py +626 -8
- package/runtime/team_router.py +6 -6
- package/runtime/test_intent_lock.py +91 -0
- package/runtime/tracebank.py +95 -0
- package/runtime/untrusted_content.py +172 -5
- package/scripts/check-omg-public-ready.py +77 -0
- package/scripts/omg.py +207 -3
- package/scripts/verify-standalone.sh +7 -0
- package/settings.json +233 -5
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Hashline Injector — injects content-hash anchors into file content on read.
|
|
3
|
+
|
|
4
|
+
Each line gets a tag: `{line_number}#{2-char-id}|{original line}`
|
|
5
|
+
where the 2-char ID is derived from SHA-256 of the line content mapped to
|
|
6
|
+
the charset ZPMQVRWSNKTXJBYH (16 chars, 4-bit nibbles of first hash byte).
|
|
7
|
+
|
|
8
|
+
Uses a sidecar cache at `.omg/state/hashline_cache.json` to avoid
|
|
9
|
+
regenerating hashes for unchanged files. Never modifies original files.
|
|
10
|
+
|
|
11
|
+
Feature flag: OMG_HASHLINE_ENABLED (default: False)
|
|
12
|
+
"""
|
|
13
|
+
import hashlib
|
|
14
|
+
import json
|
|
15
|
+
import os
|
|
16
|
+
import re
|
|
17
|
+
import sys
|
|
18
|
+
import time
|
|
19
|
+
|
|
20
|
+
HOOKS_DIR = os.path.dirname(__file__)
|
|
21
|
+
if HOOKS_DIR not in sys.path:
|
|
22
|
+
sys.path.insert(0, HOOKS_DIR)
|
|
23
|
+
|
|
24
|
+
from _common import (
|
|
25
|
+
setup_crash_handler,
|
|
26
|
+
json_input,
|
|
27
|
+
get_feature_flag,
|
|
28
|
+
get_project_dir,
|
|
29
|
+
atomic_json_write,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
setup_crash_handler("hashline-injector")
|
|
33
|
+
|
|
34
|
+
# --- Constants ---
|
|
35
|
+
|
|
36
|
+
# 16-char charset for 4-bit nibble mapping
|
|
37
|
+
HASH_CHARSET = "ZPMQVRWSNKTXJBYH"
|
|
38
|
+
|
|
39
|
+
# Regex to strip hashline prefix: digits + # + 2 uppercase letters + |
|
|
40
|
+
_HASHLINE_RE = re.compile(r"^\d+#[A-Z]{2}\|")
|
|
41
|
+
|
|
42
|
+
# Sidecar cache path (relative to project dir)
|
|
43
|
+
_CACHE_REL_PATH = os.path.join(".omg", "state", "hashline_cache.json")
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
# --- Core Functions ---
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def _line_hash_id(line: str) -> str:
|
|
50
|
+
"""Generate 2-char hash ID from line content.
|
|
51
|
+
|
|
52
|
+
Takes first byte of SHA-256 digest, splits into two 4-bit nibbles,
|
|
53
|
+
maps each nibble to HASH_CHARSET.
|
|
54
|
+
"""
|
|
55
|
+
digest = hashlib.sha256(line.encode("utf-8", errors="replace")).digest()
|
|
56
|
+
first_byte = digest[0]
|
|
57
|
+
high_nibble = (first_byte >> 4) & 0x0F
|
|
58
|
+
low_nibble = first_byte & 0x0F
|
|
59
|
+
return HASH_CHARSET[high_nibble] + HASH_CHARSET[low_nibble]
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def inject_hashlines(content: str, file_path: str = None) -> str:
|
|
63
|
+
"""Add hash anchors to each line of content.
|
|
64
|
+
|
|
65
|
+
Format: `{line_num}#{hash_id}|{original_line}` (1-indexed)
|
|
66
|
+
|
|
67
|
+
Args:
|
|
68
|
+
content: File content string
|
|
69
|
+
file_path: Optional file path for caching. If provided and the file
|
|
70
|
+
exists, hashes are cached to `.omg/state/hashline_cache.json`.
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
Content with hash anchors prepended to each line.
|
|
74
|
+
Returns content unchanged if OMG_HASHLINE_ENABLED is False.
|
|
75
|
+
"""
|
|
76
|
+
if not _is_enabled():
|
|
77
|
+
return content
|
|
78
|
+
|
|
79
|
+
# Check cache first
|
|
80
|
+
if file_path:
|
|
81
|
+
cached = _get_cached_hashes(file_path)
|
|
82
|
+
if cached is not None:
|
|
83
|
+
return _apply_cached_hashes(content, cached)
|
|
84
|
+
|
|
85
|
+
lines = content.split("\n")
|
|
86
|
+
result = []
|
|
87
|
+
line_hashes = {}
|
|
88
|
+
|
|
89
|
+
for i, line in enumerate(lines, start=1):
|
|
90
|
+
hash_id = _line_hash_id(line)
|
|
91
|
+
line_hashes[str(i)] = hash_id
|
|
92
|
+
result.append(f"{i}#{hash_id}|{line}")
|
|
93
|
+
|
|
94
|
+
# Cache if file_path provided
|
|
95
|
+
if file_path:
|
|
96
|
+
_cache_hashes(file_path, line_hashes)
|
|
97
|
+
|
|
98
|
+
return "\n".join(result)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def strip_hashlines(content: str) -> str:
|
|
102
|
+
"""Remove hash anchors from content, restoring original text.
|
|
103
|
+
|
|
104
|
+
Strips `^\\d+#[A-Z]{2}\\|` prefix from each line.
|
|
105
|
+
|
|
106
|
+
Args:
|
|
107
|
+
content: Content with hash anchors
|
|
108
|
+
|
|
109
|
+
Returns:
|
|
110
|
+
Original content without hash anchors.
|
|
111
|
+
"""
|
|
112
|
+
lines = content.split("\n")
|
|
113
|
+
result = []
|
|
114
|
+
for line in lines:
|
|
115
|
+
result.append(_HASHLINE_RE.sub("", line))
|
|
116
|
+
return "\n".join(result)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def _apply_cached_hashes(content: str, line_hashes: dict) -> str:
|
|
120
|
+
"""Apply cached hash IDs to content lines."""
|
|
121
|
+
lines = content.split("\n")
|
|
122
|
+
result = []
|
|
123
|
+
for i, line in enumerate(lines, start=1):
|
|
124
|
+
hash_id = line_hashes.get(str(i))
|
|
125
|
+
if hash_id is None:
|
|
126
|
+
# Line count changed — cache is stale, regenerate
|
|
127
|
+
hash_id = _line_hash_id(line)
|
|
128
|
+
result.append(f"{i}#{hash_id}|{line}")
|
|
129
|
+
return "\n".join(result)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
# --- Sidecar Cache ---
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def _get_cache_path() -> str:
|
|
136
|
+
"""Get absolute path to hashline cache file."""
|
|
137
|
+
return os.path.join(get_project_dir(), _CACHE_REL_PATH)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def _load_cache() -> dict:
|
|
141
|
+
"""Load the entire hashline cache from disk. Returns empty dict on failure."""
|
|
142
|
+
cache_path = _get_cache_path()
|
|
143
|
+
try:
|
|
144
|
+
if not os.path.exists(cache_path):
|
|
145
|
+
return {}
|
|
146
|
+
with open(cache_path, "r", encoding="utf-8") as f:
|
|
147
|
+
return json.load(f)
|
|
148
|
+
except Exception:
|
|
149
|
+
return {}
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def _get_cached_hashes(file_path: str):
|
|
153
|
+
"""Get cached line hashes for a file, if still valid.
|
|
154
|
+
|
|
155
|
+
Args:
|
|
156
|
+
file_path: Path to the source file
|
|
157
|
+
|
|
158
|
+
Returns:
|
|
159
|
+
dict mapping line number (str) -> hash_id, or None if not cached
|
|
160
|
+
or if the file's mtime has changed (cache invalidation).
|
|
161
|
+
"""
|
|
162
|
+
try:
|
|
163
|
+
abs_path = os.path.abspath(file_path)
|
|
164
|
+
if not os.path.exists(abs_path):
|
|
165
|
+
return None
|
|
166
|
+
|
|
167
|
+
cache = _load_cache()
|
|
168
|
+
entry = cache.get(abs_path)
|
|
169
|
+
if entry is None:
|
|
170
|
+
return None
|
|
171
|
+
|
|
172
|
+
# Check mtime for invalidation
|
|
173
|
+
current_mtime = os.path.getmtime(abs_path)
|
|
174
|
+
cached_mtime = entry.get("mtime", 0)
|
|
175
|
+
if abs(current_mtime - cached_mtime) > 0.001:
|
|
176
|
+
return None
|
|
177
|
+
|
|
178
|
+
return entry.get("line_hashes")
|
|
179
|
+
except Exception:
|
|
180
|
+
return None
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def _cache_hashes(file_path: str, line_hashes: dict) -> None:
|
|
184
|
+
"""Save line hashes to sidecar cache with mtime for invalidation.
|
|
185
|
+
|
|
186
|
+
Args:
|
|
187
|
+
file_path: Path to the source file
|
|
188
|
+
line_hashes: dict mapping line number (str) -> hash_id
|
|
189
|
+
"""
|
|
190
|
+
try:
|
|
191
|
+
abs_path = os.path.abspath(file_path)
|
|
192
|
+
cache = _load_cache()
|
|
193
|
+
|
|
194
|
+
mtime = 0.0
|
|
195
|
+
if os.path.exists(abs_path):
|
|
196
|
+
mtime = os.path.getmtime(abs_path)
|
|
197
|
+
|
|
198
|
+
cache[abs_path] = {
|
|
199
|
+
"mtime": mtime,
|
|
200
|
+
"line_hashes": line_hashes,
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
atomic_json_write(_get_cache_path(), cache)
|
|
204
|
+
except Exception:
|
|
205
|
+
pass # Never crash on cache write failure
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
# --- Feature Flag ---
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
def _is_enabled() -> bool:
|
|
212
|
+
"""Check if hashline injection is enabled.
|
|
213
|
+
|
|
214
|
+
Resolution order: OMG_HASHLINE_ENABLED env var → settings.json → False
|
|
215
|
+
"""
|
|
216
|
+
# Fast path: check env var directly
|
|
217
|
+
env_val = os.environ.get("OMG_HASHLINE_ENABLED", "").lower()
|
|
218
|
+
if env_val in ("1", "true", "yes"):
|
|
219
|
+
return True
|
|
220
|
+
if env_val in ("0", "false", "no"):
|
|
221
|
+
return False
|
|
222
|
+
# Slow path: check settings.json via get_feature_flag
|
|
223
|
+
return get_feature_flag("HASHLINE", default=False)
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
# --- Hook Entry Point ---
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
def main():
|
|
230
|
+
"""Hook stdin/stdout entry point for Claude Code PreToolUse hooks.
|
|
231
|
+
|
|
232
|
+
Reads JSON from stdin with tool_input containing file content.
|
|
233
|
+
If hashline injection is enabled and tool is a file read, injects
|
|
234
|
+
hash anchors into the content.
|
|
235
|
+
Writes modified tool input back to stdout.
|
|
236
|
+
Always exits 0 — never raises.
|
|
237
|
+
"""
|
|
238
|
+
if not _is_enabled():
|
|
239
|
+
sys.exit(0)
|
|
240
|
+
|
|
241
|
+
data = json_input()
|
|
242
|
+
if not isinstance(data, dict):
|
|
243
|
+
sys.exit(0)
|
|
244
|
+
|
|
245
|
+
# Only inject for file-read tools
|
|
246
|
+
tool_name = data.get("tool_name", "")
|
|
247
|
+
if tool_name not in ("Read", "mcp__filesystem__read_file",
|
|
248
|
+
"mcp__filesystem__read_text_file"):
|
|
249
|
+
sys.exit(0)
|
|
250
|
+
|
|
251
|
+
tool_input = data.get("tool_input", {})
|
|
252
|
+
if not isinstance(tool_input, dict):
|
|
253
|
+
sys.exit(0)
|
|
254
|
+
|
|
255
|
+
content = tool_input.get("content", "")
|
|
256
|
+
file_path = tool_input.get("file_path", tool_input.get("filePath", ""))
|
|
257
|
+
|
|
258
|
+
if not content:
|
|
259
|
+
sys.exit(0)
|
|
260
|
+
|
|
261
|
+
try:
|
|
262
|
+
injected = inject_hashlines(content, file_path or None)
|
|
263
|
+
tool_input["content"] = injected
|
|
264
|
+
data["tool_input"] = tool_input
|
|
265
|
+
json.dump(data, sys.stdout)
|
|
266
|
+
except Exception:
|
|
267
|
+
pass # Graceful degradation — never crash
|
|
268
|
+
|
|
269
|
+
sys.exit(0)
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
if __name__ == "__main__":
|
|
273
|
+
main()
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Hashline Validator — validates edit targets against stored hash anchors.
|
|
3
|
+
|
|
4
|
+
Validates that ``line_ref`` (e.g. ``"11#VK"``) matches the cached hash for
|
|
5
|
+
that line before allowing an edit. Rejects mismatched edits with a clear
|
|
6
|
+
error dict. Updates cache after successful edits.
|
|
7
|
+
|
|
8
|
+
Feature flag: OMG_HASHLINE_ENABLED (default: False)
|
|
9
|
+
"""
|
|
10
|
+
import json
|
|
11
|
+
import os
|
|
12
|
+
import re
|
|
13
|
+
import sys
|
|
14
|
+
|
|
15
|
+
HOOKS_DIR = os.path.dirname(__file__)
|
|
16
|
+
if HOOKS_DIR not in sys.path:
|
|
17
|
+
sys.path.insert(0, HOOKS_DIR)
|
|
18
|
+
|
|
19
|
+
from _common import (
|
|
20
|
+
setup_crash_handler,
|
|
21
|
+
json_input,
|
|
22
|
+
get_feature_flag,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
setup_crash_handler("hashline-validator")
|
|
26
|
+
|
|
27
|
+
# --- Constants ---
|
|
28
|
+
|
|
29
|
+
# Valid line_ref: digits + # + exactly 2 chars from HASH_CHARSET
|
|
30
|
+
_LINE_REF_RE = re.compile(r"^\d+#[ZPMQVRWSNKTXJBYH]{2}$")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# --- Feature Flag ---
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _is_enabled() -> bool:
|
|
37
|
+
"""Check if hashline validation is enabled.
|
|
38
|
+
|
|
39
|
+
Resolution order: OMG_HASHLINE_ENABLED env var → settings.json → False
|
|
40
|
+
"""
|
|
41
|
+
env_val = os.environ.get("OMG_HASHLINE_ENABLED", "").lower()
|
|
42
|
+
if env_val in ("1", "true", "yes"):
|
|
43
|
+
return True
|
|
44
|
+
if env_val in ("0", "false", "no"):
|
|
45
|
+
return False
|
|
46
|
+
return get_feature_flag("HASHLINE", default=False)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
# --- Lazy Imports from hashline-injector ---
|
|
50
|
+
|
|
51
|
+
_injector = None
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _get_injector():
|
|
55
|
+
"""Lazy-load hashline-injector module."""
|
|
56
|
+
global _injector
|
|
57
|
+
if _injector is None:
|
|
58
|
+
import importlib
|
|
59
|
+
_injector = importlib.import_module("hashline-injector")
|
|
60
|
+
return _injector
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
# --- Core Functions ---
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def validate_line_ref_format(line_ref: str) -> bool:
|
|
67
|
+
"""Return True if *line_ref* matches ``'{line_num}#{2-char hash_id}'``.
|
|
68
|
+
|
|
69
|
+
Hash ID characters must belong to the charset ``ZPMQVRWSNKTXJBYH``.
|
|
70
|
+
|
|
71
|
+
Args:
|
|
72
|
+
line_ref: Line reference string (e.g. ``"11#VK"``)
|
|
73
|
+
|
|
74
|
+
Returns:
|
|
75
|
+
True if format is valid, False otherwise.
|
|
76
|
+
"""
|
|
77
|
+
if not isinstance(line_ref, str):
|
|
78
|
+
return False
|
|
79
|
+
return bool(_LINE_REF_RE.match(line_ref))
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def validate_edit(file_path: str, line_ref: str, expected_line: str) -> dict:
|
|
83
|
+
"""Validate a hash anchor before allowing an edit.
|
|
84
|
+
|
|
85
|
+
Args:
|
|
86
|
+
file_path: Path to the file being edited.
|
|
87
|
+
line_ref: Line reference ``"{line_num}#{hash_id}"`` (e.g. ``"11#VK"``).
|
|
88
|
+
expected_line: The expected content of the line (context, not used
|
|
89
|
+
for hash matching itself).
|
|
90
|
+
|
|
91
|
+
Returns:
|
|
92
|
+
dict with validation result — always contains ``"valid"`` key:
|
|
93
|
+
|
|
94
|
+
* Feature disabled → ``{"valid": True, "skipped": True}``
|
|
95
|
+
* No cache available → ``{"valid": True, "uncached": True}``
|
|
96
|
+
* Hash match → ``{"valid": True, "line": <int>}``
|
|
97
|
+
* Hash mismatch → ``{"valid": False, "error": "HASH_MISMATCH",
|
|
98
|
+
"line": <int>, "expected": <str>, "actual": <str>}``
|
|
99
|
+
* Bad format → ``{"valid": False, "error": "INVALID_LINE_REF",
|
|
100
|
+
"line_ref": <str>}``
|
|
101
|
+
"""
|
|
102
|
+
# Skip when disabled
|
|
103
|
+
if not _is_enabled():
|
|
104
|
+
return {"valid": True, "skipped": True}
|
|
105
|
+
|
|
106
|
+
# Validate format
|
|
107
|
+
if not validate_line_ref_format(line_ref):
|
|
108
|
+
return {"valid": False, "error": "INVALID_LINE_REF", "line_ref": line_ref}
|
|
109
|
+
|
|
110
|
+
# Parse line_ref
|
|
111
|
+
parts = line_ref.split("#")
|
|
112
|
+
line_num = int(parts[0])
|
|
113
|
+
hash_id = parts[1]
|
|
114
|
+
|
|
115
|
+
# Load cache via injector
|
|
116
|
+
try:
|
|
117
|
+
injector = _get_injector()
|
|
118
|
+
cached_hashes = injector._get_cached_hashes(file_path)
|
|
119
|
+
except Exception:
|
|
120
|
+
# Injector unavailable — cannot validate
|
|
121
|
+
return {"valid": True, "uncached": True}
|
|
122
|
+
|
|
123
|
+
if cached_hashes is None:
|
|
124
|
+
return {"valid": True, "uncached": True}
|
|
125
|
+
|
|
126
|
+
# Look up the line in the cache
|
|
127
|
+
stored_hash = cached_hashes.get(str(line_num))
|
|
128
|
+
if stored_hash is None:
|
|
129
|
+
# Line number not in cache (file may have grown since last cache)
|
|
130
|
+
return {"valid": True, "uncached": True}
|
|
131
|
+
|
|
132
|
+
# Compare
|
|
133
|
+
if stored_hash != hash_id:
|
|
134
|
+
return {
|
|
135
|
+
"valid": False,
|
|
136
|
+
"error": "HASH_MISMATCH",
|
|
137
|
+
"line": line_num,
|
|
138
|
+
"expected": hash_id,
|
|
139
|
+
"actual": stored_hash,
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return {"valid": True, "line": line_num}
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def update_hashes_after_edit(file_path: str, new_content: str) -> bool:
|
|
146
|
+
"""Refresh the hash cache after a successful edit.
|
|
147
|
+
|
|
148
|
+
Re-generates line hashes for *new_content* and updates the sidecar
|
|
149
|
+
cache (``hashline_cache.json``) for *file_path*.
|
|
150
|
+
|
|
151
|
+
Args:
|
|
152
|
+
file_path: Path to the edited file.
|
|
153
|
+
new_content: The file content after the edit.
|
|
154
|
+
|
|
155
|
+
Returns:
|
|
156
|
+
True on success (or when disabled), False on error.
|
|
157
|
+
"""
|
|
158
|
+
if not _is_enabled():
|
|
159
|
+
return True
|
|
160
|
+
|
|
161
|
+
try:
|
|
162
|
+
injector = _get_injector()
|
|
163
|
+
_line_hash_id = injector._line_hash_id
|
|
164
|
+
_cache_hashes = injector._cache_hashes
|
|
165
|
+
except Exception:
|
|
166
|
+
return False
|
|
167
|
+
|
|
168
|
+
try:
|
|
169
|
+
lines = new_content.split("\n")
|
|
170
|
+
line_hashes = {}
|
|
171
|
+
for i, line in enumerate(lines, start=1):
|
|
172
|
+
line_hashes[str(i)] = _line_hash_id(line)
|
|
173
|
+
|
|
174
|
+
_cache_hashes(file_path, line_hashes)
|
|
175
|
+
return True
|
|
176
|
+
except Exception:
|
|
177
|
+
return False
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
# --- Hook Entry Point ---
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def main():
|
|
184
|
+
"""Hook stdin/stdout entry point.
|
|
185
|
+
|
|
186
|
+
Reads JSON from stdin::
|
|
187
|
+
|
|
188
|
+
{"file_path": "...", "line_ref": "11#VK", "expected_line": "..."}
|
|
189
|
+
|
|
190
|
+
Calls :func:`validate_edit` and writes the result dict to stdout.
|
|
191
|
+
Always exits 0 — never raises.
|
|
192
|
+
"""
|
|
193
|
+
if not _is_enabled():
|
|
194
|
+
json.dump({"valid": True, "skipped": True}, sys.stdout)
|
|
195
|
+
sys.exit(0)
|
|
196
|
+
|
|
197
|
+
data = json_input()
|
|
198
|
+
if not isinstance(data, dict):
|
|
199
|
+
json.dump({"valid": False, "error": "INVALID_INPUT"}, sys.stdout)
|
|
200
|
+
sys.exit(0)
|
|
201
|
+
|
|
202
|
+
file_path = data.get("file_path", "")
|
|
203
|
+
line_ref = data.get("line_ref", "")
|
|
204
|
+
expected_line = data.get("expected_line", "")
|
|
205
|
+
|
|
206
|
+
try:
|
|
207
|
+
result = validate_edit(file_path, line_ref, expected_line)
|
|
208
|
+
json.dump(result, sys.stdout)
|
|
209
|
+
except Exception:
|
|
210
|
+
json.dump({"valid": False, "error": "INTERNAL_ERROR"}, sys.stdout)
|
|
211
|
+
|
|
212
|
+
sys.exit(0)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
if __name__ == "__main__":
|
|
216
|
+
main()
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Stop Hook: Idle Detector (v1)
|
|
4
|
+
|
|
5
|
+
Detects when an agent has gone idle with incomplete todos.
|
|
6
|
+
Reads .omg/state/todo_progress.json (from todo-state-tracker)
|
|
7
|
+
and writes continuation signal to .omg/state/idle_signal.json.
|
|
8
|
+
|
|
9
|
+
Detection only — does not block the stop.
|
|
10
|
+
|
|
11
|
+
Feature flag: OMG_IDLE_DETECTION_ENABLED (default: False)
|
|
12
|
+
"""
|
|
13
|
+
import json
|
|
14
|
+
import sys
|
|
15
|
+
import os
|
|
16
|
+
from datetime import datetime, timezone
|
|
17
|
+
|
|
18
|
+
HOOKS_DIR = os.path.dirname(__file__)
|
|
19
|
+
if HOOKS_DIR not in sys.path:
|
|
20
|
+
sys.path.insert(0, HOOKS_DIR)
|
|
21
|
+
|
|
22
|
+
from _common import ( # noqa: E402
|
|
23
|
+
setup_crash_handler,
|
|
24
|
+
json_input,
|
|
25
|
+
get_project_dir,
|
|
26
|
+
get_feature_flag,
|
|
27
|
+
atomic_json_write,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
setup_crash_handler("idle-detector", fail_closed=False)
|
|
31
|
+
|
|
32
|
+
# Feature flag check — exit cleanly if disabled
|
|
33
|
+
if not get_feature_flag("IDLE_DETECTION", default=False):
|
|
34
|
+
sys.exit(0)
|
|
35
|
+
|
|
36
|
+
# Consume stdin (stop hooks receive JSON input)
|
|
37
|
+
_data = json_input()
|
|
38
|
+
|
|
39
|
+
project_dir = get_project_dir()
|
|
40
|
+
todo_path = os.path.join(project_dir, ".omg", "state", "todo_progress.json")
|
|
41
|
+
signal_path = os.path.join(project_dir, ".omg", "state", "idle_signal.json")
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _write_signal(idle: bool, incomplete: list | None = None, call_count: int = 0):
|
|
45
|
+
"""Write idle signal state atomically."""
|
|
46
|
+
items = incomplete or []
|
|
47
|
+
atomic_json_write(signal_path, {
|
|
48
|
+
"idle_detected": idle,
|
|
49
|
+
"incomplete_count": len(items),
|
|
50
|
+
"incomplete_items": items[:3],
|
|
51
|
+
"timestamp": datetime.now(timezone.utc).isoformat(),
|
|
52
|
+
"trigger": "stop_hook",
|
|
53
|
+
"call_count": call_count,
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# --- Read todo progress ---
|
|
58
|
+
todo_state = None
|
|
59
|
+
if os.path.exists(todo_path):
|
|
60
|
+
try:
|
|
61
|
+
with open(todo_path, "r", encoding="utf-8") as f:
|
|
62
|
+
todo_state = json.load(f)
|
|
63
|
+
except Exception:
|
|
64
|
+
todo_state = None
|
|
65
|
+
|
|
66
|
+
# No todo file or malformed → not idle
|
|
67
|
+
if not isinstance(todo_state, dict):
|
|
68
|
+
_write_signal(False)
|
|
69
|
+
sys.exit(0)
|
|
70
|
+
|
|
71
|
+
incomplete = todo_state.get("incomplete", [])
|
|
72
|
+
if not isinstance(incomplete, list):
|
|
73
|
+
incomplete = []
|
|
74
|
+
|
|
75
|
+
# No incomplete items → not idle
|
|
76
|
+
if not incomplete:
|
|
77
|
+
_write_signal(False)
|
|
78
|
+
sys.exit(0)
|
|
79
|
+
|
|
80
|
+
# --- Check call counter from existing signal ---
|
|
81
|
+
call_count = 0
|
|
82
|
+
if os.path.exists(signal_path):
|
|
83
|
+
try:
|
|
84
|
+
with open(signal_path, "r", encoding="utf-8") as f:
|
|
85
|
+
existing = json.load(f)
|
|
86
|
+
if isinstance(existing, dict):
|
|
87
|
+
call_count = existing.get("call_count", 0)
|
|
88
|
+
except Exception:
|
|
89
|
+
call_count = 0
|
|
90
|
+
|
|
91
|
+
# Idle = incomplete todos AND hook has been called at least once before
|
|
92
|
+
idle_detected = call_count >= 1
|
|
93
|
+
|
|
94
|
+
_write_signal(idle_detected, incomplete, call_count + 1)
|
|
95
|
+
sys.exit(0)
|