deepmodebot 0.9.0 → 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 (691) 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 +187 -10
  6. package/lib/clients.mjs +50 -3
  7. package/lib/tree.mjs +64 -10
  8. package/lib/version.mjs +26 -0
  9. package/native/dmb-gate/Cargo.toml +13 -0
  10. package/native/dmb-gate/src/agents.rs +77 -0
  11. package/native/dmb-gate/src/ci.rs +516 -0
  12. package/native/dmb-gate/src/cleanup.rs +198 -0
  13. package/native/dmb-gate/src/gap.rs +1376 -0
  14. package/native/dmb-gate/src/guard.rs +135 -0
  15. package/native/dmb-gate/src/main.rs +327 -0
  16. package/native/dmb-gate/src/map.rs +173 -0
  17. package/native/dmb-gate/src/perf.rs +347 -0
  18. package/native/dmb-gate/src/reward.rs +1214 -0
  19. package/native/dmb-gate/src/skill_check.rs +171 -0
  20. package/native/dmb-gate/src/slop.rs +1238 -0
  21. package/native/dmb-gate/src/ui.rs +842 -0
  22. package/native/dmb-gate/src/util.rs +260 -0
  23. package/native/dmb-net/go.mod +3 -0
  24. package/native/dmb-net/main.go +624 -0
  25. package/native/dmb-net/main_test.go +122 -0
  26. package/package.json +12 -2
  27. package/plugins/deepmodebot/.antigravity-plugin/plugin.json +1 -1
  28. package/plugins/deepmodebot/.antigravity-plugin/skills/deep/SKILL.md +5 -5
  29. package/plugins/deepmodebot/.antigravity-plugin/skills/pr-thread/SKILL.md +1 -1
  30. package/plugins/deepmodebot/.antigravity-plugin/skills/review-pr/SKILL.md +2 -2
  31. package/plugins/deepmodebot/.antigravity-plugin/skills/suggest/SKILL.md +13 -0
  32. package/plugins/deepmodebot/.antigravity-plugin/skills/tournament/SKILL.md +2 -2
  33. package/plugins/deepmodebot/.claude-plugin/plugin.json +1 -1
  34. package/plugins/deepmodebot/.codex-plugin/plugin.json +46 -0
  35. package/plugins/deepmodebot/agents/comment-sicko/agent.md +35 -0
  36. package/plugins/deepmodebot/agents/researcher/agent.md +33 -0
  37. package/plugins/deepmodebot/agents/reviewer/agent.md +4 -2
  38. package/plugins/deepmodebot/agents/scout/agent.md +11 -12
  39. package/plugins/deepmodebot/agents/security-reviewer/agent.md +2 -1
  40. package/plugins/deepmodebot/commands/deep.md +6 -6
  41. package/plugins/deepmodebot/commands/research.md +8 -0
  42. package/plugins/deepmodebot/commands/suggest.md +10 -0
  43. package/plugins/deepmodebot/commands/tournament.md +2 -2
  44. package/plugins/deepmodebot/hooks/hooks.json +2 -2
  45. package/plugins/deepmodebot/hooks.json +1 -1
  46. package/plugins/deepmodebot/scripts/antigravity-guard.mjs +140 -7
  47. package/plugins/deepmodebot/scripts/omp-mcp-server.mjs +179 -47
  48. package/plugins/deepmodebot/skills/agent-harnesses/SKILL.md +4 -6
  49. package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/check_antigravity.py +3 -0
  50. package/plugins/deepmodebot/skills/agent-harnesses/references/ai-native-tooling.md +4 -0
  51. package/plugins/deepmodebot/skills/agent-harnesses/references/ai-sdk-selection.md +3 -1
  52. package/plugins/deepmodebot/skills/agent-harnesses/references/antigravity.md +2 -2
  53. package/plugins/deepmodebot/skills/agent-harnesses/references/delegation-efficiency.md +12 -2
  54. package/plugins/deepmodebot/skills/agent-harnesses/references/protocols.md +11 -3
  55. package/plugins/deepmodebot/skills/app-automation-relay/SKILL.md +17 -0
  56. package/plugins/deepmodebot/skills/app-automation-relay/assets/relay_server.ts +364 -0
  57. package/plugins/deepmodebot/skills/app-automation-relay/references/adapter-cookbook.md +15 -0
  58. package/plugins/deepmodebot/skills/app-automation-relay/references/wire-protocol.md +23 -0
  59. package/plugins/deepmodebot/skills/cloud-devsecops/SKILL.md +4 -3
  60. package/plugins/deepmodebot/skills/cloud-devsecops/references/cloudflare-edge.md +43 -0
  61. package/plugins/deepmodebot/skills/cloud-devsecops/references/local-emulators.md +15 -2
  62. package/plugins/deepmodebot/skills/contribute/SKILL.md +3 -35
  63. package/plugins/deepmodebot/skills/create-formal-verification-skill/LICENSE +21 -0
  64. package/plugins/deepmodebot/skills/create-formal-verification-skill/NOTICE.md +16 -0
  65. package/plugins/deepmodebot/skills/create-formal-verification-skill/SKILL.md +71 -0
  66. package/plugins/deepmodebot/skills/create-verification-skill/SKILL.md +2 -2
  67. package/plugins/deepmodebot/skills/deep-learning/LICENSE +21 -0
  68. package/plugins/deepmodebot/skills/deep-learning/SKILL.md +33 -0
  69. package/plugins/deepmodebot/skills/deep-learning/references/neural-architectures.md +43 -0
  70. package/plugins/deepmodebot/skills/deep-learning/references/papers-and-repos.md +128 -0
  71. package/plugins/deepmodebot/skills/deep-learning/references/reinforcement-learning.md +57 -0
  72. package/plugins/deepmodebot/skills/deep-learning/references/training-optimization.md +40 -0
  73. package/plugins/deepmodebot/skills/deep-learning/references/weight-space-programming.md +76 -0
  74. package/plugins/deepmodebot/skills/deep-learning/scripts/hf_passes.py +166 -0
  75. package/plugins/deepmodebot/skills/deep-learning/scripts/wsp.py +493 -0
  76. package/plugins/deepmodebot/skills/deep-stack/SKILL.md +1 -1
  77. package/plugins/deepmodebot/skills/deep-stack/references/design-workflow.md +46 -92
  78. package/plugins/deepmodebot/skills/deep-stack/references/isolate.md +1 -0
  79. package/plugins/deepmodebot/skills/deep-stack/references/prove.md +6 -0
  80. package/plugins/deepmodebot/skills/deep-stack/references/stack.md +11 -1
  81. package/plugins/deepmodebot/skills/deepmodebot/SKILL.md +74 -145
  82. package/plugins/deepmodebot/skills/deepmodebot/assets/agents-md/agents_md.py +18 -6
  83. package/plugins/deepmodebot/skills/deepmodebot/assets/autoroute/autoroute.py +1021 -0
  84. package/plugins/deepmodebot/skills/deepmodebot/assets/cleanup/self_cleanup.py +305 -0
  85. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/claude_guard.py +98 -5
  86. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/omp-contain.ts +106 -5
  87. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/design.py +3 -0
  88. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/record.py +2 -0
  89. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/rehearsal_gate.py +536 -0
  90. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/review.py +2 -0
  91. package/plugins/deepmodebot/skills/deepmodebot/assets/formal-verification/verify_proof.py +638 -0
  92. package/plugins/deepmodebot/skills/deepmodebot/assets/gap-audit/gap_audit.py +1053 -0
  93. package/plugins/deepmodebot/skills/deepmodebot/assets/gen-ui/gen_ui.py +1782 -0
  94. package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard-patterns.txt +7 -0
  95. package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard.sh +3 -2
  96. package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard.ts +9 -5
  97. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/ghapp.py +2 -0
  98. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/install.py +2 -0
  99. package/plugins/deepmodebot/skills/deepmodebot/assets/local-ci/local_ci.py +540 -0
  100. package/plugins/deepmodebot/skills/deepmodebot/assets/local-ci/slop_gate.py +642 -0
  101. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/loop.py +2 -1
  102. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/plan.py +2 -1
  103. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/windows_job.py +2 -0
  104. package/plugins/deepmodebot/skills/deepmodebot/assets/memory/project_memory.py +529 -0
  105. package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/bench_harness.py +48 -21
  106. package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/perf_audit.py +339 -5
  107. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/diff_coverage.py +96 -6
  108. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/pr_agent_local.py +2 -0
  109. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/arena.py +2 -0
  110. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/show_thread.py +2 -0
  111. package/plugins/deepmodebot/skills/deepmodebot/assets/prompt-tools/prompt_tools.py +1239 -0
  112. package/plugins/deepmodebot/skills/deepmodebot/assets/quota-guard/quota_guard.py +424 -0
  113. package/plugins/deepmodebot/skills/deepmodebot/assets/repo-references.json +477 -1
  114. package/plugins/deepmodebot/skills/deepmodebot/assets/reward-guard/reward_guard.py +1597 -0
  115. package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rule-paths.json +57 -0
  116. package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rule_ledger.py +1645 -0
  117. package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_enrich.py +2 -0
  118. package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_meta.py +2 -0
  119. package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_transcript_relay.js +13 -10
  120. package/plugins/deepmodebot/skills/deepmodebot/assets/security-audit/static_sec_audit.py +275 -0
  121. package/plugins/deepmodebot/skills/deepmodebot/assets/self-grill/self_grill.py +1473 -0
  122. package/plugins/deepmodebot/skills/deepmodebot/assets/setup/model_setup.py +329 -0
  123. package/plugins/deepmodebot/skills/deepmodebot/assets/setup/project_setup.py +312 -0
  124. package/plugins/deepmodebot/skills/deepmodebot/assets/tournament/tournament.py +304 -18
  125. package/plugins/deepmodebot/skills/deepmodebot/assets/workspace-map/workspace_map.py +121 -78
  126. package/plugins/deepmodebot/skills/deepmodebot/references/README.md +14 -0
  127. package/plugins/deepmodebot/skills/deepmodebot/references/catalog.md +16 -11
  128. package/plugins/deepmodebot/skills/deepmodebot/references/contain.md +2 -1
  129. package/plugins/deepmodebot/skills/deepmodebot/references/delegation.md +14 -0
  130. package/plugins/deepmodebot/skills/deepmodebot/references/flows.md +2 -0
  131. package/plugins/deepmodebot/skills/deepmodebot/references/full-scope.md +9 -0
  132. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/babysit.md +2 -0
  133. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/end-to-end.md +12 -9
  134. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/feature.md +7 -3
  135. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/hillclimb.md +2 -0
  136. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/investigation.md +4 -4
  137. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/opening-a-pr.md +1 -1
  138. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/perf-issue.md +13 -10
  139. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/refactoring.md +6 -6
  140. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/reference-rebuild.md +1 -0
  141. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/run-a-goal.md +3 -1
  142. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/setup.md +1 -2
  143. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/visual-parity.md +1 -0
  144. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/work-a-queue.md +4 -2
  145. package/plugins/deepmodebot/skills/deepmodebot/references/principles/hardcore-mode.md +7 -0
  146. package/plugins/deepmodebot/skills/deepmodebot/references/principles/no-reward-hacking.md +8 -0
  147. package/plugins/deepmodebot/skills/deepmodebot/references/principles/test-behavior-not-implementation.md +2 -1
  148. package/plugins/deepmodebot/skills/deepmodebot/references/principles/type-system-discipline.md +2 -2
  149. package/plugins/deepmodebot/skills/deepmodebot/references/rule-approval.md +51 -0
  150. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/architect.md +10 -24
  151. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/architecture-review.md +5 -4
  152. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/arena.md +3 -3
  153. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/autoroute.md +49 -0
  154. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/blast-radius.md +1 -1
  155. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/catchup-video.md +13 -0
  156. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/correct.md +8 -7
  157. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/course.md +2 -1
  158. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/devex-review.md +13 -0
  159. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/expand-contract.md +13 -0
  160. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/formal-verification.md +33 -0
  161. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/gen-ui.md +60 -0
  162. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/grill.md +2 -1
  163. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/how.md +7 -18
  164. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/inner-loop.md +7 -7
  165. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/model-setup.md +14 -0
  166. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/modernize-pr.md +15 -0
  167. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/mutation-testing.md +13 -0
  168. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/no-comments.md +5 -5
  169. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/panel.md +7 -3
  170. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pr-conversation.md +1 -1
  171. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pr-review.md +8 -5
  172. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pre-commit.md +1 -2
  173. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/prior-art.md +33 -38
  174. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/product-lens.md +12 -0
  175. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/prompt-upgrade.md +30 -0
  176. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/recall.md +1 -1
  177. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/reframe.md +18 -0
  178. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/release-and-canary.md +10 -0
  179. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/research.md +62 -89
  180. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/security-audit.md +5 -1
  181. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/self-grill.md +54 -0
  182. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/sharpen.md +3 -3
  183. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/show-me-your-work.md +7 -0
  184. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/sme-review.md +3 -2
  185. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/suggest.md +24 -0
  186. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/swarm.md +7 -0
  187. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/teach.md +2 -2
  188. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/tournament.md +12 -11
  189. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/variant-analysis.md +11 -0
  190. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/video-forensics.md +46 -0
  191. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/visual-e2e.md +10 -1
  192. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/webhook-ui.md +11 -0
  193. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/writing-for-agents.md +6 -0
  194. package/plugins/deepmodebot/skills/deepmodebot/scripts/check_skill.py +7 -0
  195. package/plugins/deepmodebot/skills/deepmodebot/scripts/trending.py +141 -18
  196. package/plugins/deepmodebot/skills/deepmodebot/worker.md +16 -0
  197. package/plugins/deepmodebot/skills/domain-rules/SKILL.md +13 -119
  198. package/plugins/deepmodebot/skills/domain-rules/references/backend-system-design.md +19 -1
  199. package/plugins/deepmodebot/skills/domain-rules/references/engineering-practice.md +7 -0
  200. package/plugins/deepmodebot/skills/domain-rules/references/language-ecosystems.md +11 -0
  201. package/plugins/deepmodebot/skills/domain-rules/references/sources.md +108 -0
  202. package/plugins/deepmodebot/skills/frontend-ui/SKILL.md +30 -131
  203. package/plugins/deepmodebot/skills/frontend-ui/assets/themes/canvas.css +42 -0
  204. package/plugins/deepmodebot/skills/frontend-ui/assets/themes/editorial.css +39 -0
  205. package/plugins/deepmodebot/skills/frontend-ui/assets/themes/layouts.css +95 -0
  206. package/plugins/deepmodebot/skills/frontend-ui/assets/themes/swiss.css +40 -0
  207. package/plugins/deepmodebot/skills/frontend-ui/assets/themes/tactile.css +41 -0
  208. package/plugins/deepmodebot/skills/frontend-ui/assets/themes/workbench.css +50 -0
  209. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/mobbin-animations.md +49 -0
  210. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/mobbin-shipped-apps.md +46 -24
  211. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/motion-clips.md +27 -258
  212. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/motion-graphics.md +26 -51
  213. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/pinterest-animations.md +22 -195
  214. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/00-art-direction.md +39 -0
  215. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/01-workflow.md +27 -24
  216. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/02-review-rubric.md +23 -17
  217. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/03-ai-tells.md +22 -45
  218. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/04-components.md +11 -0
  219. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/04a-agent-ui.md +32 -152
  220. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/05-motion.md +36 -91
  221. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/05a-motion-graphics.md +14 -120
  222. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06-typography-layout.md +11 -10
  223. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06a-color.md +9 -9
  224. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06b-media-icons-charts.md +19 -0
  225. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06c-product-shots-craft.md +42 -0
  226. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/07-copy.md +5 -6
  227. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/08-quality-floor.md +28 -56
  228. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/09-steering-agents.md +9 -7
  229. package/plugins/deepmodebot/skills/frontend-ui/scripts/motion_diff.py +259 -0
  230. package/plugins/deepmodebot/skills/frontend-ui/scripts/ui_audit.py +496 -0
  231. package/plugins/deepmodebot/skills/maintain-formal-verification-skill/LICENSE +21 -0
  232. package/plugins/deepmodebot/skills/maintain-formal-verification-skill/NOTICE.md +16 -0
  233. package/plugins/deepmodebot/skills/maintain-formal-verification-skill/SKILL.md +68 -0
  234. package/plugins/deepmodebot/skills/maintain-verification-skill/SKILL.md +1 -1
  235. package/plugins/deepmodebot/skills/office-documents/SKILL.md +24 -0
  236. package/plugins/deepmodebot/skills/office-documents/references/documents-docx-pdf.md +15 -0
  237. package/plugins/deepmodebot/skills/office-documents/references/presentations-pptx.md +15 -0
  238. package/plugins/deepmodebot/skills/office-documents/references/spreadsheets-xlsx.md +15 -0
  239. package/plugins/deepmodebot/skills/office-documents/scripts/doc_audit.py +230 -0
  240. package/plugins/deepmodebot/skills/project-brief/SKILL.md +2 -19
  241. package/plugins/deepmodebot/skills/project-brief/assets/pr-overlap.py +4 -0
  242. package/plugins/deepmodebot/skills/project-brief/assets/sync-roadmap.py +4 -0
  243. package/plugins/deepmodebot/skills/project-brief/references/claim-contract.md +55 -0
  244. package/plugins/deepmodebot/skills/research/SKILL.md +18 -0
  245. package/plugins/deepmodebot/skills/secrets-and-auth/SKILL.md +1 -1
  246. package/plugins/deepmodebot/skills/seo-and-geo/SKILL.md +29 -0
  247. package/plugins/deepmodebot/skills/seo-and-geo/references/geo-and-agentic-web.md +30 -0
  248. package/plugins/deepmodebot/skills/seo-and-geo/references/technical-and-schema.md +25 -0
  249. package/plugins/deepmodebot/skills/seo-and-geo/scripts/seo_audit.py +282 -0
  250. package/plugins/deepmodebot/skills/software-architecture/SKILL.md +2 -2
  251. package/plugins/deepmodebot/skills/software-architecture/references/backend-infrastructure.md +5 -0
  252. package/plugins/deepmodebot/skills/software-architecture/references/monorepos.md +1 -0
  253. package/plugins/deepmodebot/skills/statechart/LICENSE +21 -0
  254. package/plugins/deepmodebot/skills/statechart/NOTICE.md +21 -0
  255. package/plugins/deepmodebot/skills/statechart/SKILL.md +106 -0
  256. package/plugins/deepmodebot/skills/statechart/references/render.md +93 -0
  257. package/plugins/deepmodebot/skills/statechart/references/tooling.md +78 -0
  258. package/plugins/deepmodebot/skills/statechart/scripts/backends/cfg.ts +33 -0
  259. package/plugins/deepmodebot/skills/statechart/scripts/backends/mermaid.ts +249 -0
  260. package/plugins/deepmodebot/skills/statechart/scripts/backends/plain-text.ts +72 -0
  261. package/plugins/deepmodebot/skills/statechart/scripts/backends/report.ts +177 -0
  262. package/plugins/deepmodebot/skills/statechart/scripts/frontends/config.ts +276 -0
  263. package/plugins/deepmodebot/skills/statechart/scripts/frontends/dot.ts +77 -0
  264. package/plugins/deepmodebot/skills/statechart/scripts/frontends/marks.ts +93 -0
  265. package/plugins/deepmodebot/skills/statechart/scripts/frontends/messages.ts +52 -0
  266. package/plugins/deepmodebot/skills/statechart/scripts/frontends/spec.ts +114 -0
  267. package/plugins/deepmodebot/skills/statechart/scripts/frontends/trace.ts +24 -0
  268. package/plugins/deepmodebot/skills/statechart/scripts/frontends/value.ts +166 -0
  269. package/plugins/deepmodebot/skills/statechart/scripts/frontends/verdict.ts +40 -0
  270. package/plugins/deepmodebot/skills/statechart/scripts/frontends/view.ts +119 -0
  271. package/plugins/deepmodebot/skills/statechart/scripts/ir.ts +547 -0
  272. package/plugins/deepmodebot/skills/statechart/scripts/janitor.ts +13 -0
  273. package/plugins/deepmodebot/skills/statechart/scripts/kill.ts +15 -0
  274. package/plugins/deepmodebot/skills/statechart/scripts/package.json +11 -0
  275. package/plugins/deepmodebot/skills/statechart/scripts/passes/annotate.ts +128 -0
  276. package/plugins/deepmodebot/skills/statechart/scripts/passes/label.ts +269 -0
  277. package/plugins/deepmodebot/skills/statechart/scripts/passes/lift.ts +85 -0
  278. package/plugins/deepmodebot/skills/statechart/scripts/passes/loop-check.ts +68 -0
  279. package/plugins/deepmodebot/skills/statechart/scripts/passes/paths.ts +60 -0
  280. package/plugins/deepmodebot/skills/statechart/scripts/passes/reach.ts +135 -0
  281. package/plugins/deepmodebot/skills/statechart/scripts/passes/region-check.ts +97 -0
  282. package/plugins/deepmodebot/skills/statechart/scripts/passes/regions.ts +295 -0
  283. package/plugins/deepmodebot/skills/statechart/scripts/pipeline.ts +76 -0
  284. package/plugins/deepmodebot/skills/statechart/scripts/run.ts +500 -0
  285. package/plugins/deepmodebot/skills/statechart/scripts/statechart +29 -0
  286. package/plugins/deepmodebot/skills/statechart/scripts/statechart.ts +165 -0
  287. package/plugins/deepmodebot/skills/statechart/scripts/test/ConfigOracle.java +63 -0
  288. package/plugins/deepmodebot/skills/statechart/scripts/test/chart.test.ts +1253 -0
  289. package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Braces.mmd +7 -0
  290. package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Escapes.mmd +11 -0
  291. package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Phases.mmd +29 -0
  292. package/plugins/deepmodebot/skills/statechart/scripts/test/cli.test.ts +1344 -0
  293. package/plugins/deepmodebot/skills/statechart/scripts/test/config-fuzz.test.ts +263 -0
  294. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/ChartRun.out +57 -0
  295. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/Counter.cfg +3 -0
  296. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/Counter.tla +10 -0
  297. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/chart.mmd +9 -0
  298. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/graph.dot +16 -0
  299. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/report.md +7 -0
  300. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/sany.out +2 -0
  301. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/verdict-1.out +49 -0
  302. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/ChartRun.out +60 -0
  303. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.cfg +4 -0
  304. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.tla +22 -0
  305. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/chart.mmd +26 -0
  306. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/graph.dot +19 -0
  307. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/report.md +20 -0
  308. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/sany.out +2 -0
  309. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.exit +1 -0
  310. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.out +56 -0
  311. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.exit +1 -0
  312. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.out +82 -0
  313. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-3.out +57 -0
  314. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/ChartRun.out +59 -0
  315. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.cfg +3 -0
  316. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.tla +11 -0
  317. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/chart.mmd +22 -0
  318. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/graph.dot +16 -0
  319. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/report.md +17 -0
  320. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/sany.out +2 -0
  321. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.exit +1 -0
  322. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.out +56 -0
  323. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.exit +1 -0
  324. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.out +77 -0
  325. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/ChartRun.out +69 -0
  326. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.cfg +2 -0
  327. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.tla +11 -0
  328. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/chart.mmd +85 -0
  329. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/graph.dot +70 -0
  330. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/report.md +12 -0
  331. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/sany.out +2 -0
  332. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.exit +1 -0
  333. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.out +67 -0
  334. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-2.out +57 -0
  335. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.exit +1 -0
  336. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.out +85 -0
  337. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.cfg +6 -0
  338. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.tla +13 -0
  339. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/chart.mmd +5 -0
  340. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/graph.dot +10 -0
  341. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/report.md +31 -0
  342. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/sany.out +2 -0
  343. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.exit +1 -0
  344. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.out +64 -0
  345. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.exit +1 -0
  346. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.out +77 -0
  347. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/ChartRun.out +55 -0
  348. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.cfg +3 -0
  349. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.tla +10 -0
  350. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/chart.mmd +12 -0
  351. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/graph.dot +6 -0
  352. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/report.md +12 -0
  353. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/sany.out +2 -0
  354. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.exit +1 -0
  355. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.out +33 -0
  356. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-2.out +54 -0
  357. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/ChartRun.out +54 -0
  358. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.cfg +3 -0
  359. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.tla +10 -0
  360. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/chart.mmd +1 -0
  361. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/graph.dot +6 -0
  362. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/report.md +7 -0
  363. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/sany.out +2 -0
  364. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/verdict-1.out +46 -0
  365. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/ChartRun.out +59 -0
  366. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.cfg +2 -0
  367. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.tla +10 -0
  368. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterSteps.tla +6 -0
  369. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/chart.mmd +17 -0
  370. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/graph.dot +15 -0
  371. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/report.md +14 -0
  372. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/sany.out +3 -0
  373. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.exit +1 -0
  374. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.out +78 -0
  375. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/ChartRun.out +59 -0
  376. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.cfg +3 -0
  377. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.tla +19 -0
  378. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/chart.mmd +26 -0
  379. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/graph.dot +22 -0
  380. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/report.md +12 -0
  381. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/sany.out +2 -0
  382. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.exit +1 -0
  383. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.out +58 -0
  384. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-2.out +57 -0
  385. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/ChartRun.out +57 -0
  386. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.cfg +2 -0
  387. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.tla +11 -0
  388. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/chart.mmd +17 -0
  389. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/graph.dot +15 -0
  390. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/report.md +14 -0
  391. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/sany.out +2 -0
  392. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.exit +1 -0
  393. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.out +76 -0
  394. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/ChartRun.out +59 -0
  395. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.cfg +3 -0
  396. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.tla +11 -0
  397. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/chart.mmd +19 -0
  398. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/graph.dot +10 -0
  399. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/report.md +15 -0
  400. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/sany.out +2 -0
  401. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.exit +1 -0
  402. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.out +56 -0
  403. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.exit +1 -0
  404. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.out +67 -0
  405. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/ChartRun.out +62 -0
  406. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.cfg +6 -0
  407. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.tla +24 -0
  408. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/Moves.tla +5 -0
  409. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/chart.mmd +22 -0
  410. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/graph.dot +10 -0
  411. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/report.md +23 -0
  412. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/sany.out +3 -0
  413. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.exit +1 -0
  414. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.out +58 -0
  415. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.exit +1 -0
  416. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.out +66 -0
  417. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.exit +1 -0
  418. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.out +74 -0
  419. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-4.out +59 -0
  420. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/ChartRun.out +58 -0
  421. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.cfg +3 -0
  422. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.tla +15 -0
  423. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/chart.mmd +18 -0
  424. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/graph.dot +13 -0
  425. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/report.md +11 -0
  426. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/sany.out +2 -0
  427. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.exit +1 -0
  428. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.out +33 -0
  429. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-2.out +57 -0
  430. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/ChartRun.out +57 -0
  431. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.cfg +3 -0
  432. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.tla +15 -0
  433. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/chart.mmd +7 -0
  434. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/graph.dot +13 -0
  435. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/report.md +6 -0
  436. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/sany.out +2 -0
  437. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/verdict-1.out +49 -0
  438. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/ChartRun.out +61 -0
  439. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.cfg +4 -0
  440. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.tla +14 -0
  441. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/chart.mmd +30 -0
  442. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/graph.dot +19 -0
  443. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/report.md +27 -0
  444. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/sany.out +2 -0
  445. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.exit +1 -0
  446. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.out +56 -0
  447. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.exit +1 -0
  448. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.out +64 -0
  449. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.exit +1 -0
  450. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.out +87 -0
  451. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-4.out +57 -0
  452. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/ChartRun.out +60 -0
  453. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.cfg +3 -0
  454. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.tla +12 -0
  455. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/chart.mmd +23 -0
  456. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/graph.dot +19 -0
  457. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/report.md +11 -0
  458. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/sany.out +2 -0
  459. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.exit +1 -0
  460. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.out +56 -0
  461. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-2.out +57 -0
  462. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/ChartRun.out +61 -0
  463. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/CounterView.cfg +4 -0
  464. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/CounterView.tla +14 -0
  465. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/chart.mmd +23 -0
  466. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/graph.dot +19 -0
  467. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/report.md +27 -0
  468. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/sany.out +2 -0
  469. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-1.exit +1 -0
  470. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-1.out +56 -0
  471. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-2.exit +1 -0
  472. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-2.out +64 -0
  473. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-3.exit +1 -0
  474. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-3.out +87 -0
  475. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-4.out +57 -0
  476. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/view.mjs +1 -0
  477. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/ChartRun.out +59 -0
  478. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/DieHard.cfg +4 -0
  479. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/DieHard.tla +38 -0
  480. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/chart.mmd +92 -0
  481. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/graph.dot +126 -0
  482. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/report.md +17 -0
  483. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/sany.out +2 -0
  484. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-1.exit +1 -0
  485. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-1.out +91 -0
  486. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-2.out +57 -0
  487. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/ChartRun.out +61 -0
  488. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.cfg +6 -0
  489. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.tla +11 -0
  490. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/chart.mmd +22 -0
  491. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/graph.dot +16 -0
  492. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/report.md +25 -0
  493. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/sany.out +2 -0
  494. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.exit +1 -0
  495. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.out +56 -0
  496. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.exit +1 -0
  497. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.out +64 -0
  498. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.exit +1 -0
  499. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.out +64 -0
  500. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.exit +1 -0
  501. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.out +77 -0
  502. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/ChartRun.out +57 -0
  503. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.cfg +4 -0
  504. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.tla +11 -0
  505. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/chart.mmd +13 -0
  506. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/graph.dot +12 -0
  507. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/report.md +11 -0
  508. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/sany.out +2 -0
  509. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.exit +1 -0
  510. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.out +72 -0
  511. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/ChartRun.out +57 -0
  512. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/Login.cfg +3 -0
  513. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/Login.tla +62 -0
  514. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/chart.mmd +28 -0
  515. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/graph.dot +40 -0
  516. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/report.md +7 -0
  517. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/sany.out +1 -0
  518. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/verdict-1.out +47 -0
  519. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/view.mjs +1 -0
  520. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/ChartRun.out +57 -0
  521. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.cfg +2 -0
  522. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.tla +64 -0
  523. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/chart.mmd +28 -0
  524. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/graph.dot +37 -0
  525. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/report.md +8 -0
  526. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/sany.out +1 -0
  527. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/verdict-1.out +47 -0
  528. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/view.mjs +1 -0
  529. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/ChartRun.out +60 -0
  530. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.cfg +3 -0
  531. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.tla +64 -0
  532. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/chart.mmd +44 -0
  533. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/graph.dot +58 -0
  534. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/report.md +17 -0
  535. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/sany.out +1 -0
  536. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.exit +1 -0
  537. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.out +83 -0
  538. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-2.out +57 -0
  539. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/view.mjs +1 -0
  540. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/ChartRun.out +60 -0
  541. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.cfg +3 -0
  542. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.tla +103 -0
  543. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/chart.mmd +43 -0
  544. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/graph.dot +93 -0
  545. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/report.md +14 -0
  546. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/sany.out +1 -0
  547. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.exit +1 -0
  548. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.out +59 -0
  549. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-2.out +72 -0
  550. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/view.mjs +3 -0
  551. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/ChartRun.out +57 -0
  552. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.cfg +2 -0
  553. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.tla +100 -0
  554. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/chart.mmd +31 -0
  555. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/graph.dot +85 -0
  556. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/report.md +9 -0
  557. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/sany.out +1 -0
  558. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/verdict-1.out +47 -0
  559. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/view.mjs +3 -0
  560. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/ChartRun.out +59 -0
  561. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayer.tla +103 -0
  562. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.cfg +3 -0
  563. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.tla +6 -0
  564. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/chart.mmd +42 -0
  565. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/graph.dot +93 -0
  566. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/report.md +19 -0
  567. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/sany.out +2 -0
  568. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.exit +1 -0
  569. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.out +61 -0
  570. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-2.out +59 -0
  571. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-3.out +61 -0
  572. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.exit +1 -0
  573. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.out +66 -0
  574. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.exit +1 -0
  575. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.out +58 -0
  576. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-6.out +49 -0
  577. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/view.mjs +3 -0
  578. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/ChartRun.out +57 -0
  579. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.cfg +6 -0
  580. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.tla +11 -0
  581. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/chart.mmd +5 -0
  582. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/graph.dot +11 -0
  583. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/report.md +7 -0
  584. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/sany.out +5 -0
  585. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/verdict-1.out +70 -0
  586. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ChartRun.out +61 -0
  587. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/Shadow.cfg +4 -0
  588. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/Shadow.tla +11 -0
  589. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ShadowLib.tla +6 -0
  590. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ShadowSub.tla +3 -0
  591. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/chart.mmd +9 -0
  592. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/graph.dot +16 -0
  593. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/report.md +8 -0
  594. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/sany.out +4 -0
  595. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/verdict-1.out +65 -0
  596. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/ChartRun.out +59 -0
  597. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.cfg +2 -0
  598. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.tla +9 -0
  599. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/chart.mmd +23 -0
  600. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/graph.dot +17 -0
  601. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/report.md +15 -0
  602. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/sany.out +1 -0
  603. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.exit +1 -0
  604. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.out +65 -0
  605. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.exit +1 -0
  606. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.out +75 -0
  607. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/ChartRun.out +69 -0
  608. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.cfg +3 -0
  609. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.tla +75 -0
  610. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/chart.mmd +60 -0
  611. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/graph.dot +297 -0
  612. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/report.md +20 -0
  613. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/sany.out +1 -0
  614. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.exit +1 -0
  615. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.out +95 -0
  616. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-2.out +57 -0
  617. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/view.mjs +1 -0
  618. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/ChartRun.out +57 -0
  619. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.cfg +3 -0
  620. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.tla +75 -0
  621. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/chart.mmd +37 -0
  622. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/graph.dot +223 -0
  623. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/report.md +11 -0
  624. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/sany.out +1 -0
  625. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/verdict-1.out +47 -0
  626. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/view.mjs +1 -0
  627. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.exit +1 -0
  628. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.out +75 -0
  629. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.cfg +5 -0
  630. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.tla +11 -0
  631. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/chart.mmd +18 -0
  632. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/graph.dot +14 -0
  633. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/report.md +29 -0
  634. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/sany.out +2 -0
  635. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.exit +1 -0
  636. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.out +64 -0
  637. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.exit +1 -0
  638. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.out +75 -0
  639. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/ChartRun.out +58 -0
  640. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.cfg +2 -0
  641. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.tla +8 -0
  642. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/chart.mmd +22 -0
  643. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/graph.dot +16 -0
  644. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/report.md +15 -0
  645. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/sany.out +2 -0
  646. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.exit +1 -0
  647. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.out +56 -0
  648. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.exit +1 -0
  649. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.out +77 -0
  650. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus.test.ts +441 -0
  651. package/plugins/deepmodebot/skills/statechart/scripts/test/differential.test.ts +565 -0
  652. package/plugins/deepmodebot/skills/statechart/scripts/test/drawn.ts +20 -0
  653. package/plugins/deepmodebot/skills/statechart/scripts/test/grid/Grid.cfg +2 -0
  654. package/plugins/deepmodebot/skills/statechart/scripts/test/grid/Grid.tla +9 -0
  655. package/plugins/deepmodebot/skills/statechart/scripts/test/grid/sany.out +2 -0
  656. package/plugins/deepmodebot/skills/statechart/scripts/test/java.ts +63 -0
  657. package/plugins/deepmodebot/skills/statechart/scripts/test/labels.ts +648 -0
  658. package/plugins/deepmodebot/skills/statechart/scripts/test/messages.test.ts +226 -0
  659. package/plugins/deepmodebot/skills/statechart/scripts/test/pipeline.test.ts +270 -0
  660. package/plugins/deepmodebot/skills/statechart/scripts/test/plain-tlc.test.ts +255 -0
  661. package/plugins/deepmodebot/skills/statechart/scripts/test/render.test.ts +145 -0
  662. package/plugins/deepmodebot/skills/statechart/scripts/test/tlc-out.test.ts +90 -0
  663. package/plugins/deepmodebot/skills/statechart/scripts/test/tlc.ts +158 -0
  664. package/plugins/deepmodebot/skills/statechart/scripts/tsconfig.json +11 -0
  665. package/plugins/deepmodebot/skills/statechart/scripts/worker.ts +35 -0
  666. package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/bun.lock +0 -391
  667. package/plugins/deepmodebot/skills/deepmodebot/assets/agents-md/test_agents_md.py +0 -146
  668. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_antigravity_guard.py +0 -483
  669. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_audit_regressions.py +0 -139
  670. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_contain.py +0 -301
  671. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_omp_mcp.py +0 -602
  672. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_design.py +0 -69
  673. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_evidence.py +0 -160
  674. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_record.py +0 -180
  675. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_review.py +0 -265
  676. package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/test_git_guard.py +0 -192
  677. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_bot.py +0 -2182
  678. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_brand.py +0 -19
  679. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_local_updates.py +0 -691
  680. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_review_context.py +0 -127
  681. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_workspace_cleanup.py +0 -496
  682. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_loop.py +0 -1426
  683. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_plan.py +0 -320
  684. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_windows_job.py +0 -326
  685. package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/test_bench_harness.py +0 -55
  686. package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/test_perf_audit.py +0 -53
  687. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/test_diff_coverage.py +0 -94
  688. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/test_arena.py +0 -610
  689. package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/test_yt_enrich.py +0 -250
  690. package/plugins/deepmodebot/skills/deepmodebot/assets/tournament/test_tournament.py +0 -654
  691. package/plugins/deepmodebot/skills/deepmodebot/assets/workspace-map/test_workspace_map.py +0 -879
