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
@@ -5,9 +5,17 @@
5
5
  // (pruning marks older than 30 days) and injects workspace-map output inside git repos via
6
6
  // injectSteps (deduplicated across tool-loop invocations and subsequent turns). PreToolUse blocks
7
7
  // file writes outside the project root once active (or unconditionally when invoked with CLI
8
- // argument "enforce"). Shell/command tools (run_command), workflows (run_workflow), and MCP tools
9
- // are not covered here. Always exits 0 because Antigravity treats non-zero hook exits as execution
10
- // errors and fails open.
8
+ // argument "enforce"). Rule approval (skills/deepmodebot/assets/rules/rule_ledger.py) applies in
9
+ // every conversation: in a repo whose owner turned it on, and for the user-level agent rules once
10
+ // the owner ran `deepmodebot rules init --user`, file writes to agent rule files or the ledger and
11
+ // shell commands that write them are denied (and the owner is notified), and the owner-only
12
+ // `rules init|approve|reject` commands are denied everywhere. The first PreInvocation of a
13
+ // conversation also injects a notice of agent rule changes the owner has not approved
14
+ // (rules/rules_watch.py). In active conversations and for registered workers, every tool call that reaches the
15
+ // hidden holdout store (~/.deepmodebot-holdout in any spelling) or mines git answers (cat-file --batch-all-objects,
16
+ // fsck, reflog recovery, raw .git/objects reads, sweeps of / ~ /tmp for tests) is denied. Workflows (run_workflow)
17
+ // and MCP tools are not otherwise covered here. Always exits 0 because Antigravity treats non-zero hook exits as
18
+ // execution errors and fails open.
11
19
 
12
20
  import { execFileSync } from "node:child_process";
13
21
  import * as fs from "node:fs";
@@ -23,6 +31,19 @@ const WORKSPACE_MAP_SCRIPT = path.resolve(
23
31
  "../skills/deepmodebot/assets/workspace-map/workspace_map.py",
24
32
  );
25
33
  const caseless = process.platform === "win32" || process.platform === "darwin";
34
+ const RULES_DIR = path.resolve(SCRIPT_DIR, "../skills/deepmodebot/assets/rules");
35
+ const RULE_LEDGER = path.join(RULES_DIR, "rule_ledger.py");
36
+ const RULES_WATCH = path.join(RULES_DIR, "rules_watch.py");
37
+ const WORKER_GATE = path.resolve(RULES_DIR, "../worker-gate/worker_gate.py");
38
+ const WORKER_BRIEF = path.resolve(SCRIPT_DIR, "../skills/deepmodebot/worker.md").split(path.sep).join("/");
39
+ const OVERHEAD_AGENTS = { scout: true, researcher: true, reviewer: true, "security-reviewer": true, "comment-sicko": true };
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 LEDGER_REL = path.join(".deepmodebot", "rules", "ledger.json");
42
+ const PYTHONS =
43
+ process.platform === "win32"
44
+ ? [["py", ["-3", "-B"]], ["python3", ["-B"]], ["python", ["-B"]]]
45
+ : [["python3", ["-B"]], ["python", ["-B"]]];
46
+ const RULES = loadRuleSpec();
26
47
 
