deepmodebot 0.9.1 → 0.11.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 (705) 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 +38 -5
  5. package/bin/deepmodebot.mjs +257 -4
  6. package/lib/clients.mjs +50 -3
  7. package/lib/tree.mjs +64 -10
  8. package/native/dmb-gate/Cargo.toml +13 -0
  9. package/native/dmb-gate/src/agents.rs +110 -0
  10. package/native/dmb-gate/src/ci.rs +1032 -0
  11. package/native/dmb-gate/src/cleanup.rs +198 -0
  12. package/native/dmb-gate/src/gap.rs +1376 -0
  13. package/native/dmb-gate/src/guard.rs +135 -0
  14. package/native/dmb-gate/src/main.rs +535 -0
  15. package/native/dmb-gate/src/map.rs +173 -0
  16. package/native/dmb-gate/src/perf.rs +347 -0
  17. package/native/dmb-gate/src/reward.rs +2867 -0
  18. package/native/dmb-gate/src/sim.rs +969 -0
  19. package/native/dmb-gate/src/skill_check.rs +171 -0
  20. package/native/dmb-gate/src/slop.rs +2004 -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.md +29 -0
  36. package/plugins/deepmodebot/agents/researcher.md +29 -0
  37. package/plugins/deepmodebot/agents/reviewer.md +29 -0
  38. package/plugins/deepmodebot/agents/scout.md +28 -0
  39. package/plugins/deepmodebot/agents/security-reviewer.md +27 -0
  40. package/plugins/deepmodebot/commands/deep.md +7 -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 +12 -2
  45. package/plugins/deepmodebot/hooks.json +1 -1
  46. package/plugins/deepmodebot/scripts/antigravity-guard.mjs +862 -26
  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 +3 -3
  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 +83 -146
  82. package/plugins/deepmodebot/skills/deepmodebot/assets/agents-md/agents_md.py +67 -24
  83. package/plugins/deepmodebot/skills/deepmodebot/assets/autoroute/autoroute.py +1026 -0
  84. package/plugins/deepmodebot/skills/deepmodebot/assets/cleanup/self_cleanup.py +305 -0
  85. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/claude-guard.sh +4 -0
  86. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/claude_guard.py +736 -6
  87. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/holdout_guard_cases.json +272 -0
  88. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/omp-contain.ts +861 -9
  89. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/design.py +3 -0
  90. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/record.py +2 -0
  91. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/rehearsal_gate.py +536 -0
  92. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/review.py +2 -0
  93. package/plugins/deepmodebot/skills/deepmodebot/assets/f2p-gate/f2p_gate.py +547 -0
  94. package/plugins/deepmodebot/skills/deepmodebot/assets/formal-verification/verify_proof.py +638 -0
  95. package/plugins/deepmodebot/skills/deepmodebot/assets/gap-audit/gap_audit.py +1047 -0
  96. package/plugins/deepmodebot/skills/deepmodebot/assets/gen-ui/gen_ui.py +1782 -0
  97. package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard-patterns.txt +7 -0
  98. package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard.sh +55 -7
  99. package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard.ts +55 -5
  100. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/ghapp.py +2 -0
  101. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/install.py +2 -0
  102. package/plugins/deepmodebot/skills/deepmodebot/assets/local-ci/local_ci.py +796 -0
  103. package/plugins/deepmodebot/skills/deepmodebot/assets/local-ci/slop_gate.py +1049 -0
  104. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/loop.py +748 -46
  105. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/plan.py +2 -1
  106. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/windows_job.py +2 -0
  107. package/plugins/deepmodebot/skills/deepmodebot/assets/memory/project_memory.py +928 -0
  108. package/plugins/deepmodebot/skills/deepmodebot/assets/mutation/mutation_gate.py +798 -0
  109. package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/bench_harness.py +48 -21
  110. package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/perf_audit.py +339 -5
  111. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/diff_coverage.py +96 -6
  112. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/pr_agent_local.py +2 -0
  113. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/arena.py +2 -0
  114. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/show_thread.py +2 -0
  115. package/plugins/deepmodebot/skills/deepmodebot/assets/prompt-tools/prompt_tools.py +1239 -0
  116. package/plugins/deepmodebot/skills/deepmodebot/assets/quota-guard/quota_guard.py +424 -0
  117. package/plugins/deepmodebot/skills/deepmodebot/assets/repo-references.json +477 -1
  118. package/plugins/deepmodebot/skills/deepmodebot/assets/reward-guard/reward_guard.py +3447 -0
  119. package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rule-paths.json +100 -0
  120. package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rule_ledger.py +1671 -0
  121. package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rules_watch.py +436 -0
  122. package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_enrich.py +2 -0
  123. package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_meta.py +2 -0
  124. package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_transcript_relay.js +13 -10
  125. package/plugins/deepmodebot/skills/deepmodebot/assets/security-audit/static_sec_audit.py +275 -0
  126. package/plugins/deepmodebot/skills/deepmodebot/assets/self-grill/self_grill.py +2049 -0
  127. package/plugins/deepmodebot/skills/deepmodebot/assets/setup/model_setup.py +329 -0
  128. package/plugins/deepmodebot/skills/deepmodebot/assets/setup/project_setup.py +348 -0
  129. package/plugins/deepmodebot/skills/deepmodebot/assets/sim/sim.py +856 -0
  130. package/plugins/deepmodebot/skills/deepmodebot/assets/tournament/tournament.py +304 -18
  131. package/plugins/deepmodebot/skills/deepmodebot/assets/worker-gate/worker_gate.py +237 -0
  132. package/plugins/deepmodebot/skills/deepmodebot/assets/workspace-map/workspace_map.py +121 -78
  133. package/plugins/deepmodebot/skills/deepmodebot/references/README.md +14 -0
  134. package/plugins/deepmodebot/skills/deepmodebot/references/catalog.md +17 -11
  135. package/plugins/deepmodebot/skills/deepmodebot/references/contain.md +2 -1
  136. package/plugins/deepmodebot/skills/deepmodebot/references/delegation.md +18 -0
  137. package/plugins/deepmodebot/skills/deepmodebot/references/flows.md +2 -0
  138. package/plugins/deepmodebot/skills/deepmodebot/references/full-scope.md +9 -0
  139. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/authoring-a-skill.md +1 -1
  140. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/babysit.md +2 -0
  141. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/end-to-end.md +12 -9
  142. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/feature.md +7 -3
  143. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/hillclimb.md +3 -0
  144. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/investigation.md +4 -4
  145. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/opening-a-pr.md +1 -1
  146. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/perf-issue.md +13 -10
  147. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/refactoring.md +6 -6
  148. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/reference-rebuild.md +1 -0
  149. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/run-a-goal.md +3 -1
  150. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/self-authoring.md +1 -1
  151. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/setup.md +1 -2
  152. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/visual-parity.md +1 -0
  153. package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/work-a-queue.md +4 -2
  154. package/plugins/deepmodebot/skills/deepmodebot/references/principles/hardcore-mode.md +7 -0
  155. package/plugins/deepmodebot/skills/deepmodebot/references/principles/no-reward-hacking.md +8 -0
  156. package/plugins/deepmodebot/skills/deepmodebot/references/principles/test-behavior-not-implementation.md +2 -1
  157. package/plugins/deepmodebot/skills/deepmodebot/references/principles/type-system-discipline.md +2 -2
  158. package/plugins/deepmodebot/skills/deepmodebot/references/rule-approval.md +71 -0
  159. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/architect.md +10 -24
  160. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/architecture-review.md +5 -4
  161. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/arena.md +3 -3
  162. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/autoroute.md +50 -0
  163. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/blast-radius.md +1 -1
  164. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/catchup-video.md +13 -0
  165. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/correct.md +9 -7
  166. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/course.md +2 -1
  167. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/devex-review.md +13 -0
  168. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/expand-contract.md +13 -0
  169. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/formal-verification.md +33 -0
  170. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/gen-ui.md +60 -0
  171. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/grill.md +2 -1
  172. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/how.md +7 -18
  173. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/inner-loop.md +12 -8
  174. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/model-setup.md +14 -0
  175. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/modernize-pr.md +15 -0
  176. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/mutation-testing.md +35 -0
  177. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/no-comments.md +5 -5
  178. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/panel.md +9 -5
  179. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pr-conversation.md +1 -1
  180. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pr-review.md +8 -5
  181. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pre-commit.md +1 -2
  182. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/prior-art.md +33 -38
  183. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/product-lens.md +12 -0
  184. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/prompt-upgrade.md +30 -0
  185. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/recall.md +1 -1
  186. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/reframe.md +18 -0
  187. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/release-and-canary.md +10 -0
  188. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/research.md +62 -89
  189. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/security-audit.md +5 -1
  190. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/self-grill.md +54 -0
  191. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/sharpen.md +3 -3
  192. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/show-me-your-work.md +7 -0
  193. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/sim.md +41 -0
  194. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/sme-review.md +3 -2
  195. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/suggest.md +24 -0
  196. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/swarm.md +7 -0
  197. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/tdd.md +12 -0
  198. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/teach.md +2 -2
  199. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/tournament.md +30 -18
  200. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/variant-analysis.md +11 -0
  201. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/video-forensics.md +46 -0
  202. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/visual-e2e.md +10 -1
  203. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/webhook-ui.md +11 -0
  204. package/plugins/deepmodebot/skills/deepmodebot/references/techniques/writing-for-agents.md +6 -0
  205. package/plugins/deepmodebot/skills/deepmodebot/scripts/check_skill.py +7 -0
  206. package/plugins/deepmodebot/skills/deepmodebot/scripts/trending.py +141 -18
  207. package/plugins/deepmodebot/skills/deepmodebot/worker.md +28 -0
  208. package/plugins/deepmodebot/skills/domain-rules/SKILL.md +13 -119
  209. package/plugins/deepmodebot/skills/domain-rules/references/backend-system-design.md +19 -1
  210. package/plugins/deepmodebot/skills/domain-rules/references/engineering-practice.md +7 -0
  211. package/plugins/deepmodebot/skills/domain-rules/references/language-ecosystems.md +11 -0
  212. package/plugins/deepmodebot/skills/domain-rules/references/sources.md +108 -0
  213. package/plugins/deepmodebot/skills/frontend-ui/SKILL.md +30 -131
  214. package/plugins/deepmodebot/skills/frontend-ui/assets/themes/canvas.css +42 -0
  215. package/plugins/deepmodebot/skills/frontend-ui/assets/themes/editorial.css +39 -0
  216. package/plugins/deepmodebot/skills/frontend-ui/assets/themes/layouts.css +95 -0
  217. package/plugins/deepmodebot/skills/frontend-ui/assets/themes/swiss.css +40 -0
  218. package/plugins/deepmodebot/skills/frontend-ui/assets/themes/tactile.css +41 -0
  219. package/plugins/deepmodebot/skills/frontend-ui/assets/themes/workbench.css +50 -0
  220. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/mobbin-animations.md +49 -0
  221. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/mobbin-shipped-apps.md +46 -24
  222. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/motion-clips.md +27 -258
  223. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/motion-graphics.md +26 -51
  224. package/plugins/deepmodebot/skills/frontend-ui/references/patterns/pinterest-animations.md +22 -195
  225. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/00-art-direction.md +39 -0
  226. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/01-workflow.md +27 -24
  227. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/02-review-rubric.md +23 -17
  228. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/03-ai-tells.md +22 -45
  229. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/04-components.md +11 -0
  230. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/04a-agent-ui.md +32 -152
  231. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/05-motion.md +36 -91
  232. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/05a-motion-graphics.md +14 -120
  233. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06-typography-layout.md +11 -10
  234. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06a-color.md +9 -9
  235. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06b-media-icons-charts.md +19 -0
  236. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06c-product-shots-craft.md +42 -0
  237. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/07-copy.md +5 -6
  238. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/08-quality-floor.md +28 -56
  239. package/plugins/deepmodebot/skills/frontend-ui/references/playbook/09-steering-agents.md +9 -7
  240. package/plugins/deepmodebot/skills/frontend-ui/scripts/motion_diff.py +259 -0
  241. package/plugins/deepmodebot/skills/frontend-ui/scripts/ui_audit.py +496 -0
  242. package/plugins/deepmodebot/skills/maintain-formal-verification-skill/LICENSE +21 -0
  243. package/plugins/deepmodebot/skills/maintain-formal-verification-skill/NOTICE.md +16 -0
  244. package/plugins/deepmodebot/skills/maintain-formal-verification-skill/SKILL.md +68 -0
  245. package/plugins/deepmodebot/skills/maintain-verification-skill/SKILL.md +1 -1
  246. package/plugins/deepmodebot/skills/office-documents/SKILL.md +24 -0
  247. package/plugins/deepmodebot/skills/office-documents/references/documents-docx-pdf.md +15 -0
  248. package/plugins/deepmodebot/skills/office-documents/references/presentations-pptx.md +15 -0
  249. package/plugins/deepmodebot/skills/office-documents/references/spreadsheets-xlsx.md +15 -0
  250. package/plugins/deepmodebot/skills/office-documents/scripts/doc_audit.py +230 -0
  251. package/plugins/deepmodebot/skills/project-brief/SKILL.md +2 -19
  252. package/plugins/deepmodebot/skills/project-brief/assets/pr-overlap.py +4 -0
  253. package/plugins/deepmodebot/skills/project-brief/assets/sync-roadmap.py +4 -0
  254. package/plugins/deepmodebot/skills/project-brief/references/claim-contract.md +55 -0
  255. package/plugins/deepmodebot/skills/research/SKILL.md +18 -0
  256. package/plugins/deepmodebot/skills/secrets-and-auth/SKILL.md +1 -1
  257. package/plugins/deepmodebot/skills/seo-and-geo/SKILL.md +29 -0
  258. package/plugins/deepmodebot/skills/seo-and-geo/references/geo-and-agentic-web.md +30 -0
  259. package/plugins/deepmodebot/skills/seo-and-geo/references/technical-and-schema.md +25 -0
  260. package/plugins/deepmodebot/skills/seo-and-geo/scripts/seo_audit.py +282 -0
  261. package/plugins/deepmodebot/skills/software-architecture/SKILL.md +2 -2
  262. package/plugins/deepmodebot/skills/software-architecture/references/backend-infrastructure.md +5 -0
  263. package/plugins/deepmodebot/skills/software-architecture/references/monorepos.md +1 -0
  264. package/plugins/deepmodebot/skills/statechart/LICENSE +21 -0
  265. package/plugins/deepmodebot/skills/statechart/NOTICE.md +21 -0
  266. package/plugins/deepmodebot/skills/statechart/SKILL.md +106 -0
  267. package/plugins/deepmodebot/skills/statechart/references/render.md +93 -0
  268. package/plugins/deepmodebot/skills/statechart/references/tooling.md +78 -0
  269. package/plugins/deepmodebot/skills/statechart/scripts/backends/cfg.ts +33 -0
  270. package/plugins/deepmodebot/skills/statechart/scripts/backends/mermaid.ts +249 -0
  271. package/plugins/deepmodebot/skills/statechart/scripts/backends/plain-text.ts +72 -0
  272. package/plugins/deepmodebot/skills/statechart/scripts/backends/report.ts +177 -0
  273. package/plugins/deepmodebot/skills/statechart/scripts/frontends/config.ts +276 -0
  274. package/plugins/deepmodebot/skills/statechart/scripts/frontends/dot.ts +77 -0
  275. package/plugins/deepmodebot/skills/statechart/scripts/frontends/marks.ts +93 -0
  276. package/plugins/deepmodebot/skills/statechart/scripts/frontends/messages.ts +52 -0
  277. package/plugins/deepmodebot/skills/statechart/scripts/frontends/spec.ts +114 -0
  278. package/plugins/deepmodebot/skills/statechart/scripts/frontends/trace.ts +24 -0
  279. package/plugins/deepmodebot/skills/statechart/scripts/frontends/value.ts +166 -0
  280. package/plugins/deepmodebot/skills/statechart/scripts/frontends/verdict.ts +40 -0
  281. package/plugins/deepmodebot/skills/statechart/scripts/frontends/view.ts +119 -0
  282. package/plugins/deepmodebot/skills/statechart/scripts/ir.ts +547 -0
  283. package/plugins/deepmodebot/skills/statechart/scripts/janitor.ts +13 -0
  284. package/plugins/deepmodebot/skills/statechart/scripts/kill.ts +15 -0
  285. package/plugins/deepmodebot/skills/statechart/scripts/package.json +11 -0
  286. package/plugins/deepmodebot/skills/statechart/scripts/passes/annotate.ts +128 -0
  287. package/plugins/deepmodebot/skills/statechart/scripts/passes/label.ts +269 -0
  288. package/plugins/deepmodebot/skills/statechart/scripts/passes/lift.ts +85 -0
  289. package/plugins/deepmodebot/skills/statechart/scripts/passes/loop-check.ts +68 -0
  290. package/plugins/deepmodebot/skills/statechart/scripts/passes/paths.ts +60 -0
  291. package/plugins/deepmodebot/skills/statechart/scripts/passes/reach.ts +135 -0
  292. package/plugins/deepmodebot/skills/statechart/scripts/passes/region-check.ts +97 -0
  293. package/plugins/deepmodebot/skills/statechart/scripts/passes/regions.ts +295 -0
  294. package/plugins/deepmodebot/skills/statechart/scripts/pipeline.ts +76 -0
  295. package/plugins/deepmodebot/skills/statechart/scripts/run.ts +500 -0
  296. package/plugins/deepmodebot/skills/statechart/scripts/statechart +29 -0
  297. package/plugins/deepmodebot/skills/statechart/scripts/statechart.ts +165 -0
  298. package/plugins/deepmodebot/skills/statechart/scripts/test/ConfigOracle.java +63 -0
  299. package/plugins/deepmodebot/skills/statechart/scripts/test/chart.test.ts +1253 -0
  300. package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Braces.mmd +7 -0
  301. package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Escapes.mmd +11 -0
  302. package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Phases.mmd +29 -0
  303. package/plugins/deepmodebot/skills/statechart/scripts/test/cli.test.ts +1344 -0
  304. package/plugins/deepmodebot/skills/statechart/scripts/test/config-fuzz.test.ts +263 -0
  305. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/ChartRun.out +57 -0
  306. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/Counter.cfg +3 -0
  307. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/Counter.tla +10 -0
  308. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/chart.mmd +9 -0
  309. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/graph.dot +16 -0
  310. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/report.md +7 -0
  311. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/sany.out +2 -0
  312. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/verdict-1.out +49 -0
  313. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/ChartRun.out +60 -0
  314. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.cfg +4 -0
  315. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.tla +22 -0
  316. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/chart.mmd +26 -0
  317. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/graph.dot +19 -0
  318. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/report.md +20 -0
  319. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/sany.out +2 -0
  320. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.exit +1 -0
  321. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.out +56 -0
  322. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.exit +1 -0
  323. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.out +82 -0
  324. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-3.out +57 -0
  325. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/ChartRun.out +59 -0
  326. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.cfg +3 -0
  327. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.tla +11 -0
  328. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/chart.mmd +22 -0
  329. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/graph.dot +16 -0
  330. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/report.md +17 -0
  331. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/sany.out +2 -0
  332. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.exit +1 -0
  333. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.out +56 -0
  334. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.exit +1 -0
  335. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.out +77 -0
  336. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/ChartRun.out +69 -0
  337. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.cfg +2 -0
  338. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.tla +11 -0
  339. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/chart.mmd +85 -0
  340. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/graph.dot +70 -0
  341. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/report.md +12 -0
  342. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/sany.out +2 -0
  343. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.exit +1 -0
  344. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.out +67 -0
  345. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-2.out +57 -0
  346. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.exit +1 -0
  347. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.out +85 -0
  348. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.cfg +6 -0
  349. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.tla +13 -0
  350. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/chart.mmd +5 -0
  351. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/graph.dot +10 -0
  352. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/report.md +31 -0
  353. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/sany.out +2 -0
  354. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.exit +1 -0
  355. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.out +64 -0
  356. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.exit +1 -0
  357. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.out +77 -0
  358. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/ChartRun.out +55 -0
  359. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.cfg +3 -0
  360. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.tla +10 -0
  361. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/chart.mmd +12 -0
  362. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/graph.dot +6 -0
  363. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/report.md +12 -0
  364. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/sany.out +2 -0
  365. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.exit +1 -0
  366. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.out +33 -0
  367. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-2.out +54 -0
  368. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/ChartRun.out +54 -0
  369. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.cfg +3 -0
  370. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.tla +10 -0
  371. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/chart.mmd +1 -0
  372. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/graph.dot +6 -0
  373. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/report.md +7 -0
  374. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/sany.out +2 -0
  375. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/verdict-1.out +46 -0
  376. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/ChartRun.out +59 -0
  377. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.cfg +2 -0
  378. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.tla +10 -0
  379. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterSteps.tla +6 -0
  380. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/chart.mmd +17 -0
  381. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/graph.dot +15 -0
  382. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/report.md +14 -0
  383. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/sany.out +3 -0
  384. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.exit +1 -0
  385. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.out +78 -0
  386. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/ChartRun.out +59 -0
  387. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.cfg +3 -0
  388. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.tla +19 -0
  389. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/chart.mmd +26 -0
  390. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/graph.dot +22 -0
  391. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/report.md +12 -0
  392. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/sany.out +2 -0
  393. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.exit +1 -0
  394. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.out +58 -0
  395. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-2.out +57 -0
  396. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/ChartRun.out +57 -0
  397. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.cfg +2 -0
  398. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.tla +11 -0
  399. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/chart.mmd +17 -0
  400. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/graph.dot +15 -0
  401. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/report.md +14 -0
  402. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/sany.out +2 -0
  403. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.exit +1 -0
  404. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.out +76 -0
  405. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/ChartRun.out +59 -0
  406. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.cfg +3 -0
  407. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.tla +11 -0
  408. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/chart.mmd +19 -0
  409. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/graph.dot +10 -0
  410. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/report.md +15 -0
  411. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/sany.out +2 -0
  412. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.exit +1 -0
  413. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.out +56 -0
  414. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.exit +1 -0
  415. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.out +67 -0
  416. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/ChartRun.out +62 -0
  417. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.cfg +6 -0
  418. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.tla +24 -0
  419. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/Moves.tla +5 -0
  420. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/chart.mmd +22 -0
  421. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/graph.dot +10 -0
  422. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/report.md +23 -0
  423. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/sany.out +3 -0
  424. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.exit +1 -0
  425. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.out +58 -0
  426. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.exit +1 -0
  427. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.out +66 -0
  428. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.exit +1 -0
  429. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.out +74 -0
  430. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-4.out +59 -0
  431. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/ChartRun.out +58 -0
  432. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.cfg +3 -0
  433. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.tla +15 -0
  434. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/chart.mmd +18 -0
  435. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/graph.dot +13 -0
  436. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/report.md +11 -0
  437. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/sany.out +2 -0
  438. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.exit +1 -0
  439. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.out +33 -0
  440. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-2.out +57 -0
  441. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/ChartRun.out +57 -0
  442. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.cfg +3 -0
  443. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.tla +15 -0
  444. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/chart.mmd +7 -0
  445. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/graph.dot +13 -0
  446. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/report.md +6 -0
  447. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/sany.out +2 -0
  448. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/verdict-1.out +49 -0
  449. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/ChartRun.out +61 -0
  450. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.cfg +4 -0
  451. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.tla +14 -0
  452. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/chart.mmd +30 -0
  453. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/graph.dot +19 -0
  454. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/report.md +27 -0
  455. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/sany.out +2 -0
  456. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.exit +1 -0
  457. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.out +56 -0
  458. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.exit +1 -0
  459. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.out +64 -0
  460. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.exit +1 -0
  461. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.out +87 -0
  462. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-4.out +57 -0
  463. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/ChartRun.out +60 -0
  464. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.cfg +3 -0
  465. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.tla +12 -0
  466. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/chart.mmd +23 -0
  467. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/graph.dot +19 -0
  468. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/report.md +11 -0
  469. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/sany.out +2 -0
  470. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.exit +1 -0
  471. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.out +56 -0
  472. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-2.out +57 -0
  473. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/ChartRun.out +61 -0
  474. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/CounterView.cfg +4 -0
  475. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/CounterView.tla +14 -0
  476. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/chart.mmd +23 -0
  477. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/graph.dot +19 -0
  478. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/report.md +27 -0
  479. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/sany.out +2 -0
  480. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-1.exit +1 -0
  481. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-1.out +56 -0
  482. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-2.exit +1 -0
  483. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-2.out +64 -0
  484. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-3.exit +1 -0
  485. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-3.out +87 -0
  486. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-4.out +57 -0
  487. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/view.mjs +1 -0
  488. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/ChartRun.out +59 -0
  489. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/DieHard.cfg +4 -0
  490. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/DieHard.tla +38 -0
  491. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/chart.mmd +92 -0
  492. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/graph.dot +126 -0
  493. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/report.md +17 -0
  494. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/sany.out +2 -0
  495. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-1.exit +1 -0
  496. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-1.out +91 -0
  497. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-2.out +57 -0
  498. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/ChartRun.out +61 -0
  499. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.cfg +6 -0
  500. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.tla +11 -0
  501. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/chart.mmd +22 -0
  502. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/graph.dot +16 -0
  503. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/report.md +25 -0
  504. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/sany.out +2 -0
  505. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.exit +1 -0
  506. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.out +56 -0
  507. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.exit +1 -0
  508. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.out +64 -0
  509. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.exit +1 -0
  510. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.out +64 -0
  511. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.exit +1 -0
  512. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.out +77 -0
  513. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/ChartRun.out +57 -0
  514. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.cfg +4 -0
  515. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.tla +11 -0
  516. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/chart.mmd +13 -0
  517. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/graph.dot +12 -0
  518. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/report.md +11 -0
  519. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/sany.out +2 -0
  520. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.exit +1 -0
  521. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.out +72 -0
  522. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/ChartRun.out +57 -0
  523. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/Login.cfg +3 -0
  524. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/Login.tla +62 -0
  525. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/chart.mmd +28 -0
  526. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/graph.dot +40 -0
  527. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/report.md +7 -0
  528. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/sany.out +1 -0
  529. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/verdict-1.out +47 -0
  530. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/view.mjs +1 -0
  531. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/ChartRun.out +57 -0
  532. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.cfg +2 -0
  533. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.tla +64 -0
  534. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/chart.mmd +28 -0
  535. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/graph.dot +37 -0
  536. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/report.md +8 -0
  537. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/sany.out +1 -0
  538. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/verdict-1.out +47 -0
  539. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/view.mjs +1 -0
  540. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/ChartRun.out +60 -0
  541. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.cfg +3 -0
  542. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.tla +64 -0
  543. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/chart.mmd +44 -0
  544. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/graph.dot +58 -0
  545. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/report.md +17 -0
  546. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/sany.out +1 -0
  547. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.exit +1 -0
  548. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.out +83 -0
  549. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-2.out +57 -0
  550. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/view.mjs +1 -0
  551. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/ChartRun.out +60 -0
  552. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.cfg +3 -0
  553. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.tla +103 -0
  554. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/chart.mmd +43 -0
  555. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/graph.dot +93 -0
  556. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/report.md +14 -0
  557. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/sany.out +1 -0
  558. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.exit +1 -0
  559. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.out +59 -0
  560. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-2.out +72 -0
  561. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/view.mjs +3 -0
  562. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/ChartRun.out +57 -0
  563. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.cfg +2 -0
  564. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.tla +100 -0
  565. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/chart.mmd +31 -0
  566. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/graph.dot +85 -0
  567. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/report.md +9 -0
  568. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/sany.out +1 -0
  569. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/verdict-1.out +47 -0
  570. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/view.mjs +3 -0
  571. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/ChartRun.out +59 -0
  572. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayer.tla +103 -0
  573. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.cfg +3 -0
  574. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.tla +6 -0
  575. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/chart.mmd +42 -0
  576. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/graph.dot +93 -0
  577. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/report.md +19 -0
  578. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/sany.out +2 -0
  579. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.exit +1 -0
  580. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.out +61 -0
  581. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-2.out +59 -0
  582. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-3.out +61 -0
  583. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.exit +1 -0
  584. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.out +66 -0
  585. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.exit +1 -0
  586. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.out +58 -0
  587. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-6.out +49 -0
  588. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/view.mjs +3 -0
  589. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/ChartRun.out +57 -0
  590. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.cfg +6 -0
  591. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.tla +11 -0
  592. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/chart.mmd +5 -0
  593. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/graph.dot +11 -0
  594. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/report.md +7 -0
  595. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/sany.out +5 -0
  596. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/verdict-1.out +70 -0
  597. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ChartRun.out +61 -0
  598. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/Shadow.cfg +4 -0
  599. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/Shadow.tla +11 -0
  600. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ShadowLib.tla +6 -0
  601. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ShadowSub.tla +3 -0
  602. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/chart.mmd +9 -0
  603. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/graph.dot +16 -0
  604. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/report.md +8 -0
  605. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/sany.out +4 -0
  606. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/verdict-1.out +65 -0
  607. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/ChartRun.out +59 -0
  608. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.cfg +2 -0
  609. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.tla +9 -0
  610. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/chart.mmd +23 -0
  611. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/graph.dot +17 -0
  612. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/report.md +15 -0
  613. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/sany.out +1 -0
  614. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.exit +1 -0
  615. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.out +65 -0
  616. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.exit +1 -0
  617. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.out +75 -0
  618. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/ChartRun.out +69 -0
  619. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.cfg +3 -0
  620. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.tla +75 -0
  621. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/chart.mmd +60 -0
  622. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/graph.dot +297 -0
  623. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/report.md +20 -0
  624. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/sany.out +1 -0
  625. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.exit +1 -0
  626. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.out +95 -0
  627. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-2.out +57 -0
  628. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/view.mjs +1 -0
  629. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/ChartRun.out +57 -0
  630. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.cfg +3 -0
  631. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.tla +75 -0
  632. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/chart.mmd +37 -0
  633. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/graph.dot +223 -0
  634. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/report.md +11 -0
  635. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/sany.out +1 -0
  636. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/verdict-1.out +47 -0
  637. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/view.mjs +1 -0
  638. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.exit +1 -0
  639. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.out +75 -0
  640. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.cfg +5 -0
  641. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.tla +11 -0
  642. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/chart.mmd +18 -0
  643. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/graph.dot +14 -0
  644. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/report.md +29 -0
  645. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/sany.out +2 -0
  646. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.exit +1 -0
  647. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.out +64 -0
  648. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.exit +1 -0
  649. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.out +75 -0
  650. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/ChartRun.out +58 -0
  651. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.cfg +2 -0
  652. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.tla +8 -0
  653. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/chart.mmd +22 -0
  654. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/graph.dot +16 -0
  655. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/report.md +15 -0
  656. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/sany.out +2 -0
  657. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.exit +1 -0
  658. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.out +56 -0
  659. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.exit +1 -0
  660. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.out +77 -0
  661. package/plugins/deepmodebot/skills/statechart/scripts/test/corpus.test.ts +441 -0
  662. package/plugins/deepmodebot/skills/statechart/scripts/test/differential.test.ts +565 -0
  663. package/plugins/deepmodebot/skills/statechart/scripts/test/drawn.ts +20 -0
  664. package/plugins/deepmodebot/skills/statechart/scripts/test/grid/Grid.cfg +2 -0
  665. package/plugins/deepmodebot/skills/statechart/scripts/test/grid/Grid.tla +9 -0
  666. package/plugins/deepmodebot/skills/statechart/scripts/test/grid/sany.out +2 -0
  667. package/plugins/deepmodebot/skills/statechart/scripts/test/java.ts +63 -0
  668. package/plugins/deepmodebot/skills/statechart/scripts/test/labels.ts +648 -0
  669. package/plugins/deepmodebot/skills/statechart/scripts/test/messages.test.ts +226 -0
  670. package/plugins/deepmodebot/skills/statechart/scripts/test/pipeline.test.ts +270 -0
  671. package/plugins/deepmodebot/skills/statechart/scripts/test/plain-tlc.test.ts +255 -0
  672. package/plugins/deepmodebot/skills/statechart/scripts/test/render.test.ts +145 -0
  673. package/plugins/deepmodebot/skills/statechart/scripts/test/tlc-out.test.ts +90 -0
  674. package/plugins/deepmodebot/skills/statechart/scripts/test/tlc.ts +158 -0
  675. package/plugins/deepmodebot/skills/statechart/scripts/tsconfig.json +11 -0
  676. package/plugins/deepmodebot/skills/statechart/scripts/worker.ts +35 -0
  677. package/plugins/deepmodebot/agents/reviewer/agent.md +0 -33
  678. package/plugins/deepmodebot/agents/scout/agent.md +0 -34
  679. package/plugins/deepmodebot/agents/security-reviewer/agent.md +0 -30
  680. package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/bun.lock +0 -391
  681. package/plugins/deepmodebot/skills/deepmodebot/assets/agents-md/test_agents_md.py +0 -146
  682. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_antigravity_guard.py +0 -483
  683. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_audit_regressions.py +0 -139
  684. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_contain.py +0 -301
  685. package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_omp_mcp.py +0 -602
  686. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_design.py +0 -69
  687. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_evidence.py +0 -160
  688. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_record.py +0 -180
  689. package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_review.py +0 -265
  690. package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/test_git_guard.py +0 -192
  691. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_bot.py +0 -2182
  692. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_brand.py +0 -19
  693. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_local_updates.py +0 -691
  694. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_review_context.py +0 -127
  695. package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_workspace_cleanup.py +0 -496
  696. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_loop.py +0 -1426
  697. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_plan.py +0 -320
  698. package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_windows_job.py +0 -326
  699. package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/test_bench_harness.py +0 -55
  700. package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/test_perf_audit.py +0 -53
  701. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/test_diff_coverage.py +0 -94
  702. package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/test_arena.py +0 -610
  703. package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/test_yt_enrich.py +0 -250
  704. package/plugins/deepmodebot/skills/deepmodebot/assets/tournament/test_tournament.py +0 -654
  705. package/plugins/deepmodebot/skills/deepmodebot/assets/workspace-map/test_workspace_map.py +0 -879
