@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.
Files changed (379) hide show
  1. package/README.md +56 -14
  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 +1000 -26
  10. package/bootstrap/manifest.example.yaml +93 -2
  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/COMPLETION-PLAN.md +48 -0
  48. package/docs/GAP-ANALYSIS.md +214 -0
  49. package/docs/INSTALL.md +47 -9
  50. package/docs/MCP-AND-PLUGINS.md +31 -4
  51. package/docs/SIMULATION.md +171 -0
  52. package/docs/simulate.sh +211 -0
  53. package/install.sh +164 -17
  54. package/omega/Agentik_Engine/README.md +27 -10
  55. package/omega/Agentik_Engine/omega_engine/__init__.py +212 -2
  56. package/omega/Agentik_Engine/omega_engine/__pycache__/__init__.cpython-313.pyc +0 -0
  57. package/omega/Agentik_Engine/omega_engine/__pycache__/account.cpython-313.pyc +0 -0
  58. package/omega/Agentik_Engine/omega_engine/__pycache__/agent_messages.cpython-313.pyc +0 -0
  59. package/omega/Agentik_Engine/omega_engine/__pycache__/aisb_chat.cpython-313.pyc +0 -0
  60. package/omega/Agentik_Engine/omega_engine/__pycache__/audit_diff.cpython-313.pyc +0 -0
  61. package/omega/Agentik_Engine/omega_engine/__pycache__/audit_gate.cpython-313.pyc +0 -0
  62. package/omega/Agentik_Engine/omega_engine/__pycache__/auto_update.cpython-313.pyc +0 -0
  63. package/omega/Agentik_Engine/omega_engine/__pycache__/autonomous.cpython-313.pyc +0 -0
  64. package/omega/Agentik_Engine/omega_engine/__pycache__/backup.cpython-313.pyc +0 -0
  65. package/omega/Agentik_Engine/omega_engine/__pycache__/cadence.cpython-313.pyc +0 -0
  66. package/omega/Agentik_Engine/omega_engine/__pycache__/classifier.cpython-313.pyc +0 -0
  67. package/omega/Agentik_Engine/omega_engine/__pycache__/cleanup.cpython-313.pyc +0 -0
  68. package/omega/Agentik_Engine/omega_engine/__pycache__/cli.cpython-313.pyc +0 -0
  69. package/omega/Agentik_Engine/omega_engine/__pycache__/completions.cpython-313.pyc +0 -0
  70. package/omega/Agentik_Engine/omega_engine/__pycache__/costs.cpython-313.pyc +0 -0
  71. package/omega/Agentik_Engine/omega_engine/__pycache__/done_signal.cpython-313.pyc +0 -0
  72. package/omega/Agentik_Engine/omega_engine/__pycache__/envelope.cpython-313.pyc +0 -0
  73. package/omega/Agentik_Engine/omega_engine/__pycache__/executor.cpython-313.pyc +0 -0
  74. package/omega/Agentik_Engine/omega_engine/__pycache__/handoff.cpython-313.pyc +0 -0
  75. package/omega/Agentik_Engine/omega_engine/__pycache__/hermes.cpython-313.pyc +0 -0
  76. package/omega/Agentik_Engine/omega_engine/__pycache__/hermes_bootstrap.cpython-313.pyc +0 -0
  77. package/omega/Agentik_Engine/omega_engine/__pycache__/hermes_desktop.cpython-313.pyc +0 -0
  78. package/omega/Agentik_Engine/omega_engine/__pycache__/learning.cpython-313.pyc +0 -0
  79. package/omega/Agentik_Engine/omega_engine/__pycache__/managed_agent.cpython-313.pyc +0 -0
  80. package/omega/Agentik_Engine/omega_engine/__pycache__/memory.cpython-313.pyc +0 -0
  81. package/omega/Agentik_Engine/omega_engine/__pycache__/menu.cpython-313.pyc +0 -0
  82. package/omega/Agentik_Engine/omega_engine/__pycache__/mission.cpython-313.pyc +0 -0
  83. package/omega/Agentik_Engine/omega_engine/__pycache__/plan.cpython-313.pyc +0 -0
  84. package/omega/Agentik_Engine/omega_engine/__pycache__/project.cpython-313.pyc +0 -0
  85. package/omega/Agentik_Engine/omega_engine/__pycache__/prompts.cpython-313.pyc +0 -0
  86. package/omega/Agentik_Engine/omega_engine/__pycache__/provider.cpython-313.pyc +0 -0
  87. package/omega/Agentik_Engine/omega_engine/__pycache__/prune.cpython-313.pyc +0 -0
  88. package/omega/Agentik_Engine/omega_engine/__pycache__/pursue.cpython-313.pyc +0 -0
  89. package/omega/Agentik_Engine/omega_engine/__pycache__/reducer.cpython-313.pyc +0 -0
  90. package/omega/Agentik_Engine/omega_engine/__pycache__/router.cpython-313.pyc +0 -0
  91. package/omega/Agentik_Engine/omega_engine/__pycache__/skill_routing.cpython-313.pyc +0 -0
  92. package/omega/Agentik_Engine/omega_engine/__pycache__/smoke.cpython-313.pyc +0 -0
  93. package/omega/Agentik_Engine/omega_engine/__pycache__/store.cpython-313.pyc +0 -0
  94. package/omega/Agentik_Engine/omega_engine/__pycache__/sync.cpython-313.pyc +0 -0
  95. package/omega/Agentik_Engine/omega_engine/__pycache__/telegram_history.cpython-313.pyc +0 -0
  96. package/omega/Agentik_Engine/omega_engine/__pycache__/tmux.cpython-313.pyc +0 -0
  97. package/omega/Agentik_Engine/omega_engine/__pycache__/tools.cpython-313.pyc +0 -0
  98. package/omega/Agentik_Engine/omega_engine/__pycache__/understand_anything.cpython-313.pyc +0 -0
  99. package/omega/Agentik_Engine/omega_engine/__pycache__/updater.cpython-313.pyc +0 -0
  100. package/omega/Agentik_Engine/omega_engine/__pycache__/validate.cpython-313.pyc +0 -0
  101. package/omega/Agentik_Engine/omega_engine/__pycache__/vault.cpython-313.pyc +0 -0
  102. package/omega/Agentik_Engine/omega_engine/__pycache__/webhooks.cpython-313.pyc +0 -0
  103. package/omega/Agentik_Engine/omega_engine/__pycache__/worker.cpython-313.pyc +0 -0
  104. package/omega/Agentik_Engine/omega_engine/account.py +502 -0
  105. package/omega/Agentik_Engine/omega_engine/agent_messages.py +167 -0
  106. package/omega/Agentik_Engine/omega_engine/aisb_chat.py +128 -0
  107. package/omega/Agentik_Engine/omega_engine/audit_diff.py +99 -0
  108. package/omega/Agentik_Engine/omega_engine/audit_gate.py +149 -0
  109. package/omega/Agentik_Engine/omega_engine/audits/__init__.py +60 -0
  110. package/omega/Agentik_Engine/omega_engine/audits/__pycache__/__init__.cpython-313.pyc +0 -0
  111. package/omega/Agentik_Engine/omega_engine/audits/__pycache__/batcher.cpython-313.pyc +0 -0
  112. package/omega/Agentik_Engine/omega_engine/audits/__pycache__/dispatcher.cpython-313.pyc +0 -0
  113. package/omega/Agentik_Engine/omega_engine/audits/__pycache__/generator.cpython-313.pyc +0 -0
  114. package/omega/Agentik_Engine/omega_engine/audits/__pycache__/history.cpython-313.pyc +0 -0
  115. package/omega/Agentik_Engine/omega_engine/audits/__pycache__/pipeline.cpython-313.pyc +0 -0
  116. package/omega/Agentik_Engine/omega_engine/audits/batcher.py +218 -0
  117. package/omega/Agentik_Engine/omega_engine/audits/dispatcher.py +92 -0
  118. package/omega/Agentik_Engine/omega_engine/audits/generator.py +234 -0
  119. package/omega/Agentik_Engine/omega_engine/audits/history.py +168 -0
  120. package/omega/Agentik_Engine/omega_engine/audits/pipeline.py +198 -0
  121. package/omega/Agentik_Engine/omega_engine/auto_update.py +339 -0
  122. package/omega/Agentik_Engine/omega_engine/autonomous.py +538 -0
  123. package/omega/Agentik_Engine/omega_engine/backup.py +215 -0
  124. package/omega/Agentik_Engine/omega_engine/cadence.py +158 -0
  125. package/omega/Agentik_Engine/omega_engine/classifier.py +215 -0
  126. package/omega/Agentik_Engine/omega_engine/cleanup.py +673 -0
  127. package/omega/Agentik_Engine/omega_engine/cli.py +4564 -56
  128. package/omega/Agentik_Engine/omega_engine/completions.py +260 -0
  129. package/omega/Agentik_Engine/omega_engine/costs.py +100 -0
  130. package/omega/Agentik_Engine/omega_engine/daemons/__init__.py +14 -0
  131. package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/__init__.cpython-313.pyc +0 -0
  132. package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/autonomous.cpython-313.pyc +0 -0
  133. package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/engine.cpython-313.pyc +0 -0
  134. package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/telegram.cpython-313.pyc +0 -0
  135. package/omega/Agentik_Engine/omega_engine/daemons/autonomous.py +56 -0
  136. package/omega/Agentik_Engine/omega_engine/daemons/engine.py +236 -0
  137. package/omega/Agentik_Engine/omega_engine/daemons/telegram.py +315 -0
  138. package/omega/Agentik_Engine/omega_engine/done_signal.py +154 -0
  139. package/omega/Agentik_Engine/omega_engine/educators/__init__.py +51 -0
  140. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/__init__.cpython-313.pyc +0 -0
  141. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/artifact.cpython-313.pyc +0 -0
  142. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/automation.cpython-313.pyc +0 -0
  143. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/base.cpython-313.pyc +0 -0
  144. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/claudecode.cpython-313.pyc +0 -0
  145. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/connection.cpython-313.pyc +0 -0
  146. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/coworker.cpython-313.pyc +0 -0
  147. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/loop.cpython-313.pyc +0 -0
  148. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/prompt.cpython-313.pyc +0 -0
  149. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/skill.cpython-313.pyc +0 -0
  150. package/omega/Agentik_Engine/omega_engine/educators/artifact.py +65 -0
  151. package/omega/Agentik_Engine/omega_engine/educators/automation.py +76 -0
  152. package/omega/Agentik_Engine/omega_engine/educators/base.py +327 -0
  153. package/omega/Agentik_Engine/omega_engine/educators/claudecode.py +71 -0
  154. package/omega/Agentik_Engine/omega_engine/educators/connection.py +75 -0
  155. package/omega/Agentik_Engine/omega_engine/educators/coworker.py +68 -0
  156. package/omega/Agentik_Engine/omega_engine/educators/loop.py +82 -0
  157. package/omega/Agentik_Engine/omega_engine/educators/prompt.py +68 -0
  158. package/omega/Agentik_Engine/omega_engine/educators/skill.py +69 -0
  159. package/omega/Agentik_Engine/omega_engine/envelope.py +219 -0
  160. package/omega/Agentik_Engine/omega_engine/executor.py +195 -16
  161. package/omega/Agentik_Engine/omega_engine/genesis/__init__.py +134 -0
  162. package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/__init__.cpython-313.pyc +0 -0
  163. package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/orchestrator.cpython-313.pyc +0 -0
  164. package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/phases.cpython-313.pyc +0 -0
  165. package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/stack.cpython-313.pyc +0 -0
  166. package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/state.cpython-313.pyc +0 -0
  167. package/omega/Agentik_Engine/omega_engine/genesis/orchestrator.py +262 -0
  168. package/omega/Agentik_Engine/omega_engine/genesis/phases.py +950 -0
  169. package/omega/Agentik_Engine/omega_engine/genesis/stack.py +324 -0
  170. package/omega/Agentik_Engine/omega_engine/genesis/state.py +353 -0
  171. package/omega/Agentik_Engine/omega_engine/handoff.py +459 -0
  172. package/omega/Agentik_Engine/omega_engine/hermes.py +426 -0
  173. package/omega/Agentik_Engine/omega_engine/hermes_bootstrap.py +382 -0
  174. package/omega/Agentik_Engine/omega_engine/hermes_desktop.py +469 -0
  175. package/omega/Agentik_Engine/omega_engine/integrations/__init__.py +30 -0
  176. package/omega/Agentik_Engine/omega_engine/integrations/__pycache__/__init__.cpython-313.pyc +0 -0
  177. package/omega/Agentik_Engine/omega_engine/integrations/__pycache__/graphify.cpython-313.pyc +0 -0
  178. package/omega/Agentik_Engine/omega_engine/integrations/graphify.py +234 -0
  179. package/omega/Agentik_Engine/omega_engine/learning.py +268 -0
  180. package/omega/Agentik_Engine/omega_engine/managed_agent.py +467 -0
  181. package/omega/Agentik_Engine/omega_engine/memory.py +271 -0
  182. package/omega/Agentik_Engine/omega_engine/menu.py +1065 -0
  183. package/omega/Agentik_Engine/omega_engine/migrations/__init__.py +144 -0
  184. package/omega/Agentik_Engine/omega_engine/migrations/__pycache__/__init__.cpython-313.pyc +0 -0
  185. package/omega/Agentik_Engine/omega_engine/migrations/__pycache__/v0_14_0.cpython-313.pyc +0 -0
  186. package/omega/Agentik_Engine/omega_engine/migrations/v0_14_0.py +29 -0
  187. package/omega/Agentik_Engine/omega_engine/mission.py +29 -14
  188. package/omega/Agentik_Engine/omega_engine/plan.py +846 -0
  189. package/omega/Agentik_Engine/omega_engine/prompts.py +158 -0
  190. package/omega/Agentik_Engine/omega_engine/provider.py +408 -13
  191. package/omega/Agentik_Engine/omega_engine/prune.py +151 -0
  192. package/omega/Agentik_Engine/omega_engine/pursue.py +205 -0
  193. package/omega/Agentik_Engine/omega_engine/rag/__init__.py +21 -0
  194. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/__init__.cpython-313.pyc +0 -0
  195. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/agentic.cpython-313.pyc +0 -0
  196. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/base.cpython-313.pyc +0 -0
  197. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/corrective.cpython-313.pyc +0 -0
  198. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/graph.cpython-313.pyc +0 -0
  199. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/hybrid.cpython-313.pyc +0 -0
  200. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/multimodal.cpython-313.pyc +0 -0
  201. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/router.cpython-313.pyc +0 -0
  202. package/omega/Agentik_Engine/omega_engine/rag/agentic.py +83 -0
  203. package/omega/Agentik_Engine/omega_engine/rag/base.py +42 -0
  204. package/omega/Agentik_Engine/omega_engine/rag/corrective.py +119 -0
  205. package/omega/Agentik_Engine/omega_engine/rag/graph.py +169 -0
  206. package/omega/Agentik_Engine/omega_engine/rag/hybrid.py +205 -0
  207. package/omega/Agentik_Engine/omega_engine/rag/multimodal.py +136 -0
  208. package/omega/Agentik_Engine/omega_engine/rag/router.py +110 -0
  209. package/omega/Agentik_Engine/omega_engine/reducer.py +21 -3
  210. package/omega/Agentik_Engine/omega_engine/router.py +28 -0
  211. package/omega/Agentik_Engine/omega_engine/skill_discovery/__init__.py +48 -0
  212. package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/__init__.cpython-313.pyc +0 -0
  213. package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/auditor.cpython-313.pyc +0 -0
  214. package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/finder.cpython-313.pyc +0 -0
  215. package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/installer.cpython-313.pyc +0 -0
  216. package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/marketplaces.cpython-313.pyc +0 -0
  217. package/omega/Agentik_Engine/omega_engine/skill_discovery/auditor.py +232 -0
  218. package/omega/Agentik_Engine/omega_engine/skill_discovery/finder.py +94 -0
  219. package/omega/Agentik_Engine/omega_engine/skill_discovery/installer.py +129 -0
  220. package/omega/Agentik_Engine/omega_engine/skill_discovery/marketplaces.py +80 -0
  221. package/omega/Agentik_Engine/omega_engine/skill_routing.py +388 -0
  222. package/omega/Agentik_Engine/omega_engine/smoke.py +81 -0
  223. package/omega/Agentik_Engine/omega_engine/store.py +132 -25
  224. package/omega/Agentik_Engine/omega_engine/sync.py +445 -0
  225. package/omega/Agentik_Engine/omega_engine/telegram_history.py +260 -0
  226. package/omega/Agentik_Engine/omega_engine/tmux.py +526 -0
  227. package/omega/Agentik_Engine/omega_engine/tools.py +272 -0
  228. package/omega/Agentik_Engine/omega_engine/understand_anything.py +275 -0
  229. package/omega/Agentik_Engine/omega_engine/updater.py +70 -0
  230. package/omega/Agentik_Engine/omega_engine/validate.py +186 -0
  231. package/omega/Agentik_Engine/omega_engine/vault.py +342 -0
  232. package/omega/Agentik_Engine/omega_engine/webhooks.py +262 -0
  233. package/omega/Agentik_Engine/omega_engine/worker.py +526 -0
  234. package/omega/Agentik_Engine/pyproject.toml +1 -1
  235. package/omega/Agentik_Engine/tests/__pycache__/test_account.cpython-313-pytest-8.4.2.pyc +0 -0
  236. package/omega/Agentik_Engine/tests/__pycache__/test_account.cpython-313.pyc +0 -0
  237. package/omega/Agentik_Engine/tests/__pycache__/test_adversarial.cpython-313-pytest-8.4.2.pyc +0 -0
  238. package/omega/Agentik_Engine/tests/__pycache__/test_adversarial.cpython-313.pyc +0 -0
  239. package/omega/Agentik_Engine/tests/__pycache__/test_agents_envelope.cpython-313-pytest-8.4.2.pyc +0 -0
  240. package/omega/Agentik_Engine/tests/__pycache__/test_agents_envelope.cpython-313.pyc +0 -0
  241. package/omega/Agentik_Engine/tests/__pycache__/test_audit_arsenal.cpython-313-pytest-8.4.2.pyc +0 -0
  242. package/omega/Agentik_Engine/tests/__pycache__/test_audits_pipeline.cpython-313-pytest-8.4.2.pyc +0 -0
  243. package/omega/Agentik_Engine/tests/__pycache__/test_audits_pipeline.cpython-313.pyc +0 -0
  244. package/omega/Agentik_Engine/tests/__pycache__/test_auto_update_and_migrations.cpython-313-pytest-8.4.2.pyc +0 -0
  245. package/omega/Agentik_Engine/tests/__pycache__/test_auto_update_and_migrations.cpython-313.pyc +0 -0
  246. package/omega/Agentik_Engine/tests/__pycache__/test_autonomous.cpython-313-pytest-8.4.2.pyc +0 -0
  247. package/omega/Agentik_Engine/tests/__pycache__/test_autonomous.cpython-313.pyc +0 -0
  248. package/omega/Agentik_Engine/tests/__pycache__/test_educators.cpython-313-pytest-8.4.2.pyc +0 -0
  249. package/omega/Agentik_Engine/tests/__pycache__/test_educators.cpython-313.pyc +0 -0
  250. package/omega/Agentik_Engine/tests/__pycache__/test_executor.cpython-313-pytest-8.4.2.pyc +0 -0
  251. package/omega/Agentik_Engine/tests/__pycache__/test_genesis_and_plan.cpython-313-pytest-8.4.2.pyc +0 -0
  252. package/omega/Agentik_Engine/tests/__pycache__/test_genesis_and_plan.cpython-313.pyc +0 -0
  253. package/omega/Agentik_Engine/tests/__pycache__/test_graphify.cpython-313-pytest-8.4.2.pyc +0 -0
  254. package/omega/Agentik_Engine/tests/__pycache__/test_graphify.cpython-313.pyc +0 -0
  255. package/omega/Agentik_Engine/tests/__pycache__/test_handoff.cpython-313-pytest-8.4.2.pyc +0 -0
  256. package/omega/Agentik_Engine/tests/__pycache__/test_handoff.cpython-313.pyc +0 -0
  257. package/omega/Agentik_Engine/tests/__pycache__/test_hermes_and_ua.cpython-313-pytest-8.4.2.pyc +0 -0
  258. package/omega/Agentik_Engine/tests/__pycache__/test_hermes_and_ua.cpython-313.pyc +0 -0
  259. package/omega/Agentik_Engine/tests/__pycache__/test_hermes_bootstrap_and_desktop.cpython-313-pytest-8.4.2.pyc +0 -0
  260. package/omega/Agentik_Engine/tests/__pycache__/test_hermes_bootstrap_and_desktop.cpython-313.pyc +0 -0
  261. package/omega/Agentik_Engine/tests/__pycache__/test_install_steps.cpython-313-pytest-8.4.2.pyc +0 -0
  262. package/omega/Agentik_Engine/tests/__pycache__/test_install_steps.cpython-313.pyc +0 -0
  263. package/omega/Agentik_Engine/tests/__pycache__/test_install_ux.cpython-313-pytest-8.4.2.pyc +0 -0
  264. package/omega/Agentik_Engine/tests/__pycache__/test_install_ux.cpython-313.pyc +0 -0
  265. package/omega/Agentik_Engine/tests/__pycache__/test_installer_wiring.cpython-313-pytest-8.4.2.pyc +0 -0
  266. package/omega/Agentik_Engine/tests/__pycache__/test_installer_wiring.cpython-313.pyc +0 -0
  267. package/omega/Agentik_Engine/tests/__pycache__/test_intelligence.cpython-313-pytest-8.4.2.pyc +0 -0
  268. package/omega/Agentik_Engine/tests/__pycache__/test_intelligence.cpython-313.pyc +0 -0
  269. package/omega/Agentik_Engine/tests/__pycache__/test_llm_clis_and_uninstall.cpython-313-pytest-8.4.2.pyc +0 -0
  270. package/omega/Agentik_Engine/tests/__pycache__/test_llm_clis_and_uninstall.cpython-313.pyc +0 -0
  271. package/omega/Agentik_Engine/tests/__pycache__/test_managed_agent.cpython-313-pytest-8.4.2.pyc +0 -0
  272. package/omega/Agentik_Engine/tests/__pycache__/test_managed_agent.cpython-313.pyc +0 -0
  273. package/omega/Agentik_Engine/tests/__pycache__/test_max_provider_and_menu.cpython-313-pytest-8.4.2.pyc +0 -0
  274. package/omega/Agentik_Engine/tests/__pycache__/test_max_provider_and_menu.cpython-313.pyc +0 -0
  275. package/omega/Agentik_Engine/tests/__pycache__/test_menu_coverage.cpython-313-pytest-8.4.2.pyc +0 -0
  276. package/omega/Agentik_Engine/tests/__pycache__/test_menu_coverage.cpython-313.pyc +0 -0
  277. package/omega/Agentik_Engine/tests/__pycache__/test_mission.cpython-313-pytest-8.4.2.pyc +0 -0
  278. package/omega/Agentik_Engine/tests/__pycache__/test_progress.cpython-313-pytest-8.4.2.pyc +0 -0
  279. package/omega/Agentik_Engine/tests/__pycache__/test_project.cpython-313-pytest-8.4.2.pyc +0 -0
  280. package/omega/Agentik_Engine/tests/__pycache__/test_pursue_cadence.cpython-313-pytest-8.4.2.pyc +0 -0
  281. package/omega/Agentik_Engine/tests/__pycache__/test_pursue_cadence.cpython-313.pyc +0 -0
  282. package/omega/Agentik_Engine/tests/__pycache__/test_rag.cpython-313-pytest-8.4.2.pyc +0 -0
  283. package/omega/Agentik_Engine/tests/__pycache__/test_rag.cpython-313.pyc +0 -0
  284. package/omega/Agentik_Engine/tests/__pycache__/test_reducer.cpython-313-pytest-8.4.2.pyc +0 -0
  285. package/omega/Agentik_Engine/tests/__pycache__/test_report.cpython-313-pytest-8.4.2.pyc +0 -0
  286. package/omega/Agentik_Engine/tests/__pycache__/test_role_aliases_and_ssot.cpython-313-pytest-8.4.2.pyc +0 -0
  287. package/omega/Agentik_Engine/tests/__pycache__/test_role_aliases_and_ssot.cpython-313.pyc +0 -0
  288. package/omega/Agentik_Engine/tests/__pycache__/test_skill_discovery_and_gate.cpython-313-pytest-8.4.2.pyc +0 -0
  289. package/omega/Agentik_Engine/tests/__pycache__/test_skill_discovery_and_gate.cpython-313.pyc +0 -0
  290. package/omega/Agentik_Engine/tests/__pycache__/test_skill_power.cpython-313-pytest-8.4.2.pyc +0 -0
  291. package/omega/Agentik_Engine/tests/__pycache__/test_skill_power.cpython-313.pyc +0 -0
  292. package/omega/Agentik_Engine/tests/__pycache__/test_skill_routing.cpython-313-pytest-8.4.2.pyc +0 -0
  293. package/omega/Agentik_Engine/tests/__pycache__/test_skill_routing.cpython-313.pyc +0 -0
  294. package/omega/Agentik_Engine/tests/__pycache__/test_snapshot_partial.cpython-313-pytest-8.4.2.pyc +0 -0
  295. package/omega/Agentik_Engine/tests/__pycache__/test_snapshot_partial.cpython-313.pyc +0 -0
  296. package/omega/Agentik_Engine/tests/__pycache__/test_telegram_history.cpython-313-pytest-8.4.2.pyc +0 -0
  297. package/omega/Agentik_Engine/tests/__pycache__/test_telegram_history.cpython-313.pyc +0 -0
  298. package/omega/Agentik_Engine/tests/__pycache__/test_tmux_and_aisb_chat.cpython-313-pytest-8.4.2.pyc +0 -0
  299. package/omega/Agentik_Engine/tests/__pycache__/test_tmux_and_aisb_chat.cpython-313.pyc +0 -0
  300. package/omega/Agentik_Engine/tests/__pycache__/test_tools_and_sync.cpython-313-pytest-8.4.2.pyc +0 -0
  301. package/omega/Agentik_Engine/tests/__pycache__/test_tools_and_sync.cpython-313.pyc +0 -0
  302. package/omega/Agentik_Engine/tests/__pycache__/test_v06_features.cpython-313-pytest-8.4.2.pyc +0 -0
  303. package/omega/Agentik_Engine/tests/__pycache__/test_v06_features.cpython-313.pyc +0 -0
  304. package/omega/Agentik_Engine/tests/__pycache__/test_vault.cpython-313-pytest-8.4.2.pyc +0 -0
  305. package/omega/Agentik_Engine/tests/__pycache__/test_vault.cpython-313.pyc +0 -0
  306. package/omega/Agentik_Engine/tests/__pycache__/test_webhooks_and_readiness.cpython-313-pytest-8.4.2.pyc +0 -0
  307. package/omega/Agentik_Engine/tests/__pycache__/test_webhooks_and_readiness.cpython-313.pyc +0 -0
  308. package/omega/Agentik_Engine/tests/__pycache__/test_worker_and_cleanup.cpython-313-pytest-8.4.2.pyc +0 -0
  309. package/omega/Agentik_Engine/tests/__pycache__/test_worker_and_cleanup.cpython-313.pyc +0 -0
  310. package/omega/Agentik_Engine/tests/test_account.py +338 -0
  311. package/omega/Agentik_Engine/tests/test_adversarial.py +351 -0
  312. package/omega/Agentik_Engine/tests/test_agents_envelope.py +274 -0
  313. package/omega/Agentik_Engine/tests/test_audits_pipeline.py +348 -0
  314. package/omega/Agentik_Engine/tests/test_auto_update_and_migrations.py +394 -0
  315. package/omega/Agentik_Engine/tests/test_autonomous.py +361 -0
  316. package/omega/Agentik_Engine/tests/test_educators.py +233 -0
  317. package/omega/Agentik_Engine/tests/test_genesis_and_plan.py +573 -0
  318. package/omega/Agentik_Engine/tests/test_graphify.py +190 -0
  319. package/omega/Agentik_Engine/tests/test_handoff.py +311 -0
  320. package/omega/Agentik_Engine/tests/test_hermes_and_ua.py +387 -0
  321. package/omega/Agentik_Engine/tests/test_hermes_bootstrap_and_desktop.py +358 -0
  322. package/omega/Agentik_Engine/tests/test_install_steps.py +359 -0
  323. package/omega/Agentik_Engine/tests/test_install_ux.py +151 -0
  324. package/omega/Agentik_Engine/tests/test_installer_wiring.py +496 -0
  325. package/omega/Agentik_Engine/tests/test_intelligence.py +285 -0
  326. package/omega/Agentik_Engine/tests/test_llm_clis_and_uninstall.py +228 -0
  327. package/omega/Agentik_Engine/tests/test_managed_agent.py +363 -0
  328. package/omega/Agentik_Engine/tests/test_max_provider_and_menu.py +231 -0
  329. package/omega/Agentik_Engine/tests/test_menu_coverage.py +72 -0
  330. package/omega/Agentik_Engine/tests/test_pursue_cadence.py +217 -0
  331. package/omega/Agentik_Engine/tests/test_rag.py +287 -0
  332. package/omega/Agentik_Engine/tests/test_role_aliases_and_ssot.py +207 -0
  333. package/omega/Agentik_Engine/tests/test_skill_discovery_and_gate.py +337 -0
  334. package/omega/Agentik_Engine/tests/test_skill_power.py +259 -0
  335. package/omega/Agentik_Engine/tests/test_skill_routing.py +189 -0
  336. package/omega/Agentik_Engine/tests/test_snapshot_partial.py +172 -0
  337. package/omega/Agentik_Engine/tests/test_telegram_history.py +209 -0
  338. package/omega/Agentik_Engine/tests/test_tmux_and_aisb_chat.py +223 -0
  339. package/omega/Agentik_Engine/tests/test_tools_and_sync.py +312 -0
  340. package/omega/Agentik_Engine/tests/test_v06_features.py +370 -0
  341. package/omega/Agentik_Engine/tests/test_vault.py +173 -0
  342. package/omega/Agentik_Engine/tests/test_webhooks_and_readiness.py +277 -0
  343. package/omega/Agentik_Engine/tests/test_worker_and_cleanup.py +541 -0
  344. package/omega/Agentik_Extra/etc/secrets/.vault-key +3 -0
  345. package/omega/Agentik_Extra/etc/secrets/.vault-pub +1 -0
  346. package/omega/Agentik_Runtime/audits.db +0 -0
  347. package/omega/Agentik_SSOT/VERSION +1 -1
  348. package/omega/Agentik_SSOT/claude-plugins/claude-plugins.yaml +100 -0
  349. package/omega/Agentik_SSOT/docs/LAYERS.md +90 -0
  350. package/omega/Agentik_SSOT/docs/USER-JOURNEY.md +283 -0
  351. package/omega/Agentik_SSOT/marketplaces/design-discipline.yaml +86 -0
  352. package/omega/Agentik_SSOT/skills/a11yaudit/SKILL.md +161 -0
  353. package/omega/Agentik_SSOT/skills/apiaudit/SKILL.md +157 -0
  354. package/omega/Agentik_SSOT/skills/automationaudit/SKILL.md +161 -0
  355. package/omega/Agentik_SSOT/skills/cadence/SKILL.md +76 -0
  356. package/omega/Agentik_SSOT/skills/codeaudit/SKILL.md +153 -0
  357. package/omega/Agentik_SSOT/skills/copyaudit/SKILL.md +161 -0
  358. package/omega/Agentik_SSOT/skills/dataaudit/SKILL.md +157 -0
  359. package/omega/Agentik_SSOT/skills/debugaudit/SKILL.md +161 -0
  360. package/omega/Agentik_SSOT/skills/dispatch/SKILL.md +79 -0
  361. package/omega/Agentik_SSOT/skills/dxaudit/SKILL.md +161 -0
  362. package/omega/Agentik_SSOT/skills/featureaudit/SKILL.md +161 -0
  363. package/omega/Agentik_SSOT/skills/flowaudit/SKILL.md +165 -0
  364. package/omega/Agentik_SSOT/skills/genesis/SKILL.md +116 -0
  365. package/omega/Agentik_SSOT/skills/handoff/SKILL.md +117 -0
  366. package/omega/Agentik_SSOT/skills/logicaudit/SKILL.md +165 -0
  367. package/omega/Agentik_SSOT/skills/motionaudit/SKILL.md +165 -0
  368. package/omega/Agentik_SSOT/skills/perfaudit/SKILL.md +161 -0
  369. package/omega/Agentik_SSOT/skills/plan/SKILL.md +127 -0
  370. package/omega/Agentik_SSOT/skills/pursue/SKILL.md +68 -0
  371. package/omega/Agentik_SSOT/skills/rag-route.md +82 -0
  372. package/omega/Agentik_SSOT/skills/refontaudit/SKILL.md +165 -0
  373. package/omega/Agentik_SSOT/skills/retentionaudit/SKILL.md +165 -0
  374. package/omega/Agentik_SSOT/skills/secaudit/SKILL.md +157 -0
  375. package/omega/Agentik_SSOT/skills/seoaudit/SKILL.md +161 -0
  376. package/omega/Agentik_SSOT/skills/skill-auditor/SKILL.md +83 -0
  377. package/omega/Agentik_SSOT/skills/skill-finder/SKILL.md +116 -0
  378. package/omega/Agentik_SSOT/skills/uiuxaudit/SKILL.md +165 -0
  379. package/package.json +2 -2
