deepmodebot 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +20 -0
- package/.claude-plugin/marketplace.json +2 -2
- package/.omp-plugin/marketplace.json +2 -2
- package/README.md +29 -5
- package/bin/deepmodebot.mjs +187 -10
- package/lib/clients.mjs +50 -3
- package/lib/tree.mjs +64 -10
- package/lib/version.mjs +26 -0
- package/native/dmb-gate/Cargo.toml +13 -0
- package/native/dmb-gate/src/agents.rs +77 -0
- package/native/dmb-gate/src/ci.rs +516 -0
- package/native/dmb-gate/src/cleanup.rs +198 -0
- package/native/dmb-gate/src/gap.rs +1376 -0
- package/native/dmb-gate/src/guard.rs +135 -0
- package/native/dmb-gate/src/main.rs +327 -0
- package/native/dmb-gate/src/map.rs +173 -0
- package/native/dmb-gate/src/perf.rs +347 -0
- package/native/dmb-gate/src/reward.rs +1214 -0
- package/native/dmb-gate/src/skill_check.rs +171 -0
- package/native/dmb-gate/src/slop.rs +1238 -0
- package/native/dmb-gate/src/ui.rs +842 -0
- package/native/dmb-gate/src/util.rs +260 -0
- package/native/dmb-net/go.mod +3 -0
- package/native/dmb-net/main.go +624 -0
- package/native/dmb-net/main_test.go +122 -0
- package/package.json +12 -2
- package/plugins/deepmodebot/.antigravity-plugin/plugin.json +1 -1
- package/plugins/deepmodebot/.antigravity-plugin/skills/deep/SKILL.md +5 -5
- package/plugins/deepmodebot/.antigravity-plugin/skills/pr-thread/SKILL.md +1 -1
- package/plugins/deepmodebot/.antigravity-plugin/skills/review-pr/SKILL.md +2 -2
- package/plugins/deepmodebot/.antigravity-plugin/skills/suggest/SKILL.md +13 -0
- package/plugins/deepmodebot/.antigravity-plugin/skills/tournament/SKILL.md +2 -2
- package/plugins/deepmodebot/.claude-plugin/plugin.json +1 -1
- package/plugins/deepmodebot/.codex-plugin/plugin.json +46 -0
- package/plugins/deepmodebot/agents/comment-sicko/agent.md +35 -0
- package/plugins/deepmodebot/agents/researcher/agent.md +33 -0
- package/plugins/deepmodebot/agents/reviewer/agent.md +4 -2
- package/plugins/deepmodebot/agents/scout/agent.md +11 -12
- package/plugins/deepmodebot/agents/security-reviewer/agent.md +2 -1
- package/plugins/deepmodebot/commands/deep.md +6 -6
- package/plugins/deepmodebot/commands/research.md +8 -0
- package/plugins/deepmodebot/commands/suggest.md +10 -0
- package/plugins/deepmodebot/commands/tournament.md +2 -2
- package/plugins/deepmodebot/hooks/hooks.json +2 -2
- package/plugins/deepmodebot/hooks.json +1 -1
- package/plugins/deepmodebot/scripts/antigravity-guard.mjs +140 -7
- package/plugins/deepmodebot/scripts/omp-mcp-server.mjs +179 -47
- package/plugins/deepmodebot/skills/agent-harnesses/SKILL.md +4 -6
- package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/check_antigravity.py +3 -0
- package/plugins/deepmodebot/skills/agent-harnesses/references/ai-native-tooling.md +4 -0
- package/plugins/deepmodebot/skills/agent-harnesses/references/ai-sdk-selection.md +3 -1
- package/plugins/deepmodebot/skills/agent-harnesses/references/antigravity.md +2 -2
- package/plugins/deepmodebot/skills/agent-harnesses/references/delegation-efficiency.md +12 -2
- package/plugins/deepmodebot/skills/agent-harnesses/references/protocols.md +11 -3
- package/plugins/deepmodebot/skills/app-automation-relay/SKILL.md +17 -0
- package/plugins/deepmodebot/skills/app-automation-relay/assets/relay_server.ts +364 -0
- package/plugins/deepmodebot/skills/app-automation-relay/references/adapter-cookbook.md +15 -0
- package/plugins/deepmodebot/skills/app-automation-relay/references/wire-protocol.md +23 -0
- package/plugins/deepmodebot/skills/cloud-devsecops/SKILL.md +4 -3
- package/plugins/deepmodebot/skills/cloud-devsecops/references/cloudflare-edge.md +43 -0
- package/plugins/deepmodebot/skills/cloud-devsecops/references/local-emulators.md +15 -2
- package/plugins/deepmodebot/skills/contribute/SKILL.md +3 -35
- package/plugins/deepmodebot/skills/create-formal-verification-skill/LICENSE +21 -0
- package/plugins/deepmodebot/skills/create-formal-verification-skill/NOTICE.md +16 -0
- package/plugins/deepmodebot/skills/create-formal-verification-skill/SKILL.md +71 -0
- package/plugins/deepmodebot/skills/create-verification-skill/SKILL.md +2 -2
- package/plugins/deepmodebot/skills/deep-learning/LICENSE +21 -0
- package/plugins/deepmodebot/skills/deep-learning/SKILL.md +33 -0
- package/plugins/deepmodebot/skills/deep-learning/references/neural-architectures.md +43 -0
- package/plugins/deepmodebot/skills/deep-learning/references/papers-and-repos.md +128 -0
- package/plugins/deepmodebot/skills/deep-learning/references/reinforcement-learning.md +57 -0
- package/plugins/deepmodebot/skills/deep-learning/references/training-optimization.md +40 -0
- package/plugins/deepmodebot/skills/deep-learning/references/weight-space-programming.md +76 -0
- package/plugins/deepmodebot/skills/deep-learning/scripts/hf_passes.py +166 -0
- package/plugins/deepmodebot/skills/deep-learning/scripts/wsp.py +493 -0
- package/plugins/deepmodebot/skills/deep-stack/SKILL.md +1 -1
- package/plugins/deepmodebot/skills/deep-stack/references/design-workflow.md +46 -92
- package/plugins/deepmodebot/skills/deep-stack/references/isolate.md +1 -0
- package/plugins/deepmodebot/skills/deep-stack/references/prove.md +6 -0
- package/plugins/deepmodebot/skills/deep-stack/references/stack.md +11 -1
- package/plugins/deepmodebot/skills/deepmodebot/SKILL.md +74 -145
- package/plugins/deepmodebot/skills/deepmodebot/assets/agents-md/agents_md.py +18 -6
- package/plugins/deepmodebot/skills/deepmodebot/assets/autoroute/autoroute.py +1021 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/cleanup/self_cleanup.py +305 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/claude_guard.py +98 -5
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/omp-contain.ts +106 -5
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/design.py +3 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/record.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/rehearsal_gate.py +536 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/review.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/formal-verification/verify_proof.py +638 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/gap-audit/gap_audit.py +1053 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/gen-ui/gen_ui.py +1782 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard-patterns.txt +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard.sh +3 -2
- package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard.ts +9 -5
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/ghapp.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/install.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/local-ci/local_ci.py +540 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/local-ci/slop_gate.py +642 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/loop.py +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/plan.py +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/windows_job.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/memory/project_memory.py +529 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/bench_harness.py +48 -21
- package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/perf_audit.py +339 -5
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/diff_coverage.py +96 -6
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/pr_agent_local.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/arena.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/show_thread.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/prompt-tools/prompt_tools.py +1239 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/quota-guard/quota_guard.py +424 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/repo-references.json +477 -1
- package/plugins/deepmodebot/skills/deepmodebot/assets/reward-guard/reward_guard.py +1597 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rule-paths.json +57 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rule_ledger.py +1645 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_enrich.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_meta.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_transcript_relay.js +13 -10
- package/plugins/deepmodebot/skills/deepmodebot/assets/security-audit/static_sec_audit.py +275 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/self-grill/self_grill.py +1473 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/setup/model_setup.py +329 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/setup/project_setup.py +312 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/tournament/tournament.py +304 -18
- package/plugins/deepmodebot/skills/deepmodebot/assets/workspace-map/workspace_map.py +121 -78
- package/plugins/deepmodebot/skills/deepmodebot/references/README.md +14 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/catalog.md +16 -11
- package/plugins/deepmodebot/skills/deepmodebot/references/contain.md +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/delegation.md +14 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/flows.md +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/full-scope.md +9 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/babysit.md +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/end-to-end.md +12 -9
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/feature.md +7 -3
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/hillclimb.md +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/investigation.md +4 -4
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/opening-a-pr.md +1 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/perf-issue.md +13 -10
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/refactoring.md +6 -6
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/reference-rebuild.md +1 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/run-a-goal.md +3 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/setup.md +1 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/visual-parity.md +1 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/work-a-queue.md +4 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/principles/hardcore-mode.md +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/principles/no-reward-hacking.md +8 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/principles/test-behavior-not-implementation.md +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/principles/type-system-discipline.md +2 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/rule-approval.md +51 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/architect.md +10 -24
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/architecture-review.md +5 -4
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/arena.md +3 -3
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/autoroute.md +49 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/blast-radius.md +1 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/catchup-video.md +13 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/correct.md +8 -7
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/course.md +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/devex-review.md +13 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/expand-contract.md +13 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/formal-verification.md +33 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/gen-ui.md +60 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/grill.md +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/how.md +7 -18
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/inner-loop.md +7 -7
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/model-setup.md +14 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/modernize-pr.md +15 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/mutation-testing.md +13 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/no-comments.md +5 -5
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/panel.md +7 -3
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pr-conversation.md +1 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pr-review.md +8 -5
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pre-commit.md +1 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/prior-art.md +33 -38
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/product-lens.md +12 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/prompt-upgrade.md +30 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/recall.md +1 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/reframe.md +18 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/release-and-canary.md +10 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/research.md +62 -89
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/security-audit.md +5 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/self-grill.md +54 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/sharpen.md +3 -3
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/show-me-your-work.md +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/sme-review.md +3 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/suggest.md +24 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/swarm.md +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/teach.md +2 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/tournament.md +12 -11
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/variant-analysis.md +11 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/video-forensics.md +46 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/visual-e2e.md +10 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/webhook-ui.md +11 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/writing-for-agents.md +6 -0
- package/plugins/deepmodebot/skills/deepmodebot/scripts/check_skill.py +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/scripts/trending.py +141 -18
- package/plugins/deepmodebot/skills/deepmodebot/worker.md +16 -0
- package/plugins/deepmodebot/skills/domain-rules/SKILL.md +13 -119
- package/plugins/deepmodebot/skills/domain-rules/references/backend-system-design.md +19 -1
- package/plugins/deepmodebot/skills/domain-rules/references/engineering-practice.md +7 -0
- package/plugins/deepmodebot/skills/domain-rules/references/language-ecosystems.md +11 -0
- package/plugins/deepmodebot/skills/domain-rules/references/sources.md +108 -0
- package/plugins/deepmodebot/skills/frontend-ui/SKILL.md +30 -131
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/canvas.css +42 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/editorial.css +39 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/layouts.css +95 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/swiss.css +40 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/tactile.css +41 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/workbench.css +50 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/mobbin-animations.md +49 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/mobbin-shipped-apps.md +46 -24
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/motion-clips.md +27 -258
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/motion-graphics.md +26 -51
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/pinterest-animations.md +22 -195
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/00-art-direction.md +39 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/01-workflow.md +27 -24
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/02-review-rubric.md +23 -17
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/03-ai-tells.md +22 -45
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/04-components.md +11 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/04a-agent-ui.md +32 -152
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/05-motion.md +36 -91
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/05a-motion-graphics.md +14 -120
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06-typography-layout.md +11 -10
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06a-color.md +9 -9
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06b-media-icons-charts.md +19 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06c-product-shots-craft.md +42 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/07-copy.md +5 -6
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/08-quality-floor.md +28 -56
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/09-steering-agents.md +9 -7
- package/plugins/deepmodebot/skills/frontend-ui/scripts/motion_diff.py +259 -0
- package/plugins/deepmodebot/skills/frontend-ui/scripts/ui_audit.py +496 -0
- package/plugins/deepmodebot/skills/maintain-formal-verification-skill/LICENSE +21 -0
- package/plugins/deepmodebot/skills/maintain-formal-verification-skill/NOTICE.md +16 -0
- package/plugins/deepmodebot/skills/maintain-formal-verification-skill/SKILL.md +68 -0
- package/plugins/deepmodebot/skills/maintain-verification-skill/SKILL.md +1 -1
- package/plugins/deepmodebot/skills/office-documents/SKILL.md +24 -0
- package/plugins/deepmodebot/skills/office-documents/references/documents-docx-pdf.md +15 -0
- package/plugins/deepmodebot/skills/office-documents/references/presentations-pptx.md +15 -0
- package/plugins/deepmodebot/skills/office-documents/references/spreadsheets-xlsx.md +15 -0
- package/plugins/deepmodebot/skills/office-documents/scripts/doc_audit.py +230 -0
- package/plugins/deepmodebot/skills/project-brief/SKILL.md +2 -19
- package/plugins/deepmodebot/skills/project-brief/assets/pr-overlap.py +4 -0
- package/plugins/deepmodebot/skills/project-brief/assets/sync-roadmap.py +4 -0
- package/plugins/deepmodebot/skills/project-brief/references/claim-contract.md +55 -0
- package/plugins/deepmodebot/skills/research/SKILL.md +18 -0
- package/plugins/deepmodebot/skills/secrets-and-auth/SKILL.md +1 -1
- package/plugins/deepmodebot/skills/seo-and-geo/SKILL.md +29 -0
- package/plugins/deepmodebot/skills/seo-and-geo/references/geo-and-agentic-web.md +30 -0
- package/plugins/deepmodebot/skills/seo-and-geo/references/technical-and-schema.md +25 -0
- package/plugins/deepmodebot/skills/seo-and-geo/scripts/seo_audit.py +282 -0
- package/plugins/deepmodebot/skills/software-architecture/SKILL.md +2 -2
- package/plugins/deepmodebot/skills/software-architecture/references/backend-infrastructure.md +5 -0
- package/plugins/deepmodebot/skills/software-architecture/references/monorepos.md +1 -0
- package/plugins/deepmodebot/skills/statechart/LICENSE +21 -0
- package/plugins/deepmodebot/skills/statechart/NOTICE.md +21 -0
- package/plugins/deepmodebot/skills/statechart/SKILL.md +106 -0
- package/plugins/deepmodebot/skills/statechart/references/render.md +93 -0
- package/plugins/deepmodebot/skills/statechart/references/tooling.md +78 -0
- package/plugins/deepmodebot/skills/statechart/scripts/backends/cfg.ts +33 -0
- package/plugins/deepmodebot/skills/statechart/scripts/backends/mermaid.ts +249 -0
- package/plugins/deepmodebot/skills/statechart/scripts/backends/plain-text.ts +72 -0
- package/plugins/deepmodebot/skills/statechart/scripts/backends/report.ts +177 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/config.ts +276 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/dot.ts +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/marks.ts +93 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/messages.ts +52 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/spec.ts +114 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/trace.ts +24 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/value.ts +166 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/verdict.ts +40 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/view.ts +119 -0
- package/plugins/deepmodebot/skills/statechart/scripts/ir.ts +547 -0
- package/plugins/deepmodebot/skills/statechart/scripts/janitor.ts +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/kill.ts +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/package.json +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/annotate.ts +128 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/label.ts +269 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/lift.ts +85 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/loop-check.ts +68 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/paths.ts +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/reach.ts +135 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/region-check.ts +97 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/regions.ts +295 -0
- package/plugins/deepmodebot/skills/statechart/scripts/pipeline.ts +76 -0
- package/plugins/deepmodebot/skills/statechart/scripts/run.ts +500 -0
- package/plugins/deepmodebot/skills/statechart/scripts/statechart +29 -0
- package/plugins/deepmodebot/skills/statechart/scripts/statechart.ts +165 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/ConfigOracle.java +63 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/chart.test.ts +1253 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Braces.mmd +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Escapes.mmd +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Phases.mmd +29 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/cli.test.ts +1344 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/config-fuzz.test.ts +263 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/Counter.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/Counter.tla +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/chart.mmd +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/report.md +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/verdict-1.out +49 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/ChartRun.out +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.tla +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/chart.mmd +26 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/graph.dot +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/report.md +20 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.out +82 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-3.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/chart.mmd +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/report.md +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.out +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/ChartRun.out +69 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/chart.mmd +85 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/graph.dot +70 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/report.md +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.out +67 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.out +85 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.cfg +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.tla +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/chart.mmd +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/graph.dot +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/report.md +31 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.out +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/ChartRun.out +55 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.tla +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/chart.mmd +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/graph.dot +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/report.md +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.out +33 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-2.out +54 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/ChartRun.out +54 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.tla +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/chart.mmd +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/graph.dot +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/report.md +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/verdict-1.out +46 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.tla +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterSteps.tla +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/chart.mmd +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/graph.dot +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/report.md +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/sany.out +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.out +78 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.tla +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/chart.mmd +26 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/graph.dot +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/report.md +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/chart.mmd +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/graph.dot +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/report.md +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.out +76 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/chart.mmd +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/graph.dot +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/report.md +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.out +67 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/ChartRun.out +62 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.cfg +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.tla +24 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/Moves.tla +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/chart.mmd +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/graph.dot +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/report.md +23 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/sany.out +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.out +66 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.out +74 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-4.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/ChartRun.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.tla +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/chart.mmd +18 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/graph.dot +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/report.md +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.out +33 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.tla +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/chart.mmd +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/graph.dot +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/report.md +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/verdict-1.out +49 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/ChartRun.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.tla +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/chart.mmd +30 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/graph.dot +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/report.md +27 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.out +87 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-4.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/ChartRun.out +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.tla +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/chart.mmd +23 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/graph.dot +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/report.md +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/ChartRun.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/CounterView.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/CounterView.tla +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/chart.mmd +23 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/graph.dot +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/report.md +27 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-2.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-3.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-3.out +87 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-4.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/DieHard.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/DieHard.tla +38 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/chart.mmd +92 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/graph.dot +126 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/report.md +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-1.out +91 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/ChartRun.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.cfg +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/chart.mmd +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/report.md +25 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.out +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/chart.mmd +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/graph.dot +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/report.md +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.out +72 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/Login.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/Login.tla +62 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/chart.mmd +28 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/graph.dot +40 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/report.md +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/verdict-1.out +47 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.tla +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/chart.mmd +28 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/graph.dot +37 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/report.md +8 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/verdict-1.out +47 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/ChartRun.out +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.tla +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/chart.mmd +44 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/graph.dot +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/report.md +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.out +83 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/ChartRun.out +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.tla +103 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/chart.mmd +43 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/graph.dot +93 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/report.md +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-2.out +72 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/view.mjs +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.tla +100 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/chart.mmd +31 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/graph.dot +85 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/report.md +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/verdict-1.out +47 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/view.mjs +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayer.tla +103 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.tla +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/chart.mmd +42 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/graph.dot +93 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/report.md +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-2.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-3.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.out +66 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-6.out +49 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/view.mjs +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.cfg +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/chart.mmd +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/graph.dot +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/report.md +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/sany.out +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/verdict-1.out +70 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ChartRun.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/Shadow.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/Shadow.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ShadowLib.tla +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ShadowSub.tla +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/chart.mmd +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/report.md +8 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/sany.out +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/verdict-1.out +65 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.tla +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/chart.mmd +23 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/graph.dot +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/report.md +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.out +65 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.out +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/ChartRun.out +69 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.tla +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/chart.mmd +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/graph.dot +297 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/report.md +20 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.out +95 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.tla +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/chart.mmd +37 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/graph.dot +223 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/report.md +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/verdict-1.out +47 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.out +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.cfg +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/chart.mmd +18 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/graph.dot +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/report.md +29 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.out +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/ChartRun.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.tla +8 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/chart.mmd +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/report.md +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.out +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus.test.ts +441 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/differential.test.ts +565 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/drawn.ts +20 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/grid/Grid.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/grid/Grid.tla +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/grid/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/java.ts +63 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/labels.ts +648 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/messages.test.ts +226 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/pipeline.test.ts +270 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/plain-tlc.test.ts +255 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/render.test.ts +145 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/tlc-out.test.ts +90 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/tlc.ts +158 -0
- package/plugins/deepmodebot/skills/statechart/scripts/tsconfig.json +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/worker.ts +35 -0
- package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/bun.lock +0 -391
- package/plugins/deepmodebot/skills/deepmodebot/assets/agents-md/test_agents_md.py +0 -146
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_antigravity_guard.py +0 -483
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_audit_regressions.py +0 -139
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_contain.py +0 -301
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_omp_mcp.py +0 -602
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_design.py +0 -69
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_evidence.py +0 -160
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_record.py +0 -180
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_review.py +0 -265
- package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/test_git_guard.py +0 -192
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_bot.py +0 -2182
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_brand.py +0 -19
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_local_updates.py +0 -691
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_review_context.py +0 -127
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_workspace_cleanup.py +0 -496
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_loop.py +0 -1426
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_plan.py +0 -320
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_windows_job.py +0 -326
- package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/test_bench_harness.py +0 -55
- package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/test_perf_audit.py +0 -53
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/test_diff_coverage.py +0 -94
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/test_arena.py +0 -610
- package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/test_yt_enrich.py +0 -250
- package/plugins/deepmodebot/skills/deepmodebot/assets/tournament/test_tournament.py +0 -654
- package/plugins/deepmodebot/skills/deepmodebot/assets/workspace-map/test_workspace_map.py +0 -879
|
@@ -0,0 +1,1238 @@
|
|
|
1
|
+
use crate::util::{glob_match, json_escape, parallel_map};
|
|
2
|
+
use std::collections::BTreeSet;
|
|
3
|
+
use std::fs;
|
|
4
|
+
use std::path::{Path, PathBuf};
|
|
5
|
+
use std::process::{Command, ExitCode};
|
|
6
|
+
use std::thread;
|
|
7
|
+
|
|
8
|
+
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
9
|
+
pub struct Finding {
|
|
10
|
+
pub severity: &'static str,
|
|
11
|
+
pub rule: &'static str,
|
|
12
|
+
pub file: String,
|
|
13
|
+
pub line: usize,
|
|
14
|
+
pub message: String,
|
|
15
|
+
pub fix: &'static str,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const GUARDRAIL_CONFIGS: &[&str] = &[
|
|
19
|
+
".deepmodebot/ci.yml",
|
|
20
|
+
".deepmodebot/policy.xml",
|
|
21
|
+
".github/dependabot.yml",
|
|
22
|
+
"ruff.toml",
|
|
23
|
+
".ruff.toml",
|
|
24
|
+
"pyproject.toml",
|
|
25
|
+
"tsconfig.json",
|
|
26
|
+
"biome.json",
|
|
27
|
+
"eslint.config.js",
|
|
28
|
+
"eslint.config.mjs",
|
|
29
|
+
".eslintrc.json",
|
|
30
|
+
".prettierrc",
|
|
31
|
+
".pre-commit-config.yaml",
|
|
32
|
+
"lefthook.yml",
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
fn git(root: &Path, args: &[&str]) -> Option<(bool, String)> {
|
|
36
|
+
let out = Command::new("git")
|
|
37
|
+
.arg("-C")
|
|
38
|
+
.arg(root)
|
|
39
|
+
.args(args)
|
|
40
|
+
.output()
|
|
41
|
+
.ok()?;
|
|
42
|
+
Some((
|
|
43
|
+
out.status.success(),
|
|
44
|
+
String::from_utf8_lossy(&out.stdout).into_owned(),
|
|
45
|
+
))
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
fn changed_files(root: &Path, staged: bool, explicit: &[String]) -> Vec<String> {
|
|
49
|
+
if !explicit.is_empty() {
|
|
50
|
+
let mut set = BTreeSet::new();
|
|
51
|
+
for raw in explicit {
|
|
52
|
+
for part in raw.split(',') {
|
|
53
|
+
let mut n = part.trim().replace('\\', "/");
|
|
54
|
+
while let Some(rest) = n.strip_prefix("./") {
|
|
55
|
+
n = rest.to_string();
|
|
56
|
+
}
|
|
57
|
+
let n = n.trim_start_matches('/').to_string();
|
|
58
|
+
if !n.is_empty() {
|
|
59
|
+
set.insert(n);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return set.into_iter().collect();
|
|
64
|
+
}
|
|
65
|
+
let mut set = BTreeSet::new();
|
|
66
|
+
let has_head = git(root, &["rev-parse", "--verify", "HEAD"])
|
|
67
|
+
.map(|(ok, _)| ok)
|
|
68
|
+
.unwrap_or(false);
|
|
69
|
+
if staged {
|
|
70
|
+
if let Some((true, out)) =
|
|
71
|
+
git(root, &["diff", "--cached", "--name-only", "--diff-filter=ACMR"])
|
|
72
|
+
{
|
|
73
|
+
for l in out.lines().map(str::trim).filter(|l| !l.is_empty()) {
|
|
74
|
+
set.insert(l.to_string());
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
} else {
|
|
78
|
+
if has_head {
|
|
79
|
+
if let Some((true, out)) =
|
|
80
|
+
git(root, &["diff", "HEAD", "--name-only", "--diff-filter=ACMR"])
|
|
81
|
+
{
|
|
82
|
+
for l in out.lines().map(str::trim).filter(|l| !l.is_empty()) {
|
|
83
|
+
set.insert(l.to_string());
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
} else if let Some((true, out)) = git(root, &["ls-files"]) {
|
|
87
|
+
for l in out.lines().map(str::trim).filter(|l| !l.is_empty()) {
|
|
88
|
+
set.insert(l.to_string());
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if let Some((true, out)) = git(root, &["ls-files", "--others", "--exclude-standard"]) {
|
|
92
|
+
for l in out.lines().map(str::trim).filter(|l| !l.is_empty()) {
|
|
93
|
+
set.insert(l.to_string());
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
set.into_iter().collect()
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
fn added_lines_for_file(root: &Path, rel: &str, staged: bool) -> Vec<(usize, String)> {
|
|
101
|
+
let full = root.join(rel);
|
|
102
|
+
let Ok(meta) = fs::symlink_metadata(&full) else {
|
|
103
|
+
return Vec::new();
|
|
104
|
+
};
|
|
105
|
+
if meta.file_type().is_symlink() || !meta.is_file() || meta.len() > 1_048_576 {
|
|
106
|
+
return Vec::new();
|
|
107
|
+
}
|
|
108
|
+
let has_head = git(root, &["rev-parse", "--verify", "HEAD"])
|
|
109
|
+
.map(|(ok, _)| ok)
|
|
110
|
+
.unwrap_or(false);
|
|
111
|
+
let tracked = git(root, &["ls-files", "--error-unmatch", "--", rel])
|
|
112
|
+
.map(|(ok, _)| ok)
|
|
113
|
+
.unwrap_or(false);
|
|
114
|
+
if (!has_head || !tracked) && !staged {
|
|
115
|
+
let Ok(txt) = fs::read_to_string(&full) else {
|
|
116
|
+
return Vec::new();
|
|
117
|
+
};
|
|
118
|
+
return txt
|
|
119
|
+
.lines()
|
|
120
|
+
.enumerate()
|
|
121
|
+
.map(|(i, l)| (i + 1, l.to_string()))
|
|
122
|
+
.collect();
|
|
123
|
+
}
|
|
124
|
+
let args: Vec<&str> = if staged {
|
|
125
|
+
vec!["diff", "--cached", "-U0", "--", rel]
|
|
126
|
+
} else {
|
|
127
|
+
vec!["diff", "HEAD", "-U0", "--", rel]
|
|
128
|
+
};
|
|
129
|
+
let Some((true, diff)) = git(root, &args) else {
|
|
130
|
+
return Vec::new();
|
|
131
|
+
};
|
|
132
|
+
let mut out = Vec::new();
|
|
133
|
+
let mut cur_line: usize = 0;
|
|
134
|
+
for raw in diff.lines() {
|
|
135
|
+
if let Some(rest) = raw.strip_prefix("@@ ") {
|
|
136
|
+
if let Some(plus_idx) = rest.find('+') {
|
|
137
|
+
let after = &rest[plus_idx + 1..];
|
|
138
|
+
let num: String = after.chars().take_while(|c| c.is_ascii_digit()).collect();
|
|
139
|
+
if let Ok(n) = num.parse::<usize>() {
|
|
140
|
+
cur_line = n;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
} else if raw.starts_with('+') && !raw.starts_with("+++") {
|
|
144
|
+
out.push((cur_line, raw[1..].to_string()));
|
|
145
|
+
cur_line += 1;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
out
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
fn is_test_file(rel: &str) -> bool {
|
|
152
|
+
let low = rel.to_ascii_lowercase();
|
|
153
|
+
low.starts_with("tests/")
|
|
154
|
+
|| low.starts_with("test/")
|
|
155
|
+
|| low.starts_with("spec/")
|
|
156
|
+
|| low.starts_with("__tests__/")
|
|
157
|
+
|| low.contains("/tests/")
|
|
158
|
+
|| low.contains("/test/")
|
|
159
|
+
|| low.contains("/spec/")
|
|
160
|
+
|| low.contains("/__tests__/")
|
|
161
|
+
|| low.starts_with("test_")
|
|
162
|
+
|| low.contains("/test_")
|
|
163
|
+
|| low.contains("_test.")
|
|
164
|
+
|| low.contains(".test.")
|
|
165
|
+
|| low.contains(".spec.")
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
fn is_alnum_run(s: &str, min_len: usize) -> bool {
|
|
169
|
+
s.len() >= min_len
|
|
170
|
+
&& s.bytes()
|
|
171
|
+
.take(min_len)
|
|
172
|
+
.all(|b| b.is_ascii_alphanumeric() || b == b'_' || b == b'-')
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
fn has_secret(line: &str) -> Option<(&'static str, &'static str)> {
|
|
176
|
+
let trim = line.trim();
|
|
177
|
+
if trim.starts_with("re.compile(") || trim.contains("SECRET_PATTERNS") {
|
|
178
|
+
return None;
|
|
179
|
+
}
|
|
180
|
+
if line.contains("-----BEGIN ") && line.contains("PRIVATE KEY-----") {
|
|
181
|
+
let idx = line.find("-----BEGIN ").unwrap_or(0);
|
|
182
|
+
let before = line[..idx].trim_end();
|
|
183
|
+
if !before.ends_with('"') && !before.ends_with('\'') && !before.ends_with("r\"") {
|
|
184
|
+
return Some(("secret-private-key", "Private key PEM block detected."));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
if let Some(pos) = line.find("AKIA") {
|
|
188
|
+
let tail = &line[pos + 4..];
|
|
189
|
+
if tail.len() >= 16
|
|
190
|
+
&& tail
|
|
191
|
+
.bytes()
|
|
192
|
+
.take(16)
|
|
193
|
+
.all(|b| b.is_ascii_uppercase() || b.is_ascii_digit())
|
|
194
|
+
{
|
|
195
|
+
return Some(("secret-aws-key", "Hardcoded AWS access key detected."));
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
for (prefix, min_len, rule, msg) in [
|
|
199
|
+
("ghp_", 30usize, "secret-github-token", "Hardcoded GitHub PAT detected."),
|
|
200
|
+
("github_pat_", 20, "secret-github-token", "Hardcoded GitHub PAT detected."),
|
|
201
|
+
("sk-ant-", 20, "secret-anthropic-key", "Hardcoded Anthropic API key detected."),
|
|
202
|
+
("sk-proj-", 20, "secret-openai-key", "Hardcoded OpenAI API key detected."),
|
|
203
|
+
("AIza", 35, "secret-google-key", "Hardcoded Google API key detected."),
|
|
204
|
+
("sk_live_", 16, "secret-stripe-key", "Hardcoded Stripe live key detected."),
|
|
205
|
+
] {
|
|
206
|
+
if let Some(pos) = line.find(prefix) {
|
|
207
|
+
let tail = &line[pos + prefix.len()..];
|
|
208
|
+
if is_alnum_run(tail, min_len) {
|
|
209
|
+
return Some((rule, msg));
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
None
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
fn contains_unquoted(line: &str, needle: &str) -> bool {
|
|
217
|
+
let mut start = 0;
|
|
218
|
+
while let Some(rel) = line[start..].find(needle) {
|
|
219
|
+
let idx = start + rel;
|
|
220
|
+
let prev = line[..idx].chars().next_back();
|
|
221
|
+
let next = line[idx + needle.len()..].chars().next();
|
|
222
|
+
let quoted = matches!(prev, Some('"' | '\'' | '`'))
|
|
223
|
+
&& matches!(next, Some('"' | '\'' | '`'));
|
|
224
|
+
if !quoted {
|
|
225
|
+
return true;
|
|
226
|
+
}
|
|
227
|
+
start = idx + needle.len();
|
|
228
|
+
}
|
|
229
|
+
false
|
|
230
|
+
}
|
|
231
|
+
fn is_js_ident_byte(b: u8) -> bool {
|
|
232
|
+
b.is_ascii_alphanumeric() || b == b'_' || b == b'$'
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
fn scrub_js_code_line(line: &str) -> String {
|
|
236
|
+
let bytes = line.as_bytes();
|
|
237
|
+
let mut out = String::with_capacity(line.len());
|
|
238
|
+
let mut quote: Option<u8> = None;
|
|
239
|
+
let mut i = 0;
|
|
240
|
+
while i < bytes.len() {
|
|
241
|
+
let b = bytes[i];
|
|
242
|
+
if let Some(q) = quote {
|
|
243
|
+
if b == b'\\' && i + 1 < bytes.len() {
|
|
244
|
+
out.push_str(" ");
|
|
245
|
+
i += 2;
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
if b == q {
|
|
249
|
+
out.push(b as char);
|
|
250
|
+
quote = None;
|
|
251
|
+
} else {
|
|
252
|
+
out.push(' ');
|
|
253
|
+
}
|
|
254
|
+
i += 1;
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
if b == b'/' && i + 1 < bytes.len() && bytes[i + 1] == b'/' {
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
if b == b'/' && i + 1 < bytes.len() && bytes[i + 1] == b'*' {
|
|
261
|
+
if let Some(rel_end) = line[i + 2..].find("*/") {
|
|
262
|
+
let span = rel_end + 4;
|
|
263
|
+
for _ in 0..span {
|
|
264
|
+
out.push(' ');
|
|
265
|
+
}
|
|
266
|
+
i += span;
|
|
267
|
+
continue;
|
|
268
|
+
} else {
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
if matches!(b, b'\'' | b'"' | b'`') {
|
|
273
|
+
quote = Some(b);
|
|
274
|
+
out.push(b as char);
|
|
275
|
+
i += 1;
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
let ch = line[i..].chars().next().unwrap_or(' ');
|
|
279
|
+
out.push(ch);
|
|
280
|
+
i += ch.len_utf8();
|
|
281
|
+
}
|
|
282
|
+
out
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
fn has_exact_word(haystack: &str, word: &str) -> bool {
|
|
286
|
+
let bytes = haystack.as_bytes();
|
|
287
|
+
let mut from = 0;
|
|
288
|
+
while let Some(rel) = haystack[from..].find(word) {
|
|
289
|
+
let pos = from + rel;
|
|
290
|
+
let end = pos + word.len();
|
|
291
|
+
from = end;
|
|
292
|
+
let prev_ok = pos == 0 || !is_js_ident_byte(bytes[pos - 1]);
|
|
293
|
+
let next_ok = end >= bytes.len() || !is_js_ident_byte(bytes[end]);
|
|
294
|
+
if prev_ok && next_ok {
|
|
295
|
+
return true;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
false
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
fn has_client_env_secret(line: &str) -> bool {
|
|
302
|
+
let bytes = line.as_bytes();
|
|
303
|
+
for prefix in ["NEXT_PUBLIC_", "VITE_", "EXPO_PUBLIC_", "NUXT_PUBLIC_"] {
|
|
304
|
+
let mut from = 0;
|
|
305
|
+
while let Some(rel) = line[from..].find(prefix) {
|
|
306
|
+
let pos = from + rel;
|
|
307
|
+
from = pos + prefix.len();
|
|
308
|
+
if pos > 0 && is_js_ident_byte(bytes[pos - 1]) {
|
|
309
|
+
continue;
|
|
310
|
+
}
|
|
311
|
+
let ident: String = line[pos..]
|
|
312
|
+
.chars()
|
|
313
|
+
.take_while(|c| c.is_ascii_alphanumeric() || *c == '_' || *c == '$')
|
|
314
|
+
.collect();
|
|
315
|
+
if ident
|
|
316
|
+
.bytes()
|
|
317
|
+
.all(|b| b.is_ascii_uppercase() || b.is_ascii_digit() || b == b'_')
|
|
318
|
+
&& ["SECRET", "PRIVATE_KEY", "SERVICE_ROLE", "DATABASE_URL", "WEBHOOK_SECRET"]
|
|
319
|
+
.iter()
|
|
320
|
+
.any(|suf| ident.contains(suf))
|
|
321
|
+
{
|
|
322
|
+
return true;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
false
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
fn has_llm_browser_key(js: &str) -> bool {
|
|
330
|
+
let needle = "dangerouslyAllowBrowser";
|
|
331
|
+
let bytes = js.as_bytes();
|
|
332
|
+
let mut from = 0;
|
|
333
|
+
while let Some(rel) = js[from..].find(needle) {
|
|
334
|
+
let pos = from + rel;
|
|
335
|
+
let end = pos + needle.len();
|
|
336
|
+
from = end;
|
|
337
|
+
if pos > 0 && is_js_ident_byte(bytes[pos - 1]) {
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
let rest = js[end..].trim_start();
|
|
341
|
+
let Some(after_colon) = rest.strip_prefix(':') else { continue };
|
|
342
|
+
let val = after_colon.trim_start();
|
|
343
|
+
if let Some(after_true) = val.strip_prefix("true") {
|
|
344
|
+
if !after_true.bytes().next().map(is_js_ident_byte).unwrap_or(false) {
|
|
345
|
+
return true;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
false
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
fn has_legacy_implements_do(js: &str) -> bool {
|
|
353
|
+
let bytes = js.as_bytes();
|
|
354
|
+
let mut from = 0;
|
|
355
|
+
while let Some(rel) = js[from..].find("class") {
|
|
356
|
+
let pos = from + rel;
|
|
357
|
+
let end = pos + "class".len();
|
|
358
|
+
from = end;
|
|
359
|
+
if pos > 0 && is_js_ident_byte(bytes[pos - 1]) {
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
if !matches!(bytes.get(end), Some(b' ' | b'\t')) {
|
|
363
|
+
continue;
|
|
364
|
+
}
|
|
365
|
+
let header_end = js[end..].find('{').map(|i| end + i).unwrap_or(js.len());
|
|
366
|
+
let header = &js[end..header_end];
|
|
367
|
+
let hbytes = header.as_bytes();
|
|
368
|
+
let mut hfrom = 0;
|
|
369
|
+
while let Some(irel) = header[hfrom..].find("implements") {
|
|
370
|
+
let ipos = hfrom + irel;
|
|
371
|
+
let iend = ipos + "implements".len();
|
|
372
|
+
hfrom = iend;
|
|
373
|
+
let prev_ok = ipos == 0 || !is_js_ident_byte(hbytes[ipos - 1]);
|
|
374
|
+
let next_ok = matches!(hbytes.get(iend), Some(b' ' | b'\t'));
|
|
375
|
+
if prev_ok && next_ok && has_exact_word(&header[iend..], "DurableObject") {
|
|
376
|
+
return true;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
false
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
fn has_workers_ctx_destructure(js: &str) -> bool {
|
|
384
|
+
let bytes = js.as_bytes();
|
|
385
|
+
for kw in ["const", "let", "var"] {
|
|
386
|
+
let mut from = 0;
|
|
387
|
+
while let Some(rel) = js[from..].find(kw) {
|
|
388
|
+
let pos = from + rel;
|
|
389
|
+
let end = pos + kw.len();
|
|
390
|
+
from = end;
|
|
391
|
+
if pos > 0 && is_js_ident_byte(bytes[pos - 1]) {
|
|
392
|
+
continue;
|
|
393
|
+
}
|
|
394
|
+
if end < bytes.len() && is_js_ident_byte(bytes[end]) {
|
|
395
|
+
continue;
|
|
396
|
+
}
|
|
397
|
+
let rest = js[end..].trim_start();
|
|
398
|
+
let Some(after_open) = rest.strip_prefix('{') else { continue };
|
|
399
|
+
let Some(close_idx) = after_open.find('}') else { continue };
|
|
400
|
+
let inner = &after_open[..close_idx];
|
|
401
|
+
if !has_exact_word(inner, "waitUntil") {
|
|
402
|
+
continue;
|
|
403
|
+
}
|
|
404
|
+
let after_brace = after_open[close_idx + 1..].trim_start();
|
|
405
|
+
let Some(after_eq) = after_brace.strip_prefix('=') else { continue };
|
|
406
|
+
if after_eq.starts_with('=') {
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
let rhs = after_eq.trim_start();
|
|
410
|
+
if let Some(after_ctx) = rhs.strip_prefix("ctx") {
|
|
411
|
+
if !after_ctx.bytes().next().map(is_js_ident_byte).unwrap_or(false) {
|
|
412
|
+
return true;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
false
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
pub fn scan_added_lines(rel: &str, lines: &[(usize, String)], out: &mut Vec<Finding>) {
|
|
421
|
+
let ext = Path::new(rel)
|
|
422
|
+
.extension()
|
|
423
|
+
.and_then(|e| e.to_str())
|
|
424
|
+
.map(|s| s.to_ascii_lowercase())
|
|
425
|
+
.unwrap_or_default();
|
|
426
|
+
let test_file = is_test_file(rel);
|
|
427
|
+
let mut in_cfg_test = false;
|
|
428
|
+
for (ln, line) in lines {
|
|
429
|
+
if ext == "rs" && line.trim().starts_with("#[cfg(test)]") {
|
|
430
|
+
in_cfg_test = true;
|
|
431
|
+
}
|
|
432
|
+
if let Some((rule, msg)) = has_secret(line) {
|
|
433
|
+
out.push(Finding {
|
|
434
|
+
severity: "P0",
|
|
435
|
+
rule,
|
|
436
|
+
file: rel.to_string(),
|
|
437
|
+
line: *ln,
|
|
438
|
+
message: msg.to_string(),
|
|
439
|
+
fix: "Remove key material and rotate; load from env or secret manager.",
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
if (ext == "yml" || ext == "yaml")
|
|
443
|
+
&& rel.starts_with(".github/workflows/")
|
|
444
|
+
&& line.contains("uses:")
|
|
445
|
+
&& (line.contains("@main") || line.contains("@master"))
|
|
446
|
+
{
|
|
447
|
+
out.push(Finding {
|
|
448
|
+
severity: "P1",
|
|
449
|
+
rule: "supply-chain-unpinned-action",
|
|
450
|
+
file: rel.to_string(),
|
|
451
|
+
line: *ln,
|
|
452
|
+
message: "GitHub Action pinned to mutable @main/@master branch.".to_string(),
|
|
453
|
+
fix: "Pin to full 40-char commit SHA with version comment.",
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
if test_file || in_cfg_test {
|
|
457
|
+
continue;
|
|
458
|
+
}
|
|
459
|
+
if ext == "py"
|
|
460
|
+
&& (contains_unquoted(line, "# noqa")
|
|
461
|
+
|| contains_unquoted(line, "# type: ignore")
|
|
462
|
+
|| contains_unquoted(line, "# pyright: ignore"))
|
|
463
|
+
{
|
|
464
|
+
out.push(Finding {
|
|
465
|
+
severity: "P1",
|
|
466
|
+
rule: "suppression-comment",
|
|
467
|
+
file: rel.to_string(),
|
|
468
|
+
line: *ln,
|
|
469
|
+
message: "Inline Python lint/type suppression added.".to_string(),
|
|
470
|
+
fix: "Fix root cause instead of suppressing.",
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
if matches!(ext.as_str(), "ts" | "tsx" | "js" | "jsx" | "mjs")
|
|
474
|
+
&& (contains_unquoted(line, "@ts-ignore")
|
|
475
|
+
|| contains_unquoted(line, "@ts-expect-error")
|
|
476
|
+
|| contains_unquoted(line, "eslint-disable"))
|
|
477
|
+
{
|
|
478
|
+
out.push(Finding {
|
|
479
|
+
severity: "P1",
|
|
480
|
+
rule: "suppression-comment",
|
|
481
|
+
file: rel.to_string(),
|
|
482
|
+
line: *ln,
|
|
483
|
+
message: "Inline JS/TS lint/type suppression added.".to_string(),
|
|
484
|
+
fix: "Fix root cause instead of suppressing.",
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
if matches!(ext.as_str(), "ts" | "tsx")
|
|
488
|
+
&& (contains_unquoted(line, " as any")
|
|
489
|
+
|| contains_unquoted(line, " as unknown as "))
|
|
490
|
+
{
|
|
491
|
+
out.push(Finding {
|
|
492
|
+
severity: "P1",
|
|
493
|
+
rule: "ts-unsafe-cast",
|
|
494
|
+
file: rel.to_string(),
|
|
495
|
+
line: *ln,
|
|
496
|
+
message: "Unsafe TypeScript cast added.".to_string(),
|
|
497
|
+
fix: "Use a type guard or validated schema.",
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
if ext == "rs" && contains_unquoted(line, ".unwrap()") {
|
|
501
|
+
out.push(Finding {
|
|
502
|
+
severity: "P1",
|
|
503
|
+
rule: "rust-prod-unwrap",
|
|
504
|
+
file: rel.to_string(),
|
|
505
|
+
line: *ln,
|
|
506
|
+
message: "Unwrap call in non-test Rust code.".to_string(),
|
|
507
|
+
fix: "Propagate with `?` or handle explicitly.",
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
if ext == "go" && contains_unquoted(line, "_ = err") {
|
|
511
|
+
out.push(Finding {
|
|
512
|
+
severity: "P1",
|
|
513
|
+
rule: "go-ignored-err",
|
|
514
|
+
file: rel.to_string(),
|
|
515
|
+
line: *ln,
|
|
516
|
+
message: "Swallowed Go error (`_ = err`).".to_string(),
|
|
517
|
+
fix: "Check and return or handle `err`.",
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
if has_client_env_secret(line) {
|
|
521
|
+
out.push(Finding {
|
|
522
|
+
severity: "P0",
|
|
523
|
+
rule: "client-env-secret",
|
|
524
|
+
file: rel.to_string(),
|
|
525
|
+
line: *ln,
|
|
526
|
+
message: "Client-exposed env prefix names a secret/private/DB credential.".to_string(),
|
|
527
|
+
fix: "Keep secrets in server-only env vars behind a server route or Action.",
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
let js_code = if matches!(ext.as_str(), "js" | "mjs" | "cjs" | "ts" | "tsx" | "jsx" | "svelte" | "vue") {
|
|
531
|
+
scrub_js_code_line(line)
|
|
532
|
+
} else {
|
|
533
|
+
String::new()
|
|
534
|
+
};
|
|
535
|
+
if !js_code.is_empty() && has_llm_browser_key(&js_code) {
|
|
536
|
+
out.push(Finding {
|
|
537
|
+
severity: "P0",
|
|
538
|
+
rule: "llm-browser-key-exposure",
|
|
539
|
+
file: rel.to_string(),
|
|
540
|
+
line: *ln,
|
|
541
|
+
message: "`dangerouslyAllowBrowser: true` exposes provider API keys in client bundles.".to_string(),
|
|
542
|
+
fix: "Proxy LLM SDK calls through a server route or Durable Object.",
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
if matches!(ext.as_str(), "js" | "mjs" | "ts" | "tsx") && has_legacy_implements_do(&js_code) {
|
|
546
|
+
out.push(Finding {
|
|
547
|
+
severity: "P1",
|
|
548
|
+
rule: "workers-legacy-implements-do",
|
|
549
|
+
file: rel.to_string(),
|
|
550
|
+
line: *ln,
|
|
551
|
+
message: "Legacy `implements DurableObject` omits `this.ctx` and `this.env`.".to_string(),
|
|
552
|
+
fix: "Import `DurableObject` from `cloudflare:workers` and use `extends DurableObject<Env>`.",
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
if matches!(ext.as_str(), "js" | "mjs" | "ts" | "tsx") && has_workers_ctx_destructure(&js_code) {
|
|
556
|
+
out.push(Finding {
|
|
557
|
+
severity: "P1",
|
|
558
|
+
rule: "workers-ctx-destructure",
|
|
559
|
+
file: rel.to_string(),
|
|
560
|
+
line: *ln,
|
|
561
|
+
message: "Destructuring `waitUntil` from `ctx` throws `Illegal invocation` at runtime.".to_string(),
|
|
562
|
+
fix: "Call `ctx.waitUntil(...)` directly on `ctx`.",
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
if matches!(ext.as_str(), "js" | "mjs" | "cjs" | "ts" | "tsx" | "jsx")
|
|
566
|
+
&& (contains_unquoted(line, ".innerHTML =")
|
|
567
|
+
|| contains_unquoted(line, "dangerouslySetInnerHTML")
|
|
568
|
+
|| contains_unquoted(line, "eval("))
|
|
569
|
+
{
|
|
570
|
+
out.push(Finding {
|
|
571
|
+
severity: "P1",
|
|
572
|
+
rule: "security-unsafe-sink",
|
|
573
|
+
file: rel.to_string(),
|
|
574
|
+
line: *ln,
|
|
575
|
+
message: "Unsafe dynamic sink (`eval`/`innerHTML`/`dangerouslySetInnerHTML`)."
|
|
576
|
+
.to_string(),
|
|
577
|
+
fix: "Use textContent or sanitized DOM nodes.",
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
if ext == "yml" || ext == "yaml" {
|
|
582
|
+
let norm = rel.replace('\\', "/");
|
|
583
|
+
if norm == ".github/dependabot.yml" || norm == ".github/dependabot.yaml" {
|
|
584
|
+
for (ln, line) in lines {
|
|
585
|
+
let eco_line = line
|
|
586
|
+
.trim_start()
|
|
587
|
+
.trim_start_matches('-')
|
|
588
|
+
.trim_start()
|
|
589
|
+
.starts_with("package-ecosystem:");
|
|
590
|
+
if eco_line {
|
|
591
|
+
let full = lines
|
|
592
|
+
.iter()
|
|
593
|
+
.map(|(_, s)| s.as_str())
|
|
594
|
+
.collect::<Vec<_>>()
|
|
595
|
+
.join("\n");
|
|
596
|
+
if !full.contains("cooldown:") {
|
|
597
|
+
out.push(Finding {
|
|
598
|
+
severity: "P2",
|
|
599
|
+
rule: "supply-chain-dependabot-cooldown",
|
|
600
|
+
file: rel.to_string(),
|
|
601
|
+
line: *ln,
|
|
602
|
+
message: "Dependabot config adds ecosystem without `cooldown` window.".to_string(),
|
|
603
|
+
fix: "Add `cooldown: { default-days: 7 }` to mitigate freshly published package compromises.",
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
break;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
fn scan_python_structural(
|
|
614
|
+
rel: &str,
|
|
615
|
+
txt: &str,
|
|
616
|
+
added: &[(usize, String)],
|
|
617
|
+
out: &mut Vec<Finding>,
|
|
618
|
+
) {
|
|
619
|
+
let added_lines: BTreeSet<usize> = added.iter().map(|(ln, _)| *ln).collect();
|
|
620
|
+
let is_test = is_test_file(rel);
|
|
621
|
+
let all_lines: Vec<&str> = txt.lines().collect();
|
|
622
|
+
|
|
623
|
+
if !is_test {
|
|
624
|
+
for &ln in &added_lines {
|
|
625
|
+
if ln == 0 || ln > all_lines.len() {
|
|
626
|
+
continue;
|
|
627
|
+
}
|
|
628
|
+
let line = all_lines[ln - 1];
|
|
629
|
+
let code = line.split('#').next().unwrap_or("");
|
|
630
|
+
if let Some(pos) = code.find("subprocess.run(") {
|
|
631
|
+
let mut depth = 0i32;
|
|
632
|
+
let mut call_buf = String::new();
|
|
633
|
+
for j in (ln - 1)..all_lines.len().min(ln + 25) {
|
|
634
|
+
let seg = if j == ln - 1 { &all_lines[j][pos..] } else { all_lines[j] };
|
|
635
|
+
let seg_clean = seg.split('#').next().unwrap_or("");
|
|
636
|
+
call_buf.push_str(seg_clean);
|
|
637
|
+
call_buf.push(' ');
|
|
638
|
+
for ch in seg_clean.chars() {
|
|
639
|
+
if ch == '(' {
|
|
640
|
+
depth += 1;
|
|
641
|
+
} else if ch == ')' {
|
|
642
|
+
depth -= 1;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
if depth <= 0 {
|
|
646
|
+
break;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
if !call_buf.contains("timeout=") && !call_buf.contains("timeout =") && !call_buf.contains("**") {
|
|
650
|
+
out.push(Finding {
|
|
651
|
+
severity: "P1",
|
|
652
|
+
rule: "safety-subprocess-timeout",
|
|
653
|
+
file: rel.to_string(),
|
|
654
|
+
line: ln,
|
|
655
|
+
message: "`subprocess.run()` called without `timeout=`.".to_string(),
|
|
656
|
+
fix: "Pass an explicit `timeout=` bound so child commands cannot hang forever.",
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
let mut i = 0;
|
|
665
|
+
while i < all_lines.len() {
|
|
666
|
+
let raw = all_lines[i];
|
|
667
|
+
let trimmed = raw.trim_start();
|
|
668
|
+
let def_rest = trimmed
|
|
669
|
+
.strip_prefix("def ")
|
|
670
|
+
.or_else(|| trimmed.strip_prefix("async def "));
|
|
671
|
+
if let Some(drest) = def_rest {
|
|
672
|
+
if drest.starts_with("test_") {
|
|
673
|
+
let fname: String = drest
|
|
674
|
+
.chars()
|
|
675
|
+
.take_while(|c| c.is_ascii_alphanumeric() || *c == '_')
|
|
676
|
+
.collect();
|
|
677
|
+
let def_ind = raw.len() - trimmed.len();
|
|
678
|
+
let start_ln = i + 1;
|
|
679
|
+
let mut j = i + 1;
|
|
680
|
+
let mut body_lines: Vec<(usize, &str)> = Vec::new();
|
|
681
|
+
while j < all_lines.len() {
|
|
682
|
+
let bl = all_lines[j];
|
|
683
|
+
let bc = bl.split('#').next().unwrap_or("").trim();
|
|
684
|
+
if bc.is_empty() {
|
|
685
|
+
j += 1;
|
|
686
|
+
continue;
|
|
687
|
+
}
|
|
688
|
+
let b_ind = bl.len() - bl.trim_start().len();
|
|
689
|
+
if b_ind <= def_ind {
|
|
690
|
+
break;
|
|
691
|
+
}
|
|
692
|
+
body_lines.push((j + 1, bc));
|
|
693
|
+
j += 1;
|
|
694
|
+
}
|
|
695
|
+
let end_ln = body_lines.last().map(|(l, _)| *l).unwrap_or(start_ln);
|
|
696
|
+
let touched = (start_ln..=end_ln).any(|l| added_lines.contains(&l));
|
|
697
|
+
if touched {
|
|
698
|
+
if body_lines.is_empty()
|
|
699
|
+
|| body_lines.iter().all(|(_, s)| *s == "pass" || *s == "...")
|
|
700
|
+
{
|
|
701
|
+
out.push(Finding {
|
|
702
|
+
severity: "P1",
|
|
703
|
+
rule: "test-theater-empty",
|
|
704
|
+
file: rel.to_string(),
|
|
705
|
+
line: start_ln,
|
|
706
|
+
message: format!("Empty test `{}` proves nothing.", fname),
|
|
707
|
+
fix: "Assert real observable behavior or delete the placeholder test.",
|
|
708
|
+
});
|
|
709
|
+
} else {
|
|
710
|
+
let mut has_oracle = false;
|
|
711
|
+
for (bln, bs) in &body_lines {
|
|
712
|
+
if *bs == "assert True" || bs.starts_with("assert True,") {
|
|
713
|
+
has_oracle = true;
|
|
714
|
+
out.push(Finding {
|
|
715
|
+
severity: "P1",
|
|
716
|
+
rule: "test-theater-tautology",
|
|
717
|
+
file: rel.to_string(),
|
|
718
|
+
line: *bln,
|
|
719
|
+
message: format!("`assert True` in `{}` is a tautology.", fname),
|
|
720
|
+
fix: "Assert a real output/state invariant that fails if the fix is reverted.",
|
|
721
|
+
});
|
|
722
|
+
} else if bs.starts_with("assert ")
|
|
723
|
+
|| bs.contains(".assert")
|
|
724
|
+
|| bs.contains("raises(")
|
|
725
|
+
|| bs.contains(".fail(")
|
|
726
|
+
|| bs.contains("verify(")
|
|
727
|
+
|| bs.contains("check(")
|
|
728
|
+
{
|
|
729
|
+
has_oracle = true;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
if !has_oracle {
|
|
733
|
+
out.push(Finding {
|
|
734
|
+
severity: "P1",
|
|
735
|
+
rule: "test-theater-no-assert",
|
|
736
|
+
file: rel.to_string(),
|
|
737
|
+
line: start_ln,
|
|
738
|
+
message: format!("Test `{}` has zero assertions.", fname),
|
|
739
|
+
fix: "Add concrete behavioral assertions or delete the dead test.",
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
i = j;
|
|
745
|
+
continue;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
i += 1;
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
fn parse_xml_attr(tag: &str, key: &str) -> Option<String> {
|
|
753
|
+
let needle = format!("{}=\"", key);
|
|
754
|
+
let idx = tag.find(&needle)?;
|
|
755
|
+
let rest = &tag[idx + needle.len()..];
|
|
756
|
+
let end = rest.find('"')?;
|
|
757
|
+
Some(rest[..end].to_string())
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
fn check_policy_xml(root: &Path, changed: &[String], out: &mut Vec<Finding>) {
|
|
761
|
+
let policy_path = root.join(".deepmodebot/policy.xml");
|
|
762
|
+
let Ok(xml) = fs::read_to_string(&policy_path) else {
|
|
763
|
+
return;
|
|
764
|
+
};
|
|
765
|
+
let mut forbids: Vec<(String, String, String)> = Vec::new();
|
|
766
|
+
for line in xml.lines() {
|
|
767
|
+
let trim = line.trim();
|
|
768
|
+
if trim.starts_with("<file ") {
|
|
769
|
+
if let Some(p) = parse_xml_attr(trim, "path") {
|
|
770
|
+
let target = root.join(&p);
|
|
771
|
+
if let Ok(meta) = fs::metadata(&target) {
|
|
772
|
+
if let Some(mb) = parse_xml_attr(trim, "max-bytes")
|
|
773
|
+
.and_then(|v| v.parse::<u64>().ok())
|
|
774
|
+
{
|
|
775
|
+
if meta.len() > mb {
|
|
776
|
+
out.push(Finding {
|
|
777
|
+
severity: "P1",
|
|
778
|
+
rule: "budget-max-bytes",
|
|
779
|
+
file: p.clone(),
|
|
780
|
+
line: 1,
|
|
781
|
+
message: format!("{} is {} B > budget {} B.", p, meta.len(), mb),
|
|
782
|
+
fix: "Trim file or split into references.",
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
if let Some(ml) = parse_xml_attr(trim, "max-lines")
|
|
787
|
+
.and_then(|v| v.parse::<usize>().ok())
|
|
788
|
+
{
|
|
789
|
+
if let Ok(txt) = fs::read_to_string(&target) {
|
|
790
|
+
let lc = txt.lines().count();
|
|
791
|
+
if lc > ml {
|
|
792
|
+
out.push(Finding {
|
|
793
|
+
severity: "P1",
|
|
794
|
+
rule: "budget-max-lines",
|
|
795
|
+
file: p.clone(),
|
|
796
|
+
line: 1,
|
|
797
|
+
message: format!("{} is {} L > budget {} L.", p, lc, ml),
|
|
798
|
+
fix: "Trim file to stay within policy.xml budget.",
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
} else if trim.starts_with("<forbid ") {
|
|
806
|
+
if let (Some(f), Some(t)) = (parse_xml_attr(trim, "from"), parse_xml_attr(trim, "to")) {
|
|
807
|
+
let reason = parse_xml_attr(trim, "reason")
|
|
808
|
+
.unwrap_or_else(|| format!("{} must not import {}", f, t));
|
|
809
|
+
forbids.push((f, t, reason));
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
if forbids.is_empty() {
|
|
814
|
+
return;
|
|
815
|
+
}
|
|
816
|
+
let per_file = parallel_map(changed, |rel| {
|
|
817
|
+
let mut local = Vec::new();
|
|
818
|
+
let active: Vec<&(String, String, String)> = forbids
|
|
819
|
+
.iter()
|
|
820
|
+
.filter(|(f, _, _)| glob_match(f, rel))
|
|
821
|
+
.collect();
|
|
822
|
+
if active.is_empty() {
|
|
823
|
+
return local;
|
|
824
|
+
}
|
|
825
|
+
let Ok(txt) = fs::read_to_string(root.join(rel)) else {
|
|
826
|
+
return local;
|
|
827
|
+
};
|
|
828
|
+
for (idx, line) in txt.lines().enumerate() {
|
|
829
|
+
let t = line.trim();
|
|
830
|
+
let imp = if let Some(rest) = t.strip_prefix("import ") {
|
|
831
|
+
Some(rest.split_whitespace().next().unwrap_or("").replace('.', "/"))
|
|
832
|
+
} else if let Some(rest) = t.strip_prefix("from ") {
|
|
833
|
+
Some(rest.split_whitespace().next().unwrap_or("").replace('.', "/"))
|
|
834
|
+
} else {
|
|
835
|
+
None
|
|
836
|
+
};
|
|
837
|
+
if let Some(target_mod) = imp {
|
|
838
|
+
for (_, to_pat, reason) in &active {
|
|
839
|
+
if glob_match(to_pat, &target_mod) {
|
|
840
|
+
local.push(Finding {
|
|
841
|
+
severity: "P1",
|
|
842
|
+
rule: "arch-boundary",
|
|
843
|
+
file: rel.clone(),
|
|
844
|
+
line: idx + 1,
|
|
845
|
+
message: format!(
|
|
846
|
+
"Forbidden import `{}` violates policy.xml ({}).",
|
|
847
|
+
target_mod, reason
|
|
848
|
+
),
|
|
849
|
+
fix: "Route through an allowed interface/service layer.",
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
local
|
|
856
|
+
});
|
|
857
|
+
for chunk in per_file {
|
|
858
|
+
out.extend(chunk);
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
fn tool_exists(name: &str) -> bool {
|
|
863
|
+
Command::new(name)
|
|
864
|
+
.arg("--version")
|
|
865
|
+
.output()
|
|
866
|
+
.map(|o| o.status.success())
|
|
867
|
+
.unwrap_or(false)
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
fn run_parallel_linters(root: &Path, changed: &[String]) -> (Vec<&'static str>, Vec<Finding>) {
|
|
871
|
+
let py_files: Vec<String> = changed
|
|
872
|
+
.iter()
|
|
873
|
+
.filter(|f| f.ends_with(".py") && root.join(f).is_file())
|
|
874
|
+
.cloned()
|
|
875
|
+
.collect();
|
|
876
|
+
let js_files: Vec<String> = changed
|
|
877
|
+
.iter()
|
|
878
|
+
.filter(|f| (f.ends_with(".js") || f.ends_with(".mjs")) && root.join(f).is_file())
|
|
879
|
+
.cloned()
|
|
880
|
+
.collect();
|
|
881
|
+
let sh_files: Vec<String> = changed
|
|
882
|
+
.iter()
|
|
883
|
+
.filter(|f| f.ends_with(".sh") && root.join(f).is_file())
|
|
884
|
+
.cloned()
|
|
885
|
+
.collect();
|
|
886
|
+
|
|
887
|
+
let mut active_linters = Vec::new();
|
|
888
|
+
let mut findings = Vec::new();
|
|
889
|
+
|
|
890
|
+
thread::scope(|s| {
|
|
891
|
+
let py_h = if !py_files.is_empty() && tool_exists("ruff") {
|
|
892
|
+
active_linters.push("ruff");
|
|
893
|
+
Some(s.spawn(|| {
|
|
894
|
+
let mut f = Vec::new();
|
|
895
|
+
let mut cmd = Command::new("ruff");
|
|
896
|
+
cmd.arg("check")
|
|
897
|
+
.arg("--select")
|
|
898
|
+
.arg("E9,F63,F7,F82,F401")
|
|
899
|
+
.arg("--output-format")
|
|
900
|
+
.arg("concise")
|
|
901
|
+
.current_dir(root);
|
|
902
|
+
for p in &py_files {
|
|
903
|
+
cmd.arg(p);
|
|
904
|
+
}
|
|
905
|
+
if let Ok(out) = cmd.output() {
|
|
906
|
+
if !out.status.success() {
|
|
907
|
+
let txt = String::from_utf8_lossy(&out.stdout);
|
|
908
|
+
for line in txt.lines() {
|
|
909
|
+
let parts: Vec<&str> = line.splitn(4, ':').collect();
|
|
910
|
+
if parts.len() == 4 {
|
|
911
|
+
let ln = parts[1].trim().parse::<usize>().unwrap_or(1);
|
|
912
|
+
f.push(Finding {
|
|
913
|
+
severity: "P1",
|
|
914
|
+
rule: "ruff",
|
|
915
|
+
file: parts[0].replace('\\', "/"),
|
|
916
|
+
line: ln,
|
|
917
|
+
message: parts[3].trim().to_string(),
|
|
918
|
+
fix: "Fix ruff diagnostic on changed Python file.",
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
f
|
|
925
|
+
}))
|
|
926
|
+
} else {
|
|
927
|
+
None
|
|
928
|
+
};
|
|
929
|
+
|
|
930
|
+
let js_h = if !js_files.is_empty() && tool_exists("node") {
|
|
931
|
+
active_linters.push("node-check");
|
|
932
|
+
Some(s.spawn(|| {
|
|
933
|
+
let mut f = Vec::new();
|
|
934
|
+
for p in &js_files {
|
|
935
|
+
if let Ok(out) = Command::new("node")
|
|
936
|
+
.arg("--check")
|
|
937
|
+
.arg(root.join(p))
|
|
938
|
+
.output()
|
|
939
|
+
{
|
|
940
|
+
if !out.status.success() {
|
|
941
|
+
let msg = String::from_utf8_lossy(&out.stderr)
|
|
942
|
+
.lines()
|
|
943
|
+
.next()
|
|
944
|
+
.unwrap_or("Syntax error")
|
|
945
|
+
.to_string();
|
|
946
|
+
f.push(Finding {
|
|
947
|
+
severity: "P0",
|
|
948
|
+
rule: "node-syntax",
|
|
949
|
+
file: p.clone(),
|
|
950
|
+
line: 1,
|
|
951
|
+
message: msg,
|
|
952
|
+
fix: "Fix JS syntax error.",
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
f
|
|
958
|
+
}))
|
|
959
|
+
} else {
|
|
960
|
+
None
|
|
961
|
+
};
|
|
962
|
+
|
|
963
|
+
let sh_h = if !sh_files.is_empty() && tool_exists("shellcheck") {
|
|
964
|
+
active_linters.push("shellcheck");
|
|
965
|
+
Some(s.spawn(|| {
|
|
966
|
+
let mut f = Vec::new();
|
|
967
|
+
let mut cmd = Command::new("shellcheck");
|
|
968
|
+
cmd.arg("-f").arg("gcc").arg("-S").arg("error").current_dir(root);
|
|
969
|
+
for p in &sh_files {
|
|
970
|
+
cmd.arg(p);
|
|
971
|
+
}
|
|
972
|
+
if let Ok(out) = cmd.output() {
|
|
973
|
+
if !out.status.success() {
|
|
974
|
+
let txt = String::from_utf8_lossy(&out.stdout);
|
|
975
|
+
for line in txt.lines() {
|
|
976
|
+
let parts: Vec<&str> = line.splitn(4, ':').collect();
|
|
977
|
+
if parts.len() == 4 {
|
|
978
|
+
let ln = parts[1].trim().parse::<usize>().unwrap_or(1);
|
|
979
|
+
f.push(Finding {
|
|
980
|
+
severity: "P1",
|
|
981
|
+
rule: "shellcheck",
|
|
982
|
+
file: parts[0].replace('\\', "/"),
|
|
983
|
+
line: ln,
|
|
984
|
+
message: parts[3].trim().to_string(),
|
|
985
|
+
fix: "Fix shellcheck error.",
|
|
986
|
+
});
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
f
|
|
992
|
+
}))
|
|
993
|
+
} else {
|
|
994
|
+
None
|
|
995
|
+
};
|
|
996
|
+
|
|
997
|
+
if let Some(h) = py_h {
|
|
998
|
+
findings.extend(h.join().unwrap_or_default());
|
|
999
|
+
}
|
|
1000
|
+
if let Some(h) = js_h {
|
|
1001
|
+
findings.extend(h.join().unwrap_or_default());
|
|
1002
|
+
}
|
|
1003
|
+
if let Some(h) = sh_h {
|
|
1004
|
+
findings.extend(h.join().unwrap_or_default());
|
|
1005
|
+
}
|
|
1006
|
+
});
|
|
1007
|
+
|
|
1008
|
+
(active_linters, findings)
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
pub fn run(args: &[String]) -> ExitCode {
|
|
1012
|
+
let mut root = PathBuf::from(".");
|
|
1013
|
+
let mut staged = false;
|
|
1014
|
+
let mut allow_config = false;
|
|
1015
|
+
let mut no_linters = false;
|
|
1016
|
+
let mut as_json = false;
|
|
1017
|
+
let mut explicit_files: Vec<String> = Vec::new();
|
|
1018
|
+
|
|
1019
|
+
let mut i = 0;
|
|
1020
|
+
while i < args.len() {
|
|
1021
|
+
match args[i].as_str() {
|
|
1022
|
+
"--root" if i + 1 < args.len() => {
|
|
1023
|
+
root = PathBuf::from(&args[i + 1]);
|
|
1024
|
+
i += 2;
|
|
1025
|
+
}
|
|
1026
|
+
"--staged" => {
|
|
1027
|
+
staged = true;
|
|
1028
|
+
i += 1;
|
|
1029
|
+
}
|
|
1030
|
+
"--allow-config-change" => {
|
|
1031
|
+
allow_config = true;
|
|
1032
|
+
i += 1;
|
|
1033
|
+
}
|
|
1034
|
+
"--no-linters" => {
|
|
1035
|
+
no_linters = true;
|
|
1036
|
+
i += 1;
|
|
1037
|
+
}
|
|
1038
|
+
"--json" => {
|
|
1039
|
+
as_json = true;
|
|
1040
|
+
i += 1;
|
|
1041
|
+
}
|
|
1042
|
+
"--files" => {
|
|
1043
|
+
i += 1;
|
|
1044
|
+
while i < args.len() && !args[i].starts_with("--") {
|
|
1045
|
+
explicit_files.push(args[i].clone());
|
|
1046
|
+
i += 1;
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
_ => {
|
|
1050
|
+
i += 1;
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
let root = fs::canonicalize(&root).unwrap_or(root);
|
|
1055
|
+
let changed = changed_files(&root, staged, &explicit_files);
|
|
1056
|
+
|
|
1057
|
+
// Parallel diff & line scanning across all changed files
|
|
1058
|
+
let per_file_findings = parallel_map(&changed, |rel| {
|
|
1059
|
+
let mut local = Vec::new();
|
|
1060
|
+
if !allow_config && GUARDRAIL_CONFIGS.contains(&rel.as_str()) {
|
|
1061
|
+
local.push(Finding {
|
|
1062
|
+
severity: "P1",
|
|
1063
|
+
rule: "config-tamper",
|
|
1064
|
+
file: rel.clone(),
|
|
1065
|
+
line: 1,
|
|
1066
|
+
message: format!("Guardrail config `{}` modified without opt-in.", rel),
|
|
1067
|
+
fix: "Fix code instead of loosening guardrails, or pass --allow-config-change.",
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1070
|
+
let added = added_lines_for_file(&root, rel, staged);
|
|
1071
|
+
if !added.is_empty() {
|
|
1072
|
+
scan_added_lines(rel, &added, &mut local);
|
|
1073
|
+
}
|
|
1074
|
+
let (mut r_added, r_hunks) = crate::reward::diff_file_hunks(&root, rel, staged, None);
|
|
1075
|
+
if r_added.is_empty() && !added.is_empty() {
|
|
1076
|
+
r_added = added.clone();
|
|
1077
|
+
}
|
|
1078
|
+
if !r_added.is_empty() || !r_hunks.is_empty() {
|
|
1079
|
+
let rs_cfg_ln = if rel.ends_with(".rs") {
|
|
1080
|
+
fs::read_to_string(root.join(rel))
|
|
1081
|
+
.ok()
|
|
1082
|
+
.and_then(|t| crate::reward::find_rs_cfg_test_line(&t))
|
|
1083
|
+
} else {
|
|
1084
|
+
None
|
|
1085
|
+
};
|
|
1086
|
+
let mut r_findings = Vec::new();
|
|
1087
|
+
crate::reward::scan_file_reward_hacks(rel, &r_added, &r_hunks, true, false, rs_cfg_ln, &mut r_findings);
|
|
1088
|
+
for rf in r_findings {
|
|
1089
|
+
local.push(Finding {
|
|
1090
|
+
severity: rf.severity,
|
|
1091
|
+
rule: rf.rule,
|
|
1092
|
+
file: rf.file,
|
|
1093
|
+
line: rf.line,
|
|
1094
|
+
message: rf.message,
|
|
1095
|
+
fix: rf.fix,
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
if (rel == ".github/dependabot.yml" || rel == ".github/dependabot.yaml") && !added.is_empty() {
|
|
1100
|
+
if let Ok(dep_txt) = fs::read_to_string(root.join(rel)) {
|
|
1101
|
+
if dep_txt.contains("cooldown:") {
|
|
1102
|
+
local.retain(|f| f.rule != "supply-chain-dependabot-cooldown");
|
|
1103
|
+
} else if !local.iter().any(|f| f.rule == "supply-chain-dependabot-cooldown") {
|
|
1104
|
+
local.push(Finding {
|
|
1105
|
+
severity: "P2",
|
|
1106
|
+
rule: "supply-chain-dependabot-cooldown",
|
|
1107
|
+
file: rel.clone(),
|
|
1108
|
+
line: 1,
|
|
1109
|
+
message: "`.github/dependabot.yml` has no `cooldown:` window.".to_string(),
|
|
1110
|
+
fix: "Add `cooldown: { default-days: 7 }` to reduce zero-day supply-chain exposure.",
|
|
1111
|
+
});
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
if rel.ends_with(".py") && !added.is_empty() {
|
|
1116
|
+
if let Ok(py_txt) = fs::read_to_string(root.join(rel)) {
|
|
1117
|
+
scan_python_structural(rel, &py_txt, &added, &mut local);
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
let is_ui = Path::new(rel)
|
|
1121
|
+
.extension()
|
|
1122
|
+
.and_then(|e| e.to_str())
|
|
1123
|
+
.map(|s| crate::ui::UI_EXTS.contains(&s.to_ascii_lowercase().as_str()))
|
|
1124
|
+
.unwrap_or(false);
|
|
1125
|
+
if is_ui {
|
|
1126
|
+
if let Ok(txt) = fs::read_to_string(root.join(rel)) {
|
|
1127
|
+
for uf in crate::ui::scan_ui(rel, &txt) {
|
|
1128
|
+
if uf.severity == "P0" || uf.severity == "P1" {
|
|
1129
|
+
local.push(Finding {
|
|
1130
|
+
severity: uf.severity,
|
|
1131
|
+
rule: uf.rule,
|
|
1132
|
+
file: uf.file,
|
|
1133
|
+
line: uf.line,
|
|
1134
|
+
message: uf.message.to_string(),
|
|
1135
|
+
fix: "Fix UI token/a11y/motion violation per frontend-ui.",
|
|
1136
|
+
});
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
local
|
|
1142
|
+
});
|
|
1143
|
+
|
|
1144
|
+
let mut findings: Vec<Finding> = per_file_findings.into_iter().flatten().collect();
|
|
1145
|
+
check_policy_xml(&root, &changed, &mut findings);
|
|
1146
|
+
|
|
1147
|
+
let linters = if no_linters {
|
|
1148
|
+
Vec::new()
|
|
1149
|
+
} else {
|
|
1150
|
+
let (names, l_findings) = run_parallel_linters(&root, &changed);
|
|
1151
|
+
findings.extend(l_findings);
|
|
1152
|
+
names
|
|
1153
|
+
};
|
|
1154
|
+
|
|
1155
|
+
findings.sort_by(|a, b| {
|
|
1156
|
+
a.severity
|
|
1157
|
+
.cmp(b.severity)
|
|
1158
|
+
.then_with(|| a.file.cmp(&b.file))
|
|
1159
|
+
.then_with(|| a.line.cmp(&b.line))
|
|
1160
|
+
.then_with(|| a.rule.cmp(b.rule))
|
|
1161
|
+
});
|
|
1162
|
+
|
|
1163
|
+
let p0 = findings.iter().filter(|f| f.severity == "P0").count();
|
|
1164
|
+
let p1 = findings.iter().filter(|f| f.severity == "P1").count();
|
|
1165
|
+
let p2 = findings.iter().filter(|f| f.severity == "P2").count();
|
|
1166
|
+
let ok = p0 == 0 && p1 == 0;
|
|
1167
|
+
|
|
1168
|
+
if as_json {
|
|
1169
|
+
let items: Vec<String> = findings
|
|
1170
|
+
.iter()
|
|
1171
|
+
.map(|f| {
|
|
1172
|
+
format!(
|
|
1173
|
+
"{{\"severity\":{},\"rule\":{},\"file\":{},\"line\":{},\"message\":{},\"fix\":{}}}",
|
|
1174
|
+
json_escape(f.severity),
|
|
1175
|
+
json_escape(f.rule),
|
|
1176
|
+
json_escape(&f.file),
|
|
1177
|
+
f.line,
|
|
1178
|
+
json_escape(&f.message),
|
|
1179
|
+
json_escape(f.fix)
|
|
1180
|
+
)
|
|
1181
|
+
})
|
|
1182
|
+
.collect();
|
|
1183
|
+
let l_json: Vec<String> = linters.iter().map(|l| json_escape(l)).collect();
|
|
1184
|
+
println!(
|
|
1185
|
+
"{{\"ok\":{},\"engine\":\"rust-parallel\",\"files_checked\":{},\"linters\":[{}],\"counts\":{{\"P0\":{},\"P1\":{},\"P2\":{}}},\"findings\":[{}]}}",
|
|
1186
|
+
ok,
|
|
1187
|
+
changed.len(),
|
|
1188
|
+
l_json.join(","),
|
|
1189
|
+
p0,
|
|
1190
|
+
p1,
|
|
1191
|
+
p2,
|
|
1192
|
+
items.join(",")
|
|
1193
|
+
);
|
|
1194
|
+
} else {
|
|
1195
|
+
println!(
|
|
1196
|
+
"dmb-gate slop [{}]: {} file(s), linters=[{}] — P0:{} P1:{} P2:{}",
|
|
1197
|
+
if ok { "OK" } else { "BLOCKED" },
|
|
1198
|
+
changed.len(),
|
|
1199
|
+
linters.join(", "),
|
|
1200
|
+
p0,
|
|
1201
|
+
p1,
|
|
1202
|
+
p2
|
|
1203
|
+
);
|
|
1204
|
+
for f in &findings {
|
|
1205
|
+
println!(
|
|
1206
|
+
" {}:{} [{}:{}] {} -> {}",
|
|
1207
|
+
f.file, f.line, f.severity, f.rule, f.message, f.fix
|
|
1208
|
+
);
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
if ok {
|
|
1212
|
+
ExitCode::SUCCESS
|
|
1213
|
+
} else {
|
|
1214
|
+
ExitCode::from(1)
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
#[cfg(test)]
|
|
1219
|
+
mod tests {
|
|
1220
|
+
use super::*;
|
|
1221
|
+
|
|
1222
|
+
#[test]
|
|
1223
|
+
fn dependabot_yaml_list_item_and_dotfile_explicit_files() {
|
|
1224
|
+
let mut out = Vec::new();
|
|
1225
|
+
let lines = vec![
|
|
1226
|
+
(1, "version: 2".to_string()),
|
|
1227
|
+
(2, "updates:".to_string()),
|
|
1228
|
+
(3, " - package-ecosystem: \"npm\"".to_string()),
|
|
1229
|
+
];
|
|
1230
|
+
scan_added_lines(".github/dependabot.yml", &lines, &mut out);
|
|
1231
|
+
assert_eq!(out.len(), 1);
|
|
1232
|
+
assert_eq!(out[0].rule, "supply-chain-dependabot-cooldown");
|
|
1233
|
+
|
|
1234
|
+
let explicit = vec![".github/dependabot.yml,./src/a.py".to_string()];
|
|
1235
|
+
let norm = changed_files(Path::new("."), false, &explicit);
|
|
1236
|
+
assert_eq!(norm, vec![".github/dependabot.yml", "src/a.py"]);
|
|
1237
|
+
}
|
|
1238
|
+
}
|