@@ -4,27 +4,125 @@
4
4
  // Roots = the worktree holding the session cwd plus its main checkout (they differ in a linked worktree, e.g. one
5
5
  // under <root>/.worktrees/ or an Orca workspace), or the cwd outside git. Also allowed: omp session resources
6
6
  // (local://, artifact://, agent://, proc://, xd://, out://, conflict://, cfg://) and `extraWriteRoots` in a root's
7
- // .deepmodebot.json (only paths the user named). bash and eval are not covered.
7
+ // .deepmodebot.json (only paths the user named). Shell and eval get reward-hacking checks, not path containment.
8
+ // Every tool call (read, grep, glob, find, shell, eval, writes) that reaches the hidden holdout store (~/.deepmodebot-holdout
9
+ // in any spelling) or mines git answers (cat-file --batch-all-objects, fsck, reflog recovery, raw .git/objects reads,
10
+ // sweeps of / ~ /tmp for tests) is blocked with the anti-reward-hacking message.
11
+ // Rule approval (../rules/rule_ledger.py): in a repo whose owner turned it on, and for the user-level agent rules
12
+ // (~/.omp/agent hooks and skills, ~/.claude settings, ...) once the owner ran `deepmodebot rules init --user`,
13
+ // write/edit/ast_edit on agent rule files or the ledger are blocked, and so are bash commands that write them; the
14
+ // owner-only `rules init|approve|reject` commands are blocked everywhere. Rule approval blocks notify the owner;
15
+ // session_start shows the owner any rule changes they have not approved (../rules/rules_watch.py).
8
16
  import { execFileSync } from "node:child_process";
