@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,271 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Framework Detector — detect test frameworks from project configuration files.
|
|
3
|
+
|
|
4
|
+
Scans a project directory for known config files (package.json, pyproject.toml,
|
|
5
|
+
setup.cfg, Cargo.toml, go.mod, Gemfile) and returns a FrameworkInfo dataclass
|
|
6
|
+
describing the detected framework(s).
|
|
7
|
+
|
|
8
|
+
Feature flag: TEST_GENERATION (default False) — detection works regardless.
|
|
9
|
+
Stdlib only: json, pathlib, re, dataclasses.
|
|
10
|
+
"""
|
|
11
|
+
import json
|
|
12
|
+
import re
|
|
13
|
+
from dataclasses import dataclass, field
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@dataclass
|
|
18
|
+
class FrameworkInfo:
|
|
19
|
+
"""Describes a detected test framework and its conventions."""
|
|
20
|
+
|
|
21
|
+
framework: str = "unknown"
|
|
22
|
+
config_file: str = ""
|
|
23
|
+
test_dir: str = ""
|
|
24
|
+
assertion_style: str = ""
|
|
25
|
+
mock_library: str = ""
|
|
26
|
+
multi_framework: list[str] = field(default_factory=list)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# --- JS/TS framework metadata ---
|
|
30
|
+
|
|
31
|
+
_JS_FRAMEWORKS = {
|
|
32
|
+
"vitest": {
|
|
33
|
+
"framework": "vitest",
|
|
34
|
+
"assertion_style": "expect",
|
|
35
|
+
"mock_library": "vi.mock",
|
|
36
|
+
"test_dir": "__tests__",
|
|
37
|
+
},
|
|
38
|
+
"jest": {
|
|
39
|
+
"framework": "jest",
|
|
40
|
+
"assertion_style": "expect",
|
|
41
|
+
"mock_library": "jest.mock",
|
|
42
|
+
"test_dir": "__tests__",
|
|
43
|
+
},
|
|
44
|
+
"mocha": {
|
|
45
|
+
"framework": "mocha",
|
|
46
|
+
"assertion_style": "assert",
|
|
47
|
+
"mock_library": "sinon",
|
|
48
|
+
"test_dir": "test",
|
|
49
|
+
},
|
|
50
|
+
"@playwright/test": {
|
|
51
|
+
"framework": "playwright",
|
|
52
|
+
"assertion_style": "expect",
|
|
53
|
+
"mock_library": "",
|
|
54
|
+
"test_dir": "tests",
|
|
55
|
+
},
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
# Detection priority: vitest > jest > mocha (vitest first because projects
|
|
59
|
+
# migrating from jest often keep jest in devDeps alongside vitest)
|
|
60
|
+
_JS_PRIORITY = ["vitest", "jest", "mocha", "@playwright/test"]
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def _detect_from_package_json(project_dir: str) -> FrameworkInfo | None:
|
|
64
|
+
"""Detect JS/TS framework from package.json devDependencies and scripts."""
|
|
65
|
+
pkg_path = Path(project_dir) / "package.json"
|
|
66
|
+
if not pkg_path.is_file():
|
|
67
|
+
return None
|
|
68
|
+
|
|
69
|
+
try:
|
|
70
|
+
with open(pkg_path, "r", encoding="utf-8") as f:
|
|
71
|
+
pkg = json.load(f)
|
|
72
|
+
except (json.JSONDecodeError, OSError):
|
|
73
|
+
return None
|
|
74
|
+
|
|
75
|
+
dev_deps = pkg.get("devDependencies", {})
|
|
76
|
+
deps = pkg.get("dependencies", {})
|
|
77
|
+
scripts = pkg.get("scripts", {})
|
|
78
|
+
all_deps = {**deps, **dev_deps}
|
|
79
|
+
|
|
80
|
+
# Also check scripts for framework names
|
|
81
|
+
scripts_text = " ".join(str(v) for v in scripts.values())
|
|
82
|
+
|
|
83
|
+
detected = []
|
|
84
|
+
for fw_key in _JS_PRIORITY:
|
|
85
|
+
if fw_key in all_deps:
|
|
86
|
+
detected.append(fw_key)
|
|
87
|
+
elif fw_key.lstrip("@").split("/")[-1] in scripts_text:
|
|
88
|
+
detected.append(fw_key)
|
|
89
|
+
|
|
90
|
+
if not detected:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
primary_key = detected[0]
|
|
94
|
+
meta = _JS_FRAMEWORKS[primary_key]
|
|
95
|
+
|
|
96
|
+
multi = []
|
|
97
|
+
if len(detected) > 1:
|
|
98
|
+
multi = [_JS_FRAMEWORKS[k]["framework"] for k in detected]
|
|
99
|
+
|
|
100
|
+
return FrameworkInfo(
|
|
101
|
+
framework=meta["framework"],
|
|
102
|
+
config_file="package.json",
|
|
103
|
+
test_dir=meta["test_dir"],
|
|
104
|
+
assertion_style=meta["assertion_style"],
|
|
105
|
+
mock_library=meta["mock_library"],
|
|
106
|
+
multi_framework=multi,
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def _detect_from_pyproject_toml(project_dir: str) -> FrameworkInfo | None:
|
|
111
|
+
"""Detect pytest from pyproject.toml [tool.pytest.*] section."""
|
|
112
|
+
path = Path(project_dir) / "pyproject.toml"
|
|
113
|
+
if not path.is_file():
|
|
114
|
+
return None
|
|
115
|
+
|
|
116
|
+
try:
|
|
117
|
+
content = path.read_text(encoding="utf-8")
|
|
118
|
+
except OSError:
|
|
119
|
+
return None
|
|
120
|
+
|
|
121
|
+
if re.search(r"\[tool\.pytest", content):
|
|
122
|
+
# Try to extract testpaths
|
|
123
|
+
test_dir = "tests"
|
|
124
|
+
m = re.search(r'testpaths\s*=\s*\["?([^"\]\s]+)', content)
|
|
125
|
+
if m:
|
|
126
|
+
test_dir = m.group(1)
|
|
127
|
+
|
|
128
|
+
return FrameworkInfo(
|
|
129
|
+
framework="pytest",
|
|
130
|
+
config_file="pyproject.toml",
|
|
131
|
+
test_dir=test_dir,
|
|
132
|
+
assertion_style="assert",
|
|
133
|
+
mock_library="unittest.mock",
|
|
134
|
+
multi_framework=[],
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
# Check for pytest in dependencies
|
|
138
|
+
if re.search(r"pytest", content):
|
|
139
|
+
return FrameworkInfo(
|
|
140
|
+
framework="pytest",
|
|
141
|
+
config_file="pyproject.toml",
|
|
142
|
+
test_dir="tests",
|
|
143
|
+
assertion_style="assert",
|
|
144
|
+
mock_library="unittest.mock",
|
|
145
|
+
multi_framework=[],
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
return None
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def _detect_from_setup_cfg(project_dir: str) -> FrameworkInfo | None:
|
|
152
|
+
"""Detect pytest from setup.cfg [tool:pytest] section."""
|
|
153
|
+
path = Path(project_dir) / "setup.cfg"
|
|
154
|
+
if not path.is_file():
|
|
155
|
+
return None
|
|
156
|
+
|
|
157
|
+
try:
|
|
158
|
+
content = path.read_text(encoding="utf-8")
|
|
159
|
+
except OSError:
|
|
160
|
+
return None
|
|
161
|
+
|
|
162
|
+
if re.search(r"\[tool:pytest\]", content):
|
|
163
|
+
test_dir = "tests"
|
|
164
|
+
m = re.search(r"testpaths\s*=\s*(\S+)", content)
|
|
165
|
+
if m:
|
|
166
|
+
test_dir = m.group(1)
|
|
167
|
+
|
|
168
|
+
return FrameworkInfo(
|
|
169
|
+
framework="pytest",
|
|
170
|
+
config_file="setup.cfg",
|
|
171
|
+
test_dir=test_dir,
|
|
172
|
+
assertion_style="assert",
|
|
173
|
+
mock_library="unittest.mock",
|
|
174
|
+
multi_framework=[],
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
return None
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def _detect_from_go_mod(project_dir: str) -> FrameworkInfo | None:
|
|
181
|
+
"""Detect Go test from go.mod presence."""
|
|
182
|
+
path = Path(project_dir) / "go.mod"
|
|
183
|
+
if not path.is_file():
|
|
184
|
+
return None
|
|
185
|
+
|
|
186
|
+
return FrameworkInfo(
|
|
187
|
+
framework="go test",
|
|
188
|
+
config_file="go.mod",
|
|
189
|
+
test_dir=".",
|
|
190
|
+
assertion_style="testing.T",
|
|
191
|
+
mock_library="testify/mock",
|
|
192
|
+
multi_framework=[],
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
def _detect_from_cargo_toml(project_dir: str) -> FrameworkInfo | None:
|
|
197
|
+
"""Detect Rust/cargo test from Cargo.toml presence."""
|
|
198
|
+
path = Path(project_dir) / "Cargo.toml"
|
|
199
|
+
if not path.is_file():
|
|
200
|
+
return None
|
|
201
|
+
|
|
202
|
+
return FrameworkInfo(
|
|
203
|
+
framework="cargo test",
|
|
204
|
+
config_file="Cargo.toml",
|
|
205
|
+
test_dir="tests",
|
|
206
|
+
assertion_style="assert!",
|
|
207
|
+
mock_library="mockall",
|
|
208
|
+
multi_framework=[],
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
def _detect_from_gemfile(project_dir: str) -> FrameworkInfo | None:
|
|
213
|
+
"""Detect RSpec from Gemfile containing 'rspec'."""
|
|
214
|
+
path = Path(project_dir) / "Gemfile"
|
|
215
|
+
if not path.is_file():
|
|
216
|
+
return None
|
|
217
|
+
|
|
218
|
+
try:
|
|
219
|
+
content = path.read_text(encoding="utf-8")
|
|
220
|
+
except OSError:
|
|
221
|
+
return None
|
|
222
|
+
|
|
223
|
+
if re.search(r"['\"]rspec['\"]", content):
|
|
224
|
+
return FrameworkInfo(
|
|
225
|
+
framework="rspec",
|
|
226
|
+
config_file="Gemfile",
|
|
227
|
+
test_dir="spec",
|
|
228
|
+
assertion_style="expect",
|
|
229
|
+
mock_library="rspec-mocks",
|
|
230
|
+
multi_framework=[],
|
|
231
|
+
)
|
|
232
|
+
|
|
233
|
+
return None
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
# Ordered detector chain — first match wins (except multi-framework from JS)
|
|
237
|
+
_DETECTORS = [
|
|
238
|
+
_detect_from_package_json,
|
|
239
|
+
_detect_from_pyproject_toml,
|
|
240
|
+
_detect_from_setup_cfg,
|
|
241
|
+
_detect_from_go_mod,
|
|
242
|
+
_detect_from_cargo_toml,
|
|
243
|
+
_detect_from_gemfile,
|
|
244
|
+
]
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
def detect_test_framework(project_dir: str) -> FrameworkInfo:
|
|
248
|
+
"""Detect test framework(s) in a project directory.
|
|
249
|
+
|
|
250
|
+
Scans known config files in priority order. Returns FrameworkInfo with
|
|
251
|
+
framework='unknown' if nothing detected (never crashes).
|
|
252
|
+
|
|
253
|
+
Feature flag TEST_GENERATION gates downstream generation — detection
|
|
254
|
+
itself always works.
|
|
255
|
+
|
|
256
|
+
Args:
|
|
257
|
+
project_dir: Absolute or relative path to the project root.
|
|
258
|
+
|
|
259
|
+
Returns:
|
|
260
|
+
FrameworkInfo dataclass with detected framework metadata.
|
|
261
|
+
"""
|
|
262
|
+
try:
|
|
263
|
+
for detector in _DETECTORS:
|
|
264
|
+
result = detector(project_dir)
|
|
265
|
+
if result is not None:
|
|
266
|
+
return result
|
|
267
|
+
except Exception:
|
|
268
|
+
# Crash isolation: return unknown on any unexpected error
|
|
269
|
+
pass
|
|
270
|
+
|
|
271
|
+
return FrameworkInfo()
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"""Generate lightweight test skeletons from source files.
|
|
2
|
+
|
|
3
|
+
Python symbol extraction uses ``ast`` for precise parsing of top-level public
|
|
4
|
+
functions, classes, and class methods.
|
|
5
|
+
|
|
6
|
+
JavaScript/TypeScript symbol extraction uses regular expressions for exported
|
|
7
|
+
declarations (``export function``, ``export const``, ``export default
|
|
8
|
+
function``, ``export class``). This regex approach is intentionally lightweight
|
|
9
|
+
and expected to be about 70-80% accurate for common code styles.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import ast
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
import re
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
_RE_JS_EXPORT_FUNCTION = re.compile(r"(?:^|\s)export\s+function\s+([A-Za-z_$][\w$]*)\s*\(")
|
|
20
|
+
_RE_JS_EXPORT_CONST = re.compile(r"(?:^|\s)export\s+const\s+([A-Za-z_$][\w$]*)\s*=")
|
|
21
|
+
_RE_JS_EXPORT_DEFAULT_FUNCTION = re.compile(
|
|
22
|
+
r"(?:^|\s)export\s+default\s+function(?:\s+([A-Za-z_$][\w$]*))?\s*\("
|
|
23
|
+
)
|
|
24
|
+
_RE_JS_EXPORT_CLASS = re.compile(r"(?:^|\s)export\s+class\s+([A-Za-z_$][\w$]*)\b")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def generate_test_skeleton(source_file: str, framework_info: dict[str, object]) -> str:
|
|
28
|
+
path = Path(source_file)
|
|
29
|
+
if not path.exists():
|
|
30
|
+
return ""
|
|
31
|
+
|
|
32
|
+
source_text = path.read_text(encoding="utf-8")
|
|
33
|
+
if not source_text.strip():
|
|
34
|
+
return ""
|
|
35
|
+
|
|
36
|
+
framework = str(framework_info.get("framework", "")).lower()
|
|
37
|
+
|
|
38
|
+
functions: list[str]
|
|
39
|
+
classes: dict[str, list[str]]
|
|
40
|
+
if path.suffix == ".py":
|
|
41
|
+
functions, classes = _extract_python_symbols(source_text)
|
|
42
|
+
else:
|
|
43
|
+
functions, classes = _extract_js_ts_symbols(source_text)
|
|
44
|
+
|
|
45
|
+
if framework == "pytest":
|
|
46
|
+
return _render_pytest(functions, classes)
|
|
47
|
+
if framework in {"jest", "vitest"}:
|
|
48
|
+
return _render_jest_vitest(functions, classes)
|
|
49
|
+
if framework == "go":
|
|
50
|
+
return _render_go(functions, classes)
|
|
51
|
+
return _render_generic(functions, classes)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _extract_python_symbols(source_text: str) -> tuple[list[str], dict[str, list[str]]]:
|
|
55
|
+
functions: list[str] = []
|
|
56
|
+
classes: dict[str, list[str]] = {}
|
|
57
|
+
|
|
58
|
+
tree = ast.parse(source_text)
|
|
59
|
+
for node in tree.body:
|
|
60
|
+
if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)) and not node.name.startswith("_"):
|
|
61
|
+
functions.append(node.name)
|
|
62
|
+
elif isinstance(node, ast.ClassDef) and not node.name.startswith("_"):
|
|
63
|
+
public_methods: list[str] = []
|
|
64
|
+
for member in node.body:
|
|
65
|
+
if isinstance(member, (ast.FunctionDef, ast.AsyncFunctionDef)) and not member.name.startswith("_"):
|
|
66
|
+
public_methods.append(member.name)
|
|
67
|
+
classes[node.name] = public_methods
|
|
68
|
+
|
|
69
|
+
return functions, classes
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _extract_js_ts_symbols(source_text: str) -> tuple[list[str], dict[str, list[str]]]:
|
|
73
|
+
functions: list[str] = []
|
|
74
|
+
classes: dict[str, list[str]] = {}
|
|
75
|
+
|
|
76
|
+
functions.extend(_RE_JS_EXPORT_FUNCTION.findall(source_text))
|
|
77
|
+
functions.extend(_RE_JS_EXPORT_CONST.findall(source_text))
|
|
78
|
+
|
|
79
|
+
for match in _RE_JS_EXPORT_DEFAULT_FUNCTION.findall(source_text):
|
|
80
|
+
functions.append(match or "defaultExport")
|
|
81
|
+
|
|
82
|
+
for class_name in _RE_JS_EXPORT_CLASS.findall(source_text):
|
|
83
|
+
classes[class_name] = []
|
|
84
|
+
|
|
85
|
+
return _dedupe(functions), classes
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def _render_pytest(functions: list[str], classes: dict[str, list[str]]) -> str:
|
|
89
|
+
lines: list[str] = []
|
|
90
|
+
|
|
91
|
+
for func_name in functions:
|
|
92
|
+
lines.extend(
|
|
93
|
+
[
|
|
94
|
+
f"def test_{func_name}_happy_path():",
|
|
95
|
+
" # TODO: implement test",
|
|
96
|
+
" # happy path",
|
|
97
|
+
" assert True",
|
|
98
|
+
"",
|
|
99
|
+
f"def test_{func_name}_error_case():",
|
|
100
|
+
" # TODO: implement test",
|
|
101
|
+
" # error case",
|
|
102
|
+
" assert True",
|
|
103
|
+
"",
|
|
104
|
+
]
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
for class_name, methods in classes.items():
|
|
108
|
+
lines.append(f"class Test{class_name}:")
|
|
109
|
+
if not methods:
|
|
110
|
+
lines.extend([" # TODO: implement test", " pass", ""])
|
|
111
|
+
continue
|
|
112
|
+
|
|
113
|
+
for method_name in methods:
|
|
114
|
+
lines.extend(
|
|
115
|
+
[
|
|
116
|
+
f" def test_{method_name}_happy_path(self):",
|
|
117
|
+
" # TODO: implement test",
|
|
118
|
+
" # happy path",
|
|
119
|
+
" assert True",
|
|
120
|
+
"",
|
|
121
|
+
f" def test_{method_name}_error_case(self):",
|
|
122
|
+
" # TODO: implement test",
|
|
123
|
+
" # error case",
|
|
124
|
+
" assert True",
|
|
125
|
+
"",
|
|
126
|
+
]
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
return "\n".join(lines).rstrip()
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def _render_jest_vitest(functions: list[str], classes: dict[str, list[str]]) -> str:
|
|
133
|
+
names = functions + list(classes.keys())
|
|
134
|
+
blocks: list[str] = []
|
|
135
|
+
|
|
136
|
+
for name in names:
|
|
137
|
+
blocks.extend(
|
|
138
|
+
[
|
|
139
|
+
f"describe('{name}', () => {{",
|
|
140
|
+
" it('should happy path', () => {",
|
|
141
|
+
" // TODO: implement test",
|
|
142
|
+
" // happy path",
|
|
143
|
+
" expect(value).toBe(expected);",
|
|
144
|
+
" });",
|
|
145
|
+
"",
|
|
146
|
+
" it('should error case', () => {",
|
|
147
|
+
" // TODO: implement test",
|
|
148
|
+
" // error case",
|
|
149
|
+
" expect(value).toBe(expected);",
|
|
150
|
+
" });",
|
|
151
|
+
"});",
|
|
152
|
+
"",
|
|
153
|
+
]
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
return "\n".join(blocks).rstrip()
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def _render_go(functions: list[str], classes: dict[str, list[str]]) -> str:
|
|
160
|
+
names = functions + list(classes.keys())
|
|
161
|
+
if not names:
|
|
162
|
+
return ""
|
|
163
|
+
|
|
164
|
+
lines = [
|
|
165
|
+
"package main",
|
|
166
|
+
"",
|
|
167
|
+
'import "testing"',
|
|
168
|
+
"",
|
|
169
|
+
]
|
|
170
|
+
|
|
171
|
+
for name in names:
|
|
172
|
+
test_name = _to_pascal_case(name)
|
|
173
|
+
lines.extend(
|
|
174
|
+
[
|
|
175
|
+
f"func Test{test_name}(t *testing.T) {{",
|
|
176
|
+
" // TODO: implement test",
|
|
177
|
+
" // happy path",
|
|
178
|
+
" // error case",
|
|
179
|
+
"}",
|
|
180
|
+
"",
|
|
181
|
+
]
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
return "\n".join(lines).rstrip()
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def _render_generic(functions: list[str], classes: dict[str, list[str]]) -> str:
|
|
188
|
+
names = functions + list(classes.keys())
|
|
189
|
+
if not names:
|
|
190
|
+
return ""
|
|
191
|
+
|
|
192
|
+
lines = []
|
|
193
|
+
for name in names:
|
|
194
|
+
lines.extend(
|
|
195
|
+
[
|
|
196
|
+
f"# Test skeleton for {name}",
|
|
197
|
+
"# TODO: implement test",
|
|
198
|
+
"# happy path",
|
|
199
|
+
"# error case",
|
|
200
|
+
"",
|
|
201
|
+
]
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
return "\n".join(lines).rstrip()
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
def _dedupe(values: list[str]) -> list[str]:
|
|
208
|
+
seen: set[str] = set()
|
|
209
|
+
ordered: list[str] = []
|
|
210
|
+
for value in values:
|
|
211
|
+
if value not in seen:
|
|
212
|
+
seen.add(value)
|
|
213
|
+
ordered.append(value)
|
|
214
|
+
return ordered
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
def _to_pascal_case(name: str) -> str:
|
|
218
|
+
parts = re.split(r"[^A-Za-z0-9]+", name)
|
|
219
|
+
return "".join(part[:1].upper() + part[1:] for part in parts if part) or "Generated"
|
|
File without changes
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import ast
|
|
4
|
+
import json
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import override
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def parse_python_imports(file_path: str) -> list[str]:
|
|
10
|
+
source = Path(file_path).read_text(encoding="utf-8")
|
|
11
|
+
tree = ast.parse(source)
|
|
12
|
+
collector = _ImportCollector()
|
|
13
|
+
collector.visit(tree)
|
|
14
|
+
return collector.imports
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def build_dependency_graph(project_dir: str) -> dict[str, object]:
|
|
18
|
+
root = Path(project_dir)
|
|
19
|
+
py_files = sorted(root.rglob("*.py"))
|
|
20
|
+
|
|
21
|
+
graph: dict[str, list[str]] = {}
|
|
22
|
+
for py_file in py_files:
|
|
23
|
+
module_name = _module_name_for_path(root, py_file)
|
|
24
|
+
imports = parse_python_imports(str(py_file))
|
|
25
|
+
graph[module_name] = _dedupe_preserve_order(imports)
|
|
26
|
+
|
|
27
|
+
cycles = _detect_cycles(graph)
|
|
28
|
+
stats = {
|
|
29
|
+
"module_count": len(graph),
|
|
30
|
+
"edge_count": sum(len(edges) for edges in graph.values()),
|
|
31
|
+
"max_depth": _compute_max_depth(graph),
|
|
32
|
+
"has_cycles": bool(cycles),
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
payload: dict[str, object] = {
|
|
36
|
+
"graph": graph,
|
|
37
|
+
"cycles": cycles,
|
|
38
|
+
"stats": stats,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
output_path = root / ".omg" / "state" / "dependency-graph.json"
|
|
42
|
+
output_path.parent.mkdir(parents=True, exist_ok=True)
|
|
43
|
+
_ = output_path.write_text(json.dumps(payload, indent=2, sort_keys=True), encoding="utf-8")
|
|
44
|
+
|
|
45
|
+
return payload
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class _ImportCollector(ast.NodeVisitor):
|
|
49
|
+
def __init__(self) -> None:
|
|
50
|
+
self.imports: list[str] = []
|
|
51
|
+
|
|
52
|
+
@override
|
|
53
|
+
def visit_Import(self, node: ast.Import) -> None: # noqa: N802
|
|
54
|
+
for alias in node.names:
|
|
55
|
+
self.imports.append(alias.name)
|
|
56
|
+
|
|
57
|
+
@override
|
|
58
|
+
def visit_ImportFrom(self, node: ast.ImportFrom) -> None: # noqa: N802
|
|
59
|
+
if node.level > 0:
|
|
60
|
+
prefix = "." * node.level
|
|
61
|
+
self.imports.append(f"{prefix}{node.module or ''}")
|
|
62
|
+
return
|
|
63
|
+
|
|
64
|
+
if node.module:
|
|
65
|
+
self.imports.append(node.module)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _module_name_for_path(root: Path, py_file: Path) -> str:
|
|
69
|
+
rel = py_file.relative_to(root).with_suffix("")
|
|
70
|
+
parts = list(rel.parts)
|
|
71
|
+
if parts and parts[-1] == "__init__":
|
|
72
|
+
parts = parts[:-1]
|
|
73
|
+
return ".".join(parts) if parts else "__init__"
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def _dedupe_preserve_order(values: list[str]) -> list[str]:
|
|
77
|
+
seen: set[str] = set()
|
|
78
|
+
ordered: list[str] = []
|
|
79
|
+
for value in values:
|
|
80
|
+
if value not in seen:
|
|
81
|
+
seen.add(value)
|
|
82
|
+
ordered.append(value)
|
|
83
|
+
return ordered
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def _detect_cycles(graph: dict[str, list[str]]) -> list[list[str]]:
|
|
87
|
+
visited: set[str] = set()
|
|
88
|
+
on_stack: set[str] = set()
|
|
89
|
+
stack: list[str] = []
|
|
90
|
+
cycle_set: set[tuple[str, ...]] = set()
|
|
91
|
+
|
|
92
|
+
def dfs(node: str) -> None:
|
|
93
|
+
visited.add(node)
|
|
94
|
+
on_stack.add(node)
|
|
95
|
+
stack.append(node)
|
|
96
|
+
|
|
97
|
+
for nxt in graph.get(node, []):
|
|
98
|
+
if nxt not in graph:
|
|
99
|
+
continue
|
|
100
|
+
if nxt not in visited:
|
|
101
|
+
dfs(nxt)
|
|
102
|
+
elif nxt in on_stack:
|
|
103
|
+
start_idx = stack.index(nxt)
|
|
104
|
+
cycle = stack[start_idx:] + [nxt]
|
|
105
|
+
cycle_set.add(_canonical_cycle(cycle))
|
|
106
|
+
|
|
107
|
+
_ = stack.pop()
|
|
108
|
+
on_stack.remove(node)
|
|
109
|
+
|
|
110
|
+
for module in graph:
|
|
111
|
+
if module not in visited:
|
|
112
|
+
dfs(module)
|
|
113
|
+
|
|
114
|
+
return [list(cycle) for cycle in sorted(cycle_set)]
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def _canonical_cycle(cycle: list[str]) -> tuple[str, ...]:
|
|
118
|
+
core = cycle[:-1]
|
|
119
|
+
if not core:
|
|
120
|
+
return tuple(cycle)
|
|
121
|
+
|
|
122
|
+
rotations = [tuple(core[idx:] + core[:idx]) for idx in range(len(core))]
|
|
123
|
+
minimal = min(rotations)
|
|
124
|
+
return minimal + (minimal[0],)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def _compute_max_depth(graph: dict[str, list[str]]) -> int:
|
|
128
|
+
def depth(node: str, path: set[str]) -> int:
|
|
129
|
+
best = 0
|
|
130
|
+
for nxt in graph.get(node, []):
|
|
131
|
+
if nxt not in graph or nxt in path:
|
|
132
|
+
continue
|
|
133
|
+
best = max(best, 1 + depth(nxt, path | {nxt}))
|
|
134
|
+
return best
|
|
135
|
+
|
|
136
|
+
best_depth = 0
|
|
137
|
+
for module in graph:
|
|
138
|
+
best_depth = max(best_depth, depth(module, {module}))
|
|
139
|
+
return best_depth
|