@@ -0,0 +1,1239 @@
1
+ #!/usr/bin/env python3
2
+ """Prompt reviewer/full-scope upgrader and repo gap/overclaim prompt suggester for deepmodebot.
3
+
4
+ python prompt_tools.py upgrade --stdin [--root <repo>] [--json] <<'EOF'
5
+ python prompt_tools.py suggest --root <repo> [--limit 0] [--ui] [--json]
6
+ """
7
+ import argparse
8
+ import concurrent.futures
9
+ import importlib.util
10
+ import json
11
+ import os
12
+ import posixpath
13
+ import re
14
+ import subprocess
15
+ import sys
16
+ from pathlib import Path
17
+
18
+ sys.dont_write_bytecode = True
19
+
20
+ ASSETS_DIR = Path(__file__).resolve().parent.parent
21
+
22
+
23
+ def _load_sibling(name: str, rel_path: str):
24
+ path = ASSETS_DIR / rel_path
25
+ spec = importlib.util.spec_from_file_location(name, path)
26
+ mod = importlib.util.module_from_spec(spec)
27
+ sys.modules[spec.name] = mod
28
+ spec.loader.exec_module(mod)
29
+ return mod
30
+
31
+
32
+ SKIP_DIRS = {
33
+ ".git", ".scratch", ".worktrees", "__pycache__", "node_modules", ".venv",
34
+ "venv", "dist", "build", ".next", "target", ".pytest_cache", ".lake",
35
+ ".playwright-mcp", ".turbo", "coverage", ".cache", "out", ".nuxt", ".svelte-kit",
36
+ }
37
+
38
+ AUX_SURFACE_PREFIXES = ("docs/assets/", "docs/evidence/", "docs/research/", "examples/", "evals/", "trending/")
39
+ UNCHECKED_TASK_RE = re.compile(r"^\s*[-*]\s+\[\s\]\s+(.{6,200})$")
40
+ AGENT_SDK_SIGNAL_RE = re.compile(
41
+ r"\b(?:openai|anthropic|@google/genai|langchain|langgraph|@modelcontextprotocol|generateText|streamText|McpServer)\b"
42
+ )
43
+ HTTP_ROUTE_SIGNAL_RE = re.compile(
44
+ r"\b(?:FastAPI|APIRouter|Hono|express\s*\(|axum::Router|NextResponse|createServer)\b|@(?:app|router)\.(?:post|put|delete|patch)\b"
45
+ )
46
+ RESILIENCE_SIGNAL_RE = re.compile(
47
+ r"\b(?:idempoten|rate[_-]?limit|ratelimit|zod|pydantic|BaseModel|AbortSignal\.timeout|retry)\b",
48
+ re.I,
49
+ )
50
+
51
+ ORACLE_HINT_RE = re.compile(
52
+ r"\b(?:unittest|pytest|vitest|jest|playwright|cypress|npm\s+test|cargo\s+test|go\s+test"
53
+ r"|failing\s+test|regression\s+test|verify\s+on|prove\s+(?:it|on)|benchmark|eval|exit\s+0|screenshot|repro|assert)\b",
54
+ re.I,
55
+ )
56
+
57
+ GAP_OVERCLAIM_HINT_RE = re.compile(
58
+ r"\b(?:overclaim|overclaims|gaps?|blind\s*spots?|unverified|false\s+positive|audit\s+claims)\b",
59
+ re.I,
60
+ )
61
+
62
+ TYPO_FRAGMENT_RE = re.compile(
63
+ r"\b(?:naetc|als[oy]|wehres|revuew|optimzie|misintepet|plz|pls|idk|w\/e|etc|stuff|things)\b",
64
+ re.I,
65
+ )
66
+
67
+ OPTIONAL_HARDCORE_RE = re.compile(
68
+ r"(?:\(\s*optional\s+hardcore(?:\s+mode)?[^)]*\)|\boptional\s+hardcore(?:\s+mode)?\b"
69
+ r"|\bbonus\s+(?:hardcore|tier|goal)\b|\bbasic\s+mvp\b|\bsimple\s+placeholder\b"
70
+ r"|\bquick\s+hack\b|\bstub\s+for\s+now\b|\bminimal\s+toy\b)",
71
+ re.I,
72
+ )
73
+
74
+ LEADING_OPTIONAL_HARDCORE_RE = re.compile(
75
+ r"^(?:\(\s*optional\s+hardcore(?:\s+mode)?\s*\)|optional\s+hardcore(?:\s+mode)?\b|bonus(?:\s+hardcore)?(?:\s+tier)?\b)\s*[:\-–—]?\s*",
76
+ re.I,
77
+ )
78
+
79
+ INLINE_OPTIONAL_HARDCORE_RE = re.compile(
80
+ r"\(\s*optional\s+hardcore(?:\s+mode)?(?:\s*[:\-–—]\s*([^)]+))?\s*\)",
81
+ re.I,
82
+ )
83
+
84
+ WORD_COMPOUND_SPLIT_RE = re.compile(
85
+ r"\s+(?:and\s+also|also|as\s+well\s+as)\s+",
86
+ re.I,
87
+ )
88
+
89
+ BACKEND_SIGNAL_RE = re.compile(
90
+ r"\b(?:backend|server|endpoint|route|api|fastapi|starlette|express|axum|tokio|go|postgres|sqlite|mysql"
91
+ r"|database|sql|query|queries|orm|prisma|drizzle|sqlalchemy|pgx|asyncpg|npgsql|n\+1|pagination|cursor"
92
+ r"|pool|latency|p9[59]|throughput|rps|cache|redis|serialization|orjson|gzip|simd|memory\s+layout)\b",
93
+ re.I,
94
+ )
95
+
96
+ IMPORT_REF_RE = re.compile(
97
+ r"(?:^\s*(?:from|import)\s+([A-Za-z0-9_.]+)"
98
+ r"|\brequire\(\s*['\"]([^'\"]+)['\"]\s*\)"
99
+ r"|\bfrom\s+['\"]([^'\"]+)['\"]"
100
+ r"|['\"]([A-Za-z0-9_./\\-]+\.(?:py|ts|tsx|js|jsx|mjs|go|rs|cs))['\"])",
101
+ re.M,
102
+ )
103
+
104
+ OVERCLAIM_PATTERNS = (
105
+ (
106
+ "universal-guarantee",
107
+ re.compile(
108
+ r"(?<![A-Za-z0-9_])100%(?![A-Za-z0-9_])"
109
+ r"|\b(?:always\s+works|never\s+fails|zero\s+(?:bugs|errors|failures)|guaranteed\s+to|completely\s+bug[- ]free)\b",
110
+ re.I,
111
+ ),
112
+ ),
113
+ ("unbounded-coverage", re.compile(r"\b(?:supports?\s+all|handles?\s+every|works?\s+everywhere|fully\s+automated|production[- ]ready)\b", re.I)),
114
+ ("unbacked-pass-claim", re.compile(r"\b(?:all\s+tests\s+pass|every\s+check\s+passes|fully\s+verified)\b", re.I)),
115
+ )
116
+
117
+ MD_LINK_RE = re.compile(r"\[[^\]]+\]\((<[^>]+>|[^)\s]+)\)")
118
+ URI_SCHEME_RE = re.compile(r"^[a-zA-Z][a-zA-Z0-9+.-]*://")
119
+ DEBT_MARKER_RE = re.compile(r"\b(TODO|FIXME|HACK|XXX)\b[:\s]*(.*)")
120
+ DEFECT_WORD_RE = re.compile(r"\b(?:bug|broken|crash|error|fail|failing|fix|regression|leak|hang)\b", re.I)
121
+
122
+ NO_CLARIFY_OVERRIDE_RE = re.compile(
123
+ r"\b(?:don'?t\s+ask|no\s+questions|just\s+do\s+it|do\s+everything\s+on\s+your\s+own|autonomous(?:ly)?|decide\s+yourself)\b",
124
+ re.I,
125
+ )
126
+ CONCRETE_TARGET_RE = re.compile(
127
+ r"(?:[A-Za-z0-9_./\\-]+\.(?:py|ts|tsx|js|jsx|mjs|cjs|rs|go|luau|lean|tla|md|json|yml|yaml|toml|sql|sh)\b"
128
+ r"|https?://\S+|\borgs/[A-Za-z0-9_.-]+|#\d+\b|\bPR\s*#?\d+\b|`[^`]+`"
129
+ r"|\b(?:postgres|sqlite|redis|stripe|oauth|jwt|cloudflare|vercel|workers|nextjs|react|tailwind|rust|golang|dmb-gate|dmb-net|gap_audit|slop_gate)\b)",
130
+ re.I,
131
+ )
132
+ VAGUE_GOAL_RE = re.compile(
133
+ r"^(?:please\s+|plz\s+|can\s+you\s+)?(?:improve|fix|upgrade|clean(?:\s+up)?|refactor|build|make|update|check|help(?:\s+with)?)"
134
+ r"(?:\s+(?:it|this|things|stuff|everything|something|the\s+(?:app|repo|code|project|system)|an?\s+(?:app|tool|website|saas)))?"
135
+ r"(?:\s+(?:better|faster|cleaner|good|now|please|plz))*[?!.]*$",
136
+ re.I,
137
+ )
138
+ HUMAN_FORK_RE = re.compile(
139
+ r"\b(?:not\s+sure\s+(?:whether|if)|should\s+(?:i|we)\b[^?!.]{1,80}\bor\b|either\b[^?!.]{1,60}\bor\b.*\bwhich\b)\b",
140
+ re.I,
141
+ )
142
+ IRREVERSIBLE_GATE_RE = re.compile(
143
+ r"\b(?:deploy\s+to\s+prod(?:uction)?|publish\s+(?:to\s+)?(?:npm|pypi|crates)|drop\s+table|delete\s+prod(?:uction)?|force[- ]push)\b",
144
+ re.I,
145
+ )
146
+ HARNESS_QUESTION_TOOLS = {
147
+ "agy": "ask_question",
148
+ "claude": "AskUserQuestion",
149
+ "omp": "ask",
150
+ "codex": "request_user_input",
151
+ }
152
+
153
+
154
+ def analyze_ambiguity(raw_prompt: str, root: Path | None = None) -> dict:
155
+ stripped = re.sub(r"^\s*(?:/(?:deepmodebot:)?deep\b|\$deepmodebot:(?:deepmodebot|deep)\b)\s*", "", raw_prompt or "", flags=re.I)
156
+ cleaned = " ".join(stripped.strip().split())
157
+ signals: list[str] = []
158
+ questions: list[dict] = []
159
+
160
+ if cleaned and not NO_CLARIFY_OVERRIDE_RE.search(cleaned):
161
+ has_anchor = bool(CONCRETE_TARGET_RE.search(cleaned))
162
+ word_count = len(re.findall(r"[A-Za-z0-9_]+", cleaned))
163
+ if not has_anchor and (word_count <= 4 or VAGUE_GOAL_RE.match(cleaned)):
164
+ signals.append("underspecified_scope")
165
+ questions.append({
166
+ "question": "What outcome should /deep prioritize in this run?",
167
+ "options": [
168
+ "(Recommended) Full repo gap, drift & bug audit followed by Hardcore Mode fixes and verification",
169
+ "Build a new end-to-end feature or subsystem (specify target workflow)",
170
+ "Optimize performance, reliability, and test coverage across core modules",
171
+ ],
172
+ })
173
+ if HUMAN_FORK_RE.search(cleaned):
174
+ signals.append("explicit_human_choice_fork")
175
+ questions.append({
176
+ "question": "Which direction should /deep lock in before full-scope execution?",
177
+ "options": [
178
+ "(Recommended) Prototype/benchmark the leading first-principles architecture and ship the winner",
179
+ "Keep the smallest backwards-compatible change in the existing module layout",
180
+ ],
181
+ })
182
+ if IRREVERSIBLE_GATE_RE.search(cleaned):
183
+ signals.append("irreversible_or_external_action")
184
+ questions.append({
185
+ "question": "This prompt touches an external/irreversible boundary; how far should /deep proceed?",
186
+ "options": [
187
+ "(Recommended) Build, test, and prove everything locally/on a branch, pausing right before external publish/deploy",
188
+ "Execute the external publish/deploy step in this run as well",
189
+ ],
190
+ })
191
+
192
+ return {
193
+ "needs_clarification": bool(signals),
194
+ "signals": signals,
195
+ "max_rounds": 1 if signals else 0,
196
+ "never_ask_repo_or_doc_facts": True,
197
+ "headless_fallback": "select_recommended_and_log",
198
+ "harness_question_tools": HARNESS_QUESTION_TOOLS,
199
+ "questions": questions[:3],
200
+ }
201
+
202
+ def _has_verify_skill(root: Path) -> list[str]:
203
+ found = []
204
+ for base in (".omp/skills", ".claude/skills", ".agents/skills"):
205
+ d = root / base
206
+ if d.is_dir():
207
+ for child in sorted(d.glob("verify-*/SKILL.md")):
208
+ found.append(child.relative_to(root).as_posix())
209
+ return found
210
+
211
+
212
+ def _split_outside_code(text: str) -> list[str]:
213
+ spans: list[str] = []
214
+
215
+ def _stash(match: re.Match[str]) -> str:
216
+ idx = len(spans)
217
+ spans.append(match.group(0))
218
+ return f"\x00SPAN{idx}\x00"
219
+
220
+ masked_ticks = re.sub(r"`[^`]+`", _stash, text)
221
+ masked = []
222
+ paren_depth = 0
223
+ cur_paren: list[str] = []
224
+ for ch in masked_ticks:
225
+ if ch == "(":
226
+ paren_depth += 1
227
+ cur_paren.append(ch)
228
+ elif ch == ")" and paren_depth > 0:
229
+ cur_paren.append(ch)
230
+ paren_depth -= 1
231
+ if paren_depth == 0:
232
+ idx = len(spans)
233
+ spans.append("".join(cur_paren))
234
+ cur_paren = []
235
+ masked.append(f"\x00SPAN{idx}\x00")
236
+ elif paren_depth > 0:
237
+ cur_paren.append(ch)
238
+ elif ch == ";":
239
+ masked.append("\x1f")
240
+ else:
241
+ masked.append(ch)
242
+ if cur_paren:
243
+ masked.append("".join(cur_paren))
244
+
245
+ def _restore(chunk: str) -> str:
246
+ out = chunk
247
+ for _ in range(3):
248
+ if "\x00SPAN" not in out:
249
+ break
250
+ out = re.sub(r"\x00SPAN(\d+)\x00", lambda m: spans[int(m.group(1))], out)
251
+ return out.strip()
252
+
253
+ chunks: list[str] = []
254
+ for semi_part in "".join(masked).split("\x1f"):
255
+ s = semi_part.strip()
256
+ if not s:
257
+ continue
258
+ for part in WORD_COMPOUND_SPLIT_RE.split(s):
259
+ restored = _restore(part)
260
+ if restored:
261
+ chunks.append(restored)
262
+ return chunks
263
+
264
+ def _extract_deliverables(raw_prompt: str) -> list[str]:
265
+ text = raw_prompt.strip()
266
+ if not text:
267
+ return []
268
+ has_list = bool(re.search(r"(?:^|\n)\s*(?:\d+[.)]|[-*])\s+", text))
269
+ raw_parts: list[str] = []
270
+ if has_list:
271
+ line_blocks = re.split(r"(?:^|\n)\s*(?:\d+[.)]|[-*])\s+", text)
272
+ lead = " ".join(line_blocks[0].split()).strip()
273
+ if lead and not lead.endswith(":"):
274
+ raw_parts.extend(_split_outside_code(lead))
275
+ for block in line_blocks[1:]:
276
+ norm = " ".join(block.split()).strip()
277
+ if norm:
278
+ raw_parts.extend(_split_outside_code(norm))
279
+ else:
280
+ raw_parts.extend(_split_outside_code(" ".join(text.split())))
281
+
282
+ deduped: list[str] = []
283
+ for raw_part in raw_parts:
284
+ part = re.sub(r"^\d+[.)]\s+", "", raw_part).strip(" ,;.-")
285
+ if len(part) < 3:
286
+ continue
287
+ if part.lower() not in {d.lower() for d in deduped}:
288
+ deduped.append(part)
289
+ return deduped if deduped else [" ".join(text.split())]
290
+
291
+
292
+ def _promote_optional_hardcore_item(item: str) -> tuple[str, bool]:
293
+ if LEADING_OPTIONAL_HARDCORE_RE.search(item):
294
+ stripped = LEADING_OPTIONAL_HARDCORE_RE.sub("", item).strip()
295
+ return f"[Hardcore mandatory] {stripped or item}", True
296
+ m = INLINE_OPTIONAL_HARDCORE_RE.search(item)
297
+ if m:
298
+ inner = (m.group(1) or "").strip()
299
+ replacement = f"[Hardcore mandatory: {inner}]" if inner else "[Hardcore mandatory]"
300
+ rewritten = INLINE_OPTIONAL_HARDCORE_RE.sub(replacement, item).strip()
301
+ return rewritten, True
302
+ return item, False
303
+
304
+
305
+ def upgrade_prompt(raw_prompt: str, root: Path | None = None) -> dict:
306
+ tournament = _load_sibling("deepmode_tournament_mod", "tournament/tournament.py")
307
+ self_grill = _load_sibling("deepmode_self_grill_mod", "self-grill/self_grill.py")
308
+ autoroute = _load_sibling("deepmode_autoroute_mod", "autoroute/autoroute.py")
309
+
310
+ cleaned = " ".join(raw_prompt.strip().split())
311
+ if not cleaned:
312
+ raise SystemExit("prompt cannot be empty")
313
+
314
+ has_factory = False
315
+ empty_dir = False
316
+ verify_skills: list[str] = []
317
+ diff_summary = None
318
+ if root is not None:
319
+ safe_root = self_grill.reject_unsafe_root(root)
320
+ has_factory = (safe_root / "factory.json").is_file()
321
+ entries = [
322
+ p.name for p in safe_root.iterdir()
323
+ if p.name not in {".git", ".scratch", ".worktrees", ".DS_Store"}
324
+ ]
325
+ empty_dir = len(entries) == 0
326
+ verify_skills = _has_verify_skill(safe_root)
327
+ if self_grill._is_git_root_or_worktree(safe_root):
328
+ diff_summary = self_grill.inspect_diff(safe_root)
329
+
330
+ route = dict(tournament.classify_prompt(cleaned, has_factory=has_factory, empty_dir=empty_dir))
331
+ deliverables = _extract_deliverables(raw_prompt)
332
+ hardcore_mode = not autoroute.has_minimal_opt_out(cleaned)
333
+ hardcore_system = bool(autoroute.HARDCORE_SYSTEM_RE.search(cleaned))
334
+ is_sensitive = bool(autoroute.SENSITIVE_RE.search(cleaned)) or bool(diff_summary and diff_summary["sensitive_paths"])
335
+
336
+ promoted_hardcore = False
337
+ normalized_deliverables: list[str] = []
338
+ for item in deliverables:
339
+ rewritten, changed = _promote_optional_hardcore_item(item) if hardcore_mode else (item, False)
340
+ if changed:
341
+ promoted_hardcore = True
342
+ normalized_deliverables.append(rewritten)
343
+ deliverables = normalized_deliverables
344
+
345
+ if hardcore_mode and hardcore_system and route["mode"] == "bug-fix" and not DEFECT_WORD_RE.search(cleaned):
346
+ route["mode"] = "phased-build" if len(deliverables) >= 2 else "feature"
347
+ if route["mode"] not in autoroute.READ_ONLY_MODES and route["mode"] not in autoroute.FLEXIBLE_SIZE_MODES:
348
+ size_rank = {"none": 0, "S": 1, "M": 2, "L": 3}
349
+ floor_size = route["size"]
350
+ if hardcore_mode and (hardcore_system or len(deliverables) >= 3):
351
+ floor_size = "L"
352
+ elif len(deliverables) >= 2 or is_sensitive:
353
+ floor_size = "M" if size_rank.get(floor_size, 1) < 2 else floor_size
354
+ if diff_summary and size_rank.get(diff_summary["measured_size"], 0) > size_rank.get(floor_size, 0):
355
+ floor_size = diff_summary["measured_size"]
356
+ route["size"] = floor_size
357
+ if floor_size == "L" or is_sensitive:
358
+ route["self_grill"] = "both"
359
+ route["model_tier"] = "L"
360
+ route["effort"] = "xhigh" if floor_size == "L" else "high"
361
+ elif floor_size == "M" and route["self_grill"] == "none":
362
+ route["self_grill"] = "checks"
363
+
364
+ weaknesses: list[str] = []
365
+ words = cleaned.split()
366
+ if len(words) < 8 or route["anchors"] == 0:
367
+ weaknesses.append("shorthand_or_vague")
368
+ if len(deliverables) > 1 and not re.search(r"(?:^|\s)1[.)]\s", raw_prompt):
369
+ weaknesses.append("multi_part_unnumbered")
370
+ if not ORACLE_HINT_RE.search(cleaned):
371
+ weaknesses.append("missing_acceptance_oracle")
372
+ if not GAP_OVERCLAIM_HINT_RE.search(cleaned):
373
+ weaknesses.append("missing_gap_overclaim_check")
374
+ if TYPO_FRAGMENT_RE.search(cleaned):
375
+ weaknesses.append("contains_typos_or_fragments")
376
+ if hardcore_mode and (promoted_hardcore or OPTIONAL_HARDCORE_RE.search(cleaned)):
377
+ weaknesses.append("watered_down_or_optional_hardcore")
378
+
379
+ deliverable_lines = "\n".join(f"{idx}. {item}" for idx, item in enumerate(deliverables, 1))
380
+ verify_hint = (
381
+ f"Reuse existing verify skill ({', '.join(verify_skills)}) plus real tests/commands."
382
+ if verify_skills
383
+ else "Prove every behavior change on the real CLI/app/test path after the final edit with raw exit code 0."
384
+ )
385
+ diff_note = ""
386
+ if diff_summary and diff_summary["file_count"] > 0:
387
+ diff_note = (
388
+ f"- Active repo diff: {diff_summary['file_count']} file(s), "
389
+ f"+{diff_summary['lines_added']}/-{diff_summary['lines_deleted']} lines "
390
+ f"(size={diff_summary['measured_size']}, comments_added={diff_summary['added_comment_count']}, "
391
+ f"workaround_smells={diff_summary['workaround_smell_count']})."
392
+ )
393
+
394
+ hardcore_label = "HARDCORE MODE ON" if hardcore_mode else "minimal-scope opt-out"
395
+ upgraded_lines = [
396
+ f"/deep Execute the following full-scope request [{hardcore_label}] (advisory prior: {route['mode']}, "
397
+ f"size: {route['size']}, self_grill: {route['self_grill']}, tier: {route['model_tier']}/{route['effort']}; "
398
+ f"confirm via autoroute.py):",
399
+ "",
400
+ "Deliverables (keep 100% of scope; do not drop or demote any item):",
401
+ deliverable_lines,
402
+ "",
403
+ "Required execution & quality gates:",
404
+ "- Hardcore Mode by default (references/principles/hardcore-mode.md): aim straight for the first-principles architectural ceiling (batch query plans, bounded async concurrency, cache-friendly flat data structures, real solvers/algorithms, crisp native representations, full integration); never ship toy MVPs, stubs, or defer real craft to '(optional hardcore mode)'."
405
+ if hardcore_mode
406
+ else "- Respect explicit minimal-scope opt-out while preserving correctness and real-artifact proof.",
407
+ "- Ground in real repo files and git state first; resolve reversible ambiguity from evidence and state assumptions.",
408
+ *(
409
+ [
410
+ "- Backend & systems hot-path optimization: load skill://domain-rules/references/high-scale-server-optimization.md + data-structures-and-cache-optimization.md, run assets/perf-audit/perf_audit.py --fail-on-high, and eliminate N+1/await-in-loop waterfalls, sync-in-async blocking, missing timeouts, per-request pools, OFFSET scans, and cache stampedes."
411
+ ]
412
+ if BACKEND_SIGNAL_RE.search(cleaned) or route["mode"] in ("perf-issue", "hillclimb")
413
+ else []
414
+ ),
415
+ "- Audit for gaps and overclaims: verify every claim, count, link, and 'passes/works' statement against current files or fresh runs; fix or downgrade any unbacked claim.",
416
+ f"- Verification: {verify_hint}",
417
+ "- Self-grill & hygiene: run self_grill.py check-diff (including hardcore-craft-depth), eliminate lying/narration comments (no-comments) and workaround smells, and keep all writes inside the project root.",
418
+ "- Report concise observed results, exact receipts, remaining risks, and any real blockers.",
419
+ ]
420
+ if diff_note:
421
+ upgraded_lines.insert(6, diff_note)
422
+
423
+ clarification = analyze_ambiguity(raw_prompt, root=root)
424
+ return {
425
+ "original_prompt": raw_prompt.strip(),
426
+ "hardcore_mode": hardcore_mode,
427
+ "promoted_optional_hardcore": promoted_hardcore,
428
+ "decoded_deliverables": deliverables,
429
+ "weaknesses": weaknesses,
430
+ "needs_upgrade": bool(weaknesses),
431
+ "clarification": clarification,
432
+ "route": route,
433
+ "verify_skills": verify_skills,
434
+ "upgraded_prompt": "\n".join(upgraded_lines),
435
+ }
436
+
437
+
438
+ def _subsystem_of(rel: str) -> str:
439
+ norm = rel.replace("\\", "/").strip("/")
440
+ if "/assets/" in norm and norm.startswith("plugins/"):
441
+ after = norm.split("/assets/", 1)[1]
442
+ if "/" in after:
443
+ seg = after.split("/", 1)[0]
444
+ if seg:
445
+ return f"assets/{seg}"
446
+ parts = norm.split("/")
447
+ if len(parts) == 1:
448
+ return "root"
449
+ if parts[0] in {"src", "lib", "packages", "apps", "services", "native", "plugins", "docs", "skills"} and len(parts) >= 3:
450
+ return f"{parts[0]}/{parts[1]}"
451
+ return parts[0]
452
+
453
+
454
+ def _is_aux_surface(rel: str) -> bool:
455
+ return rel.replace("\\", "/").startswith(AUX_SURFACE_PREFIXES)
456
+
457
+
458
+ def _filter_bulk_untracked_dumps(tracked: list[str], untracked: list[str]) -> list[str]:
459
+ if not tracked or len(untracked) < 400:
460
+ return untracked
461
+ code_suffixes = {".py", ".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".rs", ".go", ".cs", ".java", ".kt", ".luau"}
462
+ by_bucket: dict[str, list[str]] = {}
463
+ for rel in untracked:
464
+ parts = rel.split("/")
465
+ key = f"{parts[0]}/{parts[1]}" if len(parts) >= 3 else parts[0]
466
+ by_bucket.setdefault(key, []).append(rel)
467
+ kept: list[str] = []
468
+ for items in by_bucket.values():
469
+ if len(items) > 250:
470
+ code_cnt = sum(1 for r in items if posixpath.splitext(r)[1].lower() in code_suffixes)
471
+ if code_cnt < max(10, int(len(items) * 0.15)):
472
+ continue
473
+ kept.extend(items)
474
+ return kept
475
+
476
+
477
+ def _collect_repo_files(root: Path) -> tuple[list[str], set[str], set[str]]:
478
+ rel_files: list[str] = []
479
+ all_known_files: list[str] = []
480
+ git_used = False
481
+ if (root / ".git").exists():
482
+ try:
483
+ rc = subprocess.run(
484
+ ["git", "-C", str(root), "ls-files", "-z", "--cached"],
485
+ stdin=subprocess.DEVNULL, capture_output=True, timeout=8,
486
+ )
487
+ ro = subprocess.run(
488
+ ["git", "-C", str(root), "ls-files", "-z", "--others", "--exclude-standard"],
489
+ stdin=subprocess.DEVNULL, capture_output=True, timeout=8,
490
+ )
491
+ if rc.returncode == 0 and ro.returncode == 0:
492
+ git_used = True
493
+
494
+ def _decode_list(blob: bytes) -> list[str]:
495
+ out: list[str] = []
496
+ for raw in blob.split(b"\x00"):
497
+ if not raw:
498
+ continue
499
+ rel = raw.decode("utf-8", errors="replace").replace("\\", "/").strip("/")
500
+ if rel and not any(seg in SKIP_DIRS for seg in rel.split("/")):
501
+ out.append(rel)
502
+ return out
503
+
504
+ tracked = _decode_list(rc.stdout)
505
+ untracked = _decode_list(ro.stdout)
506
+ all_known_files = sorted(set(tracked) | set(untracked))
507
+ kept = sorted(set(tracked) | set(_filter_bulk_untracked_dumps(tracked, untracked)))
508
+ rel_files = [r for r in kept if (root / r).is_file() and not (root / r).is_symlink()]
509
+ except (OSError, subprocess.SubprocessError):
510
+ git_used = False
511
+ if not git_used:
512
+ for dirpath, dirnames, filenames in os.walk(root):
513
+ dirnames[:] = [
514
+ d for d in sorted(dirnames)
515
+ if d not in SKIP_DIRS and not (Path(dirpath) / d).is_symlink()
516
+ ]
517
+ base = Path(dirpath)
518
+ for name in sorted(filenames):
519
+ p = base / name
520
+ if not p.is_symlink() and p.is_file():
521
+ rel_files.append(p.relative_to(root).as_posix())
522
+ all_known_files = rel_files
523
+ existing_files = set(all_known_files)
524
+ existing_dirs: set[str] = {""}
525
+ for rel in all_known_files:
526
+ idx = rel.rfind("/")
527
+ while idx > 0:
528
+ parent = rel[:idx]
529
+ if parent in existing_dirs:
530
+ break
531
+ existing_dirs.add(parent)
532
+ idx = parent.rfind("/")
533
+ return rel_files, existing_files, existing_dirs
534
+
535
+ def _recent_subsystem_churn(root: Path) -> dict[str, int]:
536
+ churn: dict[str, int] = {}
537
+ if not (root / ".git").exists():
538
+ return churn
539
+ try:
540
+ r = subprocess.run(
541
+ ["git", "-C", str(root), "log", "-n", "30", "--format=", "--name-only"],
542
+ stdin=subprocess.DEVNULL, capture_output=True, text=True, encoding="utf-8", errors="replace", timeout=5,
543
+ )
544
+ if r.returncode == 0:
545
+ for line in r.stdout.splitlines():
546
+ rel = line.strip().replace("\\", "/")
547
+ if rel:
548
+ sub = _subsystem_of(rel)
549
+ churn[sub] = churn.get(sub, 0) + 1
550
+ except (OSError, subprocess.SubprocessError):
551
+ pass
552
+ return churn
553
+
554
+
555
+ def _resolve_doc_link_in_repo(
556
+ target: str, md_parent_rel: str, skill_rel: str | None, sibling_skill_rels: list[str], existing_all: set[str]
557
+ ) -> bool:
558
+ clean = target.lstrip("/")
559
+ bases = [md_parent_rel, ""]
560
+ if skill_rel is not None:
561
+ bases.append(skill_rel)
562
+ bases.extend(sibling_skill_rels)
563
+ for base_rel in bases:
564
+ joined = f"{base_rel}/{clean}" if base_rel else clean
565
+ norm = posixpath.normpath(joined)
566
+ if norm == ".":
567
+ norm = ""
568
+ if norm.startswith("..") or norm.startswith("/"):
569
+ continue
570
+ if norm in existing_all:
571
+ return True
572
+ return False
573
+
574
+
575
+ def _scan_single_markdown(
576
+ root: Path,
577
+ rel: str,
578
+ skill_rel: str | None,
579
+ sibling_rels: list[str],
580
+ existing_all: set[str],
581
+ overclaims: list[dict],
582
+ broken_links: list[dict],
583
+ roadmap_items: list[dict],
584
+ ) -> None:
585
+ p = root / rel
586
+ try:
587
+ if p.stat().st_size > 512_000:
588
+ return
589
+ lines = p.read_text(encoding="utf-8", errors="replace").splitlines()
590
+ except OSError:
591
+ return
592
+ is_template_doc = p.name.endswith(".template.md")
593
+ can_have_roadmap = (
594
+ not is_template_doc
595
+ and not _is_aux_surface(rel)
596
+ and "/references/" not in f"/{rel}"
597
+ and p.name.upper() != "CHANGELOG.MD"
598
+ )
599
+ md_parent_rel = posixpath.dirname(rel)
600
+ fence_len = 0
601
+ for idx, line in enumerate(lines, 1):
602
+ m_fence = re.match(r"^(`{3,}|~{3,})", line.lstrip())
603
+ if m_fence:
604
+ ticks = len(m_fence.group(1))
605
+ fence_len = ticks if fence_len == 0 else (0 if ticks >= fence_len else fence_len)
606
+ continue
607
+ if fence_len > 0:
608
+ continue
609
+ if can_have_roadmap and len(roadmap_items) < 60:
610
+ m_task = UNCHECKED_TASK_RE.match(line)
611
+ if m_task and "<" not in m_task.group(1):
612
+ roadmap_items.append({"path": rel, "line": idx, "task": m_task.group(1).strip()})
613
+ prose_only = re.sub(r"`[^`]+`", " ", line)
614
+ if not re.search(r"\bkeep\s+100%\s+of\s+scope\b|\b100%\s+vs\b", prose_only, re.I):
615
+ for kind, pat in OVERCLAIM_PATTERNS:
616
+ m = pat.search(prose_only)
617
+ if m:
618
+ overclaims.append({"path": rel, "line": idx, "kind": kind, "match": m.group(0), "excerpt": line.strip()[:140]})
619
+ break
620
+ for raw_target in MD_LINK_RE.findall(prose_only):
621
+ target = raw_target.strip("<>").split("#", 1)[0].split("?", 1)[0].strip()
622
+ if not target or target.startswith("#") or URI_SCHEME_RE.match(target) or target.startswith("mailto:"):
623
+ continue
624
+ if "{{" in target or "}}" in target or (is_template_doc and target.startswith("../")):
625
+ continue
626
+ if not _resolve_doc_link_in_repo(target, md_parent_rel, skill_rel, sibling_rels, existing_all):
627
+ broken_links.append({"path": rel, "line": idx, "target": target})
628
+
629
+
630
+ def _scan_docs_for_overclaims_and_broken_links(
631
+ root: Path, rel_files: list[str] | None = None, existing_all: set[str] | None = None
632
+ ) -> tuple[list[dict], list[dict], list[dict]]:
633
+ if rel_files is None or existing_all is None:
634
+ rel_files, ef, ed = _collect_repo_files(root)
635
+ existing_all = ef | ed
636
+ skill_dirs = sorted({posixpath.dirname(r) for r in rel_files if r.endswith("/SKILL.md") or r == "SKILL.md"})
637
+ skill_set = set(skill_dirs)
638
+ siblings_by_parent: dict[str, list[str]] = {}
639
+ for sd in skill_dirs:
640
+ par = posixpath.dirname(sd)
641
+ siblings_by_parent.setdefault(par, []).append(sd)
642
+ overclaims: list[dict] = []
643
+ broken_links: list[dict] = []
644
+ roadmap_items: list[dict] = []
645
+ for rel in rel_files:
646
+ if not rel.lower().endswith(".md"):
647
+ continue
648
+ cur = posixpath.dirname(rel)
649
+ skill_rel: str | None = None
650
+ while True:
651
+ if cur in skill_set:
652
+ skill_rel = cur
653
+ break
654
+ if not cur:
655
+ break
656
+ cur = posixpath.dirname(cur)
657
+ sibs = siblings_by_parent.get(posixpath.dirname(skill_rel), []) if skill_rel is not None else []
658
+ _scan_single_markdown(root, rel, skill_rel, sibs, existing_all, overclaims, broken_links, roadmap_items)
659
+ return overclaims, broken_links, roadmap_items
660
+
661
+
662
+ def _extract_imported_stems(joined_text: str) -> set[str]:
663
+ stems: set[str] = set()
664
+ for m_imp in IMPORT_REF_RE.finditer(joined_text):
665
+ raw_imp = next((g for g in m_imp.groups() if g), "")
666
+ clean_imp = raw_imp.replace("\\", "/").rstrip("/")
667
+ leaf = Path(clean_imp.split(".")[-1] if "/" not in clean_imp else clean_imp).stem.lower()
668
+ if len(leaf) >= 3:
669
+ stems.add(leaf)
670
+ for m_from in re.finditer(r"^\s*from\s+([A-Za-z0-9_.]+)\s+import\s+([A-Za-z0-9_,\s]+)", joined_text, re.M):
671
+ for part in m_from.group(1).split("."):
672
+ if len(part) >= 3:
673
+ stems.add(part.lower())
674
+ return stems
675
+
676
+
677
+ def _scan_code_debt_and_tests(
678
+ root: Path,
679
+ code_exts: set[str],
680
+ test_re: re.Pattern[str],
681
+ comment_body_fn,
682
+ smell_patterns,
683
+ rel_files: list[str] | None = None,
684
+ ) -> dict:
685
+ if rel_files is None:
686
+ rel_files, _, _ = _collect_repo_files(root)
687
+ debt: list[dict] = []
688
+ repo_smells: list[dict] = []
689
+ code_dirs: dict[str, set[str]] = {}
690
+ tested_dirs: set[str] = set()
691
+ test_contents_stems: set[str] = set()
692
+ stem_to_subsystems: dict[str, set[str]] = {}
693
+ imported_stem_counts: dict[str, int] = {}
694
+ code_file_count = 0
695
+ core_modules: list[tuple[str, int]] = []
696
+ ui_component_files: list[str] = []
697
+ agent_sdk_files: list[str] = []
698
+ http_route_files: list[str] = []
699
+ has_resilience_guard = False
700
+ has_eval_suite = any("eval" in r.lower() or "bench" in r.lower() for r in rel_files)
701
+ has_browser_e2e = any("playwright" in r.lower() or "cypress" in r.lower() or ".e2e." in r.lower() for r in rel_files)
702
+
703
+ for rel in rel_files:
704
+ p = root / rel
705
+ ext = p.suffix.lower()
706
+ if ext not in code_exts:
707
+ continue
708
+ code_file_count += 1
709
+ parent_rel = posixpath.dirname(rel) or "."
710
+ try:
711
+ if p.stat().st_size > 512_000:
712
+ continue
713
+ text = p.read_text(encoding="utf-8", errors="replace")
714
+ except OSError:
715
+ continue
716
+ lines = text.splitlines()
717
+ if test_re.search(rel):
718
+ tested_dirs.add(parent_rel)
719
+ par_name = Path(parent_rel).name.lower()
720
+ if par_name in {"tests", "test", "__tests__", "spec"} and "/" in parent_rel:
721
+ tested_dirs.add(posixpath.dirname(parent_rel))
722
+ test_contents_stems.update(_extract_imported_stems(text))
723
+ continue
724
+
725
+ subsys = _subsystem_of(rel)
726
+ stem_low = p.stem.lower()
727
+ if stem_low not in {"__init__", "index", "main", "types", "mod", "util", "utils"}:
728
+ stem_to_subsystems.setdefault(stem_low, set()).add(subsys)
729
+ for imp_stem in _extract_imported_stems(text):
730
+ imported_stem_counts[imp_stem] = imported_stem_counts.get(imp_stem, 0) + 1
731
+ if ext in {".tsx", ".vue", ".svelte"} and not _is_aux_surface(rel):
732
+ ui_component_files.append(rel)
733
+ if not _is_aux_surface(rel) and AGENT_SDK_SIGNAL_RE.search(text):
734
+ agent_sdk_files.append(rel)
735
+ if not _is_aux_surface(rel) and HTTP_ROUTE_SIGNAL_RE.search(text):
736
+ http_route_files.append(rel)
737
+ if RESILIENCE_SIGNAL_RE.search(text):
738
+ has_resilience_guard = True
739
+ code_dirs.setdefault(parent_rel, set()).add(stem_low)
740
+ if len([ln for ln in lines if ln.strip()]) >= 2 and p.name != "__init__.py":
741
+ core_modules.append((rel, len(lines)))
742
+ for idx, line in enumerate(lines, 1):
743
+ body = comment_body_fn(rel, line)
744
+ if body is not None:
745
+ m = DEBT_MARKER_RE.search(body)
746
+ if m and len(debt) < 80:
747
+ debt.append({"path": rel, "line": idx, "marker": m.group(1), "excerpt": line.strip()[:120]})
748
+ elif "re.compile(" not in line and len(repo_smells) < 80:
749
+ for kind, pat, _ in smell_patterns:
750
+ if pat.search(line):
751
+ repo_smells.append({"path": rel, "line": idx, "kind": kind})
752
+ break
753
+
754
+ subsystem_fan_in: dict[str, int] = {}
755
+ for stem_k, subs in stem_to_subsystems.items():
756
+ hits = imported_stem_counts.get(stem_k, 0)
757
+ if hits:
758
+ for s_name in subs:
759
+ subsystem_fan_in[s_name] = subsystem_fan_in.get(s_name, 0) + hits
760
+
761
+ core_modules.sort(key=lambda item: (_is_aux_surface(item[0]), -(item[1] * (1.0 + 0.08 * subsystem_fan_in.get(_subsystem_of(item[0]), 0))), item[0]))
762
+ untested_dirs = [
763
+ d for d, stems in sorted(code_dirs.items())
764
+ if d not in tested_dirs and not ({s for s in stems if s not in {"__init__", "index", "main", "types"}} & test_contents_stems)
765
+ ]
766
+ return {
767
+ "debt": debt,
768
+ "untested_dirs": untested_dirs,
769
+ "code_file_count": code_file_count,
770
+ "core_modules": core_modules[:25],
771
+ "repo_smells": repo_smells,
772
+ "subsystem_fan_in": subsystem_fan_in,
773
+ "ui_component_files": ui_component_files,
774
+ "agent_sdk_files": agent_sdk_files,
775
+ "http_route_files": http_route_files,
776
+ "has_resilience_guard": has_resilience_guard,
777
+ "has_eval_suite": has_eval_suite,
778
+ "has_browser_e2e": has_browser_e2e,
779
+ }
780
+
781
+
782
+ def _native_dmb_gate_bin() -> Path | None:
783
+ repo_root = ASSETS_DIR.parents[4] if len(ASSETS_DIR.parents) > 4 else ASSETS_DIR
784
+ exe_name = "dmb-gate.exe" if os.name == "nt" else "dmb-gate"
785
+ cand = repo_root / "native" / "dmb-gate" / "target" / "release" / exe_name
786
+ return cand if cand.is_file() else None
787
+
788
+
789
+ def _run_fast_perf_and_gap(safe_root: Path) -> tuple[list[dict], list[dict]]:
790
+ gate_bin = _native_dmb_gate_bin()
791
+ if gate_bin is not None:
792
+ def _call_gate(sub: str) -> list[dict] | None:
793
+ try:
794
+ r = subprocess.run(
795
+ [str(gate_bin), sub, "--root", str(safe_root), "--json"],
796
+ stdin=subprocess.DEVNULL, capture_output=True, text=True, encoding="utf-8", errors="replace", timeout=20,
797
+ )
798
+ if r.stdout.strip():
799
+ return json.loads(r.stdout).get("findings", [])
800
+ except (OSError, ValueError, subprocess.SubprocessError):
801
+ return None
802
+ return None
803
+
804
+ with concurrent.futures.ThreadPoolExecutor(max_workers=2) as pool:
805
+ f_perf = pool.submit(_call_gate, "perf")
806
+ f_gap = pool.submit(_call_gate, "gap")
807
+ p_res, g_res = f_perf.result(), f_gap.result()
808
+ if p_res is not None and g_res is not None:
809
+ return p_res, g_res
810
+
811
+ perf_findings: list[dict] = []
812
+ if (ASSETS_DIR / "perf-audit" / "perf_audit.py").is_file():
813
+ perf_audit = _load_sibling("deepmode_perf_audit_mod", "perf-audit/perf_audit.py")
814
+ perf_findings = perf_audit.scan_paths(safe_root).get("findings", [])
815
+ gap_findings: list[dict] = []
816
+ if (ASSETS_DIR / "gap-audit" / "gap_audit.py").is_file():
817
+ gap_audit = _load_sibling("deepmode_gap_audit_mod", "gap-audit/gap_audit.py")
818
+ gap_findings = gap_audit.scan_repo(safe_root).get("findings", [])
819
+ return perf_findings, gap_findings
820
+
821
+
822
+ def _group_by_subsystem(items: list[dict], path_key: str) -> list[tuple[str, list[dict]]]:
823
+ buckets: dict[str, list[dict]] = {}
824
+ for it in items:
825
+ sub = _subsystem_of(it[path_key])
826
+ buckets.setdefault(sub, []).append(it)
827
+ return sorted(buckets.items(), key=lambda kv: (all(_is_aux_surface(x[path_key]) for x in kv[1]), -len(kv[1]), kv[0]))
828
+
829
+
830
+ def _compute_leverage_score(priority: str, subsys: str, count: int, fan_in: dict[str, int], churn: dict[str, int], aux: bool) -> int:
831
+ base = {"P0": 88, "P1": 68, "P2": 44}.get(priority, 40)
832
+ score = base + min(8, fan_in.get(subsys, 0) * 2) + min(6, churn.get(subsys, 0)) + min(6, count)
833
+ score += -14 if aux else 4
834
+ return max(10, min(99, score))
835
+
836
+
837
+ def _emit_capability_and_roadmap_tasks(
838
+ add_fn, roadmap_items: list[dict], code_info: dict, verify_skills: list[str]
839
+ ) -> None:
840
+ if roadmap_items:
841
+ for subsys, items in _group_by_subsystem(roadmap_items, "path"):
842
+ refs = [f"{r['path']}:{r['line']} ({r['task'][:70]})" for r in items]
843
+ add_fn(
844
+ "P1", "capability", f"[{subsys}] Ship {len(items)} unchecked roadmap/spec deliverable(s)",
845
+ refs, subsys, False,
846
+ f"/deep [HARDCORE MODE] Full-scope delivery of {len(items)} unchecked roadmap/spec deliverable(s) in `{subsys}` "
847
+ f"({', '.join(refs[:5])}): 1. Implement every listed deliverable end-to-end with production data models and error handling. "
848
+ f"2. Check off verified items only after real behavioral tests and runtime proof pass. 3. Run self-grill.",
849
+ )
850
+ if code_info["agent_sdk_files"] and not code_info["has_eval_suite"]:
851
+ refs = code_info["agent_sdk_files"][:8]
852
+ sub = _subsystem_of(refs[0])
853
+ add_fn(
854
+ "P1", "capability", f"[{sub}] Build deterministic offline + adversarial eval harness for LLM/agent workflows",
855
+ refs, sub, False,
856
+ f"/deep [HARDCORE MODE] Full-scope LLM/agent evaluation & regression harness for `{sub}` ({', '.join(refs[:4])}): "
857
+ f"1. Build a deterministic golden + adversarial evaluation suite covering tool calls, failure recovery, prompt injection, and output invariants. "
858
+ f"2. Wire baseline pass-rate and latency metrics into local CI gates. 3. Prove the eval runner exits 0 and run self-grill.",
859
+ )
860
+ if code_info["http_route_files"] and not code_info["has_resilience_guard"]:
861
+ refs = code_info["http_route_files"][:8]
862
+ sub = _subsystem_of(refs[0])
863
+ add_fn(
864
+ "P1", "capability", f"[{sub}] Add schema validation, idempotency, timeouts, and rate-limit guards to HTTP/RPC boundaries",
865
+ refs, sub, False,
866
+ f"/deep [HARDCORE MODE] Full-scope API & boundary hardening for `{sub}` ({', '.join(refs[:4])}): "
867
+ f"1. Enforce strict input schema validation, explicit upstream timeouts, idempotency keys on mutating routes, and rate-limit protection. "
868
+ f"2. Add hostile/malformed payload and retry regression tests. 3. Prove all gates exit 0 and run self-grill.",
869
+ )
870
+ if len(code_info["ui_component_files"]) >= 3 and not code_info["has_browser_e2e"] and not verify_skills:
871
+ refs = code_info["ui_component_files"][:8]
872
+ sub = _subsystem_of(refs[0])
873
+ add_fn(
874
+ "P1", "verification", f"[{sub}] Add real-browser Desktop + Mobile visual E2E, motion, and a11y verification",
875
+ refs, sub, False,
876
+ f"/deep [HARDCORE MODE] Full-scope real-browser E2E & UI gate for `{sub}` ({', '.join(refs[:4])}): "
877
+ f"1. Build automated Desktop (1440x900) and Mobile (390x844) browser journeys exercising real user flows, keyboard focus, and OKLCH/layout tokens. "
878
+ f"2. Pass deepmodebot gate ui and capture reproducible runtime proof. 3. Run self-grill.",
879
+ )
880
+
881
+
882
+ def _emit_core_module_tasks(add_fn, core_modules: list[tuple[str, int]]) -> None:
883
+ if not core_modules:
884
+ return
885
+ seen_subs: set[str] = set()
886
+ grouped: list[tuple[str, list[tuple[str, int]]]] = []
887
+ for path, n_lines in core_modules:
888
+ if _is_aux_surface(path) and any(not _is_aux_surface(p) for p, _ in core_modules):
889
+ continue
890
+ sub = _subsystem_of(path)
891
+ if n_lines < 220 and grouped:
892
+ continue
893
+ if sub not in seen_subs:
894
+ seen_subs.add(sub)
895
+ sub_mods = [(p, nl) for p, nl in core_modules if _subsystem_of(p) == sub and (nl >= 220 or not grouped)][:4]
896
+ grouped.append((sub, sub_mods))
897
+ for idx, (sub, mods) in enumerate(grouped):
898
+ refs = [f"{p} ({nl} lines)" for p, nl in mods]
899
+ paths_csv = ", ".join(p for p, _ in mods)
900
+ prefix = f"[{sub}] " if len(grouped) > 1 or idx > 0 else ""
901
+ add_fn(
902
+ "P1", "hardcore", f"{prefix}Hardcore Mode architectural ceiling upgrade on core source modules",
903
+ refs, sub, all(_is_aux_surface(p) for p, _ in mods),
904
+ f"/deep [HARDCORE MODE] First-principles architectural ceiling upgrade for `{sub}` core module(s) ({paths_csv}): "
905
+ f"1. Inspect {paths_csv} and identify every flat approximation, single-threaded bottleneck, shallow pass-through seam, "
906
+ f"or naive algorithm holding back the system ceiling. "
907
+ f"2. Upgrade straight to the true first-principles architecture (batch query plans, bounded async concurrency, "
908
+ f"cache-friendly data structures, crisp native representations, and full integration). "
909
+ f"3. Prove end-to-end behavior and measured gains on the real artifact, and run self_grill.py check-diff.",
910
+ )
911
+
912
+
913
+ def _emit_p0_and_diff_tasks(
914
+ add_fn, broken_links: list[dict], overclaims: list[dict], gap_findings: list[dict], diff: dict
915
+ ) -> None:
916
+ if broken_links:
917
+ refs = [f"{b['path']}:{b['line']} -> {b['target']}" for b in broken_links]
918
+ add_fn(
919
+ "P0", "overclaim", "Fix broken documentation links and audit referenced paths",
920
+ refs, "docs", False,
921
+ f"/deep Full-scope doc link and accuracy audit: 1. Inspect and fix all {len(broken_links)} broken local doc link(s) "
922
+ f"({', '.join(refs[:5])}). 2. Audit every doc file for stale paths, missing files, and unbacked claims. "
923
+ f"3. Prove every remaining link resolves on disk and run repo checks + self-grill before reporting.",
924
+ )
925
+ if overclaims:
926
+ non_aux_oc = [o for o in overclaims if not _is_aux_surface(o["path"])] or overclaims
927
+ refs = [f"{o['path']}:{o['line']} ({o['match']})" for o in non_aux_oc]
928
+ add_fn(
929
+ "P0", "overclaim", "Audit documentation for overclaims and back or downgrade every guarantee",
930
+ refs, "docs", len(non_aux_oc) != len(overclaims) and all(_is_aux_surface(o["path"]) for o in non_aux_oc),
931
+ f"/deep Full-scope gap and overclaim audit across docs: 1. Inspect all {len(non_aux_oc)} flagged guarantee/coverage claim(s) "
932
+ f"({', '.join(refs[:5])}). 2. For each claim, either prove it with a real command/test receipt or rewrite it to state exact tested bounds and limits. "
933
+ f"3. Run doc/repo checks and self-grill, and report each claim's verdict with file:line evidence.",
934
+ )
935
+ drift_gaps = [
936
+ g for g in gap_findings
937
+ if g["rule"] in ("doc-script-flag-drift", "doc-cli-subcommand-drift", "stale-replaces-claim", "cross-lang-gate-drift")
938
+ ]
939
+ for subsys, items in _group_by_subsystem(drift_gaps, "file"):
940
+ refs = [f"{g['file']}:{g['line']} ({g['rule']})" for g in items]
941
+ add_fn(
942
+ "P0", "gap", f"[{subsys}] Eliminate doc-to-CLI flag drift, stale replacement claims, and cross-language gate drift",
943
+ refs, subsys, all(_is_aux_surface(g["file"]) for g in items),
944
+ f"/deep Full-scope spec-to-code and cross-language parity fix in `{subsys}` across {len(items)} drift finding(s) "
945
+ f"({', '.join(refs[:5])}): 1. Reconcile every documented CLI flag/subcommand, stale replacement comment, and Python-vs-Rust gate rule mismatch at the root. "
946
+ f"2. Add regression tests asserting 1:1 parity across docs, Python scripts, and native binaries. "
947
+ f"3. Prove gap_audit.py scan --root . exits 0 and run self-grill.",
948
+ )
949
+ if diff["sensitive_paths"]:
950
+ refs = list(diff["sensitive_paths"])
951
+ add_fn(
952
+ "P0", "checks", "Self-grill and security-audit sensitive paths in the current diff",
953
+ refs, _subsystem_of(refs[0]), False,
954
+ f"/deep Full-scope security and self-grill audit on active diff touching sensitive path(s) ({', '.join(refs[:5])}): "
955
+ f"1. Run self_grill.py check-diff and verify fail-closed handling on missing, malformed, and hostile inputs. "
956
+ f"2. Add failing-without-fix regression tests for every trust boundary touched. "
957
+ f"3. Run a cross-family skeptic review, prove all checks exit 0 on the current tree, and report gaps or blockers.",
958
+ )
959
+ if diff["code_paths"] and not diff["test_paths"]:
960
+ refs = list(diff["code_paths"])
961
+ add_fn(
962
+ "P1", "gap", "Add failing-without-fix regression tests for changed code files",
963
+ refs, _subsystem_of(refs[0]), False,
964
+ f"/deep Full-scope test coverage for active diff: 1. Inspect changed code ({', '.join(refs[:5])}) that currently has zero test edits. "
965
+ f"2. Write behavioral tests (no tautological mocks) proven to fail if each change is reverted. "
966
+ f"3. Run the full test suite and self_grill.py check-diff to verify PASS with raw exit code 0.",
967
+ )
968
+ if diff["added_comment_count"] > 0:
969
+ refs = [f"{c['path']}:{c['line']}" for c in diff["added_comments"]]
970
+ add_fn(
971
+ "P1", "checks", "Run comment-sicko / no-comments on added code comments in diff",
972
+ refs, _subsystem_of(diff["added_comments"][0]["path"]), False,
973
+ f"/deep Full-scope no-comments cleanup: 1. Inspect all {diff['added_comment_count']} added code comment(s) "
974
+ f"({', '.join(refs[:5])}) because stale comments rot and mislead agents into reading comments instead of code. "
975
+ f"2. Delete narration, banners, workarounds, and unsafe suppressions; encode real constraints in types, names, or tests. "
976
+ f"3. Re-run tests and self_grill.py check-diff to confirm clean diff.",
977
+ )
978
+
979
+
980
+ def _emit_subsystem_and_hygiene_tasks(
981
+ add_fn, safe_root: Path, gap_findings: list[dict], perf_findings: list[dict], diff: dict, code_info: dict, verify_skills: list[str]
982
+ ) -> None:
983
+ silent_gaps = [g for g in gap_findings if g["rule"] in ("hollow-stub-body", "swallowed-exception")]
984
+ for subsys, items in _group_by_subsystem(silent_gaps, "file"):
985
+ refs = [f"{g['file']}:{g['line']} ({g['rule']})" for g in items]
986
+ add_fn(
987
+ "P1", "gap", f"[{subsys}] Replace hollow stub functions and silent swallowed exceptions with real behavior",
988
+ refs, subsys, all(_is_aux_surface(g["file"]) for g in items),
989
+ f"/deep [HARDCORE MODE] Full-scope elimination of {len(items)} hollow stub / silent error black-hole(s) in `{subsys}` "
990
+ f"({', '.join(refs[:5])}): 1. Replace every hollow no-op `pass` or empty function body with a complete production implementation or explicit ABC/Protocol contract. "
991
+ f"2. Replace broad `except Exception: pass` and `.catch(() => {{}})` black-holes with narrow error handling and observable failure states. "
992
+ f"3. Prove gap_audit.py scan --root . exits 0, add failure-path tests, and run self-grill.",
993
+ )
994
+ for subsys, items in _group_by_subsystem(perf_findings, "file"):
995
+ refs = [f"{f['file']}:{f['line']} ({f.get('rule_id') or f.get('rule', 'perf')})" for f in items]
996
+ add_fn(
997
+ "P1", "perf", f"[{subsys}] Eliminate backend hot-path, database N+1, and high-scale server bottlenecks",
998
+ refs, subsys, all(_is_aux_surface(f["file"]) for f in items),
999
+ f"/deep [HARDCORE MODE] Full-scope backend & systems performance optimization in `{subsys}` across {len(items)} "
1000
+ f"perf_audit finding(s) ({', '.join(refs[:5])}): "
1001
+ f"1. Load skill://domain-rules/references/high-scale-server-optimization.md and data-structures-and-cache-optimization.md, "
1002
+ f"and capture baseline p50/p95/p99 latency + query counts via bench_harness.py or EXPLAIN ANALYZE. "
1003
+ f"2. Fix every N+1/await-in-loop waterfall, sync-in-async block, missing timeout, per-request pool, OFFSET scan, "
1004
+ f"and framework/serialization bottleneck at the root. "
1005
+ f"3. Prove perf_audit.py --fail-on-high exits 0, verify before/after delta on the real harness, and run self-grill.",
1006
+ )
1007
+ smell_items = diff["workaround_smells"] or code_info["repo_smells"]
1008
+ for subsys, items in _group_by_subsystem(smell_items, "path"):
1009
+ refs = [f"{s['path']}:{s['line']}({s['kind']})" for s in items]
1010
+ add_fn(
1011
+ "P1", "gardening", f"[{subsys}] Replace imperative-timer, raw useEffect, or unsafe cast workarounds at the root",
1012
+ refs, subsys, all(_is_aux_surface(s["path"]) for s in items),
1013
+ f"/deep Full-scope root-cause cleanup in `{subsys}` for {len(items)} workaround smell(s) ({', '.join(refs[:5])}): "
1014
+ f"1. Eliminate each imperative timer, raw useEffect, or unsafe type cast at the root cause. "
1015
+ f"2. Add a deterministic lint or type check so the pattern cannot return. "
1016
+ f"3. Prove behavior with tests and self_grill.py check-diff.",
1017
+ )
1018
+ if not verify_skills and code_info["code_file_count"] >= 3:
1019
+ add_fn(
1020
+ "P1", "verification", "Create a project-local verify-<app> skill with control CLI and full feature map",
1021
+ [f"code_files={code_info['code_file_count']}", "verify_skills=0"], "root", False,
1022
+ "/deep Full-scope verification setup: 1. Interview this repo and generate a project-local verify-<app> skill "
1023
+ "with a single control CLI (launch, doctor, inspect, drive, cleanup) and complete user-POV feature map across every route/command. "
1024
+ "2. Prove the skill end-to-end on the real app and confirm evidence survives cleanup. "
1025
+ "3. Wire it into repo instructions and audit for gaps or unverified steps.",
1026
+ )
1027
+ untested_by_sub: dict[str, list[str]] = {}
1028
+ for d in code_info["untested_dirs"]:
1029
+ untested_by_sub.setdefault(_subsystem_of(f"{d}/x"), []).append(d)
1030
+ for subsys, dirs in sorted(untested_by_sub.items(), key=lambda kv: (all(_is_aux_surface(f"{x}/") for x in kv[1]), -len(kv[1]), kv[0])):
1031
+ aux_u = all(_is_aux_surface(f"{x}/") for x in dirs)
1032
+ add_fn(
1033
+ "P2" if aux_u else "P1", "gap", f"[{subsys}] Close missing test coverage in code directories with no sibling tests",
1034
+ dirs, subsys, aux_u,
1035
+ f"/deep Full-scope gap audit and test hardening for `{subsys}`: 1. Inspect untested code directories ({', '.join(dirs[:6])}) "
1036
+ f"and prioritize highest-risk public contracts and failure paths. "
1037
+ f"2. Add real behavioral tests (never tautological mocks) covering happy paths and edge failures. "
1038
+ f"3. Run all checks and self-grill to confirm zero regressions.",
1039
+ )
1040
+ _emit_core_module_tasks(add_fn, code_info["core_modules"])
1041
+ unwired_gaps = [g for g in gap_findings if g["rule"] == "unwired-script-asset"]
1042
+ for subsys, items in _group_by_subsystem(unwired_gaps, "file"):
1043
+ refs = [f"{g['file']}:{g['line']} ({g['rule']})" for g in items]
1044
+ add_fn(
1045
+ "P2", "gap", f"[{subsys}] Wire orphaned skill/tool scripts into active workflows or prune dead assets",
1046
+ refs, subsys, False,
1047
+ f"/deep Full-scope dead-seam audit in `{subsys}` for {len(items)} unwired script asset(s) ({', '.join(refs[:5])}): "
1048
+ f"1. Inspect each unreferenced script and either wire it into its owning SKILL.md / CLI dispatcher with end-to-end tests or delete dead code. "
1049
+ f"2. Prove gap_audit.py scan --root . reports 0 unwired assets and run self-grill.",
1050
+ )
1051
+ for subsys, items in _group_by_subsystem(code_info["debt"], "path"):
1052
+ refs = [f"{d['path']}:{d['line']} ({d['marker']})" for d in items]
1053
+ add_fn(
1054
+ "P2", "gardening", f"[{subsys}] Triage and resolve TODO/FIXME/HACK markers via codebase gardening",
1055
+ refs, subsys, all(_is_aux_surface(d["path"]) for d in items),
1056
+ f"/deep Full-scope codebase gardening in `{subsys}` for {len(items)} TODO/FIXME/HACK marker(s) ({', '.join(refs[:5])}): "
1057
+ f"1. Group markers by shared root cause into a pattern buffer instead of patching one by one. "
1058
+ f"2. Fix valid items, delete obsolete markers/workarounds, and encode recurring rules as lints/types/tests. "
1059
+ f"3. Prove all tests pass and run self-grill.",
1060
+ )
1061
+ if code_info["code_file_count"] >= 10 and not (safe_root / "GLOSSARY.md").is_file() and not (safe_root / "docs" / "adr").is_dir():
1062
+ add_fn(
1063
+ "P2", "gardening", "Establish domain glossary and architecture decision records",
1064
+ [f"code_files={code_info['code_file_count']}", "GLOSSARY.md=missing", "docs/adr=missing"], "docs", False,
1065
+ "/deep Full-scope domain modeling and architecture baseline: 1. Audit core domain terms and high-churn modules "
1066
+ "across the repo. 2. Create GLOSSARY.md and initial docs/adr/ records for non-obvious architectural choices. "
1067
+ "3. Verify every entry cites real code paths with zero fabricated claims.",
1068
+ )
1069
+
1070
+
1071
+ def suggest_prompts(root: Path, limit: int = 0) -> dict:
1072
+ self_grill = _load_sibling("deepmode_self_grill_mod", "self-grill/self_grill.py")
1073
+ safe_root = self_grill.reject_unsafe_root(root)
1074
+ rel_files, existing_files, existing_dirs = _collect_repo_files(safe_root)
1075
+ existing_all = existing_files | existing_dirs
1076
+ verify_skills = _has_verify_skill(safe_root)
1077
+
1078
+ with concurrent.futures.ThreadPoolExecutor(max_workers=4) as pool:
1079
+ f_churn = pool.submit(_recent_subsystem_churn, safe_root)
1080
+ f_diff = pool.submit(self_grill.inspect_diff, safe_root)
1081
+ f_docs = pool.submit(_scan_docs_for_overclaims_and_broken_links, safe_root, rel_files, existing_all)
1082
+ f_code = pool.submit(
1083
+ _scan_code_debt_and_tests,
1084
+ safe_root,
1085
+ self_grill.CODE_EXTS,
1086
+ self_grill.TEST_PATH_RE,
1087
+ self_grill._comment_body,
1088
+ self_grill.WORKAROUND_SMELL_PATTERNS,
1089
+ rel_files,
1090
+ )
1091
+ f_gates = pool.submit(_run_fast_perf_and_gap, safe_root)
1092
+ churn = f_churn.result()
1093
+ diff = f_diff.result()
1094
+ overclaims, broken_links, roadmap_items = f_docs.result()
1095
+ code_info = f_code.result()
1096
+ perf_findings, gap_findings = f_gates.result()
1097
+
1098
+ fan_in = code_info["subsystem_fan_in"]
1099
+ all_suggestions: list[dict] = []
1100
+ wave_for = {"P0": 1, "P1": 2, "P2": 3}
1101
+
1102
+ def add(priority: str, kind: str, title: str, evidence: list[str], subsys: str, aux: bool, prompt: str) -> None:
1103
+ score = _compute_leverage_score(priority, subsys, len(evidence), fan_in, churn, aux)
1104
+ all_suggestions.append({
1105
+ "priority": priority,
1106
+ "wave": wave_for.get(priority, 3),
1107
+ "leverage_score": score,
1108
+ "subsystem": subsys,
1109
+ "kind": kind,
1110
+ "title": title,
1111
+ "evidence": evidence,
1112
+ "prompt": prompt,
1113
+ })
1114
+
1115
+ _emit_p0_and_diff_tasks(add, broken_links, overclaims, gap_findings, diff)
1116
+ _emit_capability_and_roadmap_tasks(add, roadmap_items, code_info, verify_skills)
1117
+ _emit_subsystem_and_hygiene_tasks(add, safe_root, gap_findings, perf_findings, diff, code_info, verify_skills)
1118
+
1119
+ rank = {"P0": 0, "P1": 1, "P2": 2}
1120
+ all_suggestions.sort(key=lambda s: (rank.get(s["priority"], 9), -s["leverage_score"], s["title"]))
1121
+ total_count = len(all_suggestions)
1122
+ suggestions = all_suggestions[:limit] if limit and limit > 0 else all_suggestions
1123
+ subsystems_mapped = sorted({s["subsystem"] for s in all_suggestions})
1124
+
1125
+ return {
1126
+ "root": str(safe_root),
1127
+ "hardcore_mode": True,
1128
+ "full_scope": not (limit and limit > 0),
1129
+ "total_leverage_tasks": total_count,
1130
+ "truncated": len(suggestions) < total_count,
1131
+ "subsystems_mapped": subsystems_mapped,
1132
+ "code_file_count": code_info["code_file_count"],
1133
+ "core_modules": [{"path": p, "lines": n, "subsystem": _subsystem_of(p)} for p, n in code_info["core_modules"]],
1134
+ "verify_skills": verify_skills,
1135
+ "diff_size": diff["measured_size"],
1136
+ "overclaim_hits": len(overclaims),
1137
+ "broken_link_hits": len(broken_links),
1138
+ "roadmap_unchecked_hits": len(roadmap_items),
1139
+ "debt_marker_hits": len(code_info["debt"]),
1140
+ "perf_audit_hits": len(perf_findings),
1141
+ "gap_audit_hits": len(gap_findings),
1142
+ "suggestions": suggestions,
1143
+ }
1144
+
1145
+
1146
+ def cmd_upgrade(args: argparse.Namespace) -> int:
1147
+ raw = sys.stdin.read() if args.stdin else (args.prompt or "")
1148
+ root = Path(args.root) if args.root else None
1149
+ result = upgrade_prompt(raw, root=root)
1150
+ if args.json:
1151
+ print(json.dumps(result, indent=2))
1152
+ else:
1153
+ print(result["upgraded_prompt"])
1154
+ return 0
1155
+
1156
+
1157
+ def cmd_clarify(args: argparse.Namespace) -> int:
1158
+ raw = sys.stdin.read() if args.stdin else (args.prompt or "")
1159
+ root = Path(args.root) if args.root else None
1160
+ res = analyze_ambiguity(raw, root=root)
1161
+ if args.json:
1162
+ print(json.dumps(res, indent=2))
1163
+ elif res["needs_clarification"]:
1164
+ print(f"clarify [ASK_ONCE_UPFRONT]: {', '.join(res['signals'])}")
1165
+ for idx, q in enumerate(res["questions"], 1):
1166
+ print(f" Q{idx}: {q['question']} -> {'; '.join(q['options'])}")
1167
+ else:
1168
+ print("clarify [CLEAR_RUN_AUTONOMOUSLY]: 0 questions needed")
1169
+ return 0
1170
+
1171
+
1172
+ def cmd_suggest(args: argparse.Namespace) -> int:
1173
+ result = suggest_prompts(Path(args.root), limit=args.limit)
1174
+ if getattr(args, "ui", False) or getattr(args, "open", False):
1175
+ gen_ui = _load_sibling("deepmode_gen_ui_mod", "gen-ui/gen_ui.py")
1176
+ ui_out = gen_ui.generate_from_suggest(
1177
+ Path(result["root"]),
1178
+ slug="suggest",
1179
+ limit=args.limit,
1180
+ open_browser=bool(getattr(args, "open", False)),
1181
+ precomputed=result,
1182
+ )
1183
+ result["ui_surface"] = ui_out["ui_surface"]
1184
+ if args.json:
1185
+ print(json.dumps(result, indent=2))
1186
+ else:
1187
+ print(
1188
+ f"High-Leverage Project Map ({len(result['suggestions'])}/{result['total_leverage_tasks']} task(s) across "
1189
+ f"{len(result['subsystems_mapped'])} subsystem(s)):"
1190
+ )
1191
+ for idx, item in enumerate(result["suggestions"], 1):
1192
+ print(
1193
+ f"{idx}. [W{item['wave']} {item['priority']}/{item['kind']} · score={item['leverage_score']}] {item['title']}"
1194
+ )
1195
+ print(f" evidence ({len(item['evidence'])}): {', '.join(item['evidence'][:8])}")
1196
+ print(f" prompt: {item['prompt']}")
1197
+ if "ui_surface" in result:
1198
+ print(f" a2ui: {result['ui_surface']['a2ui_path']}")
1199
+ print(f" cockpit: {result['ui_surface']['html_path']}")
1200
+ return 0
1201
+
1202
+
1203
+ def build_parser() -> argparse.ArgumentParser:
1204
+ parser = argparse.ArgumentParser(description="Prompt reviewer/upgrader and repo gap/overclaim prompt suggester.")
1205
+ sub = parser.add_subparsers(dest="cmd", required=True)
1206
+
1207
+ p_up = sub.add_parser("upgrade", help="Review a raw user prompt and compile a full-scope deepmodebot prompt.")
1208
+ p_up.add_argument("--stdin", action="store_true")
1209
+ p_up.add_argument("--prompt", default="")
1210
+ p_up.add_argument("--root", default=None)
1211
+ p_up.add_argument("--json", action="store_true")
1212
+ p_up.set_defaults(func=cmd_upgrade)
1213
+
1214
+ p_cl = sub.add_parser("clarify", help="Check whether /deep should ask 1 upfront clarification round or run immediately.")
1215
+ p_cl.add_argument("--stdin", action="store_true")
1216
+ p_cl.add_argument("--prompt", default="")
1217
+ p_cl.add_argument("--root", default=None)
1218
+ p_cl.add_argument("--json", action="store_true")
1219
+ p_cl.set_defaults(func=cmd_clarify)
1220
+
1221
+ p_sug = sub.add_parser("suggest", help="Scan a repo for gaps and overclaims and suggest full-scope /deep prompts.")
1222
+ p_sug.add_argument("--root", required=True)
1223
+ p_sug.add_argument("--limit", type=int, default=0, help="Max tasks to return (0 = full un-truncated scope, default).")
1224
+ p_sug.add_argument("--ui", action="store_true", help="Also emit an A2UI v1.0 surface and interactive HTML cockpit.")
1225
+ p_sug.add_argument("--open", action="store_true", help="Open the interactive HTML cockpit in the default browser.")
1226
+ p_sug.add_argument("--json", action="store_true")
1227
+ p_sug.set_defaults(func=cmd_suggest)
1228
+
1229
+ return parser
1230
+
1231
+
1232
+ def main(argv: list[str] | None = None) -> int:
1233
+ parser = build_parser()
1234
+ args = parser.parse_args(argv)
1235
+ return args.func(args)
1236
+
1237
+
1238
+ if __name__ == "__main__":
1239
+ raise SystemExit(main())