deepmodebot 0.9.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +20 -0
- package/.claude-plugin/marketplace.json +2 -2
- package/.omp-plugin/marketplace.json +2 -2
- package/README.md +38 -5
- package/bin/deepmodebot.mjs +257 -4
- package/lib/clients.mjs +50 -3
- package/lib/tree.mjs +64 -10
- package/native/dmb-gate/Cargo.toml +13 -0
- package/native/dmb-gate/src/agents.rs +110 -0
- package/native/dmb-gate/src/ci.rs +1032 -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 +535 -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 +2867 -0
- package/native/dmb-gate/src/sim.rs +969 -0
- package/native/dmb-gate/src/skill_check.rs +171 -0
- package/native/dmb-gate/src/slop.rs +2004 -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.md +29 -0
- package/plugins/deepmodebot/agents/researcher.md +29 -0
- package/plugins/deepmodebot/agents/reviewer.md +29 -0
- package/plugins/deepmodebot/agents/scout.md +28 -0
- package/plugins/deepmodebot/agents/security-reviewer.md +27 -0
- package/plugins/deepmodebot/commands/deep.md +7 -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 +12 -2
- package/plugins/deepmodebot/hooks.json +1 -1
- package/plugins/deepmodebot/scripts/antigravity-guard.mjs +862 -26
- 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 +3 -3
- 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 +83 -146
- package/plugins/deepmodebot/skills/deepmodebot/assets/agents-md/agents_md.py +67 -24
- package/plugins/deepmodebot/skills/deepmodebot/assets/autoroute/autoroute.py +1026 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/cleanup/self_cleanup.py +305 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/claude-guard.sh +4 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/claude_guard.py +736 -6
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/holdout_guard_cases.json +272 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/omp-contain.ts +861 -9
- 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/f2p-gate/f2p_gate.py +547 -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 +1047 -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 +55 -7
- package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard.ts +55 -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 +796 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/local-ci/slop_gate.py +1049 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/loop.py +748 -46
- 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 +928 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/mutation/mutation_gate.py +798 -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 +3447 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rule-paths.json +100 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rule_ledger.py +1671 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rules_watch.py +436 -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 +2049 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/setup/model_setup.py +329 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/setup/project_setup.py +348 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/sim/sim.py +856 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/tournament/tournament.py +304 -18
- package/plugins/deepmodebot/skills/deepmodebot/assets/worker-gate/worker_gate.py +237 -0
- 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 +17 -11
- package/plugins/deepmodebot/skills/deepmodebot/references/contain.md +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/delegation.md +18 -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/authoring-a-skill.md +1 -1
- 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 +3 -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/self-authoring.md +1 -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 +71 -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 +50 -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 +9 -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 +12 -8
- 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 +35 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/no-comments.md +5 -5
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/panel.md +9 -5
- 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/sim.md +41 -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/tdd.md +12 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/teach.md +2 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/tournament.md +30 -18
- 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 +28 -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/agents/reviewer/agent.md +0 -33
- package/plugins/deepmodebot/agents/scout/agent.md +0 -34
- package/plugins/deepmodebot/agents/security-reviewer/agent.md +0 -30
- 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,1049 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Zero-token diff-only anti-slop, secret, test-theater, linter, boundary & budget CI gate.
|
|
3
|
+
|
|
4
|
+
python -B slop_gate.py [--root <repo>] [--staged] [--files a,b] [--allow-config-change] [--no-linters] [--record-memory] [--json]
|
|
5
|
+
|
|
6
|
+
Runs deterministically on changed files/lines only (0 LLM tokens, <1s typical):
|
|
7
|
+
- Reuses loop.py (scan_text_slop + diff_new_slop + discover_guardrail_configs), perf_audit.py, and ui_audit.py.
|
|
8
|
+
- Scans added lines for secrets/keys/PEMs, unpinned Actions, unsafe sinks, workarounds, Rust .unwrap(), Go `_ = err`.
|
|
9
|
+
- AST-checks changed Python tests for 0-assertion/tautological test theater and new functions for god-function bloat.
|
|
10
|
+
- Auto-dispatches installed fast linters (ruff, shellcheck, node --check, oxlint, biome) on changed files only.
|
|
11
|
+
- Enforces .deepmodebot/policy.xml <boundaries> (import layer rules) and <budgets> (file byte/line ceilings).
|
|
12
|
+
- Enforces Self-Improvement Memory (assets/sim/sim.py): harness edits need a new recorded SIM attempt.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import argparse
|
|
18
|
+
import ast
|
|
19
|
+
import fnmatch
|
|
20
|
+
import importlib.util
|
|
21
|
+
import json
|
|
22
|
+
import re
|
|
23
|
+
import shutil
|
|
24
|
+
import subprocess
|
|
25
|
+
import sys
|
|
26
|
+
import xml.etree.ElementTree as ET
|
|
27
|
+
from pathlib import Path
|
|
28
|
+
|
|
29
|
+
sys.dont_write_bytecode = True
|
|
30
|
+
|
|
31
|
+
NO_WINDOW = getattr(subprocess, "CREATE_NO_WINDOW", 0)
|
|
32
|
+
ASSETS_DIR = Path(__file__).resolve().parent.parent
|
|
33
|
+
SKILLS_DIR = ASSETS_DIR.parent.parent
|
|
34
|
+
DEFAULT_MAX_FUNC_LINES = 120
|
|
35
|
+
DEFAULT_MAX_NESTING = 5
|
|
36
|
+
|
|
37
|
+
SECRET_PATTERNS = (
|
|
38
|
+
("secret-aws-key", re.compile(r"\bAKIA[0-9A-Z]{16}\b"), "Remove hardcoded AWS key; inject via OIDC or vault."),
|
|
39
|
+
("secret-github-pat", re.compile(r"\b(?:ghp_[A-Za-z0-9]{36}|github_pat_[A-Za-z0-9_]{22,})\b"), "Revoke and remove GitHub PAT; inject via env/gh auth."),
|
|
40
|
+
("secret-anthropic-key", re.compile(r"\bsk-ant-[A-Za-z0-9_-]{20,}\b"), "Remove Anthropic API key; use subscription login or broker."),
|
|
41
|
+
("secret-openai-key", re.compile(r"\bsk-proj-[A-Za-z0-9_-]{20,}\b"), "Remove OpenAI key; use subscription login or broker."),
|
|
42
|
+
("secret-google-key", re.compile(r"\bAIza[0-9A-Za-z_-]{35}\b"), "Remove Google API key; inject from vault."),
|
|
43
|
+
("secret-stripe-live", re.compile(r"\bsk_live_[0-9A-Za-z]{20,}\b"), "Remove live Stripe key; rotate immediately."),
|
|
44
|
+
("secret-private-key", re.compile(r"-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----"), "Remove private key material from repository."),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
UNPINNED_ACTION_RE = re.compile(r"^\s*-?\s*uses:\s*[A-Za-z0-9_.-]+/[A-Za-z0-9_./-]+@(?:main|master)\b")
|
|
48
|
+
TS_CAST_SLOP_RE = re.compile(r"\bas\s+(?:any|unknown\s+as)\b")
|
|
49
|
+
UNSAFE_WEB_SINK_RE = re.compile(r"(?:\.innerHTML\s*=|\bdangerouslySetInnerHTML\b|\beval\s*\()")
|
|
50
|
+
CLIENT_ENV_SECRET_RE = re.compile(
|
|
51
|
+
r"(?<![A-Za-z0-9_$])(?:NEXT_PUBLIC|VITE|EXPO_PUBLIC|NUXT_PUBLIC)_[A-Z0-9_]*(?:SECRET|PRIVATE_KEY|SERVICE_ROLE|DATABASE_URL|WEBHOOK_SECRET)[A-Z0-9_]*(?![A-Za-z0-9_$])"
|
|
52
|
+
)
|
|
53
|
+
LLM_BROWSER_KEY_RE = re.compile(r"(?<![A-Za-z0-9_$])dangerouslyAllowBrowser\s*:\s*true(?![A-Za-z0-9_$])")
|
|
54
|
+
WORKERS_LEGACY_DO_RE = re.compile(
|
|
55
|
+
r"(?<![A-Za-z0-9_$])class\s+[A-Za-z_$][\w$]*(?:\s+extends\s+[^{]+?)?\s+implements\s+[^{]*?(?<![A-Za-z0-9_$])DurableObject(?![A-Za-z0-9_$])"
|
|
56
|
+
)
|
|
57
|
+
WORKERS_CTX_DESTRUCTURE_RE = re.compile(r"(?<![A-Za-z0-9_$])(?:const|let|var)\s*\{([^}]*)\}\s*=\s*ctx(?![A-Za-z0-9_$])")
|
|
58
|
+
WAIT_UNTIL_WORD_RE = re.compile(r"(?<![A-Za-z0-9_$])waitUntil(?![A-Za-z0-9_$])")
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _scrub_js_code_line(line: str) -> str:
|
|
62
|
+
out: list[str] = []
|
|
63
|
+
quote: str | None = None
|
|
64
|
+
i = 0
|
|
65
|
+
n = len(line)
|
|
66
|
+
while i < n:
|
|
67
|
+
ch = line[i]
|
|
68
|
+
if quote is not None:
|
|
69
|
+
if ch == "\\" and i + 1 < n:
|
|
70
|
+
out.append(" ")
|
|
71
|
+
i += 2
|
|
72
|
+
continue
|
|
73
|
+
if ch == quote:
|
|
74
|
+
out.append(ch)
|
|
75
|
+
quote = None
|
|
76
|
+
else:
|
|
77
|
+
out.append(" ")
|
|
78
|
+
i += 1
|
|
79
|
+
continue
|
|
80
|
+
if ch == "/" and i + 1 < n and line[i + 1] == "/":
|
|
81
|
+
break
|
|
82
|
+
if ch == "/" and i + 1 < n and line[i + 1] == "*":
|
|
83
|
+
end = line.find("*/", i + 2)
|
|
84
|
+
if end < 0:
|
|
85
|
+
break
|
|
86
|
+
out.append(" " * (end + 2 - i))
|
|
87
|
+
i = end + 2
|
|
88
|
+
continue
|
|
89
|
+
if ch in ("'", '"', "`"):
|
|
90
|
+
quote = ch
|
|
91
|
+
out.append(ch)
|
|
92
|
+
i += 1
|
|
93
|
+
continue
|
|
94
|
+
out.append(ch)
|
|
95
|
+
i += 1
|
|
96
|
+
return "".join(out)
|
|
97
|
+
RUST_UNWRAP_RE = re.compile(r"""(?<!['"`])\.unwrap\s*\(\s*\)(?!['"`])""")
|
|
98
|
+
GO_IGNORED_ERR_RE = re.compile(r"\b_\s*=\s*err\b")
|
|
99
|
+
JS_IMPORT_RE = re.compile(r"""(?:import\s+(?:[^'"]+?\s+from\s+)?|require\s*\(\s*)['"]([^'"]+)['"]""")
|
|
100
|
+
|
|
101
|
+
CODE_EXTS = frozenset({".py", ".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx", ".rs", ".go", ".sh", ".css", ".html", ".svelte"})
|
|
102
|
+
UI_EXTS = frozenset({".html", ".htm", ".css", ".scss", ".jsx", ".tsx", ".vue", ".svelte"})
|
|
103
|
+
TEST_FILE_RE = re.compile(r"(?:^|/)(?:tests?/|spec/|__tests__/)|(?:^|/)(?:test_[^/]+|[^/]+(?:_test|\.test|\.spec))\.[^/]+$", re.I)
|
|
104
|
+
JS_EXTS = {".js", ".mjs", ".cjs", ".jsx", ".ts", ".tsx"}
|
|
105
|
+
PROD_EXTS = JS_EXTS | {".py", ".rs", ".go"}
|
|
106
|
+
BRACE_EXTS = JS_EXTS | {".rs", ".go"}
|
|
107
|
+
DIFF_EXEMPT_DIRS = {".deepmodebot", "scripts", "docs", "evals"}
|
|
108
|
+
BRANCH_BASES = ("origin/HEAD", "origin/main", "origin/master", "main", "master")
|
|
109
|
+
TS_DIAGNOSTIC_RE = re.compile(r"^(.+)\((\d+),\d+\): error TS\d+: (.+)$")
|
|
110
|
+
BRACE_TOKEN_RE = re.compile(
|
|
111
|
+
r"""(?P<comment>//[^\n]*|/\*[\s\S]*?(?:\*/|\Z))|(?P<literal>r(?P<hash>#+)"[\s\S]*?"(?P=hash)|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[^\n]|[^'\\\n])*'|`(?:\\[\s\S]|[^`\\])*`)|[\w$]+|=>|->|::|[^\s]"""
|
|
112
|
+
)
|
|
113
|
+
_BLOCK_COMMENT_DELIMITER = re.compile(r"/\*|\*/")
|
|
114
|
+
GUARDRAIL_EXTRA = (".deepmodebot/ci.yml", ".deepmodebot/policy.xml", ".github/dependabot.yml")
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def _load_mod(name: str, path: Path):
|
|
118
|
+
if name in sys.modules:
|
|
119
|
+
return sys.modules[name]
|
|
120
|
+
spec = importlib.util.spec_from_file_location(name, path)
|
|
121
|
+
mod = importlib.util.module_from_spec(spec)
|
|
122
|
+
sys.modules[spec.name] = mod
|
|
123
|
+
spec.loader.exec_module(mod)
|
|
124
|
+
return mod
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def _git(root: Path, *args: str) -> subprocess.CompletedProcess:
|
|
128
|
+
p = subprocess.run(
|
|
129
|
+
["git", "-C", str(root), *args],
|
|
130
|
+
capture_output=True,
|
|
131
|
+
timeout=30,
|
|
132
|
+
creationflags=NO_WINDOW,
|
|
133
|
+
)
|
|
134
|
+
return subprocess.CompletedProcess(
|
|
135
|
+
p.args,
|
|
136
|
+
p.returncode,
|
|
137
|
+
p.stdout.decode("utf-8", errors="replace"),
|
|
138
|
+
p.stderr.decode("utf-8", errors="replace"),
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def _norm_rel_arg(raw: str) -> str:
|
|
143
|
+
s = raw.strip().replace("\\", "/")
|
|
144
|
+
while s.startswith("./"):
|
|
145
|
+
s = s[2:]
|
|
146
|
+
return s.lstrip("/")
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def _merge_base(root: Path, ref: str) -> str | None:
|
|
150
|
+
result = _git(root, "merge-base", "HEAD", ref) if not ref.startswith("-") else None
|
|
151
|
+
return result.stdout.strip() if result is not None and result.returncode == 0 else None
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def _change_scope(
|
|
155
|
+
root: Path, staged: bool, explicit_files: list[str] | None, base: str | None
|
|
156
|
+
) -> tuple[list[str], str | None]:
|
|
157
|
+
rev = _git(root, "rev-parse", "--verify", "HEAD")
|
|
158
|
+
head = rev.stdout.strip() if rev.returncode == 0 else None
|
|
159
|
+
if explicit_files:
|
|
160
|
+
return sorted({_norm_rel_arg(f) for f in explicit_files if _norm_rel_arg(f)}), head
|
|
161
|
+
|
|
162
|
+
def paths(*args: str) -> set[str]:
|
|
163
|
+
result = _git(root, *args)
|
|
164
|
+
return set(result.stdout.split("\0")) - {""} if result.returncode == 0 else set()
|
|
165
|
+
|
|
166
|
+
if staged:
|
|
167
|
+
return sorted(paths("diff", "--cached", "--name-only", "-z", "--diff-filter=ACMR")), head
|
|
168
|
+
|
|
169
|
+
diff = ["diff", "--name-only", "-z"]
|
|
170
|
+
untracked = paths("ls-files", "--others", "--exclude-standard", "-z")
|
|
171
|
+
if base is not None:
|
|
172
|
+
baseline = _merge_base(root, base)
|
|
173
|
+
if baseline is None:
|
|
174
|
+
raise ValueError(f"cannot resolve a merge base for {base!r}")
|
|
175
|
+
elif head and not untracked and not paths(*diff, head):
|
|
176
|
+
baseline = next((mb for ref in BRANCH_BASES if (mb := _merge_base(root, ref)) and mb != head), head)
|
|
177
|
+
else:
|
|
178
|
+
baseline = head
|
|
179
|
+
changed = paths(*diff, baseline or "--cached", "--diff-filter=ACMR") | untracked
|
|
180
|
+
if baseline != head:
|
|
181
|
+
changed |= paths(*diff, f"{baseline}..HEAD", "--diff-filter=ACMR")
|
|
182
|
+
return sorted(changed), baseline
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def _split_lf_lines(text: str) -> list[str]:
|
|
186
|
+
if not text:
|
|
187
|
+
return []
|
|
188
|
+
parts = text.split("\n")
|
|
189
|
+
if parts and parts[-1] == "":
|
|
190
|
+
parts.pop()
|
|
191
|
+
return [p[:-1] if p.endswith("\r") else p for p in parts]
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
def _added_lines_for_file(root: Path, rel: str, staged: bool, baseline: str | None, text: str) -> dict[int, str]:
|
|
195
|
+
full = root / rel
|
|
196
|
+
if not full.is_file() or full.is_symlink():
|
|
197
|
+
return {}
|
|
198
|
+
if not staged and (not baseline or _git(root, "ls-files", "--error-unmatch", "--", rel).returncode != 0):
|
|
199
|
+
return dict(enumerate(_split_lf_lines(text), 1))
|
|
200
|
+
cmd = ["diff", "--cached", "-U0", "--", rel] if staged else ["diff", baseline, "-U0", "--", rel]
|
|
201
|
+
diff = _git(root, *cmd)
|
|
202
|
+
if diff.returncode != 0:
|
|
203
|
+
return {}
|
|
204
|
+
added: dict[int, str] = {}
|
|
205
|
+
cur_line = 0
|
|
206
|
+
for raw in _split_lf_lines(diff.stdout):
|
|
207
|
+
if raw.startswith("@@ "):
|
|
208
|
+
m = re.search(r"\+(\d+)", raw)
|
|
209
|
+
if m:
|
|
210
|
+
cur_line = int(m.group(1))
|
|
211
|
+
elif cur_line and raw.startswith("+"):
|
|
212
|
+
added[cur_line] = raw[1:]
|
|
213
|
+
cur_line += 1
|
|
214
|
+
return added
|
|
215
|
+
|
|
216
|
+
def _read_text_safe(root: Path, rel: str, max_bytes: int = 1_048_576) -> str | None:
|
|
217
|
+
p = root / rel
|
|
218
|
+
if p.is_symlink() or not p.is_file():
|
|
219
|
+
return None
|
|
220
|
+
if not p.resolve().is_relative_to(root.resolve()):
|
|
221
|
+
return None
|
|
222
|
+
if p.stat().st_size > max_bytes:
|
|
223
|
+
return None
|
|
224
|
+
return p.read_bytes().decode("utf-8", errors="replace")
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
def _max_ast_nesting(node: ast.AST, depth: int = 0) -> int:
|
|
228
|
+
best = depth
|
|
229
|
+
for child in ast.iter_child_nodes(node):
|
|
230
|
+
inc = 1 if isinstance(child, (ast.If, ast.For, ast.AsyncFor, ast.While, ast.With, ast.AsyncWith, ast.Try)) else 0
|
|
231
|
+
sub = _max_ast_nesting(child, depth + inc)
|
|
232
|
+
if sub > best:
|
|
233
|
+
best = sub
|
|
234
|
+
return best
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
def _named_call(node: ast.AST, name: str) -> bool:
|
|
238
|
+
return isinstance(node, ast.Call) and isinstance(node.func, ast.Name) and node.func.id == name
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def _tautological_assertion(node: ast.AST) -> bool:
|
|
242
|
+
if isinstance(node, ast.Constant):
|
|
243
|
+
return node.value is True
|
|
244
|
+
if _named_call(node, "isinstance"):
|
|
245
|
+
return len(node.args) == 2 and isinstance(node.args[1], ast.Name) and node.args[1].id == "object"
|
|
246
|
+
if not isinstance(node, ast.Compare) or len(node.ops) != 1:
|
|
247
|
+
return False
|
|
248
|
+
left, op, right = node.left, node.ops[0], node.comparators[0]
|
|
249
|
+
if isinstance(op, ast.Eq):
|
|
250
|
+
return ast.dump(left) == ast.dump(right)
|
|
251
|
+
if isinstance(op, ast.LtE):
|
|
252
|
+
left, right = right, left
|
|
253
|
+
return (
|
|
254
|
+
isinstance(op, (ast.GtE, ast.LtE))
|
|
255
|
+
and _named_call(left, "len")
|
|
256
|
+
and len(left.args) == 1
|
|
257
|
+
and isinstance(right, ast.Constant)
|
|
258
|
+
and type(right.value) is int
|
|
259
|
+
and right.value == 0
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
def _test_theater_finding(rel: str, line: int, reason: str) -> dict:
|
|
264
|
+
return {"severity": "P1", "rule": f"test-theater-{reason}", "file": rel, "line": line,
|
|
265
|
+
"message": {"empty": "Empty test proves nothing.", "no-assert": "Test has zero behavioral assertions.",
|
|
266
|
+
"tautology": "Test assertion always passes."}[reason],
|
|
267
|
+
"fix": "Assert an observable behavior that fails when the implementation regresses."}
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
def _is_test_target(rel: str, ext: str) -> bool:
|
|
271
|
+
if ext not in PROD_EXTS:
|
|
272
|
+
return False
|
|
273
|
+
parts = rel.lower().split("/")
|
|
274
|
+
stem = parts[-1][:-len(ext)]
|
|
275
|
+
if ext == ".go":
|
|
276
|
+
return stem.endswith("_test")
|
|
277
|
+
if stem.startswith("test_") or stem.endswith(("_test", ".test", ".spec")):
|
|
278
|
+
return True
|
|
279
|
+
if ext in JS_EXTS:
|
|
280
|
+
return "__tests__" in parts[:-1]
|
|
281
|
+
return ext == ".rs" and (parts[-2:-1] == ["tests"] or stem == "main" and parts[-3:-2] == ["tests"])
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
def _empty_test_finding(rel: str) -> dict:
|
|
285
|
+
return {"severity": "P1", "rule": "empty-test-file", "file": rel, "line": 1,
|
|
286
|
+
"message": "Test file contains no test definitions.",
|
|
287
|
+
"fix": "Add a behavioral test or move helpers out of the test target."}
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
def _python_declares_tests(tree: ast.AST) -> bool:
|
|
291
|
+
functions = (ast.FunctionDef, ast.AsyncFunctionDef)
|
|
292
|
+
for node in ast.walk(tree):
|
|
293
|
+
if isinstance(node, functions) and node.name.startswith("test_"):
|
|
294
|
+
return True
|
|
295
|
+
if isinstance(node, ast.ClassDef):
|
|
296
|
+
if node.name.startswith("Test"):
|
|
297
|
+
return True
|
|
298
|
+
if any(isinstance(base, ast.Name) and base.id == "TestCase"
|
|
299
|
+
or isinstance(base, ast.Attribute) and base.attr == "TestCase" for base in node.bases):
|
|
300
|
+
if any(isinstance(child, functions) and child.name.startswith("test") for child in node.body):
|
|
301
|
+
return True
|
|
302
|
+
return False
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
def _check_python_ast(rel: str, text: str, added_lines: dict[int, str], max_func_lines: int, max_nesting: int, *, check_empty: bool) -> list[dict]:
|
|
306
|
+
findings: list[dict] = []
|
|
307
|
+
try:
|
|
308
|
+
tree = ast.parse(text, filename=rel)
|
|
309
|
+
except SyntaxError as exc:
|
|
310
|
+
return [{"severity": "P0", "rule": "py-syntax", "file": rel, "line": exc.lineno or 1,
|
|
311
|
+
"message": f"SyntaxError: {exc.msg}", "fix": "Fix Python syntax before continuing."}]
|
|
312
|
+
|
|
313
|
+
if check_empty and not _python_declares_tests(tree):
|
|
314
|
+
findings.append(_empty_test_finding(rel))
|
|
315
|
+
|
|
316
|
+
is_test = bool(TEST_FILE_RE.search(rel))
|
|
317
|
+
added_set = set(added_lines.keys())
|
|
318
|
+
|
|
319
|
+
for node in ast.walk(tree):
|
|
320
|
+
if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)):
|
|
321
|
+
start = node.lineno
|
|
322
|
+
end = getattr(node, "end_lineno", start) or start
|
|
323
|
+
touched = any(start <= ln <= end for ln in added_set)
|
|
324
|
+
if not touched:
|
|
325
|
+
continue
|
|
326
|
+
if is_test and node.name.startswith("test_"):
|
|
327
|
+
body = node.body
|
|
328
|
+
if body and isinstance(body[0], ast.Expr) and isinstance(body[0].value, ast.Constant) and isinstance(body[0].value.value, str):
|
|
329
|
+
body = body[1:]
|
|
330
|
+
if not body or all(isinstance(s, ast.Pass) or (isinstance(s, ast.Expr) and isinstance(s.value, ast.Constant) and s.value.value is Ellipsis) for s in body):
|
|
331
|
+
findings.append({"severity": "P1", "rule": "test-theater-empty", "file": rel, "line": start,
|
|
332
|
+
"message": f"Empty test `{node.name}` proves nothing.",
|
|
333
|
+
"fix": "Assert real observable behavior or delete the placeholder test."})
|
|
334
|
+
continue
|
|
335
|
+
has_oracle = False
|
|
336
|
+
for sub in ast.walk(node):
|
|
337
|
+
tautology = False
|
|
338
|
+
if isinstance(sub, ast.Assert):
|
|
339
|
+
has_oracle = True
|
|
340
|
+
tautology = _tautological_assertion(sub.test)
|
|
341
|
+
elif isinstance(sub, ast.Call):
|
|
342
|
+
fn = sub.func
|
|
343
|
+
fname = fn.attr if isinstance(fn, ast.Attribute) else (fn.id if isinstance(fn, ast.Name) else "")
|
|
344
|
+
if fname.startswith(("assert", "check_")) or fname in ("fail", "raises", "warns", "called"):
|
|
345
|
+
has_oracle = True
|
|
346
|
+
if fname == "assertEqual" and len(sub.args) >= 2:
|
|
347
|
+
tautology = ast.dump(sub.args[0]) == ast.dump(sub.args[1])
|
|
348
|
+
elif fname == "assertTrue" and sub.args:
|
|
349
|
+
tautology = _tautological_assertion(sub.args[0])
|
|
350
|
+
if tautology and sub.lineno in added_set:
|
|
351
|
+
findings.append(_test_theater_finding(rel, sub.lineno, "tautology"))
|
|
352
|
+
if not has_oracle:
|
|
353
|
+
findings.append({"severity": "P1", "rule": "test-theater-no-assert", "file": rel, "line": start,
|
|
354
|
+
"message": f"Test `{node.name}` has zero assertions.",
|
|
355
|
+
"fix": "Add concrete behavioral assertions or delete the dead test."})
|
|
356
|
+
elif not is_test and start in added_set:
|
|
357
|
+
span = end - start + 1
|
|
358
|
+
if span > max_func_lines:
|
|
359
|
+
findings.append({"severity": "P2", "rule": "complexity-god-func", "file": rel, "line": start,
|
|
360
|
+
"message": f"New function `{node.name}` is {span} lines (max {max_func_lines}).",
|
|
361
|
+
"fix": "Split into cohesive single-responsibility helpers."})
|
|
362
|
+
nest = _max_ast_nesting(node)
|
|
363
|
+
if nest > max_nesting:
|
|
364
|
+
findings.append({"severity": "P2", "rule": "complexity-nesting", "file": rel, "line": start,
|
|
365
|
+
"message": f"New function `{node.name}` nesting depth is {nest} (max {max_nesting}).",
|
|
366
|
+
"fix": "Use guard clauses/early returns or extract inner loop."})
|
|
367
|
+
|
|
368
|
+
if not is_test and isinstance(node, ast.Call) and node.lineno in added_set:
|
|
369
|
+
fn = node.func
|
|
370
|
+
if isinstance(fn, ast.Attribute) and fn.attr == "run" and isinstance(fn.value, ast.Name) and fn.value.id == "subprocess":
|
|
371
|
+
has_timeout = any(kw.arg == "timeout" for kw in node.keywords)
|
|
372
|
+
if not has_timeout:
|
|
373
|
+
findings.append({"severity": "P1", "rule": "safety-subprocess-timeout", "file": rel, "line": node.lineno,
|
|
374
|
+
"message": "`subprocess.run()` called without `timeout=`.",
|
|
375
|
+
"fix": "Pass an explicit `timeout=` bound so child commands cannot hang forever."})
|
|
376
|
+
|
|
377
|
+
return findings
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
def _brace_tokens(text: str, ext: str) -> tuple[list[str], list[int], dict[int, int]]:
|
|
381
|
+
values: list[str] = []
|
|
382
|
+
lines: list[int] = []
|
|
383
|
+
closes: dict[int, int] = {}
|
|
384
|
+
stack: list[int] = []
|
|
385
|
+
line = 1
|
|
386
|
+
end = 0
|
|
387
|
+
pairs = {"}": "{", ")": "(", "]": "["}
|
|
388
|
+
while match := BRACE_TOKEN_RE.search(text, end):
|
|
389
|
+
line += text.count("\n", end, match.start())
|
|
390
|
+
start, end = match.span()
|
|
391
|
+
if ext == ".rs" and text.startswith("/*", start):
|
|
392
|
+
depth, end = 1, start + 2
|
|
393
|
+
while depth and (delimiter := _BLOCK_COMMENT_DELIMITER.search(text, end)) is not None:
|
|
394
|
+
end = delimiter.end()
|
|
395
|
+
depth += 1 if delimiter[0] == "/*" else -1
|
|
396
|
+
if depth:
|
|
397
|
+
end = len(text)
|
|
398
|
+
if match.group("comment") is None:
|
|
399
|
+
value = "<literal>" if match.group("literal") is not None else match[0]
|
|
400
|
+
if ext == ".go" and text[start] == "`":
|
|
401
|
+
closing = text.find("`", start + 1)
|
|
402
|
+
end = closing + 1 if closing >= 0 else len(text)
|
|
403
|
+
value = "<literal>"
|
|
404
|
+
index = len(values)
|
|
405
|
+
if value in ("{", "(", "["):
|
|
406
|
+
stack.append(index)
|
|
407
|
+
elif value in pairs and stack and values[stack[-1]] == pairs[value]:
|
|
408
|
+
closes[stack.pop()] = index
|
|
409
|
+
values.append(value)
|
|
410
|
+
lines.append(line)
|
|
411
|
+
line += text.count("\n", start, end)
|
|
412
|
+
return values, lines, closes
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
def _next_top_level(values: list[str], closes: dict[int, int], start: int, end: int, stops: set[str]) -> int:
|
|
416
|
+
while start < end and values[start] not in stops:
|
|
417
|
+
start = closes.get(start, start) + 1
|
|
418
|
+
return start
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
def _rust_test_ranges(values: list[str], lines: list[int], closes: dict[int, int]) -> list[tuple[int, int]]:
|
|
422
|
+
ranges = []
|
|
423
|
+
for i, value in enumerate(values):
|
|
424
|
+
if value != "#" or values[i:i + 7] != ["#", "[", "cfg", "(", "test", ")", "]"]:
|
|
425
|
+
continue
|
|
426
|
+
start = i + 7
|
|
427
|
+
while values[start:start + 2] == ["#", "["] and start + 1 in closes:
|
|
428
|
+
start = closes[start + 1] + 1
|
|
429
|
+
end = _next_top_level(values, closes, start, len(values), {"{", ";"})
|
|
430
|
+
if end < len(values):
|
|
431
|
+
ranges.append((lines[i], lines[closes.get(end, end)]))
|
|
432
|
+
return ranges
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
def _brace_tests(
|
|
436
|
+
ext: str, values: list[str], closes: dict[int, int]
|
|
437
|
+
):
|
|
438
|
+
opens = {end: start for start, end in closes.items()} if ext == ".rs" else {}
|
|
439
|
+
for i, value in enumerate(values):
|
|
440
|
+
tail = values[i + 1:i + 2]
|
|
441
|
+
if ext in JS_EXTS and value in ("it", "test") and tail == ["("] and i + 1 in closes:
|
|
442
|
+
end = closes[i + 1]
|
|
443
|
+
marker = _next_top_level(values, closes, i + 2, end, {"=>", "function"})
|
|
444
|
+
if marker == end:
|
|
445
|
+
continue
|
|
446
|
+
if values[marker] == "function":
|
|
447
|
+
body = _next_top_level(values, closes, marker + 1, end, {"{"})
|
|
448
|
+
else:
|
|
449
|
+
body = marker + 1
|
|
450
|
+
if body < end:
|
|
451
|
+
if values[body] == "{" and body in closes:
|
|
452
|
+
yield i, body + 1, closes[body], closes[body], False
|
|
453
|
+
else:
|
|
454
|
+
end = _next_top_level(values, closes, body, end, {","})
|
|
455
|
+
yield i, body, end, end, False
|
|
456
|
+
continue
|
|
457
|
+
if ext == ".rs" and value == "#" and tail == ["["] and i + 1 in closes:
|
|
458
|
+
end = closes[i + 1]
|
|
459
|
+
if values[i + 2:end] not in (["test"], ["tokio", "::", "test"]) and values[i + 2:i + 6] != ["tokio", "::", "test", "("]:
|
|
460
|
+
continue
|
|
461
|
+
start = end + 1
|
|
462
|
+
while values[start:start + 2] == ["#", "["] and start + 1 in closes:
|
|
463
|
+
start = closes[start + 1] + 1
|
|
464
|
+
fn = _next_top_level(values, closes, start, len(values), {"fn", "{", ";", "}"})
|
|
465
|
+
if values[fn:fn + 1] != ["fn"]:
|
|
466
|
+
continue
|
|
467
|
+
body = _next_top_level(values, closes, fn + 1, len(values), {"{", ";", "}"})
|
|
468
|
+
if values[body:body + 1] == ["{"] and body in closes:
|
|
469
|
+
prior = i
|
|
470
|
+
while prior >= 2 and values[prior - 1] == "]":
|
|
471
|
+
attr = opens.get(prior - 1, 0)
|
|
472
|
+
if attr == 0 or values[attr - 1] != "#":
|
|
473
|
+
break
|
|
474
|
+
prior = attr - 1
|
|
475
|
+
special = any(values[j:j + 3] == ["#", "[", "should_panic"] for j in range(prior, fn)) or any(
|
|
476
|
+
values[j:j + 3] == ["->", "Result", "<"] for j in range(fn + 1, body)
|
|
477
|
+
)
|
|
478
|
+
yield i, body + 1, closes[body], closes[body], special
|
|
479
|
+
continue
|
|
480
|
+
if ext == ".go" and value == "func" and tail and tail[0].startswith("Test") and values[i + 2:i + 3] == ["("]:
|
|
481
|
+
body = closes.get(i + 2, i + 2) + 1
|
|
482
|
+
if values[body:body + 1] == ["{"] and body in closes:
|
|
483
|
+
yield i, body + 1, closes[body], closes[body], False
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
def _brace_declares_tests(ext: str, values: list[str], closes: dict[int, int]) -> bool:
|
|
487
|
+
if ext not in JS_EXTS:
|
|
488
|
+
return any(True for _ in _brace_tests(ext, values, closes))
|
|
489
|
+
for i, value in enumerate(values):
|
|
490
|
+
if value not in ("test", "it") or values[i - 1:i] == ["function"]:
|
|
491
|
+
continue
|
|
492
|
+
start = i + 1
|
|
493
|
+
while values[start:start + 1] == ["."] and values[start + 1:start + 2] in (
|
|
494
|
+
["only"], ["skip"], ["todo"], ["concurrent"], ["each"],
|
|
495
|
+
):
|
|
496
|
+
start += 2
|
|
497
|
+
if values[start:start + 1] != ["("] or start not in closes:
|
|
498
|
+
continue
|
|
499
|
+
end = closes[start]
|
|
500
|
+
if end > start + 1 and values[end + 1:end + 2] != ["{"]:
|
|
501
|
+
return True
|
|
502
|
+
return False
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
def _check_staged_test_target(root: Path, rel: str, ext: str) -> list[dict]:
|
|
506
|
+
blob = _git(root, "show", f":{rel}")
|
|
507
|
+
if blob.returncode != 0 or len(blob.stdout) > 1_048_576:
|
|
508
|
+
return []
|
|
509
|
+
if ext == ".py":
|
|
510
|
+
try:
|
|
511
|
+
tree = ast.parse(blob.stdout, filename=rel)
|
|
512
|
+
except SyntaxError:
|
|
513
|
+
return []
|
|
514
|
+
found = _python_declares_tests(tree)
|
|
515
|
+
else:
|
|
516
|
+
values, _, closes = _brace_tokens(blob.stdout, ext)
|
|
517
|
+
found = _brace_declares_tests(ext, values, closes)
|
|
518
|
+
return [] if found else [_empty_test_finding(rel)]
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
def _scan_brace_tests(
|
|
522
|
+
rel: str, ext: str, values: list[str], lines: list[int], closes: dict[int, int], added: dict[int, str],
|
|
523
|
+
) -> list[dict]:
|
|
524
|
+
findings = []
|
|
525
|
+
for start, body, end, last, oracle in _brace_tests(ext, values, closes):
|
|
526
|
+
if not any(line in added for line in range(lines[start], lines[last] + 1)):
|
|
527
|
+
continue
|
|
528
|
+
if body == end:
|
|
529
|
+
findings.append(_test_theater_finding(rel, lines[start], "empty"))
|
|
530
|
+
continue
|
|
531
|
+
for i in range(body, end):
|
|
532
|
+
token = values[i]
|
|
533
|
+
following = values[i + 1:i + 2]
|
|
534
|
+
tautology = False
|
|
535
|
+
if ext in JS_EXTS:
|
|
536
|
+
oracle |= (token in {"expect", "assert", "rejects", "throws", "verify"} and following in (["("], ["."])) or (
|
|
537
|
+
token in {"rejects", "throws"} and values[i - 1:i] == ["."]
|
|
538
|
+
)
|
|
539
|
+
if token == "expect" and values[i + 2:i + 3] in (["true"], ["false"], ["1"]):
|
|
540
|
+
literal = values[i + 2]
|
|
541
|
+
tautology = values[i:i + 9] == ["expect", "(", literal, ")", ".", "toBe", "(", literal, ")"]
|
|
542
|
+
if ext == ".rs":
|
|
543
|
+
oracle |= (token.startswith(("assert", "debug_assert")) or token == "panic") and following == ["!"]
|
|
544
|
+
if token == "assert":
|
|
545
|
+
tautology = values[i + 1:i + 5] == ["!", "(", "true", ")"]
|
|
546
|
+
elif token == "assert_eq":
|
|
547
|
+
tautology = values[i + 1:i + 7] == ["!", "(", "1", ",", "1", ")"]
|
|
548
|
+
elif ext not in JS_EXTS:
|
|
549
|
+
oracle |= following == ["."] and (token in {"assert", "require"} or (
|
|
550
|
+
token == "t" and values[i + 2:i + 3] in (["Fatal"], ["Fatalf"], ["Error"], ["Errorf"], ["Fail"], ["FailNow"])
|
|
551
|
+
))
|
|
552
|
+
if tautology and lines[i] in added:
|
|
553
|
+
findings.append(_test_theater_finding(rel, lines[i], "tautology"))
|
|
554
|
+
if not oracle:
|
|
555
|
+
findings.append(_test_theater_finding(rel, lines[start], "no-assert"))
|
|
556
|
+
return findings
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
def _check_secrets_and_patterns(rel: str, added_lines: dict[int, str], full_text: str) -> list[dict]:
|
|
560
|
+
findings: list[dict] = []
|
|
561
|
+
ext = Path(rel).suffix.lower()
|
|
562
|
+
is_test = bool(TEST_FILE_RE.search(rel))
|
|
563
|
+
rs_cfg_test_line = None
|
|
564
|
+
if ext == ".rs":
|
|
565
|
+
for idx, fl in enumerate(full_text.splitlines(), 1):
|
|
566
|
+
if fl.strip().startswith("#[cfg(test)]"):
|
|
567
|
+
rs_cfg_test_line = idx
|
|
568
|
+
break
|
|
569
|
+
|
|
570
|
+
for ln, line in sorted(added_lines.items()):
|
|
571
|
+
in_test_ctx = is_test or (rs_cfg_test_line is not None and ln >= rs_cfg_test_line)
|
|
572
|
+
for rule_id, pat, fix in SECRET_PATTERNS:
|
|
573
|
+
if rule_id == "secret-private-key" and in_test_ctx and ("compile(" in line or 'r"' in line or "r'" in line or '"-----BEGIN' in line or "'-----BEGIN" in line):
|
|
574
|
+
continue
|
|
575
|
+
if pat.search(line):
|
|
576
|
+
findings.append({"severity": "P0", "rule": rule_id, "file": rel, "line": ln,
|
|
577
|
+
"message": f"Potential hardcoded secret matched `{rule_id}`.", "fix": fix})
|
|
578
|
+
if rel.startswith(".github/workflows/") and ext in (".yml", ".yaml") and UNPINNED_ACTION_RE.search(line):
|
|
579
|
+
findings.append({"severity": "P1", "rule": "supply-chain-unpinned-action", "file": rel, "line": ln,
|
|
580
|
+
"message": "GitHub Action pinned to mutable `@main`/`@master` ref.",
|
|
581
|
+
"fix": "Pin to a full 40-char commit SHA or immutable tag."})
|
|
582
|
+
if not in_test_ctx and ext in (".ts", ".tsx") and TS_CAST_SLOP_RE.search(line):
|
|
583
|
+
findings.append({"severity": "P1", "rule": "ts-unsafe-cast", "file": rel, "line": ln,
|
|
584
|
+
"message": "Unsafe `as any` / `as unknown as` type escape.",
|
|
585
|
+
"fix": "Narrow with a proper type guard or schema parser."})
|
|
586
|
+
js_code = _scrub_js_code_line(line) if ext in (".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx", ".svelte", ".vue") else ""
|
|
587
|
+
if not in_test_ctx and CLIENT_ENV_SECRET_RE.search(line):
|
|
588
|
+
findings.append({"severity": "P0", "rule": "client-env-secret", "file": rel, "line": ln,
|
|
589
|
+
"message": "Client-exposed env prefix (`NEXT_PUBLIC_`/`VITE_`/`EXPO_PUBLIC_`/`NUXT_PUBLIC_`) names a secret/private/DB credential.",
|
|
590
|
+
"fix": "Keep secrets in server-only env vars and access them behind a server route or Action."})
|
|
591
|
+
if not in_test_ctx and js_code and LLM_BROWSER_KEY_RE.search(js_code):
|
|
592
|
+
findings.append({"severity": "P0", "rule": "llm-browser-key-exposure", "file": rel, "line": ln,
|
|
593
|
+
"message": "`dangerouslyAllowBrowser: true` exposes provider API keys in client bundles.",
|
|
594
|
+
"fix": "Move LLM SDK calls behind a server endpoint or Durable Object / Edge route."})
|
|
595
|
+
if not in_test_ctx and ext in (".js", ".mjs", ".ts", ".tsx") and WORKERS_LEGACY_DO_RE.search(js_code):
|
|
596
|
+
findings.append({"severity": "P1", "rule": "workers-legacy-implements-do", "file": rel, "line": ln,
|
|
597
|
+
"message": "Legacy `implements DurableObject` omits `this.ctx` and `this.env` bindings.",
|
|
598
|
+
"fix": "Import `DurableObject` from `cloudflare:workers` and use `extends DurableObject<Env>`."})
|
|
599
|
+
if not in_test_ctx and ext in (".js", ".mjs", ".ts", ".tsx"):
|
|
600
|
+
m_ctx = WORKERS_CTX_DESTRUCTURE_RE.search(js_code)
|
|
601
|
+
if m_ctx and WAIT_UNTIL_WORD_RE.search(m_ctx.group(1)):
|
|
602
|
+
findings.append({"severity": "P1", "rule": "workers-ctx-destructure", "file": rel, "line": ln,
|
|
603
|
+
"message": "Destructuring `const { waitUntil } = ctx` loses `ExecutionContext` `this` binding and throws `Illegal invocation`.",
|
|
604
|
+
"fix": "Call `ctx.waitUntil(...)` directly on `ctx`."})
|
|
605
|
+
if not in_test_ctx and ext in (".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx", ".html") and UNSAFE_WEB_SINK_RE.search(line):
|
|
606
|
+
findings.append({"severity": "P1", "rule": "security-unsafe-sink", "file": rel, "line": ln,
|
|
607
|
+
"message": "Unsafe dynamic sink (`eval`/`innerHTML`/`dangerouslySetInnerHTML`).",
|
|
608
|
+
"fix": "Use safe DOM nodes (`textContent`) or sanitized renderer."})
|
|
609
|
+
if not in_test_ctx and ext == ".rs" and RUST_UNWRAP_RE.search(line):
|
|
610
|
+
findings.append({"severity": "P1", "rule": "rust-prod-unwrap", "file": rel, "line": ln,
|
|
611
|
+
"message": "`.unwrap()` in non-test Rust code panics on unexpected input.",
|
|
612
|
+
"fix": "Propagate with `?` or handle error explicitly."})
|
|
613
|
+
if not is_test and ext == ".go" and GO_IGNORED_ERR_RE.search(line):
|
|
614
|
+
findings.append({"severity": "P1", "rule": "go-ignored-err", "file": rel, "line": ln,
|
|
615
|
+
"message": "Swallowed Go error (`_ = err`).",
|
|
616
|
+
"fix": "Check and return or explicitly handle `err`."})
|
|
617
|
+
|
|
618
|
+
if rel in (".github/dependabot.yml", ".github/dependabot.yaml") and added_lines and "cooldown:" not in full_text:
|
|
619
|
+
findings.append({"severity": "P2", "rule": "supply-chain-dependabot-cooldown", "file": rel, "line": 1,
|
|
620
|
+
"message": f"`{rel}` has no `cooldown:` window.",
|
|
621
|
+
"fix": "Add `cooldown: { default-days: 7 }` to reduce zero-day supply-chain exposure."})
|
|
622
|
+
return findings
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
def _check_policy_xml(root: Path, changed: list[str]) -> list[dict]:
|
|
626
|
+
policy_path = root / ".deepmodebot" / "policy.xml"
|
|
627
|
+
if not policy_path.is_file() or policy_path.is_symlink():
|
|
628
|
+
return []
|
|
629
|
+
findings: list[dict] = []
|
|
630
|
+
try:
|
|
631
|
+
xml_root = ET.fromstring(policy_path.read_text(encoding="utf-8"))
|
|
632
|
+
except (OSError, ET.ParseError) as exc:
|
|
633
|
+
return [{"severity": "P0", "rule": "policy-xml-invalid", "file": ".deepmodebot/policy.xml", "line": 1,
|
|
634
|
+
"message": f"Invalid policy.xml: {exc}", "fix": "Fix XML syntax in .deepmodebot/policy.xml."}]
|
|
635
|
+
|
|
636
|
+
for b_el in xml_root.findall("./budgets/file"):
|
|
637
|
+
rel = (b_el.attrib.get("path") or "").strip()
|
|
638
|
+
if not rel:
|
|
639
|
+
continue
|
|
640
|
+
p = root / rel
|
|
641
|
+
if not p.is_file() or p.is_symlink():
|
|
642
|
+
continue
|
|
643
|
+
raw = p.read_bytes()
|
|
644
|
+
max_bytes = int(b_el.attrib["max-bytes"]) if "max-bytes" in b_el.attrib else None
|
|
645
|
+
max_lines = int(b_el.attrib["max-lines"]) if "max-lines" in b_el.attrib else None
|
|
646
|
+
if max_bytes is not None and len(raw) > max_bytes:
|
|
647
|
+
findings.append({"severity": "P1", "rule": "budget-max-bytes", "file": rel, "line": 1,
|
|
648
|
+
"message": f"File size {len(raw)} B exceeds policy budget {max_bytes} B.",
|
|
649
|
+
"fix": "Trim bloat or progressively disclose reference detail into a sibling file."})
|
|
650
|
+
if max_lines is not None:
|
|
651
|
+
lcount = len(raw.decode("utf-8", errors="replace").splitlines())
|
|
652
|
+
if lcount > max_lines:
|
|
653
|
+
findings.append({"severity": "P1", "rule": "budget-max-lines", "file": rel, "line": 1,
|
|
654
|
+
"message": f"File length {lcount} lines exceeds policy budget {max_lines} lines.",
|
|
655
|
+
"fix": "Move non-essential prose out to referenced docs."})
|
|
656
|
+
|
|
657
|
+
forbid_rules = [
|
|
658
|
+
(el.attrib.get("from", ""), el.attrib.get("to", ""), el.attrib.get("reason", "forbidden layer import"))
|
|
659
|
+
for el in xml_root.findall("./boundaries/forbid")
|
|
660
|
+
if el.attrib.get("from") and el.attrib.get("to")
|
|
661
|
+
]
|
|
662
|
+
if forbid_rules:
|
|
663
|
+
for rel in changed:
|
|
664
|
+
text = _read_text_safe(root, rel)
|
|
665
|
+
if text is None:
|
|
666
|
+
continue
|
|
667
|
+
ext = Path(rel).suffix.lower()
|
|
668
|
+
imports: list[tuple[int, str]] = []
|
|
669
|
+
if ext == ".py":
|
|
670
|
+
try:
|
|
671
|
+
tree = ast.parse(text, filename=rel)
|
|
672
|
+
for n in ast.walk(tree):
|
|
673
|
+
if isinstance(n, ast.Import):
|
|
674
|
+
for a in n.names:
|
|
675
|
+
imports.append((n.lineno, a.name.replace(".", "/")))
|
|
676
|
+
elif isinstance(n, ast.ImportFrom) and n.module:
|
|
677
|
+
imports.append((n.lineno, n.module.replace(".", "/")))
|
|
678
|
+
except SyntaxError:
|
|
679
|
+
pass
|
|
680
|
+
elif ext in (".js", ".mjs", ".cjs", ".ts", ".tsx", ".jsx"):
|
|
681
|
+
for idx, line in enumerate(text.splitlines(), 1):
|
|
682
|
+
for m in JS_IMPORT_RE.finditer(line):
|
|
683
|
+
imports.append((idx, m.group(1)))
|
|
684
|
+
for from_pat, to_pat, reason in forbid_rules:
|
|
685
|
+
if not fnmatch.fnmatch(rel, from_pat):
|
|
686
|
+
continue
|
|
687
|
+
for ln, imp in imports:
|
|
688
|
+
norm_imp = imp.lstrip("./")
|
|
689
|
+
if fnmatch.fnmatch(norm_imp, to_pat) or fnmatch.fnmatch(imp, to_pat):
|
|
690
|
+
findings.append({"severity": "P0", "rule": "boundary-violation", "file": rel, "line": ln,
|
|
691
|
+
"message": f"Forbidden import `{imp}` from `{rel}` ({reason}).",
|
|
692
|
+
"fix": f"Invert dependency or route through an allowed interface outside `{to_pat}`."})
|
|
693
|
+
return findings
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
def _diagnostic_rel(root: Path, path: str | None) -> str | None:
|
|
697
|
+
if path:
|
|
698
|
+
candidate = root / path
|
|
699
|
+
try:
|
|
700
|
+
return candidate.resolve().relative_to(root).as_posix()
|
|
701
|
+
except (ValueError, OSError):
|
|
702
|
+
pass
|
|
703
|
+
return None
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
def _run_polyglot_linters(root: Path, changed: list[str]) -> tuple[list[dict], list[str]]:
|
|
707
|
+
findings: list[dict] = []
|
|
708
|
+
ran: list[str] = []
|
|
709
|
+
files = [f for f in changed if (root / f).is_file() and not (root / f).is_symlink()]
|
|
710
|
+
py_files = [f for f in files if f.endswith(".py")]
|
|
711
|
+
js_files = [f for f in files if Path(f).suffix.lower() in JS_EXTS]
|
|
712
|
+
sh_files = [f for f in files if f.endswith(".sh")]
|
|
713
|
+
|
|
714
|
+
def invoke(name: str, command: list[str], timeout: int = 30) -> subprocess.CompletedProcess:
|
|
715
|
+
if name not in ran:
|
|
716
|
+
ran.append(name)
|
|
717
|
+
try:
|
|
718
|
+
return subprocess.run(command, cwd=root, capture_output=True, encoding="utf-8",
|
|
719
|
+
errors="replace", timeout=timeout, creationflags=NO_WINDOW)
|
|
720
|
+
except (OSError, subprocess.TimeoutExpired) as exc:
|
|
721
|
+
return subprocess.CompletedProcess(command, 124, "", str(exc))
|
|
722
|
+
|
|
723
|
+
def failure(rule: str, file: str, result: subprocess.CompletedProcess, severity: str = "P1") -> None:
|
|
724
|
+
message = (result.stdout + "\n" + result.stderr).strip()
|
|
725
|
+
findings.append({"severity": severity, "rule": rule, "file": file, "line": 1,
|
|
726
|
+
"message": message[-1500:] or f"{rule} exited with status {result.returncode}.",
|
|
727
|
+
"fix": f"Resolve the {rule} diagnostics."})
|
|
728
|
+
|
|
729
|
+
if py_files and (ruff := shutil.which("ruff")):
|
|
730
|
+
r = invoke("ruff", [ruff, "check", "--no-cache", "--select",
|
|
731
|
+
"E9,F63,F7,F82,F401,F811,F841,B006,B007,B012,B023,S102,S307",
|
|
732
|
+
"--output-format", "json", "--", *py_files])
|
|
733
|
+
if r.returncode != 0:
|
|
734
|
+
try:
|
|
735
|
+
items = json.loads(r.stdout)
|
|
736
|
+
except ValueError:
|
|
737
|
+
items = []
|
|
738
|
+
if not items:
|
|
739
|
+
failure("ruff", py_files[0], r)
|
|
740
|
+
for it in items[:20]:
|
|
741
|
+
loc = it.get("location") or {}
|
|
742
|
+
fname = _diagnostic_rel(root, it.get("filename")) or py_files[0]
|
|
743
|
+
findings.append({"severity": "P1", "rule": f"ruff-{it.get('code', 'ERR')}", "file": fname,
|
|
744
|
+
"line": int(loc.get("row") or 1), "message": it.get("message", "ruff error"),
|
|
745
|
+
"fix": "Fix the ruff diagnostic on the changed Python file."})
|
|
746
|
+
|
|
747
|
+
if py_files and (root / "pyrightconfig.json").is_file() and (pyright := shutil.which("pyright")):
|
|
748
|
+
r = invoke("pyright", [pyright, *["./" + f for f in py_files]])
|
|
749
|
+
if r.returncode != 0:
|
|
750
|
+
failure("pyright", py_files[0], r)
|
|
751
|
+
|
|
752
|
+
if js_files:
|
|
753
|
+
if node := shutil.which("node"):
|
|
754
|
+
for file in js_files:
|
|
755
|
+
if Path(file).suffix.lower() not in {".js", ".mjs", ".cjs"}:
|
|
756
|
+
continue
|
|
757
|
+
r = invoke("node-check", [node, "--check", "./" + file], timeout=15)
|
|
758
|
+
if r.returncode != 0:
|
|
759
|
+
failure("node-syntax", file, r, "P0")
|
|
760
|
+
if oxlint := shutil.which("oxlint"):
|
|
761
|
+
r = invoke("oxlint", [oxlint, "-D", "correctness", "-D", "suspicious", "--", *js_files])
|
|
762
|
+
if r.returncode != 0:
|
|
763
|
+
failure("oxlint", js_files[0], r)
|
|
764
|
+
elif any((root / f).is_file() for f in ("biome.json", "biome.jsonc")) and (biome := shutil.which("biome")):
|
|
765
|
+
r = invoke("biome", [biome, "lint", "--", *js_files])
|
|
766
|
+
if r.returncode != 0:
|
|
767
|
+
failure("biome", js_files[0], r)
|
|
768
|
+
|
|
769
|
+
ts_files = {f for f in js_files if Path(f).suffix.lower() in {".ts", ".tsx"}}
|
|
770
|
+
if ts_files and (root / "tsconfig.json").is_file():
|
|
771
|
+
bin_dir = root / "node_modules/.bin"
|
|
772
|
+
tsc = next((str(path) for name in ("tsc.cmd", "tsc") if (path := bin_dir / name).is_file()), None) if sys.platform == "win32" else None
|
|
773
|
+
if not tsc:
|
|
774
|
+
tsc = shutil.which(str(bin_dir / "tsc")) or shutil.which("tsc")
|
|
775
|
+
if tsc:
|
|
776
|
+
r = invoke("tsc", [tsc, "--noEmit", "--pretty", "false"])
|
|
777
|
+
failed_without_file = r.returncode != 0
|
|
778
|
+
for line in (r.stdout + "\n" + r.stderr).splitlines():
|
|
779
|
+
if match := TS_DIAGNOSTIC_RE.match(line):
|
|
780
|
+
failed_without_file = False
|
|
781
|
+
file = _diagnostic_rel(root, match[1])
|
|
782
|
+
if file in ts_files:
|
|
783
|
+
findings.append({"severity": "P1", "rule": "ts-typecheck", "file": file,
|
|
784
|
+
"line": int(match[2]), "message": match[3],
|
|
785
|
+
"fix": "Fix the TypeScript error on the changed file."})
|
|
786
|
+
if failed_without_file:
|
|
787
|
+
failure("ts-typecheck", min(ts_files), r)
|
|
788
|
+
|
|
789
|
+
go_files = [f for f in files if f.endswith(".go")]
|
|
790
|
+
if go_files and (root / "go.mod").is_file() and (go := shutil.which("go")):
|
|
791
|
+
r = invoke("go-vet", [go, "vet", "./..."])
|
|
792
|
+
if r.returncode != 0:
|
|
793
|
+
failure("go-vet", go_files[0], r)
|
|
794
|
+
|
|
795
|
+
if sh_files and (shellcheck := shutil.which("shellcheck")):
|
|
796
|
+
r = invoke("shellcheck", [shellcheck, "-S", "error", "-f", "json", "--", *sh_files])
|
|
797
|
+
if r.returncode != 0:
|
|
798
|
+
try:
|
|
799
|
+
items = json.loads(r.stdout)
|
|
800
|
+
except ValueError:
|
|
801
|
+
items = []
|
|
802
|
+
if not items:
|
|
803
|
+
failure("shellcheck", sh_files[0], r)
|
|
804
|
+
for it in items[:15]:
|
|
805
|
+
findings.append({"severity": "P1", "rule": f"SC{it.get('code', '')}", "file": it.get("file", sh_files[0]),
|
|
806
|
+
"line": int(it.get("line") or 1), "message": it.get("message", "shellcheck error"),
|
|
807
|
+
"fix": "Fix the shellcheck error."})
|
|
808
|
+
|
|
809
|
+
return findings, ran
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
REWARD_HACK_GOTCHA = "a verification or evaluation step changed behavior; keep its original behavior and fix the underlying failure"
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
def _gotcha_content(pm, findings: list[dict], key: str, source: str) -> str:
|
|
816
|
+
"""Note text that the memory screen accepts: scanner-authored messages describe the trigger, so they stay out."""
|
|
817
|
+
rules = sorted({f["rule"] for f in findings})[:6]
|
|
818
|
+
sample = findings[0]
|
|
819
|
+
head = f"Slop gate blocked {len(findings)} issue(s) ({', '.join(rules)})"
|
|
820
|
+
if sample["rule"].startswith("reward-hack-"):
|
|
821
|
+
return f"{head}: {REWARD_HACK_GOTCHA}."
|
|
822
|
+
detail = f"{head}: {sample['message']} -> {sample['fix']}"
|
|
823
|
+
if pm.note_violations(key=key, kind="gotcha", content=detail, tags="slop-gate,ci", source=source):
|
|
824
|
+
return f"{head}: see {source} and fix the reported cause."
|
|
825
|
+
return detail
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
def _record_gotcha_memory(root: Path, findings: list[dict]) -> None:
|
|
829
|
+
mem_path = ASSETS_DIR / "memory" / "project_memory.py"
|
|
830
|
+
if not mem_path.is_file() or not findings:
|
|
831
|
+
return
|
|
832
|
+
try:
|
|
833
|
+
pm = _load_mod("dmb_slop_pm", mem_path)
|
|
834
|
+
key = f"slop-gotcha:{sorted({f['rule'] for f in findings})[0]}"
|
|
835
|
+
source = f"{findings[0]['file']}:{findings[0]['line']}"
|
|
836
|
+
pm.put_memory(
|
|
837
|
+
root,
|
|
838
|
+
key=key,
|
|
839
|
+
kind="gotcha",
|
|
840
|
+
priority=1,
|
|
841
|
+
tags="slop-gate,ci",
|
|
842
|
+
source=source,
|
|
843
|
+
content=_gotcha_content(pm, findings, key, source),
|
|
844
|
+
)
|
|
845
|
+
except (OSError, ImportError, ValueError) as exc:
|
|
846
|
+
print(f"warning: slop memory record skipped: {exc}", file=sys.stderr)
|
|
847
|
+
|
|
848
|
+
|
|
849
|
+
def run_slop_gate(
|
|
850
|
+
root: Path,
|
|
851
|
+
*,
|
|
852
|
+
staged: bool = False,
|
|
853
|
+
explicit_files: list[str] | None = None,
|
|
854
|
+
base: str | None = None,
|
|
855
|
+
allow_untested: bool = False,
|
|
856
|
+
allow_config_change: bool = False,
|
|
857
|
+
run_linters: bool = True,
|
|
858
|
+
record_memory: bool = False,
|
|
859
|
+
max_func_lines: int = DEFAULT_MAX_FUNC_LINES,
|
|
860
|
+
max_nesting: int = DEFAULT_MAX_NESTING,
|
|
861
|
+
) -> dict:
|
|
862
|
+
resolved_root = root.resolve()
|
|
863
|
+
changed, baseline = _change_scope(resolved_root, staged, explicit_files, base)
|
|
864
|
+
findings: list[dict] = []
|
|
865
|
+
|
|
866
|
+
loop_mod = _load_mod("dmb_loop_slop", ASSETS_DIR / "loop" / "loop.py")
|
|
867
|
+
guardrails = set(loop_mod.discover_guardrail_configs(str(resolved_root))) | set(GUARDRAIL_EXTRA)
|
|
868
|
+
reward_path = ASSETS_DIR / "reward-guard" / "reward_guard.py"
|
|
869
|
+
reward_mod = _load_mod("dmb_reward_guard", reward_path) if reward_path.is_file() else None
|
|
870
|
+
|
|
871
|
+
if not allow_config_change:
|
|
872
|
+
for rel in changed:
|
|
873
|
+
if rel in guardrails or Path(rel).name in guardrails:
|
|
874
|
+
findings.append({"severity": "P0", "rule": "config-tamper-lock", "file": rel, "line": 1,
|
|
875
|
+
"message": f"Guardrail config `{rel}` modified without explicit authorization.",
|
|
876
|
+
"fix": "Revert guardrail weakening or re-run with `--allow-config-change` when intentional."})
|
|
877
|
+
|
|
878
|
+
count_prod = not allow_untested and not explicit_files
|
|
879
|
+
changed_tests = any(TEST_FILE_RE.search(rel) for rel in changed)
|
|
880
|
+
prod_counts: dict[str, int] = {}
|
|
881
|
+
batched_reward = reward_mod._batch_diffs_for_files(resolved_root, changed, staged=staged, base=baseline) if reward_mod is not None else {}
|
|
882
|
+
for rel in changed:
|
|
883
|
+
ext = Path(rel).suffix.lower()
|
|
884
|
+
test_target = _is_test_target(rel, ext)
|
|
885
|
+
if staged and test_target:
|
|
886
|
+
findings.extend(_check_staged_test_target(resolved_root, rel, ext))
|
|
887
|
+
text = _read_text_safe(resolved_root, rel)
|
|
888
|
+
if text is None:
|
|
889
|
+
continue
|
|
890
|
+
added = _added_lines_for_file(resolved_root, rel, staged, baseline, text)
|
|
891
|
+
if not added and explicit_files:
|
|
892
|
+
added = {i: l for i, l in enumerate(_split_lf_lines(text), 1)}
|
|
893
|
+
cur_slop = loop_mod.scan_text_slop(rel, text)
|
|
894
|
+
if cur_slop:
|
|
895
|
+
base_findings = []
|
|
896
|
+
if baseline:
|
|
897
|
+
blob = _git(resolved_root, "show", f"{baseline}:{rel}")
|
|
898
|
+
if blob.returncode == 0:
|
|
899
|
+
base_findings = loop_mod.scan_text_slop(rel, blob.stdout)
|
|
900
|
+
new_slop = loop_mod.diff_new_slop(cur_slop, loop_mod.slop_counts(base_findings))
|
|
901
|
+
for _, ln, rule, _, msg in new_slop:
|
|
902
|
+
findings.append({"severity": "P1", "rule": rule, "file": rel, "line": ln,
|
|
903
|
+
"message": msg.split(": ", 1)[-1], "fix": "Fix the underlying issue instead of suppressing/stubbing."})
|
|
904
|
+
|
|
905
|
+
findings.extend(_check_secrets_and_patterns(rel, added, text))
|
|
906
|
+
|
|
907
|
+
if ext == ".py":
|
|
908
|
+
findings.extend(_check_python_ast(rel, text, added, max_func_lines=max_func_lines,
|
|
909
|
+
max_nesting=max_nesting, check_empty=test_target and not staged))
|
|
910
|
+
test_file = bool(TEST_FILE_RE.search(rel))
|
|
911
|
+
count_file = count_prod and not changed_tests and not test_file and ext in PROD_EXTS and rel.split("/", 1)[0] not in DIFF_EXEMPT_DIRS
|
|
912
|
+
if ext in BRACE_EXTS and (test_target and not staged or added and (ext == ".rs" or test_file or count_file)):
|
|
913
|
+
values, lines, closes = _brace_tokens(text, ext)
|
|
914
|
+
if test_target and not staged and not _brace_declares_tests(ext, values, closes):
|
|
915
|
+
findings.append(_empty_test_finding(rel))
|
|
916
|
+
rust_tests = _rust_test_ranges(values, lines, closes) if ext == ".rs" else []
|
|
917
|
+
changed_tests |= any(start <= n <= end for start, end in rust_tests for n in added)
|
|
918
|
+
if test_file or rust_tests:
|
|
919
|
+
findings.extend(_scan_brace_tests(rel, ext, values, lines, closes, added))
|
|
920
|
+
if count_file:
|
|
921
|
+
prod_counts[rel] = len(added.keys() & set(lines))
|
|
922
|
+
elif count_file and ext == ".py":
|
|
923
|
+
prod_counts[rel] = sum(bool(line.strip()) and not line.lstrip().startswith("#") for line in added.values())
|
|
924
|
+
|
|
925
|
+
if reward_mod is not None:
|
|
926
|
+
_, r_hunks = batched_reward.get(rel, ({}, []))
|
|
927
|
+
findings.extend(
|
|
928
|
+
reward_mod.scan_added_lines_for_reward_hacks(rel, added, r_hunks, include_primitives=False, full_text=text)
|
|
929
|
+
)
|
|
930
|
+
if not changed_tests and sum(prod_counts.values()) >= 30:
|
|
931
|
+
tracked = _git(resolved_root, "ls-files", "-z")
|
|
932
|
+
if tracked.returncode == 0 and any(TEST_FILE_RE.search(rel) for rel in tracked.stdout.split("\0")):
|
|
933
|
+
largest = max(prod_counts, key=prod_counts.__getitem__)
|
|
934
|
+
findings.append({"severity": "P1", "rule": "untested-code-diff", "file": largest, "line": 1,
|
|
935
|
+
"message": "At least 30 production lines were added without changing any tests.",
|
|
936
|
+
"fix": "Add behavioral regression tests or pass --allow-untested for an approved exception."})
|
|
937
|
+
perf_path = ASSETS_DIR / "perf-audit" / "perf_audit.py"
|
|
938
|
+
code_changed = [f for f in changed if Path(f).suffix.lower() in CODE_EXTS and not TEST_FILE_RE.search(f) and (resolved_root / f).is_file()]
|
|
939
|
+
if perf_path.is_file() and code_changed:
|
|
940
|
+
pa = _load_mod("dmb_perf_audit", perf_path)
|
|
941
|
+
for rel in code_changed:
|
|
942
|
+
for pf in pa.scan_file(resolved_root / rel, resolved_root):
|
|
943
|
+
if getattr(pf, "severity", "") == "high":
|
|
944
|
+
findings.append({"severity": "P1", "rule": pf.rule_id, "file": rel, "line": pf.line,
|
|
945
|
+
"message": pf.message, "fix": "Batch DB/async calls or move sync I/O off the hot loop."})
|
|
946
|
+
|
|
947
|
+
ui_path = SKILLS_DIR / "frontend-ui" / "scripts" / "ui_audit.py"
|
|
948
|
+
ui_changed = [f for f in changed if Path(f).suffix.lower() in UI_EXTS and (resolved_root / f).is_file()]
|
|
949
|
+
if ui_path.is_file() and ui_changed:
|
|
950
|
+
ua = _load_mod("dmb_ui_audit", ui_path)
|
|
951
|
+
for rel in ui_changed:
|
|
952
|
+
txt = _read_text_safe(resolved_root, rel)
|
|
953
|
+
if txt is None:
|
|
954
|
+
continue
|
|
955
|
+
for uf in ua.audit_source(txt, rel, Path(rel).suffix.lower()):
|
|
956
|
+
if uf["severity"] in ("P0", "P1"):
|
|
957
|
+
findings.append({"severity": uf["severity"], "rule": uf["rule"], "file": rel, "line": uf["line"],
|
|
958
|
+
"message": uf["message"], "fix": "Fix UI token/a11y/motion violation per frontend-ui."})
|
|
959
|
+
|
|
960
|
+
linters_ran: list[str] = []
|
|
961
|
+
if run_linters and changed:
|
|
962
|
+
l_findings, linters_ran = _run_polyglot_linters(resolved_root, changed)
|
|
963
|
+
findings.extend(l_findings)
|
|
964
|
+
|
|
965
|
+
findings.extend(_check_policy_xml(resolved_root, changed))
|
|
966
|
+
if reward_mod is not None:
|
|
967
|
+
if not staged and not explicit_files:
|
|
968
|
+
changed_set = set(changed)
|
|
969
|
+
sc_files, sym_findings = reward_mod._discover_scratch_scripts_and_symlinks(resolved_root)
|
|
970
|
+
findings.extend(sym_findings)
|
|
971
|
+
for srel in sc_files:
|
|
972
|
+
if srel in changed_set:
|
|
973
|
+
continue
|
|
974
|
+
stxt = _read_text_safe(resolved_root, srel, max_bytes=reward_mod.MAX_SCRATCH_SCRIPT_BYTES)
|
|
975
|
+
if stxt is not None:
|
|
976
|
+
sadded = {i: ln for i, ln in enumerate(_split_lf_lines(stxt), 1)}
|
|
977
|
+
findings.extend(
|
|
978
|
+
reward_mod.scan_added_lines_for_reward_hacks(srel, sadded, [([], list(sadded.items()))], include_primitives=False, full_text=stxt)
|
|
979
|
+
)
|
|
980
|
+
findings.extend(reward_mod._check_locked_contracts(resolved_root))
|
|
981
|
+
rules_path = ASSETS_DIR / "rules" / "rule_ledger.py"
|
|
982
|
+
if rules_path.is_file():
|
|
983
|
+
findings.extend(_load_mod("dmb_rule_ledger", rules_path).check(
|
|
984
|
+
resolved_root, staged=staged, base=base if not staged and not explicit_files else None,
|
|
985
|
+
)["findings"])
|
|
986
|
+
sim_path = ASSETS_DIR / "sim" / "sim.py"
|
|
987
|
+
if sim_path.is_file():
|
|
988
|
+
findings.extend(_load_mod("dmb_sim", sim_path).check_repo(
|
|
989
|
+
resolved_root, changed=changed if explicit_files else None, staged=staged,
|
|
990
|
+
base_ref=baseline if not staged and not explicit_files else None,
|
|
991
|
+
)["findings"])
|
|
992
|
+
|
|
993
|
+
counts = {"P0": 0, "P1": 0, "P2": 0}
|
|
994
|
+
for f in findings:
|
|
995
|
+
counts[f["severity"]] = counts.get(f["severity"], 0) + 1
|
|
996
|
+
ok = counts["P0"] == 0 and counts["P1"] == 0
|
|
997
|
+
|
|
998
|
+
if not ok and record_memory:
|
|
999
|
+
_record_gotcha_memory(resolved_root, findings)
|
|
1000
|
+
|
|
1001
|
+
return {
|
|
1002
|
+
"ok": ok,
|
|
1003
|
+
"root": str(resolved_root),
|
|
1004
|
+
"staged": staged,
|
|
1005
|
+
"files_checked": len(changed),
|
|
1006
|
+
"linters_ran": linters_ran,
|
|
1007
|
+
"counts": counts,
|
|
1008
|
+
"findings": findings,
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
def main(argv: list[str] | None = None) -> int:
|
|
1013
|
+
p = argparse.ArgumentParser(description="Zero-token diff-only anti-slop, secret, linter, boundary & budget CI gate.")
|
|
1014
|
+
p.add_argument("--root", default=".")
|
|
1015
|
+
p.add_argument("--staged", action="store_true", help="Scan staged git changes only (for pre-commit hooks).")
|
|
1016
|
+
p.add_argument("--base", help="Scan changes since the merge base with this ref, including local changes.")
|
|
1017
|
+
p.add_argument("--files", nargs="*", default=None, help="Optional comma- or space-separated repo-relative file list.")
|
|
1018
|
+
p.add_argument("--allow-config-change", action="store_true", help="Allow edits to guardrail configs in this run.")
|
|
1019
|
+
p.add_argument("--allow-untested", action="store_true", help="Allow large production changes without changed tests.")
|
|
1020
|
+
p.add_argument("--no-linters", action="store_true", help="Skip external PATH linters (ruff/shellcheck/node).")
|
|
1021
|
+
p.add_argument("--record-memory", action="store_true", help="Record failing rules as P1 gotchas in deepmode-memory.db.")
|
|
1022
|
+
p.add_argument("--max-func-lines", type=int, default=DEFAULT_MAX_FUNC_LINES)
|
|
1023
|
+
p.add_argument("--max-nesting", type=int, default=DEFAULT_MAX_NESTING)
|
|
1024
|
+
p.add_argument("--json", action="store_true")
|
|
1025
|
+
args = p.parse_args(argv)
|
|
1026
|
+
|
|
1027
|
+
explicit = [x.strip() for raw_f in (args.files or []) for x in raw_f.split(",") if x.strip()] or None
|
|
1028
|
+
try:
|
|
1029
|
+
res = run_slop_gate(
|
|
1030
|
+
Path(args.root), staged=args.staged, explicit_files=explicit, base=args.base,
|
|
1031
|
+
allow_config_change=args.allow_config_change, allow_untested=args.allow_untested,
|
|
1032
|
+
run_linters=not args.no_linters, record_memory=args.record_memory,
|
|
1033
|
+
max_func_lines=args.max_func_lines, max_nesting=args.max_nesting,
|
|
1034
|
+
)
|
|
1035
|
+
except ValueError as exc:
|
|
1036
|
+
p.error(str(exc))
|
|
1037
|
+
if args.json:
|
|
1038
|
+
print(json.dumps(res, indent=2))
|
|
1039
|
+
else:
|
|
1040
|
+
c = res["counts"]
|
|
1041
|
+
status = "OK" if res["ok"] else "BLOCKED"
|
|
1042
|
+
print(f"slop-gate [{status}]: {res['files_checked']} file(s), linters={res['linters_ran']} — P0:{c['P0']} P1:{c['P1']} P2:{c['P2']}")
|
|
1043
|
+
for f in res["findings"]:
|
|
1044
|
+
print(f" {f['file']}:{f['line']} [{f['severity']}:{f['rule']}] {f['message']} -> {f['fix']}")
|
|
1045
|
+
return 0 if res["ok"] else 1
|
|
1046
|
+
|
|
1047
|
+
|
|
1048
|
+
if __name__ == "__main__":
|
|
1049
|
+
raise SystemExit(main())
|