@agentikos/omega-os 0.1.0 → 0.19.5
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/README.md +56 -14
- package/bootstrap/lib/__pycache__/claude-code-settings.cpython-313.pyc +0 -0
- package/bootstrap/lib/__pycache__/llm-clis.cpython-313.pyc +0 -0
- package/bootstrap/lib/__pycache__/manifest-helpers.cpython-313.pyc +0 -0
- package/bootstrap/lib/claude-code-settings.py +176 -0
- package/bootstrap/lib/common.sh +457 -1
- package/bootstrap/lib/llm-clis.py +341 -0
- package/bootstrap/lib/manifest-helpers.py +384 -0
- package/bootstrap/lib/steps.sh +1000 -26
- package/bootstrap/manifest.example.yaml +93 -2
- package/bootstrap/templates/aisb/CLAUDE.md +305 -0
- package/bootstrap/templates/aisb/architect.md +204 -0
- package/bootstrap/templates/aisb/checkers/CLAUDE.md +9 -0
- package/bootstrap/templates/aisb/checkers/checker-architect.md +151 -0
- package/bootstrap/templates/aisb/checkers/checker-common.md +171 -0
- package/bootstrap/templates/aisb/checkers/checker-construct.md +129 -0
- package/bootstrap/templates/aisb/checkers/checker-keymaker.md +204 -0
- package/bootstrap/templates/aisb/checkers/checker-link.md +205 -0
- package/bootstrap/templates/aisb/checkers/checker-merovingian.md +219 -0
- package/bootstrap/templates/aisb/checkers/checker-morpheus.md +211 -0
- package/bootstrap/templates/aisb/checkers/checker-neo.md +177 -0
- package/bootstrap/templates/aisb/checkers/checker-niobe.md +156 -0
- package/bootstrap/templates/aisb/checkers/checker-oracle.md +164 -0
- package/bootstrap/templates/aisb/checkers/checker-seraph.md +187 -0
- package/bootstrap/templates/aisb/checkers/checker-smith.md +195 -0
- package/bootstrap/templates/aisb/checkers/checker-zion.md +113 -0
- package/bootstrap/templates/aisb/construct.md +135 -0
- package/bootstrap/templates/aisb/keymaker.md +227 -0
- package/bootstrap/templates/aisb/link.md +170 -0
- package/bootstrap/templates/aisb/lmc-protocol.md +57 -0
- package/bootstrap/templates/aisb/merovingian.md +159 -0
- package/bootstrap/templates/aisb/morpheus.md +243 -0
- package/bootstrap/templates/aisb/neo.md +147 -0
- package/bootstrap/templates/aisb/niobe.md +197 -0
- package/bootstrap/templates/aisb/oracle.md +244 -0
- package/bootstrap/templates/aisb/protocols/handoff-templates.md +204 -0
- package/bootstrap/templates/aisb/protocols/shared-protocol.md +248 -0
- package/bootstrap/templates/aisb/pythia.md +153 -0
- package/bootstrap/templates/aisb/seraph.md +315 -0
- package/bootstrap/templates/aisb/smith.md +202 -0
- package/bootstrap/templates/aisb/zion.md +172 -0
- package/bootstrap/templates/autonomous/audit-patrol.yaml +41 -0
- package/bootstrap/templates/autonomous/smith-reflect.yaml +43 -0
- package/bootstrap/templates/autonomous/ssh-key-rotate.yaml +46 -0
- package/bootstrap/templates/autonomous/support-agent.yaml +38 -0
- package/docs/AUDITS.md +85 -0
- package/docs/COMPLETION-PLAN.md +48 -0
- package/docs/GAP-ANALYSIS.md +214 -0
- package/docs/INSTALL.md +47 -9
- package/docs/MCP-AND-PLUGINS.md +31 -4
- package/docs/SIMULATION.md +171 -0
- package/docs/simulate.sh +211 -0
- package/install.sh +164 -17
- package/omega/Agentik_Engine/README.md +27 -10
- package/omega/Agentik_Engine/omega_engine/__init__.py +212 -2
- package/omega/Agentik_Engine/omega_engine/__pycache__/__init__.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/account.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/agent_messages.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/aisb_chat.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/audit_diff.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/audit_gate.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/auto_update.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/autonomous.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/backup.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/cadence.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/classifier.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/cleanup.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/cli.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/completions.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/costs.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/done_signal.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/envelope.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/executor.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/handoff.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/hermes.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/hermes_bootstrap.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/hermes_desktop.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/learning.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/managed_agent.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/memory.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/menu.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/mission.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/plan.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/project.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/prompts.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/provider.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/prune.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/pursue.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/reducer.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/router.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/skill_routing.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/smoke.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/store.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/sync.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/telegram_history.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/tmux.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/tools.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/understand_anything.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/updater.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/validate.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/vault.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/webhooks.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/worker.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/account.py +502 -0
- package/omega/Agentik_Engine/omega_engine/agent_messages.py +167 -0
- package/omega/Agentik_Engine/omega_engine/aisb_chat.py +128 -0
- package/omega/Agentik_Engine/omega_engine/audit_diff.py +99 -0
- package/omega/Agentik_Engine/omega_engine/audit_gate.py +149 -0
- package/omega/Agentik_Engine/omega_engine/audits/__init__.py +60 -0
- package/omega/Agentik_Engine/omega_engine/audits/__pycache__/__init__.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/audits/__pycache__/batcher.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/audits/__pycache__/dispatcher.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/audits/__pycache__/generator.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/audits/__pycache__/history.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/audits/__pycache__/pipeline.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/audits/batcher.py +218 -0
- package/omega/Agentik_Engine/omega_engine/audits/dispatcher.py +92 -0
- package/omega/Agentik_Engine/omega_engine/audits/generator.py +234 -0
- package/omega/Agentik_Engine/omega_engine/audits/history.py +168 -0
- package/omega/Agentik_Engine/omega_engine/audits/pipeline.py +198 -0
- package/omega/Agentik_Engine/omega_engine/auto_update.py +339 -0
- package/omega/Agentik_Engine/omega_engine/autonomous.py +538 -0
- package/omega/Agentik_Engine/omega_engine/backup.py +215 -0
- package/omega/Agentik_Engine/omega_engine/cadence.py +158 -0
- package/omega/Agentik_Engine/omega_engine/classifier.py +215 -0
- package/omega/Agentik_Engine/omega_engine/cleanup.py +673 -0
- package/omega/Agentik_Engine/omega_engine/cli.py +4564 -56
- package/omega/Agentik_Engine/omega_engine/completions.py +260 -0
- package/omega/Agentik_Engine/omega_engine/costs.py +100 -0
- package/omega/Agentik_Engine/omega_engine/daemons/__init__.py +14 -0
- package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/__init__.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/autonomous.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/engine.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/telegram.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/daemons/autonomous.py +56 -0
- package/omega/Agentik_Engine/omega_engine/daemons/engine.py +236 -0
- package/omega/Agentik_Engine/omega_engine/daemons/telegram.py +315 -0
- package/omega/Agentik_Engine/omega_engine/done_signal.py +154 -0
- package/omega/Agentik_Engine/omega_engine/educators/__init__.py +51 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/__init__.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/artifact.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/automation.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/base.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/claudecode.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/connection.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/coworker.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/loop.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/prompt.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/skill.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/artifact.py +65 -0
- package/omega/Agentik_Engine/omega_engine/educators/automation.py +76 -0
- package/omega/Agentik_Engine/omega_engine/educators/base.py +327 -0
- package/omega/Agentik_Engine/omega_engine/educators/claudecode.py +71 -0
- package/omega/Agentik_Engine/omega_engine/educators/connection.py +75 -0
- package/omega/Agentik_Engine/omega_engine/educators/coworker.py +68 -0
- package/omega/Agentik_Engine/omega_engine/educators/loop.py +82 -0
- package/omega/Agentik_Engine/omega_engine/educators/prompt.py +68 -0
- package/omega/Agentik_Engine/omega_engine/educators/skill.py +69 -0
- package/omega/Agentik_Engine/omega_engine/envelope.py +219 -0
- package/omega/Agentik_Engine/omega_engine/executor.py +195 -16
- package/omega/Agentik_Engine/omega_engine/genesis/__init__.py +134 -0
- package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/__init__.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/orchestrator.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/phases.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/stack.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/state.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/genesis/orchestrator.py +262 -0
- package/omega/Agentik_Engine/omega_engine/genesis/phases.py +950 -0
- package/omega/Agentik_Engine/omega_engine/genesis/stack.py +324 -0
- package/omega/Agentik_Engine/omega_engine/genesis/state.py +353 -0
- package/omega/Agentik_Engine/omega_engine/handoff.py +459 -0
- package/omega/Agentik_Engine/omega_engine/hermes.py +426 -0
- package/omega/Agentik_Engine/omega_engine/hermes_bootstrap.py +382 -0
- package/omega/Agentik_Engine/omega_engine/hermes_desktop.py +469 -0
- package/omega/Agentik_Engine/omega_engine/integrations/__init__.py +30 -0
- package/omega/Agentik_Engine/omega_engine/integrations/__pycache__/__init__.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/integrations/__pycache__/graphify.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/integrations/graphify.py +234 -0
- package/omega/Agentik_Engine/omega_engine/learning.py +268 -0
- package/omega/Agentik_Engine/omega_engine/managed_agent.py +467 -0
- package/omega/Agentik_Engine/omega_engine/memory.py +271 -0
- package/omega/Agentik_Engine/omega_engine/menu.py +1065 -0
- package/omega/Agentik_Engine/omega_engine/migrations/__init__.py +144 -0
- package/omega/Agentik_Engine/omega_engine/migrations/__pycache__/__init__.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/migrations/__pycache__/v0_14_0.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/migrations/v0_14_0.py +29 -0
- package/omega/Agentik_Engine/omega_engine/mission.py +29 -14
- package/omega/Agentik_Engine/omega_engine/plan.py +846 -0
- package/omega/Agentik_Engine/omega_engine/prompts.py +158 -0
- package/omega/Agentik_Engine/omega_engine/provider.py +408 -13
- package/omega/Agentik_Engine/omega_engine/prune.py +151 -0
- package/omega/Agentik_Engine/omega_engine/pursue.py +205 -0
- package/omega/Agentik_Engine/omega_engine/rag/__init__.py +21 -0
- package/omega/Agentik_Engine/omega_engine/rag/__pycache__/__init__.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/rag/__pycache__/agentic.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/rag/__pycache__/base.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/rag/__pycache__/corrective.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/rag/__pycache__/graph.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/rag/__pycache__/hybrid.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/rag/__pycache__/multimodal.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/rag/__pycache__/router.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/rag/agentic.py +83 -0
- package/omega/Agentik_Engine/omega_engine/rag/base.py +42 -0
- package/omega/Agentik_Engine/omega_engine/rag/corrective.py +119 -0
- package/omega/Agentik_Engine/omega_engine/rag/graph.py +169 -0
- package/omega/Agentik_Engine/omega_engine/rag/hybrid.py +205 -0
- package/omega/Agentik_Engine/omega_engine/rag/multimodal.py +136 -0
- package/omega/Agentik_Engine/omega_engine/rag/router.py +110 -0
- package/omega/Agentik_Engine/omega_engine/reducer.py +21 -3
- package/omega/Agentik_Engine/omega_engine/router.py +28 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/__init__.py +48 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/__init__.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/auditor.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/finder.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/installer.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/marketplaces.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/auditor.py +232 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/finder.py +94 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/installer.py +129 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/marketplaces.py +80 -0
- package/omega/Agentik_Engine/omega_engine/skill_routing.py +388 -0
- package/omega/Agentik_Engine/omega_engine/smoke.py +81 -0
- package/omega/Agentik_Engine/omega_engine/store.py +132 -25
- package/omega/Agentik_Engine/omega_engine/sync.py +445 -0
- package/omega/Agentik_Engine/omega_engine/telegram_history.py +260 -0
- package/omega/Agentik_Engine/omega_engine/tmux.py +526 -0
- package/omega/Agentik_Engine/omega_engine/tools.py +272 -0
- package/omega/Agentik_Engine/omega_engine/understand_anything.py +275 -0
- package/omega/Agentik_Engine/omega_engine/updater.py +70 -0
- package/omega/Agentik_Engine/omega_engine/validate.py +186 -0
- package/omega/Agentik_Engine/omega_engine/vault.py +342 -0
- package/omega/Agentik_Engine/omega_engine/webhooks.py +262 -0
- package/omega/Agentik_Engine/omega_engine/worker.py +526 -0
- package/omega/Agentik_Engine/pyproject.toml +1 -1
- package/omega/Agentik_Engine/tests/__pycache__/test_account.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_account.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_adversarial.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_adversarial.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_agents_envelope.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_agents_envelope.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_audit_arsenal.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_audits_pipeline.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_audits_pipeline.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_auto_update_and_migrations.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_auto_update_and_migrations.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_autonomous.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_autonomous.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_educators.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_educators.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_executor.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_genesis_and_plan.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_genesis_and_plan.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_graphify.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_graphify.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_handoff.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_handoff.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_hermes_and_ua.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_hermes_and_ua.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_hermes_bootstrap_and_desktop.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_hermes_bootstrap_and_desktop.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_install_steps.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_install_steps.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_install_ux.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_install_ux.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_installer_wiring.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_installer_wiring.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_intelligence.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_intelligence.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_llm_clis_and_uninstall.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_llm_clis_and_uninstall.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_managed_agent.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_managed_agent.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_max_provider_and_menu.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_max_provider_and_menu.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_menu_coverage.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_menu_coverage.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_mission.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_progress.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_project.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_pursue_cadence.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_pursue_cadence.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_rag.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_rag.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_reducer.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_report.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_role_aliases_and_ssot.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_role_aliases_and_ssot.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_skill_discovery_and_gate.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_skill_discovery_and_gate.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_skill_power.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_skill_power.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_skill_routing.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_skill_routing.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_snapshot_partial.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_snapshot_partial.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_telegram_history.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_telegram_history.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_tmux_and_aisb_chat.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_tmux_and_aisb_chat.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_tools_and_sync.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_tools_and_sync.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_v06_features.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_v06_features.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_vault.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_vault.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_webhooks_and_readiness.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_webhooks_and_readiness.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_worker_and_cleanup.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_worker_and_cleanup.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/test_account.py +338 -0
- package/omega/Agentik_Engine/tests/test_adversarial.py +351 -0
- package/omega/Agentik_Engine/tests/test_agents_envelope.py +274 -0
- package/omega/Agentik_Engine/tests/test_audits_pipeline.py +348 -0
- package/omega/Agentik_Engine/tests/test_auto_update_and_migrations.py +394 -0
- package/omega/Agentik_Engine/tests/test_autonomous.py +361 -0
- package/omega/Agentik_Engine/tests/test_educators.py +233 -0
- package/omega/Agentik_Engine/tests/test_genesis_and_plan.py +573 -0
- package/omega/Agentik_Engine/tests/test_graphify.py +190 -0
- package/omega/Agentik_Engine/tests/test_handoff.py +311 -0
- package/omega/Agentik_Engine/tests/test_hermes_and_ua.py +387 -0
- package/omega/Agentik_Engine/tests/test_hermes_bootstrap_and_desktop.py +358 -0
- package/omega/Agentik_Engine/tests/test_install_steps.py +359 -0
- package/omega/Agentik_Engine/tests/test_install_ux.py +151 -0
- package/omega/Agentik_Engine/tests/test_installer_wiring.py +496 -0
- package/omega/Agentik_Engine/tests/test_intelligence.py +285 -0
- package/omega/Agentik_Engine/tests/test_llm_clis_and_uninstall.py +228 -0
- package/omega/Agentik_Engine/tests/test_managed_agent.py +363 -0
- package/omega/Agentik_Engine/tests/test_max_provider_and_menu.py +231 -0
- package/omega/Agentik_Engine/tests/test_menu_coverage.py +72 -0
- package/omega/Agentik_Engine/tests/test_pursue_cadence.py +217 -0
- package/omega/Agentik_Engine/tests/test_rag.py +287 -0
- package/omega/Agentik_Engine/tests/test_role_aliases_and_ssot.py +207 -0
- package/omega/Agentik_Engine/tests/test_skill_discovery_and_gate.py +337 -0
- package/omega/Agentik_Engine/tests/test_skill_power.py +259 -0
- package/omega/Agentik_Engine/tests/test_skill_routing.py +189 -0
- package/omega/Agentik_Engine/tests/test_snapshot_partial.py +172 -0
- package/omega/Agentik_Engine/tests/test_telegram_history.py +209 -0
- package/omega/Agentik_Engine/tests/test_tmux_and_aisb_chat.py +223 -0
- package/omega/Agentik_Engine/tests/test_tools_and_sync.py +312 -0
- package/omega/Agentik_Engine/tests/test_v06_features.py +370 -0
- package/omega/Agentik_Engine/tests/test_vault.py +173 -0
- package/omega/Agentik_Engine/tests/test_webhooks_and_readiness.py +277 -0
- package/omega/Agentik_Engine/tests/test_worker_and_cleanup.py +541 -0
- package/omega/Agentik_Extra/etc/secrets/.vault-key +3 -0
- package/omega/Agentik_Extra/etc/secrets/.vault-pub +1 -0
- package/omega/Agentik_Runtime/audits.db +0 -0
- package/omega/Agentik_SSOT/VERSION +1 -1
- package/omega/Agentik_SSOT/claude-plugins/claude-plugins.yaml +100 -0
- package/omega/Agentik_SSOT/docs/LAYERS.md +90 -0
- package/omega/Agentik_SSOT/docs/USER-JOURNEY.md +283 -0
- package/omega/Agentik_SSOT/marketplaces/design-discipline.yaml +86 -0
- package/omega/Agentik_SSOT/skills/a11yaudit/SKILL.md +161 -0
- package/omega/Agentik_SSOT/skills/apiaudit/SKILL.md +157 -0
- package/omega/Agentik_SSOT/skills/automationaudit/SKILL.md +161 -0
- package/omega/Agentik_SSOT/skills/cadence/SKILL.md +76 -0
- package/omega/Agentik_SSOT/skills/codeaudit/SKILL.md +153 -0
- package/omega/Agentik_SSOT/skills/copyaudit/SKILL.md +161 -0
- package/omega/Agentik_SSOT/skills/dataaudit/SKILL.md +157 -0
- package/omega/Agentik_SSOT/skills/debugaudit/SKILL.md +161 -0
- package/omega/Agentik_SSOT/skills/dispatch/SKILL.md +79 -0
- package/omega/Agentik_SSOT/skills/dxaudit/SKILL.md +161 -0
- package/omega/Agentik_SSOT/skills/featureaudit/SKILL.md +161 -0
- package/omega/Agentik_SSOT/skills/flowaudit/SKILL.md +165 -0
- package/omega/Agentik_SSOT/skills/genesis/SKILL.md +116 -0
- package/omega/Agentik_SSOT/skills/handoff/SKILL.md +117 -0
- package/omega/Agentik_SSOT/skills/logicaudit/SKILL.md +165 -0
- package/omega/Agentik_SSOT/skills/motionaudit/SKILL.md +165 -0
- package/omega/Agentik_SSOT/skills/perfaudit/SKILL.md +161 -0
- package/omega/Agentik_SSOT/skills/plan/SKILL.md +127 -0
- package/omega/Agentik_SSOT/skills/pursue/SKILL.md +68 -0
- package/omega/Agentik_SSOT/skills/rag-route.md +82 -0
- package/omega/Agentik_SSOT/skills/refontaudit/SKILL.md +165 -0
- package/omega/Agentik_SSOT/skills/retentionaudit/SKILL.md +165 -0
- package/omega/Agentik_SSOT/skills/secaudit/SKILL.md +157 -0
- package/omega/Agentik_SSOT/skills/seoaudit/SKILL.md +161 -0
- package/omega/Agentik_SSOT/skills/skill-auditor/SKILL.md +83 -0
- package/omega/Agentik_SSOT/skills/skill-finder/SKILL.md +116 -0
- package/omega/Agentik_SSOT/skills/uiuxaudit/SKILL.md +165 -0
- package/package.json +2 -2
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
"""Tests for the audit pipeline + batcher + history + generator.
|
|
2
|
+
|
|
3
|
+
This is the "100% mega powerful audit" layer: smart batching of findings,
|
|
4
|
+
capped fix-worker dispatch, re-audit with score comparison, persistent
|
|
5
|
+
history. Each test exercises one piece in isolation; the integration test
|
|
6
|
+
at the end runs the full pipeline end-to-end against a registered audit.
|
|
7
|
+
|
|
8
|
+
We use the MockProvider (returns a structured forensic verdict) and a
|
|
9
|
+
synthetic audit registered in a temp tree, so the whole suite runs with
|
|
10
|
+
no network and no real linter binaries.
|
|
11
|
+
"""
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import os
|
|
15
|
+
import sys
|
|
16
|
+
import tempfile
|
|
17
|
+
import unittest
|
|
18
|
+
from pathlib import Path
|
|
19
|
+
|
|
20
|
+
import yaml
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
HERE = Path(__file__).resolve().parent
|
|
24
|
+
sys.path.insert(0, str(HERE.parent))
|
|
25
|
+
|
|
26
|
+
from omega_engine.audit_arsenal import ( # noqa: E402
|
|
27
|
+
ArsenalFinding,
|
|
28
|
+
AuditRegistry,
|
|
29
|
+
)
|
|
30
|
+
from omega_engine.audits import ( # noqa: E402
|
|
31
|
+
AuditPipeline,
|
|
32
|
+
Batch,
|
|
33
|
+
Finding,
|
|
34
|
+
batch_findings,
|
|
35
|
+
)
|
|
36
|
+
from omega_engine.audits.dispatcher import dispatch_fixes # noqa: E402
|
|
37
|
+
from omega_engine.audits.generator import ( # noqa: E402
|
|
38
|
+
generate_skill,
|
|
39
|
+
write_all,
|
|
40
|
+
)
|
|
41
|
+
from omega_engine.audits.history import ( # noqa: E402
|
|
42
|
+
AuditRun,
|
|
43
|
+
latest_score,
|
|
44
|
+
list_runs,
|
|
45
|
+
make_run_id,
|
|
46
|
+
now,
|
|
47
|
+
record_run,
|
|
48
|
+
trend,
|
|
49
|
+
)
|
|
50
|
+
from omega_engine.provider import MockProvider # noqa: E402
|
|
51
|
+
from omega_engine.router import ModelRouter # noqa: E402
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
# ---------------------------------------------------------------------------
|
|
55
|
+
# Batcher
|
|
56
|
+
# ---------------------------------------------------------------------------
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class TestBatcher(unittest.TestCase):
|
|
60
|
+
def test_groups_by_file_into_disjoint_batches(self):
|
|
61
|
+
findings = [
|
|
62
|
+
Finding(audit="x", phase="p", severity="high",
|
|
63
|
+
file="a.py", line=10, message="bug A"),
|
|
64
|
+
Finding(audit="x", phase="p", severity="medium",
|
|
65
|
+
file="a.py", line=22, message="bug A2"),
|
|
66
|
+
Finding(audit="x", phase="p", severity="critical",
|
|
67
|
+
file="b.py", line=5, message="bug B"),
|
|
68
|
+
Finding(audit="x", phase="p", severity="low",
|
|
69
|
+
file="c.py", line=1, message="nit"),
|
|
70
|
+
]
|
|
71
|
+
plan = batch_findings(findings, max_batches=3)
|
|
72
|
+
# No file appears in two different batches.
|
|
73
|
+
files_per_batch = [set(b.files) for b in plan.batches]
|
|
74
|
+
for i, fs in enumerate(files_per_batch):
|
|
75
|
+
for fs2 in files_per_batch[i + 1:]:
|
|
76
|
+
self.assertEqual(fs & fs2, set(), msg=f"{fs} ∩ {fs2}")
|
|
77
|
+
# Every finding ends up in some batch.
|
|
78
|
+
total = sum(len(b.findings) for b in plan.batches)
|
|
79
|
+
self.assertEqual(total, len(findings))
|
|
80
|
+
|
|
81
|
+
def test_min_severity_filters_low(self):
|
|
82
|
+
findings = [
|
|
83
|
+
Finding(audit="x", phase="p", severity="low",
|
|
84
|
+
file="a.py", line=1, message="nit"),
|
|
85
|
+
Finding(audit="x", phase="p", severity="high",
|
|
86
|
+
file="b.py", line=1, message="real"),
|
|
87
|
+
]
|
|
88
|
+
plan = batch_findings(findings, min_severity="high")
|
|
89
|
+
all_findings = [f for b in plan.batches for f in b.findings]
|
|
90
|
+
self.assertEqual(len(all_findings), 1)
|
|
91
|
+
self.assertEqual(all_findings[0].file, "b.py")
|
|
92
|
+
|
|
93
|
+
def test_global_findings_go_into_one_batch(self):
|
|
94
|
+
findings = [
|
|
95
|
+
Finding(audit="x", phase="arch", severity="high",
|
|
96
|
+
file=None, line=None, message="architectural"),
|
|
97
|
+
Finding(audit="x", phase="arch", severity="medium",
|
|
98
|
+
file=None, line=None, message="another"),
|
|
99
|
+
]
|
|
100
|
+
plan = batch_findings(findings)
|
|
101
|
+
non_empty = [b for b in plan.batches if b.findings]
|
|
102
|
+
self.assertEqual(len(non_empty), 1)
|
|
103
|
+
self.assertEqual(len(non_empty[0].findings), 2)
|
|
104
|
+
|
|
105
|
+
def test_from_arsenal_finding(self):
|
|
106
|
+
af = ArsenalFinding(
|
|
107
|
+
audit="codeaudit", phase="phantoms", severity="high",
|
|
108
|
+
location="src/util.py:42",
|
|
109
|
+
claim="returns user id", reality="returns None",
|
|
110
|
+
)
|
|
111
|
+
f = Finding.from_arsenal(af)
|
|
112
|
+
self.assertEqual(f.file, "src/util.py")
|
|
113
|
+
self.assertEqual(f.line, 42)
|
|
114
|
+
self.assertEqual(f.audit, "codeaudit")
|
|
115
|
+
|
|
116
|
+
def test_batch_intent_renders_findings(self):
|
|
117
|
+
batch = Batch(
|
|
118
|
+
id="b1",
|
|
119
|
+
findings=[
|
|
120
|
+
Finding(audit="x", phase="p", severity="high",
|
|
121
|
+
file="a.py", line=10, message="bug A"),
|
|
122
|
+
Finding(audit="x", phase="p", severity="medium",
|
|
123
|
+
file="a.py", line=22, message="bug A2"),
|
|
124
|
+
],
|
|
125
|
+
files=["a.py"],
|
|
126
|
+
)
|
|
127
|
+
intent = batch.to_intent("codeaudit")
|
|
128
|
+
self.assertIn("codeaudit", intent)
|
|
129
|
+
self.assertIn("a.py:10", intent)
|
|
130
|
+
self.assertIn("bug A", intent)
|
|
131
|
+
self.assertIn("a.py", intent)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
# ---------------------------------------------------------------------------
|
|
135
|
+
# History
|
|
136
|
+
# ---------------------------------------------------------------------------
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
class TestHistory(unittest.TestCase):
|
|
140
|
+
def test_round_trip(self):
|
|
141
|
+
with tempfile.TemporaryDirectory() as td:
|
|
142
|
+
run = AuditRun(
|
|
143
|
+
run_id="ar-test1", audit_id="codeaudit", scope=".",
|
|
144
|
+
timestamp=now(), score=88, verified=True,
|
|
145
|
+
finding_count=2, fix_workers_dispatched=1, reaudit_score=92,
|
|
146
|
+
verdict={"findings": [], "score": 88},
|
|
147
|
+
)
|
|
148
|
+
record_run(td, run)
|
|
149
|
+
runs = list_runs(td, audit_id="codeaudit")
|
|
150
|
+
self.assertEqual(len(runs), 1)
|
|
151
|
+
self.assertEqual(runs[0].score, 88)
|
|
152
|
+
self.assertEqual(runs[0].reaudit_score, 92)
|
|
153
|
+
self.assertTrue(runs[0].verified)
|
|
154
|
+
|
|
155
|
+
def test_latest_score(self):
|
|
156
|
+
with tempfile.TemporaryDirectory() as td:
|
|
157
|
+
base = now()
|
|
158
|
+
for i, s in enumerate((70, 80, 90)):
|
|
159
|
+
record_run(td, AuditRun(
|
|
160
|
+
run_id=make_run_id(), audit_id="codeaudit",
|
|
161
|
+
scope=".", timestamp=base + i, score=s,
|
|
162
|
+
verified=s >= 85, finding_count=0,
|
|
163
|
+
verdict={"score": s},
|
|
164
|
+
))
|
|
165
|
+
self.assertEqual(latest_score(td, "codeaudit"), 90)
|
|
166
|
+
|
|
167
|
+
def test_trend_detects_improvement(self):
|
|
168
|
+
with tempfile.TemporaryDirectory() as td:
|
|
169
|
+
for i, s in enumerate((60, 65, 75, 88, 90)):
|
|
170
|
+
record_run(td, AuditRun(
|
|
171
|
+
run_id=f"ar-{i}", audit_id="codeaudit",
|
|
172
|
+
scope=".", timestamp=now() + i, score=s,
|
|
173
|
+
verified=False, finding_count=0,
|
|
174
|
+
verdict={"score": s},
|
|
175
|
+
))
|
|
176
|
+
self.assertEqual(trend(td, "codeaudit"), "↑")
|
|
177
|
+
|
|
178
|
+
def test_trend_detects_degradation(self):
|
|
179
|
+
with tempfile.TemporaryDirectory() as td:
|
|
180
|
+
for i, s in enumerate((90, 80, 70, 60, 50)):
|
|
181
|
+
record_run(td, AuditRun(
|
|
182
|
+
run_id=f"ar-{i}", audit_id="codeaudit",
|
|
183
|
+
scope=".", timestamp=now() + i, score=s,
|
|
184
|
+
verified=False, finding_count=0,
|
|
185
|
+
verdict={"score": s},
|
|
186
|
+
))
|
|
187
|
+
self.assertEqual(trend(td, "codeaudit"), "↓")
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
# ---------------------------------------------------------------------------
|
|
191
|
+
# Dispatcher
|
|
192
|
+
# ---------------------------------------------------------------------------
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
class TestDispatcher(unittest.TestCase):
|
|
196
|
+
def test_dispatch_dry_run_returns_intent_without_executor(self):
|
|
197
|
+
from omega_engine.audits.batcher import BatchPlan
|
|
198
|
+
plan = BatchPlan(batches=[
|
|
199
|
+
Batch(
|
|
200
|
+
id="b1",
|
|
201
|
+
findings=[Finding(audit="x", phase="p", severity="high",
|
|
202
|
+
file="a.py", line=1, message="m")],
|
|
203
|
+
files=["a.py"],
|
|
204
|
+
),
|
|
205
|
+
], audit_id="codeaudit")
|
|
206
|
+
results = dispatch_fixes(plan, audit_id="codeaudit", dry_run=True)
|
|
207
|
+
self.assertEqual(len(results), 1)
|
|
208
|
+
self.assertEqual(results[0].status, "skipped")
|
|
209
|
+
self.assertIn("a.py", results[0].intent)
|
|
210
|
+
|
|
211
|
+
def test_dispatch_with_executor_runs_each_batch(self):
|
|
212
|
+
from omega_engine.audits.batcher import BatchPlan
|
|
213
|
+
|
|
214
|
+
class _FakeOutcome:
|
|
215
|
+
mission_id = "m-test1"
|
|
216
|
+
final_state = type("S", (), {"value": "completed"})()
|
|
217
|
+
verified = True
|
|
218
|
+
|
|
219
|
+
class _FakeExecutor:
|
|
220
|
+
def __init__(self): self.calls: list[str] = []
|
|
221
|
+
def run_mission(self, intent, root_role="oracle"):
|
|
222
|
+
self.calls.append(intent)
|
|
223
|
+
return _FakeOutcome()
|
|
224
|
+
|
|
225
|
+
plan = BatchPlan(batches=[
|
|
226
|
+
Batch(id="b1", findings=[Finding(
|
|
227
|
+
audit="x", phase="p", severity="high",
|
|
228
|
+
file="a.py", line=1, message="m1",
|
|
229
|
+
)], files=["a.py"]),
|
|
230
|
+
Batch(id="b2", findings=[Finding(
|
|
231
|
+
audit="x", phase="p", severity="critical",
|
|
232
|
+
file="b.py", line=1, message="m2",
|
|
233
|
+
)], files=["b.py"]),
|
|
234
|
+
], audit_id="codeaudit")
|
|
235
|
+
ex = _FakeExecutor()
|
|
236
|
+
results = dispatch_fixes(plan, audit_id="codeaudit", executor=ex)
|
|
237
|
+
self.assertEqual(len(results), 2)
|
|
238
|
+
self.assertEqual(len(ex.calls), 2)
|
|
239
|
+
for r in results:
|
|
240
|
+
self.assertEqual(r.status, "dispatched")
|
|
241
|
+
self.assertEqual(r.mission_id, "m-test1")
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
# ---------------------------------------------------------------------------
|
|
245
|
+
# Generator
|
|
246
|
+
# ---------------------------------------------------------------------------
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
class TestGenerator(unittest.TestCase):
|
|
250
|
+
def test_generate_skill_produces_valid_frontmatter(self):
|
|
251
|
+
with tempfile.TemporaryDirectory() as td:
|
|
252
|
+
audits_dir = Path(td) / "Agentik_SSOT" / "audits"
|
|
253
|
+
audits_dir.mkdir(parents=True)
|
|
254
|
+
(audits_dir / "test.yaml").write_text(yaml.safe_dump({
|
|
255
|
+
"id": "testaudit",
|
|
256
|
+
"domain": "test",
|
|
257
|
+
"question": "Does it work?",
|
|
258
|
+
"threshold": 80,
|
|
259
|
+
"phases": [
|
|
260
|
+
{"id": "p1", "checks": "Check one thing"},
|
|
261
|
+
{"id": "p2", "checks": "Check another"},
|
|
262
|
+
],
|
|
263
|
+
"falsification": "Bias toward FAIL.",
|
|
264
|
+
}))
|
|
265
|
+
sf = generate_skill(audits_dir / "test.yaml")
|
|
266
|
+
self.assertEqual(sf.audit_id, "testaudit")
|
|
267
|
+
self.assertIn("name: testaudit", sf.body)
|
|
268
|
+
self.assertIn("Does it work?", sf.body)
|
|
269
|
+
self.assertIn("p1", sf.body)
|
|
270
|
+
self.assertIn("Bias toward FAIL", sf.body)
|
|
271
|
+
# Frontmatter is valid YAML between the leading --- markers.
|
|
272
|
+
parts = sf.body.split("---", 2)
|
|
273
|
+
self.assertGreaterEqual(len(parts), 3)
|
|
274
|
+
fm = yaml.safe_load(parts[1])
|
|
275
|
+
self.assertEqual(fm["name"], "testaudit")
|
|
276
|
+
self.assertIn("Bash", fm["allowed-tools"])
|
|
277
|
+
|
|
278
|
+
def test_write_all_creates_skills_dir(self):
|
|
279
|
+
with tempfile.TemporaryDirectory() as td:
|
|
280
|
+
ssot = Path(td) / "Agentik_SSOT"
|
|
281
|
+
audits = ssot / "audits"; audits.mkdir(parents=True)
|
|
282
|
+
(audits / "a.yaml").write_text(yaml.safe_dump({
|
|
283
|
+
"id": "a", "domain": "code", "question": "q?",
|
|
284
|
+
"phases": [{"id": "x", "checks": "y"}],
|
|
285
|
+
}))
|
|
286
|
+
(audits / "b.yaml").write_text(yaml.safe_dump({
|
|
287
|
+
"id": "b", "domain": "ui", "question": "q?",
|
|
288
|
+
"phases": [{"id": "x", "checks": "y"}],
|
|
289
|
+
}))
|
|
290
|
+
result = write_all(audits)
|
|
291
|
+
self.assertEqual(result["written"], 2)
|
|
292
|
+
self.assertTrue((ssot / "skills" / "a" / "SKILL.md").exists())
|
|
293
|
+
self.assertTrue((ssot / "skills" / "b" / "SKILL.md").exists())
|
|
294
|
+
# Re-running is idempotent.
|
|
295
|
+
result2 = write_all(audits)
|
|
296
|
+
self.assertEqual(result2["written"], 0)
|
|
297
|
+
self.assertEqual(result2["skipped"], 2)
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
# ---------------------------------------------------------------------------
|
|
301
|
+
# Pipeline integration
|
|
302
|
+
# ---------------------------------------------------------------------------
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
def _seed_audit(home: Path) -> AuditRegistry:
|
|
306
|
+
audits = home / "Agentik_SSOT" / "audits"
|
|
307
|
+
audits.mkdir(parents=True, exist_ok=True)
|
|
308
|
+
(audits / "demoaudit.yaml").write_text(yaml.safe_dump({
|
|
309
|
+
"id": "demoaudit",
|
|
310
|
+
"domain": "demo",
|
|
311
|
+
"question": "Is the demo solid?",
|
|
312
|
+
"weight": 1.0,
|
|
313
|
+
"threshold": 85,
|
|
314
|
+
"applies_to": {"roles": ["worker"], "changed": ["*"]},
|
|
315
|
+
"gather": [],
|
|
316
|
+
"phases": [{"id": "claims", "checks": "Every label is a promise."}],
|
|
317
|
+
"falsification": "Bias toward FAIL.",
|
|
318
|
+
}))
|
|
319
|
+
return AuditRegistry.load(audits)
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
class TestPipelineReadOnly(unittest.TestCase):
|
|
323
|
+
def test_pipeline_records_history(self):
|
|
324
|
+
with tempfile.TemporaryDirectory() as td:
|
|
325
|
+
home = Path(td)
|
|
326
|
+
registry = _seed_audit(home)
|
|
327
|
+
router = ModelRouter.single(MockProvider())
|
|
328
|
+
pipeline = AuditPipeline(registry, router, omega_home=home)
|
|
329
|
+
outcome = pipeline.run("demoaudit", scope=str(home), read_only=True)
|
|
330
|
+
self.assertEqual(outcome.audit_id, "demoaudit")
|
|
331
|
+
self.assertTrue(outcome.verdict.verified)
|
|
332
|
+
# History row was persisted.
|
|
333
|
+
runs = list_runs(home, audit_id="demoaudit")
|
|
334
|
+
self.assertEqual(len(runs), 1)
|
|
335
|
+
self.assertEqual(runs[0].run_id, outcome.run_id)
|
|
336
|
+
|
|
337
|
+
def test_pipeline_unknown_audit_raises(self):
|
|
338
|
+
with tempfile.TemporaryDirectory() as td:
|
|
339
|
+
home = Path(td)
|
|
340
|
+
registry = _seed_audit(home)
|
|
341
|
+
router = ModelRouter.single(MockProvider())
|
|
342
|
+
pipeline = AuditPipeline(registry, router, omega_home=home)
|
|
343
|
+
with self.assertRaises(KeyError):
|
|
344
|
+
pipeline.run("doesnotexist", scope=str(home))
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
if __name__ == "__main__":
|
|
348
|
+
unittest.main(verbosity=2)
|