@agentikos/omega-os 0.2.0 → 0.19.6

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.
Files changed (376) hide show
  1. package/README.md +33 -3
  2. package/bootstrap/lib/__pycache__/claude-code-settings.cpython-313.pyc +0 -0
  3. package/bootstrap/lib/__pycache__/llm-clis.cpython-313.pyc +0 -0
  4. package/bootstrap/lib/__pycache__/manifest-helpers.cpython-313.pyc +0 -0
  5. package/bootstrap/lib/claude-code-settings.py +176 -0
  6. package/bootstrap/lib/common.sh +457 -1
  7. package/bootstrap/lib/llm-clis.py +341 -0
  8. package/bootstrap/lib/manifest-helpers.py +384 -0
  9. package/bootstrap/lib/steps.sh +790 -21
  10. package/bootstrap/manifest.example.yaml +87 -1
  11. package/bootstrap/templates/aisb/CLAUDE.md +305 -0
  12. package/bootstrap/templates/aisb/architect.md +204 -0
  13. package/bootstrap/templates/aisb/checkers/CLAUDE.md +9 -0
  14. package/bootstrap/templates/aisb/checkers/checker-architect.md +151 -0
  15. package/bootstrap/templates/aisb/checkers/checker-common.md +171 -0
  16. package/bootstrap/templates/aisb/checkers/checker-construct.md +129 -0
  17. package/bootstrap/templates/aisb/checkers/checker-keymaker.md +204 -0
  18. package/bootstrap/templates/aisb/checkers/checker-link.md +205 -0
  19. package/bootstrap/templates/aisb/checkers/checker-merovingian.md +219 -0
  20. package/bootstrap/templates/aisb/checkers/checker-morpheus.md +211 -0
  21. package/bootstrap/templates/aisb/checkers/checker-neo.md +177 -0
  22. package/bootstrap/templates/aisb/checkers/checker-niobe.md +156 -0
  23. package/bootstrap/templates/aisb/checkers/checker-oracle.md +164 -0
  24. package/bootstrap/templates/aisb/checkers/checker-seraph.md +187 -0
  25. package/bootstrap/templates/aisb/checkers/checker-smith.md +195 -0
  26. package/bootstrap/templates/aisb/checkers/checker-zion.md +113 -0
  27. package/bootstrap/templates/aisb/construct.md +135 -0
  28. package/bootstrap/templates/aisb/keymaker.md +227 -0
  29. package/bootstrap/templates/aisb/link.md +170 -0
  30. package/bootstrap/templates/aisb/lmc-protocol.md +57 -0
  31. package/bootstrap/templates/aisb/merovingian.md +159 -0
  32. package/bootstrap/templates/aisb/morpheus.md +243 -0
  33. package/bootstrap/templates/aisb/neo.md +147 -0
  34. package/bootstrap/templates/aisb/niobe.md +197 -0
  35. package/bootstrap/templates/aisb/oracle.md +244 -0
  36. package/bootstrap/templates/aisb/protocols/handoff-templates.md +204 -0
  37. package/bootstrap/templates/aisb/protocols/shared-protocol.md +248 -0
  38. package/bootstrap/templates/aisb/pythia.md +153 -0
  39. package/bootstrap/templates/aisb/seraph.md +315 -0
  40. package/bootstrap/templates/aisb/smith.md +202 -0
  41. package/bootstrap/templates/aisb/zion.md +172 -0
  42. package/bootstrap/templates/autonomous/audit-patrol.yaml +41 -0
  43. package/bootstrap/templates/autonomous/smith-reflect.yaml +43 -0
  44. package/bootstrap/templates/autonomous/ssh-key-rotate.yaml +46 -0
  45. package/bootstrap/templates/autonomous/support-agent.yaml +38 -0
  46. package/docs/AUDITS.md +85 -0
  47. package/docs/GAP-ANALYSIS.md +214 -0
  48. package/docs/INSTALL.md +47 -9
  49. package/docs/MCP-AND-PLUGINS.md +31 -4
  50. package/docs/SIMULATION.md +171 -0
  51. package/docs/simulate.sh +211 -0
  52. package/install.sh +164 -17
  53. package/omega/Agentik_Engine/README.md +4 -2
  54. package/omega/Agentik_Engine/omega_engine/__init__.py +147 -1
  55. package/omega/Agentik_Engine/omega_engine/__pycache__/__init__.cpython-313.pyc +0 -0
  56. package/omega/Agentik_Engine/omega_engine/__pycache__/account.cpython-313.pyc +0 -0
  57. package/omega/Agentik_Engine/omega_engine/__pycache__/agent_messages.cpython-313.pyc +0 -0
  58. package/omega/Agentik_Engine/omega_engine/__pycache__/aisb_chat.cpython-313.pyc +0 -0
  59. package/omega/Agentik_Engine/omega_engine/__pycache__/audit.cpython-313.pyc +0 -0
  60. package/omega/Agentik_Engine/omega_engine/__pycache__/audit_arsenal.cpython-313.pyc +0 -0
  61. package/omega/Agentik_Engine/omega_engine/__pycache__/audit_diff.cpython-313.pyc +0 -0
  62. package/omega/Agentik_Engine/omega_engine/__pycache__/audit_gate.cpython-313.pyc +0 -0
  63. package/omega/Agentik_Engine/omega_engine/__pycache__/auto_update.cpython-313.pyc +0 -0
  64. package/omega/Agentik_Engine/omega_engine/__pycache__/autonomous.cpython-313.pyc +0 -0
  65. package/omega/Agentik_Engine/omega_engine/__pycache__/backup.cpython-313.pyc +0 -0
  66. package/omega/Agentik_Engine/omega_engine/__pycache__/barrier.cpython-313.pyc +0 -0
  67. package/omega/Agentik_Engine/omega_engine/__pycache__/bus.cpython-313.pyc +0 -0
  68. package/omega/Agentik_Engine/omega_engine/__pycache__/cadence.cpython-313.pyc +0 -0
  69. package/omega/Agentik_Engine/omega_engine/__pycache__/classifier.cpython-313.pyc +0 -0
  70. package/omega/Agentik_Engine/omega_engine/__pycache__/cleanup.cpython-313.pyc +0 -0
  71. package/omega/Agentik_Engine/omega_engine/__pycache__/cli.cpython-313.pyc +0 -0
  72. package/omega/Agentik_Engine/omega_engine/__pycache__/completions.cpython-313.pyc +0 -0
  73. package/omega/Agentik_Engine/omega_engine/__pycache__/costs.cpython-313.pyc +0 -0
  74. package/omega/Agentik_Engine/omega_engine/__pycache__/done_signal.cpython-313.pyc +0 -0
  75. package/omega/Agentik_Engine/omega_engine/__pycache__/envelope.cpython-313.pyc +0 -0
  76. package/omega/Agentik_Engine/omega_engine/__pycache__/events.cpython-313.pyc +0 -0
  77. package/omega/Agentik_Engine/omega_engine/__pycache__/executor.cpython-313.pyc +0 -0
  78. package/omega/Agentik_Engine/omega_engine/__pycache__/handoff.cpython-313.pyc +0 -0
  79. package/omega/Agentik_Engine/omega_engine/__pycache__/hermes.cpython-313.pyc +0 -0
  80. package/omega/Agentik_Engine/omega_engine/__pycache__/hermes_bootstrap.cpython-313.pyc +0 -0
  81. package/omega/Agentik_Engine/omega_engine/__pycache__/hermes_desktop.cpython-313.pyc +0 -0
  82. package/omega/Agentik_Engine/omega_engine/__pycache__/learning.cpython-313.pyc +0 -0
  83. package/omega/Agentik_Engine/omega_engine/__pycache__/managed_agent.cpython-313.pyc +0 -0
  84. package/omega/Agentik_Engine/omega_engine/__pycache__/memory.cpython-313.pyc +0 -0
  85. package/omega/Agentik_Engine/omega_engine/__pycache__/menu.cpython-313.pyc +0 -0
  86. package/omega/Agentik_Engine/omega_engine/__pycache__/mission.cpython-313.pyc +0 -0
  87. package/omega/Agentik_Engine/omega_engine/__pycache__/plan.cpython-313.pyc +0 -0
  88. package/omega/Agentik_Engine/omega_engine/__pycache__/progress.cpython-313.pyc +0 -0
  89. package/omega/Agentik_Engine/omega_engine/__pycache__/project.cpython-313.pyc +0 -0
  90. package/omega/Agentik_Engine/omega_engine/__pycache__/prompts.cpython-313.pyc +0 -0
  91. package/omega/Agentik_Engine/omega_engine/__pycache__/provider.cpython-313.pyc +0 -0
  92. package/omega/Agentik_Engine/omega_engine/__pycache__/prune.cpython-313.pyc +0 -0
  93. package/omega/Agentik_Engine/omega_engine/__pycache__/pursue.cpython-313.pyc +0 -0
  94. package/omega/Agentik_Engine/omega_engine/__pycache__/reducer.cpython-313.pyc +0 -0
  95. package/omega/Agentik_Engine/omega_engine/__pycache__/report.cpython-313.pyc +0 -0
  96. package/omega/Agentik_Engine/omega_engine/__pycache__/router.cpython-313.pyc +0 -0
  97. package/omega/Agentik_Engine/omega_engine/__pycache__/skill_routing.cpython-313.pyc +0 -0
  98. package/omega/Agentik_Engine/omega_engine/__pycache__/smoke.cpython-313.pyc +0 -0
  99. package/omega/Agentik_Engine/omega_engine/__pycache__/store.cpython-313.pyc +0 -0
  100. package/omega/Agentik_Engine/omega_engine/__pycache__/supervisor.cpython-313.pyc +0 -0
  101. package/omega/Agentik_Engine/omega_engine/__pycache__/sync.cpython-313.pyc +0 -0
  102. package/omega/Agentik_Engine/omega_engine/__pycache__/task.cpython-313.pyc +0 -0
  103. package/omega/Agentik_Engine/omega_engine/__pycache__/telegram.cpython-313.pyc +0 -0
  104. package/omega/Agentik_Engine/omega_engine/__pycache__/telegram_history.cpython-313.pyc +0 -0
  105. package/omega/Agentik_Engine/omega_engine/__pycache__/tmux.cpython-313.pyc +0 -0
  106. package/omega/Agentik_Engine/omega_engine/__pycache__/tools.cpython-313.pyc +0 -0
  107. package/omega/Agentik_Engine/omega_engine/__pycache__/understand_anything.cpython-313.pyc +0 -0
  108. package/omega/Agentik_Engine/omega_engine/__pycache__/updater.cpython-313.pyc +0 -0
  109. package/omega/Agentik_Engine/omega_engine/__pycache__/validate.cpython-313.pyc +0 -0
  110. package/omega/Agentik_Engine/omega_engine/__pycache__/vault.cpython-313.pyc +0 -0
  111. package/omega/Agentik_Engine/omega_engine/__pycache__/webhooks.cpython-313.pyc +0 -0
  112. package/omega/Agentik_Engine/omega_engine/__pycache__/worker.cpython-313.pyc +0 -0
  113. package/omega/Agentik_Engine/omega_engine/account.py +28 -31
  114. package/omega/Agentik_Engine/omega_engine/agent_messages.py +167 -0
  115. package/omega/Agentik_Engine/omega_engine/aisb_chat.py +128 -0
  116. package/omega/Agentik_Engine/omega_engine/audit_diff.py +99 -0
  117. package/omega/Agentik_Engine/omega_engine/audit_gate.py +149 -0
  118. package/omega/Agentik_Engine/omega_engine/audits/__init__.py +60 -0
  119. package/omega/Agentik_Engine/omega_engine/audits/__pycache__/__init__.cpython-313.pyc +0 -0
  120. package/omega/Agentik_Engine/omega_engine/audits/__pycache__/batcher.cpython-313.pyc +0 -0
  121. package/omega/Agentik_Engine/omega_engine/audits/__pycache__/dispatcher.cpython-313.pyc +0 -0
  122. package/omega/Agentik_Engine/omega_engine/audits/__pycache__/generator.cpython-313.pyc +0 -0
  123. package/omega/Agentik_Engine/omega_engine/audits/__pycache__/history.cpython-313.pyc +0 -0
  124. package/omega/Agentik_Engine/omega_engine/audits/__pycache__/pipeline.cpython-313.pyc +0 -0
  125. package/omega/Agentik_Engine/omega_engine/audits/batcher.py +218 -0
  126. package/omega/Agentik_Engine/omega_engine/audits/dispatcher.py +92 -0
  127. package/omega/Agentik_Engine/omega_engine/audits/generator.py +234 -0
  128. package/omega/Agentik_Engine/omega_engine/audits/history.py +168 -0
  129. package/omega/Agentik_Engine/omega_engine/audits/pipeline.py +198 -0
  130. package/omega/Agentik_Engine/omega_engine/auto_update.py +339 -0
  131. package/omega/Agentik_Engine/omega_engine/backup.py +215 -0
  132. package/omega/Agentik_Engine/omega_engine/cadence.py +158 -0
  133. package/omega/Agentik_Engine/omega_engine/classifier.py +215 -0
  134. package/omega/Agentik_Engine/omega_engine/cleanup.py +673 -0
  135. package/omega/Agentik_Engine/omega_engine/cli.py +4156 -86
  136. package/omega/Agentik_Engine/omega_engine/completions.py +260 -0
  137. package/omega/Agentik_Engine/omega_engine/costs.py +100 -0
  138. package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/__init__.cpython-313.pyc +0 -0
  139. package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/autonomous.cpython-313.pyc +0 -0
  140. package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/engine.cpython-313.pyc +0 -0
  141. package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/telegram.cpython-313.pyc +0 -0
  142. package/omega/Agentik_Engine/omega_engine/daemons/engine.py +53 -4
  143. package/omega/Agentik_Engine/omega_engine/daemons/telegram.py +101 -17
  144. package/omega/Agentik_Engine/omega_engine/done_signal.py +154 -0
  145. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/__init__.cpython-313.pyc +0 -0
  146. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/artifact.cpython-313.pyc +0 -0
  147. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/automation.cpython-313.pyc +0 -0
  148. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/base.cpython-313.pyc +0 -0
  149. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/claudecode.cpython-313.pyc +0 -0
  150. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/connection.cpython-313.pyc +0 -0
  151. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/coworker.cpython-313.pyc +0 -0
  152. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/loop.cpython-313.pyc +0 -0
  153. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/prompt.cpython-313.pyc +0 -0
  154. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/skill.cpython-313.pyc +0 -0
  155. package/omega/Agentik_Engine/omega_engine/envelope.py +219 -0
  156. package/omega/Agentik_Engine/omega_engine/executor.py +149 -10
  157. package/omega/Agentik_Engine/omega_engine/genesis/__init__.py +134 -0
  158. package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/__init__.cpython-313.pyc +0 -0
  159. package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/orchestrator.cpython-313.pyc +0 -0
  160. package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/phases.cpython-313.pyc +0 -0
  161. package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/stack.cpython-313.pyc +0 -0
  162. package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/state.cpython-313.pyc +0 -0
  163. package/omega/Agentik_Engine/omega_engine/genesis/orchestrator.py +262 -0
  164. package/omega/Agentik_Engine/omega_engine/genesis/phases.py +950 -0
  165. package/omega/Agentik_Engine/omega_engine/genesis/stack.py +324 -0
  166. package/omega/Agentik_Engine/omega_engine/genesis/state.py +353 -0
  167. package/omega/Agentik_Engine/omega_engine/handoff.py +459 -0
  168. package/omega/Agentik_Engine/omega_engine/hermes.py +426 -0
  169. package/omega/Agentik_Engine/omega_engine/hermes_bootstrap.py +382 -0
  170. package/omega/Agentik_Engine/omega_engine/hermes_desktop.py +469 -0
  171. package/omega/Agentik_Engine/omega_engine/integrations/__init__.py +30 -0
  172. package/omega/Agentik_Engine/omega_engine/integrations/__pycache__/__init__.cpython-313.pyc +0 -0
  173. package/omega/Agentik_Engine/omega_engine/integrations/__pycache__/graphify.cpython-313.pyc +0 -0
  174. package/omega/Agentik_Engine/omega_engine/integrations/graphify.py +234 -0
  175. package/omega/Agentik_Engine/omega_engine/learning.py +268 -0
  176. package/omega/Agentik_Engine/omega_engine/managed_agent.py +467 -0
  177. package/omega/Agentik_Engine/omega_engine/memory.py +271 -0
  178. package/omega/Agentik_Engine/omega_engine/menu.py +1065 -0
  179. package/omega/Agentik_Engine/omega_engine/migrations/__init__.py +144 -0
  180. package/omega/Agentik_Engine/omega_engine/migrations/__pycache__/__init__.cpython-313.pyc +0 -0
  181. package/omega/Agentik_Engine/omega_engine/migrations/__pycache__/v0_14_0.cpython-313.pyc +0 -0
  182. package/omega/Agentik_Engine/omega_engine/migrations/v0_14_0.py +29 -0
  183. package/omega/Agentik_Engine/omega_engine/mission.py +16 -13
  184. package/omega/Agentik_Engine/omega_engine/plan.py +846 -0
  185. package/omega/Agentik_Engine/omega_engine/prompts.py +158 -0
  186. package/omega/Agentik_Engine/omega_engine/provider.py +161 -12
  187. package/omega/Agentik_Engine/omega_engine/prune.py +151 -0
  188. package/omega/Agentik_Engine/omega_engine/pursue.py +205 -0
  189. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/__init__.cpython-313.pyc +0 -0
  190. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/agentic.cpython-313.pyc +0 -0
  191. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/base.cpython-313.pyc +0 -0
  192. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/corrective.cpython-313.pyc +0 -0
  193. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/graph.cpython-313.pyc +0 -0
  194. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/hybrid.cpython-313.pyc +0 -0
  195. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/multimodal.cpython-313.pyc +0 -0
  196. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/router.cpython-313.pyc +0 -0
  197. package/omega/Agentik_Engine/omega_engine/router.py +28 -0
  198. package/omega/Agentik_Engine/omega_engine/skill_discovery/__init__.py +48 -0
  199. package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/__init__.cpython-313.pyc +0 -0
  200. package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/auditor.cpython-313.pyc +0 -0
  201. package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/finder.cpython-313.pyc +0 -0
  202. package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/installer.cpython-313.pyc +0 -0
  203. package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/marketplaces.cpython-313.pyc +0 -0
  204. package/omega/Agentik_Engine/omega_engine/skill_discovery/auditor.py +232 -0
  205. package/omega/Agentik_Engine/omega_engine/skill_discovery/finder.py +94 -0
  206. package/omega/Agentik_Engine/omega_engine/skill_discovery/installer.py +129 -0
  207. package/omega/Agentik_Engine/omega_engine/skill_discovery/marketplaces.py +80 -0
  208. package/omega/Agentik_Engine/omega_engine/skill_routing.py +388 -0
  209. package/omega/Agentik_Engine/omega_engine/smoke.py +81 -0
  210. package/omega/Agentik_Engine/omega_engine/store.py +88 -41
  211. package/omega/Agentik_Engine/omega_engine/sync.py +142 -1
  212. package/omega/Agentik_Engine/omega_engine/telegram_history.py +260 -0
  213. package/omega/Agentik_Engine/omega_engine/tmux.py +526 -0
  214. package/omega/Agentik_Engine/omega_engine/understand_anything.py +275 -0
  215. package/omega/Agentik_Engine/omega_engine/updater.py +70 -0
  216. package/omega/Agentik_Engine/omega_engine/validate.py +186 -0
  217. package/omega/Agentik_Engine/omega_engine/vault.py +342 -0
  218. package/omega/Agentik_Engine/omega_engine/webhooks.py +262 -0
  219. package/omega/Agentik_Engine/omega_engine/worker.py +526 -0
  220. package/omega/Agentik_Engine/pyproject.toml +1 -1
  221. package/omega/Agentik_Engine/tests/__pycache__/test_account.cpython-313-pytest-8.4.2.pyc +0 -0
  222. package/omega/Agentik_Engine/tests/__pycache__/test_account.cpython-313.pyc +0 -0
  223. package/omega/Agentik_Engine/tests/__pycache__/test_adversarial.cpython-313-pytest-8.4.2.pyc +0 -0
  224. package/omega/Agentik_Engine/tests/__pycache__/test_adversarial.cpython-313.pyc +0 -0
  225. package/omega/Agentik_Engine/tests/__pycache__/test_agents_envelope.cpython-313-pytest-8.4.2.pyc +0 -0
  226. package/omega/Agentik_Engine/tests/__pycache__/test_agents_envelope.cpython-313.pyc +0 -0
  227. package/omega/Agentik_Engine/tests/__pycache__/test_audit_arsenal.cpython-313-pytest-8.4.2.pyc +0 -0
  228. package/omega/Agentik_Engine/tests/__pycache__/test_audit_arsenal.cpython-313.pyc +0 -0
  229. package/omega/Agentik_Engine/tests/__pycache__/test_audits_pipeline.cpython-313-pytest-8.4.2.pyc +0 -0
  230. package/omega/Agentik_Engine/tests/__pycache__/test_audits_pipeline.cpython-313.pyc +0 -0
  231. package/omega/Agentik_Engine/tests/__pycache__/test_auto_update_and_migrations.cpython-313-pytest-8.4.2.pyc +0 -0
  232. package/omega/Agentik_Engine/tests/__pycache__/test_auto_update_and_migrations.cpython-313.pyc +0 -0
  233. package/omega/Agentik_Engine/tests/__pycache__/test_autonomous.cpython-313-pytest-8.4.2.pyc +0 -0
  234. package/omega/Agentik_Engine/tests/__pycache__/test_autonomous.cpython-313.pyc +0 -0
  235. package/omega/Agentik_Engine/tests/__pycache__/test_educators.cpython-313-pytest-8.4.2.pyc +0 -0
  236. package/omega/Agentik_Engine/tests/__pycache__/test_educators.cpython-313.pyc +0 -0
  237. package/omega/Agentik_Engine/tests/__pycache__/test_executor.cpython-313-pytest-8.4.2.pyc +0 -0
  238. package/omega/Agentik_Engine/tests/__pycache__/test_executor.cpython-313.pyc +0 -0
  239. package/omega/Agentik_Engine/tests/__pycache__/test_genesis_and_plan.cpython-313-pytest-8.4.2.pyc +0 -0
  240. package/omega/Agentik_Engine/tests/__pycache__/test_genesis_and_plan.cpython-313.pyc +0 -0
  241. package/omega/Agentik_Engine/tests/__pycache__/test_graphify.cpython-313-pytest-8.4.2.pyc +0 -0
  242. package/omega/Agentik_Engine/tests/__pycache__/test_graphify.cpython-313.pyc +0 -0
  243. package/omega/Agentik_Engine/tests/__pycache__/test_handoff.cpython-313-pytest-8.4.2.pyc +0 -0
  244. package/omega/Agentik_Engine/tests/__pycache__/test_handoff.cpython-313.pyc +0 -0
  245. package/omega/Agentik_Engine/tests/__pycache__/test_hermes_and_ua.cpython-313-pytest-8.4.2.pyc +0 -0
  246. package/omega/Agentik_Engine/tests/__pycache__/test_hermes_and_ua.cpython-313.pyc +0 -0
  247. package/omega/Agentik_Engine/tests/__pycache__/test_hermes_bootstrap_and_desktop.cpython-313-pytest-8.4.2.pyc +0 -0
  248. package/omega/Agentik_Engine/tests/__pycache__/test_hermes_bootstrap_and_desktop.cpython-313.pyc +0 -0
  249. package/omega/Agentik_Engine/tests/__pycache__/test_install_steps.cpython-313-pytest-8.4.2.pyc +0 -0
  250. package/omega/Agentik_Engine/tests/__pycache__/test_install_steps.cpython-313.pyc +0 -0
  251. package/omega/Agentik_Engine/tests/__pycache__/test_install_ux.cpython-313-pytest-8.4.2.pyc +0 -0
  252. package/omega/Agentik_Engine/tests/__pycache__/test_install_ux.cpython-313.pyc +0 -0
  253. package/omega/Agentik_Engine/tests/__pycache__/test_installer_wiring.cpython-313-pytest-8.4.2.pyc +0 -0
  254. package/omega/Agentik_Engine/tests/__pycache__/test_installer_wiring.cpython-313.pyc +0 -0
  255. package/omega/Agentik_Engine/tests/__pycache__/test_intelligence.cpython-313-pytest-8.4.2.pyc +0 -0
  256. package/omega/Agentik_Engine/tests/__pycache__/test_intelligence.cpython-313.pyc +0 -0
  257. package/omega/Agentik_Engine/tests/__pycache__/test_llm_clis_and_uninstall.cpython-313-pytest-8.4.2.pyc +0 -0
  258. package/omega/Agentik_Engine/tests/__pycache__/test_llm_clis_and_uninstall.cpython-313.pyc +0 -0
  259. package/omega/Agentik_Engine/tests/__pycache__/test_managed_agent.cpython-313-pytest-8.4.2.pyc +0 -0
  260. package/omega/Agentik_Engine/tests/__pycache__/test_managed_agent.cpython-313.pyc +0 -0
  261. package/omega/Agentik_Engine/tests/__pycache__/test_max_provider_and_menu.cpython-313-pytest-8.4.2.pyc +0 -0
  262. package/omega/Agentik_Engine/tests/__pycache__/test_max_provider_and_menu.cpython-313.pyc +0 -0
  263. package/omega/Agentik_Engine/tests/__pycache__/test_menu_coverage.cpython-313-pytest-8.4.2.pyc +0 -0
  264. package/omega/Agentik_Engine/tests/__pycache__/test_menu_coverage.cpython-313.pyc +0 -0
  265. package/omega/Agentik_Engine/tests/__pycache__/test_mission.cpython-313-pytest-8.4.2.pyc +0 -0
  266. package/omega/Agentik_Engine/tests/__pycache__/test_mission.cpython-313.pyc +0 -0
  267. package/omega/Agentik_Engine/tests/__pycache__/test_progress.cpython-313-pytest-8.4.2.pyc +0 -0
  268. package/omega/Agentik_Engine/tests/__pycache__/test_progress.cpython-313.pyc +0 -0
  269. package/omega/Agentik_Engine/tests/__pycache__/test_project.cpython-313-pytest-8.4.2.pyc +0 -0
  270. package/omega/Agentik_Engine/tests/__pycache__/test_project.cpython-313.pyc +0 -0
  271. package/omega/Agentik_Engine/tests/__pycache__/test_pursue_cadence.cpython-313-pytest-8.4.2.pyc +0 -0
  272. package/omega/Agentik_Engine/tests/__pycache__/test_pursue_cadence.cpython-313.pyc +0 -0
  273. package/omega/Agentik_Engine/tests/__pycache__/test_rag.cpython-313-pytest-8.4.2.pyc +0 -0
  274. package/omega/Agentik_Engine/tests/__pycache__/test_rag.cpython-313.pyc +0 -0
  275. package/omega/Agentik_Engine/tests/__pycache__/test_reducer.cpython-313-pytest-8.4.2.pyc +0 -0
  276. package/omega/Agentik_Engine/tests/__pycache__/test_reducer.cpython-313.pyc +0 -0
  277. package/omega/Agentik_Engine/tests/__pycache__/test_report.cpython-313-pytest-8.4.2.pyc +0 -0
  278. package/omega/Agentik_Engine/tests/__pycache__/test_report.cpython-313.pyc +0 -0
  279. package/omega/Agentik_Engine/tests/__pycache__/test_role_aliases_and_ssot.cpython-313-pytest-8.4.2.pyc +0 -0
  280. package/omega/Agentik_Engine/tests/__pycache__/test_role_aliases_and_ssot.cpython-313.pyc +0 -0
  281. package/omega/Agentik_Engine/tests/__pycache__/test_skill_discovery_and_gate.cpython-313-pytest-8.4.2.pyc +0 -0
  282. package/omega/Agentik_Engine/tests/__pycache__/test_skill_discovery_and_gate.cpython-313.pyc +0 -0
  283. package/omega/Agentik_Engine/tests/__pycache__/test_skill_power.cpython-313-pytest-8.4.2.pyc +0 -0
  284. package/omega/Agentik_Engine/tests/__pycache__/test_skill_power.cpython-313.pyc +0 -0
  285. package/omega/Agentik_Engine/tests/__pycache__/test_skill_routing.cpython-313-pytest-8.4.2.pyc +0 -0
  286. package/omega/Agentik_Engine/tests/__pycache__/test_skill_routing.cpython-313.pyc +0 -0
  287. package/omega/Agentik_Engine/tests/__pycache__/test_snapshot_partial.cpython-313-pytest-8.4.2.pyc +0 -0
  288. package/omega/Agentik_Engine/tests/__pycache__/test_snapshot_partial.cpython-313.pyc +0 -0
  289. package/omega/Agentik_Engine/tests/__pycache__/test_telegram_history.cpython-313-pytest-8.4.2.pyc +0 -0
  290. package/omega/Agentik_Engine/tests/__pycache__/test_telegram_history.cpython-313.pyc +0 -0
  291. package/omega/Agentik_Engine/tests/__pycache__/test_tmux_and_aisb_chat.cpython-313-pytest-8.4.2.pyc +0 -0
  292. package/omega/Agentik_Engine/tests/__pycache__/test_tmux_and_aisb_chat.cpython-313.pyc +0 -0
  293. package/omega/Agentik_Engine/tests/__pycache__/test_tools_and_sync.cpython-313-pytest-8.4.2.pyc +0 -0
  294. package/omega/Agentik_Engine/tests/__pycache__/test_tools_and_sync.cpython-313.pyc +0 -0
  295. package/omega/Agentik_Engine/tests/__pycache__/test_v06_features.cpython-313-pytest-8.4.2.pyc +0 -0
  296. package/omega/Agentik_Engine/tests/__pycache__/test_v06_features.cpython-313.pyc +0 -0
  297. package/omega/Agentik_Engine/tests/__pycache__/test_vault.cpython-313-pytest-8.4.2.pyc +0 -0
  298. package/omega/Agentik_Engine/tests/__pycache__/test_vault.cpython-313.pyc +0 -0
  299. package/omega/Agentik_Engine/tests/__pycache__/test_webhooks_and_readiness.cpython-313-pytest-8.4.2.pyc +0 -0
  300. package/omega/Agentik_Engine/tests/__pycache__/test_webhooks_and_readiness.cpython-313.pyc +0 -0
  301. package/omega/Agentik_Engine/tests/__pycache__/test_worker_and_cleanup.cpython-313-pytest-8.4.2.pyc +0 -0
  302. package/omega/Agentik_Engine/tests/__pycache__/test_worker_and_cleanup.cpython-313.pyc +0 -0
  303. package/omega/Agentik_Engine/tests/test_account.py +8 -3
  304. package/omega/Agentik_Engine/tests/test_adversarial.py +351 -0
  305. package/omega/Agentik_Engine/tests/test_agents_envelope.py +274 -0
  306. package/omega/Agentik_Engine/tests/test_audits_pipeline.py +348 -0
  307. package/omega/Agentik_Engine/tests/test_auto_update_and_migrations.py +394 -0
  308. package/omega/Agentik_Engine/tests/test_genesis_and_plan.py +573 -0
  309. package/omega/Agentik_Engine/tests/test_graphify.py +190 -0
  310. package/omega/Agentik_Engine/tests/test_handoff.py +311 -0
  311. package/omega/Agentik_Engine/tests/test_hermes_and_ua.py +387 -0
  312. package/omega/Agentik_Engine/tests/test_hermes_bootstrap_and_desktop.py +358 -0
  313. package/omega/Agentik_Engine/tests/test_install_steps.py +359 -0
  314. package/omega/Agentik_Engine/tests/test_install_ux.py +151 -0
  315. package/omega/Agentik_Engine/tests/test_installer_wiring.py +496 -0
  316. package/omega/Agentik_Engine/tests/test_intelligence.py +285 -0
  317. package/omega/Agentik_Engine/tests/test_llm_clis_and_uninstall.py +228 -0
  318. package/omega/Agentik_Engine/tests/test_managed_agent.py +363 -0
  319. package/omega/Agentik_Engine/tests/test_max_provider_and_menu.py +231 -0
  320. package/omega/Agentik_Engine/tests/test_menu_coverage.py +72 -0
  321. package/omega/Agentik_Engine/tests/test_pursue_cadence.py +217 -0
  322. package/omega/Agentik_Engine/tests/test_role_aliases_and_ssot.py +207 -0
  323. package/omega/Agentik_Engine/tests/test_skill_discovery_and_gate.py +337 -0
  324. package/omega/Agentik_Engine/tests/test_skill_power.py +259 -0
  325. package/omega/Agentik_Engine/tests/test_skill_routing.py +189 -0
  326. package/omega/Agentik_Engine/tests/test_telegram_history.py +209 -0
  327. package/omega/Agentik_Engine/tests/test_tmux_and_aisb_chat.py +223 -0
  328. package/omega/Agentik_Engine/tests/test_v06_features.py +370 -0
  329. package/omega/Agentik_Engine/tests/test_vault.py +173 -0
  330. package/omega/Agentik_Engine/tests/test_webhooks_and_readiness.py +277 -0
  331. package/omega/Agentik_Engine/tests/test_worker_and_cleanup.py +541 -0
  332. package/omega/Agentik_Extra/etc/secrets/.vault-key +3 -0
  333. package/omega/Agentik_Extra/etc/secrets/.vault-pub +1 -0
  334. package/omega/Agentik_Runtime/audits.db +0 -0
  335. package/omega/Agentik_SSOT/VERSION +1 -1
  336. package/omega/Agentik_SSOT/claude-plugins/claude-plugins.yaml +100 -0
  337. package/omega/Agentik_SSOT/docs/LAYERS.md +90 -0
  338. package/omega/Agentik_SSOT/docs/USER-JOURNEY.md +283 -0
  339. package/omega/Agentik_SSOT/docs/quality-arsenal/ARSENAL-INTERCONNECTIONS.md +283 -0
  340. package/omega/Agentik_SSOT/docs/quality-arsenal/ARSENAL-ORCHESTRATION-PLAYBOOK.md +364 -0
  341. package/omega/Agentik_SSOT/docs/quality-arsenal/AUDIT-VERIFICATION-CONTRACT.md +272 -0
  342. package/omega/Agentik_SSOT/docs/quality-arsenal/QUALITY-ARSENAL-PREAMBLE.md +462 -0
  343. package/omega/Agentik_SSOT/marketplaces/design-discipline.yaml +86 -0
  344. package/omega/Agentik_SSOT/skills/a11yaudit/SKILL.md +161 -0
  345. package/omega/Agentik_SSOT/skills/apiaudit/SKILL.md +157 -0
  346. package/omega/Agentik_SSOT/skills/audit-orchestrator.md +212 -0
  347. package/omega/Agentik_SSOT/skills/audit-pilot.md +466 -0
  348. package/omega/Agentik_SSOT/skills/audit-tracker.md +147 -0
  349. package/omega/Agentik_SSOT/skills/automationaudit/SKILL.md +161 -0
  350. package/omega/Agentik_SSOT/skills/cadence/SKILL.md +76 -0
  351. package/omega/Agentik_SSOT/skills/codeaudit/SKILL.md +153 -0
  352. package/omega/Agentik_SSOT/skills/copyaudit/SKILL.md +161 -0
  353. package/omega/Agentik_SSOT/skills/dataaudit/SKILL.md +157 -0
  354. package/omega/Agentik_SSOT/skills/debugaudit/SKILL.md +161 -0
  355. package/omega/Agentik_SSOT/skills/dispatch/SKILL.md +79 -0
  356. package/omega/Agentik_SSOT/skills/dxaudit/SKILL.md +161 -0
  357. package/omega/Agentik_SSOT/skills/featureaudit/SKILL.md +161 -0
  358. package/omega/Agentik_SSOT/skills/flowaudit/SKILL.md +165 -0
  359. package/omega/Agentik_SSOT/skills/genesis/SKILL.md +116 -0
  360. package/omega/Agentik_SSOT/skills/handoff/SKILL.md +117 -0
  361. package/omega/Agentik_SSOT/skills/logicaudit/SKILL.md +165 -0
  362. package/omega/Agentik_SSOT/skills/motionaudit/SKILL.md +165 -0
  363. package/omega/Agentik_SSOT/skills/newcmd.md +300 -0
  364. package/omega/Agentik_SSOT/skills/perfaudit/SKILL.md +161 -0
  365. package/omega/Agentik_SSOT/skills/plan/SKILL.md +127 -0
  366. package/omega/Agentik_SSOT/skills/pursue/SKILL.md +68 -0
  367. package/omega/Agentik_SSOT/skills/quality-arsenal.md +180 -0
  368. package/omega/Agentik_SSOT/skills/rag-route.md +9 -0
  369. package/omega/Agentik_SSOT/skills/refontaudit/SKILL.md +165 -0
  370. package/omega/Agentik_SSOT/skills/retentionaudit/SKILL.md +165 -0
  371. package/omega/Agentik_SSOT/skills/secaudit/SKILL.md +157 -0
  372. package/omega/Agentik_SSOT/skills/seoaudit/SKILL.md +161 -0
  373. package/omega/Agentik_SSOT/skills/skill-auditor/SKILL.md +83 -0
  374. package/omega/Agentik_SSOT/skills/skill-finder/SKILL.md +116 -0
  375. package/omega/Agentik_SSOT/skills/uiuxaudit/SKILL.md +165 -0
  376. package/package.json +2 -2