@@ -0,0 +1,92 @@
1
+ """Audit fix-dispatcher — turn batches into worker missions, capped.
2
+
3
+ The pipeline calls ``dispatch_fixes(batches, ...)`` after the audit has
4
+ produced ``fix_plan`` items. We hand each batch to the OmegaOS engine via
5
+ ``run_mission`` (the same path ``omega run`` uses), but with a constructed
6
+ intent that lists every finding the worker must fix.
7
+
8
+ Hard guards:
9
+
10
+ * Caller already capped ``max_batches`` (default 3) via the batcher.
11
+ * We add a wall-clock + budget timeout per worker (default 600s).
12
+ * If too many workers are already running for the same audit on the
13
+ same project, we refuse — operator must reduce parallelism.
14
+ """
15
+ from __future__ import annotations
16
+
17
+ from dataclasses import dataclass, field
18
+ from pathlib import Path
19
+ from typing import Any
20
+
21
+ from omega_engine.audits.batcher import Batch, BatchPlan
22
+
23
+
24
+ @dataclass
25
+ class DispatchResult:
26
+ batch_id: str
27
+ mission_id: str | None
28
+ status: str # "dispatched" | "skipped" | "failed"
29
+ reason: str = ""
30
+ summary: str = ""
31
+ intent: str = ""
32
+ files: list[str] = field(default_factory=list)
33
+
34
+
35
+ def dispatch_fixes(
36
+ plan: BatchPlan,
37
+ *,
38
+ omega_home: str | Path | None = None,
39
+ audit_id: str | None = None,
40
+ project: str | None = None,
41
+ dry_run: bool = False,
42
+ executor: Any = None,
43
+ ) -> list[DispatchResult]:
44
+ """Send every batch in ``plan`` to its own worker mission.
45
+
46
+ Args:
47
+ plan: the output of ``batch_findings``.
48
+ omega_home: ``$OMEGA_HOME`` (env or default).
49
+ audit_id: which audit produced these findings — only used to
50
+ label the worker intent. Falls back to ``plan.audit_id``.
51
+ project: optional project slug — the mission inherits it via
52
+ the envelope (per-project context).
53
+ dry_run: when True, build intents but do NOT dispatch — return
54
+ ``status='skipped'`` for each batch.
55
+ executor: optional ``omega_engine.executor.Executor`` instance.
56
+ If None, we don't dispatch — we return the intent text only.
57
+ This keeps the dispatcher pure-data when called from the CLI
58
+ in inspect mode.
59
+
60
+ Returns: one ``DispatchResult`` per batch.
61
+ """
62
+ aid = audit_id or plan.audit_id or "audit"
63
+ results: list[DispatchResult] = []
64
+ for batch in plan.batches:
65
+ intent = batch.to_intent(aid)
66
+ if dry_run or executor is None:
67
+ results.append(DispatchResult(
68
+ batch_id=batch.id, mission_id=None,
69
+ status="skipped" if dry_run else "no_executor",
70
+ reason=("dry-run" if dry_run else "no executor provided"),
71
+ summary=f"{len(batch.findings)} finding(s) across {len(batch.files)} file(s)",
72
+ intent=intent, files=list(batch.files),
73
+ ))
74
+ continue
75
+ try:
76
+ outcome = executor.run_mission(intent, root_role="worker")
77
+ results.append(DispatchResult(
78
+ batch_id=batch.id, mission_id=outcome.mission_id,
79
+ status="dispatched" if outcome.verified else "failed",
80
+ reason="" if outcome.verified else (
81
+ f"mission terminated {outcome.final_state.value}"
82
+ ),
83
+ summary=f"{len(batch.findings)} finding(s) → mission {outcome.mission_id}",
84
+ intent=intent, files=list(batch.files),
85
+ ))
86
+ except Exception as exc: # noqa: BLE001
87
+ results.append(DispatchResult(
88
+ batch_id=batch.id, mission_id=None,
89
+ status="failed", reason=f"executor raised: {exc}"[:300],
90
+ summary="", intent=intent, files=list(batch.files),
91
+ ))
92
+ return results
@@ -0,0 +1,234 @@
1
+ """SKILL.md generator — turn each audit.yaml into a Claude Code skill.
2
+
3
+ The user wants every audit invocable as a first-class Claude Code skill
4
+ (``/codeaudit``, ``/flowaudit``, ...). This generator reads each
5
+ ``Agentik_SSOT/audits/<id>.yaml`` and writes the matching
6
+ ``Agentik_SSOT/skills/<id>/SKILL.md`` so ``omega sync`` then projects it
7
+ into Claude Code's native skills tree.
8
+
9
+ The generated SKILL.md follows the Agent Skills open standard:
10
+
11
+ * **frontmatter** — name, description (built from the audit's question),
12
+ when_to_use, argument-hint, allowed-tools, hooks (optional).
13
+ * **body** — doctrine + per-phase checks + the exact commands to call
14
+ (``omega audit run``, ``omega audit gather``, ``omega audit reaudit``),
15
+ plus the structured ``.done.json`` contract.
16
+
17
+ The generator is idempotent — re-running it overwrites in place. It
18
+ preserves operator-edited supporting files in the same directory
19
+ (scripts/, examples/, etc.).
20
+ """
21
+ from __future__ import annotations
22
+
23
+ from dataclasses import dataclass
24
+ from pathlib import Path
25
+ from typing import Any
26
+
27
+ import yaml
28
+
29
+
30
+ SKILL_TEMPLATE = """\
31
+ ---
32
+ name: {name}
33
+ description: {description}
34
+ when_to_use: {when_to_use}
35
+ argument-hint: "[--scope <path>] [--fix] [--max-workers N]"
36
+ arguments: [args]
37
+ allowed-tools: Bash Read Edit Grep Glob Write
38
+ ---
39
+
40
+ # {name} — forensic audit (Agentik OS Quality Arsenal)
41
+
42
+ > {question}
43
+
44
+ You are running the {name} forensic audit. Apply the **Gestalt-Popper
45
+ doctrine**: identify the hinge point, scrutinise it 10x, then assume
46
+ every name is a CLAIM and look for the divergence between the claim and
47
+ the reality. Bias toward FAIL. A perfect score is earned by finding zero
48
+ falsifiable claims, never by absence of effort.
49
+
50
+ ## Run
51
+
52
+ The audit is one engine call — gather (deterministic) + falsify (agentic)
53
+ + optional fix-dispatch (capped) + re-audit. Invoke the unified pipeline:
54
+
55
+ ```bash
56
+ omega audit run {name} $args
57
+ ```
58
+
59
+ Common options:
60
+
61
+ | Flag | Effect |
62
+ |---|---|
63
+ | `--scope <path>` | scope the audit (file or directory) |
64
+ | `--fix` | after analysing, batch findings + dispatch up to N workers + re-audit |
65
+ | `--max-workers N` | cap parallel fix workers (default 3) |
66
+ | `--min-severity high` | only batch + fix findings at or above this severity |
67
+
68
+ Read-only by default. Add `--fix` to enable the dispatch + re-audit loop.
69
+
70
+ ## Phases under investigation
71
+
72
+ The agentic pass walks each phase below and emits structured findings
73
+ (claim vs. reality). Every PASS must cite ≥3 concrete checks.
74
+
75
+ {phases_block}
76
+
77
+ ## Falsification rules
78
+
79
+ {falsification}
80
+
81
+ ## After the run
82
+
83
+ The pipeline writes one structured verdict to:
84
+
85
+ ```
86
+ Agentik_Runtime/audits.db (history — `omega audit history {name}`)
87
+ Agentik_Runtime/sessions/${{CLAUDE_SESSION_ID}}/.done.json (this turn)
88
+ ```
89
+
90
+ The `.done.json` schema:
91
+
92
+ ```json
93
+ {{
94
+ "status": "done_clean" | "pending" | "failed",
95
+ "summary": "<one-paragraph verdict>",
96
+ "artifacts": {{
97
+ "audit": "{name}",
98
+ "score": 0-100,
99
+ "verified": bool,
100
+ "findings": [...],
101
+ "fix_plan": [...],
102
+ "dispatches": [...],
103
+ "reaudit_score": 0-100 // only when --fix was used
104
+ }}
105
+ }}
106
+ ```
107
+
108
+ ## Hard rules (don't break these)
109
+
110
+ 1. **No fake "done".** First Law: only runtime tells the truth. If the
111
+ gather phase fails or the agentic verdict scores below the threshold,
112
+ you have NOT verified — set status to `pending` or `failed`.
113
+ 2. **Cap parallelism.** ≤ {default_max_batches} fix workers at a time. The
114
+ batcher enforces this; do not call out to other dispatch mechanisms.
115
+ 3. **No worker per finding.** Findings are clustered by file footprint and
116
+ severity. One worker handles one disjoint batch.
117
+ 4. **Re-audit confirms.** After fixes land, the pipeline re-runs the same
118
+ gather + agentic phases. If the score did not improve, escalate honestly.
119
+ 5. **History is the trend.** `omega audit history {name}` shows whether the
120
+ codebase is improving over time on this dimension. Use it to decide
121
+ whether to push for `--fix` again.
122
+
123
+ ## Why this audit exists
124
+
125
+ The 18 forensic audits are the OmegaOS verification layer. Claude's
126
+ "I'm done" claims used to be unverified. With these audits running as
127
+ the gate, completion is **derived from observable facts**, not declared
128
+ by the worker. Run this audit any time someone (human or agent) claims
129
+ the {domain} dimension is healthy. Insist on the score before you
130
+ accept.
131
+
132
+ ## Reference
133
+
134
+ Audit definition: `Agentik_SSOT/audits/{name}.yaml`
135
+ Engine pipeline: `omega_engine.audits.pipeline.AuditPipeline`
136
+ Batcher: `omega_engine.audits.batcher.batch_findings`
137
+ History: `omega_engine.audits.history`
138
+ """
139
+
140
+
141
+ @dataclass
142
+ class AuditSkillFile:
143
+ """A single generated SKILL.md path + content tuple."""
144
+ audit_id: str
145
+ skill_path: Path
146
+ body: str
147
+
148
+
149
+ def _short_description(audit: dict[str, Any]) -> str:
150
+ """Build a one-line description for the skill listing."""
151
+ question = (audit.get("question") or "").strip().rstrip(".")
152
+ domain = audit.get("domain", "")
153
+ return (
154
+ f"Forensic {domain} audit — {question}. Runs the gather "
155
+ f"(deterministic) + falsify (agentic) pipeline, batches fixes, "
156
+ f"dispatches capped workers, re-audits, and persists scores. "
157
+ f"Use when the user says \"/{audit['id']}\", \"audit {domain}\", "
158
+ f"or asks to verify the {domain} health of the project."
159
+ )[:1500]
160
+
161
+
162
+ def _when_to_use(audit: dict[str, Any]) -> str:
163
+ """Trigger phrases for Claude's auto-routing."""
164
+ aid = audit["id"]
165
+ domain = audit.get("domain", "")
166
+ return (
167
+ f"User says /{aid}, audit {domain}, check {domain}, "
168
+ f"verify {domain}, is {domain} healthy."
169
+ )
170
+
171
+
172
+ def _phases_block(audit: dict[str, Any]) -> str:
173
+ phases = audit.get("phases") or []
174
+ if not phases:
175
+ return "_(no phases declared — the agentic pass falls back to "
176
+ "domain-agnostic falsification)_"
177
+ parts = []
178
+ for i, p in enumerate(phases, start=1):
179
+ pid = p.get("id", f"phase-{i}")
180
+ checks = p.get("checks", "").strip()
181
+ parts.append(f"### {i}. {pid}\n\n{checks}")
182
+ return "\n\n".join(parts)
183
+
184
+
185
+ def generate_skill(audit_yaml_path: str | Path) -> AuditSkillFile:
186
+ """Read an audit YAML and produce the matching SKILL.md content."""
187
+ src = Path(audit_yaml_path)
188
+ data = yaml.safe_load(src.read_text()) or {}
189
+ if not data.get("id"):
190
+ raise ValueError(f"{src}: missing `id` — not a valid audit")
191
+ aid = data["id"]
192
+
193
+ skill_dir = src.parent.parent / "skills" / aid
194
+ skill_path = skill_dir / "SKILL.md"
195
+
196
+ body = SKILL_TEMPLATE.format(
197
+ name=aid,
198
+ domain=data.get("domain", "general"),
199
+ question=data.get("question", "").strip(),
200
+ description=_short_description(data),
201
+ when_to_use=_when_to_use(data),
202
+ phases_block=_phases_block(data),
203
+ falsification=(data.get("falsification") or "Bias toward FAIL. "
204
+ "Cite three concrete checks for every PASS.").strip(),
205
+ default_max_batches=3,
206
+ )
207
+ return AuditSkillFile(audit_id=aid, skill_path=skill_path, body=body)
208
+
209
+
210
+ def generate_all(audits_dir: str | Path) -> list[AuditSkillFile]:
211
+ """Generate SKILL.md for every audit YAML under ``audits_dir``."""
212
+ audits_dir = Path(audits_dir)
213
+ out: list[AuditSkillFile] = []
214
+ for path in sorted(audits_dir.glob("*.yaml")):
215
+ try:
216
+ out.append(generate_skill(path))
217
+ except ValueError:
218
+ continue
219
+ return out
220
+
221
+
222
+ def write_all(audits_dir: str | Path) -> dict[str, int]:
223
+ """Generate AND write every SKILL.md. Returns counts for the CLI to print."""
224
+ written = 0
225
+ skipped = 0
226
+ for sf in generate_all(audits_dir):
227
+ sf.skill_path.parent.mkdir(parents=True, exist_ok=True)
228
+ # Preserve existing content if it's identical — saves doctor noise.
229
+ if sf.skill_path.exists() and sf.skill_path.read_text() == sf.body:
230
+ skipped += 1
231
+ continue
232
+ sf.skill_path.write_text(sf.body)
233
+ written += 1
234
+ return {"written": written, "skipped": skipped}
@@ -0,0 +1,168 @@
1
+ """Audit run history — score per audit per run, persisted to SQLite.
2
+
3
+ Every ``omega audit <id>`` invocation writes a row. The CLI's ``omega audit
4
+ history <id>`` reads it back. The doctor surfaces a one-line trend.
5
+
6
+ Storage: ``$OMEGA_HOME/Agentik_Runtime/audits.db``. Same WAL mode as the
7
+ event store. Survives reinstalls (it's under Agentik_Runtime).
8
+ """
9
+ from __future__ import annotations
10
+
11
+ import json
12
+ import os
13
+ import sqlite3
14
+ import time
15
+ import uuid
16
+ from dataclasses import asdict, dataclass, field
17
+ from pathlib import Path
18
+ from typing import Any
19
+
20
+
21
+ @dataclass
22
+ class AuditRun:
23
+ run_id: str
24
+ audit_id: str
25
+ scope: str
26
+ timestamp: int
27
+ score: int
28
+ verified: bool
29
+ finding_count: int
30
+ fix_workers_dispatched: int = 0
31
+ reaudit_score: int | None = None
32
+ verdict: dict[str, Any] = field(default_factory=dict)
33
+
34
+
35
+ def _db_path(omega_home: str | Path) -> Path:
36
+ home = Path(omega_home)
37
+ (home / "Agentik_Runtime").mkdir(parents=True, exist_ok=True)
38
+ return home / "Agentik_Runtime" / "audits.db"
39
+
40
+
41
+ def _connect(omega_home: str | Path) -> sqlite3.Connection:
42
+ conn = sqlite3.connect(str(_db_path(omega_home)))
43
+ conn.row_factory = sqlite3.Row
44
+ conn.execute("PRAGMA journal_mode=WAL")
45
+ conn.execute("""
46
+ CREATE TABLE IF NOT EXISTS audit_runs (
47
+ run_id TEXT PRIMARY KEY,
48
+ audit_id TEXT NOT NULL,
49
+ scope TEXT NOT NULL,
50
+ timestamp INTEGER NOT NULL,
51
+ score INTEGER NOT NULL,
52
+ verified INTEGER NOT NULL,
53
+ finding_count INTEGER NOT NULL,
54
+ fix_workers_dispatched INTEGER NOT NULL DEFAULT 0,
55
+ reaudit_score INTEGER,
56
+ verdict_json TEXT NOT NULL
57
+ )
58
+ """)
59
+ conn.execute("""
60
+ CREATE INDEX IF NOT EXISTS idx_audit_runs_audit_id
61
+ ON audit_runs(audit_id, timestamp DESC)
62
+ """)
63
+ return conn
64
+
65
+
66
+ def record_run(omega_home: str | Path, run: AuditRun) -> None:
67
+ """Insert (or replace) one row."""
68
+ conn = _connect(omega_home)
69
+ try:
70
+ conn.execute(
71
+ """
72
+ INSERT OR REPLACE INTO audit_runs
73
+ (run_id, audit_id, scope, timestamp, score, verified,
74
+ finding_count, fix_workers_dispatched, reaudit_score, verdict_json)
75
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
76
+ """,
77
+ (
78
+ run.run_id, run.audit_id, run.scope, run.timestamp,
79
+ int(run.score), 1 if run.verified else 0,
80
+ int(run.finding_count),
81
+ int(run.fix_workers_dispatched),
82
+ run.reaudit_score if run.reaudit_score is not None else None,
83
+ json.dumps(run.verdict),
84
+ ),
85
+ )
86
+ conn.commit()
87
+ finally:
88
+ conn.close()
89
+
90
+
91
+ def list_runs(omega_home: str | Path, *,
92
+ audit_id: str | None = None,
93
+ limit: int = 50) -> list[AuditRun]:
94
+ """Last N runs for an audit (or all audits if ``audit_id`` is None)."""
95
+ conn = _connect(omega_home)
96
+ try:
97
+ if audit_id:
98
+ cur = conn.execute(
99
+ """SELECT * FROM audit_runs WHERE audit_id = ?
100
+ ORDER BY timestamp DESC LIMIT ?""",
101
+ (audit_id, int(limit)),
102
+ )
103
+ else:
104
+ cur = conn.execute(
105
+ "SELECT * FROM audit_runs ORDER BY timestamp DESC LIMIT ?",
106
+ (int(limit),),
107
+ )
108
+ rows = cur.fetchall()
109
+ finally:
110
+ conn.close()
111
+ return [_row_to_run(r) for r in rows]
112
+
113
+
114
+ def latest_score(omega_home: str | Path, audit_id: str) -> int | None:
115
+ """The score of the most recent run, or None if no run yet."""
116
+ conn = _connect(omega_home)
117
+ try:
118
+ cur = conn.execute(
119
+ """SELECT score FROM audit_runs WHERE audit_id = ?
120
+ ORDER BY timestamp DESC LIMIT 1""",
121
+ (audit_id,),
122
+ )
123
+ row = cur.fetchone()
124
+ finally:
125
+ conn.close()
126
+ return int(row["score"]) if row else None
127
+
128
+
129
+ def trend(omega_home: str | Path, audit_id: str, *, window: int = 5) -> str:
130
+ """One-character trend symbol: ↑ (improved), → (stable), ↓ (degraded)."""
131
+ runs = list_runs(omega_home, audit_id=audit_id, limit=window)
132
+ if len(runs) < 2:
133
+ return "→"
134
+ # Compare oldest vs newest within window.
135
+ oldest = runs[-1].score
136
+ newest = runs[0].score
137
+ diff = newest - oldest
138
+ if diff > 3:
139
+ return "↑"
140
+ if diff < -3:
141
+ return "↓"
142
+ return "→"
143
+
144
+
145
+ def _row_to_run(row: sqlite3.Row) -> AuditRun:
146
+ return AuditRun(
147
+ run_id=row["run_id"],
148
+ audit_id=row["audit_id"],
149
+ scope=row["scope"],
150
+ timestamp=int(row["timestamp"]),
151
+ score=int(row["score"]),
152
+ verified=bool(row["verified"]),
153
+ finding_count=int(row["finding_count"]),
154
+ fix_workers_dispatched=int(row["fix_workers_dispatched"]),
155
+ reaudit_score=(
156
+ int(row["reaudit_score"])
157
+ if row["reaudit_score"] is not None else None
158
+ ),
159
+ verdict=json.loads(row["verdict_json"]),
160
+ )
161
+
162
+
163
+ def make_run_id() -> str:
164
+ return "ar-" + uuid.uuid4().hex[:10]
165
+
166
+
167
+ def now() -> int:
168
+ return int(time.time())
@@ -0,0 +1,198 @@
1
+ """AuditPipeline — gather → analyse → batch → dispatch → reaudit → record.
2
+
3
+ Wraps the existing ``audit_arsenal.run_forensic_audit`` (gather + agentic
4
+ analysis) with the new layers the user asked for:
5
+
6
+ * **Batching** — cluster findings, never more than ``max_batches``
7
+ parallel workers.
8
+ * **Dispatching** — turn each batch into one worker mission via the
9
+ engine's executor (the same path ``omega run`` uses).
10
+ * **Re-audit** — after fixes land, run the same audit again and
11
+ compare scores.
12
+ * **History** — persist every run to ``Agentik_Runtime/audits.db``
13
+ so we can show trend and diff in the CLI / doctor.
14
+
15
+ Two operating modes:
16
+
17
+ 1. ``read_only=True`` (default for ``omega audit <id>``) —
18
+ gather + analyse + persist + return verdict. No fixes.
19
+ 2. ``read_only=False`` (``omega audit <id> --fix``) —
20
+ above + batch + dispatch up to N workers + re-audit + persist again.
21
+
22
+ All side-effecting steps are guarded by ``read_only`` so this pipeline
23
+ can be used inside a tight verification loop (the ArsenalGate keeps the
24
+ read-only path; ``--fix`` is opt-in for the CLI / autonomous charters).
25
+ """
26
+ from __future__ import annotations
27
+
28
+ import os
29
+ from dataclasses import dataclass, field
30
+ from pathlib import Path
31
+ from typing import Any
32
+
33
+ from omega_engine.audit_arsenal import (
34
+ Audit,
35
+ ArsenalVerdict,
36
+ AuditRegistry,
37
+ run_forensic_audit,
38
+ )
39
+ from omega_engine.audits.batcher import (
40
+ BatchPlan,
41
+ Finding,
42
+ batch_findings,
43
+ )
44
+ from omega_engine.audits.dispatcher import (
45
+ DispatchResult,
46
+ dispatch_fixes,
47
+ )
48
+ from omega_engine.audits.history import (
49
+ AuditRun,
50
+ make_run_id,
51
+ now,
52
+ record_run,
53
+ )
54
+
55
+
56
+ @dataclass
57
+ class AuditOutcome:
58
+ """End-to-end result of an audit pipeline run."""
59
+ run_id: str
60
+ audit_id: str
61
+ verdict: ArsenalVerdict
62
+ scope: str
63
+ plan: BatchPlan | None = None
64
+ dispatches: list[DispatchResult] = field(default_factory=list)
65
+ reaudit: ArsenalVerdict | None = None
66
+ improved: bool = False # reaudit.score > verdict.score
67
+ elapsed_s: float = 0.0
68
+
69
+
70
+ class AuditPipeline:
71
+ """Run one audit end-to-end. Use one instance per audit + scope.
72
+
73
+ The constructor takes everything dependency-injected so the pipeline
74
+ is testable without a full OmegaOS install:
75
+
76
+ * ``registry``: ``AuditRegistry`` (load from
77
+ ``Agentik_SSOT/audits/`` for production).
78
+ * ``router``: an ``omega_engine.router.ModelRouter`` (single
79
+ provider OK for tests / Mock).
80
+ * ``omega_home``: the live tree; the history DB lives under it.
81
+ * ``executor`` (optional): used in ``fix`` mode to dispatch fix
82
+ workers. Pass ``None`` for read-only runs.
83
+ """
84
+
85
+ def __init__(
86
+ self,
87
+ registry: AuditRegistry,
88
+ router: Any,
89
+ *,
90
+ omega_home: str | Path | None = None,
91
+ executor: Any = None,
92
+ ) -> None:
93
+ self._registry = registry
94
+ self._router = router
95
+ self._home = Path(omega_home or os.environ.get("OMEGA_HOME")
96
+ or Path.home() / "Omega")
97
+ self._executor = executor
98
+
99
+ def run(
100
+ self,
101
+ audit_id: str,
102
+ *,
103
+ scope: str = ".",
104
+ changed: list[str] | None = None,
105
+ role: str = "worker",
106
+ read_only: bool = True,
107
+ max_batches: int = 3,
108
+ max_files_per_batch: int = 10,
109
+ min_severity: str | None = None,
110
+ project: str | None = None,
111
+ record: bool = True,
112
+ ) -> AuditOutcome:
113
+ import time
114
+ audit = self._registry.get(audit_id)
115
+ if audit is None:
116
+ raise KeyError(f"unknown audit: {audit_id}")
117
+
118
+ ctx: dict[str, Any] = {
119
+ "path": scope, "changed": changed or [],
120
+ "role": role, "artifacts": {"path": scope},
121
+ }
122
+ if project:
123
+ ctx["project"] = {"slug": project,
124
+ "path": str(self._home / "Agentik_Coding"
125
+ / "projects" / project)}
126
+
127
+ start = time.time()
128
+ provider = self._router.resolve("audit")
129
+ verdict = run_forensic_audit(audit, ctx, provider)
130
+ elapsed = time.time() - start
131
+
132
+ plan: BatchPlan | None = None
133
+ dispatches: list[DispatchResult] = []
134
+ reaudit_verdict: ArsenalVerdict | None = None
135
+ improved = False
136
+
137
+ if not read_only and verdict.fix_plan:
138
+ # The forensic verdict produced fix tasks — batch and dispatch.
139
+ findings = [Finding.from_arsenal(f) for f in verdict.findings]
140
+ plan = batch_findings(
141
+ findings, audit_id=audit_id,
142
+ max_batches=max_batches,
143
+ max_files_per_batch=max_files_per_batch,
144
+ min_severity=min_severity,
145
+ )
146
+ dispatches = dispatch_fixes(
147
+ plan, omega_home=self._home, audit_id=audit_id,
148
+ project=project, executor=self._executor,
149
+ )
150
+ # Re-audit after the fix workers finished.
151
+ reaudit_verdict = run_forensic_audit(audit, ctx, provider)
152
+ improved = reaudit_verdict.score > verdict.score
153
+
154
+ outcome = AuditOutcome(
155
+ run_id=make_run_id(),
156
+ audit_id=audit_id,
157
+ verdict=verdict,
158
+ scope=scope,
159
+ plan=plan,
160
+ dispatches=dispatches,
161
+ reaudit=reaudit_verdict,
162
+ improved=improved,
163
+ elapsed_s=round(elapsed, 2),
164
+ )
165
+
166
+ if record:
167
+ record_run(self._home, AuditRun(
168
+ run_id=outcome.run_id,
169
+ audit_id=audit_id,
170
+ scope=scope,
171
+ timestamp=now(),
172
+ score=int(verdict.score),
173
+ verified=bool(verdict.verified),
174
+ finding_count=len(verdict.findings),
175
+ fix_workers_dispatched=len(dispatches),
176
+ reaudit_score=(
177
+ int(reaudit_verdict.score) if reaudit_verdict else None
178
+ ),
179
+ verdict=verdict.to_dict(),
180
+ ))
181
+
182
+ return outcome
183
+
184
+ def run_all_applicable(
185
+ self,
186
+ *,
187
+ scope: str = ".",
188
+ changed: list[str] | None = None,
189
+ role: str = "worker",
190
+ read_only: bool = True,
191
+ ) -> list[AuditOutcome]:
192
+ """Run every audit whose ``applies_to`` matches the context."""
193
+ applicable = self._registry.select(role=role, changed=changed or [])
194
+ return [
195
+ self.run(a.id, scope=scope, changed=changed, role=role,
196
+ read_only=read_only)
197
+ for a in applicable
198
+ ]