27
48
  const WRITE_TOOLS = new Set([
28
49
  "write_file",
@@ -31,12 +52,222 @@ const WRITE_TOOLS = new Set([
31
52
  "replace_file_content",
32
53
  "multi_replace_file_content",
33
54
  ]);
55
+ const SHELL_TOOLS = new Set(["run_command", "execute_command", "bash"]);
56
+ const METRIC_FLOORS = {
57
+ iou: 0.5, ssim: 0.5, dice: 0.5, f1: 0.5, auc: 0.5,
58
+ accuracy: 0.5, acc: 0.5, precision: 0.5, recall: 0.5,
59
+ fidelity: 0.5, similarity: 0.5, coverage: 0.5, "pass-rate": 0.5, "win-rate": 0.5,
60
+ clip: 0.15, "clip-score": 0.15, ap: 0.15, map: 0.15, bleu: 0.15, rouge: 0.15,
61
+ psnr: 10.0, protrusion: 0.02, score: 0.05, confidence: 0.05, symmetry: 0.05,
62
+ "cov-fail-under": 50.0,
63
+ };
64
+ const MIN_FLAG_VAL_RE =
65
+ /(?:^|[\s;&|(])(['"]?--(?:(?:gate-)?mi(?:n(?:-([a-z0-9_-]*))?)?|(cov-fail-under))['"]?(?:\s+|=)['"]?\s*([-+]?(?:inf(?:inity)?|nan|(?:\d[\d_]*\.?[\d_]*|\.[\d_]+)(?:e[-+]?[\d_]+)?))\s*['"]?)(?=$|[\s;&|)])/gi;
66
+ const REWARD_HACK_CMD_RE = new RegExp(
67
+ [
68
+ 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;&|)])`,
69
+ String.raw`(?:^|[\s;&|(])['"]?(?:--require-spark-receipt(?:\s+|=)['"]?false|--gate-mode(?:\s+|=)['"]?off|--measured-gates(?:\s+|=)['"]?off|--check-360(?:\s+|=)['"]?(?:false|0))['"]?(?=$|[\s;&|)])`,
70
+ 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;&|)])`,
71
+ String.raw`\bgit\b[^\n;&|]*\bcommit\b[^\n;&|]*\s['"]?(?:-n|--no-verify)['"]?(?=$|[\s;&|)])`,
72
+ String.raw`\b(?:reward-guard\.db|contract-lock\.json|judge_verdicts)\b`,
73
+ String.raw`\breward_guard\.py\b[^\n;&|]*\brecord-judge\b`,
74
+ ].join("|"),
75
+ "i",
76
+ );
77
+
78
+ function minFlagFloor(rawTok) {
79
+ const tok = (rawTok ?? "").toLowerCase().replace(/_/g, "-");
80
+ if (!tok) return 0.5;
81
+ if (tok === "p" || tok === "k" || tok === "port" || tok === "ports") return null;
82
+ if (Object.hasOwn(METRIC_FLOORS, tok)) return METRIC_FLOORS[tok];
83
+ const matches = Object.entries(METRIC_FLOORS)
84
+ .filter(([k]) => k.startsWith(tok))
85
+ .map(([, v]) => v);
86
+ return matches.length ? Math.max(...matches) : null;
87
+ }
88
+ function parseGuardFloat(raw) {
89
+ const c = String(raw).trim().replace(/_/g, "");
90
+ if (/^[-+]?inf(?:inity)?$/i.test(c)) return c.startsWith("-") ? -Infinity : Infinity;
91
+ if (/^[-+]?nan$/i.test(c)) return NaN;
92
+ return Number(c);
93
+ }
94
+
95
+ // rule-paths.json, lowercased, for the cheap pre-check that decides whether rule_ledger.py needs to run at all.
96
+ function loadRuleSpec() {
97
+ try {
98
+ const spec = JSON.parse(fs.readFileSync(path.join(RULES_DIR, "rule-paths.json"), "utf8"));
99
+ const low = xs => (Array.isArray(xs) ? xs.map(x => String(x).toLowerCase().replace(/^\/+|\/+$/g, "")) : []);
100
+ const names = low(spec.names);
101
+ const dirs = low(spec.dirs);
102
+ const files = low(spec.files);
103
+ const userFiles = low(spec.user?.files);
104
+ const userDirs = low(spec.user?.dirs);
105
+ return {
106
+ names: new Set(names),
107
+ dirs: dirs.map(d => `/${d}/`),
108
+ files: files.map(f => `/${f}`),
109
+ userFiles: new Set(userFiles),
110
+ userDirs: userDirs.map(d => `${d}/`),
111
+ hints: [
112
+ ...names, ...files, ...dirs, ...dirs.map(d => d.split("/")[0]),
113
+ ...userFiles, ...userDirs, "deepmodebot", "rule_ledger",
114
+ ],
115
+ };
116
+ } catch {
117
+ return undefined;
118
+ }
119
+ }
120
+
121
+ // A user-level agent rule: a `user` path of rule-paths.json under the home folder.
122
+ function isUserRulePath(abs) {
123
+ const home = real(homeDirectory()).replace(/\\/g, "/").toLowerCase();
124
+ const p = abs.replace(/\\/g, "/").toLowerCase();
125
+ if (!RULES || !p.startsWith(`${home}/`)) return false;
126
+ const rel = p.slice(home.length + 1);
127
+ return RULES.userFiles.has(rel) || RULES.userDirs.some(d => rel.startsWith(d));
128
+ }
129
+
130
+ function mayBeRulePath(abs) {
131
+ if (!RULES) return false;
132
+ const p = abs.toLowerCase().replace(/\\/g, "/");
133
+ return (
134
+ RULES.names.has(p.slice(p.lastIndexOf("/") + 1)) ||
135
+ p.includes("/.deepmodebot/rules") ||
136
+ RULES.dirs.some(d => p.includes(d)) ||
137
+ RULES.files.some(f => p.endsWith(f)) ||
138
+ isUserRulePath(abs)
139
+ );
140
+ }
141
+
142
+ // Whether the repo holding `abs` has an owner rule ledger in its working tree.
143
+ function ledgerNear(abs) {
144
+ let dir = path.dirname(abs);
145
+ while (true) {
146
+ if (fs.existsSync(path.join(dir, LEDGER_REL))) return true;
147
+ if (fs.existsSync(path.join(dir, ".git"))) return false;
148
+ const parent = path.dirname(dir);
149
+ if (parent === dir) return false;
150
+ dir = parent;
151
+ }
152
+ }
153
+
154
+ // Output of a Python helper, "" when it failed, or null when no Python could run it.
155
+ function runPython(script, args, input, timeout) {
156
+ for (const [exe, prefix] of PYTHONS) {
157
+ try {
158
+ return execFileSync(exe, [...prefix, script, ...args], {
159
+ input,
160
+ encoding: "utf8",
161
+ timeout,
162
+ stdio: ["pipe", "pipe", "ignore"],
163
+ windowsHide: true,
164
+ env: { ...process.env, PYTHONDONTWRITEBYTECODE: "1" },
165
+ });
166
+ } catch (err) {
167
+ if (err && err.code === "ENOENT") continue;
168
+ return "";
169
+ }
170
+ }
171
+ return null;
172
+ }
173
+
174
+ // rule_ledger.py guard verdict: a deny reason, "" to allow, or null when no Python could run it.
175
+ function pythonGuard(request) {
176
+ const out = runPython(RULE_LEDGER, ["guard"], JSON.stringify(request), 8_000);
177
+ if (out === null) return null;
178
+ try {
179
+ const verdict = JSON.parse(out);
180
+ return verdict && verdict.block ? String(verdict.reason) : "";
181
+ } catch {
182
+ return "";
183
+ }
184
+ }
185
+
186
+ // The unapproved-rules notice for this conversation as an injectSteps entry, or null when nothing is pending.
187
+ function rulesNoticeStep(cwd) {
188
+ const out = runPython(RULES_WATCH, ["check", "--format", "agy", "--cwd", cwd], "", 8_000);
189
+ let notice;
190
+ try {
191
+ notice = out ? JSON.parse(out) : null;
192
+ } catch {
193
+ notice = { systemMessage: "deepmodebot: the agent rule check returned unreadable output; tell the user to run `deepmodebot rules watch`." };
194
+ }
195
+ if (!notice || !notice.systemMessage) return null;
196
+ return { systemMessage: { systemMessage: notice.systemMessage, metadata: { source: "deepmodebot", kind: "rules-notice" } } };
197
+ }
198
+
199
+ // Python runs only for shell commands in a ledger repo or naming a rule path or owner command, and for writes whose
200
+ // target (or resolved target) looks like a rule path.
201
+ function ruleDenyReason(cwd, paths, command) {
202
+ const candidates = paths.filter(p => mayBeRulePath(absolute(p, cwd)) || mayBeRulePath(real(absolute(p, cwd))));
203
+ const lowered = command.toLowerCase().replace(/\\/g, "/");
204
+ const hinted = Boolean(RULES && RULES.hints.some(h => lowered.includes(h)));
205
+ const shell = command !== "" && (hinted || ledgerNear(path.join(cwd, "_")));
206
+ if (candidates.length === 0 && !shell) return "";
207
+ const verdict = pythonGuard({ cwd, paths: candidates, command: shell ? command : "" });
208
+ if (verdict !== null) return verdict;
209
+ const userOn = fs.existsSync(path.join(homeDirectory(), LEDGER_REL));
210
+ return candidates.some(p => ledgerNear(absolute(p, cwd)) || (userOn && isUserRulePath(absolute(p, cwd))))
211
+ ? "deepmodebot rule approval needs Python 3 on PATH to check rule files; install it, then retry."
212
+ : "";
213
+ }
214
+
215
+ function findShellRewardHack(rawCmd) {
216
+ const cleaned = String(rawCmd ?? "").replace(/(-m|--message)(=|\s+)("[^"]*"|'[^']*')/g, '$1 ""');
217
+ for (const rawLine of cleaned.replace(/\\\r?\n/g, " ").split(/\r?\n/)) {
218
+ const line = rawLine.trim();
219
+ if (!line || /^(?:grep|rg|echo|printf)\s+[^;&|<>()`$]*$/.test(line)) continue;
220
+ MIN_FLAG_VAL_RE.lastIndex = 0;
221
+ let fm;
222
+ while ((fm = MIN_FLAG_VAL_RE.exec(line)) !== null) {
223
+ const floor = minFlagFloor(fm[3] || fm[2]);
224
+ const val = parseGuardFloat(fm[4]);
225
+ if (floor !== null && (!Number.isFinite(val) || val < floor)) return fm[1].trim();
226
+ }
227
+ const m = REWARD_HACK_CMD_RE.exec(line);
228
+ if (m) return m[0].trim();
229
+ }
230
+ return null;
231
+ }
232
+
233
+ function spawnVerdict(args) {
234
+ const env = process.env;
235
+ const depth = env.DEEPMODEBOT_SUBAGENT_DEPTH;
236
+ const nested = env.TEAMWORK_RUN_ID || env.SWARM_ID || env.AGY_PARENT_CONVERSATION_ID ||
237
+ (depth && depth !== "0") || env.DEEPMODEBOT_MAX_SUBAGENTS === "0";
238
+ const promptKey = "Prompt" in args || !("prompt" in args) ? "Prompt" : "prompt";
239
+ const prompt = String(args[promptKey] ?? "");
240
+ if (nested && env.ALLOW_NESTED_SUBAGENTS !== "1" && !prompt.includes("ALLOW_NESTED_SUBAGENTS")) {
241
+ return { decision: "deny", reason: NESTED_REASON };
242
+ }
243
+ const overwrite = {};
244
+ const agent = args.TypeName;
245
+ if (typeof agent === "string" && Object.hasOwn(OVERHEAD_AGENTS, agent) && (!args.Model || args.Model === "inherit")) {
246
+ overwrite.Model = agent === "scout" ? "flash_lite" : "flash";
247
+ }
248
+ if (!prompt.includes("worker.md")) overwrite[promptKey] = `Read ${WORKER_BRIEF} before anything else.\n${prompt}`;
249
+ return Object.keys(overwrite).length ? { decision: "allow", overwrite } : { decision: "allow" };
250
+ }
251
+
252
+ function sliceDenyReason(root, target) {
253
+ const worker = process.env.DEEPMODEBOT_WORKER_ID;
254
+ if (!worker) return "";
255
+ if (!/^[A-Za-z0-9._-]+(?![\s\S])/.test(worker)) return "deepmodebot: invalid worker ID";
256
+ if (!fs.existsSync(path.join(root, ".scratch", "slices", `${worker}.json`))) return "";
257
+ const out = runPython(WORKER_GATE, ["check-write", "--root", root, "--worker", worker, "--path", target, "--json"], "", 5_000);
258
+ try {
259
+ if (out && JSON.parse(out).ok === true) return "";
260
+ } catch { return `deepmodebot: ${target} is outside the owned slice for ${worker}, or the slice could not be checked`; }
261
+ return `deepmodebot: ${target} is outside the owned slice for ${worker}, or the slice could not be checked`;
262
+ }
34
263
 
35
264
  // Kept as explicit slash tokens so scripts/whitelabel.py rebrands both /deepmodebot: and /deep.
36
265
  const SLASH_PREFIX = "/deepmodebot:";
37
266
  const SLASH_COMMANDS = [
38
267
  "/deep",
39
268
  "/deepmodebot",
269
+ "/suggest",
270
+ "/research",
40
271
  "/tournament",
41
272
  "/review-pr",
42
273
  "/land-pr",
@@ -217,13 +448,38 @@ function allowedRoots(roots, event) {
217
448
  return allowed.map(real);
218
449
  }
219
450
 
451
+ function guardDataDir() {
452
+ return process.env.PLUGIN_DATA || path.join(homeDirectory(), ".gemini", "antigravity", "deepmodebot-guard");
453
+ }
454
+
455
+ function conversationId(event) {
456
+ return String(event.conversationId ?? event.session_id ?? "").replace(/[^A-Za-z0-9_-]/g, "");
457
+ }
458
+
220
459
  function sessionMarkPath(event) {
221
- const dataDir =
222
- process.env.PLUGIN_DATA ||
223
- path.join(homeDirectory(), ".gemini", "antigravity", "deepmodebot-guard");
224
- const rawId = String(event.conversationId ?? event.session_id ?? "");
225
- const cleanId = rawId.replace(/[^A-Za-z0-9_-]/g, "");
226
- return cleanId ? path.join(dataDir, "active-sessions", cleanId) : null;
460
+ const id = conversationId(event);
461
+ return id ? path.join(guardDataDir(), "active-sessions", id) : null;
462
+ }
463
+
464
+ // Whether this conversation still needs its rules notice; marks it shown (marks older than 30 days are pruned).
465
+ function claimRulesNotice(event) {
466
+ const id = conversationId(event);
467
+ if (!id) return typeof event.invocationNum !== "number" || event.invocationNum <= 1;
468
+ const folder = path.join(guardDataDir(), "rules-notice");
469
+ const mark = path.join(folder, id);
470
+ if (fs.existsSync(mark)) return false;
471
+ try {
472
+ fs.mkdirSync(folder, { recursive: true });
473
+ const now = Date.now();
474
+ for (const entry of fs.readdirSync(folder)) {
475
+ const old = path.join(folder, entry);
476
+ if (now - fs.statSync(old).mtimeMs > MARK_MAX_AGE_MS) fs.unlinkSync(old);
477
+ }
478
+ fs.writeFileSync(mark, "");
479
+ } catch {
480
+ // Without a mark the notice may repeat; that is better than never showing it.
481
+ }
482
+ return true;
227
483
  }
228
484
 
229
485
  function readMarkState(markPath) {
@@ -296,6 +552,537 @@ function writeJsonAndExit(payload) {
296
552
  process.exit(0);
297
553
  }
298
554
 
555
+
556
+ const HOLDOUT_DIR = ".deepmodebot-holdout";
557
+ const HOLDOUT_FALLBACK = "deepmodebot-holdout";
558
+ const onWindows = process.platform === "win32";
559
+ const TMP_ROOTS = ["/tmp", "/var/tmp", "/private/tmp", "/var/folders", "/private/var/folders", "c:/windows/temp"];
560
+ const HOME_SPELLING_RE =
561
+ /^(?:~|\$\{?(?:home|userprofile)\}?|%(?:home|userprofile)%|\$\{?env:(?:home|userprofile)\}?|%homedrive%%homepath%|\$\{?(?:env:)?homedrive\}?\$\{?(?:env:)?homepath\}?)(?=\/|$)/i;
562
+ const LOCAL_SPELLING_RE = /^(?:\$\{?(?:env:)?localappdata\}?|%localappdata%)(?=\/|$)/i;
563
+ const GIT_RAW_RE = /(?:^|\/)[^/]*\.git\/(?:objects|logs|lost-found)(?:\/|$)|(?:^|\/)objects\/(?:pack|info|[0-9a-f]{2})(?:\/|$)/i;
564
+ const GLOB_RE = /[*?[]/;
565
+ const TEST_RE = /(?:^|[^a-z0-9])(?:tests?|specs?|holdouts?|hidden|golden|graders?|solutions?|answers?|expected|fixtures?)(?:[^a-z0-9]|$)/i;
566
+ 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.]*$/;
567
+ const LOOP_RE = /(?:^|[\s;&|(])(?:for|while|until|read|xargs)(?=$|[\s;&|)])/;
568
+ const COMMAND_PREFIXES = new Set(["sudo", "time", "command", "env", "nohup", "exec", "builtin", "nice", "then", "do", "else", "{"]);
569
+ const CD_COMMANDS = new Set(["cd", "pushd", "chdir", "sl", "set-location"]);
570
+ const GREP_FAMILY = new Set(["grep", "egrep", "fgrep", "rg", "ag", "ack", "sls", "select-string"]);
571
+ const ENUMERATORS = new Set(["find", "fd", "fdfind", "ls", "dir", "tree", "gci", "get-childitem", "locate", "mlocate"]);
572
+ const CONTENT_READERS = new Set([
573
+ "cat", "type", "head", "tail", "less", "more", "xargs", "strings", "bat", "tac", "nl", "od", "xxd", "hexdump",
574
+ "get-content", "gc", "select-string", "sls", "findstr",
575
+ ]);
576
+ const ALWAYS_RECURSIVE = new Set(["rg", "ag", "ack", "zip", "7z", "7za", "rsync", "robocopy", "xcopy"]);
577
+ const GREP_ARG_FLAGS = new Set([
578
+ "-e", "-f", "-m", "-A", "-B", "-C", "-g", "-t", "-T", "-j", "-M", "-d", "-D", "--regexp", "--file", "--max-count",
579
+ "--after-context", "--before-context", "--context", "--glob", "--iglob", "--type", "--type-not", "--include",
580
+ "--exclude", "--exclude-dir", "--include-dir", "--max-depth", "--threads", "-pattern", "-path", "-literalpath",
581
+ ]);
582
+ const GIT_GLOBAL_ARG_FLAGS = new Set(["-C", "-c", "--git-dir", "--work-tree", "--namespace", "--super-prefix", "--config-env"]);
583
+ const GIT_DENIED_SUBCOMMANDS = new Set(["unpack-file", "prune", "show-index", "verify-pack", "lost-found"]);
584
+ const GIT_REFLOG_SUBCOMMANDS = new Set(["log", "show", "rev-list", "whatchanged", "shortlog", "format-patch", "diff", "archive", "grep"]);
585
+ const GIT_CONTENT_SUBCOMMANDS = new Set(["show", "diff", "format-patch", "archive", "grep"]);
586
+ const GIT_RECOVER_SUBCOMMANDS = new Set([
587
+ "show", "cat-file", "checkout", "restore", "switch", "cherry-pick", "archive", "diff", "format-patch", "read-tree",
588
+ "reset", "merge", "branch", "tag", "update-ref", "worktree", "apply",
589
+ ]);
590
+ const GIT_CONTENT_FLAGS = [
591
+ "--patch", "--patch-with-stat", "--patch-with-raw", "--cc", "--stat", "--numstat", "--shortstat", "--raw", "--name-only",
592
+ "--name-status", "--full-diff", "--pickaxe-regex", "--pickaxe-all", "--word-diff", "--textconv", "--objects",
593
+ "--summary", "--dirstat",
594
+ ];
595
+ const TOOL_PATH_KEYS = new Set([
596
+ "path", "paths", "filepath", "file", "files", "notebookpath", "directory", "dir", "cwd", "root", "targetfile",
597
+ "searchpath", "searchdirectory", "directorypath", "absolutepath", "abspath", "workdir", "filename",
598
+ ]);
599
+ const TOOL_PATTERN_KEYS = new Set(["glob", "include", "pattern"]);
600
+ const SEARCH_TOOL_RE = /grep|glob|find|^ls$|list|tree|walk|^dir$|^rg$/i;
601
+
602
+ function holdoutReason(hit) {
603
+ 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.`;
604
+ }
605
+
606
+ function homeDirs() {
607
+ const env = process.env;
608
+ const found = [];
609
+ for (const home of [env.HOME, env.USERPROFILE, `${env.HOMEDRIVE ?? ""}${env.HOMEPATH ?? ""}`, os.homedir()]) {
610
+ if (home && home !== "~" && !found.includes(home)) found.push(home);
611
+ }
612
+ return found;
613
+ }
614
+
615
+ function prepPath(p) {
616
+ let text = p.replace(/\\/g, "/");
617
+ text = text.replace(/^file:\/{2,3}(?:localhost\/)?/i, "/");
618
+ if (/^\/[A-Za-z]:/.test(text)) text = text.slice(1);
619
+ text = text.replace(/^\/\/[?.]\//, "");
620
+ text = text.replace(/^\/\/(?:localhost|127\.0\.0\.1)\/([A-Za-z])\$(?=\/|$)/i, "$1:");
621
+ if (onWindows) {
622
+ text = text.replace(/^\/(?:mnt|cygdrive)\/([A-Za-z])(?=\/|$)/, "$1:");
623
+ text = text.replace(/^\/([A-Za-z])(?=\/)/, "$1:");
624
+ }
625
+ return text;
626
+ }
627
+
628
+ function toSegs(p) {
629
+ const text = prepPath(p);
630
+ const drive = /^[A-Za-z]:(?=\/|$)/.exec(text);
631
+ let root;
632
+ let rest;
633
+ if (drive) {
634
+ root = drive[0];
635
+ rest = text.slice(drive[0].length);
636
+ } else if (text.startsWith("/")) {
637
+ root = onWindows ? process.cwd().slice(0, 2) : "/";
638
+ rest = text;
639
+ } else {
640
+ return null;
641
+ }
642
+ const out = [];
643
+ for (let part of rest.split("/")) {
644
+ if (part === "" || part === ".") continue;
645
+ if (part === "..") {
646
+ out.pop();
647
+ continue;
648
+ }
649
+ if (onWindows) {
650
+ part = part.split(":")[0].replace(/[. ]+$/, "");
651
+ if (!part) continue;
652
+ }
653
+ out.push(part);
654
+ }
655
+ return caseless ? [root.toLowerCase(), ...out.map(part => part.toLowerCase())] : [root, ...out];
656
+ }
657
+
658
+ function joinSegs(segs) {
659
+ return (segs[0] !== "/" ? segs[0] : "") + "/" + segs.slice(1).join("/");
660
+ }
661
+
662
+ function toAbs(text, cwd) {
663
+ return toSegs(text) ?? toSegs(joinSegs(cwd) + "/" + prepPath(text)) ?? cwd;
664
+ }
665
+
666
+ function realpathLoose(p) {
667
+ try {
668
+ return fs.realpathSync.native(p);
669
+ } catch {
670
+ const parent = path.dirname(p);
671
+ return parent === p ? p : path.join(realpathLoose(parent), path.basename(p));
672
+ }
673
+ }
674
+
675
+ function realSegs(text, cwd) {
676
+ const raw = prepPath(text);
677
+ return toSegs(realpathLoose(toSegs(raw) ? raw : joinSegs(cwd) + "/" + raw));
678
+ }
679
+
680
+ function sameSegs(a, b) {
681
+ return a.length === b.length && a.every((part, i) => part === b[i]);
682
+ }
683
+
684
+ function startsWithSegs(segs, prefix) {
685
+ return segs.length >= prefix.length && prefix.every((part, i) => part === segs[i]);
686
+ }
687
+
688
+ function uniqueSegs(paths) {
689
+ const found = [];
690
+ for (const p of paths) {
691
+ for (const segs of [toSegs(p), toSegs(realpathLoose(p))]) {
692
+ if (segs && !found.some(f => sameSegs(f, segs))) found.push(segs);
693
+ }
694
+ }
695
+ return found;
696
+ }
697
+
698
+ function expandBraces(text, cap = 64) {
699
+ const match = /\{([^{}]*,[^{}]*)\}/.exec(text);
700
+ if (!match) return [text];
701
+ const out = [];
702
+ for (const alt of match[1].split(",")) {
703
+ out.push(...expandBraces(text.slice(0, match.index) + alt + text.slice(match.index + match[0].length), cap));
704
+ if (out.length >= cap) break;
705
+ }
706
+ return out.slice(0, cap);
707
+ }
708
+
709
+ function wordVariants(word) {
710
+ const out = [word];
711
+ for (let i = word.indexOf("="); i !== -1; i = word.indexOf("=", i + 1)) out.push(word.slice(i + 1));
712
+ for (const match of word.matchAll(/:(?=[~$%/\\])/g)) out.push(word.slice((match.index ?? 0) + 1));
713
+ return out.filter((v, i) => v !== "" && !out.slice(0, i).includes(v));
714
+ }
715
+
716
+ function segMatch(glob, name) {
717
+ if (!GLOB_RE.test(glob)) return glob === name;
718
+ if ("*?[".includes(glob[0]) && name.startsWith(".")) return false;
719
+ let out = "";
720
+ for (let i = 0; i < glob.length; i++) {
721
+ const ch = glob[i];
722
+ const close = ch === "[" ? glob.indexOf("]", i + 2) : -1;
723
+ if (ch === "*") {
724
+ out += "[^/]*";
725
+ } else if (ch === "?") {
726
+ out += "[^/]";
727
+ } else if (close !== -1) {
728
+ const body = glob.slice(i + 1, close);
729
+ out += "[" + (body[0] === "!" || body[0] === "^" ? "^" + body.slice(1) : body).replace(/\\/g, "\\\\") + "]";
730
+ i = close;
731
+ } else {
732
+ out += escapeRegex(ch);
733
+ }
734
+ }
735
+ try {
736
+ return new RegExp("^" + out + "$").test(name);
737
+ } catch {
738
+ return true;
739
+ }
740
+ }
741
+
742
+ function namedLiteral(seg) {
743
+ return !GLOB_RE.test(seg) || seg.replace(/[.*?[\]!^-]/g, "") !== "";
744
+ }
745
+
746
+ function globMatch(glob, i, root, j) {
747
+ if (j === root.length) return i < glob.length || (i > 0 && namedLiteral(glob[i - 1]));
748
+ if (i === glob.length) return false;
749
+ if (glob[i] === "**") return globMatch(glob, i + 1, root, j) || globMatch(glob, i, root, j + 1);
750
+ return segMatch(glob[i], root[j]) && globMatch(glob, i + 1, root, j + 1);
751
+ }
752
+
753
+ function wordBase(word) {
754
+ const name = (word.replace(/\\/g, "/").split("/").pop() ?? "").toLowerCase();
755
+ return name.endsWith(".exe") ? name.slice(0, -4) : name;
756
+ }
757
+
758
+ function leadIndex(words) {
759
+ let prefixed = false;
760
+ for (let i = 0; i < words.length; i++) {
761
+ if (/^[A-Za-z_]\w*=/.test(words[i]) || COMMAND_PREFIXES.has(wordBase(words[i]))) prefixed = true;
762
+ else if (!(prefixed && words[i].startsWith("-"))) return i;
763
+ }
764
+ return words.length;
765
+ }
766
+
767
+ function optIs(token, full, minLen) {
768
+ const name = token.split("=")[0];
769
+ return name.startsWith("--") && name.length >= minLen && full.startsWith(name);
770
+ }
771
+
772
+ class HoldoutScan {
773
+ homes = homeDirs();
774
+ cwd;
775
+ roots;
776
+ tmp;
777
+ realBudget = 200;
778
+
779
+ constructor(cwd) {
780
+ this.cwd = toSegs(cwd) ?? toSegs(process.cwd()) ?? ["/"];
781
+ const stores = this.homes.map(home => path.join(home, HOLDOUT_DIR));
782
+ const local = process.env.LOCALAPPDATA;
783
+ if (local) stores.push(path.join(local, HOLDOUT_FALLBACK));
784
+ stores.push("/tmp/" + HOLDOUT_FALLBACK);
785
+ this.roots = uniqueSegs(stores);
786
+ this.tmp = uniqueSegs([...TMP_ROOTS, ...this.homes.map(home => path.join(home, "AppData", "Local", "Temp"))]);
787
+ }
788
+
789
+ expand(item) {
790
+ const match = HOME_SPELLING_RE.exec(item);
791
+ if (match) return this.homes.length ? this.homes.map(home => home + item.slice(match[0].length)) : [item];
792
+ const local = process.env.LOCALAPPDATA;
793
+ const localMatch = LOCAL_SPELLING_RE.exec(item);
794
+ return localMatch && local ? [local + item.slice(localMatch[0].length)] : [item];
795
+ }
796
+
797
+ candidates(word, cwd) {
798
+ const found = [];
799
+ for (const variant of wordVariants(word.replace(/\\/g, "/"))) {
800
+ for (const item of expandBraces(variant)) {
801
+ for (const text of this.expand(item)) {
802
+ found.push(toAbs(text, cwd));
803
+ if (this.realBudget > 0 && prepPath(text).includes("/") && !GLOB_RE.test(text)) {
804
+ this.realBudget -= 1;
805
+ const real = realSegs(text, cwd);
806
+ if (real) found.push(real);
807
+ }
808
+ }
809
+ }
810
+ }
811
+ return found;
812
+ }
813
+
814
+ reaches(cands) {
815
+ return cands.some(c => this.roots.some(r => globMatch(c, 0, r, 0)));
816
+ }
817
+
818
+ above(cands, widen = false) {
819
+ return cands.map(c => (widen ? literalHead(c) : c))
820
+ .some(h => !h.some(s => GLOB_RE.test(s)) && this.roots.some(r => startsWithSegs(r, h)));
821
+ }
822
+
823
+ inTmp(segs) {
824
+ return this.tmp.some(t => startsWithSegs(segs, t)) && !startsWithSegs(segs, this.cwd);
825
+ }
826
+ }
827
+
828
+ function literalHead(segs) {
829
+ const i = segs.findIndex(seg => GLOB_RE.test(seg));
830
+ return i === -1 ? segs : segs.slice(0, i);
831
+ }
832
+
833
+ function computedHome(word) {
834
+ for (const variant of wordVariants(word)) {
835
+ const match = HOME_SPELLING_RE.exec(variant);
836
+ const first = match ? variant.slice(match[0].length).replace(/^\/+/, "").split("/")[0] : "";
837
+ if (first && /\$|%[A-Za-z_]\w*%/.test(first)) return true;
838
+ }
839
+ return false;
840
+ }
841
+
842
+ function grepSkips(words) {
843
+ const skips = new Set();
844
+ for (let i = 0; i < words.length; i++) {
845
+ const name = wordBase(words[i]);
846
+ if (!GREP_FAMILY.has(name)) continue;
847
+ let k = i + 1;
848
+ let havePattern = false;
849
+ while (k < words.length && words[k].startsWith("-") && words[k] !== "-" && words[k] !== "--") {
850
+ const flag = words[k].length <= 2 ? words[k] : words[k].toLowerCase();
851
+ if (flag.startsWith("--regexp=")) {
852
+ skips.add(k);
853
+ havePattern = true;
854
+ }
855
+ if (flag === "-e" || flag === "--regexp" || flag === "-pattern") {
856
+ havePattern = true;
857
+ skips.add(k + 1);
858
+ }
859
+ k += GREP_ARG_FLAGS.has(flag) || (name === "rg" && flag === "-r") ? 2 : 1;
860
+ }
861
+ if (k < words.length && words[k] === "--") k += 1;
862
+ if (!havePattern && k < words.length) skips.add(k);
863
+ }
864
+ return skips;
865
+ }
866
+
867
+ function contentFlag(token) {
868
+ return GIT_CONTENT_FLAGS.some(full => optIs(token, full, 4)) || /^-\d*[pu]$/.test(token)
869
+ || token.startsWith("-S") || token.startsWith("-G");
870
+ }
871
+
872
+ function gitCalls(words) {
873
+ const calls = [];
874
+ for (let i = 0; i < words.length; i++) {
875
+ const name = wordBase(words[i]);
876
+ const dashed = /^git-([a-z-]+)$/.exec(name);
877
+ if (dashed) {
878
+ calls.push([dashed[1], words.slice(i + 1)]);
879
+ } else if (name === "git") {
880
+ let k = i + 1;
881
+ while (k < words.length && words[k].startsWith("-")) k += GIT_GLOBAL_ARG_FLAGS.has(words[k]) ? 2 : 1;
882
+ if (k < words.length) calls.push([words[k].toLowerCase(), words.slice(k + 1)]);
883
+ }
884
+ }
885
+ return calls;
886
+ }
887
+
888
+ function reflogFlagged(sub, args) {
889
+ return GIT_REFLOG_SUBCOMMANDS.has(sub)
890
+ && args.some(a => a === "-g" || optIs(a, "--reflog", 6) || optIs(a, "--walk-reflogs", 7));
891
+ }
892
+
893
+ function gitHit(sub, args) {
894
+ if (sub === "cat-file" && args.some(a => optIs(a, "--batch-all-objects", 9))) return "git cat-file --batch-all-objects";
895
+ if (sub === "fsck" || sub === "fsck-objects") {
896
+ const bad = args.some(a => optIs(a, "--lost-found", 4) || optIs(a, "--unreachable", 4) || optIs(a, "--dangling", 3)
897
+ || optIs(a, "--no-reflogs", 6));
898
+ if (bad || !args.some(a => optIs(a, "--no-dangling", 8))) return "git fsck";
899
+ }
900
+ if (GIT_DENIED_SUBCOMMANDS.has(sub)) return "git " + sub;
901
+ const content = args.some(contentFlag);
902
+ if ((reflogFlagged(sub, args) && (GIT_CONTENT_SUBCOMMANDS.has(sub) || content)) || (sub === "reflog" && content)) {
903
+ return "git " + sub + " reflog content";
904
+ }
905
+ return null;
906
+ }
907
+
908
+ function gitRole(sub, args) {
909
+ const feeder = sub === "reflog" || reflogFlagged(sub, args) || (
910
+ sub === "rev-list" && args.some(a => optIs(a, "--objects", 5))
911
+ && args.some(a => a === "--all" || optIs(a, "--reflog", 6)));
912
+ const sink = GIT_RECOVER_SUBCOMMANDS.has(sub) || (sub === "cat-file" && args.some(a => a.startsWith("--batch")));
913
+ return [feeder, sink];
914
+ }
915
+
916
+ function isRecursive(name, args) {
917
+ const low = args.map(a => a.toLowerCase());
918
+ if (ALWAYS_RECURSIVE.has(name)) return true;
919
+ if (GREP_FAMILY.has(name)) {
920
+ return args.some(a => /^-[a-zA-Z]*[rR][a-zA-Z]*$/.test(a) || a === "--recursive" || a === "--dereference-recursive")
921
+ || low.includes("-recurse") || (args.includes("-d") && args.includes("recurse"));
922
+ }
923
+ if (name === "cp" || name === "scp" || name === "copy-item" || name === "cpi") {
924
+ return args.some(a => /^-[a-zA-Z]*[rRa][a-zA-Z]*$/.test(a) || a === "--recursive") || low.includes("-recurse");
925
+ }
926
+ if (name === "tar") return args.length > 0 && (args[0] === "--create" || /^-?[a-zA-Z]*c[a-zA-Z]*$/.test(args[0]));
927
+ return name === "findstr" && low.includes("/s");
928
+ }
929
+
930
+ function isContentReader(words) {
931
+ const consumes = words.some(w => GREP_FAMILY.has(wordBase(w)) || wordBase(w) === "sed" || wordBase(w) === "awk");
932
+ return words.some(w => CONTENT_READERS.has(wordBase(w)) || /^-(?:exec|execdir|ok|okdir)$/.test(w) || (w === "$" && consumes));
933
+ }
934
+
935
+ function sweepHit(scan, stages, content) {
936
+ const hasTest = TEST_RE.test(stages.flatMap(st => (st ? st.words : [])).join(" "));
937
+ for (const st of stages) {
938
+ if (!st) continue;
939
+ for (let i = 0; i < st.words.length; i++) {
940
+ const name = wordBase(st.words[i]);
941
+ const rec = isRecursive(name, st.words.slice(i + 1));
942
+ const enumerates = ENUMERATORS.has(name);
943
+ if ((rec || (enumerates && content)) && scan.above([...st.ops, st.start], rec)) {
944
+ return name + " over a directory holding the holdout store";
945
+ }
946
+ if (!hasTest) continue;
947
+ for (const op of st.ops) {
948
+ const broad = rec || (enumerates && content) || (CONTENT_READERS.has(name) && op.some(s => GLOB_RE.test(s)));
949
+ if (broad && scan.inTmp(op)) return name + " sweeping temp directories for tests";
950
+ }
951
+ }
952
+ }
953
+ return null;
954
+ }
955
+
956
+ function scanStage(scan, words, cur) {
957
+ const lead = leadIndex(words);
958
+ const skips = grepSkips(words);
959
+ const ops = [];
960
+ for (let i = 0; i < words.length; i++) {
961
+ const token = words[i].replace(/^\d*[<>]+/, "");
962
+ if (skips.has(i) || !token) continue;
963
+ if (GIT_RAW_RE.test(token.replace(/\\/g, "/"))) return { hit: token, stage: null };
964
+ if (token.startsWith("-") && !token.includes("=")) continue;
965
+ const cands = scan.candidates(token, cur);
966
+ if (computedHome(token) || scan.reaches(cands)) return { hit: token, stage: null };
967
+ if (i > lead) ops.push(...cands);
968
+ }
969
+ const gwords = words.flatMap(w => w.split(/[,[\]]+/).filter(Boolean));
970
+ const calls = [];
971
+ for (const [sub, args] of gitCalls(gwords)) {
972
+ const hit = gitHit(sub, args);
973
+ if (hit) return { hit, stage: null };
974
+ calls.push([sub, args]);
975
+ }
976
+ return { hit: null, stage: { words, ops, start: cur, git: calls, lead } };
977
+ }
978
+
979
+ function nextCwd(scan, st, cur) {
980
+ const { words, lead } = st;
981
+ if (lead >= words.length || !CD_COMMANDS.has(wordBase(words[lead])) || words.slice(lead + 1).includes("-")) return cur;
982
+ const args = words.slice(lead + 1).filter(w => !w.startsWith("-") && !/^\/[A-Za-z]$/.test(w));
983
+ const first = scan.candidates(args.length ? args[0] : "~", cur)[0];
984
+ return first.some(s => GLOB_RE.test(s)) ? cur : first;
985
+ }
986
+
987
+ function gitLinkHit(stages, ci, links) {
988
+ const feeders = [];
989
+ const sinks = [];
990
+ stages.forEach((st, si) => {
991
+ if (!st) return;
992
+ for (const [sub, args] of st.git) {
993
+ const [feeder, sink] = gitRole(sub, args);
994
+ if (feeder) feeders.push(si);
995
+ if (sink) sinks.push(si);
996
+ }
997
+ if (st.words.some(w => wordBase(w) === "xargs")) sinks.push(si);
998
+ });
999
+ links.feeders.push(...feeders.map((f) => [ci, f]));
1000
+ links.sinks.push(...sinks.map((s) => [ci, s]));
1001
+ return feeders.some(f => sinks.some(s => f !== s)) ? "git history listing piped into content recovery" : null;
1002
+ }
1003
+
1004
+ function scanText(scan, source) {
1005
+ const text = source.replace(/`([^`]*)`/g, "$$($1)");
1006
+ let cur = scan.cwd;
1007
+ const links = { feeders: [], sinks: [] };
1008
+ const chains = text.split(/\|\||&&|[;&\r\n]/);
1009
+ for (let ci = 0; ci < chains.length; ci++) {
1010
+ const stages = [];
1011
+ for (const part of chains[ci].split(/[|()]/)) {
1012
+ const words = part.split(/\s+/).filter(Boolean);
1013
+ const scanned = words.length ? scanStage(scan, words, cur) : { hit: null, stage: null };
1014
+ if (scanned.hit) return scanned.hit;
1015
+ stages.push(scanned.stage);
1016
+ if (scanned.stage) cur = nextCwd(scan, scanned.stage, cur);
1017
+ }
1018
+ const content = stages.some(st => st !== null && isContentReader(st.words));
1019
+ const hit = gitLinkHit(stages, ci, links) ?? sweepHit(scan, stages, content);
1020
+ if (hit) return hit;
1021
+ }
1022
+ const crossed = links.feeders.some(([fc, fs]) => links.sinks.some(([sc, ss]) => fc !== sc || fs !== ss));
1023
+ return LOOP_RE.test(text) && crossed ? "git history listing piped into content recovery" : null;
1024
+ }
1025
+
1026
+ function inlineNameHit(text, evalMode) {
1027
+ const reduced = text.toLowerCase().replace(/[\s'"+,()[\]`\\^$\/]/g, "");
1028
+ if (!reduced.includes("deepmodebot-holdout")) return null;
1029
+ const interpreted = text.split(/[\s;&|()'"`]+/).some(w => w !== "" && INTERPRETER_RE.test(wordBase(w)));
1030
+ return evalMode || interpreted ? HOLDOUT_DIR : null;
1031
+ }
1032
+
1033
+ function holdoutCommandHit(command, cwd, evalMode = false) {
1034
+ const stripped = String(command ?? "").replace(/(-m|--message)(=|\s+)("[^"]*"|'[^']*')/g, '$1 ""');
1035
+ const text = stripped.replace(/\\\r?\n/g, " ");
1036
+ const scan = new HoldoutScan(cwd);
1037
+ const inline = inlineNameHit(text, evalMode);
1038
+ if (inline) return inline;
1039
+ const flat = text.replace(/\$(?=['"])/g, "").replace(/['"]/g, "");
1040
+ for (const view of [flat.replace(/\\/g, "/"), flat.replace(/[\\^`]/g, "")]) {
1041
+ const hit = scanText(scan, view);
1042
+ if (hit) return hit;
1043
+ }
1044
+ return null;
1045
+ }
1046
+
1047
+ function toolVariants(value) {
1048
+ const out = [value, value.replace(/#[0-9A-Za-z]{4}$/, ""), value.replace(/:\d+(?:-\d+)?(?:,.*)?$/, "")];
1049
+ for (const pattern of [/^\[(.+)#[0-9A-Za-z]+\]$/, /^(.{2,}?):[^/\\]/]) {
1050
+ const match = pattern.exec(value);
1051
+ if (match) out.push(match[1]);
1052
+ }
1053
+ return out.filter((v, i) => v !== "" && !out.slice(0, i).includes(v));
1054
+ }
1055
+
1056
+ function toolStrings(value) {
1057
+ if (typeof value === "string") return [value];
1058
+ return Array.isArray(value) ? value.filter(v => typeof v === "string") : [];
1059
+ }
1060
+
1061
+ function holdoutToolHit(toolName, input, cwd) {
1062
+ const search = SEARCH_TOOL_RE.test(toolName);
1063
+ const patternOk = search && !toolName.toLowerCase().includes("grep");
1064
+ const bases = [];
1065
+ const patterns = [];
1066
+ for (const [key, value] of Object.entries(input)) {
1067
+ const norm = key.replace(/[_\-\s]/g, "").toLowerCase();
1068
+ if (TOOL_PATTERN_KEYS.has(norm) && (norm !== "pattern" || patternOk)) patterns.push(...toolStrings(value));
1069
+ if (TOOL_PATH_KEYS.has(norm)) bases.push(...toolStrings(value));
1070
+ }
1071
+ if (!search && bases.length === 0 && patterns.length === 0) return null;
1072
+ const scan = new HoldoutScan(cwd);
1073
+ const texts = [...bases, ...patterns].flatMap(value => value.split(";"));
1074
+ for (const base of bases.length ? bases : [joinSegs(scan.cwd)]) {
1075
+ for (const pattern of patterns) texts.push(base.replace(/[/\\]+$/, "") + "/" + pattern);
1076
+ }
1077
+ for (const text of texts) {
1078
+ for (const variant of toolVariants(text.trim())) {
1079
+ const cands = scan.candidates(variant, scan.cwd);
1080
+ if (GIT_RAW_RE.test(variant.replace(/\\/g, "/")) || scan.reaches(cands) || (search && scan.above(cands, true))) return variant;
1081
+ }
1082
+ }
1083
+ return search && bases.length === 0 && scan.above([scan.cwd]) ? joinSegs(scan.cwd) : null;
1084
+ }
1085
+
299
1086
  function main() {
300
1087
  const mode = process.argv[2] === "enforce" ? "enforce" : "session";
301
1088
  const raw = readStdinText();
@@ -319,6 +1106,11 @@ function main() {
319
1106
  (event.hookEventName == null && event.toolCall != null);
320
1107
 
321
1108
  if (!isPreToolUse) {
1109
+ const steps = [];
1110
+ if (claimRulesNotice(event)) {
1111
+ const notice = rulesNoticeStep(resolveSessionCwd(event));
1112
+ if (notice) steps.push(notice);
1113
+ }
322
1114
  if (ACTIVATION_RE.test(promptText)) {
323
1115
  const prevState = markPath ? readMarkState(markPath) : null;
324
1116
  if (markPath) {
@@ -342,40 +1134,78 @@ function main() {
342
1134
  // Non-fatal: still return the overview for this invocation.
343
1135
  }
344
1136
  }
345
- writeJsonAndExit({
346
- injectSteps: [
347
- {
348
- systemMessage: {
349
- systemMessage: `deepmodebot workspace-map (auto-injected):\n${overview}`,
350
- metadata: { source: "deepmodebot", kind: "workspace-map" },
351
- },
352
- },
353
- ],
1137
+ steps.push({
1138
+ systemMessage: {
1139
+ systemMessage: `deepmodebot workspace-map (auto-injected):\n${overview}`,
1140
+ metadata: { source: "deepmodebot", kind: "workspace-map" },
1141
+ },
354
1142
  });
355
- return;
356
1143
  }
357
1144
  } catch {
358
1145
  // Fail open cleanly if workspace-map overview cannot be generated.
359
1146
  }
360
1147
  }
361
1148
  }
362
- writeJsonAndExit({});
1149
+ writeJsonAndExit(steps.length ? { injectSteps: steps } : {});
363
1150
  return;
364
1151
  }
365
1152
 
366
- if (mode !== "enforce" && !(markPath && fs.existsSync(markPath))) {
1153
+ const toolCall = event.toolCall && typeof event.toolCall === "object" ? event.toolCall : {};
1154
+ const toolName = String(toolCall.name ?? "");
1155
+ const args = toolCall.args && typeof toolCall.args === "object" ? toolCall.args : {};
1156
+ const sessionCwd = resolveSessionCwd(event);
1157
+ const ruleTarget = args.Path ?? args.TargetFile ?? args.path ?? args.targetFile;
1158
+ const ruleCwd = SHELL_TOOLS.has(toolName) && typeof (args.Cwd ?? args.cwd) === "string"
1159
+ ? absolute(String(args.Cwd ?? args.cwd), sessionCwd)
1160
+ : sessionCwd;
1161
+ const ruleReason = SHELL_TOOLS.has(toolName)
1162
+ ? ruleDenyReason(ruleCwd, [], String(args.CommandLine ?? args.command ?? args.cmd ?? ""))
1163
+ : WRITE_TOOLS.has(toolName) && typeof ruleTarget === "string" && ruleTarget.trim()
1164
+ ? ruleDenyReason(sessionCwd, [ruleTarget.trim()], "")
1165
+ : "";
1166
+ if (ruleReason) {
1167
+ writeJsonAndExit({ decision: "deny", reason: ruleReason });
1168
+ return;
1169
+ }
1170
+
1171
+ const parentMark = sessionMarkPath({ conversationId: process.env.AGY_PARENT_CONVERSATION_ID });
1172
+ const active = mode === "enforce" || [markPath, parentMark].some(p => p && fs.existsSync(p));
1173
+ if (active || process.env.DEEPMODEBOT_WORKER_ID) {
1174
+ const holdoutHit = SHELL_TOOLS.has(toolName)
1175
+ ? holdoutCommandHit(String(args.CommandLine ?? args.command ?? args.cmd ?? ""), ruleCwd)
1176
+ : holdoutToolHit(toolName, args, sessionCwd);
1177
+ if (holdoutHit) {
1178
+ writeJsonAndExit({ decision: "deny", reason: holdoutReason(holdoutHit) });
1179
+ return;
1180
+ }
1181
+ }
1182
+ if (!active) {
367
1183
  writeJsonAndExit({ decision: "allow" });
368
1184
  return;
369
1185
  }
370
1186
 
371
- const toolCall = event.toolCall && typeof event.toolCall === "object" ? event.toolCall : {};
372
- const toolName = String(toolCall.name ?? "");
1187
+ if (toolName === "invoke_subagent") {
1188
+ writeJsonAndExit(spawnVerdict(args));
1189
+ return;
1190
+ }
1191
+
1192
+ if (SHELL_TOOLS.has(toolName)) {
1193
+ const cmdStr = args.CommandLine ?? args.command ?? args.cmd ?? "";
1194
+ const hit = findShellRewardHack(cmdStr);
1195
+ if (hit) {
1196
+ writeJsonAndExit({
1197
+ decision: "deny",
1198
+ reason: `deepmodebot anti-reward-hacking guard blocked "${hit}": builders may not zero thresholds, skip reference/verification gates, or tamper with provenance ledgers.`,
1199
+ });
1200
+ return;
1201
+ }
1202
+ writeJsonAndExit({ decision: "allow" });
1203
+ return;
1204
+ }
373
1205
  if (!WRITE_TOOLS.has(toolName)) {
374
1206
  writeJsonAndExit({ decision: "allow" });
375
1207
  return;
376
1208
  }
377
-
378
- const args = toolCall.args && typeof toolCall.args === "object" ? toolCall.args : {};
379
1209
  const target = args.Path ?? args.TargetFile ?? args.path ?? args.targetFile;
380
1210
  if (typeof target !== "string" || !target.trim()) {
381
1211
  writeJsonAndExit({ decision: "allow" });
@@ -394,7 +1224,13 @@ function main() {
394
1224
  }
395
1225
  }
396
1226
 
397
- const resolvedTarget = real(absolute(target.trim(), cwd));
1227
+ const absTarget = absolute(target.trim(), cwd);
1228
+ const sliceReason = sliceDenyReason(roots[0], absTarget);
1229
+ if (sliceReason) {
1230
+ writeJsonAndExit({ decision: "deny", reason: sliceReason });
1231
+ return;
1232
+ }
1233
+ const resolvedTarget = real(absTarget);
398
1234
  const allowed = allowedRoots(roots, event);
399
1235
  if (allowed.some(r => inside(resolvedTarget, r))) {
400
1236
  writeJsonAndExit({ decision: "allow" });