@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,339 @@
|
|
|
1
|
+
"""Auto-update layer.
|
|
2
|
+
|
|
3
|
+
What this module does
|
|
4
|
+
---------------------
|
|
5
|
+
|
|
6
|
+
Three jobs, distinct on purpose so each is testable:
|
|
7
|
+
|
|
8
|
+
1. **Cached check** — ``check_cached(home)`` returns the latest known
|
|
9
|
+
version from a small JSON file under ``Agentik_Extra/var/``. If the
|
|
10
|
+
cache is fresh (< check_interval_s), no network is hit. Default
|
|
11
|
+
interval: 24 h. Every CLI invocation can call this for ~0 ms.
|
|
12
|
+
|
|
13
|
+
2. **Banner emission** — ``maybe_emit_banner(home)`` prints a one-line
|
|
14
|
+
stderr notice if a new version is known to be available. Silent
|
|
15
|
+
when up-to-date or when the cache is empty (first run). Opt-out via
|
|
16
|
+
``OMEGA_NO_UPDATE_BANNER=1``.
|
|
17
|
+
|
|
18
|
+
3. **Apply** — ``apply_update(home)`` performs the actual upgrade:
|
|
19
|
+
|
|
20
|
+
(a) ``omega doctor --json`` baseline
|
|
21
|
+
(b) ``omega backup create --encrypt`` snapshot
|
|
22
|
+
(c) ``npm install -g @agentikos/omega-os@latest``
|
|
23
|
+
(d) ``omega upgrade --non-interactive``
|
|
24
|
+
(e) run ``migrations`` from current → latest
|
|
25
|
+
(f) ``omega doctor --json`` + ``omega smoke``
|
|
26
|
+
(g) on failure: ``omega backup restore <bundle>``
|
|
27
|
+
|
|
28
|
+
Atomic-ish: every step is recorded to a journal, and any non-zero
|
|
29
|
+
exit before step (g) triggers rollback. The operator sees a clear
|
|
30
|
+
"✗ update aborted — restored from <bundle>" or "✓ updated to vX.Y.Z".
|
|
31
|
+
|
|
32
|
+
Why all this care
|
|
33
|
+
-----------------
|
|
34
|
+
|
|
35
|
+
Updates that break the daily workflow are worse than no updates. Claude
|
|
36
|
+
Code's pattern (silent banner + manual apply) is the right default. The
|
|
37
|
+
``omega update auto`` cadence opts the operator into background apply,
|
|
38
|
+
but ALWAYS through this same backup + verify + rollback pipeline.
|
|
39
|
+
"""
|
|
40
|
+
from __future__ import annotations
|
|
41
|
+
|
|
42
|
+
import json
|
|
43
|
+
import os
|
|
44
|
+
import shlex
|
|
45
|
+
import subprocess
|
|
46
|
+
import sys
|
|
47
|
+
import time
|
|
48
|
+
from dataclasses import asdict, dataclass, field
|
|
49
|
+
from pathlib import Path
|
|
50
|
+
from typing import Any
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
_DEFAULT_INTERVAL_S = 24 * 3600 # one day
|
|
54
|
+
_CACHE_FILE = "last-update-check.json"
|
|
55
|
+
_JOURNAL_FILE = "update-journal.jsonl"
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
# ---------------------------------------------------------------------------
|
|
59
|
+
# Cached check
|
|
60
|
+
# ---------------------------------------------------------------------------
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
@dataclass
|
|
64
|
+
class CachedCheck:
|
|
65
|
+
current: str
|
|
66
|
+
latest: str
|
|
67
|
+
is_outdated: bool
|
|
68
|
+
checked_at: float
|
|
69
|
+
error: str = ""
|
|
70
|
+
|
|
71
|
+
def to_json(self) -> str:
|
|
72
|
+
return json.dumps(asdict(self), indent=2)
|
|
73
|
+
|
|
74
|
+
@staticmethod
|
|
75
|
+
def from_json(text: str) -> "CachedCheck":
|
|
76
|
+
return CachedCheck(**json.loads(text))
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def _cache_path(home: Path) -> Path:
|
|
80
|
+
return home / "Agentik_Extra" / "var" / _CACHE_FILE
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _journal_path(home: Path) -> Path:
|
|
84
|
+
return home / "Agentik_Extra" / "var" / _JOURNAL_FILE
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def _journal(home: Path, event: dict[str, Any]) -> None:
|
|
88
|
+
"""Append a JSONL line to the update journal. Best-effort."""
|
|
89
|
+
p = _journal_path(home)
|
|
90
|
+
p.parent.mkdir(parents=True, exist_ok=True)
|
|
91
|
+
line = json.dumps({"ts": time.time(), **event}) + "\n"
|
|
92
|
+
try:
|
|
93
|
+
with p.open("a") as fh:
|
|
94
|
+
fh.write(line)
|
|
95
|
+
except OSError:
|
|
96
|
+
pass
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def check_cached(
|
|
100
|
+
home: str | Path,
|
|
101
|
+
*,
|
|
102
|
+
interval_s: int = _DEFAULT_INTERVAL_S,
|
|
103
|
+
force: bool = False,
|
|
104
|
+
) -> CachedCheck:
|
|
105
|
+
"""Return the latest cached check; refresh from npm if stale.
|
|
106
|
+
|
|
107
|
+
Side-effect: writes the refreshed cache. Network access only when the
|
|
108
|
+
cache is stale or ``force=True``. Network errors set ``error`` but
|
|
109
|
+
don't raise — auto-update must never break a CLI invocation.
|
|
110
|
+
"""
|
|
111
|
+
home = Path(home)
|
|
112
|
+
p = _cache_path(home)
|
|
113
|
+
p.parent.mkdir(parents=True, exist_ok=True)
|
|
114
|
+
|
|
115
|
+
if p.exists() and not force:
|
|
116
|
+
try:
|
|
117
|
+
cached = CachedCheck.from_json(p.read_text())
|
|
118
|
+
if time.time() - cached.checked_at < interval_s:
|
|
119
|
+
return cached
|
|
120
|
+
except (OSError, ValueError, KeyError):
|
|
121
|
+
pass
|
|
122
|
+
|
|
123
|
+
# Refresh.
|
|
124
|
+
from omega_engine import __version__
|
|
125
|
+
from omega_engine.updater import check_for_updates
|
|
126
|
+
info = check_for_updates(__version__, timeout=8)
|
|
127
|
+
fresh = CachedCheck(
|
|
128
|
+
current=info.current,
|
|
129
|
+
latest=info.latest,
|
|
130
|
+
is_outdated=info.is_outdated,
|
|
131
|
+
checked_at=time.time(),
|
|
132
|
+
error=info.error,
|
|
133
|
+
)
|
|
134
|
+
try:
|
|
135
|
+
# Atomic write — same pattern as done_signal.
|
|
136
|
+
tmp = p.with_suffix(p.suffix + f".tmp.{os.getpid()}")
|
|
137
|
+
tmp.write_text(fresh.to_json())
|
|
138
|
+
os.replace(tmp, p)
|
|
139
|
+
except OSError:
|
|
140
|
+
pass
|
|
141
|
+
return fresh
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def maybe_emit_banner(home: str | Path, *, stream=sys.stderr) -> bool:
|
|
145
|
+
"""Print a one-line update banner when a new version is known.
|
|
146
|
+
|
|
147
|
+
Returns True iff a banner was emitted. Opt-out via
|
|
148
|
+
``OMEGA_NO_UPDATE_BANNER=1``. Never raises.
|
|
149
|
+
"""
|
|
150
|
+
if os.environ.get("OMEGA_NO_UPDATE_BANNER") == "1":
|
|
151
|
+
return False
|
|
152
|
+
try:
|
|
153
|
+
check = check_cached(home)
|
|
154
|
+
except Exception: # noqa: BLE001
|
|
155
|
+
return False
|
|
156
|
+
if not check.is_outdated or check.error:
|
|
157
|
+
return False
|
|
158
|
+
msg = (
|
|
159
|
+
f"[omega] update available: {check.current} → {check.latest} "
|
|
160
|
+
f"run `omega update apply` to install"
|
|
161
|
+
)
|
|
162
|
+
try:
|
|
163
|
+
print(msg, file=stream)
|
|
164
|
+
except (OSError, ValueError):
|
|
165
|
+
return False
|
|
166
|
+
return True
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
# ---------------------------------------------------------------------------
|
|
170
|
+
# Apply
|
|
171
|
+
# ---------------------------------------------------------------------------
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
@dataclass
|
|
175
|
+
class ApplyResult:
|
|
176
|
+
ok: bool
|
|
177
|
+
from_version: str
|
|
178
|
+
to_version: str
|
|
179
|
+
bundle: str = "" # path to the pre-update backup
|
|
180
|
+
rolled_back: bool = False
|
|
181
|
+
duration_s: float = 0.0
|
|
182
|
+
steps: list[dict[str, Any]] = field(default_factory=list)
|
|
183
|
+
error: str = ""
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def _which(bin_: str) -> str | None:
|
|
187
|
+
import shutil as _sh
|
|
188
|
+
return _sh.which(bin_)
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
def _run_step(
|
|
192
|
+
home: Path, label: str, cmd: list[str], *, timeout: int = 600,
|
|
193
|
+
) -> tuple[int, str]:
|
|
194
|
+
"""Run a step, journal it, return (returncode, tail-of-output)."""
|
|
195
|
+
started = time.time()
|
|
196
|
+
try:
|
|
197
|
+
proc = subprocess.run(
|
|
198
|
+
cmd, check=False, capture_output=True, text=True, timeout=timeout,
|
|
199
|
+
)
|
|
200
|
+
rc = proc.returncode
|
|
201
|
+
tail = (proc.stdout + "\n" + proc.stderr).strip()[-500:]
|
|
202
|
+
except subprocess.TimeoutExpired:
|
|
203
|
+
rc = 124
|
|
204
|
+
tail = f"timeout after {timeout}s"
|
|
205
|
+
except OSError as exc:
|
|
206
|
+
rc = 127
|
|
207
|
+
tail = f"exec error: {exc}"
|
|
208
|
+
_journal(home, {
|
|
209
|
+
"step": label, "rc": rc, "duration_s": round(time.time() - started, 2),
|
|
210
|
+
"tail": tail[:400],
|
|
211
|
+
})
|
|
212
|
+
return rc, tail
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def apply_update(
|
|
216
|
+
home: str | Path,
|
|
217
|
+
*,
|
|
218
|
+
skip_backup: bool = False,
|
|
219
|
+
skip_verify: bool = False,
|
|
220
|
+
npm_global: bool = True,
|
|
221
|
+
) -> ApplyResult:
|
|
222
|
+
"""Apply the available update with full backup + migrate + verify + rollback.
|
|
223
|
+
|
|
224
|
+
Strict sequence:
|
|
225
|
+
|
|
226
|
+
1. baseline doctor JSON
|
|
227
|
+
2. backup create (skippable for tests)
|
|
228
|
+
3. npm install -g @agentikos/omega-os@latest (or skipped when not on PATH)
|
|
229
|
+
4. run migrations from <current> → <latest>
|
|
230
|
+
5. omega upgrade --non-interactive (re-run install steps)
|
|
231
|
+
6. doctor + smoke (skippable for tests)
|
|
232
|
+
|
|
233
|
+
Any failure between 2 and 6 triggers ``backup restore`` from the bundle.
|
|
234
|
+
"""
|
|
235
|
+
home = Path(home)
|
|
236
|
+
start = time.time()
|
|
237
|
+
from omega_engine import __version__
|
|
238
|
+
info = check_cached(home, force=True)
|
|
239
|
+
if info.error:
|
|
240
|
+
return ApplyResult(
|
|
241
|
+
ok=False, from_version=__version__, to_version="?",
|
|
242
|
+
error=f"check failed: {info.error}",
|
|
243
|
+
duration_s=round(time.time() - start, 2),
|
|
244
|
+
)
|
|
245
|
+
if not info.is_outdated:
|
|
246
|
+
return ApplyResult(
|
|
247
|
+
ok=True, from_version=__version__, to_version=info.latest,
|
|
248
|
+
error="already up-to-date",
|
|
249
|
+
duration_s=round(time.time() - start, 2),
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
_journal(home, {"phase": "begin", "from": info.current, "to": info.latest})
|
|
253
|
+
steps: list[dict[str, Any]] = []
|
|
254
|
+
bundle = ""
|
|
255
|
+
omega_bin = _which("omega") or "omega"
|
|
256
|
+
|
|
257
|
+
# 1. baseline doctor (informational)
|
|
258
|
+
rc, _ = _run_step(home, "doctor-baseline",
|
|
259
|
+
[omega_bin, "doctor", "--json"],
|
|
260
|
+
timeout=60)
|
|
261
|
+
steps.append({"label": "doctor-baseline", "rc": rc})
|
|
262
|
+
|
|
263
|
+
# 2. backup
|
|
264
|
+
if not skip_backup:
|
|
265
|
+
from omega_engine.backup import backup as _bk
|
|
266
|
+
try:
|
|
267
|
+
res = _bk(home, out_dir=home / "Agentik_Extra" / "var" / "backups")
|
|
268
|
+
bundle = str(res.path)
|
|
269
|
+
steps.append({"label": "backup", "rc": 0, "bundle": bundle})
|
|
270
|
+
_journal(home, {"step": "backup", "bundle": bundle})
|
|
271
|
+
except Exception as exc: # noqa: BLE001
|
|
272
|
+
return ApplyResult(
|
|
273
|
+
ok=False, from_version=info.current, to_version=info.latest,
|
|
274
|
+
error=f"backup failed: {exc}",
|
|
275
|
+
duration_s=round(time.time() - start, 2), steps=steps,
|
|
276
|
+
)
|
|
277
|
+
|
|
278
|
+
def _rollback(reason: str) -> ApplyResult:
|
|
279
|
+
_journal(home, {"phase": "rollback", "reason": reason, "bundle": bundle})
|
|
280
|
+
if bundle and not skip_backup:
|
|
281
|
+
from omega_engine.backup import restore as _rs
|
|
282
|
+
try:
|
|
283
|
+
_rs(bundle, target=home)
|
|
284
|
+
except Exception as exc: # noqa: BLE001
|
|
285
|
+
_journal(home, {"phase": "rollback-failed", "reason": str(exc)})
|
|
286
|
+
return ApplyResult(
|
|
287
|
+
ok=False, from_version=info.current, to_version=info.latest,
|
|
288
|
+
bundle=bundle, rolled_back=bool(bundle),
|
|
289
|
+
error=reason,
|
|
290
|
+
duration_s=round(time.time() - start, 2), steps=steps,
|
|
291
|
+
)
|
|
292
|
+
|
|
293
|
+
# 3. npm install
|
|
294
|
+
if npm_global and _which("npm"):
|
|
295
|
+
rc, tail = _run_step(
|
|
296
|
+
home, "npm-install",
|
|
297
|
+
["npm", "install", "-g", "@agentikos/omega-os@latest"],
|
|
298
|
+
timeout=600,
|
|
299
|
+
)
|
|
300
|
+
steps.append({"label": "npm-install", "rc": rc})
|
|
301
|
+
if rc != 0:
|
|
302
|
+
return _rollback(f"npm install failed: {tail[:200]}")
|
|
303
|
+
|
|
304
|
+
# 4. migrations
|
|
305
|
+
from omega_engine.migrations import run_migrations
|
|
306
|
+
try:
|
|
307
|
+
migrated = run_migrations(home, info.current, info.latest)
|
|
308
|
+
steps.append({
|
|
309
|
+
"label": "migrations", "rc": 0,
|
|
310
|
+
"applied": [m["name"] for m in migrated],
|
|
311
|
+
})
|
|
312
|
+
except Exception as exc: # noqa: BLE001
|
|
313
|
+
return _rollback(f"migrations failed: {exc}")
|
|
314
|
+
|
|
315
|
+
# 5. omega upgrade (re-run install steps, idempotent)
|
|
316
|
+
rc, tail = _run_step(
|
|
317
|
+
home, "omega-upgrade",
|
|
318
|
+
[omega_bin, "upgrade", "--non-interactive"],
|
|
319
|
+
timeout=900,
|
|
320
|
+
)
|
|
321
|
+
steps.append({"label": "omega-upgrade", "rc": rc})
|
|
322
|
+
if rc != 0:
|
|
323
|
+
return _rollback(f"omega upgrade failed: {tail[:200]}")
|
|
324
|
+
|
|
325
|
+
# 6. verify
|
|
326
|
+
if not skip_verify:
|
|
327
|
+
rc_doc, _ = _run_step(home, "doctor-verify",
|
|
328
|
+
[omega_bin, "doctor", "--json"], timeout=60)
|
|
329
|
+
rc_smk, _ = _run_step(home, "smoke", [omega_bin, "smoke"], timeout=120)
|
|
330
|
+
steps.append({"label": "doctor-verify", "rc": rc_doc})
|
|
331
|
+
steps.append({"label": "smoke", "rc": rc_smk})
|
|
332
|
+
if rc_smk != 0:
|
|
333
|
+
return _rollback(f"post-update smoke failed (rc={rc_smk})")
|
|
334
|
+
|
|
335
|
+
_journal(home, {"phase": "success", "to": info.latest})
|
|
336
|
+
return ApplyResult(
|
|
337
|
+
ok=True, from_version=info.current, to_version=info.latest,
|
|
338
|
+
bundle=bundle, duration_s=round(time.time() - start, 2), steps=steps,
|
|
339
|
+
)
|