@@ -0,0 +1,285 @@
1
+ """Tests for the v0.9 "intelligence" layer:
2
+
3
+ classifier.py — task complexity classification
4
+ memory.py — cross-source semantic search
5
+ learning.py — Smith reflection on audit + worker history
6
+ agent_messages.py — worker ↔ oracle messaging
7
+ """
8
+ from __future__ import annotations
9
+
10
+ import json
11
+ import sys
12
+ import tempfile
13
+ import time
14
+ import unittest
15
+ from pathlib import Path
16
+ from unittest import mock
17
+
18
+
19
+ HERE = Path(__file__).resolve().parent
20
+ sys.path.insert(0, str(HERE.parent))
21
+
22
+
23
+ # ---------------------------------------------------------------------------
24
+ # classifier.py
25
+ # ---------------------------------------------------------------------------
26
+
27
+
28
+ class TestClassifier(unittest.TestCase):
29
+ def test_empty_is_simple(self):
30
+ from omega_engine.classifier import classify
31
+ c = classify("")
32
+ self.assertEqual(c.bucket, "simple")
33
+ self.assertEqual(c.confidence, "high")
34
+
35
+ def test_architect_role_always_complex(self):
36
+ from omega_engine.classifier import classify
37
+ c = classify("rename a variable", role="architect")
38
+ self.assertEqual(c.bucket, "complex")
39
+
40
+ def test_oracle_role_is_moderate(self):
41
+ from omega_engine.classifier import classify
42
+ c = classify("anything", role="oracle")
43
+ self.assertEqual(c.bucket, "moderate")
44
+
45
+ def test_complex_keywords(self):
46
+ from omega_engine.classifier import classify
47
+ c = classify(
48
+ "design a security architecture for the auth refactor",
49
+ role="worker",
50
+ )
51
+ self.assertEqual(c.bucket, "complex")
52
+ self.assertEqual(c.suggested_model, "opus")
53
+
54
+ def test_simple_keyword_short(self):
55
+ from omega_engine.classifier import classify
56
+ c = classify("rename Foo to Bar in utils.py", role="worker")
57
+ self.assertEqual(c.bucket, "simple")
58
+ self.assertEqual(c.suggested_model, "haiku")
59
+
60
+ def test_file_count_complex(self):
61
+ from omega_engine.classifier import classify
62
+ c = classify("update 12 files for the new API", role="worker")
63
+ self.assertEqual(c.bucket, "complex")
64
+
65
+ def test_long_description_complex(self):
66
+ from omega_engine.classifier import classify
67
+ long_text = (
68
+ "We need to investigate the recent performance regression on "
69
+ "the dashboard route. The user reports load times went from "
70
+ "1.2s to 4.5s in the last two weeks. Look at the bundle, "
71
+ "the database queries, the cache, and the rendering "
72
+ "pipeline. Identify the regression and propose a fix that "
73
+ "we can ship today."
74
+ )
75
+ c = classify(long_text, role="worker")
76
+ # Has "investigate", "performance" → complex
77
+ self.assertEqual(c.bucket, "complex")
78
+
79
+ def test_moderate_keyword(self):
80
+ from omega_engine.classifier import classify
81
+ # 'implement' + medium length but no complex keyword → moderate
82
+ c = classify("implement the password validator function",
83
+ role="worker")
84
+ self.assertEqual(c.bucket, "moderate")
85
+ self.assertEqual(c.suggested_model, "sonnet")
86
+
87
+
88
+ # ---------------------------------------------------------------------------
89
+ # memory.py
90
+ # ---------------------------------------------------------------------------
91
+
92
+
93
+ class TestMemory(unittest.TestCase):
94
+ def _seed(self, home: Path):
95
+ # Telegram history
96
+ from omega_engine.telegram_history import (
97
+ record_inbound, record_outbound,
98
+ )
99
+ record_inbound(home, topic_id=1, text="we decided to use age for vault encryption")
100
+ record_outbound(home, topic_id=1, text="confirmed; vault keys live in Agentik_Extra")
101
+ record_inbound(home, topic_id=2, text="the login bug returns 500 on Safari")
102
+ # .done.json
103
+ from omega_engine.done_signal import DoneSignal, write_done
104
+ write_done(home, "t-abc", DoneSignal(
105
+ status="done_clean", summary="fixed the login bug for Safari",
106
+ files_changed=["src/auth.py"],
107
+ ))
108
+ # Audit history
109
+ from omega_engine.audits.history import (
110
+ AuditRun, make_run_id, now, record_run,
111
+ )
112
+ record_run(home, AuditRun(
113
+ run_id=make_run_id(), audit_id="codeaudit",
114
+ scope=".", timestamp=now(),
115
+ score=88, verified=True, finding_count=2,
116
+ verdict={"summary": "code passes with two minor warnings",
117
+ "findings": []},
118
+ ))
119
+
120
+ def test_reindex_counts_each_source(self):
121
+ from omega_engine import memory
122
+ with tempfile.TemporaryDirectory() as td:
123
+ home = Path(td)
124
+ self._seed(home)
125
+ counts = memory.reindex(home)
126
+ self.assertGreaterEqual(counts["telegram"], 3)
127
+ self.assertGreaterEqual(counts["done_json"], 1)
128
+ self.assertGreaterEqual(counts["audit"], 1)
129
+ self.assertEqual(counts["total"],
130
+ counts["telegram"] + counts["done_json"]
131
+ + counts["audit"])
132
+
133
+ def test_search_finds_across_sources(self):
134
+ from omega_engine import memory
135
+ with tempfile.TemporaryDirectory() as td:
136
+ home = Path(td)
137
+ self._seed(home)
138
+ memory.reindex(home)
139
+ hits = memory.search(home, "vault", k=5)
140
+ sources = {h.source for h in hits}
141
+ # We seeded "vault encryption" in telegram — should find it.
142
+ self.assertIn("telegram", sources)
143
+
144
+ def test_search_returns_login_bug_done_json(self):
145
+ from omega_engine import memory
146
+ with tempfile.TemporaryDirectory() as td:
147
+ home = Path(td)
148
+ self._seed(home)
149
+ memory.reindex(home)
150
+ hits = memory.search(home, "login bug", k=5)
151
+ # The .done.json text mentions "login bug" — should appear.
152
+ sources = {h.source for h in hits}
153
+ self.assertTrue("done_json" in sources or "telegram" in sources)
154
+
155
+ def test_index_stats(self):
156
+ from omega_engine import memory
157
+ with tempfile.TemporaryDirectory() as td:
158
+ home = Path(td)
159
+ self._seed(home)
160
+ memory.reindex(home)
161
+ stats = memory.index_stats(home)
162
+ self.assertTrue(stats["indexed"])
163
+ self.assertGreater(stats["total"], 0)
164
+
165
+
166
+ # ---------------------------------------------------------------------------
167
+ # learning.py — Smith reflection
168
+ # ---------------------------------------------------------------------------
169
+
170
+
171
+ class TestLearning(unittest.TestCase):
172
+ def test_weak_audit_insight(self):
173
+ from omega_engine.audits.history import (
174
+ AuditRun, make_run_id, record_run,
175
+ )
176
+ from omega_engine.learning import reflect
177
+ with tempfile.TemporaryDirectory() as td:
178
+ now_s = int(time.time())
179
+ # Seed 4 codeaudit runs all below threshold.
180
+ for i in range(4):
181
+ record_run(td, AuditRun(
182
+ run_id=make_run_id(), audit_id="codeaudit",
183
+ scope=".", timestamp=now_s - i * 3600,
184
+ score=55 + i * 2, verified=False, finding_count=10,
185
+ verdict={"findings": []},
186
+ ))
187
+ report = reflect(td, write_proposals=False)
188
+ kinds = {i.kind for i in report.insights}
189
+ self.assertIn("weak_audit", kinds)
190
+ titles = " ".join(i.title for i in report.insights)
191
+ self.assertIn("codeaudit", titles)
192
+
193
+ def test_repeated_pending_action_insight(self):
194
+ from omega_engine.done_signal import DoneSignal, write_done
195
+ from omega_engine.learning import reflect
196
+ with tempfile.TemporaryDirectory() as td:
197
+ for i in range(12):
198
+ write_done(td, f"t-{i}", DoneSignal(
199
+ status="pending",
200
+ summary=f"part {i}",
201
+ pending_actions=["write the unit test for X"],
202
+ ))
203
+ report = reflect(td, write_proposals=False)
204
+ kinds = [i.kind for i in report.insights]
205
+ self.assertIn("skill_suggestion", kinds)
206
+
207
+ def test_write_proposals_creates_files(self):
208
+ from omega_engine.audits.history import (
209
+ AuditRun, make_run_id, record_run,
210
+ )
211
+ from omega_engine.learning import reflect
212
+ with tempfile.TemporaryDirectory() as td:
213
+ now_s = int(time.time())
214
+ for i in range(4):
215
+ record_run(td, AuditRun(
216
+ run_id=make_run_id(), audit_id="seoaudit",
217
+ scope=".", timestamp=now_s - i * 3600,
218
+ score=40, verified=False, finding_count=10,
219
+ verdict={"findings": []},
220
+ ))
221
+ report = reflect(td, write_proposals=True)
222
+ staging = Path(td) / "Agentik_Extra" / "staging" / "promotion"
223
+ files = list(staging.glob("smith-*.json"))
224
+ self.assertGreater(len(files), 0)
225
+ # Each file is parseable JSON with the expected schema.
226
+ data = json.loads(files[0].read_text())
227
+ self.assertIn("kind", data)
228
+ self.assertIn("title", data)
229
+
230
+
231
+ # ---------------------------------------------------------------------------
232
+ # agent_messages.py
233
+ # ---------------------------------------------------------------------------
234
+
235
+
236
+ class TestAgentMessages(unittest.TestCase):
237
+ def test_send_and_read_round_trip(self):
238
+ from omega_engine import agent_messages as am
239
+ with tempfile.TemporaryDirectory() as td:
240
+ am.send(td, "t-1", from_="worker", to="oracle",
241
+ type="question", text="should I bump the version?")
242
+ am.send(td, "t-1", from_="oracle", to="worker",
243
+ type="answer", text="yes, semver minor.")
244
+ msgs = am.read(td, "t-1")
245
+ self.assertEqual(len(msgs), 2)
246
+ self.assertEqual(msgs[0].type, "question")
247
+ self.assertEqual(msgs[1].type, "answer")
248
+
249
+ def test_recipient_filter(self):
250
+ from omega_engine import agent_messages as am
251
+ with tempfile.TemporaryDirectory() as td:
252
+ am.send(td, "t-2", from_="worker", to="oracle",
253
+ type="question", text="for oracle")
254
+ am.send(td, "t-2", from_="worker", to="manager",
255
+ type="question", text="for manager")
256
+ for_oracle = am.read(td, "t-2", for_recipient="oracle")
257
+ self.assertEqual(len(for_oracle), 1)
258
+ self.assertEqual(for_oracle[0].text, "for oracle")
259
+
260
+ def test_open_questions(self):
261
+ from omega_engine import agent_messages as am
262
+ with tempfile.TemporaryDirectory() as td:
263
+ # task A: question without answer
264
+ am.send(td, "task-A", from_="worker", to="oracle",
265
+ type="question", text="answer me")
266
+ # task B: question with answer (no longer open)
267
+ am.send(td, "task-B", from_="worker", to="oracle",
268
+ type="question", text="x")
269
+ am.send(td, "task-B", from_="oracle", to="worker",
270
+ type="answer", text="y")
271
+ opens = am.list_open_questions(td)
272
+ tasks = {pair[0] for pair in opens}
273
+ self.assertIn("task-A", tasks)
274
+ self.assertNotIn("task-B", tasks)
275
+
276
+ def test_rejects_unknown_type(self):
277
+ from omega_engine import agent_messages as am
278
+ with tempfile.TemporaryDirectory() as td:
279
+ with self.assertRaises(ValueError):
280
+ am.send(td, "t-3", from_="a", to="b",
281
+ type="invalid", text="x")
282
+
283
+
284
+ if __name__ == "__main__":
285
+ unittest.main(verbosity=2)
@@ -0,0 +1,228 @@
1
+ """Tests for the LLM CLI helper + omega uninstall + omega upgrade.
2
+
3
+ The helper is at ``bootstrap/lib/llm-clis.py`` — loadable as a module
4
+ via importlib.util because of the hyphen in the filename. We exercise:
5
+
6
+ * CliSpec.is_installed() resolves to PATH presence.
7
+ * _selection_from_manifest reads the list AND dict forms.
8
+ * install_cli short-circuits on already-installed.
9
+ * uninstall_cli reverses npm/uv/pip commands.
10
+ * cmd_uninstall removes the 8-block tree and strips settings.json
11
+ keys (idempotent + safe with a fake HOME).
12
+ """
13
+ from __future__ import annotations
14
+
15
+ import importlib.util
16
+ import io
17
+ import json
18
+ import os
19
+ import sys
20
+ import tempfile
21
+ import unittest
22
+ from pathlib import Path
23
+ from unittest import mock
24
+
25
+ import yaml
26
+
27
+
28
+ HERE = Path(__file__).resolve().parent
29
+ sys.path.insert(0, str(HERE.parent))
30
+
31
+ REPO_ROOT = HERE.parent.parent.parent
32
+ HELPER = REPO_ROOT / "bootstrap" / "lib" / "llm-clis.py"
33
+
34
+
35
+ def _load_helper():
36
+ """Load bootstrap/lib/llm-clis.py as a module.
37
+
38
+ Python 3.13's dataclasses inspects ``sys.modules[cls.__module__]``,
39
+ so we must register the freshly loaded module BEFORE exec_module
40
+ runs the class-definitions inside.
41
+ """
42
+ spec = importlib.util.spec_from_file_location("llm_clis", str(HELPER))
43
+ mod = importlib.util.module_from_spec(spec)
44
+ sys.modules["llm_clis"] = mod
45
+ spec.loader.exec_module(mod) # type: ignore[union-attr]
46
+ return mod
47
+
48
+
49
+ class TestCliSpec(unittest.TestCase):
50
+ def test_is_installed_false_when_missing(self):
51
+ mod = _load_helper()
52
+ spec = mod.CliSpec(
53
+ id="x", label="x", bin_name="definitely-not-a-real-binary-1234",
54
+ install_cmd=["npm", "install", "-g", "x"],
55
+ )
56
+ self.assertFalse(spec.is_installed())
57
+ self.assertIsNone(spec.installed_version())
58
+
59
+ def test_is_installed_true_when_present(self):
60
+ mod = _load_helper()
61
+ # `python3` is always on PATH in our test env.
62
+ spec = mod.CliSpec(
63
+ id="py", label="python", bin_name="python3",
64
+ install_cmd=["echo", "noop"],
65
+ version_cmd=["python3", "--version"],
66
+ )
67
+ self.assertTrue(spec.is_installed())
68
+ v = spec.installed_version()
69
+ self.assertIsNotNone(v)
70
+ self.assertIn("Python", v or "")
71
+
72
+
73
+ class TestManifestParsing(unittest.TestCase):
74
+ def test_list_form(self):
75
+ mod = _load_helper()
76
+ with tempfile.TemporaryDirectory() as td:
77
+ p = Path(td) / "m.yaml"
78
+ p.write_text(yaml.safe_dump({
79
+ "llm_clis": ["claude_code", "gemini_cli"],
80
+ }))
81
+ self.assertEqual(
82
+ mod._selection_from_manifest(p),
83
+ {"claude_code", "gemini_cli"},
84
+ )
85
+
86
+ def test_dict_form_filters_false(self):
87
+ mod = _load_helper()
88
+ with tempfile.TemporaryDirectory() as td:
89
+ p = Path(td) / "m.yaml"
90
+ p.write_text(yaml.safe_dump({
91
+ "llm_clis": {
92
+ "claude_code": True,
93
+ "gemini_cli": True,
94
+ "codex": False,
95
+ },
96
+ }))
97
+ self.assertEqual(
98
+ mod._selection_from_manifest(p),
99
+ {"claude_code", "gemini_cli"},
100
+ )
101
+
102
+ def test_no_block_returns_none(self):
103
+ mod = _load_helper()
104
+ with tempfile.TemporaryDirectory() as td:
105
+ p = Path(td) / "m.yaml"
106
+ p.write_text(yaml.safe_dump({"profile": "vps"}))
107
+ self.assertIsNone(mod._selection_from_manifest(p))
108
+
109
+
110
+ class TestInstallShortCircuits(unittest.TestCase):
111
+ def test_already_installed_skips(self):
112
+ mod = _load_helper()
113
+ spec = mod.CliSpec(
114
+ id="py", label="python", bin_name="python3",
115
+ install_cmd=["echo", "noop"],
116
+ version_cmd=["python3", "--version"],
117
+ )
118
+ result = mod.install_cli(spec, force=False)
119
+ self.assertEqual(result["status"], "skip")
120
+ self.assertEqual(result["reason"], "already installed")
121
+
122
+ def test_unknown_tool_errors_cleanly(self):
123
+ mod = _load_helper()
124
+ spec = mod.CliSpec(
125
+ id="x", label="x", bin_name="not-real-x-1234",
126
+ install_cmd=["definitely-not-a-real-tool-9999",
127
+ "install", "x"],
128
+ )
129
+ result = mod.install_cli(spec)
130
+ self.assertEqual(result["status"], "error")
131
+ self.assertIn("not on PATH", result["reason"])
132
+
133
+
134
+ class TestUninstallCommand(unittest.TestCase):
135
+ def test_uninstall_strips_settings_keys(self):
136
+ # Simulate a settings.json that was previously merged by step 33.
137
+ with tempfile.TemporaryDirectory() as td:
138
+ home = Path(td) / "Omega"
139
+ home.mkdir(parents=True)
140
+ # Minimal 8-block tree.
141
+ for b in ("Agentik_SSOT", "Agentik_Engine", "Agentik_Orchestration",
142
+ "Agentik_Providers", "Agentik_Coding", "Agentik_Tools",
143
+ "Agentik_Runtime", "Agentik_Extra"):
144
+ (home / b).mkdir()
145
+
146
+ fake_home = Path(td) / "fake-home"
147
+ settings = fake_home / ".claude" / "settings.json"
148
+ settings.parent.mkdir(parents=True)
149
+ settings.write_text(json.dumps({
150
+ "env": {
151
+ "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1",
152
+ "OPERATOR_OWN_KEY": "preserve me",
153
+ },
154
+ "permissions": {"defaultMode": "bypassPermissions"},
155
+ "hooks": {
156
+ "Stop": [
157
+ {"tag": "omega-audit-gate",
158
+ "hooks": [{"type": "command", "command": "x"}]},
159
+ {"tag": "operator-own-hook",
160
+ "hooks": [{"type": "command", "command": "y"}]},
161
+ ],
162
+ },
163
+ }))
164
+
165
+ # Run the uninstall.
166
+ from omega_engine.cli import cmd_uninstall
167
+ ns = mock.Mock(yes=True, purge=False, include_llm_clis=False)
168
+ with mock.patch.dict(os.environ, {
169
+ "OMEGA_HOME": str(home),
170
+ "HOME": str(fake_home),
171
+ }), mock.patch("pathlib.Path.home", return_value=fake_home):
172
+ rc = cmd_uninstall(ns)
173
+ self.assertEqual(rc, 0)
174
+ # Tree gone.
175
+ self.assertFalse(home.exists())
176
+ # Settings cleaned, operator keys preserved.
177
+ data = json.loads(settings.read_text())
178
+ self.assertNotIn(
179
+ "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS", data.get("env", {}),
180
+ )
181
+ self.assertEqual(data["env"]["OPERATOR_OWN_KEY"], "preserve me")
182
+ tags = [
183
+ e.get("tag") for e in data["hooks"]["Stop"]
184
+ if isinstance(e, dict)
185
+ ]
186
+ self.assertNotIn("omega-audit-gate", tags)
187
+ self.assertIn("operator-own-hook", tags)
188
+
189
+ def test_uninstall_backs_up_vault_by_default(self):
190
+ with tempfile.TemporaryDirectory() as td:
191
+ home = Path(td) / "Omega"
192
+ home.mkdir()
193
+ secrets = home / "Agentik_Extra" / "etc" / "secrets"
194
+ secrets.mkdir(parents=True)
195
+ (secrets / "CLAUDE_OAUTH_max_TOKEN.age").write_text("encrypted")
196
+ fake_home = Path(td) / "fake-home"
197
+ fake_home.mkdir()
198
+
199
+ from omega_engine.cli import cmd_uninstall
200
+ ns = mock.Mock(yes=True, purge=False, include_llm_clis=False)
201
+ with mock.patch.dict(os.environ, {"OMEGA_HOME": str(home)}), \
202
+ mock.patch("pathlib.Path.home", return_value=fake_home):
203
+ cmd_uninstall(ns)
204
+
205
+ backups = list(fake_home.glob(".omega-vault-backup-*"))
206
+ self.assertEqual(len(backups), 1)
207
+ self.assertTrue(
208
+ (backups[0] / "CLAUDE_OAUTH_max_TOKEN.age").exists()
209
+ )
210
+
211
+ def test_uninstall_purge_drops_vault(self):
212
+ with tempfile.TemporaryDirectory() as td:
213
+ home = Path(td) / "Omega"
214
+ home.mkdir()
215
+ (home / "Agentik_Extra" / "etc" / "secrets").mkdir(parents=True)
216
+ (home / "Agentik_Extra" / "etc" / "secrets" / "x.age").write_text("x")
217
+ fake_home = Path(td) / "fake-home"; fake_home.mkdir()
218
+
219
+ from omega_engine.cli import cmd_uninstall
220
+ ns = mock.Mock(yes=True, purge=True, include_llm_clis=False)
221
+ with mock.patch.dict(os.environ, {"OMEGA_HOME": str(home)}), \
222
+ mock.patch("pathlib.Path.home", return_value=fake_home):
223
+ cmd_uninstall(ns)
224
+ self.assertEqual(list(fake_home.glob(".omega-vault-backup-*")), [])
225
+
226
+
227
+ if __name__ == "__main__":
228
+ unittest.main(verbosity=2)