deepmodebot 0.9.1 → 0.10.0

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 (690) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/.claude-plugin/marketplace.json +2 -2
  3. package/.omp-plugin/marketplace.json +2 -2
  4. package/README.md +29 -5
  5. package/bin/deepmodebot.mjs +163 -4
  6. package/lib/clients.mjs +50 -3
  7. package/lib/tree.mjs +64 -10
  8. package/native/dmb-gate/Cargo.toml +13 -0
  9. package/native/dmb-gate/src/agents.rs +77 -0
  10. package/native/dmb-gate/src/ci.rs +516 -0
  11. package/native/dmb-gate/src/cleanup.rs +198 -0
  12. package/native/dmb-gate/src/gap.rs +1376 -0
  13. package/native/dmb-gate/src/guard.rs +135 -0
  14. package/native/dmb-gate/src/main.rs +327 -0
  15. package/native/dmb-gate/src/map.rs +173 -0
  16. package/native/dmb-gate/src/perf.rs +347 -0
  17. package/native/dmb-gate/src/reward.rs +1214 -0
  18. package/native/dmb-gate/src/skill_check.rs +171 -0
  19. package/native/dmb-gate/src/slop.rs +1238 -0
  20. package/native/dmb-gate/src/ui.rs +842 -0
  21. package/native/dmb-gate/src/util.rs +260 -0
  22. package/native/dmb-net/go.mod +3 -0
  23. package/native/dmb-net/main.go +624 -0
  24. package/native/dmb-net/main_test.go +122 -0
  25. package/package.json +12 -2
  26. package/plugins/deepmodebot/.antigravity-plugin/plugin.json +1 -1
  27. package/plugins/deepmodebot/.antigravity-plugin/skills/deep/SKILL.md +5 -5
  28. package/plugins/deepmodebot/.antigravity-plugin/skills/pr-thread/SKILL.md +1 -1
  29. package/plugins/deepmodebot/.antigravity-plugin/skills/review-pr/SKILL.md +2 -2
  30. package/plugins/deepmodebot/.antigravity-plugin/skills/suggest/SKILL.md +13 -0
  31. package/plugins/deepmodebot/.antigravity-plugin/skills/tournament/SKILL.md +2 -2
  32. package/plugins/deepmodebot/.claude-plugin/plugin.json +1 -1
  33. package/plugins/deepmodebot/.codex-plugin/plugin.json +46 -0
  34. package/plugins/deepmodebot/agents/comment-sicko/agent.md +35 -0
  35. package/plugins/deepmodebot/agents/researcher/agent.md +33 -0
  36. package/plugins/deepmodebot/agents/reviewer/agent.md +4 -2
  37. package/plugins/deepmodebot/agents/scout/agent.md +11 -12
  38. package/plugins/deepmodebot/agents/security-reviewer/agent.md +2 -1
  39. package/plugins/deepmodebot/commands/deep.md +6 -6
  40. package/plugins/deepmodebot/commands/research.md +8 -0
  41. package/plugins/deepmodebot/commands/suggest.md +10 -0
  42. package/plugins/deepmodebot/commands/tournament.md +2 -2
  43. package/plugins/deepmodebot/hooks/hooks.json +2 -2
  44. package/plugins/deepmodebot/hooks.json +1 -1
  45. package/plugins/deepmodebot/scripts/antigravity-guard.mjs +140 -7
  46. package/plugins/deepmodebot/scripts/omp-mcp-server.mjs +179 -47
  47. package/plugins/deepmodebot/skills/agent-harnesses/SKILL.md +4 -6
  48. package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/check_antigravity.py +3 -0
  49. package/plugins/deepmodebot/skills/agent-harnesses/references/ai-native-tooling.md +4 -0
  50. package/plugins/deepmodebot/skills/agent-harnesses/references/ai-sdk-selection.md +3 -1
  51. package/plugins/deepmodebot/skills/agent-harnesses/references/antigravity.md +2 -2
  52. package/plugins/deepmodebot/skills/agent-harnesses/references/delegation-efficiency.md +12 -2
  53. package/plugins/deepmodebot/skills/agent-harnesses/references/protocols.md +11 -3
  54. package/plugins/deepmodebot/skills/app-automation-relay/SKILL.md +17 -0
  55. package/plugins/deepmodebot/skills/app-automation-relay/assets/relay_server.ts +364 -0
  56. package/plugins/deepmodebot/skills/app-automation-relay/references/adapter-cookbook.md +15 -0
  57. package/plugins/deepmodebot/skills/app-automation-relay/references/wire-protocol.md +23 -0
  58. package/plugins/deepmodebot/skills/cloud-devsecops/SKILL.md +4 -3
  59. package/plugins/deepmodebot/skills/cloud-devsecops/references/cloudflare-edge.md +43 -0
  60. package/plugins/deepmodebot/skills/cloud-devsecops/references/local-emulators.md +15 -2
  61. package/plugins/deepmodebot/skills/contribute/SKILL.md +3 -35
  62. package/plugins/deepmodebot/skills/create-formal-verification-skill/LICENSE +21 -0
  63. package/plugins/deepmodebot/skills/create-formal-verification-skill/NOTICE.md +16 -0
  64. package/plugins/deepmodebot/skills/create-formal-verification-skill/SKILL.md +71 -0
  65. package/plugins/deepmodebot/skills/create-verification-skill/SKILL.md +2 -2
  66. package/plugins/deepmodebot/skills/deep-learning/LICENSE +21 -0
  67. package/plugins/deepmodebot/skills/deep-learning/SKILL.md +33 -0
  68. package/plugins/deepmodebot/skills/deep-learning/references/neural-architectures.md +43 -0
  69. package/plugins/deepmodebot/skills/deep-learning/references/papers-and-repos.md +128 -0
  70. package/plugins/deepmodebot/skills/deep-learning/references/reinforcement-learning.md +57 -0
  71. package/plugins/deepmodebot/skills/deep-learning/references/training-optimization.md +40 -0
  72. package/plugins/deepmodebot/skills/deep-learning/references/weight-space-programming.md +76 -0
  73. package/plugins/deepmodebot/skills/deep-learning/scripts/hf_passes.py +166 -0
  74. package/plugins/deepmodebot/skills/deep-learning/scripts/wsp.py +493 -0
  75. package/plugins/deepmodebot/skills/deep-stack/SKILL.md +1 -1
  76. package/plugins/deepmodebot/skills/deep-stack/references/design-workflow.md +46 -92
  77. package/plugins/deepmodebot/skills/deep-stack/references/isolate.md +1 -0
  78. package/plugins/deepmodebot/skills/deep-stack/references/prove.md +6 -0
  79. package/plugins/deepmodebot/skills/deep-stack/references/stack.md +11 -1
  80. package/plugins/deepmodebot/skills/deepmodebot/SKILL.md +74 -145
  81. package/plugins/deepmodebot/skills/deepmodebot/assets/agents-md/agents_md.py +18 -6
  82. package/plugins/deepmodebot/skills/deepmodebot/assets/autoroute/autoroute.py +1021 -0
  83. package/plugins/deepmodebot/skills/deepmodebot/assets/cleanup/self_cleanup.py +305 -0
  84. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/claude_guard.py +98 -5
  85. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/omp-contain.ts +106 -5
  86. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/design.py +3 -0
  87. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/record.py +2 -0
  88. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/rehearsal_gate.py +536 -0
  89. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/review.py +2 -0
  90. package/plugins/deepmodebot/skills/deepmodebot/assets/formal-verification/verify_proof.py +638 -0
  91. package/plugins/deepmodebot/skills/deepmodebot/assets/gap-audit/gap_audit.py +1053 -0
  92. package/plugins/deepmodebot/skills/deepmodebot/assets/gen-ui/gen_ui.py +1782 -0
  93. package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard-patterns.txt +7 -0
  94. package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard.sh +3 -2
  95. package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard.ts +9 -5
  96. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/ghapp.py +2 -0
  97. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/install.py +2 -0
  98. package/plugins/deepmodebot/skills/deepmodebot/assets/local-ci/local_ci.py +540 -0
  99. package/plugins/deepmodebot/skills/deepmodebot/assets/local-ci/slop_gate.py +642 -0
  100. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/loop.py +2 -1
  101. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/plan.py +2 -1
  102. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/windows_job.py +2 -0
  103. package/plugins/deepmodebot/skills/deepmodebot/assets/memory/project_memory.py +529 -0
  104. package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/bench_harness.py +48 -21
  105. package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/perf_audit.py +339 -5
  106. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/diff_coverage.py +96 -6
  107. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/pr_agent_local.py +2 -0
  108. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/arena.py +2 -0
  109. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/show_thread.py +2 -0
  110. package/plugins/deepmodebot/skills/deepmodebot/assets/prompt-tools/prompt_tools.py +1239 -0
  111. package/plugins/deepmodebot/skills/deepmodebot/assets/quota-guard/quota_guard.py +424 -0
  112. package/plugins/deepmodebot/skills/deepmodebot/assets/repo-references.json +477 -1
  113. package/plugins/deepmodebot/skills/deepmodebot/assets/reward-guard/reward_guard.py +1597 -0
  114. package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rule-paths.json +57 -0
  115. package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rule_ledger.py +1645 -0
  116. package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_enrich.py +2 -0
  117. package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_meta.py +2 -0
  118. package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_transcript_relay.js +13 -10
  119. package/plugins/deepmodebot/skills/deepmodebot/assets/security-audit/static_sec_audit.py +275 -0
  120. package/plugins/deepmodebot/skills/deepmodebot/assets/self-grill/self_grill.py +1473 -0
  121. package/plugins/deepmodebot/skills/deepmodebot/assets/setup/model_setup.py +329 -0
  122. package/plugins/deepmodebot/skills/deepmodebot/assets/setup/project_setup.py +312 -0
  123. package/plugins/deepmodebot/skills/deepmodebot/assets/tournament/tournament.py +304 -18
  124. package/plugins/deepmodebot/skills/deepmodebot/assets/workspace-map/workspace_map.py +121 -78
  125. package/plugins/deepmodebot/skills/deepmodebot/references/README.md +14 -0
  126. package/plugins/deepmodebot/skills/deepmodebot/references/catalog.md +16 -11
  127. package/plugins/deepmodebot/skills/deepmodebot/references/contain.md +2 -1
  128. package/plugins/deepmodebot/skills/deepmodebot/references/delegation.md +14 -0
  129. package/plugins/deepmodebot/skills/deepmodebot/references/flows.md +2 -0
  130. package/plugins/deepmodebot/skills/deepmodebot/references/full-scope.md +9 -0
  131. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/babysit.md +2 -0
  132. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/end-to-end.md +12 -9
  133. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/feature.md +7 -3
  134. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/hillclimb.md +2 -0
  135. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/investigation.md +4 -4
  136. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/opening-a-pr.md +1 -1
  137. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/perf-issue.md +13 -10
  138. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/refactoring.md +6 -6
  139. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/reference-rebuild.md +1 -0
  140. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/run-a-goal.md +3 -1
  141. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/setup.md +1 -2
  142. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/visual-parity.md +1 -0
  143. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/work-a-queue.md +4 -2
  144. package/plugins/deepmodebot/skills/deepmodebot/references/principles/hardcore-mode.md +7 -0
  145. package/plugins/deepmodebot/skills/deepmodebot/references/principles/no-reward-hacking.md +8 -0
  146. package/plugins/deepmodebot/skills/deepmodebot/references/principles/test-behavior-not-implementation.md +2 -1
  147. package/plugins/deepmodebot/skills/deepmodebot/references/principles/type-system-discipline.md +2 -2
  148. package/plugins/deepmodebot/skills/deepmodebot/references/rule-approval.md +51 -0
  149. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/architect.md +10 -24
  150. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/architecture-review.md +5 -4
  151. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/arena.md +3 -3
  152. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/autoroute.md +49 -0
  153. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/blast-radius.md +1 -1
  154. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/catchup-video.md +13 -0
  155. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/correct.md +8 -7
  156. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/course.md +2 -1
  157. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/devex-review.md +13 -0
  158. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/expand-contract.md +13 -0
  159. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/formal-verification.md +33 -0
  160. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/gen-ui.md +60 -0
  161. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/grill.md +2 -1
  162. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/how.md +7 -18
  163. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/inner-loop.md +7 -7
  164. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/model-setup.md +14 -0
  165. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/modernize-pr.md +15 -0
  166. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/mutation-testing.md +13 -0
  167. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/no-comments.md +5 -5
  168. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/panel.md +7 -3
  169. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pr-conversation.md +1 -1
  170. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pr-review.md +8 -5
  171. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pre-commit.md +1 -2
  172. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/prior-art.md +33 -38
  173. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/product-lens.md +12 -0
  174. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/prompt-upgrade.md +30 -0
  175. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/recall.md +1 -1
  176. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/reframe.md +18 -0
  177. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/release-and-canary.md +10 -0
  178. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/research.md +62 -89
  179. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/security-audit.md +5 -1
  180. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/self-grill.md +54 -0
  181. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/sharpen.md +3 -3
  182. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/show-me-your-work.md +7 -0
  183. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/sme-review.md +3 -2
  184. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/suggest.md +24 -0
  185. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/swarm.md +7 -0
  186. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/teach.md +2 -2
  187. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/tournament.md +12 -11
  188. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/variant-analysis.md +11 -0
  189. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/video-forensics.md +46 -0
  190. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/visual-e2e.md +10 -1
  191. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/webhook-ui.md +11 -0
  192. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/writing-for-agents.md +6 -0
  193. package/plugins/deepmodebot/skills/deepmodebot/scripts/check_skill.py +7 -0
  194. package/plugins/deepmodebot/skills/deepmodebot/scripts/trending.py +141 -18
  195. package/plugins/deepmodebot/skills/deepmodebot/worker.md +16 -0
  196. package/plugins/deepmodebot/skills/domain-rules/SKILL.md +13 -119
  197. package/plugins/deepmodebot/skills/domain-rules/references/backend-system-design.md +19 -1
  198. package/plugins/deepmodebot/skills/domain-rules/references/engineering-practice.md +7 -0
  199. package/plugins/deepmodebot/skills/domain-rules/references/language-ecosystems.md +11 -0
  200. package/plugins/deepmodebot/skills/domain-rules/references/sources.md +108 -0
  201. package/plugins/deepmodebot/skills/frontend-ui/SKILL.md +30 -131
  202. package/plugins/deepmodebot/skills/frontend-ui/assets/themes/canvas.css +42 -0
  203. package/plugins/deepmodebot/skills/frontend-ui/assets/themes/editorial.css +39 -0
  204. package/plugins/deepmodebot/skills/frontend-ui/assets/themes/layouts.css +95 -0
  205. package/plugins/deepmodebot/skills/frontend-ui/assets/themes/swiss.css +40 -0
  206. package/plugins/deepmodebot/skills/frontend-ui/assets/themes/tactile.css +41 -0
  207. package/plugins/deepmodebot/skills/frontend-ui/assets/themes/workbench.css +50 -0
  208. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/mobbin-animations.md +49 -0
  209. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/mobbin-shipped-apps.md +46 -24
  210. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/motion-clips.md +27 -258
  211. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/motion-graphics.md +26 -51
  212. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/pinterest-animations.md +22 -195
  213. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/00-art-direction.md +39 -0
  214. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/01-workflow.md +27 -24
  215. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/02-review-rubric.md +23 -17
  216. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/03-ai-tells.md +22 -45
  217. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/04-components.md +11 -0
  218. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/04a-agent-ui.md +32 -152
  219. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/05-motion.md +36 -91
  220. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/05a-motion-graphics.md +14 -120
  221. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06-typography-layout.md +11 -10
  222. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06a-color.md +9 -9
  223. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06b-media-icons-charts.md +19 -0
  224. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06c-product-shots-craft.md +42 -0
  225. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/07-copy.md +5 -6
  226. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/08-quality-floor.md +28 -56
  227. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/09-steering-agents.md +9 -7
  228. package/plugins/deepmodebot/skills/frontend-ui/scripts/motion_diff.py +259 -0
  229. package/plugins/deepmodebot/skills/frontend-ui/scripts/ui_audit.py +496 -0
  230. package/plugins/deepmodebot/skills/maintain-formal-verification-skill/LICENSE +21 -0
  231. package/plugins/deepmodebot/skills/maintain-formal-verification-skill/NOTICE.md +16 -0
  232. package/plugins/deepmodebot/skills/maintain-formal-verification-skill/SKILL.md +68 -0
  233. package/plugins/deepmodebot/skills/maintain-verification-skill/SKILL.md +1 -1
  234. package/plugins/deepmodebot/skills/office-documents/SKILL.md +24 -0
  235. package/plugins/deepmodebot/skills/office-documents/references/documents-docx-pdf.md +15 -0
  236. package/plugins/deepmodebot/skills/office-documents/references/presentations-pptx.md +15 -0
  237. package/plugins/deepmodebot/skills/office-documents/references/spreadsheets-xlsx.md +15 -0
  238. package/plugins/deepmodebot/skills/office-documents/scripts/doc_audit.py +230 -0
  239. package/plugins/deepmodebot/skills/project-brief/SKILL.md +2 -19
  240. package/plugins/deepmodebot/skills/project-brief/assets/pr-overlap.py +4 -0
  241. package/plugins/deepmodebot/skills/project-brief/assets/sync-roadmap.py +4 -0
  242. package/plugins/deepmodebot/skills/project-brief/references/claim-contract.md +55 -0
  243. package/plugins/deepmodebot/skills/research/SKILL.md +18 -0
  244. package/plugins/deepmodebot/skills/secrets-and-auth/SKILL.md +1 -1
  245. package/plugins/deepmodebot/skills/seo-and-geo/SKILL.md +29 -0
  246. package/plugins/deepmodebot/skills/seo-and-geo/references/geo-and-agentic-web.md +30 -0
  247. package/plugins/deepmodebot/skills/seo-and-geo/references/technical-and-schema.md +25 -0
  248. package/plugins/deepmodebot/skills/seo-and-geo/scripts/seo_audit.py +282 -0
  249. package/plugins/deepmodebot/skills/software-architecture/SKILL.md +2 -2
  250. package/plugins/deepmodebot/skills/software-architecture/references/backend-infrastructure.md +5 -0
  251. package/plugins/deepmodebot/skills/software-architecture/references/monorepos.md +1 -0
  252. package/plugins/deepmodebot/skills/statechart/LICENSE +21 -0
  253. package/plugins/deepmodebot/skills/statechart/NOTICE.md +21 -0
  254. package/plugins/deepmodebot/skills/statechart/SKILL.md +106 -0
  255. package/plugins/deepmodebot/skills/statechart/references/render.md +93 -0
  256. package/plugins/deepmodebot/skills/statechart/references/tooling.md +78 -0
  257. package/plugins/deepmodebot/skills/statechart/scripts/backends/cfg.ts +33 -0
  258. package/plugins/deepmodebot/skills/statechart/scripts/backends/mermaid.ts +249 -0
  259. package/plugins/deepmodebot/skills/statechart/scripts/backends/plain-text.ts +72 -0
  260. package/plugins/deepmodebot/skills/statechart/scripts/backends/report.ts +177 -0
  261. package/plugins/deepmodebot/skills/statechart/scripts/frontends/config.ts +276 -0
  262. package/plugins/deepmodebot/skills/statechart/scripts/frontends/dot.ts +77 -0
  263. package/plugins/deepmodebot/skills/statechart/scripts/frontends/marks.ts +93 -0
  264. package/plugins/deepmodebot/skills/statechart/scripts/frontends/messages.ts +52 -0
  265. package/plugins/deepmodebot/skills/statechart/scripts/frontends/spec.ts +114 -0
  266. package/plugins/deepmodebot/skills/statechart/scripts/frontends/trace.ts +24 -0
  267. package/plugins/deepmodebot/skills/statechart/scripts/frontends/value.ts +166 -0
  268. package/plugins/deepmodebot/skills/statechart/scripts/frontends/verdict.ts +40 -0
  269. package/plugins/deepmodebot/skills/statechart/scripts/frontends/view.ts +119 -0
  270. package/plugins/deepmodebot/skills/statechart/scripts/ir.ts +547 -0
  271. package/plugins/deepmodebot/skills/statechart/scripts/janitor.ts +13 -0
  272. package/plugins/deepmodebot/skills/statechart/scripts/kill.ts +15 -0
  273. package/plugins/deepmodebot/skills/statechart/scripts/package.json +11 -0
  274. package/plugins/deepmodebot/skills/statechart/scripts/passes/annotate.ts +128 -0
  275. package/plugins/deepmodebot/skills/statechart/scripts/passes/label.ts +269 -0
  276. package/plugins/deepmodebot/skills/statechart/scripts/passes/lift.ts +85 -0
  277. package/plugins/deepmodebot/skills/statechart/scripts/passes/loop-check.ts +68 -0
  278. package/plugins/deepmodebot/skills/statechart/scripts/passes/paths.ts +60 -0
  279. package/plugins/deepmodebot/skills/statechart/scripts/passes/reach.ts +135 -0
  280. package/plugins/deepmodebot/skills/statechart/scripts/passes/region-check.ts +97 -0
  281. package/plugins/deepmodebot/skills/statechart/scripts/passes/regions.ts +295 -0
  282. package/plugins/deepmodebot/skills/statechart/scripts/pipeline.ts +76 -0
  283. package/plugins/deepmodebot/skills/statechart/scripts/run.ts +500 -0
  284. package/plugins/deepmodebot/skills/statechart/scripts/statechart +29 -0
  285. package/plugins/deepmodebot/skills/statechart/scripts/statechart.ts +165 -0
  286. package/plugins/deepmodebot/skills/statechart/scripts/test/ConfigOracle.java +63 -0
  287. package/plugins/deepmodebot/skills/statechart/scripts/test/chart.test.ts +1253 -0
  288. package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Braces.mmd +7 -0
  289. package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Escapes.mmd +11 -0
  290. package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Phases.mmd +29 -0
  291. package/plugins/deepmodebot/skills/statechart/scripts/test/cli.test.ts +1344 -0
  292. package/plugins/deepmodebot/skills/statechart/scripts/test/config-fuzz.test.ts +263 -0
  293. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/ChartRun.out +57 -0
  294. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/Counter.cfg +3 -0
  295. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/Counter.tla +10 -0
  296. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/chart.mmd +9 -0
  297. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/graph.dot +16 -0
  298. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/report.md +7 -0
  299. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/sany.out +2 -0
  300. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/verdict-1.out +49 -0
  301. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/ChartRun.out +60 -0
  302. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.cfg +4 -0
  303. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.tla +22 -0
  304. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/chart.mmd +26 -0
  305. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/graph.dot +19 -0
  306. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/report.md +20 -0
  307. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/sany.out +2 -0
  308. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.exit +1 -0
  309. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.out +56 -0
  310. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.exit +1 -0
  311. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.out +82 -0
  312. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-3.out +57 -0
  313. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/ChartRun.out +59 -0
  314. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.cfg +3 -0
  315. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.tla +11 -0
  316. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/chart.mmd +22 -0
  317. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/graph.dot +16 -0
  318. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/report.md +17 -0
  319. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/sany.out +2 -0
  320. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.exit +1 -0
  321. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.out +56 -0
  322. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.exit +1 -0
  323. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.out +77 -0
  324. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/ChartRun.out +69 -0
  325. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.cfg +2 -0
  326. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.tla +11 -0
  327. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/chart.mmd +85 -0
  328. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/graph.dot +70 -0
  329. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/report.md +12 -0
  330. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/sany.out +2 -0
  331. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.exit +1 -0
  332. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.out +67 -0
  333. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-2.out +57 -0
  334. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.exit +1 -0
  335. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.out +85 -0
  336. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.cfg +6 -0
  337. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.tla +13 -0
  338. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/chart.mmd +5 -0
  339. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/graph.dot +10 -0
  340. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/report.md +31 -0
  341. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/sany.out +2 -0
  342. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.exit +1 -0
  343. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.out +64 -0
  344. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.exit +1 -0
  345. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.out +77 -0
  346. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/ChartRun.out +55 -0
  347. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.cfg +3 -0
  348. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.tla +10 -0
  349. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/chart.mmd +12 -0
  350. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/graph.dot +6 -0
  351. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/report.md +12 -0
  352. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/sany.out +2 -0
  353. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.exit +1 -0
  354. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.out +33 -0
  355. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-2.out +54 -0
  356. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/ChartRun.out +54 -0
  357. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.cfg +3 -0
  358. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.tla +10 -0
  359. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/chart.mmd +1 -0
  360. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/graph.dot +6 -0
  361. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/report.md +7 -0
  362. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/sany.out +2 -0
  363. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/verdict-1.out +46 -0
  364. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/ChartRun.out +59 -0
  365. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.cfg +2 -0
  366. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.tla +10 -0
  367. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterSteps.tla +6 -0
  368. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/chart.mmd +17 -0
  369. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/graph.dot +15 -0
  370. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/report.md +14 -0
  371. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/sany.out +3 -0
  372. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.exit +1 -0
  373. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.out +78 -0
  374. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/ChartRun.out +59 -0
  375. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.cfg +3 -0
  376. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.tla +19 -0
  377. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/chart.mmd +26 -0
  378. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/graph.dot +22 -0
  379. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/report.md +12 -0
  380. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/sany.out +2 -0
  381. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.exit +1 -0
  382. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.out +58 -0
  383. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-2.out +57 -0
  384. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/ChartRun.out +57 -0
  385. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.cfg +2 -0
  386. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.tla +11 -0
  387. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/chart.mmd +17 -0
  388. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/graph.dot +15 -0
  389. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/report.md +14 -0
  390. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/sany.out +2 -0
  391. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.exit +1 -0
  392. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.out +76 -0
  393. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/ChartRun.out +59 -0
  394. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.cfg +3 -0
  395. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.tla +11 -0
  396. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/chart.mmd +19 -0
  397. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/graph.dot +10 -0
  398. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/report.md +15 -0
  399. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/sany.out +2 -0
  400. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.exit +1 -0
  401. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.out +56 -0
  402. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.exit +1 -0
  403. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.out +67 -0
  404. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/ChartRun.out +62 -0
  405. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.cfg +6 -0
  406. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.tla +24 -0
  407. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/Moves.tla +5 -0
  408. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/chart.mmd +22 -0
  409. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/graph.dot +10 -0
  410. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/report.md +23 -0
  411. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/sany.out +3 -0
  412. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.exit +1 -0
  413. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.out +58 -0
  414. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.exit +1 -0
  415. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.out +66 -0
  416. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.exit +1 -0
  417. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.out +74 -0
  418. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-4.out +59 -0
  419. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/ChartRun.out +58 -0
  420. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.cfg +3 -0
  421. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.tla +15 -0
  422. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/chart.mmd +18 -0
  423. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/graph.dot +13 -0
  424. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/report.md +11 -0
  425. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/sany.out +2 -0
  426. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.exit +1 -0
  427. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.out +33 -0
  428. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-2.out +57 -0
  429. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/ChartRun.out +57 -0
  430. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.cfg +3 -0
  431. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.tla +15 -0
  432. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/chart.mmd +7 -0
  433. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/graph.dot +13 -0
  434. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/report.md +6 -0
  435. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/sany.out +2 -0
  436. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/verdict-1.out +49 -0
  437. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/ChartRun.out +61 -0
  438. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.cfg +4 -0
  439. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.tla +14 -0
  440. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/chart.mmd +30 -0
  441. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/graph.dot +19 -0
  442. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/report.md +27 -0
  443. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/sany.out +2 -0
  444. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.exit +1 -0
  445. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.out +56 -0
  446. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.exit +1 -0
  447. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.out +64 -0
  448. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.exit +1 -0
  449. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.out +87 -0
  450. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-4.out +57 -0
  451. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/ChartRun.out +60 -0
  452. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.cfg +3 -0
  453. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.tla +12 -0
  454. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/chart.mmd +23 -0
  455. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/graph.dot +19 -0
  456. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/report.md +11 -0
  457. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/sany.out +2 -0
  458. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.exit +1 -0
  459. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.out +56 -0
  460. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-2.out +57 -0
  461. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/ChartRun.out +61 -0
  462. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/CounterView.cfg +4 -0
  463. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/CounterView.tla +14 -0
  464. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/chart.mmd +23 -0
  465. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/graph.dot +19 -0
  466. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/report.md +27 -0
  467. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/sany.out +2 -0
  468. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-1.exit +1 -0
  469. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-1.out +56 -0
  470. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-2.exit +1 -0
  471. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-2.out +64 -0
  472. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-3.exit +1 -0
  473. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-3.out +87 -0
  474. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-4.out +57 -0
  475. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/view.mjs +1 -0
  476. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/ChartRun.out +59 -0
  477. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/DieHard.cfg +4 -0
  478. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/DieHard.tla +38 -0
  479. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/chart.mmd +92 -0
  480. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/graph.dot +126 -0
  481. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/report.md +17 -0
  482. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/sany.out +2 -0
  483. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-1.exit +1 -0
  484. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-1.out +91 -0
  485. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-2.out +57 -0
  486. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/ChartRun.out +61 -0
  487. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.cfg +6 -0
  488. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.tla +11 -0
  489. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/chart.mmd +22 -0
  490. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/graph.dot +16 -0
  491. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/report.md +25 -0
  492. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/sany.out +2 -0
  493. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.exit +1 -0
  494. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.out +56 -0
  495. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.exit +1 -0
  496. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.out +64 -0
  497. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.exit +1 -0
  498. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.out +64 -0
  499. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.exit +1 -0
  500. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.out +77 -0
  501. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/ChartRun.out +57 -0
  502. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.cfg +4 -0
  503. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.tla +11 -0
  504. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/chart.mmd +13 -0
  505. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/graph.dot +12 -0
  506. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/report.md +11 -0
  507. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/sany.out +2 -0
  508. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.exit +1 -0
  509. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.out +72 -0
  510. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/ChartRun.out +57 -0
  511. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/Login.cfg +3 -0
  512. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/Login.tla +62 -0
  513. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/chart.mmd +28 -0
  514. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/graph.dot +40 -0
  515. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/report.md +7 -0
  516. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/sany.out +1 -0
  517. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/verdict-1.out +47 -0
  518. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/view.mjs +1 -0
  519. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/ChartRun.out +57 -0
  520. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.cfg +2 -0
  521. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.tla +64 -0
  522. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/chart.mmd +28 -0
  523. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/graph.dot +37 -0
  524. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/report.md +8 -0
  525. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/sany.out +1 -0
  526. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/verdict-1.out +47 -0
  527. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/view.mjs +1 -0
  528. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/ChartRun.out +60 -0
  529. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.cfg +3 -0
  530. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.tla +64 -0
  531. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/chart.mmd +44 -0
  532. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/graph.dot +58 -0
  533. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/report.md +17 -0
  534. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/sany.out +1 -0
  535. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.exit +1 -0
  536. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.out +83 -0
  537. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-2.out +57 -0
  538. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/view.mjs +1 -0
  539. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/ChartRun.out +60 -0
  540. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.cfg +3 -0
  541. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.tla +103 -0
  542. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/chart.mmd +43 -0
  543. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/graph.dot +93 -0
  544. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/report.md +14 -0
  545. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/sany.out +1 -0
  546. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.exit +1 -0
  547. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.out +59 -0
  548. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-2.out +72 -0
  549. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/view.mjs +3 -0
  550. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/ChartRun.out +57 -0
  551. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.cfg +2 -0
  552. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.tla +100 -0
  553. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/chart.mmd +31 -0
  554. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/graph.dot +85 -0
  555. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/report.md +9 -0
  556. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/sany.out +1 -0
  557. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/verdict-1.out +47 -0
  558. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/view.mjs +3 -0
  559. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/ChartRun.out +59 -0
  560. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayer.tla +103 -0
  561. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.cfg +3 -0
  562. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.tla +6 -0
  563. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/chart.mmd +42 -0
  564. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/graph.dot +93 -0
  565. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/report.md +19 -0
  566. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/sany.out +2 -0
  567. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.exit +1 -0
  568. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.out +61 -0
  569. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-2.out +59 -0
  570. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-3.out +61 -0
  571. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.exit +1 -0
  572. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.out +66 -0
  573. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.exit +1 -0
  574. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.out +58 -0
  575. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-6.out +49 -0
  576. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/view.mjs +3 -0
  577. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/ChartRun.out +57 -0
  578. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.cfg +6 -0
  579. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.tla +11 -0
  580. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/chart.mmd +5 -0
  581. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/graph.dot +11 -0
  582. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/report.md +7 -0
  583. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/sany.out +5 -0
  584. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/verdict-1.out +70 -0
  585. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ChartRun.out +61 -0
  586. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/Shadow.cfg +4 -0
  587. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/Shadow.tla +11 -0
  588. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ShadowLib.tla +6 -0
  589. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ShadowSub.tla +3 -0
  590. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/chart.mmd +9 -0
  591. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/graph.dot +16 -0
  592. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/report.md +8 -0
  593. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/sany.out +4 -0
  594. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/verdict-1.out +65 -0
  595. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/ChartRun.out +59 -0
  596. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.cfg +2 -0
  597. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.tla +9 -0
  598. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/chart.mmd +23 -0
  599. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/graph.dot +17 -0
  600. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/report.md +15 -0
  601. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/sany.out +1 -0
  602. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.exit +1 -0
  603. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.out +65 -0
  604. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.exit +1 -0
  605. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.out +75 -0
  606. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/ChartRun.out +69 -0
  607. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.cfg +3 -0
  608. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.tla +75 -0
  609. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/chart.mmd +60 -0
  610. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/graph.dot +297 -0
  611. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/report.md +20 -0
  612. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/sany.out +1 -0
  613. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.exit +1 -0
  614. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.out +95 -0
  615. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-2.out +57 -0
  616. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/view.mjs +1 -0
  617. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/ChartRun.out +57 -0
  618. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.cfg +3 -0
  619. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.tla +75 -0
  620. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/chart.mmd +37 -0
  621. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/graph.dot +223 -0
  622. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/report.md +11 -0
  623. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/sany.out +1 -0
  624. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/verdict-1.out +47 -0
  625. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/view.mjs +1 -0
  626. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.exit +1 -0
  627. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.out +75 -0
  628. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.cfg +5 -0
  629. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.tla +11 -0
  630. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/chart.mmd +18 -0
  631. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/graph.dot +14 -0
  632. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/report.md +29 -0
  633. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/sany.out +2 -0
  634. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.exit +1 -0
  635. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.out +64 -0
  636. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.exit +1 -0
  637. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.out +75 -0
  638. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/ChartRun.out +58 -0
  639. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.cfg +2 -0
  640. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.tla +8 -0
  641. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/chart.mmd +22 -0
  642. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/graph.dot +16 -0
  643. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/report.md +15 -0
  644. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/sany.out +2 -0
  645. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.exit +1 -0
  646. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.out +56 -0
  647. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.exit +1 -0
  648. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.out +77 -0
  649. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus.test.ts +441 -0
  650. package/plugins/deepmodebot/skills/statechart/scripts/test/differential.test.ts +565 -0
  651. package/plugins/deepmodebot/skills/statechart/scripts/test/drawn.ts +20 -0
  652. package/plugins/deepmodebot/skills/statechart/scripts/test/grid/Grid.cfg +2 -0
  653. package/plugins/deepmodebot/skills/statechart/scripts/test/grid/Grid.tla +9 -0
  654. package/plugins/deepmodebot/skills/statechart/scripts/test/grid/sany.out +2 -0
  655. package/plugins/deepmodebot/skills/statechart/scripts/test/java.ts +63 -0
  656. package/plugins/deepmodebot/skills/statechart/scripts/test/labels.ts +648 -0
  657. package/plugins/deepmodebot/skills/statechart/scripts/test/messages.test.ts +226 -0
  658. package/plugins/deepmodebot/skills/statechart/scripts/test/pipeline.test.ts +270 -0
  659. package/plugins/deepmodebot/skills/statechart/scripts/test/plain-tlc.test.ts +255 -0
  660. package/plugins/deepmodebot/skills/statechart/scripts/test/render.test.ts +145 -0
  661. package/plugins/deepmodebot/skills/statechart/scripts/test/tlc-out.test.ts +90 -0
  662. package/plugins/deepmodebot/skills/statechart/scripts/test/tlc.ts +158 -0
  663. package/plugins/deepmodebot/skills/statechart/scripts/tsconfig.json +11 -0
  664. package/plugins/deepmodebot/skills/statechart/scripts/worker.ts +35 -0
  665. package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/bun.lock +0 -391
  666. package/plugins/deepmodebot/skills/deepmodebot/assets/agents-md/test_agents_md.py +0 -146
  667. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_antigravity_guard.py +0 -483
  668. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_audit_regressions.py +0 -139
  669. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_contain.py +0 -301
  670. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_omp_mcp.py +0 -602
  671. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_design.py +0 -69
  672. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_evidence.py +0 -160
  673. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_record.py +0 -180
  674. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_review.py +0 -265
  675. package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/test_git_guard.py +0 -192
  676. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_bot.py +0 -2182
  677. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_brand.py +0 -19
  678. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_local_updates.py +0 -691
  679. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_review_context.py +0 -127
  680. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_workspace_cleanup.py +0 -496
  681. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_loop.py +0 -1426
  682. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_plan.py +0 -320
  683. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_windows_job.py +0 -326
  684. package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/test_bench_harness.py +0 -55
  685. package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/test_perf_audit.py +0 -53
  686. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/test_diff_coverage.py +0 -94
  687. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/test_arena.py +0 -610
  688. package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/test_yt_enrich.py +0 -250
  689. package/plugins/deepmodebot/skills/deepmodebot/assets/tournament/test_tournament.py +0 -654
  690. package/plugins/deepmodebot/skills/deepmodebot/assets/workspace-map/test_workspace_map.py +0 -879
