@agentikos/omega-os 0.2.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 +33 -3
- 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 +790 -21
- package/bootstrap/manifest.example.yaml +87 -1
- 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/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 +4 -2
- package/omega/Agentik_Engine/omega_engine/__init__.py +147 -1
- 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.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/audit_arsenal.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__/barrier.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/bus.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__/events.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__/progress.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__/report.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__/supervisor.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__/task.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/telegram.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 +28 -31
- 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/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 +4156 -86
- 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/__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/engine.py +53 -4
- package/omega/Agentik_Engine/omega_engine/daemons/telegram.py +101 -17
- package/omega/Agentik_Engine/omega_engine/done_signal.py +154 -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/envelope.py +219 -0
- package/omega/Agentik_Engine/omega_engine/executor.py +149 -10
- 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 +16 -13
- 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 +161 -12
- 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/__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/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 +88 -41
- package/omega/Agentik_Engine/omega_engine/sync.py +142 -1
- 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/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_audit_arsenal.cpython-313.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_executor.cpython-313.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_mission.cpython-313.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_progress.cpython-313.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_project.cpython-313.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_reducer.cpython-313.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_report.cpython-313.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 +8 -3
- 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_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_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_telegram_history.py +209 -0
- package/omega/Agentik_Engine/tests/test_tmux_and_aisb_chat.py +223 -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 +9 -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,274 @@
|
|
|
1
|
+
"""Tests for the AISB agent suite plumbing.
|
|
2
|
+
|
|
3
|
+
Three things to exercise:
|
|
4
|
+
|
|
5
|
+
1. ``omega_engine.prompts.load_agent_prompt`` reads the right file, strips
|
|
6
|
+
YAML frontmatter, and appends LMC + shared protocols when present.
|
|
7
|
+
2. ``omega_engine.envelope.build_envelope`` produces a ``{system, user}``
|
|
8
|
+
pair: the system holds the agent prompt + the right orchestration
|
|
9
|
+
contract; the user holds the verbatim intent + structured context.
|
|
10
|
+
3. ``omega_engine.done_signal`` round-trips a worker's completion JSON,
|
|
11
|
+
rejects invalid statuses, and lets the verifier attach an audit.
|
|
12
|
+
"""
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import json
|
|
16
|
+
import sys
|
|
17
|
+
import tempfile
|
|
18
|
+
import unittest
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
HERE = Path(__file__).resolve().parent
|
|
23
|
+
sys.path.insert(0, str(HERE.parent))
|
|
24
|
+
|
|
25
|
+
from omega_engine.done_signal import ( # noqa: E402
|
|
26
|
+
DoneSignal,
|
|
27
|
+
DoneSignalError,
|
|
28
|
+
attach_audit_to_done,
|
|
29
|
+
read_done,
|
|
30
|
+
write_done,
|
|
31
|
+
)
|
|
32
|
+
from omega_engine.envelope import ( # noqa: E402
|
|
33
|
+
DISPATCHER_ROLES,
|
|
34
|
+
EXECUTOR_ROLES,
|
|
35
|
+
EnvelopeContext,
|
|
36
|
+
VERIFIER_ROLES,
|
|
37
|
+
build_envelope,
|
|
38
|
+
)
|
|
39
|
+
from omega_engine.prompts import ( # noqa: E402
|
|
40
|
+
clear_cache,
|
|
41
|
+
find_agent_file,
|
|
42
|
+
list_available_agents,
|
|
43
|
+
load_agent_prompt,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _seed_aisb(home: Path, role: str, body: str, *,
|
|
48
|
+
with_lmc: bool = False) -> None:
|
|
49
|
+
suite = home / "Agentik_SSOT" / "agents" / "aisb"
|
|
50
|
+
suite.mkdir(parents=True, exist_ok=True)
|
|
51
|
+
(suite / f"{role}.md").write_text(body)
|
|
52
|
+
if with_lmc:
|
|
53
|
+
(suite / "lmc-protocol.md").write_text(
|
|
54
|
+
"## LMC PROTOCOL\n\nLead → Manager → Checker."
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class TestPrompts(unittest.TestCase):
|
|
59
|
+
def setUp(self):
|
|
60
|
+
clear_cache()
|
|
61
|
+
|
|
62
|
+
def test_load_returns_none_when_no_file(self):
|
|
63
|
+
with tempfile.TemporaryDirectory() as td:
|
|
64
|
+
self.assertIsNone(load_agent_prompt(td, "oracle"))
|
|
65
|
+
|
|
66
|
+
def test_load_strips_yaml_frontmatter(self):
|
|
67
|
+
with tempfile.TemporaryDirectory() as td:
|
|
68
|
+
home = Path(td)
|
|
69
|
+
_seed_aisb(home, "oracle",
|
|
70
|
+
"---\nname: oracle\n---\n# ORACLE\n\nI orchestrate.")
|
|
71
|
+
text = load_agent_prompt(home, "oracle")
|
|
72
|
+
self.assertIsNotNone(text)
|
|
73
|
+
self.assertNotIn("---", text)
|
|
74
|
+
self.assertIn("# ORACLE", text)
|
|
75
|
+
|
|
76
|
+
def test_load_appends_lmc(self):
|
|
77
|
+
with tempfile.TemporaryDirectory() as td:
|
|
78
|
+
home = Path(td)
|
|
79
|
+
_seed_aisb(home, "architect", "# ARCHITECT", with_lmc=True)
|
|
80
|
+
text = load_agent_prompt(home, "architect")
|
|
81
|
+
self.assertIn("# ARCHITECT", text)
|
|
82
|
+
self.assertIn("LMC PROTOCOL", text)
|
|
83
|
+
|
|
84
|
+
def test_find_file_aisb_takes_priority(self):
|
|
85
|
+
with tempfile.TemporaryDirectory() as td:
|
|
86
|
+
home = Path(td)
|
|
87
|
+
_seed_aisb(home, "oracle", "# AISB-ORACLE")
|
|
88
|
+
other = home / "Agentik_SSOT" / "agents" / "custom"
|
|
89
|
+
other.mkdir(parents=True)
|
|
90
|
+
(other / "oracle.md").write_text("# CUSTOM-ORACLE")
|
|
91
|
+
path = find_agent_file(home, "oracle")
|
|
92
|
+
self.assertIn("aisb", str(path))
|
|
93
|
+
|
|
94
|
+
def test_list_available_agents(self):
|
|
95
|
+
with tempfile.TemporaryDirectory() as td:
|
|
96
|
+
home = Path(td)
|
|
97
|
+
for r in ("oracle", "architect", "keymaker"):
|
|
98
|
+
_seed_aisb(home, r, f"# {r.upper()}")
|
|
99
|
+
# Also a non-role-looking file that should be excluded.
|
|
100
|
+
(home / "Agentik_SSOT" / "agents" / "aisb" / "CLAUDE.md").write_text("x")
|
|
101
|
+
(home / "Agentik_SSOT" / "agents" / "aisb" / "checker-oracle.md").write_text("x")
|
|
102
|
+
agents = list_available_agents(home)
|
|
103
|
+
self.assertIn("aisb", agents)
|
|
104
|
+
self.assertIn("oracle", agents["aisb"])
|
|
105
|
+
self.assertIn("architect", agents["aisb"])
|
|
106
|
+
self.assertNotIn("CLAUDE", agents["aisb"])
|
|
107
|
+
self.assertNotIn("checker-oracle", agents["aisb"])
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class TestEnvelope(unittest.TestCase):
|
|
111
|
+
def setUp(self):
|
|
112
|
+
clear_cache()
|
|
113
|
+
|
|
114
|
+
def test_envelope_loads_agent_and_dispatcher_contract(self):
|
|
115
|
+
with tempfile.TemporaryDirectory() as td:
|
|
116
|
+
home = Path(td)
|
|
117
|
+
_seed_aisb(home, "oracle", "# ORACLE — I orchestrate.")
|
|
118
|
+
ctx = EnvelopeContext(
|
|
119
|
+
role="oracle",
|
|
120
|
+
intent="Fix the login bug",
|
|
121
|
+
task_id="t-1",
|
|
122
|
+
mission_id="m-1",
|
|
123
|
+
)
|
|
124
|
+
env = build_envelope(home, ctx)
|
|
125
|
+
self.assertIn("ORACLE", env["system"])
|
|
126
|
+
self.assertIn("ORCHESTRATION CONTRACT (dispatcher)", env["system"])
|
|
127
|
+
self.assertIn("Fix the login bug", env["user"])
|
|
128
|
+
|
|
129
|
+
def test_envelope_worker_gets_done_json_contract(self):
|
|
130
|
+
with tempfile.TemporaryDirectory() as td:
|
|
131
|
+
home = Path(td)
|
|
132
|
+
_seed_aisb(home, "worker", "# WORKER")
|
|
133
|
+
ctx = EnvelopeContext(
|
|
134
|
+
role="worker", intent="Implement X",
|
|
135
|
+
done_json_path="/tmp/foo/.done.json",
|
|
136
|
+
verify_cmd="pytest tests/test_foo.py",
|
|
137
|
+
)
|
|
138
|
+
env = build_envelope(home, ctx)
|
|
139
|
+
self.assertIn("ORCHESTRATION CONTRACT (executor / worker)", env["system"])
|
|
140
|
+
self.assertIn("/tmp/foo/.done.json", env["system"])
|
|
141
|
+
self.assertIn("Implement X", env["user"])
|
|
142
|
+
self.assertIn("pytest tests/test_foo.py", env["user"])
|
|
143
|
+
|
|
144
|
+
def test_envelope_verifier_gets_verifier_contract(self):
|
|
145
|
+
with tempfile.TemporaryDirectory() as td:
|
|
146
|
+
home = Path(td)
|
|
147
|
+
_seed_aisb(home, "seraph", "# SERAPH")
|
|
148
|
+
ctx = EnvelopeContext(role="seraph", intent="Verify X")
|
|
149
|
+
env = build_envelope(home, ctx)
|
|
150
|
+
self.assertIn("ORCHESTRATION CONTRACT (verifier)", env["system"])
|
|
151
|
+
|
|
152
|
+
def test_envelope_includes_parent_context(self):
|
|
153
|
+
with tempfile.TemporaryDirectory() as td:
|
|
154
|
+
home = Path(td)
|
|
155
|
+
_seed_aisb(home, "worker", "# WORKER")
|
|
156
|
+
ctx = EnvelopeContext(
|
|
157
|
+
role="worker", intent="Subtask 1",
|
|
158
|
+
parent_role="oracle",
|
|
159
|
+
parent_intent="Fix the cart bug",
|
|
160
|
+
plan_so_far=[{"role": "worker", "spec": {"task": "1"}}],
|
|
161
|
+
)
|
|
162
|
+
env = build_envelope(home, ctx)
|
|
163
|
+
self.assertIn("Fix the cart bug", env["user"])
|
|
164
|
+
self.assertIn("Plan so far", env["user"])
|
|
165
|
+
|
|
166
|
+
def test_role_constants_cover_aisb_agents(self):
|
|
167
|
+
# All canonical AISB roles must fit in exactly one bucket.
|
|
168
|
+
for r in ("aisb", "oracle", "manager", "architect", "keymaker", "morpheus"):
|
|
169
|
+
self.assertIn(r, DISPATCHER_ROLES)
|
|
170
|
+
for r in ("worker", "construct", "link"):
|
|
171
|
+
self.assertIn(r, EXECUTOR_ROLES)
|
|
172
|
+
for r in ("seraph", "audit", "verifier"):
|
|
173
|
+
self.assertIn(r, VERIFIER_ROLES)
|
|
174
|
+
|
|
175
|
+
def test_envelope_falls_back_when_no_agent_file(self):
|
|
176
|
+
with tempfile.TemporaryDirectory() as td:
|
|
177
|
+
home = Path(td) # no agent files seeded
|
|
178
|
+
ctx = EnvelopeContext(role="oracle", intent="X")
|
|
179
|
+
env = build_envelope(home, ctx)
|
|
180
|
+
# Generic identity line is the floor; contract is still appended.
|
|
181
|
+
self.assertIn("ORACLE", env["system"].upper())
|
|
182
|
+
self.assertIn("ORCHESTRATION CONTRACT", env["system"])
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
class TestDoneSignal(unittest.TestCase):
|
|
186
|
+
def test_round_trip(self):
|
|
187
|
+
with tempfile.TemporaryDirectory() as td:
|
|
188
|
+
sig = DoneSignal(
|
|
189
|
+
status="done_clean",
|
|
190
|
+
summary="implemented X",
|
|
191
|
+
files_changed=["a.py", "b.py"],
|
|
192
|
+
artifacts={"key": "value"},
|
|
193
|
+
)
|
|
194
|
+
path = write_done(td, "t-42", sig)
|
|
195
|
+
self.assertTrue(path.exists())
|
|
196
|
+
got = read_done(td, "t-42")
|
|
197
|
+
self.assertEqual(got.status, "done_clean")
|
|
198
|
+
self.assertEqual(got.files_changed, ["a.py", "b.py"])
|
|
199
|
+
self.assertEqual(got.artifacts["key"], "value")
|
|
200
|
+
|
|
201
|
+
def test_rejects_invalid_status_on_write(self):
|
|
202
|
+
with tempfile.TemporaryDirectory() as td:
|
|
203
|
+
sig = DoneSignal(status="all_good")
|
|
204
|
+
with self.assertRaises(DoneSignalError):
|
|
205
|
+
write_done(td, "t-1", sig)
|
|
206
|
+
|
|
207
|
+
def test_rejects_invalid_status_on_read(self):
|
|
208
|
+
with tempfile.TemporaryDirectory() as td:
|
|
209
|
+
from omega_engine.done_signal import session_dir
|
|
210
|
+
d = session_dir(td, "t-9")
|
|
211
|
+
(d / ".done.json").write_text(json.dumps({"status": "BAD"}))
|
|
212
|
+
with self.assertRaises(DoneSignalError):
|
|
213
|
+
read_done(td, "t-9")
|
|
214
|
+
|
|
215
|
+
def test_attach_audit_preserves_existing_fields(self):
|
|
216
|
+
with tempfile.TemporaryDirectory() as td:
|
|
217
|
+
sig = DoneSignal(status="pending", summary="halfway",
|
|
218
|
+
files_changed=["x.py"])
|
|
219
|
+
write_done(td, "t-7", sig)
|
|
220
|
+
attach_audit_to_done(td, "t-7", {"verified": True, "score": 95})
|
|
221
|
+
got = read_done(td, "t-7")
|
|
222
|
+
self.assertEqual(got.status, "pending") # unchanged
|
|
223
|
+
self.assertEqual(got.files_changed, ["x.py"])
|
|
224
|
+
self.assertEqual(got.audit["score"], 95)
|
|
225
|
+
self.assertTrue(got.audit["verified"])
|
|
226
|
+
|
|
227
|
+
def test_read_returns_none_when_missing(self):
|
|
228
|
+
with tempfile.TemporaryDirectory() as td:
|
|
229
|
+
self.assertIsNone(read_done(td, "t-missing"))
|
|
230
|
+
|
|
231
|
+
def test_file_mode_is_600(self):
|
|
232
|
+
with tempfile.TemporaryDirectory() as td:
|
|
233
|
+
path = write_done(td, "t-mode", DoneSignal(status="failed"))
|
|
234
|
+
self.assertEqual(path.stat().st_mode & 0o777, 0o600)
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
class TestProjectVault(unittest.TestCase):
|
|
238
|
+
def test_project_vault_isolation(self):
|
|
239
|
+
from omega_engine.vault import (
|
|
240
|
+
list_project_vaults, vault_read, vault_write,
|
|
241
|
+
)
|
|
242
|
+
import shutil as _sh
|
|
243
|
+
|
|
244
|
+
if not (_sh.which("age") and _sh.which("age-keygen")):
|
|
245
|
+
# Plain mode is the test we can run universally.
|
|
246
|
+
pass
|
|
247
|
+
|
|
248
|
+
with tempfile.TemporaryDirectory() as td:
|
|
249
|
+
# Write a secret in the global vault and one in project "alpha".
|
|
250
|
+
vault_write(td, "GLOBAL_X", "global-value")
|
|
251
|
+
vault_write(td, "ALPHA_X", "alpha-value", project="alpha")
|
|
252
|
+
vault_write(td, "BETA_X", "beta-value", project="beta")
|
|
253
|
+
|
|
254
|
+
# Project vaults don't see each other or the global one.
|
|
255
|
+
self.assertEqual(vault_read(td, "ALPHA_X", project="alpha"),
|
|
256
|
+
"alpha-value")
|
|
257
|
+
self.assertIsNone(vault_read(td, "ALPHA_X")) # not in global
|
|
258
|
+
self.assertIsNone(vault_read(td, "ALPHA_X", project="beta"))
|
|
259
|
+
self.assertEqual(vault_read(td, "GLOBAL_X"), "global-value")
|
|
260
|
+
|
|
261
|
+
vaults = list_project_vaults(td)
|
|
262
|
+
slugs = {v["project"] for v in vaults}
|
|
263
|
+
self.assertEqual(slugs, {"alpha", "beta"})
|
|
264
|
+
|
|
265
|
+
def test_project_vault_rejects_traversal(self):
|
|
266
|
+
from omega_engine.vault import vault_write
|
|
267
|
+
with tempfile.TemporaryDirectory() as td:
|
|
268
|
+
for bad in ("../escape", "a/b", "..", ".hidden"):
|
|
269
|
+
with self.assertRaises(ValueError):
|
|
270
|
+
vault_write(td, "X", "v", project=bad)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
if __name__ == "__main__":
|
|
274
|
+
unittest.main(verbosity=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)
|