9
17
  import * as fs from "node:fs";
10
18
  import * as os from "node:os";
11
19
  import * as path from "node:path";
20
+ import { fileURLToPath } from "node:url";
12
21
 
13
22
  const WRITE_TOOLS: Record<string, true> = { write: true, edit: true, ast_edit: true };
14
23
  const SESSION_URL = /^(local|artifact|agent|proc|xd|out|conflict|cfg):\/\//i;
15
24
  const HEADER = /^\[(.+)#[0-9A-Za-z]+\]$/; // a copied [path#TAG] header: omp strips the wrapper before writing
25
+ const EDIT_TAG = /#[0-9A-Za-z]{4}$/; // the hashline edit tool reports its target as `path#TAG`
16
26
  const ANY_URL = /^[a-z][a-z0-9+.-]*:\/\//i;
17
27
  const caseless = process.platform === "win32" || process.platform === "darwin";
28
+ const RULES_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "rules");
29
+ const RULE_LEDGER = path.join(RULES_DIR, "rule_ledger.py");
30
+ const RULES_WATCH = path.join(RULES_DIR, "rules_watch.py");
31
+ const LEDGER_REL = path.join(".deepmodebot", "rules", "ledger.json");
32
+ const PYTHONS: [string, string[]][] =
33
+ process.platform === "win32"
34
+ ? [["py", ["-3", "-B"]], ["python3", ["-B"]], ["python", ["-B"]]]
35
+ : [["python3", ["-B"]], ["python", ["-B"]]];
36
+ const RULES = loadRuleSpec();
37
+ const OVERHEAD_AGENTS: Record<string, true> = {
38
+ scout: true, researcher: true, reviewer: true, "security-reviewer": true, "comment-sicko": true,
39
+ };
40
+ const NESTED_REASON = "deepmodebot anti-stacking guard: nested subagent spawning is blocked (max_subagents=0); execute inline or include ALLOW_NESTED_SUBAGENTS when explicitly authorized.";
41
+ const METRIC_FLOORS: Record<string, number> = {
42
+ iou: 0.5, ssim: 0.5, dice: 0.5, f1: 0.5, auc: 0.5,
43
+ accuracy: 0.5, acc: 0.5, precision: 0.5, recall: 0.5,
44
+ fidelity: 0.5, similarity: 0.5, coverage: 0.5, "pass-rate": 0.5, "win-rate": 0.5,
45
+ clip: 0.15, "clip-score": 0.15, ap: 0.15, map: 0.15, bleu: 0.15, rouge: 0.15,
46
+ psnr: 10.0, protrusion: 0.02, score: 0.05, confidence: 0.05, symmetry: 0.05,
47
+ "cov-fail-under": 50.0,
48
+ };
49
+ const MIN_FLAG_VAL_RE =
50
+ /(?:^|[\s;&|(])(['"]?--(?:(?:gate-)?mi(?:n(?:-([a-z0-9_-]*))?)?|(cov-fail-under))['"]?(?:\s+|=)['"]?\s*([-+]?(?:inf(?:inity)?|nan|(?:\d[\d_]*\.?[\d_]*|\.[\d_]+)(?:e[-+]?[\d_]+)?))\s*['"]?)(?=$|[\s;&|)])/gi;
51
+ const REWARD_HACK_CMD_RE = new RegExp(
52
+ [
53
+ String.raw`(?:^|[\s;&|(])['"]?--(?:skip-reference|skip-fidelity|skip-gates?|skip-verify|skip-validation|bypass-gate|pass-if-no-tests|passWithNoTests|no-cov|(?:update-snapshots|snapshot-update|overwrite-snapshots|updateSnapshot)(?:=[^\s;&|)'"]+)?)['"]?(?=$|[\s;&|)])`,
54
+ String.raw`(?:^|[\s;&|(])['"]?(?:--require-spark-receipt(?:\s+|=)['"]?false|--gate-mode(?:\s+|=)['"]?off|--measured-gates(?:\s+|=)['"]?off|--check-360(?:\s+|=)['"]?(?:false|0))['"]?(?=$|[\s;&|)])`,
55
+ String.raw`(?:^|[\s;&|(])(?:(?:jest|vitest|playwright\s+test)\b[^\n;&|]*\s['"]?(?:-u|--update)['"]?|cargo\b[^\n;&|]*\sinsta\s+accept|(?:UPDATE_SNAPSHOTS|SNAPSHOT_UPDATE|INSTA_UPDATE)=['"]?(?:1|true|always|all)['"]?|go\s+test\b[^\n;&|]*\s-run(?:=|\s+)['"]?\^\$['"]?)(?=$|[\s;&|)])`,
56
+ String.raw`\bgit\b[^\n;&|]*\bcommit\b[^\n;&|]*\s['"]?(?:-n|--no-verify)['"]?(?=$|[\s;&|)])`,
57
+ String.raw`\b(?:reward-guard\.db|contract-lock\.json|judge_verdicts)\b`,
58
+ String.raw`\breward_guard\.py\b[^\n;&|]*\brecord-judge\b`,
59
+ ].join("|"),
60
+ "i",
61
+ );
62
+
63
+ function minFlagFloor(rawTok: string | undefined): number | null {
64
+ const tok = (rawTok ?? "").toLowerCase().replace(/_/g, "-");
65
+ if (!tok) return 0.5;
66
+ if (tok === "p" || tok === "k" || tok === "port" || tok === "ports") return null;
67
+ if (Object.hasOwn(METRIC_FLOORS, tok)) return METRIC_FLOORS[tok];
68
+ const matches = Object.entries(METRIC_FLOORS)
69
+ .filter(([k]) => k.startsWith(tok))
70
+ .map(([, v]) => v);
71
+ return matches.length ? Math.max(...matches) : null;
72
+ }
73
+
74
+ function parseGuardFloat(raw: string): number {
75
+ const c = String(raw).trim().replace(/_/g, "");
76
+ if (/^[-+]?inf(?:inity)?$/i.test(c)) return c.startsWith("-") ? -Infinity : Infinity;
77
+ if (/^[-+]?nan$/i.test(c)) return NaN;
78
+ return Number(c);
79
+ }
80
+
81
+ function findShellRewardHack(rawCmd: unknown): string | null {
82
+ const cleaned = String(rawCmd ?? "").replace(/(-m|--message)(=|\s+)("[^"]*"|'[^']*')/g, '$1 ""');
83
+ for (const rawLine of cleaned.replace(/\\\r?\n/g, " ").split(/\r?\n/)) {
84
+ const line = rawLine.trim();
85
+ if (!line || /^(?:grep|rg|echo|printf)\s+[^;&|<>()`$]*$/.test(line)) continue;
86
+ MIN_FLAG_VAL_RE.lastIndex = 0;
87
+ let fm: RegExpExecArray | null;
88
+ while ((fm = MIN_FLAG_VAL_RE.exec(line)) !== null) {
89
+ const floor = minFlagFloor(fm[3] || fm[2]);
90
+ const val = parseGuardFloat(fm[4]);
91
+ if (floor !== null && (!Number.isFinite(val) || val < floor)) return fm[1].trim();
92
+ }
93
+ const m = REWARD_HACK_CMD_RE.exec(line);
94
+ if (m) return m[0].trim();
95
+ }
96
+ return null;
97
+ }
98
+
99
+ function nestedSpawn(): boolean {
100
+ const { TEAMWORK_RUN_ID, SWARM_ID, DEEPMODEBOT_SUBAGENT_DEPTH, DEEPMODEBOT_MAX_SUBAGENTS } = process.env;
101
+ return Boolean(TEAMWORK_RUN_ID || SWARM_ID || (DEEPMODEBOT_SUBAGENT_DEPTH && DEEPMODEBOT_SUBAGENT_DEPTH !== "0")
102
+ || DEEPMODEBOT_MAX_SUBAGENTS === "0");
103
+ }
18
104
 
19
105
  interface ToolCallEvent {
20
106
  toolName: string;
21
107
  input?: Record<string, unknown>;
22
108
  }
23
109
 
24
- type ToolCallResult = { block: true; reason: string } | undefined;
110
+ type Block = { block: true; reason: string };
111
+ type ToolCallResult = Block | { input: Record<string, unknown> } | undefined;
112
+
113
+ interface HookContext {
114
+ cwd?: string;
115
+ ui?: { notify?(message: string, type?: string): void; setStatus?(key: string, text: string | undefined): void };
116
+ }
25
117
 
26
118
  interface HookApi {
27
119
  on(event: "tool_call", handler: (event: ToolCallEvent, ctx: { cwd?: string }) => Promise<ToolCallResult>): void;
120
+ on(event: "session_start", handler: (event: unknown, ctx: HookContext) => Promise<void>): void;
121
+ on(
122
+ event: "before_subagent_spawn",
123
+ handler: (event: { agent: string; modelRole?: string; patterns?: string[] }) =>
124
+ Promise<{ model?: string | string[]; block?: boolean; reason?: string; note?: string } | undefined>,
125
+ ): void;
28
126
  }
29
127
 
30
128
  // Absolute form of a path as omp would open it: `~` is the home folder, anything relative hangs off cwd.
@@ -33,16 +131,16 @@ function absolute(p: string, cwd: string): string {
33
131
  return path.resolve(cwd, expanded);
34
132
  }
35
133
 
36
- function real(p: string): string {
134
+ function real(p: string, fold = caseless): string {
37
135
  let resolved = path.resolve(p);
38
136
  try {
39
137
  resolved = fs.realpathSync.native(resolved);
40
138
  } catch {
41
139
  // Target may not exist yet; resolve its nearest existing parent so symlinked parents still count.
42
140
  const parent = path.dirname(resolved);
43
- if (parent !== resolved) resolved = path.join(real(parent), path.basename(resolved));
141
+ if (parent !== resolved) resolved = path.join(real(parent, fold), path.basename(resolved));
44
142
  }
45
- return caseless ? resolved.toLowerCase() : resolved;
143
+ return fold ? resolved.toLowerCase() : resolved;
46
144
  }
47
145
 
48
146
  function inside(p: string, root: string): boolean {
@@ -52,6 +150,62 @@ function inside(p: string, root: string): boolean {
52
150
  return !path.isAbsolute(rel);
53
151
  }
54
152
 
153
+ function escapeRegex(text: string): string {
154
+ return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
155
+ }
156
+
157
+ function compileOwnedGlob(value: unknown): RegExp {
158
+ if (typeof value !== "string") throw new Error("owned_globs entries must be strings");
159
+ const glob = value.trim().replace(/\\/g, "/").replace(/\/+$/, "");
160
+ const parts = glob.split("/");
161
+ if (/^[a-z]:/i.test(glob) || glob.includes("\0") || parts.some(p => !p || p === "." || p === "..")) {
162
+ throw new Error("owned_globs must contain only repo-relative glob patterns");
163
+ }
164
+ const expr = /[*?]/.test(glob)
165
+ ? parts.map(part => part === "**" ? "(?:/[^/]+)*"
166
+ : "/" + Array.from(part, c => c === "*" ? "[^/]*" : c === "?" ? "[^/]" : escapeRegex(c)).join("")).join("")
167
+ : "/" + escapeRegex(glob) + "(?:/[\\s\\S]*)?";
168
+ return new RegExp("^" + expr + "(?![\\s\\S])", process.platform === "win32" ? "iu" : "u");
169
+ }
170
+
171
+ function sliceWriteBlock(root: string, cwd: string, paths: string[]): Block | undefined {
172
+ const worker = process.env.DEEPMODEBOT_WORKER_ID;
173
+ if (!worker) return;
174
+ if (!/^[A-Za-z0-9._-]+(?![\s\S])/.test(worker)) return { block: true, reason: "deepmodebot: invalid worker ID" };
175
+ const slicePath = path.join(root, ".scratch", "slices", `${worker}.json`);
176
+ let manifest: unknown;
177
+ try {
178
+ manifest = JSON.parse(fs.readFileSync(slicePath, "utf8"));
179
+ } catch (error) {
180
+ if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") return;
181
+ return { block: true, reason: `deepmodebot: cannot read slice manifest ${slicePath}: ${String(error)}` };
182
+ }
183
+ try {
184
+ if (!manifest || typeof manifest !== "object" || !("schema_version" in manifest) || manifest.schema_version !== 1
185
+ || !("worker_id" in manifest) || manifest.worker_id !== worker
186
+ || !("build_owner" in manifest) || typeof manifest.build_owner !== "boolean"
187
+ || !("owned_globs" in manifest) || !Array.isArray(manifest.owned_globs) || !manifest.owned_globs.length) {
188
+ throw new Error("invalid slice manifest");
189
+ }
190
+ const globs = manifest.owned_globs.map(compileOwnedGlob);
191
+ const permits = (base: string, candidate: string) => {
192
+ if (!inside(candidate, base)) return false;
193
+ const rel = path.relative(base, candidate).split(path.sep).join("/");
194
+ const scratch = process.platform === "win32" ? rel.toLowerCase() : rel;
195
+ return scratch === ".scratch" || scratch.startsWith(".scratch/") || globs.some(glob => glob.test("/" + rel));
196
+ };
197
+ const realRoot = real(root, false);
198
+ for (const target of paths) {
199
+ const abs = absolute(target, cwd);
200
+ if (ANY_URL.test(target) || !permits(root, abs) || !permits(realRoot, real(abs, false))) {
201
+ return { block: true, reason: `deepmodebot: ${target} is outside the owned slice for ${worker}` };
202
+ }
203
+ }
204
+ } catch (error) {
205
+ return { block: true, reason: `deepmodebot: invalid slice manifest ${slicePath}: ${String(error)}` };
206
+ }
207
+ }
208
+
55
209
  // The worktree holding cwd first, then the main checkout.
56
210
  function projectRoots(cwd: string): string[] {
57
211
  try {
@@ -88,17 +242,715 @@ function targets(input: Record<string, unknown>): string[] {
88
242
  const out: string[] = [];
89
243
  if (typeof input.path === "string") out.push(input.path);
90
244
  if (Array.isArray(input.paths)) for (const p of input.paths) if (typeof p === "string") out.push(p);
91
- return out.map(p => HEADER.exec(p.trim())?.[1] ?? p.trim()).filter(p => p.length > 0 && !SESSION_URL.test(p));
245
+ return out
246
+ .map(p => (HEADER.exec(p.trim())?.[1] ?? p.trim()).replace(EDIT_TAG, ""))
247
+ .filter(p => p.length > 0 && !SESSION_URL.test(p));
248
+ }
249
+
250
+ // rule-paths.json, lowercased, for the cheap pre-check that decides whether rule_ledger.py needs to run at all.
251
+ function loadRuleSpec() {
252
+ try {
253
+ const spec = JSON.parse(fs.readFileSync(path.join(RULES_DIR, "rule-paths.json"), "utf8"));
254
+ const low = (xs: unknown): string[] =>
255
+ Array.isArray(xs) ? xs.map(x => String(x).toLowerCase().replace(/^\/+|\/+$/g, "")) : [];
256
+ const names = low(spec.names);
257
+ const dirs = low(spec.dirs);
258
+ const files = low(spec.files);
259
+ const userFiles = low(spec.user?.files);
260
+ const userDirs = low(spec.user?.dirs);
261
+ return {
262
+ names: new Set(names),
263
+ dirs: dirs.map(d => `/${d}/`),
264
+ files: files.map(f => `/${f}`),
265
+ userFiles: new Set(userFiles),
266
+ userDirs: userDirs.map(d => `${d}/`),
267
+ hints: [
268
+ ...names, ...files, ...dirs, ...dirs.map(d => d.split("/")[0]),
269
+ ...userFiles, ...userDirs, "deepmodebot", "rule_ledger",
270
+ ],
271
+ };
272
+ } catch {
273
+ return undefined;
274
+ }
275
+ }
276
+
277
+ // A user-level agent rule: a `user` path of rule-paths.json under the home folder.
278
+ function isUserRulePath(abs: string): boolean {
279
+ const home = real(os.homedir()).replace(/\\/g, "/").toLowerCase();
280
+ const p = abs.replace(/\\/g, "/").toLowerCase();
281
+ if (!RULES || !p.startsWith(`${home}/`)) return false;
282
+ const rel = p.slice(home.length + 1);
283
+ return RULES.userFiles.has(rel) || RULES.userDirs.some(d => rel.startsWith(d));
284
+ }
285
+
286
+ function mayBeRulePath(abs: string): boolean {
287
+ if (!RULES) return false;
288
+ const p = abs.toLowerCase().replace(/\\/g, "/");
289
+ return (
290
+ RULES.names.has(p.slice(p.lastIndexOf("/") + 1)) ||
291
+ p.includes("/.deepmodebot/rules") ||
292
+ RULES.dirs.some(d => p.includes(d)) ||
293
+ RULES.files.some(f => p.endsWith(f)) ||
294
+ isUserRulePath(abs)
295
+ );
296
+ }
297
+
298
+ // Whether the repo holding `abs` has an owner rule ledger in its working tree.
299
+ function ledgerNear(abs: string): boolean {
300
+ let dir = path.dirname(abs);
301
+ while (true) {
302
+ if (fs.existsSync(path.join(dir, LEDGER_REL))) return true;
303
+ if (fs.existsSync(path.join(dir, ".git"))) return false;
304
+ const parent = path.dirname(dir);
305
+ if (parent === dir) return false;
306
+ dir = parent;
307
+ }
308
+ }
309
+
310
+ // Output of a Python helper, "" when it failed, or null when no Python could run it.
311
+ function runPython(script: string, args: string[], input: string, timeout: number): string | null {
312
+ for (const [exe, prefix] of PYTHONS) {
313
+ try {
314
+ return execFileSync(exe, [...prefix, script, ...args], {
315
+ input,
316
+ encoding: "utf8",
317
+ timeout,
318
+ stdio: ["pipe", "pipe", "ignore"],
319
+ windowsHide: true,
320
+ env: { ...process.env, PYTHONDONTWRITEBYTECODE: "1" },
321
+ });
322
+ } catch (err) {
323
+ if (err && typeof err === "object" && "code" in err && err.code === "ENOENT") continue;
324
+ return "";
325
+ }
326
+ }
327
+ return null;
328
+ }
329
+
330
+ // rule_ledger.py guard verdict: a deny reason, "" to allow, or null when no Python could run it.
331
+ function pythonGuard(request: { cwd: string; paths: string[]; command: string }): string | null {
332
+ const out = runPython(RULE_LEDGER, ["guard"], JSON.stringify(request), 15_000);
333
+ if (out === null) return null;
334
+ try {
335
+ const verdict = JSON.parse(out);
336
+ return verdict && verdict.block ? String(verdict.reason) : "";
337
+ } catch {
338
+ return "";
339
+ }
340
+ }
341
+
342
+ // Python runs only for shell commands in a ledger repo or naming a rule path or owner command, and for writes whose
343
+ // target (or resolved target) looks like a rule path.
344
+ function ruleBlock(cwd: string, paths: string[], command: string): Block | undefined {
345
+ const candidates = paths.filter(p => mayBeRulePath(absolute(p, cwd)) || mayBeRulePath(real(absolute(p, cwd))));
346
+ const lowered = command.toLowerCase().replace(/\\/g, "/");
347
+ const shell =
348
+ command !== "" && ((RULES?.hints.some(h => lowered.includes(h)) ?? false) || ledgerNear(path.join(cwd, "_")));
349
+ if (candidates.length === 0 && !shell) return undefined;
350
+ const verdict = pythonGuard({ cwd, paths: candidates, command: shell ? command : "" });
351
+ if (verdict === null) {
352
+ const userOn = fs.existsSync(path.join(os.homedir(), LEDGER_REL));
353
+ if (!candidates.some(p => ledgerNear(absolute(p, cwd)) || (userOn && isUserRulePath(absolute(p, cwd))))) return undefined;
354
+ return { block: true, reason: "deepmodebot rule approval needs Python 3 on PATH to check rule files; install it, then retry." };
355
+ }
356
+ return verdict ? { block: true, reason: verdict } : undefined;
357
+ }
358
+
359
+ type Segs = string[];
360
+ type GitCall = [string, string[]];
361
+ type Stage = { words: string[]; ops: Segs[]; start: Segs; git: GitCall[]; lead: number };
362
+ type Links = { feeders: [number, number][]; sinks: [number, number][] };
363
+
364
+ const HOLDOUT_DIR = ".deepmodebot-holdout";
365
+ const HOLDOUT_FALLBACK = "deepmodebot-holdout";
366
+ const onWindows = process.platform === "win32";
367
+ const TMP_ROOTS = ["/tmp", "/var/tmp", "/private/tmp", "/var/folders", "/private/var/folders", "c:/windows/temp"];
368
+ const HOME_SPELLING_RE =
369
+ /^(?:~|\$\{?(?:home|userprofile)\}?|%(?:home|userprofile)%|\$\{?env:(?:home|userprofile)\}?|%homedrive%%homepath%|\$\{?(?:env:)?homedrive\}?\$\{?(?:env:)?homepath\}?)(?=\/|$)/i;
370
+ const LOCAL_SPELLING_RE = /^(?:\$\{?(?:env:)?localappdata\}?|%localappdata%)(?=\/|$)/i;
371
+ const GIT_RAW_RE = /(?:^|\/)[^/]*\.git\/(?:objects|logs|lost-found)(?:\/|$)|(?:^|\/)objects\/(?:pack|info|[0-9a-f]{2})(?:\/|$)/i;
372
+ const GLOB_RE = /[*?[]/;
373
+ const TEST_RE = /(?:^|[^a-z0-9])(?:tests?|specs?|holdouts?|hidden|golden|graders?|solutions?|answers?|expected|fixtures?)(?:[^a-z0-9]|$)/i;
374
+ const INTERPRETER_RE = /^(?:python|py|node|bun|deno|perl|ruby|php|pwsh|powershell|bash|sh|zsh|dash|ksh|cmd|lua|tsx|ts-node|osascript|rscript)[0-9.]*$/;
375
+ const LOOP_RE = /(?:^|[\s;&|(])(?:for|while|until|read|xargs)(?=$|[\s;&|)])/;
376
+ const COMMAND_PREFIXES = new Set(["sudo", "time", "command", "env", "nohup", "exec", "builtin", "nice", "then", "do", "else", "{"]);
377
+ const CD_COMMANDS = new Set(["cd", "pushd", "chdir", "sl", "set-location"]);
378
+ const GREP_FAMILY = new Set(["grep", "egrep", "fgrep", "rg", "ag", "ack", "sls", "select-string"]);
379
+ const ENUMERATORS = new Set(["find", "fd", "fdfind", "ls", "dir", "tree", "gci", "get-childitem", "locate", "mlocate"]);
380
+ const CONTENT_READERS = new Set([
381
+ "cat", "type", "head", "tail", "less", "more", "xargs", "strings", "bat", "tac", "nl", "od", "xxd", "hexdump",
382
+ "get-content", "gc", "select-string", "sls", "findstr",
383
+ ]);
384
+ const ALWAYS_RECURSIVE = new Set(["rg", "ag", "ack", "zip", "7z", "7za", "rsync", "robocopy", "xcopy"]);
385
+ const GREP_ARG_FLAGS = new Set([
386
+ "-e", "-f", "-m", "-A", "-B", "-C", "-g", "-t", "-T", "-j", "-M", "-d", "-D", "--regexp", "--file", "--max-count",
387
+ "--after-context", "--before-context", "--context", "--glob", "--iglob", "--type", "--type-not", "--include",
388
+ "--exclude", "--exclude-dir", "--include-dir", "--max-depth", "--threads", "-pattern", "-path", "-literalpath",
389
+ ]);
390
+ const GIT_GLOBAL_ARG_FLAGS = new Set(["-C", "-c", "--git-dir", "--work-tree", "--namespace", "--super-prefix", "--config-env"]);
391
+ const GIT_DENIED_SUBCOMMANDS = new Set(["unpack-file", "prune", "show-index", "verify-pack", "lost-found"]);
392
+ const GIT_REFLOG_SUBCOMMANDS = new Set(["log", "show", "rev-list", "whatchanged", "shortlog", "format-patch", "diff", "archive", "grep"]);
393
+ const GIT_CONTENT_SUBCOMMANDS = new Set(["show", "diff", "format-patch", "archive", "grep"]);
394
+ const GIT_RECOVER_SUBCOMMANDS = new Set([
395
+ "show", "cat-file", "checkout", "restore", "switch", "cherry-pick", "archive", "diff", "format-patch", "read-tree",
396
+ "reset", "merge", "branch", "tag", "update-ref", "worktree", "apply",
397
+ ]);
398
+ const GIT_CONTENT_FLAGS = [
399
+ "--patch", "--patch-with-stat", "--patch-with-raw", "--cc", "--stat", "--numstat", "--shortstat", "--raw", "--name-only",
400
+ "--name-status", "--full-diff", "--pickaxe-regex", "--pickaxe-all", "--word-diff", "--textconv", "--objects",
401
+ "--summary", "--dirstat",
402
+ ];
403
+ const TOOL_PATH_KEYS = new Set([
404
+ "path", "paths", "filepath", "file", "files", "notebookpath", "directory", "dir", "cwd", "root", "targetfile",
405
+ "searchpath", "searchdirectory", "directorypath", "absolutepath", "abspath", "workdir", "filename",
406
+ ]);
407
+ const TOOL_PATTERN_KEYS = new Set(["glob", "include", "pattern"]);
408
+ const SEARCH_TOOL_RE = /grep|glob|find|^ls$|list|tree|walk|^dir$|^rg$/i;
409
+
410
+ function holdoutReason(hit: string): string {
411
+ return `deepmodebot anti-reward-hacking guard blocked "${hit}": builders may not read the hidden holdout store or mine git objects, reflogs, or other agents' temp files for hidden answers.`;
412
+ }
413
+
414
+ function homeDirs(): string[] {
415
+ const env = process.env;
416
+ const found: string[] = [];
417
+ for (const home of [env.HOME, env.USERPROFILE, `${env.HOMEDRIVE ?? ""}${env.HOMEPATH ?? ""}`, os.homedir()]) {
418
+ if (home && home !== "~" && !found.includes(home)) found.push(home);
419
+ }
420
+ return found;
421
+ }
422
+
423
+ function prepPath(p: string): string {
424
+ let text = p.replace(/\\/g, "/");
425
+ text = text.replace(/^file:\/{2,3}(?:localhost\/)?/i, "/");
426
+ if (/^\/[A-Za-z]:/.test(text)) text = text.slice(1);
427
+ text = text.replace(/^\/\/[?.]\//, "");
428
+ text = text.replace(/^\/\/(?:localhost|127\.0\.0\.1)\/([A-Za-z])\$(?=\/|$)/i, "$1:");
429
+ if (onWindows) {
430
+ text = text.replace(/^\/(?:mnt|cygdrive)\/([A-Za-z])(?=\/|$)/, "$1:");
431
+ text = text.replace(/^\/([A-Za-z])(?=\/)/, "$1:");
432
+ }
433
+ return text;
434
+ }
435
+
436
+ function toSegs(p: string): Segs | null {
437
+ const text = prepPath(p);
438
+ const drive = /^[A-Za-z]:(?=\/|$)/.exec(text);
439
+ let root: string;
440
+ let rest: string;
441
+ if (drive) {
442
+ root = drive[0];
443
+ rest = text.slice(drive[0].length);
444
+ } else if (text.startsWith("/")) {
445
+ root = onWindows ? process.cwd().slice(0, 2) : "/";
446
+ rest = text;
447
+ } else {
448
+ return null;
449
+ }
450
+ const out: string[] = [];
451
+ for (let part of rest.split("/")) {
452
+ if (part === "" || part === ".") continue;
453
+ if (part === "..") {
454
+ out.pop();
455
+ continue;
456
+ }
457
+ if (onWindows) {
458
+ part = part.split(":")[0].replace(/[. ]+$/, "");
459
+ if (!part) continue;
460
+ }
461
+ out.push(part);
462
+ }
463
+ return caseless ? [root.toLowerCase(), ...out.map(part => part.toLowerCase())] : [root, ...out];
464
+ }
465
+
466
+ function joinSegs(segs: Segs): string {
467
+ return (segs[0] !== "/" ? segs[0] : "") + "/" + segs.slice(1).join("/");
468
+ }
469
+
470
+ function toAbs(text: string, cwd: Segs): Segs {
471
+ return toSegs(text) ?? toSegs(joinSegs(cwd) + "/" + prepPath(text)) ?? cwd;
472
+ }
473
+
474
+ function realpathLoose(p: string): string {
475
+ try {
476
+ return fs.realpathSync.native(p);
477
+ } catch {
478
+ const parent = path.dirname(p);
479
+ return parent === p ? p : path.join(realpathLoose(parent), path.basename(p));
480
+ }
481
+ }
482
+
483
+ function realSegs(text: string, cwd: Segs): Segs | null {
484
+ const raw = prepPath(text);
485
+ return toSegs(realpathLoose(toSegs(raw) ? raw : joinSegs(cwd) + "/" + raw));
486
+ }
487
+
488
+ function sameSegs(a: Segs, b: Segs): boolean {
489
+ return a.length === b.length && a.every((part, i) => part === b[i]);
490
+ }
491
+
492
+ function startsWithSegs(segs: Segs, prefix: Segs): boolean {
493
+ return segs.length >= prefix.length && prefix.every((part, i) => part === segs[i]);
494
+ }
495
+
496
+ function uniqueSegs(paths: string[]): Segs[] {
497
+ const found: Segs[] = [];
498
+ for (const p of paths) {
499
+ for (const segs of [toSegs(p), toSegs(realpathLoose(p))]) {
500
+ if (segs && !found.some(f => sameSegs(f, segs))) found.push(segs);
501
+ }
502
+ }
503
+ return found;
504
+ }
505
+
506
+ function expandBraces(text: string, cap = 64): string[] {
507
+ const match = /\{([^{}]*,[^{}]*)\}/.exec(text);
508
+ if (!match) return [text];
509
+ const out: string[] = [];
510
+ for (const alt of match[1].split(",")) {
511
+ out.push(...expandBraces(text.slice(0, match.index) + alt + text.slice(match.index + match[0].length), cap));
512
+ if (out.length >= cap) break;
513
+ }
514
+ return out.slice(0, cap);
515
+ }
516
+
517
+ function wordVariants(word: string): string[] {
518
+ const out = [word];
519
+ for (let i = word.indexOf("="); i !== -1; i = word.indexOf("=", i + 1)) out.push(word.slice(i + 1));
520
+ for (const match of word.matchAll(/:(?=[~$%/\\])/g)) out.push(word.slice((match.index ?? 0) + 1));
521
+ return out.filter((v, i) => v !== "" && !out.slice(0, i).includes(v));
522
+ }
523
+
524
+ function segMatch(glob: string, name: string): boolean {
525
+ if (!GLOB_RE.test(glob)) return glob === name;
526
+ if ("*?[".includes(glob[0]) && name.startsWith(".")) return false;
527
+ let out = "";
528
+ for (let i = 0; i < glob.length; i++) {
529
+ const ch = glob[i];
530
+ const close = ch === "[" ? glob.indexOf("]", i + 2) : -1;
531
+ if (ch === "*") {
532
+ out += "[^/]*";
533
+ } else if (ch === "?") {
534
+ out += "[^/]";
535
+ } else if (close !== -1) {
536
+ const body = glob.slice(i + 1, close);
537
+ out += "[" + (body[0] === "!" || body[0] === "^" ? "^" + body.slice(1) : body).replace(/\\/g, "\\\\") + "]";
538
+ i = close;
539
+ } else {
540
+ out += escapeRegex(ch);
541
+ }
542
+ }
543
+ try {
544
+ return new RegExp("^" + out + "$").test(name);
545
+ } catch {
546
+ return true;
547
+ }
548
+ }
549
+
550
+ function namedLiteral(seg: string): boolean {
551
+ return !GLOB_RE.test(seg) || seg.replace(/[.*?[\]!^-]/g, "") !== "";
552
+ }
553
+
554
+ function globMatch(glob: Segs, i: number, root: Segs, j: number): boolean {
555
+ if (j === root.length) return i < glob.length || (i > 0 && namedLiteral(glob[i - 1]));
556
+ if (i === glob.length) return false;
557
+ if (glob[i] === "**") return globMatch(glob, i + 1, root, j) || globMatch(glob, i, root, j + 1);
558
+ return segMatch(glob[i], root[j]) && globMatch(glob, i + 1, root, j + 1);
559
+ }
560
+
561
+ function wordBase(word: string): string {
562
+ const name = (word.replace(/\\/g, "/").split("/").pop() ?? "").toLowerCase();
563
+ return name.endsWith(".exe") ? name.slice(0, -4) : name;
564
+ }
565
+
566
+ function leadIndex(words: string[]): number {
567
+ let prefixed = false;
568
+ for (let i = 0; i < words.length; i++) {
569
+ if (/^[A-Za-z_]\w*=/.test(words[i]) || COMMAND_PREFIXES.has(wordBase(words[i]))) prefixed = true;
570
+ else if (!(prefixed && words[i].startsWith("-"))) return i;
571
+ }
572
+ return words.length;
573
+ }
574
+
575
+ function optIs(token: string, full: string, minLen: number): boolean {
576
+ const name = token.split("=")[0];
577
+ return name.startsWith("--") && name.length >= minLen && full.startsWith(name);
578
+ }
579
+
580
+ class HoldoutScan {
581
+ homes = homeDirs();
582
+ cwd: Segs;
583
+ roots: Segs[];
584
+ tmp: Segs[];
585
+ realBudget = 200;
586
+
587
+ constructor(cwd: string) {
588
+ this.cwd = toSegs(cwd) ?? toSegs(process.cwd()) ?? ["/"];
589
+ const stores = this.homes.map(home => path.join(home, HOLDOUT_DIR));
590
+ const local = process.env.LOCALAPPDATA;
591
+ if (local) stores.push(path.join(local, HOLDOUT_FALLBACK));
592
+ stores.push("/tmp/" + HOLDOUT_FALLBACK);
593
+ this.roots = uniqueSegs(stores);
594
+ this.tmp = uniqueSegs([...TMP_ROOTS, ...this.homes.map(home => path.join(home, "AppData", "Local", "Temp"))]);
595
+ }
596
+
597
+ expand(item: string): string[] {
598
+ const match = HOME_SPELLING_RE.exec(item);
599
+ if (match) return this.homes.length ? this.homes.map(home => home + item.slice(match[0].length)) : [item];
600
+ const local = process.env.LOCALAPPDATA;
601
+ const localMatch = LOCAL_SPELLING_RE.exec(item);
602
+ return localMatch && local ? [local + item.slice(localMatch[0].length)] : [item];
603
+ }
604
+
605
+ candidates(word: string, cwd: Segs): Segs[] {
606
+ const found: Segs[] = [];
607
+ for (const variant of wordVariants(word.replace(/\\/g, "/"))) {
608
+ for (const item of expandBraces(variant)) {
609
+ for (const text of this.expand(item)) {
610
+ found.push(toAbs(text, cwd));
611
+ if (this.realBudget > 0 && prepPath(text).includes("/") && !GLOB_RE.test(text)) {
612
+ this.realBudget -= 1;
613
+ const real = realSegs(text, cwd);
614
+ if (real) found.push(real);
615
+ }
616
+ }
617
+ }
618
+ }
619
+ return found;
620
+ }
621
+
622
+ reaches(cands: Segs[]): boolean {
623
+ return cands.some(c => this.roots.some(r => globMatch(c, 0, r, 0)));
624
+ }
625
+
626
+ above(cands: Segs[], widen = false): boolean {
627
+ return cands.map(c => (widen ? literalHead(c) : c))
628
+ .some(h => !h.some(s => GLOB_RE.test(s)) && this.roots.some(r => startsWithSegs(r, h)));
629
+ }
630
+
631
+ inTmp(segs: Segs): boolean {
632
+ return this.tmp.some(t => startsWithSegs(segs, t)) && !startsWithSegs(segs, this.cwd);
633
+ }
634
+ }
635
+
636
+ function literalHead(segs: Segs): Segs {
637
+ const i = segs.findIndex(seg => GLOB_RE.test(seg));
638
+ return i === -1 ? segs : segs.slice(0, i);
639
+ }
640
+
641
+ function computedHome(word: string): boolean {
642
+ for (const variant of wordVariants(word)) {
643
+ const match = HOME_SPELLING_RE.exec(variant);
644
+ const first = match ? variant.slice(match[0].length).replace(/^\/+/, "").split("/")[0] : "";
645
+ if (first && /\$|%[A-Za-z_]\w*%/.test(first)) return true;
646
+ }
647
+ return false;
648
+ }
649
+
650
+ function grepSkips(words: string[]): Set<number> {
651
+ const skips = new Set<number>();
652
+ for (let i = 0; i < words.length; i++) {
653
+ const name = wordBase(words[i]);
654
+ if (!GREP_FAMILY.has(name)) continue;
655
+ let k = i + 1;
656
+ let havePattern = false;
657
+ while (k < words.length && words[k].startsWith("-") && words[k] !== "-" && words[k] !== "--") {
658
+ const flag = words[k].length <= 2 ? words[k] : words[k].toLowerCase();
659
+ if (flag.startsWith("--regexp=")) {
660
+ skips.add(k);
661
+ havePattern = true;
662
+ }
663
+ if (flag === "-e" || flag === "--regexp" || flag === "-pattern") {
664
+ havePattern = true;
665
+ skips.add(k + 1);
666
+ }
667
+ k += GREP_ARG_FLAGS.has(flag) || (name === "rg" && flag === "-r") ? 2 : 1;
668
+ }
669
+ if (k < words.length && words[k] === "--") k += 1;
670
+ if (!havePattern && k < words.length) skips.add(k);
671
+ }
672
+ return skips;
673
+ }
674
+
675
+ function contentFlag(token: string): boolean {
676
+ return GIT_CONTENT_FLAGS.some(full => optIs(token, full, 4)) || /^-\d*[pu]$/.test(token)
677
+ || token.startsWith("-S") || token.startsWith("-G");
678
+ }
679
+
680
+ function gitCalls(words: string[]): GitCall[] {
681
+ const calls: GitCall[] = [];
682
+ for (let i = 0; i < words.length; i++) {
683
+ const name = wordBase(words[i]);
684
+ const dashed = /^git-([a-z-]+)$/.exec(name);
685
+ if (dashed) {
686
+ calls.push([dashed[1], words.slice(i + 1)]);
687
+ } else if (name === "git") {
688
+ let k = i + 1;
689
+ while (k < words.length && words[k].startsWith("-")) k += GIT_GLOBAL_ARG_FLAGS.has(words[k]) ? 2 : 1;
690
+ if (k < words.length) calls.push([words[k].toLowerCase(), words.slice(k + 1)]);
691
+ }
692
+ }
693
+ return calls;
694
+ }
695
+
696
+ function reflogFlagged(sub: string, args: string[]): boolean {
697
+ return GIT_REFLOG_SUBCOMMANDS.has(sub)
698
+ && args.some(a => a === "-g" || optIs(a, "--reflog", 6) || optIs(a, "--walk-reflogs", 7));
699
+ }
700
+
701
+ function gitHit(sub: string, args: string[]): string | null {
702
+ if (sub === "cat-file" && args.some(a => optIs(a, "--batch-all-objects", 9))) return "git cat-file --batch-all-objects";
703
+ if (sub === "fsck" || sub === "fsck-objects") {
704
+ const bad = args.some(a => optIs(a, "--lost-found", 4) || optIs(a, "--unreachable", 4) || optIs(a, "--dangling", 3)
705
+ || optIs(a, "--no-reflogs", 6));
706
+ if (bad || !args.some(a => optIs(a, "--no-dangling", 8))) return "git fsck";
707
+ }
708
+ if (GIT_DENIED_SUBCOMMANDS.has(sub)) return "git " + sub;
709
+ const content = args.some(contentFlag);
710
+ if ((reflogFlagged(sub, args) && (GIT_CONTENT_SUBCOMMANDS.has(sub) || content)) || (sub === "reflog" && content)) {
711
+ return "git " + sub + " reflog content";
712
+ }
713
+ return null;
714
+ }
715
+
716
+ function gitRole(sub: string, args: string[]): [boolean, boolean] {
717
+ const feeder = sub === "reflog" || reflogFlagged(sub, args) || (
718
+ sub === "rev-list" && args.some(a => optIs(a, "--objects", 5))
719
+ && args.some(a => a === "--all" || optIs(a, "--reflog", 6)));
720
+ const sink = GIT_RECOVER_SUBCOMMANDS.has(sub) || (sub === "cat-file" && args.some(a => a.startsWith("--batch")));
721
+ return [feeder, sink];
722
+ }
723
+
724
+ function isRecursive(name: string, args: string[]): boolean {
725
+ const low = args.map(a => a.toLowerCase());
726
+ if (ALWAYS_RECURSIVE.has(name)) return true;
727
+ if (GREP_FAMILY.has(name)) {
728
+ return args.some(a => /^-[a-zA-Z]*[rR][a-zA-Z]*$/.test(a) || a === "--recursive" || a === "--dereference-recursive")
729
+ || low.includes("-recurse") || (args.includes("-d") && args.includes("recurse"));
730
+ }
731
+ if (name === "cp" || name === "scp" || name === "copy-item" || name === "cpi") {
732
+ return args.some(a => /^-[a-zA-Z]*[rRa][a-zA-Z]*$/.test(a) || a === "--recursive") || low.includes("-recurse");
733
+ }
734
+ if (name === "tar") return args.length > 0 && (args[0] === "--create" || /^-?[a-zA-Z]*c[a-zA-Z]*$/.test(args[0]));
735
+ return name === "findstr" && low.includes("/s");
736
+ }
737
+
738
+ function isContentReader(words: string[]): boolean {
739
+ const consumes = words.some(w => GREP_FAMILY.has(wordBase(w)) || wordBase(w) === "sed" || wordBase(w) === "awk");
740
+ return words.some(w => CONTENT_READERS.has(wordBase(w)) || /^-(?:exec|execdir|ok|okdir)$/.test(w) || (w === "$" && consumes));
741
+ }
742
+
743
+ function sweepHit(scan: HoldoutScan, stages: (Stage | null)[], content: boolean): string | null {
744
+ const hasTest = TEST_RE.test(stages.flatMap(st => (st ? st.words : [])).join(" "));
745
+ for (const st of stages) {
746
+ if (!st) continue;
747
+ for (let i = 0; i < st.words.length; i++) {
748
+ const name = wordBase(st.words[i]);
749
+ const rec = isRecursive(name, st.words.slice(i + 1));
750
+ const enumerates = ENUMERATORS.has(name);
751
+ if ((rec || (enumerates && content)) && scan.above([...st.ops, st.start], rec)) {
752
+ return name + " over a directory holding the holdout store";
753
+ }
754
+ if (!hasTest) continue;
755
+ for (const op of st.ops) {
756
+ const broad = rec || (enumerates && content) || (CONTENT_READERS.has(name) && op.some(s => GLOB_RE.test(s)));
757
+ if (broad && scan.inTmp(op)) return name + " sweeping temp directories for tests";
758
+ }
759
+ }
760
+ }
761
+ return null;
762
+ }
763
+
764
+ function scanStage(scan: HoldoutScan, words: string[], cur: Segs): { hit: string | null; stage: Stage | null } {
765
+ const lead = leadIndex(words);
766
+ const skips = grepSkips(words);
767
+ const ops: Segs[] = [];
768
+ for (let i = 0; i < words.length; i++) {
769
+ const token = words[i].replace(/^\d*[<>]+/, "");
770
+ if (skips.has(i) || !token) continue;
771
+ if (GIT_RAW_RE.test(token.replace(/\\/g, "/"))) return { hit: token, stage: null };
772
+ if (token.startsWith("-") && !token.includes("=")) continue;
773
+ const cands = scan.candidates(token, cur);
774
+ if (computedHome(token) || scan.reaches(cands)) return { hit: token, stage: null };
775
+ if (i > lead) ops.push(...cands);
776
+ }
777
+ const gwords = words.flatMap(w => w.split(/[,[\]]+/).filter(Boolean));
778
+ const calls: GitCall[] = [];
779
+ for (const [sub, args] of gitCalls(gwords)) {
780
+ const hit = gitHit(sub, args);
781
+ if (hit) return { hit, stage: null };
782
+ calls.push([sub, args]);
783
+ }
784
+ return { hit: null, stage: { words, ops, start: cur, git: calls, lead } };
785
+ }
786
+
787
+ function nextCwd(scan: HoldoutScan, st: Stage, cur: Segs): Segs {
788
+ const { words, lead } = st;
789
+ if (lead >= words.length || !CD_COMMANDS.has(wordBase(words[lead])) || words.slice(lead + 1).includes("-")) return cur;
790
+ const args = words.slice(lead + 1).filter(w => !w.startsWith("-") && !/^\/[A-Za-z]$/.test(w));
791
+ const first = scan.candidates(args.length ? args[0] : "~", cur)[0];
792
+ return first.some(s => GLOB_RE.test(s)) ? cur : first;
793
+ }
794
+
795
+ function gitLinkHit(stages: (Stage | null)[], ci: number, links: Links): string | null {
796
+ const feeders: number[] = [];
797
+ const sinks: number[] = [];
798
+ stages.forEach((st, si) => {
799
+ if (!st) return;
800
+ for (const [sub, args] of st.git) {
801
+ const [feeder, sink] = gitRole(sub, args);
802
+ if (feeder) feeders.push(si);
803
+ if (sink) sinks.push(si);
804
+ }
805
+ if (st.words.some(w => wordBase(w) === "xargs")) sinks.push(si);
806
+ });
807
+ links.feeders.push(...feeders.map((f): [number, number] => [ci, f]));
808
+ links.sinks.push(...sinks.map((s): [number, number] => [ci, s]));
809
+ return feeders.some(f => sinks.some(s => f !== s)) ? "git history listing piped into content recovery" : null;
810
+ }
811
+
812
+ function scanText(scan: HoldoutScan, source: string): string | null {
813
+ const text = source.replace(/`([^`]*)`/g, "$$($1)");
814
+ let cur = scan.cwd;
815
+ const links: Links = { feeders: [], sinks: [] };
816
+ const chains = text.split(/\|\||&&|[;&\r\n]/);
817
+ for (let ci = 0; ci < chains.length; ci++) {
818
+ const stages: (Stage | null)[] = [];
819
+ for (const part of chains[ci].split(/[|()]/)) {
820
+ const words = part.split(/\s+/).filter(Boolean);
821
+ const scanned = words.length ? scanStage(scan, words, cur) : { hit: null, stage: null };
822
+ if (scanned.hit) return scanned.hit;
823
+ stages.push(scanned.stage);
824
+ if (scanned.stage) cur = nextCwd(scan, scanned.stage, cur);
825
+ }
826
+ const content = stages.some(st => st !== null && isContentReader(st.words));
827
+ const hit = gitLinkHit(stages, ci, links) ?? sweepHit(scan, stages, content);
828
+ if (hit) return hit;
829
+ }
830
+ const crossed = links.feeders.some(([fc, fs]) => links.sinks.some(([sc, ss]) => fc !== sc || fs !== ss));
831
+ return LOOP_RE.test(text) && crossed ? "git history listing piped into content recovery" : null;
832
+ }
833
+
834
+ function inlineNameHit(text: string, evalMode: boolean): string | null {
835
+ const reduced = text.toLowerCase().replace(/[\s'"+,()[\]`\\^$\/]/g, "");
836
+ if (!reduced.includes("deepmodebot-holdout")) return null;
837
+ const interpreted = text.split(/[\s;&|()'"`]+/).some(w => w !== "" && INTERPRETER_RE.test(wordBase(w)));
838
+ return evalMode || interpreted ? HOLDOUT_DIR : null;
839
+ }
840
+
841
+ function holdoutCommandHit(command: unknown, cwd: string, evalMode = false): string | null {
842
+ const stripped = String(command ?? "").replace(/(-m|--message)(=|\s+)("[^"]*"|'[^']*')/g, '$1 ""');
843
+ const text = stripped.replace(/\\\r?\n/g, " ");
844
+ const scan = new HoldoutScan(cwd);
845
+ const inline = inlineNameHit(text, evalMode);
846
+ if (inline) return inline;
847
+ const flat = text.replace(/\$(?=['"])/g, "").replace(/['"]/g, "");
848
+ for (const view of [flat.replace(/\\/g, "/"), flat.replace(/[\\^`]/g, "")]) {
849
+ const hit = scanText(scan, view);
850
+ if (hit) return hit;
851
+ }
852
+ return null;
853
+ }
854
+
855
+ function toolVariants(value: string): string[] {
856
+ const out = [value, value.replace(/#[0-9A-Za-z]{4}$/, ""), value.replace(/:\d+(?:-\d+)?(?:,.*)?$/, "")];
857
+ for (const pattern of [/^\[(.+)#[0-9A-Za-z]+\]$/, /^(.{2,}?):[^/\\]/]) {
858
+ const match = pattern.exec(value);
859
+ if (match) out.push(match[1]);
860
+ }
861
+ return out.filter((v, i) => v !== "" && !out.slice(0, i).includes(v));
862
+ }
863
+
864
+ function toolStrings(value: unknown): string[] {
865
+ if (typeof value === "string") return [value];
866
+ return Array.isArray(value) ? value.filter((v): v is string => typeof v === "string") : [];
867
+ }
868
+
869
+ function holdoutToolHit(toolName: string, input: Record<string, unknown>, cwd: string): string | null {
870
+ const search = SEARCH_TOOL_RE.test(toolName);
871
+ const patternOk = search && !toolName.toLowerCase().includes("grep");
872
+ const bases: string[] = [];
873
+ const patterns: string[] = [];
874
+ for (const [key, value] of Object.entries(input)) {
875
+ const norm = key.replace(/[_\-\s]/g, "").toLowerCase();
876
+ if (TOOL_PATTERN_KEYS.has(norm) && (norm !== "pattern" || patternOk)) patterns.push(...toolStrings(value));
877
+ if (TOOL_PATH_KEYS.has(norm)) bases.push(...toolStrings(value));
878
+ }
879
+ if (!search && bases.length === 0 && patterns.length === 0) return null;
880
+ const scan = new HoldoutScan(cwd);
881
+ const texts = [...bases, ...patterns].flatMap(value => value.split(";"));
882
+ for (const base of bases.length ? bases : [joinSegs(scan.cwd)]) {
883
+ for (const pattern of patterns) texts.push(base.replace(/[/\\]+$/, "") + "/" + pattern);
884
+ }
885
+ for (const text of texts) {
886
+ for (const variant of toolVariants(text.trim())) {
887
+ const cands = scan.candidates(variant, scan.cwd);
888
+ if (GIT_RAW_RE.test(variant.replace(/\\/g, "/")) || scan.reaches(cands) || (search && scan.above(cands, true))) return variant;
889
+ }
890
+ }
891
+ return search && bases.length === 0 && scan.above([scan.cwd]) ? joinSegs(scan.cwd) : null;
92
892
  }
93
893
 
94
894
  export default function (pi: HookApi): void {
895
+ // Show the owner, once per session, any agent rule changes they have not approved (rules_watch.py).
896
+ pi.on("session_start", async (_event, ctx) => {
897
+ const out = runPython(RULES_WATCH, ["check", "--format", "omp", "--cwd", ctx?.cwd ?? process.cwd()], "", 30_000);
898
+ let notice: { message?: string; status?: string };
899
+ try {
900
+ notice = out ? JSON.parse(out) : {};
901
+ } catch {
902
+ notice = { message: "deepmodebot: the agent rule check returned unreadable output; run `deepmodebot rules watch`." };
903
+ }
904
+ ctx?.ui?.setStatus?.("deepmodebot-rules", notice.status || undefined);
905
+ if (notice.message) ctx?.ui?.notify?.(notice.message, "warning");
906
+ });
907
+ pi.on("before_subagent_spawn", async event => {
908
+ if (nestedSpawn() && process.env.ALLOW_NESTED_SUBAGENTS !== "1") return { block: true, reason: NESTED_REASON };
909
+ if (!event.modelRole && Object.hasOwn(OVERHEAD_AGENTS, event.agent) && event.patterns?.[0] !== "@smol") {
910
+ return { model: ["@smol", ...(event.patterns ?? [])], note: "deepmodebot: pinned overhead specialist to @smol" };
911
+ }
912
+ });
95
913
  pi.on("tool_call", async (event, ctx) => {
96
- if (!WRITE_TOOLS[event.toolName]) return;
97
914
  const cwd = ctx?.cwd ?? process.cwd();
915
+ const input = event.input ?? {};
916
+ if (event.toolName === "task") {
917
+ const context = String(input.context ?? "");
918
+ if (nestedSpawn() && process.env.ALLOW_NESTED_SUBAGENTS !== "1" && !context.includes("ALLOW_NESTED_SUBAGENTS")) {
919
+ return { block: true, reason: NESTED_REASON };
920
+ }
921
+ if (context.includes("worker.md")) return;
922
+ const [root] = projectRoots(cwd);
923
+ const nextContext = `Read skill://deepmodebot/worker.md before anything else.\nProject root: ${root} | Scratch & TMPDIR: ${path.join(root, ".scratch", "tmp")}\n${context}`;
924
+ return { input: { ...input, context: nextContext } };
925
+ }
926
+ if (event.toolName === "bash" || event.toolName === "eval") {
927
+ const command = event.toolName === "bash" ? input.command : input.code;
928
+ const hit = findShellRewardHack(event.toolName === "eval" && typeof command === "string"
929
+ ? command.replace(/[`}\]]/g, " ") : command);
930
+ if (hit) return {
931
+ block: true,
932
+ reason: `deepmodebot anti-reward-hacking guard blocked "${hit}": builders may not zero thresholds, skip reference/verification gates, or tamper with provenance ledgers.`,
933
+ };
934
+ const runDir = typeof input.cwd === "string" && input.cwd.trim() ? absolute(input.cwd.trim(), cwd) : cwd;
935
+ const holdout = holdoutCommandHit(
936
+ event.toolName === "eval" && typeof command === "string" ? command.replace(/[`}\]]/g, " ") : command,
937
+ runDir,
938
+ event.toolName === "eval",
939
+ );
940
+ if (holdout) return { block: true, reason: holdoutReason(holdout) };
941
+ if (event.toolName === "eval") return;
942
+ return ruleBlock(runDir, [], typeof command === "string" ? command : "");
943
+ }
944
+ const holdoutTool = holdoutToolHit(event.toolName, input, cwd);
945
+ if (holdoutTool) return { block: true, reason: holdoutReason(holdoutTool) };
946
+ if (!WRITE_TOOLS[event.toolName]) return;
98
947
  const roots = projectRoots(cwd);
99
948
  const root = roots[0];
949
+ const files = targets(input);
950
+ const sliceBlock = sliceWriteBlock(root, cwd, files);
951
+ if (sliceBlock) return sliceBlock;
100
952
  const allowed = allowedRoots(roots);
101
- for (const target of targets(event.input ?? {})) {
953
+ for (const target of files) {
102
954
  // skill://, vault://, ssh:// and other non-session URLs resolve outside the root. A selector suffix
103
955
  // (archive.zip:member, db.sqlite:table) stays on the path: `..` in it must count against the target.
104
956
  if (!ANY_URL.test(target) && allowed.some(r => inside(real(absolute(target, cwd)), r))) continue;
@@ -110,6 +962,6 @@ export default function (pi: HookApi): void {
110
962
  `If the user explicitly named this path, add it to extraWriteRoots in ${path.join(root, ".deepmodebot.json")}.`,
111
963
  };
112
964
  }
113
- return undefined;
965
+ return ruleBlock(cwd, files.filter(t => !ANY_URL.test(t)), "");
114
966
  });
115
967
  }