@@ -0,0 +1,1021 @@
1
+ #!/usr/bin/env python3
2
+ """Pure LLM semantic auto-routing loop with live disk catalog discovery and deterministic checks & balances.
3
+
4
+ python autoroute.py route --root <repo> --stdin [--harness auto|agy|claude|codex] [--json] <<'EOF'
5
+ python autoroute.py menu --root <repo> --stdin [--json] <<'EOF'
6
+ python autoroute.py verify --root <repo> --prompt <text> --decision-stdin [--critic-round 2] [--strict] [--json] <<'EOF'
7
+ python autoroute.py reroute --root <repo> --current-mode <mode> --current-size <size> [--failed-attempts N] [--json]
8
+ """
9
+ import argparse
10
+ import importlib.util
11
+ import json
12
+ import os
13
+ import re
14
+ import shutil
15
+ import subprocess
16
+ import sys
17
+ from pathlib import Path
18
+ from typing import Callable
19
+
20
+ sys.dont_write_bytecode = True
21
+
22
+ NO_WINDOW = getattr(subprocess, "CREATE_NO_WINDOW", 0)
23
+ SKILL_DIR = Path(__file__).resolve().parents[2]
24
+ PLUGINS_SKILLS_DIR = SKILL_DIR.parent
25
+ ASSETS_DIR = SKILL_DIR / "assets"
26
+
27
+ READ_ONLY_MODES = frozenset({
28
+ "investigation", "runtime-forensics", "trace-forensics", "triage",
29
+ "pr-review", "grill", "product-lens", "devex-review", "self-grill", "tournament", "research", "flows",
30
+ "architecture-review", "retro", "course", "questionnaire", "re-explain",
31
+ "security-audit", "variant-analysis", "pr-agent", "blast-radius", "sharpen", "reframe", "reflect", "recall", "catchup-video",
32
+ "interrogate", "sme-review", "formal-verification", "statechart", "prior-art", "wizard",
33
+ "scrape", "suggest", "teach", "why", "how", "autoroute",
34
+ "goal-review", "workspace-map", "open-design-evidence", "deep-stack", "seo-and-geo",
35
+ })
36
+
37
+ FLEXIBLE_SIZE_MODES = frozenset({
38
+ "eval", "arena", "prompt-upgrade", "self-authoring", "video-forensics", "gen-ui", "webhook-ui", "model-setup",
39
+ "modernize-pr", "expand-contract", "release-and-canary", "mutation-testing", "office-documents",
40
+ "pause-safely", "triage", "inner-loop", "tool-routing", "agent-collaboration", "visual-e2e",
41
+ "create-verification-skill", "maintain-verification-skill",
42
+ "create-formal-verification-skill", "maintain-formal-verification-skill",
43
+ })
44
+
45
+ SENSITIVE_RE = re.compile(
46
+ r"(?<![A-Za-z0-9_])(?:\.env\b|\.github/workflows\b)"
47
+ r"|\b(?:auth|oauth|jwt|session|token|tokens|secret|secrets|password|passwords|credential|credentials"
48
+ r"|rbac|acl|permission|permissions|migration|migrations|stripe|billing|payment|payments|webhook|webhooks"
49
+ r"|security|encrypt|decrypt|crypto|signature|ci\s+(?:workflow|pipeline|config|yaml|yml)"
50
+ r"|hooks?\.json|mcp_config|agents\.md|claude\.md|env\s+var|trust\s+boundary|sanitiz\w*|parser)\b",
51
+ re.I,
52
+ )
53
+
54
+ MINIMAL_OPT_OUT_TOKEN_RE = re.compile(
55
+ r"\b(?:minimal\s+(?:fix|patch|change|diff|mvp)|quick\s+(?:spike|hack|fix|typo)|throwaway\s+(?:prototype|spike)"
56
+ r"|just\s+a\s+typo|one[- ]line\s+(?:fix|tweak)|tiny\s+(?:fix|tweak)|no\s+hardcore|skip\s+hardcore)\b",
57
+ re.I,
58
+ )
59
+ NEGATION_CLAUSE_RE = re.compile(
60
+ r"\b(?:no|not|never|without|don'?t|do\s+not|avoid|instead\s+of|refuse|forbid)\b",
61
+ re.I,
62
+ )
63
+
64
+ HARDCORE_SYSTEM_RE = re.compile(
65
+ r"\b(?:hardcore\s+mode|volumetric|density\s+field|domain\s+warp|hydraulic\s+erosion|wave\s+function\s+collapse"
66
+ r"|wfc|dual\s+contouring|surface\s+nets|editablemesh|voxel\s+mesh|parallel\s+luau|actor\s+pool"
67
+ r"|custom\s+(?:engine|compiler|solver|renderer|scheduler|allocator|mesher)|distributed\s+consensus"
68
+ r"|zero[- ]copy|lock[- ]free|full\s+rewrite|from\s+scratch|real[- ]time\s+physics|procedural\s+generation"
69
+ r"|n\+1|query\s+plan|connection\s+pool|backpressure|transactional\s+outbox|singleflight|cursor\s+pagination"
70
+ r"|tail\s+latency|simd|arena\s+allocator|ring\s+buffer|flat\s+hash)\b",
71
+ re.I,
72
+ )
73
+
74
+ STRUGGLE_SIGNAL_RE = re.compile(
75
+ r"\b(?:i'?m\s+(?:struggling|stuck)|struggling\s+with|stuck\s+on|keeps?\s+(?:breaking|failing|crashing)"
76
+ r"|still\s+(?:broken|not\s+working|failing)|idk\s+why\b.*\b(?:work|broken|fail)|tried\s+\d+\s+times)\b",
77
+ re.I,
78
+ )
79
+
80
+ LEAN_QUOTA_RE = re.compile(
81
+ r"\b(?:lean\s+mode|quota[- ]safe|save\s+(?:weekly\s+)?(?:usage|quota|tokens)"
82
+ r"|low\s+token|without\s+(?:burning|killing)\s+(?:weekly\s+)?(?:quota|usage))\b",
83
+ re.I,
84
+ )
85
+
86
+ SPECIALIZED_SIGNALS = (
87
+ ("gen-ui", re.compile(r"\b(?:a2ui|gen[- ]ui|generative\s+ui)\b|\b(?:interactive|visual)\s+(?:cockpit|surface|ui)\b.{0,35}\b(?:human|talk|visualize|decisions?|prompts?)\b", re.I)),
88
+ ("video-forensics", re.compile(r"\b(?:rea[- ]video|videomd|video\.md)\b|\b(?:reverse[- ]engineer|break\s+down|remake|deconstruct)\b.{0,35}\bvideo\b|\bis\s+this\s+video\s+ai\b", re.I)),
89
+ ("runtime-forensics", re.compile(r"\b(?:memory\s+leak|leaking\s+ram|idle\s+cpu|cpu\s+(?:spike|stuck)\b|freez(?:e|es|ing)\b|hangs?\b|oom\b)|\bcpu\s+100%(?![A-Za-z0-9_])", re.I)),
90
+ ("trace-forensics", re.compile(r"(?<![A-Za-z0-9_])\.(?:cpuprofile|heapsnapshot)\b|\b(?:cpuprofile|heap\s+snapshot|chrome\s+trace|flamegraph)\b", re.I)),
91
+ ("perf-issue", re.compile(r"\b(?:\d+(?:\.\d+)?x\s+slower|got\s+slower|slowness|latency\s+(?:spike|regression)|p9[59]\b.{0,30}\b(?:ms|s|slow|high|jumped)|n\+1\b|(?:optimize|speed\s+up)\b.{0,45}\b(?:endpoint|route|query|queries|api|backend|server|throughput|latency|serialization|pool))\b", re.I)),
92
+ ("hillclimb", re.compile(r"\b(?:hillclimb|from\s+\d+\s*(?:ms|s|%)\s+(?:down\s+)?(?:to|below|under)\s+\d+|below\s+\d+\s*ms|step\s+by\s+step.*(?:latency|accuracy|throughput))", re.I)),
93
+ ("visual-parity", re.compile(r"\b(?:pixel[- ]exact|pixel\s+diff|visual\s+parity|pixel[- ]for[- ]pixel)\b", re.I)),
94
+ ("reference-rebuild", re.compile(r"\b(?:rebuild\b.*\b(?:match|like)\s+[A-Z][a-z]+|to\s+the\s+standard\s+of)\b")),
95
+ ("prototype", re.compile(r"\b(?:throwaway\s+(?:prototype|spike)|quick\s+spike|prototype\b.*\b(?:test\s+whether|beats?|compare))\b", re.I)),
96
+ ("session-pickup", re.compile(r"\b(?:pick\s+up\s+where\s+(?:the\s+)?(?:previous|last)\s+agent|take\s+over\b.*\bin[- ]flight)\b", re.I)),
97
+ ("pause-safely", re.compile(r"\b(?:pause\s+safely|checkpoint\s+and\s+pause|resume\s+tomorrow)\b", re.I)),
98
+ ("reframe", re.compile(r"(?:^\s*/?reframe\b|\b(?:expert\s+words\s+for\s+what\s+(?:i'?m|we'?re)\s+building|what\s+is\s+this\s+problem\s+called|teach\s+(?:me\s+)?the\s+expert\s+(?:words|terms|vocabulary))\b)", re.I)),
99
+ ("catchup-video", re.compile(r"\b(?:catchup[- ]video|catch[- ]up\s+video|subtitled\s+(?:catch[- ]?up\s+|recap\s+)?video|video\s+recap\s+of\s+what\s+happened)\b", re.I)),
100
+ ("webhook-ui", re.compile(r"\b(?:webhook[- ]ui|make[- ]bot[- ]ui)\b|\b(?:custom|tailscale|local)\s+(?:ui|page|dashboard|buttons?)\b.{0,45}\b(?:wake|trigger|post\s+to)\b.{0,30}\bwebhook\b", re.I)),
101
+ ("model-setup", re.compile(r"\b(?:model[- ]setup|per[- ]role\s+models?|configure\s+(?:my\s+|role\s+)?models?\s+(?:and\s+)?(?:reasoning\s+)?budget)\b", re.I)),
102
+ ("modernize-pr", re.compile(r"\b(?:modernize[- ]pr|modernize\s+this\s+pr|rebase\s+this\s+old\s+pr|revive\s+this\s+(?:old\s+)?(?:pr|branch)|is\s+this\s+pr\s+still\s+worth\s+landing)\b", re.I)),
103
+ ("expand-contract", re.compile(r"\b(?:expand[- /]contract|zero[- ]downtime\s+(?:migration|column|schema|rename|drop|cutover)|dual[- ]write.*backfill)\b", re.I)),
104
+ ("release-and-canary", re.compile(r"\b(?:canary\s+(?:check|monitor\w*|rollout)|monitor\s+after\s+deploy|post[- ]deploy\s+canary|document[- ]release|update\s+docs\s+after\s+ship)\b", re.I)),
105
+ ("devex-review", re.compile(r"\b(?:devex[- ]review|dx\s+(?:plan\s+)?review|developer\s+experience\s+review|check\s+developer\s+onboarding|cli\s+ergonomics\s+review)\b", re.I)),
106
+ ("product-lens", re.compile(r"\b(?:product[- ]lens|ceo\s+review|founder[- ]mode\s+review|10[- ]star\s+(?:product|experience)|painkiller\s+(?:vs|or)\s+vitamin)\b", re.I)),
107
+ ("variant-analysis", re.compile(r"\b(?:variant[- ]analysis|hunt\s+(?:for\s+)?(?:all\s+)?sibling\s+(?:bugs|vulnerabilities)|find\s+every\s+variant\s+of\s+this\s+(?:bug|vuln))\b", re.I)),
108
+ ("mutation-testing", re.compile(r"\b(?:mutation[- ]test(?:ing|s)?|kill\s+surviving\s+mutants|cargo[- ]mutants|mutmut|stryker)\b", re.I)),
109
+ ("statechart", re.compile(r"(?:^\s*/?statechart\b|\b(?:tla\+?\s+statechart|mermaid\s+statechart\b.*\bcounterexample|draw\b.*\btla\+?\s+model\s+as\s+a?\s*statechart)\b)", re.I)),
110
+ ("formal-verification", re.compile(r"\btla\+(?![A-Za-z0-9_])|\b(?:tlc|statechart|lean\s*4?|lean\s+proof|mathlib|coq|rocq|isabelle|smt2|z3|comparator|nanoda|bombadil|model[- ]check|property[- ]based\s+ui|(?:formalize|prove)\s+(?:this|the)\s+(?:theorem|lemma|conjecture|invariant))\b|(?<![A-Za-z0-9_])\.(?:lean|tla|smt2)\b", re.I)),
111
+ ("suggest", re.compile(r"\b(?:deepmode\s+suggest|suggest\s+(?:me\s+)?(?:some\s+)?(?:full[- ]scope\s+)?prompts?|what\s+prompts?\s+should\s+i\s+run|what\s+should\s+i\s+(?:fix|work\s+on)\s+next)\b", re.I)),
112
+ ("research", re.compile(r"(?:^\s*/?(?:deepmodebot:)?research\b|\b(?:adversarial\s+research|sota\s+(?:research|gap\s+matrix|gaps?)|research\b.{0,45}\b(?:gaps?\s+in|vs\s+our\s+repo|differential\s+gap)|sweep\s+(?:github\s+)?orgs?\b))", re.I)),
113
+ ("prompt-upgrade", re.compile(r"\b(?:make\s+my\s+prompt\s+better|(?:review|improve|upgrade|rewrite|fix)\s+(?:my|this)\s+prompt|convert\b.*\bdeepmode\s*prompt)\b", re.I)),
114
+ ("grill", re.compile(r"(?:^\s*grill(?:\s+(?:it|this|me))?\s*[?!.]*$|(?:\bare\s+you\s+sure\W+grill\b)|\bgrill\s+(?:me|this\s+plan|my\s+plan|our\s+plan|it)\b|\bpoke\s+holes\s+in\b)", re.I)),
115
+ ("self-grill", re.compile(r"\b(?:self[- ]grill|check\s+theater|mocking\s+stuff|tests\s+are\s+actually\s+catching|grill\s+(?:my|our|the|this)\s+(?:checks?|diff|tests?|code|work|implementation)|(?:find|look\s+for|hunt(?:\s+for)?|check\s+for)\s+(?:\d+\s+)?(?!(?:architecture|architectural|research)\s+gaps?\b)gaps?\b|(?<!suggest\s)overclaims?\b|what\s+(?:gaps?\s+)?did\s+(?:you|we)\s+miss|^are\s+you\s+sure\s*[?!.]*$)", re.I)),
116
+ ("no-comments", re.compile(r"\b(?:no[- ]comments|comment[- ]sicko|(?:strip|remove|delete|clean)\b.{0,30}\bcomments)\b", re.I)),
117
+ ("worktree-cleanup", re.compile(r"\b(?:clean\s+up|prune|delete|remove)\b.{0,25}\bworktrees?\b", re.I)),
118
+ )
119
+
120
+ REFERENCE_SKILL_SIGNALS = (
121
+ ("skill://frontend-ui", re.compile(r"\b(?:react|next\.?js|css|tailwind|shadcn|ui|ux|a2ui|vibe[- ]coded|ai\s+studio|sidebar|modal|animation|animations|remotion|hyperframes|figma|pixel|a11y|accessibility|dashboard|layout|chat\s+ui)\b", re.I)),
122
+ ("skill://secrets-and-auth", re.compile(r"(?<![A-Za-z0-9_])\.env\b|\b(?:auth|oauth|jwt|login|password|secret|secrets|credential|credentials|mfa|sso|api\s+key|rbac|session\s+token)\b", re.I)),
123
+ ("skill://software-architecture", re.compile(r"\b(?:postgres|sqlite|mysql|database|schema|migration|monorepo|queue|redis|kafka|microservice|api\s+design|data\s+model|domain\s+model|orm|prisma|drizzle|sqlalchemy|pgx|asyncpg|npgsql|foreign\s+key|n\+1|pagination|cursor|connection\s+pool|outbox|timeout|backpressure)\b", re.I)),
124
+ ("skill://cloud-devsecops", re.compile(r"\b(?:docker|kubernetes|k8s|terraform|iac|aws|gcp|azure|iam|s3|bucket|ci/cd|github\s+actions|container|helm)\b", re.I)),
125
+ ("skill://agent-harnesses", re.compile(r"\b(?:omp|claude\s+code|codex|antigravity|mcp|acp|a2a|ag[- ]ui|a2ui|webmcp|subagent|subagents|teamwork|weekly\s+usage|quota|hooks\.json|skill\.md)\b", re.I)),
126
+ ("skill://domain-rules", re.compile(r"\b(?:llm|rag|evals?|rate\s+limit|distributed|concurrency|race\s+condition|deadlock|caching|idempoten\w*|incident|legacy\s+code|backend|server|endpoint|fastapi|starlette|express|axum|tokio|goroutine|event\s+loop|n\+1|tail\s+latency|p9[59]|throughput|rps|serialization|orjson|gzip|cache\s+stampede|singleflight|simd|cache\s+line|arena|unordered_map)\b", re.I)),
127
+ ("skill://deep-stack", re.compile(r"\b(?:what\s+stack|tech\s+stack|pick\s+a\s+stack|choose\s+a\s+stack|greenfield\s+stack)\b", re.I)),
128
+ ("skill://seo-and-geo", re.compile(r"\b(?:seo|geo/aeo|json[- ]ld|schema\.org|sitemap\.xml|robots\.txt|llms\.txt|core\s+web\s+vitals|agentic\s+browsing|hreflang|opengraph)\b", re.I)),
129
+ ("skill://office-documents", re.compile(r"(?<![A-Za-z0-9_])\.(?:xlsx|pptx|docx|pdf)\b|\b(?:spreadsheet|excel\s+workbook|powerpoint|slide\s+deck|word\s+document|openpyxl|python[- ]pptx|python[- ]docx|fillable\s+pdf)\b", re.I)),
130
+ ("skill://deep-learning", re.compile(r"\b(?:reinforcement\s+learning|ppo|grpo|sac|world\s+model|gnn|equivariant|pinns?|neural\s+operator|weight[- ]space\s+programming|muon\s+optimizer)\b", re.I)),
131
+ ("skill://app-automation-relay", re.compile(r"\b(?:automation\s+relay|control\s+adapter\b.*\b(?:desktop|mobile|terminal|app)|observe\s*->\s*act\s*->\s*wait)\b", re.I)),
132
+ )
133
+
134
+ CONCRETE_ANCHOR_RE = re.compile(
135
+ r"(?:[A-Za-z0-9_./-]+\.[A-Za-z0-9]{1,6}\b|#\d+\b|https?://\S+|\bPR\s*#?\d+\b)",
136
+ re.I,
137
+ )
138
+
139
+ DEFAULT_PANEL_SEATS = [
140
+ "claude-haiku-5-5-high",
141
+ "gpt-6-luna",
142
+ "gemini-4-flash",
143
+ ]
144
+
145
+ STRIPPED_API_KEY_VARS = (
146
+ "ANTHROPIC_API_KEY",
147
+ "ANTHROPIC_AUTH_TOKEN",
148
+ "OPENAI_API_KEY",
149
+ "CODEX_API_KEY",
150
+ "GEMINI_API_KEY",
151
+ "GOOGLE_API_KEY",
152
+ )
153
+
154
+
155
+ def _load_sibling(name: str, rel_path: str):
156
+ path = ASSETS_DIR / rel_path
157
+ spec = importlib.util.spec_from_file_location(name, path)
158
+ mod = importlib.util.module_from_spec(spec)
159
+ sys.modules[spec.name] = mod
160
+ spec.loader.exec_module(mod)
161
+ return mod
162
+
163
+
164
+ def has_minimal_opt_out(text: str) -> bool:
165
+ for m in MINIMAL_OPT_OUT_TOKEN_RE.finditer(text):
166
+ tok = m.group(0).lower()
167
+ if tok in ("no hardcore", "skip hardcore"):
168
+ return True
169
+ clause_prefix = re.split(r"[.;!?]", text[: m.start()])[-1]
170
+ if NEGATION_CLAUSE_RE.search(clause_prefix):
171
+ continue
172
+ return True
173
+ return False
174
+
175
+
176
+ def _first_summary_line(md_path: Path) -> str:
177
+ try:
178
+ lines = md_path.read_text(encoding="utf-8", errors="replace").splitlines()
179
+ except OSError:
180
+ return ""
181
+ body_start = 0
182
+ if lines and lines[0].strip() == "---":
183
+ end_idx = None
184
+ for idx in range(1, min(len(lines), 30)):
185
+ if lines[idx].strip() == "---":
186
+ end_idx = idx
187
+ break
188
+ if end_idx is not None:
189
+ body_start = end_idx + 1
190
+ for idx in range(1, end_idx):
191
+ m = re.match(r'^description:\s*(.*)$', lines[idx])
192
+ if m:
193
+ val = m.group(1).strip().strip('"').strip("'")
194
+ if val in (">", "|", ">-", "|-", ""):
195
+ collected = []
196
+ for sub in lines[idx + 1 : end_idx]:
197
+ if sub.startswith((" ", "\t")) and sub.strip():
198
+ collected.append(sub.strip())
199
+ else:
200
+ break
201
+ if collected:
202
+ return " ".join(collected)[:140]
203
+ elif val:
204
+ return val[:140]
205
+ for line in lines[body_start : body_start + 15]:
206
+ s = line.strip()
207
+ if not s or s.startswith("#") or s == "---":
208
+ continue
209
+ return s[:140]
210
+ return ""
211
+
212
+
213
+ def discover_live_catalog(root: Path | None = None) -> dict:
214
+ playbooks: dict[str, dict] = {}
215
+ techniques: dict[str, dict] = {}
216
+ references: dict[str, dict] = {}
217
+ sibling_skills: dict[str, dict] = {}
218
+
219
+ pb_dir = SKILL_DIR / "references" / "playbooks"
220
+ if pb_dir.is_dir():
221
+ for md in sorted(pb_dir.glob("*.md")):
222
+ playbooks[md.stem] = {
223
+ "kind": "playbook",
224
+ "file": f"references/playbooks/{md.name}",
225
+ "dir": SKILL_DIR,
226
+ "summary": _first_summary_line(md),
227
+ }
228
+
229
+ tech_dir = SKILL_DIR / "references" / "techniques"
230
+ if tech_dir.is_dir():
231
+ for md in sorted(tech_dir.glob("*.md")):
232
+ techniques[md.stem] = {
233
+ "kind": "technique",
234
+ "file": f"references/techniques/{md.name}",
235
+ "dir": SKILL_DIR,
236
+ "summary": _first_summary_line(md),
237
+ }
238
+
239
+ if (SKILL_DIR / "references" / "flows.md").is_file():
240
+ references["flows"] = {
241
+ "kind": "reference",
242
+ "file": "references/flows.md",
243
+ "dir": SKILL_DIR,
244
+ "summary": _first_summary_line(SKILL_DIR / "references" / "flows.md"),
245
+ }
246
+
247
+ if PLUGINS_SKILLS_DIR.is_dir():
248
+ for smd in sorted(PLUGINS_SKILLS_DIR.glob("*/SKILL.md")):
249
+ name = smd.parent.name
250
+ if name == SKILL_DIR.name:
251
+ continue
252
+ sibling_skills[name] = {
253
+ "kind": "skill",
254
+ "file": f"skill://{name}",
255
+ "dir": smd.parent,
256
+ "summary": _first_summary_line(smd),
257
+ }
258
+
259
+ if root is not None and root.is_dir():
260
+ for base in (".omp/skills", ".claude/skills", ".agents/skills"):
261
+ sdir = root / base
262
+ if sdir.is_dir():
263
+ for smd in sorted(sdir.glob("*/SKILL.md")):
264
+ name = smd.parent.name
265
+ if name not in sibling_skills and name != SKILL_DIR.name:
266
+ sibling_skills[name] = {
267
+ "kind": "project-skill",
268
+ "file": f"skill://{name}",
269
+ "dir": smd.parent,
270
+ "summary": _first_summary_line(smd),
271
+ }
272
+
273
+ all_modes: dict[str, dict] = {}
274
+ all_modes.update(playbooks)
275
+ all_modes.update(techniques)
276
+ all_modes.update(references)
277
+ all_modes.update(sibling_skills)
278
+
279
+ return {
280
+ "playbooks": playbooks,
281
+ "techniques": techniques,
282
+ "references": references,
283
+ "sibling_skills": sibling_skills,
284
+ "all_modes": all_modes,
285
+ }
286
+
287
+
288
+ def gather_repo_facts(root: Path | None) -> dict:
289
+ if root is None:
290
+ return {"has_root": False}
291
+ self_grill = _load_sibling("ar_self_grill", "self-grill/self_grill.py")
292
+ safe_root = self_grill.reject_unsafe_root(root)
293
+ diff = self_grill.inspect_diff(safe_root)
294
+ verify_skills = []
295
+ for base in (".omp/skills", ".claude/skills", ".agents/skills"):
296
+ d = safe_root / base
297
+ if d.is_dir():
298
+ for child in sorted(d.glob("verify-*/SKILL.md")):
299
+ verify_skills.append(child.relative_to(safe_root).as_posix())
300
+ entries = [
301
+ p.name for p in safe_root.iterdir()
302
+ if p.name not in {".git", ".scratch", ".worktrees", ".DS_Store"}
303
+ ]
304
+ return {
305
+ "has_root": True,
306
+ "root": str(safe_root),
307
+ "empty_dir": len(entries) == 0,
308
+ "has_factory": (safe_root / "factory.json").is_file(),
309
+ "has_glossary_or_adrs": (safe_root / "GLOSSARY.md").is_file() or (safe_root / "docs" / "adr").is_dir(),
310
+ "verify_skills": verify_skills,
311
+ "diff_size": diff["measured_size"],
312
+ "diff_files": diff["file_count"],
313
+ "diff_sensitive_paths": diff["sensitive_paths"][:10],
314
+ "diff_added_comments": diff["added_comment_count"],
315
+ "diff_workaround_smells": diff["workaround_smell_count"],
316
+ }
317
+
318
+
319
+ def detect_expected_reference_skills(prompt: str, available_skills: dict[str, dict] | None = None) -> list[str]:
320
+ hits = []
321
+ for skill_uri, pat in REFERENCE_SKILL_SIGNALS:
322
+ sname = skill_uri.removeprefix("skill://")
323
+ if available_skills is not None and sname not in available_skills:
324
+ continue
325
+ if pat.search(prompt):
326
+ hits.append(skill_uri)
327
+ return hits
328
+
329
+
330
+ def detect_specialized_signals(prompt: str) -> list[str]:
331
+ hits = []
332
+ for mode, pat in SPECIALIZED_SIGNALS:
333
+ if pat.search(prompt):
334
+ hits.append(mode)
335
+ return hits
336
+
337
+
338
+ def build_menu_packet(prompt: str, root: Path | None = None) -> dict:
339
+ cleaned = " ".join(prompt.strip().split())
340
+ if not cleaned:
341
+ raise SystemExit("prompt cannot be empty")
342
+ repo_facts = gather_repo_facts(root)
343
+ safe_root = Path(repo_facts["root"]) if repo_facts.get("has_root") else None
344
+ catalog = discover_live_catalog(root=safe_root)
345
+ tournament = _load_sibling("ar_tournament", "tournament/tournament.py")
346
+ prior = tournament.classify_prompt(
347
+ cleaned,
348
+ has_factory=bool(repo_facts.get("has_factory")),
349
+ empty_dir=bool(repo_facts.get("empty_dir")),
350
+ )
351
+ ref_hints = detect_expected_reference_skills(cleaned, catalog["sibling_skills"])
352
+ spec_hints = detect_specialized_signals(cleaned)
353
+ prompt_tools = _load_sibling("ar_prompt_tools", "prompt-tools/prompt_tools.py")
354
+ clarification = prompt_tools.analyze_ambiguity(cleaned, root=safe_root)
355
+ compact_playbooks = [f"{k} (route_file: {v['file']}): {v['summary']}" for k, v in catalog["playbooks"].items()]
356
+ compact_techniques = [f"{k} (route_file: {v['file']}): {v['summary']}" for k, v in catalog["techniques"].items()]
357
+ compact_ref_skills = [f"{k} (route_file: {v['file']}): {v['summary']}" for k, v in catalog["sibling_skills"].items()]
358
+
359
+ minimal_opt_out = has_minimal_opt_out(cleaned)
360
+ hardcore_default = not minimal_opt_out
361
+ hardcore_system_hit = bool(HARDCORE_SYSTEM_RE.search(cleaned))
362
+
363
+ schema = {
364
+ "decoded_intent": "1-sentence semantic restatement of what the user actually wants",
365
+ "deliverables": ["1. concrete deliverable", "2. ..."],
366
+ "primary_mode": "exact mode name from Playbooks, Techniques, or Sibling Skills",
367
+ "route_file": "exact route_file from the catalog",
368
+ "secondary_techniques": ["optional companion technique names, e.g. self-grill, no-comments, security-audit"],
369
+ "reference_skills": ["optional skill://<name> URIs from Reference & Sibling Skills"],
370
+ "size": "S | M | L | none",
371
+ "self_grill": "none | plan | checks | both",
372
+ "hardcore_mode": hardcore_default,
373
+ "hardcore_ceiling": "1-sentence first-principles maximal-craft engineering target (never a watered-down MVP)",
374
+ "confidence": 0.9,
375
+ "runner_up": "closest alternative mode name",
376
+ "why_not_runner_up": "concrete reason primary_mode beats runner_up",
377
+ "needs_prompt_upgrade": False,
378
+ "hard_stops": [],
379
+ }
380
+
381
+ llm_router_prompt = (
382
+ "You are deepmodebot's LLM semantic auto-router in HARDCORE MODE by default. "
383
+ "Read what the user literally typed — including typos, shorthand, compound asks, frustration/struggle, "
384
+ "skepticism ('are you sure', 'grill', 'what did you miss', 'find gaps/overclaims'), media/video breakdown "
385
+ "requests ('rea-video', 'VIDEO.md', 'how was this video made', 'remake this video'), or multi-system builds — "
386
+ "and choose the best primary_mode, companion techniques, reference_skills, size, and self_grill mode purely from "
387
+ "semantic understanding against the live catalog below (never naive keyword matching).\n"
388
+ "Routing guidance:\n"
389
+ "- Hardcore Mode is ON by default: aim straight for the first-principles architectural ceiling and promote any "
390
+ "'(Optional hardcore mode)' tier into a mandatory deliverable unless the user explicitly asked for a minimal fix or throwaway prototype.\n"
391
+ "- Read-only/discovery/audit modes (investigation, runtime-forensics, trace-forensics, pr-review, grill, self-grill, "
392
+ "tournament, suggest, formal-verification, etc.) MUST use size='none'.\n"
393
+ "- If the user doubts prior work ('are you sure', 'what did you miss', 'find gaps/overclaims'), route to 'self-grill' "
394
+ "(Confession + Adaptive Hotspot Prosecutor + Sieve). If stress-testing a plan/idea ('grill it', 'grill this plan'), route to 'grill'.\n"
395
+ "- If the user is stuck or struggling ('keeps breaking', 'stuck', 'doesn't work'), route to 'bug-fix' (or 'runtime-forensics') "
396
+ "at size M/L with secondary_techniques including 'self-grill' and 'why'.\n"
397
+ "- If breaking down or remaking a video, route to 'video-forensics' (plus skill://frontend-ui when remaking motion graphics).\n"
398
+ "- If building Google A2UI (v1.0) declarative agent surfaces or generating an interactive visual UI/cockpit to talk to the human, route to 'gen-ui' (plus skill://frontend-ui).\n"
399
+ "- If optimizing backend/API/DB latency, throughput, N+1 queries, connection pools, serialization, or memory layout, route to 'perf-issue' (or 'hillclimb' for iterative metric targets) and attach skill://domain-rules + skill://software-architecture.\n"
400
+ "Output ONLY valid JSON matching the schema (no markdown prose outside JSON).\n\n"
401
+ f"User prompt:\n{cleaned}\n\n"
402
+ f"Live repo facts:\n{json.dumps(repo_facts, indent=2)}\n\n"
403
+ f"Playbooks ({len(compact_playbooks)}):\n- " + "\n- ".join(compact_playbooks) + "\n\n"
404
+ f"Techniques ({len(compact_techniques)}):\n- " + "\n- ".join(compact_techniques) + "\n\n"
405
+ f"Reference & Sibling Skills ({len(compact_ref_skills)}):\n- " + "\n- ".join(compact_ref_skills) + "\n\n"
406
+ f"Required JSON schema:\n{json.dumps(schema, indent=2)}"
407
+ )
408
+
409
+ return {
410
+ "prompt": cleaned,
411
+ "routing_engine": "llm-semantic",
412
+ "repo_facts": repo_facts,
413
+ "advisory_only": True,
414
+ "hardcore_mode": hardcore_default,
415
+ "pre_flight_clarification": clarification,
416
+ "advisory_prior": {
417
+ "deprecated_offline_only": True,
418
+ "mode": prior["mode"],
419
+ "size": prior["size"],
420
+ "self_grill": prior["self_grill"],
421
+ "hardcore_mode": hardcore_default,
422
+ "hardcore_system_signal": hardcore_system_hit,
423
+ "specialized_hints": spec_hints,
424
+ "reference_skill_hints": ref_hints,
425
+ },
426
+ "catalog_counts": {
427
+ "playbooks": len(catalog["playbooks"]),
428
+ "techniques": len(catalog["techniques"]),
429
+ "sibling_skills": len(catalog["sibling_skills"]),
430
+ },
431
+ "decision_schema": schema,
432
+ "llm_router_prompt": llm_router_prompt,
433
+ }
434
+
435
+
436
+ def _validate_route_file(route_file: str, expected_file: str, primary: str, all_modes: dict, sibling_skills: dict) -> str | None:
437
+ if route_file == expected_file:
438
+ return None
439
+ if route_file.startswith("skill://"):
440
+ rest = route_file.removeprefix("skill://")
441
+ parts = [p for p in rest.split("/") if p]
442
+ if not parts:
443
+ return f"invalid skill URI {route_file!r}"
444
+ sname = parts[0]
445
+ if sname != primary:
446
+ return f"route_file {route_file!r} does not match primary_mode {primary!r} (expected {expected_file!r})"
447
+ base_dir = SKILL_DIR if sname == SKILL_DIR.name else (sibling_skills.get(sname) or {}).get("dir")
448
+ if base_dir is None:
449
+ return f"route_file {route_file!r} names non-existent skill {sname!r}"
450
+ if len(parts) > 1:
451
+ sub_target = (base_dir / "/".join(parts[1:])).resolve()
452
+ try:
453
+ sub_target.relative_to(base_dir.resolve())
454
+ except ValueError:
455
+ return f"route_file {route_file!r} escapes skill root"
456
+ if not sub_target.is_file():
457
+ return f"route_file {route_file!r} does not exist on disk"
458
+ return None
459
+ return f"route_file {route_file!r} does not match primary_mode {primary!r} (expected {expected_file!r})"
460
+
461
+
462
+ def verify_decision(
463
+ decision: dict,
464
+ prompt: str = "",
465
+ root: Path | None = None,
466
+ critic_round: int = 1,
467
+ enforce_regex_hints: bool = True,
468
+ ) -> dict:
469
+ repo_facts = gather_repo_facts(root)
470
+ safe_root = Path(repo_facts["root"]) if repo_facts.get("has_root") else None
471
+ catalog = discover_live_catalog(root=safe_root)
472
+ all_modes = catalog["all_modes"]
473
+ techniques = catalog["techniques"]
474
+ sibling_skills = catalog["sibling_skills"]
475
+
476
+ violations: list[str] = []
477
+ warnings: list[str] = []
478
+ auto_repairs: dict = {}
479
+
480
+ raw_primary = str(decision.get("primary_mode", "")).strip()
481
+ primary = raw_primary.removeprefix("skill://") if raw_primary.startswith("skill://") else raw_primary
482
+ if primary not in all_modes:
483
+ violations.append(f"unknown primary_mode {raw_primary!r}: must match a live playbook, technique, or sibling skill")
484
+
485
+ expected_file = all_modes[primary]["file"] if primary in all_modes else ""
486
+ route_file = str(decision.get("route_file", "")).strip()
487
+ if primary in all_modes:
488
+ if not route_file:
489
+ route_file = expected_file
490
+ auto_repairs["route_file"] = expected_file
491
+ else:
492
+ rf_err = _validate_route_file(route_file, expected_file, primary, all_modes, sibling_skills)
493
+ if rf_err:
494
+ violations.append(rf_err)
495
+
496
+ raw_sec = decision.get("secondary_techniques")
497
+ if raw_sec is not None and not isinstance(raw_sec, list):
498
+ violations.append("secondary_techniques must be a JSON list of technique names")
499
+ sec_list: list[str] = []
500
+ else:
501
+ sec_list = [str(x).strip() for x in (raw_sec or []) if str(x).strip()]
502
+ for tech in sec_list:
503
+ if tech not in techniques:
504
+ violations.append(f"unknown secondary_technique {tech!r}: not found in references/techniques/")
505
+
506
+ raw_refs = decision.get("reference_skills")
507
+ if raw_refs is not None and not isinstance(raw_refs, list):
508
+ violations.append("reference_skills must be a JSON list of skill:// URIs")
509
+ ref_list: list[str] = []
510
+ else:
511
+ ref_list = []
512
+ for ref in (raw_refs or []):
513
+ ref_str = str(ref).strip()
514
+ if not ref_str:
515
+ continue
516
+ rest = ref_str.removeprefix("skill://")
517
+ parts = [p for p in rest.split("/") if p]
518
+ if not parts:
519
+ violations.append(f"invalid reference_skill {ref_str!r}")
520
+ continue
521
+ sname = parts[0]
522
+ if sname not in sibling_skills:
523
+ violations.append(f"unknown reference_skill {ref_str!r}: skill {sname!r} not found in plugin or repo")
524
+ continue
525
+ base_dir = sibling_skills[sname]["dir"]
526
+ if len(parts) > 1:
527
+ if ".." in parts:
528
+ violations.append(f"reference_skill {ref_str!r} escapes skill root")
529
+ continue
530
+ sub_target = (base_dir / "/".join(parts[1:])).resolve()
531
+ try:
532
+ sub_target.relative_to(base_dir.resolve())
533
+ except ValueError:
534
+ violations.append(f"reference_skill {ref_str!r} escapes skill root")
535
+ continue
536
+ if not sub_target.is_file():
537
+ violations.append(f"reference_skill {ref_str!r} does not exist on disk")
538
+ continue
539
+ norm_ref = f"skill://{sname}/{'/'.join(parts[1:])}"
540
+ else:
541
+ norm_ref = f"skill://{sname}"
542
+ if norm_ref not in ref_list:
543
+ ref_list.append(norm_ref)
544
+ size = str(decision.get("size", "")).strip()
545
+ if size not in ("S", "M", "L", "none"):
546
+ violations.append(f"invalid size {size!r}: must be S, M, L, or none")
547
+
548
+ self_grill_mode = str(decision.get("self_grill", "")).strip()
549
+ if self_grill_mode not in ("none", "plan", "checks", "both"):
550
+ violations.append(f"invalid self_grill {self_grill_mode!r}: must be none, plan, checks, or both")
551
+
552
+ try:
553
+ confidence = float(decision.get("confidence", 0.0))
554
+ except (TypeError, ValueError):
555
+ confidence = 0.0
556
+ violations.append("confidence must be a number between 0.0 and 1.0")
557
+ if not (0.0 <= confidence <= 1.0):
558
+ violations.append(f"confidence {confidence} out of range [0.0, 1.0]")
559
+
560
+ deliverables = decision.get("deliverables") or []
561
+ if not isinstance(deliverables, list) or not deliverables:
562
+ violations.append("deliverables must be a non-empty list covering full request scope")
563
+
564
+ decoded_intent = str(decision.get("decoded_intent", "")).strip()
565
+ if not decoded_intent:
566
+ violations.append("decoded_intent cannot be empty")
567
+
568
+ sensitive_prompt = bool(SENSITIVE_RE.search(prompt)) if prompt else False
569
+ sensitive_diff = bool(repo_facts.get("diff_sensitive_paths"))
570
+ is_sensitive = sensitive_prompt or sensitive_diff
571
+ minimal_opt_out = has_minimal_opt_out(prompt) if prompt else False
572
+ hardcore_system = bool(HARDCORE_SYSTEM_RE.search(prompt)) if prompt else False
573
+ raw_hardcore = decision.get("hardcore_mode", True)
574
+ if not isinstance(raw_hardcore, bool):
575
+ violations.append(f"hardcore_mode must be boolean, got {raw_hardcore!r}")
576
+ hardcore_mode = True
577
+ else:
578
+ hardcore_mode = raw_hardcore
579
+ hardcore_ceiling = str(decision.get("hardcore_ceiling", "")).strip()
580
+
581
+ is_flexible = primary in FLEXIBLE_SIZE_MODES
582
+ is_read_only = (primary in READ_ONLY_MODES) and not is_flexible
583
+ if is_read_only and size != "none":
584
+ violations.append(f"read-only/discovery mode {primary!r} must have size 'none', got {size!r}")
585
+ if primary and not is_read_only and not is_flexible and size == "none":
586
+ violations.append(f"execution mode {primary!r} cannot have size 'none'")
587
+ if is_sensitive and size == "S":
588
+ violations.append("sensitive domain or diff (auth/secrets/migrations/payments/CI/agent-config) cannot be sized S; use M or L")
589
+ if is_sensitive and not is_read_only and size != "none" and self_grill_mode not in ("checks", "both"):
590
+ violations.append("sensitive execution work requires post-edit diff verification; set self_grill to 'both' or 'checks'")
591
+ if primary and not is_read_only and size != "none" and not hardcore_mode and not minimal_opt_out and primary != "prototype":
592
+ violations.append("Hardcore Mode is ON by default; do not set hardcore_mode=false without an explicit minimal/prototype opt-out in the user prompt")
593
+ if primary and not is_read_only and size == "S" and not minimal_opt_out and (hardcore_system or len(deliverables) >= 2):
594
+ violations.append("ambitious hardcore or multi-deliverable task cannot be under-sized to S; use M or L")
595
+
596
+ why_not = str(decision.get("why_not_runner_up", "")).strip()
597
+ if primary == "tournament" and prompt and CONCRETE_ANCHOR_RE.search(prompt) and len(why_not) < 15:
598
+ violations.append("routing to 'tournament' despite concrete file/PR/anchor requires a concrete why_not_runner_up justification")
599
+
600
+ claimed_critic = bool(decision.get("critic_reviewed", False))
601
+ if claimed_critic and critic_round < 2:
602
+ violations.append("critic_reviewed=true is only valid on --critic-round 2 after a Round-1 CRITIC_REQUIRED pass")
603
+ critic_verified = claimed_critic and critic_round >= 2
604
+
605
+ critic_reasons: list[str] = []
606
+ if confidence < 0.80 and not critic_verified:
607
+ critic_reasons.append(f"confidence {confidence:.2f} < 0.80")
608
+
609
+ spec_hints = detect_specialized_signals(prompt) if (prompt and enforce_regex_hints) else []
610
+ if spec_hints and primary not in spec_hints and not critic_verified:
611
+ critic_reasons.append(
612
+ f"prompt contains specialized signal(s) {spec_hints} but router picked {primary!r}"
613
+ )
614
+
615
+ present_skill_roots = {r.split("/")[2] if r.startswith("skill://") else r.split("/")[0] for r in ref_list}
616
+ expected_refs = detect_expected_reference_skills(prompt, sibling_skills) if prompt else []
617
+ missing_refs = [r for r in expected_refs if r.removeprefix("skill://") not in present_skill_roots]
618
+ if missing_refs:
619
+ warnings.append(f"recommended reference_skills omitted: {missing_refs}")
620
+ auto_repairs["add_reference_skills"] = missing_refs
621
+ struggle_hit = bool(STRUGGLE_SIGNAL_RE.search(prompt)) if prompt else False
622
+ if struggle_hit and size == "S":
623
+ violations.append("user is stuck/struggling; do not under-size to S — use M/L with self_grill and attack-the-premise")
624
+
625
+ if (size in ("M", "L") and not is_read_only) or struggle_hit:
626
+ missing_sec = [t for t in ("self-grill", "no-comments") if t not in sec_list and primary != t] if not is_read_only else (["self-grill"] if "self-grill" not in sec_list and primary != "self-grill" else [])
627
+ if struggle_hit and "why" not in sec_list and primary != "why":
628
+ missing_sec.append("why")
629
+ if is_sensitive and "security-audit" not in sec_list and primary != "security-audit":
630
+ missing_sec.append("security-audit")
631
+ if hardcore_mode and (size == "L" or hardcore_system) and len(deliverables) >= 2 and "architect" not in sec_list and primary != "architect":
632
+ missing_sec.append("architect")
633
+ if missing_sec:
634
+ warnings.append(f"recommended secondary_techniques omitted for {size} work: {missing_sec}")
635
+ auto_repairs["add_secondary_techniques"] = missing_sec
636
+
637
+ if violations:
638
+ status = "REJECTED"
639
+ elif critic_reasons:
640
+ status = "CRITIC_REQUIRED"
641
+ else:
642
+ status = "APPROVED"
643
+
644
+ critic_prompt = ""
645
+ if status != "APPROVED":
646
+ next_round = min(2, max(2, critic_round))
647
+ critic_prompt = (
648
+ f"You are the Adversarial Route Critic (round {next_round} of 2). Attack the proposed route decision below. "
649
+ "Check: (1) based on what the user literally typed, does a more specific playbook or technique fit better than primary_mode? "
650
+ "(2) did deliverables drop any clause from the user prompt? "
651
+ "(3) are size, self_grill, secondary_techniques, and reference_skills accurate and safe? "
652
+ "Output ONLY the corrected full JSON decision with \"critic_reviewed\": true.\n\n"
653
+ f"Original prompt: {prompt}\n"
654
+ f"Proposed decision: {json.dumps(decision, indent=2)}\n"
655
+ f"Gate violations: {violations}\n"
656
+ f"Critic triggers: {critic_reasons}\n"
657
+ f"Auto-repair hints: {json.dumps(auto_repairs)}"
658
+ )
659
+
660
+ if size == "S":
661
+ model_tier, effort = "S", "low"
662
+ elif primary in ("investigation", "recall", "flows", "worktree-cleanup"):
663
+ model_tier, effort = "S", "medium"
664
+ elif size == "L" or primary in ("tournament", "architecture-review", "security-audit", "interrogate", "arena", "formal-verification"):
665
+ model_tier, effort = "L", "xhigh"
666
+ elif is_sensitive or is_read_only:
667
+ model_tier, effort = "L", "high"
668
+ else:
669
+ model_tier, effort = "M", "medium"
670
+
671
+ final_refs = sorted(set(ref_list) | set(auto_repairs.get("add_reference_skills", [])))
672
+ final_sec = sorted(set(sec_list) | set(auto_repairs.get("add_secondary_techniques", [])))
673
+ qg = _load_sibling("ar_quota_guard", "quota-guard/quota_guard.py")
674
+ outer_harness = qg.detect_outer_harness(root=safe_root)
675
+ lean_quota = bool(decision.get("lean_mode")) or (bool(LEAN_QUOTA_RE.search(prompt)) if prompt else False)
676
+ is_merge_gate = primary in ("shipping", "opening-a-pr", "pr-conversation", "work-a-queue")
677
+ quota_budget = qg.compute_quota_plan(
678
+ size=size if size in ("S", "M", "L", "none") else "M",
679
+ mode=primary,
680
+ diff_lines=int(repo_facts.get("diff_lines", 0) or 0),
681
+ is_sensitive=is_sensitive,
682
+ outer_harness=outer_harness,
683
+ lean_mode=lean_quota,
684
+ is_merge_gate=is_merge_gate,
685
+ )
686
+ if quota_budget["nested_anti_stacking"] or lean_quota:
687
+ panel_seats = []
688
+ else:
689
+ panel_seats = list(DEFAULT_PANEL_SEATS) if (size == "L" or primary in ("tournament", "arena", "interrogate", "security-audit", "shipping")) else []
690
+
691
+ return {
692
+ "status": status,
693
+ "critic_round": critic_round,
694
+ "violations": violations,
695
+ "critic_reasons": critic_reasons,
696
+ "warnings": warnings,
697
+ "auto_repairs": auto_repairs,
698
+ "critic_prompt": critic_prompt,
699
+ "locked_plan": {
700
+ "primary_mode": primary,
701
+ "route_file": route_file,
702
+ "secondary_techniques": final_sec,
703
+ "reference_skills": final_refs,
704
+ "size": size,
705
+ "self_grill": self_grill_mode,
706
+ "hardcore_mode": hardcore_mode,
707
+ "hardcore_ceiling": hardcore_ceiling,
708
+ "model_tier": model_tier,
709
+ "effort": effort,
710
+ "panel_seats": panel_seats,
711
+ "quota_budget": quota_budget,
712
+ "deliverables": deliverables,
713
+ } if status == "APPROVED" else None,
714
+ }
715
+
716
+
717
+ def _extract_json_object(raw_text: str) -> dict:
718
+ text = raw_text.strip()
719
+ if not text:
720
+ raise ValueError("empty LLM response")
721
+ try:
722
+ outer = json.loads(text)
723
+ if isinstance(outer, dict):
724
+ if "primary_mode" in outer:
725
+ return outer
726
+ for key in ("result", "response", "text", "output", "content", "message"):
727
+ val = outer.get(key)
728
+ if isinstance(val, dict) and "primary_mode" in val:
729
+ return val
730
+ if isinstance(val, str) and "{" in val:
731
+ text = val.strip()
732
+ break
733
+ except ValueError:
734
+ pass
735
+
736
+ fenced = re.search(r"```(?:json)?\s*(\{.*?\})\s*```", text, re.S)
737
+ if fenced:
738
+ try:
739
+ parsed_fenced = json.loads(fenced.group(1))
740
+ if isinstance(parsed_fenced, dict):
741
+ return parsed_fenced
742
+ except ValueError:
743
+ pass
744
+ decoder = json.JSONDecoder()
745
+ best_dict: dict | None = None
746
+ best_span = -1
747
+ idx = text.find("{")
748
+ while idx >= 0:
749
+ try:
750
+ obj, end_idx = decoder.raw_decode(text, idx)
751
+ if isinstance(obj, dict):
752
+ if "primary_mode" in obj:
753
+ return obj
754
+ if (end_idx - idx) > best_span:
755
+ best_dict = obj
756
+ best_span = end_idx - idx
757
+ except ValueError:
758
+ pass
759
+ idx = text.find("{", idx + 1)
760
+ if best_dict is not None:
761
+ return best_dict
762
+ raise ValueError(f"could not locate JSON object in LLM output: {text[:200]!r}")
763
+
764
+
765
+ def _prefer_native_exe_on_windows(name: str, found: str) -> str:
766
+ if os.name != "nt" or not found.lower().endswith((".cmd", ".bat")):
767
+ return found
768
+ if name == "agy":
769
+ local_agy = Path(os.environ.get("LOCALAPPDATA", "")) / "agy" / "bin" / "agy.exe"
770
+ if local_agy.is_file():
771
+ return str(local_agy)
772
+ sibling_exe = Path(found).with_suffix(".exe")
773
+ if sibling_exe.is_file():
774
+ return str(sibling_exe)
775
+ return found
776
+
777
+
778
+ def _resolve_subscription_harness(harness: str) -> tuple[str, list[str]]:
779
+ choice = harness.lower().strip()
780
+ if choice == "omp":
781
+ raise SystemExit("refusing 'omp' harness for LLM routing: omp model token spend is forbidden; use agy, claude, or codex")
782
+ candidates = ("agy", "claude", "codex") if choice == "auto" else (choice,)
783
+ for name in candidates:
784
+ exe = shutil.which(name)
785
+ if not exe:
786
+ continue
787
+ exe = _prefer_native_exe_on_windows(name, exe)
788
+ if name == "agy":
789
+ return "agy", [exe, "-p"]
790
+ if name == "claude":
791
+ return "claude", [exe, "-p", "--tools", "", "--output-format", "json"]
792
+ if name == "codex":
793
+ return "codex", [exe, "exec", "-s", "read-only", "--skip-git-repo-check"]
794
+ raise SystemExit(f"no subscription LLM CLI found for harness={harness!r} (checked: {', '.join(candidates)})")
795
+
796
+
797
+ def invoke_subscription_llm(prompt_text: str, harness: str = "auto", cwd: Path | None = None, timeout_sec: int = 90) -> str:
798
+ resolved_name, base_cmd = _resolve_subscription_harness(harness)
799
+ env = {k: v for k, v in os.environ.items() if k not in STRIPPED_API_KEY_VARS}
800
+ cmd = [*base_cmd, prompt_text]
801
+ res = subprocess.run(
802
+ cmd,
803
+ cwd=str(cwd) if cwd else None,
804
+ env=env,
805
+ capture_output=True,
806
+ text=True,
807
+ encoding="utf-8",
808
+ errors="replace",
809
+ timeout=timeout_sec,
810
+ check=False,
811
+ creationflags=NO_WINDOW,
812
+ )
813
+ if res.returncode != 0:
814
+ raise RuntimeError(f"{resolved_name} exited {res.returncode}: {(res.stderr or res.stdout).strip()[:300]}")
815
+ return res.stdout
816
+
817
+
818
+ def route_with_llm(
819
+ prompt: str,
820
+ root: Path | None = None,
821
+ harness: str = "auto",
822
+ llm_runner: Callable[[str, int], str | dict] | None = None,
823
+ ) -> dict:
824
+ packet = build_menu_packet(prompt, root=root)
825
+ safe_root = Path(packet["repo_facts"]["root"]) if packet["repo_facts"].get("has_root") else None
826
+ runner = llm_runner or (lambda p, _r: invoke_subscription_llm(p, harness=harness, cwd=safe_root))
827
+
828
+ raw_r1 = runner(packet["llm_router_prompt"], 1)
829
+ dec_r1 = raw_r1 if isinstance(raw_r1, dict) else _extract_json_object(str(raw_r1))
830
+ ver_r1 = verify_decision(dec_r1, prompt=packet["prompt"], root=safe_root, critic_round=1)
831
+ rounds = [{"round": 1, "decision": dec_r1, "verification": ver_r1}]
832
+
833
+ if ver_r1["status"] == "APPROVED":
834
+ return {
835
+ "status": "APPROVED",
836
+ "routing_engine": "llm-semantic",
837
+ "rounds_used": 1,
838
+ "locked_plan": ver_r1["locked_plan"],
839
+ "rounds": rounds,
840
+ }
841
+
842
+ raw_r2 = runner(ver_r1["critic_prompt"], 2)
843
+ dec_r2 = raw_r2 if isinstance(raw_r2, dict) else _extract_json_object(str(raw_r2))
844
+ dec_r2["critic_reviewed"] = True
845
+ ver_r2 = verify_decision(dec_r2, prompt=packet["prompt"], root=safe_root, critic_round=2)
846
+ rounds.append({"round": 2, "decision": dec_r2, "verification": ver_r2})
847
+
848
+ return {
849
+ "status": ver_r2["status"],
850
+ "routing_engine": "llm-semantic",
851
+ "rounds_used": 2,
852
+ "locked_plan": ver_r2["locked_plan"],
853
+ "violations": ver_r2["violations"],
854
+ "rounds": rounds,
855
+ }
856
+
857
+
858
+ def evaluate_reroute(root: Path, current_mode: str, current_size: str, failed_attempts: int = 0, competing_shapes: int = 1) -> dict:
859
+ repo_facts = gather_repo_facts(root)
860
+ triggers: list[str] = []
861
+ new_size = current_size
862
+ add_techniques: list[str] = []
863
+ add_principles: list[str] = []
864
+ recommended_mode = current_mode
865
+
866
+ size_rank = {"none": 0, "S": 1, "M": 2, "L": 3}
867
+ diff_size = repo_facts.get("diff_size", "none")
868
+ if size_rank.get(diff_size, 0) > size_rank.get(current_size, 0):
869
+ triggers.append(f"diff grew from {current_size} to {diff_size} ({repo_facts['diff_files']} files)")
870
+ new_size = diff_size
871
+
872
+ if repo_facts.get("diff_sensitive_paths"):
873
+ triggers.append(f"diff touched sensitive path(s): {repo_facts['diff_sensitive_paths'][:3]}")
874
+ if new_size in ("none", "S"):
875
+ new_size = "M"
876
+ add_techniques.extend(["security-audit", "self-grill"])
877
+
878
+ if failed_attempts >= 2:
879
+ triggers.append(f"{failed_attempts} failed attempts sharing a premise -> pause and apply attack-the-premise")
880
+ add_techniques.append("self-grill")
881
+ add_principles.append("attack-the-premise")
882
+ if current_mode in ("bug-fix", "feature"):
883
+ recommended_mode = "investigation"
884
+
885
+ if competing_shapes >= 2:
886
+ triggers.append(f"{competing_shapes} competing design shapes -> sketch with architect or arena")
887
+ add_techniques.append("architect" if competing_shapes == 2 else "arena")
888
+
889
+ if repo_facts.get("diff_added_comments", 0) > 0:
890
+ triggers.append(f"diff added {repo_facts['diff_added_comments']} code comment(s) -> run no-comments")
891
+ add_techniques.append("no-comments")
892
+ if repo_facts.get("diff_workaround_smells", 0) > 0:
893
+ triggers.append(f"diff added {repo_facts['diff_workaround_smells']} workaround smell(s) -> run self-grill")
894
+ add_techniques.append("self-grill")
895
+
896
+ return {
897
+ "reroute_needed": bool(triggers),
898
+ "current_mode": current_mode,
899
+ "recommended_mode": recommended_mode,
900
+ "current_size": current_size,
901
+ "recommended_size": new_size,
902
+ "add_techniques": sorted(set(add_techniques)),
903
+ "add_principles": sorted(set(add_principles)),
904
+ "triggers": triggers,
905
+ "repo_facts": repo_facts,
906
+ }
907
+
908
+
909
+ def cmd_route(args: argparse.Namespace) -> int:
910
+ raw = sys.stdin.read() if args.stdin else (args.prompt or "")
911
+ root = Path(args.root) if args.root else None
912
+ res = route_with_llm(raw, root=root, harness=args.harness)
913
+ if args.json:
914
+ print(json.dumps(res, indent=2))
915
+ else:
916
+ plan = res.get("locked_plan") or {}
917
+ print(
918
+ f"autoroute ({res['routing_engine']}, rounds={res['rounds_used']}): {res['status']} "
919
+ f"mode={plan.get('primary_mode')} file={plan.get('route_file')} size={plan.get('size')}"
920
+ )
921
+ return 0 if res["status"] == "APPROVED" else 2
922
+
923
+
924
+ def cmd_menu(args: argparse.Namespace) -> int:
925
+ raw = sys.stdin.read() if args.stdin else (args.prompt or "")
926
+ root = Path(args.root) if args.root else None
927
+ packet = build_menu_packet(raw, root=root)
928
+ if args.json:
929
+ print(json.dumps(packet, indent=2))
930
+ else:
931
+ print(packet["llm_router_prompt"])
932
+ return 0
933
+
934
+
935
+ def cmd_verify(args: argparse.Namespace) -> int:
936
+ if args.strict and not (args.prompt or "").strip():
937
+ raise SystemExit("verify --strict requires a non-empty --prompt")
938
+ raw_dec = sys.stdin.read() if args.decision_stdin else Path(args.decision_file).read_text(encoding="utf-8")
939
+ try:
940
+ decision = json.loads(raw_dec)
941
+ except ValueError as err:
942
+ raise SystemExit(f"invalid decision JSON: {err}") from err
943
+ root = Path(args.root) if args.root else None
944
+ res = verify_decision(decision, prompt=args.prompt or "", root=root, critic_round=args.critic_round)
945
+ if args.json:
946
+ print(json.dumps(res, indent=2))
947
+ else:
948
+ print(f"autoroute: {res['status']} violations={len(res['violations'])} critic_reasons={len(res['critic_reasons'])}")
949
+ if args.strict and res["status"] != "APPROVED":
950
+ return 2
951
+ return 0
952
+
953
+
954
+ def cmd_reroute(args: argparse.Namespace) -> int:
955
+ res = evaluate_reroute(
956
+ Path(args.root),
957
+ current_mode=args.current_mode,
958
+ current_size=args.current_size,
959
+ failed_attempts=args.failed_attempts,
960
+ competing_shapes=args.competing_shapes,
961
+ )
962
+ if args.json:
963
+ print(json.dumps(res, indent=2))
964
+ else:
965
+ print(
966
+ f"reroute_needed={res['reroute_needed']} mode={res['current_mode']}->{res['recommended_mode']} "
967
+ f"size={res['current_size']}->{res['recommended_size']} add={res['add_techniques']}"
968
+ )
969
+ return 0
970
+
971
+
972
+ def build_parser() -> argparse.ArgumentParser:
973
+ parser = argparse.ArgumentParser(description="Pure LLM semantic auto-routing loop with checks and balances.")
974
+ sub = parser.add_subparsers(dest="cmd", required=True)
975
+
976
+ p_rt = sub.add_parser("route", help="Semantically route a user prompt using the subscription LLM + 2-round verifier.")
977
+ p_rt.add_argument("--stdin", action="store_true")
978
+ p_rt.add_argument("--prompt", default="")
979
+ p_rt.add_argument("--root", default=None)
980
+ p_rt.add_argument("--harness", choices=("auto", "agy", "claude", "codex"), default="auto")
981
+ p_rt.add_argument("--json", action="store_true")
982
+ p_rt.set_defaults(func=cmd_route)
983
+
984
+ p_menu = sub.add_parser("menu", help="Build live disk catalog menu and repo facts packet for the LLM router.")
985
+ p_menu.add_argument("--stdin", action="store_true")
986
+ p_menu.add_argument("--prompt", default="")
987
+ p_menu.add_argument("--root", default=None)
988
+ p_menu.add_argument("--json", action="store_true")
989
+ p_menu.set_defaults(func=cmd_menu)
990
+
991
+ p_ver = sub.add_parser("verify", help="Verify an LLM route decision against checks and balances.")
992
+ p_ver.add_argument("--root", default=None)
993
+ p_ver.add_argument("--prompt", default="")
994
+ dec_group = p_ver.add_mutually_exclusive_group(required=True)
995
+ dec_group.add_argument("--decision-stdin", action="store_true")
996
+ dec_group.add_argument("--decision-file", default=None)
997
+ p_ver.add_argument("--critic-round", type=int, choices=(1, 2), default=1)
998
+ p_ver.add_argument("--strict", action="store_true")
999
+ p_ver.add_argument("--json", action="store_true")
1000
+ p_ver.set_defaults(func=cmd_verify)
1001
+
1002
+ p_re = sub.add_parser("reroute", help="Evaluate mid-flight re-route triggers from live repo state.")
1003
+ p_re.add_argument("--root", required=True)
1004
+ p_re.add_argument("--current-mode", required=True)
1005
+ p_re.add_argument("--current-size", choices=("S", "M", "L", "none"), required=True)
1006
+ p_re.add_argument("--failed-attempts", type=int, default=0)
1007
+ p_re.add_argument("--competing-shapes", type=int, default=1)
1008
+ p_re.add_argument("--json", action="store_true")
1009
+ p_re.set_defaults(func=cmd_reroute)
1010
+
1011
+ return parser
1012
+
1013
+
1014
+ def main(argv: list[str] | None = None) -> int:
1015
+ parser = build_parser()
1016
+ args = parser.parse_args(argv)
1017
+ return args.func(args)
1018
+
1019
+
1020
+ if __name__ == "__main__":
1021
+ raise SystemExit(main())