deepmodebot 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +20 -0
- package/.claude-plugin/marketplace.json +2 -2
- package/.omp-plugin/marketplace.json +2 -2
- package/README.md +29 -5
- package/bin/deepmodebot.mjs +163 -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 +77 -0
- package/native/dmb-gate/src/ci.rs +516 -0
- package/native/dmb-gate/src/cleanup.rs +198 -0
- package/native/dmb-gate/src/gap.rs +1376 -0
- package/native/dmb-gate/src/guard.rs +135 -0
- package/native/dmb-gate/src/main.rs +327 -0
- package/native/dmb-gate/src/map.rs +173 -0
- package/native/dmb-gate/src/perf.rs +347 -0
- package/native/dmb-gate/src/reward.rs +1214 -0
- package/native/dmb-gate/src/skill_check.rs +171 -0
- package/native/dmb-gate/src/slop.rs +1238 -0
- package/native/dmb-gate/src/ui.rs +842 -0
- package/native/dmb-gate/src/util.rs +260 -0
- package/native/dmb-net/go.mod +3 -0
- package/native/dmb-net/main.go +624 -0
- package/native/dmb-net/main_test.go +122 -0
- package/package.json +12 -2
- package/plugins/deepmodebot/.antigravity-plugin/plugin.json +1 -1
- package/plugins/deepmodebot/.antigravity-plugin/skills/deep/SKILL.md +5 -5
- package/plugins/deepmodebot/.antigravity-plugin/skills/pr-thread/SKILL.md +1 -1
- package/plugins/deepmodebot/.antigravity-plugin/skills/review-pr/SKILL.md +2 -2
- package/plugins/deepmodebot/.antigravity-plugin/skills/suggest/SKILL.md +13 -0
- package/plugins/deepmodebot/.antigravity-plugin/skills/tournament/SKILL.md +2 -2
- package/plugins/deepmodebot/.claude-plugin/plugin.json +1 -1
- package/plugins/deepmodebot/.codex-plugin/plugin.json +46 -0
- package/plugins/deepmodebot/agents/comment-sicko/agent.md +35 -0
- package/plugins/deepmodebot/agents/researcher/agent.md +33 -0
- package/plugins/deepmodebot/agents/reviewer/agent.md +4 -2
- package/plugins/deepmodebot/agents/scout/agent.md +11 -12
- package/plugins/deepmodebot/agents/security-reviewer/agent.md +2 -1
- package/plugins/deepmodebot/commands/deep.md +6 -6
- package/plugins/deepmodebot/commands/research.md +8 -0
- package/plugins/deepmodebot/commands/suggest.md +10 -0
- package/plugins/deepmodebot/commands/tournament.md +2 -2
- package/plugins/deepmodebot/hooks/hooks.json +2 -2
- package/plugins/deepmodebot/hooks.json +1 -1
- package/plugins/deepmodebot/scripts/antigravity-guard.mjs +140 -7
- package/plugins/deepmodebot/scripts/omp-mcp-server.mjs +179 -47
- package/plugins/deepmodebot/skills/agent-harnesses/SKILL.md +4 -6
- package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/check_antigravity.py +3 -0
- package/plugins/deepmodebot/skills/agent-harnesses/references/ai-native-tooling.md +4 -0
- package/plugins/deepmodebot/skills/agent-harnesses/references/ai-sdk-selection.md +3 -1
- package/plugins/deepmodebot/skills/agent-harnesses/references/antigravity.md +2 -2
- package/plugins/deepmodebot/skills/agent-harnesses/references/delegation-efficiency.md +12 -2
- package/plugins/deepmodebot/skills/agent-harnesses/references/protocols.md +11 -3
- package/plugins/deepmodebot/skills/app-automation-relay/SKILL.md +17 -0
- package/plugins/deepmodebot/skills/app-automation-relay/assets/relay_server.ts +364 -0
- package/plugins/deepmodebot/skills/app-automation-relay/references/adapter-cookbook.md +15 -0
- package/plugins/deepmodebot/skills/app-automation-relay/references/wire-protocol.md +23 -0
- package/plugins/deepmodebot/skills/cloud-devsecops/SKILL.md +4 -3
- package/plugins/deepmodebot/skills/cloud-devsecops/references/cloudflare-edge.md +43 -0
- package/plugins/deepmodebot/skills/cloud-devsecops/references/local-emulators.md +15 -2
- package/plugins/deepmodebot/skills/contribute/SKILL.md +3 -35
- package/plugins/deepmodebot/skills/create-formal-verification-skill/LICENSE +21 -0
- package/plugins/deepmodebot/skills/create-formal-verification-skill/NOTICE.md +16 -0
- package/plugins/deepmodebot/skills/create-formal-verification-skill/SKILL.md +71 -0
- package/plugins/deepmodebot/skills/create-verification-skill/SKILL.md +2 -2
- package/plugins/deepmodebot/skills/deep-learning/LICENSE +21 -0
- package/plugins/deepmodebot/skills/deep-learning/SKILL.md +33 -0
- package/plugins/deepmodebot/skills/deep-learning/references/neural-architectures.md +43 -0
- package/plugins/deepmodebot/skills/deep-learning/references/papers-and-repos.md +128 -0
- package/plugins/deepmodebot/skills/deep-learning/references/reinforcement-learning.md +57 -0
- package/plugins/deepmodebot/skills/deep-learning/references/training-optimization.md +40 -0
- package/plugins/deepmodebot/skills/deep-learning/references/weight-space-programming.md +76 -0
- package/plugins/deepmodebot/skills/deep-learning/scripts/hf_passes.py +166 -0
- package/plugins/deepmodebot/skills/deep-learning/scripts/wsp.py +493 -0
- package/plugins/deepmodebot/skills/deep-stack/SKILL.md +1 -1
- package/plugins/deepmodebot/skills/deep-stack/references/design-workflow.md +46 -92
- package/plugins/deepmodebot/skills/deep-stack/references/isolate.md +1 -0
- package/plugins/deepmodebot/skills/deep-stack/references/prove.md +6 -0
- package/plugins/deepmodebot/skills/deep-stack/references/stack.md +11 -1
- package/plugins/deepmodebot/skills/deepmodebot/SKILL.md +74 -145
- package/plugins/deepmodebot/skills/deepmodebot/assets/agents-md/agents_md.py +18 -6
- package/plugins/deepmodebot/skills/deepmodebot/assets/autoroute/autoroute.py +1021 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/cleanup/self_cleanup.py +305 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/claude_guard.py +98 -5
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/omp-contain.ts +106 -5
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/design.py +3 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/record.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/rehearsal_gate.py +536 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/review.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/formal-verification/verify_proof.py +638 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/gap-audit/gap_audit.py +1053 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/gen-ui/gen_ui.py +1782 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard-patterns.txt +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard.sh +3 -2
- package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard.ts +9 -5
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/ghapp.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/install.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/local-ci/local_ci.py +540 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/local-ci/slop_gate.py +642 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/loop.py +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/plan.py +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/windows_job.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/memory/project_memory.py +529 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/bench_harness.py +48 -21
- package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/perf_audit.py +339 -5
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/diff_coverage.py +96 -6
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/pr_agent_local.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/arena.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/show_thread.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/prompt-tools/prompt_tools.py +1239 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/quota-guard/quota_guard.py +424 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/repo-references.json +477 -1
- package/plugins/deepmodebot/skills/deepmodebot/assets/reward-guard/reward_guard.py +1597 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rule-paths.json +57 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rule_ledger.py +1645 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_enrich.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_meta.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_transcript_relay.js +13 -10
- package/plugins/deepmodebot/skills/deepmodebot/assets/security-audit/static_sec_audit.py +275 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/self-grill/self_grill.py +1473 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/setup/model_setup.py +329 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/setup/project_setup.py +312 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/tournament/tournament.py +304 -18
- package/plugins/deepmodebot/skills/deepmodebot/assets/workspace-map/workspace_map.py +121 -78
- package/plugins/deepmodebot/skills/deepmodebot/references/README.md +14 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/catalog.md +16 -11
- package/plugins/deepmodebot/skills/deepmodebot/references/contain.md +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/delegation.md +14 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/flows.md +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/full-scope.md +9 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/babysit.md +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/end-to-end.md +12 -9
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/feature.md +7 -3
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/hillclimb.md +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/investigation.md +4 -4
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/opening-a-pr.md +1 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/perf-issue.md +13 -10
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/refactoring.md +6 -6
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/reference-rebuild.md +1 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/run-a-goal.md +3 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/setup.md +1 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/visual-parity.md +1 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/work-a-queue.md +4 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/principles/hardcore-mode.md +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/principles/no-reward-hacking.md +8 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/principles/test-behavior-not-implementation.md +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/principles/type-system-discipline.md +2 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/rule-approval.md +51 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/architect.md +10 -24
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/architecture-review.md +5 -4
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/arena.md +3 -3
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/autoroute.md +49 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/blast-radius.md +1 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/catchup-video.md +13 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/correct.md +8 -7
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/course.md +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/devex-review.md +13 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/expand-contract.md +13 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/formal-verification.md +33 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/gen-ui.md +60 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/grill.md +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/how.md +7 -18
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/inner-loop.md +7 -7
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/model-setup.md +14 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/modernize-pr.md +15 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/mutation-testing.md +13 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/no-comments.md +5 -5
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/panel.md +7 -3
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pr-conversation.md +1 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pr-review.md +8 -5
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pre-commit.md +1 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/prior-art.md +33 -38
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/product-lens.md +12 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/prompt-upgrade.md +30 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/recall.md +1 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/reframe.md +18 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/release-and-canary.md +10 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/research.md +62 -89
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/security-audit.md +5 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/self-grill.md +54 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/sharpen.md +3 -3
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/show-me-your-work.md +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/sme-review.md +3 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/suggest.md +24 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/swarm.md +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/teach.md +2 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/tournament.md +12 -11
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/variant-analysis.md +11 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/video-forensics.md +46 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/visual-e2e.md +10 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/webhook-ui.md +11 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/writing-for-agents.md +6 -0
- package/plugins/deepmodebot/skills/deepmodebot/scripts/check_skill.py +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/scripts/trending.py +141 -18
- package/plugins/deepmodebot/skills/deepmodebot/worker.md +16 -0
- package/plugins/deepmodebot/skills/domain-rules/SKILL.md +13 -119
- package/plugins/deepmodebot/skills/domain-rules/references/backend-system-design.md +19 -1
- package/plugins/deepmodebot/skills/domain-rules/references/engineering-practice.md +7 -0
- package/plugins/deepmodebot/skills/domain-rules/references/language-ecosystems.md +11 -0
- package/plugins/deepmodebot/skills/domain-rules/references/sources.md +108 -0
- package/plugins/deepmodebot/skills/frontend-ui/SKILL.md +30 -131
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/canvas.css +42 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/editorial.css +39 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/layouts.css +95 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/swiss.css +40 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/tactile.css +41 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/workbench.css +50 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/mobbin-animations.md +49 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/mobbin-shipped-apps.md +46 -24
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/motion-clips.md +27 -258
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/motion-graphics.md +26 -51
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/pinterest-animations.md +22 -195
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/00-art-direction.md +39 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/01-workflow.md +27 -24
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/02-review-rubric.md +23 -17
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/03-ai-tells.md +22 -45
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/04-components.md +11 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/04a-agent-ui.md +32 -152
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/05-motion.md +36 -91
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/05a-motion-graphics.md +14 -120
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06-typography-layout.md +11 -10
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06a-color.md +9 -9
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06b-media-icons-charts.md +19 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06c-product-shots-craft.md +42 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/07-copy.md +5 -6
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/08-quality-floor.md +28 -56
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/09-steering-agents.md +9 -7
- package/plugins/deepmodebot/skills/frontend-ui/scripts/motion_diff.py +259 -0
- package/plugins/deepmodebot/skills/frontend-ui/scripts/ui_audit.py +496 -0
- package/plugins/deepmodebot/skills/maintain-formal-verification-skill/LICENSE +21 -0
- package/plugins/deepmodebot/skills/maintain-formal-verification-skill/NOTICE.md +16 -0
- package/plugins/deepmodebot/skills/maintain-formal-verification-skill/SKILL.md +68 -0
- package/plugins/deepmodebot/skills/maintain-verification-skill/SKILL.md +1 -1
- package/plugins/deepmodebot/skills/office-documents/SKILL.md +24 -0
- package/plugins/deepmodebot/skills/office-documents/references/documents-docx-pdf.md +15 -0
- package/plugins/deepmodebot/skills/office-documents/references/presentations-pptx.md +15 -0
- package/plugins/deepmodebot/skills/office-documents/references/spreadsheets-xlsx.md +15 -0
- package/plugins/deepmodebot/skills/office-documents/scripts/doc_audit.py +230 -0
- package/plugins/deepmodebot/skills/project-brief/SKILL.md +2 -19
- package/plugins/deepmodebot/skills/project-brief/assets/pr-overlap.py +4 -0
- package/plugins/deepmodebot/skills/project-brief/assets/sync-roadmap.py +4 -0
- package/plugins/deepmodebot/skills/project-brief/references/claim-contract.md +55 -0
- package/plugins/deepmodebot/skills/research/SKILL.md +18 -0
- package/plugins/deepmodebot/skills/secrets-and-auth/SKILL.md +1 -1
- package/plugins/deepmodebot/skills/seo-and-geo/SKILL.md +29 -0
- package/plugins/deepmodebot/skills/seo-and-geo/references/geo-and-agentic-web.md +30 -0
- package/plugins/deepmodebot/skills/seo-and-geo/references/technical-and-schema.md +25 -0
- package/plugins/deepmodebot/skills/seo-and-geo/scripts/seo_audit.py +282 -0
- package/plugins/deepmodebot/skills/software-architecture/SKILL.md +2 -2
- package/plugins/deepmodebot/skills/software-architecture/references/backend-infrastructure.md +5 -0
- package/plugins/deepmodebot/skills/software-architecture/references/monorepos.md +1 -0
- package/plugins/deepmodebot/skills/statechart/LICENSE +21 -0
- package/plugins/deepmodebot/skills/statechart/NOTICE.md +21 -0
- package/plugins/deepmodebot/skills/statechart/SKILL.md +106 -0
- package/plugins/deepmodebot/skills/statechart/references/render.md +93 -0
- package/plugins/deepmodebot/skills/statechart/references/tooling.md +78 -0
- package/plugins/deepmodebot/skills/statechart/scripts/backends/cfg.ts +33 -0
- package/plugins/deepmodebot/skills/statechart/scripts/backends/mermaid.ts +249 -0
- package/plugins/deepmodebot/skills/statechart/scripts/backends/plain-text.ts +72 -0
- package/plugins/deepmodebot/skills/statechart/scripts/backends/report.ts +177 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/config.ts +276 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/dot.ts +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/marks.ts +93 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/messages.ts +52 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/spec.ts +114 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/trace.ts +24 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/value.ts +166 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/verdict.ts +40 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/view.ts +119 -0
- package/plugins/deepmodebot/skills/statechart/scripts/ir.ts +547 -0
- package/plugins/deepmodebot/skills/statechart/scripts/janitor.ts +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/kill.ts +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/package.json +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/annotate.ts +128 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/label.ts +269 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/lift.ts +85 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/loop-check.ts +68 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/paths.ts +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/reach.ts +135 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/region-check.ts +97 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/regions.ts +295 -0
- package/plugins/deepmodebot/skills/statechart/scripts/pipeline.ts +76 -0
- package/plugins/deepmodebot/skills/statechart/scripts/run.ts +500 -0
- package/plugins/deepmodebot/skills/statechart/scripts/statechart +29 -0
- package/plugins/deepmodebot/skills/statechart/scripts/statechart.ts +165 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/ConfigOracle.java +63 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/chart.test.ts +1253 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Braces.mmd +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Escapes.mmd +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Phases.mmd +29 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/cli.test.ts +1344 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/config-fuzz.test.ts +263 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/Counter.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/Counter.tla +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/chart.mmd +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/report.md +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/verdict-1.out +49 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/ChartRun.out +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.tla +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/chart.mmd +26 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/graph.dot +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/report.md +20 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.out +82 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-3.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/chart.mmd +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/report.md +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.out +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/ChartRun.out +69 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/chart.mmd +85 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/graph.dot +70 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/report.md +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.out +67 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.out +85 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.cfg +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.tla +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/chart.mmd +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/graph.dot +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/report.md +31 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.out +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/ChartRun.out +55 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.tla +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/chart.mmd +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/graph.dot +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/report.md +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.out +33 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-2.out +54 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/ChartRun.out +54 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.tla +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/chart.mmd +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/graph.dot +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/report.md +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/verdict-1.out +46 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.tla +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterSteps.tla +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/chart.mmd +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/graph.dot +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/report.md +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/sany.out +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.out +78 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.tla +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/chart.mmd +26 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/graph.dot +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/report.md +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/chart.mmd +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/graph.dot +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/report.md +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.out +76 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/chart.mmd +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/graph.dot +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/report.md +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.out +67 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/ChartRun.out +62 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.cfg +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.tla +24 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/Moves.tla +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/chart.mmd +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/graph.dot +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/report.md +23 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/sany.out +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.out +66 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.out +74 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-4.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/ChartRun.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.tla +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/chart.mmd +18 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/graph.dot +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/report.md +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.out +33 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.tla +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/chart.mmd +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/graph.dot +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/report.md +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/verdict-1.out +49 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/ChartRun.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.tla +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/chart.mmd +30 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/graph.dot +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/report.md +27 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.out +87 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-4.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/ChartRun.out +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.tla +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/chart.mmd +23 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/graph.dot +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/report.md +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/ChartRun.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/CounterView.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/CounterView.tla +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/chart.mmd +23 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/graph.dot +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/report.md +27 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-2.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-3.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-3.out +87 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-4.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/DieHard.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/DieHard.tla +38 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/chart.mmd +92 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/graph.dot +126 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/report.md +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-1.out +91 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/ChartRun.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.cfg +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/chart.mmd +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/report.md +25 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.out +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/chart.mmd +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/graph.dot +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/report.md +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.out +72 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/Login.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/Login.tla +62 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/chart.mmd +28 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/graph.dot +40 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/report.md +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/verdict-1.out +47 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.tla +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/chart.mmd +28 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/graph.dot +37 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/report.md +8 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/verdict-1.out +47 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/ChartRun.out +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.tla +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/chart.mmd +44 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/graph.dot +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/report.md +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.out +83 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/ChartRun.out +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.tla +103 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/chart.mmd +43 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/graph.dot +93 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/report.md +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-2.out +72 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/view.mjs +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.tla +100 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/chart.mmd +31 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/graph.dot +85 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/report.md +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/verdict-1.out +47 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/view.mjs +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayer.tla +103 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.tla +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/chart.mmd +42 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/graph.dot +93 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/report.md +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-2.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-3.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.out +66 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-6.out +49 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/view.mjs +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.cfg +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/chart.mmd +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/graph.dot +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/report.md +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/sany.out +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/verdict-1.out +70 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ChartRun.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/Shadow.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/Shadow.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ShadowLib.tla +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ShadowSub.tla +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/chart.mmd +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/report.md +8 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/sany.out +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/verdict-1.out +65 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.tla +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/chart.mmd +23 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/graph.dot +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/report.md +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.out +65 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.out +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/ChartRun.out +69 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.tla +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/chart.mmd +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/graph.dot +297 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/report.md +20 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.out +95 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.tla +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/chart.mmd +37 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/graph.dot +223 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/report.md +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/verdict-1.out +47 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.out +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.cfg +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/chart.mmd +18 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/graph.dot +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/report.md +29 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.out +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/ChartRun.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.tla +8 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/chart.mmd +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/report.md +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.out +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus.test.ts +441 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/differential.test.ts +565 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/drawn.ts +20 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/grid/Grid.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/grid/Grid.tla +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/grid/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/java.ts +63 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/labels.ts +648 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/messages.test.ts +226 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/pipeline.test.ts +270 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/plain-tlc.test.ts +255 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/render.test.ts +145 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/tlc-out.test.ts +90 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/tlc.ts +158 -0
- package/plugins/deepmodebot/skills/statechart/scripts/tsconfig.json +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/worker.ts +35 -0
- package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/bun.lock +0 -391
- package/plugins/deepmodebot/skills/deepmodebot/assets/agents-md/test_agents_md.py +0 -146
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_antigravity_guard.py +0 -483
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_audit_regressions.py +0 -139
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_contain.py +0 -301
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_omp_mcp.py +0 -602
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_design.py +0 -69
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_evidence.py +0 -160
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_record.py +0 -180
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_review.py +0 -265
- package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/test_git_guard.py +0 -192
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_bot.py +0 -2182
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_brand.py +0 -19
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_local_updates.py +0 -691
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_review_context.py +0 -127
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_workspace_cleanup.py +0 -496
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_loop.py +0 -1426
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_plan.py +0 -320
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_windows_job.py +0 -326
- package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/test_bench_harness.py +0 -55
- package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/test_perf_audit.py +0 -53
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/test_diff_coverage.py +0 -94
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/test_arena.py +0 -610
- package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/test_yt_enrich.py +0 -250
- package/plugins/deepmodebot/skills/deepmodebot/assets/tournament/test_tournament.py +0 -654
- package/plugins/deepmodebot/skills/deepmodebot/assets/workspace-map/test_workspace_map.py +0 -879
|
@@ -0,0 +1,1473 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Deterministic diff-aware self-grill and Adaptive Hotspot Prosecutor engine for deepmodebot.
|
|
3
|
+
|
|
4
|
+
python self_grill.py check-diff --root <repo> [--base <ref>] [--staged] [--json]
|
|
5
|
+
python self_grill.py init --root <repo> --slug <slug> [--phase plan|checks|both] [--base <ref>] [--staged] [--force] [--refresh] [--json]
|
|
6
|
+
python self_grill.py answer --dir <dir> --id <qid> --status proven|na|failed|blocked --answer <text> [--receipt <ref>] [--json]
|
|
7
|
+
python self_grill.py verdict --dir <dir> [--strict] [--allow-stale] [--json]
|
|
8
|
+
python self_grill.py bundle --root <repo> [--slug <slug>] [--claims-stdin | --claims-file <path>] [--confession <text>] [--json]
|
|
9
|
+
"""
|
|
10
|
+
import argparse
|
|
11
|
+
import hashlib
|
|
12
|
+
import json
|
|
13
|
+
import os
|
|
14
|
+
import re
|
|
15
|
+
import subprocess
|
|
16
|
+
import sys
|
|
17
|
+
import tempfile
|
|
18
|
+
import time
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
|
|
21
|
+
sys.dont_write_bytecode = True
|
|
22
|
+
|
|
23
|
+
SLUG_RE = re.compile(r"[a-z0-9]+(?:-[a-z0-9]+)*")
|
|
24
|
+
|
|
25
|
+
SENSITIVE_PATH_RE = re.compile(
|
|
26
|
+
r"(?:^|/)(?:\.github/workflows/|hooks\.json$|mcp_config\.json$|AGENTS\.md$|CLAUDE\.md$|migrations?/|contain/)"
|
|
27
|
+
r"|(?:^|/|.)\.env(?:\.|$)"
|
|
28
|
+
r"|(?:^|[/._-])(?:auth|oauth|jwt|password|passwords|login|sso|mfa|session|token|tokens|secret|secrets"
|
|
29
|
+
r"|credential|credentials|cred|rbac|acl|permission|permissions|policy|security|guard|sanitize|sanitizer"
|
|
30
|
+
r"|crypto|signature|billing|stripe|payment|payments)(?:$|[/._-])",
|
|
31
|
+
re.I,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
TEST_PATH_RE = re.compile(
|
|
35
|
+
r"(^|/)(?:tests?/|spec/|__tests__/|evals/)|(?:^|/)(?:test_[^/]+|[^/]+(?:_test|\.test|\.spec)\.[^/]+)$",
|
|
36
|
+
re.I,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
CODE_EXTS = {
|
|
40
|
+
".py", ".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs",
|
|
41
|
+
".rs", ".go", ".java", ".cs", ".rb", ".php", ".c", ".cc", ".cpp", ".h", ".hpp",
|
|
42
|
+
".lua", ".luau",
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
SHELL_OR_SCRIPT_EXTS = {".sh", ".bash", ".zsh", ".ps1", ".cmd", ".bat", ".py", ".mjs", ".cjs", ".ts", ".js"}
|
|
46
|
+
|
|
47
|
+
SCHEMA_OR_CONFIG_EXTS = {".json", ".yaml", ".yml", ".toml", ".sql", ".ini", ".cfg"}
|
|
48
|
+
|
|
49
|
+
PROOF_EXTS = {".lean", ".v", ".thy", ".tla", ".smt2", ".tex"}
|
|
50
|
+
NON_GIT_SKIP_DIRS = {
|
|
51
|
+
".git", ".scratch", ".worktrees", "__pycache__", "node_modules",
|
|
52
|
+
".venv", "venv", "target", "dist", "build", ".pytest_cache", ".lake",
|
|
53
|
+
}
|
|
54
|
+
SKILL_OR_PROMPT_RE = re.compile(
|
|
55
|
+
r"(^|/)(?:SKILL\.md$|commands/|references/|agents/|prompts?/|\.claude-plugin/|\.antigravity-plugin/|\.omp-plugin/)",
|
|
56
|
+
re.I,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
HASH_COMMENT_EXTS = {".py", ".rb", ".sh", ".bash", ".zsh", ".ps1"}
|
|
60
|
+
import ast
|
|
61
|
+
import importlib.util
|
|
62
|
+
|
|
63
|
+
NO_WINDOW = getattr(subprocess, "CREATE_NO_WINDOW", 0)
|
|
64
|
+
BACKEND_EXTS = {".py", ".go", ".rs", ".cs", ".fs", ".ts", ".js", ".mjs", ".java", ".kt", ".sql", ".c", ".cc", ".cpp"}
|
|
65
|
+
SLASH_COMMENT_EXTS = {
|
|
66
|
+
".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs",
|
|
67
|
+
".rs", ".go", ".java", ".cs", ".php", ".c", ".cc", ".cpp", ".h", ".hpp",
|
|
68
|
+
}
|
|
69
|
+
DASH_COMMENT_EXTS = {".lua", ".luau", ".sql"}
|
|
70
|
+
COMMENT_SCAN_EXTS = CODE_EXTS | HASH_COMMENT_EXTS | DASH_COMMENT_EXTS
|
|
71
|
+
|
|
72
|
+
LUAU_DIRECTIVE_RE = re.compile(r"^!(?:strict|nonstrict|nocheck|native|optimize)\b", re.I)
|
|
73
|
+
|
|
74
|
+
COMMENT_KEEP_RE = re.compile(
|
|
75
|
+
r"(?:spdx-license-identifier|copyright\b|prettier-ignore|https?://\S+)",
|
|
76
|
+
re.I,
|
|
77
|
+
)
|
|
78
|
+
COMMENT_SCENT_RE = re.compile(
|
|
79
|
+
r"(?:eslint-disable|@ts-ignore|@ts-expect-error|\bnoqa\b|type:\s*ignore|\btodo\b|\bfixme\b"
|
|
80
|
+
r"|\bimportant\b|\bdo\s+not\s+remove\b|\btoo\s+risky\b|\bfine\s+for\s+now\b|\bworkaround\b|\bhack\b)",
|
|
81
|
+
re.I,
|
|
82
|
+
)
|
|
83
|
+
WORKAROUND_SMELL_PATTERNS = (
|
|
84
|
+
("imperative-timer", re.compile(r"\b(?:setTimeout|requestAnimationFrame|requestIdleCallback)\s*\("), False),
|
|
85
|
+
("raw-use-effect", re.compile(r"\buseEffect\s*\("), False),
|
|
86
|
+
("unsafe-type-escape", re.compile(r"\bas\s+any\b|\bas\s+unknown\s+as\b"), True),
|
|
87
|
+
)
|
|
88
|
+
TOY_SHORTCUT_PATTERNS = (
|
|
89
|
+
(
|
|
90
|
+
"not-implemented-stub",
|
|
91
|
+
re.compile(r"\b(?:NotImplementedError|unimplemented!\s*\(|todo!\s*\(|throw\s+new\s+Error\s*\(\s*['\"]not\s+implemented)", re.I),
|
|
92
|
+
True,
|
|
93
|
+
),
|
|
94
|
+
(
|
|
95
|
+
"placeholder-shortcut",
|
|
96
|
+
re.compile(
|
|
97
|
+
r"\b(?:placeholder\s+(?:impl|implementation|stub|logic|value|return|data|code|solver|mesh|fallback)"
|
|
98
|
+
r"|stub\s+for\s+now|simplified\s+fallback|fake_data|mock_data|optional\s+hardcore)\b",
|
|
99
|
+
re.I,
|
|
100
|
+
),
|
|
101
|
+
True,
|
|
102
|
+
),
|
|
103
|
+
(
|
|
104
|
+
"deferred-real-impl",
|
|
105
|
+
re.compile(r"\b(?:TODO|FIXME)\b.{0,40}\b(?:later|hardcore|real\s+impl|future|upgrade|placeholder)\b", re.I),
|
|
106
|
+
True,
|
|
107
|
+
),
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
CMD_RECEIPT_RE = re.compile(r"^cmd:\s*\S+.*(?:\bexit\s+0\b|\bok\b|\bpass(?:ed)?\b)", re.I)
|
|
111
|
+
URL_RECEIPT_RE = re.compile(r"^https?://\S+$", re.I)
|
|
112
|
+
FILE_LINE_TOKEN_RE = re.compile(r"([A-Za-z0-9_./\\-]+?\.[A-Za-z0-9]{1,10})(?::(\d+))?")
|
|
113
|
+
|
|
114
|
+
CLAIM_OVERCLAIM_RE = re.compile(
|
|
115
|
+
r"(?<![A-Za-z0-9_])(?:100%|always\s+works|never\s+fails|zero\s+(?:bugs|errors|failures|gaps)"
|
|
116
|
+
r"|completely\s+bug[- ]free|supports?\s+all|handles?\s+every|guaranteed\s+to)(?![A-Za-z0-9_])",
|
|
117
|
+
re.I,
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def reject_unsafe_root(root_arg: Path) -> Path:
|
|
122
|
+
if root_arg.is_symlink():
|
|
123
|
+
raise SystemExit(f"project root cannot be a symlink: {root_arg}")
|
|
124
|
+
resolved = root_arg.resolve()
|
|
125
|
+
if not resolved.is_dir():
|
|
126
|
+
raise SystemExit(f"project root does not exist: {resolved}")
|
|
127
|
+
if resolved.parent == resolved:
|
|
128
|
+
raise SystemExit(f"refusing filesystem root as project root: {resolved}")
|
|
129
|
+
forbidden = {Path.home().resolve(), Path(tempfile.gettempdir()).resolve()}
|
|
130
|
+
for extra in ("/tmp", "/var/tmp", "/private/tmp"):
|
|
131
|
+
p = Path(extra)
|
|
132
|
+
if p.exists():
|
|
133
|
+
forbidden.add(p.resolve())
|
|
134
|
+
if resolved in forbidden:
|
|
135
|
+
raise SystemExit(f"refusing home or system temp directory as project root: {resolved}")
|
|
136
|
+
return resolved
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def ensure_contained(target: Path, root: Path) -> Path:
|
|
140
|
+
resolved_root = reject_unsafe_root(root)
|
|
141
|
+
if target.is_symlink():
|
|
142
|
+
raise SystemExit(f"refusing symlink path: {target}")
|
|
143
|
+
resolved_target = target.resolve()
|
|
144
|
+
try:
|
|
145
|
+
rel_parts = resolved_target.relative_to(resolved_root).parts
|
|
146
|
+
except ValueError as err:
|
|
147
|
+
raise SystemExit(f"path {resolved_target} escapes project root {resolved_root}") from err
|
|
148
|
+
probe = resolved_root
|
|
149
|
+
for part in rel_parts:
|
|
150
|
+
probe = probe / part
|
|
151
|
+
if probe.is_symlink():
|
|
152
|
+
raise SystemExit(f"refusing symlink component inside root: {probe}")
|
|
153
|
+
return resolved_target
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def atomic_write_text(target: Path, content: str, root: Path) -> None:
|
|
157
|
+
safe_target = ensure_contained(target, root)
|
|
158
|
+
safe_parent = ensure_contained(safe_target.parent, root)
|
|
159
|
+
safe_parent.mkdir(parents=True, exist_ok=True)
|
|
160
|
+
fd, tmp_name = tempfile.mkstemp(prefix=f".{safe_target.name}.", suffix=".tmp", dir=str(safe_parent))
|
|
161
|
+
tmp_path = Path(tmp_name)
|
|
162
|
+
try:
|
|
163
|
+
with os.fdopen(fd, "w", encoding="utf-8", newline="\n") as handle:
|
|
164
|
+
handle.write(content)
|
|
165
|
+
handle.flush()
|
|
166
|
+
os.fsync(handle.fileno())
|
|
167
|
+
last_err = None
|
|
168
|
+
for attempt in range(5):
|
|
169
|
+
try:
|
|
170
|
+
os.replace(str(tmp_path), str(safe_target))
|
|
171
|
+
last_err = None
|
|
172
|
+
break
|
|
173
|
+
except PermissionError as err:
|
|
174
|
+
last_err = err
|
|
175
|
+
time.sleep(0.05 * (attempt + 1))
|
|
176
|
+
if last_err is not None:
|
|
177
|
+
raise last_err
|
|
178
|
+
finally:
|
|
179
|
+
if tmp_path.exists():
|
|
180
|
+
try:
|
|
181
|
+
tmp_path.unlink()
|
|
182
|
+
except OSError:
|
|
183
|
+
pass
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def _run_git(root: Path, args: list[str]) -> subprocess.CompletedProcess:
|
|
187
|
+
env = dict(os.environ)
|
|
188
|
+
env["GIT_OPTIONAL_LOCKS"] = "0"
|
|
189
|
+
return subprocess.run(
|
|
190
|
+
["git", "-c", "core.quotePath=false", "-C", str(root), *args],
|
|
191
|
+
capture_output=True,
|
|
192
|
+
text=True,
|
|
193
|
+
encoding="utf-8",
|
|
194
|
+
errors="replace",
|
|
195
|
+
env=env,
|
|
196
|
+
check=False,
|
|
197
|
+
creationflags=NO_WINDOW,
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
def _is_git_root_or_worktree(root: Path) -> bool:
|
|
202
|
+
if (root / ".git").exists():
|
|
203
|
+
return True
|
|
204
|
+
res = _run_git(root, ["rev-parse", "--show-toplevel"])
|
|
205
|
+
if res.returncode != 0:
|
|
206
|
+
return False
|
|
207
|
+
try:
|
|
208
|
+
return Path(res.stdout.strip()).resolve() == root.resolve()
|
|
209
|
+
except OSError:
|
|
210
|
+
return False
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
def _iter_non_git_files(safe_root: Path, cap: int = 200) -> list[str]:
|
|
214
|
+
found: list[str] = []
|
|
215
|
+
for cur_root, dirnames, filenames in os.walk(safe_root):
|
|
216
|
+
dirnames[:] = [
|
|
217
|
+
d for d in sorted(dirnames)
|
|
218
|
+
if d not in NON_GIT_SKIP_DIRS and not (Path(cur_root) / d).is_symlink()
|
|
219
|
+
]
|
|
220
|
+
base = Path(cur_root)
|
|
221
|
+
for fn in sorted(filenames):
|
|
222
|
+
p = base / fn
|
|
223
|
+
if p.is_symlink():
|
|
224
|
+
continue
|
|
225
|
+
ext = p.suffix.lower()
|
|
226
|
+
if ext in (CODE_EXTS | PROOF_EXTS | SCHEMA_OR_CONFIG_EXTS | {".md"}):
|
|
227
|
+
found.append(p.relative_to(safe_root).as_posix())
|
|
228
|
+
if len(found) >= cap:
|
|
229
|
+
return found
|
|
230
|
+
return found
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
def compute_tree_digest(root: Path) -> str:
|
|
234
|
+
safe_root = reject_unsafe_root(root)
|
|
235
|
+
h = hashlib.sha256()
|
|
236
|
+
if _is_git_root_or_worktree(safe_root):
|
|
237
|
+
head = _run_git(safe_root, ["rev-parse", "HEAD"])
|
|
238
|
+
h.update(f"HEAD:{head.stdout.strip()}\n".encode("utf-8"))
|
|
239
|
+
status = _run_git(safe_root, ["status", "--porcelain=v1", "-uno"])
|
|
240
|
+
for line in sorted(status.stdout.splitlines()):
|
|
241
|
+
norm = line.replace("\\", "/")
|
|
242
|
+
if "/.scratch/" in norm or norm.endswith(" .scratch") or ".worktrees/" in norm:
|
|
243
|
+
continue
|
|
244
|
+
h.update((norm + "\n").encode("utf-8"))
|
|
245
|
+
diff = _run_git(safe_root, ["diff", "--relative", "HEAD"])
|
|
246
|
+
h.update(diff.stdout.encode("utf-8", errors="replace"))
|
|
247
|
+
untracked = _run_git(safe_root, ["ls-files", "--others", "--exclude-standard"])
|
|
248
|
+
for rel in sorted(untracked.stdout.splitlines()):
|
|
249
|
+
norm = rel.strip().replace("\\", "/")
|
|
250
|
+
if not norm or norm.startswith((".scratch/", ".worktrees/", "__pycache__/")):
|
|
251
|
+
continue
|
|
252
|
+
p = safe_root / norm
|
|
253
|
+
if p.is_file() and not p.is_symlink():
|
|
254
|
+
try:
|
|
255
|
+
h.update(f"U:{norm}:{hashlib.sha256(p.read_bytes()).hexdigest()}\n".encode("utf-8"))
|
|
256
|
+
except OSError:
|
|
257
|
+
pass
|
|
258
|
+
else:
|
|
259
|
+
for rel in _iter_non_git_files(safe_root, cap=200):
|
|
260
|
+
p = safe_root / rel
|
|
261
|
+
if p.is_file() and not p.is_symlink():
|
|
262
|
+
try:
|
|
263
|
+
h.update(f"NG:{rel}:{hashlib.sha256(p.read_bytes()).hexdigest()}\n".encode("utf-8"))
|
|
264
|
+
except OSError:
|
|
265
|
+
pass
|
|
266
|
+
return h.hexdigest()[:24]
|
|
267
|
+
|
|
268
|
+
def _parse_numstat(output: str) -> dict[str, tuple[int, int]]:
|
|
269
|
+
stats: dict[str, tuple[int, int]] = {}
|
|
270
|
+
for line in output.splitlines():
|
|
271
|
+
parts = line.split("\t")
|
|
272
|
+
if len(parts) < 3:
|
|
273
|
+
continue
|
|
274
|
+
add_raw, del_raw, raw_path = parts[0], parts[1], parts[2]
|
|
275
|
+
if " => " in raw_path:
|
|
276
|
+
raw_path = re.sub(r"\{[^{}]* => ([^{}]*)\}", r"\1", raw_path)
|
|
277
|
+
if " => " in raw_path:
|
|
278
|
+
raw_path = raw_path.split(" => ", 1)[1]
|
|
279
|
+
path_norm = raw_path.strip().strip('"').replace("\\", "/")
|
|
280
|
+
if not path_norm or path_norm.startswith((".scratch/", ".worktrees/")):
|
|
281
|
+
continue
|
|
282
|
+
added = int(add_raw) if add_raw.isdigit() else 0
|
|
283
|
+
deleted = int(del_raw) if del_raw.isdigit() else 0
|
|
284
|
+
prev_a, prev_d = stats.get(path_norm, (0, 0))
|
|
285
|
+
stats[path_norm] = (prev_a + added, prev_d + deleted)
|
|
286
|
+
return stats
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
def _count_file_lines(path: Path) -> int:
|
|
290
|
+
try:
|
|
291
|
+
data = path.read_bytes()
|
|
292
|
+
except OSError:
|
|
293
|
+
return 0
|
|
294
|
+
if b"\x00" in data[:8192] or not data:
|
|
295
|
+
return 0
|
|
296
|
+
return data.count(b"\n") + (0 if data.endswith(b"\n") else 1)
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
def _find_inline_marker(line: str, marker: str) -> int:
|
|
300
|
+
in_single = False
|
|
301
|
+
in_double = False
|
|
302
|
+
escaped = False
|
|
303
|
+
mlen = len(marker)
|
|
304
|
+
limit = len(line) - mlen + 1
|
|
305
|
+
i = 0
|
|
306
|
+
while i < limit:
|
|
307
|
+
ch = line[i]
|
|
308
|
+
if escaped:
|
|
309
|
+
escaped = False
|
|
310
|
+
i += 1
|
|
311
|
+
continue
|
|
312
|
+
if ch == "\\" and (in_single or in_double):
|
|
313
|
+
escaped = True
|
|
314
|
+
i += 1
|
|
315
|
+
continue
|
|
316
|
+
if ch == "'" and not in_double:
|
|
317
|
+
in_single = not in_single
|
|
318
|
+
elif ch == '"' and not in_single:
|
|
319
|
+
in_double = not in_double
|
|
320
|
+
elif not in_single and not in_double and line.startswith(marker, i):
|
|
321
|
+
if marker == "//" and i > 0 and line[i - 1] == ":":
|
|
322
|
+
i += 1
|
|
323
|
+
continue
|
|
324
|
+
return i
|
|
325
|
+
i += 1
|
|
326
|
+
return -1
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
def _comment_body(path: str, line: str) -> str | None:
|
|
330
|
+
ext = Path(path).suffix.lower()
|
|
331
|
+
stripped = line.lstrip()
|
|
332
|
+
if ext in HASH_COMMENT_EXTS:
|
|
333
|
+
if stripped.startswith("#!"):
|
|
334
|
+
return None
|
|
335
|
+
if stripped.startswith("#"):
|
|
336
|
+
return stripped[1:].strip()
|
|
337
|
+
idx = _find_inline_marker(line, "#")
|
|
338
|
+
if idx >= 0:
|
|
339
|
+
return line[idx + 1 :].strip()
|
|
340
|
+
elif ext in SLASH_COMMENT_EXTS:
|
|
341
|
+
if stripped.startswith("//"):
|
|
342
|
+
return stripped[2:].strip()
|
|
343
|
+
if stripped.startswith("/*") and not stripped.startswith("/**"):
|
|
344
|
+
body = stripped[2:]
|
|
345
|
+
if body.endswith("*/"):
|
|
346
|
+
body = body[: -2]
|
|
347
|
+
return body.strip(" *")
|
|
348
|
+
idx = _find_inline_marker(line, "//")
|
|
349
|
+
if idx >= 0:
|
|
350
|
+
return line[idx + 2 :].strip()
|
|
351
|
+
elif ext in DASH_COMMENT_EXTS:
|
|
352
|
+
if stripped.startswith("--"):
|
|
353
|
+
body = stripped[2:].strip()
|
|
354
|
+
if ext in (".lua", ".luau") and LUAU_DIRECTIVE_RE.match(body):
|
|
355
|
+
return None
|
|
356
|
+
return body
|
|
357
|
+
idx = _find_inline_marker(line, "--")
|
|
358
|
+
if idx >= 0:
|
|
359
|
+
body = line[idx + 2 :].strip()
|
|
360
|
+
if ext in (".lua", ".luau") and LUAU_DIRECTIVE_RE.match(body):
|
|
361
|
+
return None
|
|
362
|
+
return body
|
|
363
|
+
return None
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
def _should_keep_comment(body: str) -> bool:
|
|
367
|
+
if not body:
|
|
368
|
+
return True
|
|
369
|
+
if COMMENT_SCENT_RE.search(body):
|
|
370
|
+
return False
|
|
371
|
+
return bool(COMMENT_KEEP_RE.search(body))
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
def _collect_diff_patches(root: Path, paths: list[str], base: str | None, staged: bool, head_sha: str | None) -> list[str]:
|
|
375
|
+
if not paths:
|
|
376
|
+
return []
|
|
377
|
+
outputs: list[str] = []
|
|
378
|
+
if base:
|
|
379
|
+
res = _run_git(root, ["diff", "--relative", "-U0", base, "--", *paths])
|
|
380
|
+
if res.returncode == 0:
|
|
381
|
+
outputs.append(res.stdout)
|
|
382
|
+
elif staged:
|
|
383
|
+
res = _run_git(root, ["diff", "--relative", "--cached", "-U0", "--", *paths])
|
|
384
|
+
if res.returncode == 0:
|
|
385
|
+
outputs.append(res.stdout)
|
|
386
|
+
elif head_sha:
|
|
387
|
+
res = _run_git(root, ["diff", "--relative", "-U0", "HEAD", "--", *paths])
|
|
388
|
+
if res.returncode == 0:
|
|
389
|
+
outputs.append(res.stdout)
|
|
390
|
+
else:
|
|
391
|
+
cached = _run_git(root, ["diff", "--relative", "--cached", "-U0", "--", *paths])
|
|
392
|
+
if cached.returncode == 0 and cached.stdout:
|
|
393
|
+
outputs.append(cached.stdout)
|
|
394
|
+
unstaged = _run_git(root, ["diff", "--relative", "-U0", "--", *paths])
|
|
395
|
+
if unstaged.returncode == 0 and unstaged.stdout:
|
|
396
|
+
outputs.append(unstaged.stdout)
|
|
397
|
+
return outputs
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
def _iter_added_lines(
|
|
401
|
+
root: Path, target_paths: set[str], base: str | None, staged: bool, head_sha: str | None
|
|
402
|
+
):
|
|
403
|
+
if not target_paths:
|
|
404
|
+
return
|
|
405
|
+
seen_in_diff: set[str] = set()
|
|
406
|
+
seen_pairs: set[tuple[str, int]] = set()
|
|
407
|
+
patches = _collect_diff_patches(root, sorted(target_paths), base, staged, head_sha)
|
|
408
|
+
for patch in patches:
|
|
409
|
+
cur_file = None
|
|
410
|
+
cur_line = 0
|
|
411
|
+
for raw in patch.splitlines():
|
|
412
|
+
if raw.startswith("diff --git "):
|
|
413
|
+
cur_file = None
|
|
414
|
+
elif raw.startswith("+++ "):
|
|
415
|
+
header_path = raw[4:].strip().strip('"')
|
|
416
|
+
if header_path == "/dev/null":
|
|
417
|
+
cur_file = None
|
|
418
|
+
else:
|
|
419
|
+
if header_path.startswith("b/"):
|
|
420
|
+
header_path = header_path[2:]
|
|
421
|
+
cur_file = header_path.replace("\\", "/")
|
|
422
|
+
seen_in_diff.add(cur_file)
|
|
423
|
+
elif raw.startswith("@@ "):
|
|
424
|
+
m = re.search(r"\+(\d+)", raw)
|
|
425
|
+
cur_line = int(m.group(1)) if m else 0
|
|
426
|
+
elif cur_file and cur_file in target_paths and raw.startswith("+") and not raw.startswith("+++"):
|
|
427
|
+
key = (cur_file, cur_line)
|
|
428
|
+
if key not in seen_pairs:
|
|
429
|
+
seen_pairs.add(key)
|
|
430
|
+
yield cur_file, cur_line, raw[1:]
|
|
431
|
+
cur_line += 1
|
|
432
|
+
|
|
433
|
+
if not staged:
|
|
434
|
+
for rel in sorted(target_paths - seen_in_diff):
|
|
435
|
+
target = root / rel
|
|
436
|
+
if not target.is_file() or target.is_symlink():
|
|
437
|
+
continue
|
|
438
|
+
try:
|
|
439
|
+
lines = target.read_text(encoding="utf-8", errors="replace").splitlines()
|
|
440
|
+
except OSError:
|
|
441
|
+
continue
|
|
442
|
+
for idx, line in enumerate(lines, 1):
|
|
443
|
+
yield rel, idx, line
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
def _scan_added_comments(root: Path, files: list[str], base: str | None, staged: bool, head_sha: str | None) -> list[dict]:
|
|
447
|
+
scan_set = {p for p in files if Path(p).suffix.lower() in COMMENT_SCAN_EXTS}
|
|
448
|
+
found: list[dict] = []
|
|
449
|
+
for rel, line_no, text in _iter_added_lines(root, scan_set, base, staged, head_sha):
|
|
450
|
+
body = _comment_body(rel, text)
|
|
451
|
+
if body is not None and not _should_keep_comment(body):
|
|
452
|
+
found.append(
|
|
453
|
+
{
|
|
454
|
+
"path": rel,
|
|
455
|
+
"line": line_no,
|
|
456
|
+
"text": body[:120],
|
|
457
|
+
"high_scent": bool(COMMENT_SCENT_RE.search(body)),
|
|
458
|
+
}
|
|
459
|
+
)
|
|
460
|
+
return found
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
def _python_regex_or_template_lines(root: Path, rel: str) -> set[int]:
|
|
464
|
+
if not rel.lower().endswith(".py"):
|
|
465
|
+
return set()
|
|
466
|
+
target = root / rel
|
|
467
|
+
try:
|
|
468
|
+
src = target.read_text(encoding="utf-8", errors="replace")
|
|
469
|
+
tree = ast.parse(src, filename=rel)
|
|
470
|
+
except (OSError, SyntaxError):
|
|
471
|
+
return set()
|
|
472
|
+
skip: set[int] = set()
|
|
473
|
+
for node in ast.walk(tree):
|
|
474
|
+
if isinstance(node, ast.Call):
|
|
475
|
+
fn = node.func
|
|
476
|
+
is_re_compile = (
|
|
477
|
+
isinstance(fn, ast.Attribute)
|
|
478
|
+
and fn.attr in {"compile", "search", "match", "fullmatch", "sub", "findall", "finditer"}
|
|
479
|
+
and isinstance(fn.value, ast.Name)
|
|
480
|
+
and fn.value.id == "re"
|
|
481
|
+
)
|
|
482
|
+
if is_re_compile and hasattr(node, "lineno") and hasattr(node, "end_lineno"):
|
|
483
|
+
skip.update(range(node.lineno, (node.end_lineno or node.lineno) + 1))
|
|
484
|
+
elif isinstance(node, ast.Constant) and isinstance(node.value, str):
|
|
485
|
+
val = node.value
|
|
486
|
+
if ("/deep " in val or "Hardcore Mode" in val or "hardcore-craft-depth" in val or "(optional hardcore mode)" in val.lower()) and hasattr(node, "lineno"):
|
|
487
|
+
skip.update(range(node.lineno, (getattr(node, "end_lineno", None) or node.lineno) + 1))
|
|
488
|
+
return skip
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
def _scan_workaround_smells(root: Path, files: list[str], base: str | None, staged: bool, head_sha: str | None) -> list[dict]:
|
|
492
|
+
code_set = {p for p in files if Path(p).suffix.lower() in CODE_EXTS and not TEST_PATH_RE.search(p)}
|
|
493
|
+
skip_cache: dict[str, set[int]] = {}
|
|
494
|
+
found: list[dict] = []
|
|
495
|
+
for rel, line_no, text in _iter_added_lines(root, code_set, base, staged, head_sha):
|
|
496
|
+
stripped = text.lstrip()
|
|
497
|
+
if stripped.startswith(("#", "//", "--", "/*", "*")) or "re.compile(" in text:
|
|
498
|
+
continue
|
|
499
|
+
if rel not in skip_cache:
|
|
500
|
+
skip_cache[rel] = _python_regex_or_template_lines(root, rel)
|
|
501
|
+
if line_no in skip_cache[rel]:
|
|
502
|
+
continue
|
|
503
|
+
for kind, pat, is_critical in WORKAROUND_SMELL_PATTERNS:
|
|
504
|
+
if pat.search(text):
|
|
505
|
+
found.append(
|
|
506
|
+
{
|
|
507
|
+
"path": rel,
|
|
508
|
+
"line": line_no,
|
|
509
|
+
"kind": kind,
|
|
510
|
+
"critical": is_critical,
|
|
511
|
+
"text": text.strip()[:120],
|
|
512
|
+
}
|
|
513
|
+
)
|
|
514
|
+
return found
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
def _scan_toy_shortcuts(root: Path, files: list[str], base: str | None, staged: bool, head_sha: str | None) -> list[dict]:
|
|
518
|
+
code_set = {p for p in files if Path(p).suffix.lower() in CODE_EXTS and not TEST_PATH_RE.search(p)}
|
|
519
|
+
skip_cache: dict[str, set[int]] = {}
|
|
520
|
+
found: list[dict] = []
|
|
521
|
+
for rel, line_no, text in _iter_added_lines(root, code_set, base, staged, head_sha):
|
|
522
|
+
if "re.compile(" in text:
|
|
523
|
+
continue
|
|
524
|
+
if rel not in skip_cache:
|
|
525
|
+
skip_cache[rel] = _python_regex_or_template_lines(root, rel)
|
|
526
|
+
if line_no in skip_cache[rel]:
|
|
527
|
+
continue
|
|
528
|
+
cbody = _comment_body(rel, text)
|
|
529
|
+
if cbody is not None and re.search(r"\b(?:placeholder|stub|simplified\s+fallback|optional\s+hardcore)\b", cbody, re.I):
|
|
530
|
+
found.append(
|
|
531
|
+
{
|
|
532
|
+
"path": rel,
|
|
533
|
+
"line": line_no,
|
|
534
|
+
"kind": "comment-placeholder-shortcut",
|
|
535
|
+
"critical": True,
|
|
536
|
+
"text": text.strip()[:120],
|
|
537
|
+
}
|
|
538
|
+
)
|
|
539
|
+
continue
|
|
540
|
+
for kind, pat, is_critical in TOY_SHORTCUT_PATTERNS:
|
|
541
|
+
if pat.search(text):
|
|
542
|
+
found.append(
|
|
543
|
+
{
|
|
544
|
+
"path": rel,
|
|
545
|
+
"line": line_no,
|
|
546
|
+
"kind": kind,
|
|
547
|
+
"critical": is_critical,
|
|
548
|
+
"text": text.strip()[:120],
|
|
549
|
+
}
|
|
550
|
+
)
|
|
551
|
+
break
|
|
552
|
+
return found
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
def _scan_backend_perf_traps(root: Path, files: list[str]) -> list[dict]:
|
|
556
|
+
perf_script = Path(__file__).resolve().parent.parent / "perf-audit" / "perf_audit.py"
|
|
557
|
+
if not perf_script.is_file():
|
|
558
|
+
return []
|
|
559
|
+
cand_files = [
|
|
560
|
+
f for f in files
|
|
561
|
+
if Path(f).suffix.lower() in BACKEND_EXTS
|
|
562
|
+
and not TEST_PATH_RE.search(f)
|
|
563
|
+
and (root / f).is_file()
|
|
564
|
+
]
|
|
565
|
+
if not cand_files:
|
|
566
|
+
return []
|
|
567
|
+
try:
|
|
568
|
+
spec = importlib.util.spec_from_file_location("self_grill_perf_audit", perf_script)
|
|
569
|
+
if spec is None or spec.loader is None:
|
|
570
|
+
return []
|
|
571
|
+
mod = importlib.util.module_from_spec(spec)
|
|
572
|
+
sys.modules[spec.name] = mod
|
|
573
|
+
spec.loader.exec_module(mod)
|
|
574
|
+
res = mod.scan_paths(root, explicit_files=cand_files)
|
|
575
|
+
return list(res.get("findings") or [])
|
|
576
|
+
except Exception:
|
|
577
|
+
return []
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
def _scan_reward_hacks(root: Path, files: list[str], base: str | None, staged: bool) -> list[dict]:
|
|
582
|
+
rg_script = Path(__file__).resolve().parent.parent / "reward-guard" / "reward_guard.py"
|
|
583
|
+
if not rg_script.is_file() or not files:
|
|
584
|
+
return []
|
|
585
|
+
try:
|
|
586
|
+
spec = importlib.util.spec_from_file_location("self_grill_reward_guard", rg_script)
|
|
587
|
+
if spec is None or spec.loader is None:
|
|
588
|
+
return []
|
|
589
|
+
mod = importlib.util.module_from_spec(spec)
|
|
590
|
+
sys.modules[spec.name] = mod
|
|
591
|
+
spec.loader.exec_module(mod)
|
|
592
|
+
res = mod.scan_reward_hacking(root, staged=staged, explicit_files=files if not _is_git_root_or_worktree(root) else None, base=base)
|
|
593
|
+
return list(res.get("findings") or [])
|
|
594
|
+
except Exception:
|
|
595
|
+
return []
|
|
596
|
+
|
|
597
|
+
def _auto_merge_base(root: Path) -> str | None:
|
|
598
|
+
branch_res = _run_git(root, ["rev-parse", "--abbrev-ref", "HEAD"])
|
|
599
|
+
branch = branch_res.stdout.strip() if branch_res.returncode == 0 else ""
|
|
600
|
+
if not branch or branch in ("main", "master", "HEAD"):
|
|
601
|
+
return None
|
|
602
|
+
for candidate in ("origin/main", "origin/master", "main", "master"):
|
|
603
|
+
mb = _run_git(root, ["merge-base", "HEAD", candidate])
|
|
604
|
+
if mb.returncode == 0:
|
|
605
|
+
sha = mb.stdout.strip()
|
|
606
|
+
head = _run_git(root, ["rev-parse", "HEAD"]).stdout.strip()
|
|
607
|
+
if sha and sha != head:
|
|
608
|
+
return sha
|
|
609
|
+
return None
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
def _scan_proof_escapes(root: Path, files: list[str]) -> list[dict]:
|
|
614
|
+
vp_script = Path(__file__).resolve().parent.parent / "formal-verification" / "verify_proof.py"
|
|
615
|
+
if not vp_script.is_file():
|
|
616
|
+
return []
|
|
617
|
+
cand_files = [
|
|
618
|
+
f for f in files
|
|
619
|
+
if Path(f).suffix.lower() in PROOF_EXTS
|
|
620
|
+
and not TEST_PATH_RE.search(f)
|
|
621
|
+
and (root / f).is_file()
|
|
622
|
+
]
|
|
623
|
+
if not cand_files:
|
|
624
|
+
return []
|
|
625
|
+
try:
|
|
626
|
+
spec = importlib.util.spec_from_file_location("self_grill_verify_proof", vp_script)
|
|
627
|
+
if spec is None or spec.loader is None:
|
|
628
|
+
return []
|
|
629
|
+
mod = importlib.util.module_from_spec(spec)
|
|
630
|
+
sys.modules[spec.name] = mod
|
|
631
|
+
spec.loader.exec_module(mod)
|
|
632
|
+
out: list[dict] = []
|
|
633
|
+
for rel in cand_files:
|
|
634
|
+
for item in mod.scan_proof_file(root / rel, base_root=root):
|
|
635
|
+
out.append({
|
|
636
|
+
"rule_id": item.rule_id,
|
|
637
|
+
"severity": item.severity,
|
|
638
|
+
"file": item.file,
|
|
639
|
+
"line": item.line,
|
|
640
|
+
"message": item.message,
|
|
641
|
+
})
|
|
642
|
+
return out
|
|
643
|
+
except Exception:
|
|
644
|
+
return []
|
|
645
|
+
|
|
646
|
+
def inspect_diff(
|
|
647
|
+
root: Path,
|
|
648
|
+
base: str | None = None,
|
|
649
|
+
staged: bool = False,
|
|
650
|
+
explicit_files: list[str] | None = None,
|
|
651
|
+
) -> dict:
|
|
652
|
+
safe_root = reject_unsafe_root(root)
|
|
653
|
+
stats: dict[str, tuple[int, int]] = {}
|
|
654
|
+
head_sha = None
|
|
655
|
+
effective_base = base
|
|
656
|
+
in_git = _is_git_root_or_worktree(safe_root)
|
|
657
|
+
if explicit_files:
|
|
658
|
+
for raw in explicit_files:
|
|
659
|
+
cand = ensure_contained((safe_root / raw) if not Path(raw).is_absolute() else Path(raw), safe_root)
|
|
660
|
+
if cand.is_file():
|
|
661
|
+
rel = cand.relative_to(safe_root).as_posix()
|
|
662
|
+
stats[rel] = (_count_file_lines(cand), 0)
|
|
663
|
+
elif in_git:
|
|
664
|
+
head_res = _run_git(safe_root, ["rev-parse", "--short", "HEAD"])
|
|
665
|
+
if head_res.returncode == 0:
|
|
666
|
+
head_sha = head_res.stdout.strip() or None
|
|
667
|
+
if effective_base:
|
|
668
|
+
diff_res = _run_git(safe_root, ["diff", "--relative", "--numstat", effective_base])
|
|
669
|
+
if diff_res.returncode != 0:
|
|
670
|
+
diff_res = _run_git(safe_root, ["diff", "--relative", "--numstat", f"{effective_base}...HEAD"])
|
|
671
|
+
stats.update(_parse_numstat(diff_res.stdout))
|
|
672
|
+
elif staged:
|
|
673
|
+
diff_res = _run_git(safe_root, ["diff", "--relative", "--cached", "--numstat"])
|
|
674
|
+
stats.update(_parse_numstat(diff_res.stdout))
|
|
675
|
+
else:
|
|
676
|
+
if head_sha:
|
|
677
|
+
diff_res = _run_git(safe_root, ["diff", "--relative", "--numstat", "HEAD"])
|
|
678
|
+
stats.update(_parse_numstat(diff_res.stdout))
|
|
679
|
+
else:
|
|
680
|
+
cached_res = _run_git(safe_root, ["diff", "--relative", "--cached", "--numstat"])
|
|
681
|
+
stats.update(_parse_numstat(cached_res.stdout))
|
|
682
|
+
wt_res = _run_git(safe_root, ["diff", "--relative", "--numstat"])
|
|
683
|
+
stats.update(_parse_numstat(wt_res.stdout))
|
|
684
|
+
|
|
685
|
+
if not staged:
|
|
686
|
+
untracked = _run_git(safe_root, ["ls-files", "--others", "--exclude-standard"])
|
|
687
|
+
if untracked.returncode == 0:
|
|
688
|
+
for rel in untracked.stdout.splitlines():
|
|
689
|
+
norm = rel.strip().replace("\\", "/")
|
|
690
|
+
if not norm or norm.startswith((".scratch/", ".worktrees/")):
|
|
691
|
+
continue
|
|
692
|
+
stats.setdefault(norm, (_count_file_lines(safe_root / norm), 0))
|
|
693
|
+
|
|
694
|
+
if not stats and not effective_base and not staged and head_sha:
|
|
695
|
+
mb = _auto_merge_base(safe_root)
|
|
696
|
+
if mb:
|
|
697
|
+
effective_base = mb
|
|
698
|
+
mb_res = _run_git(safe_root, ["diff", "--relative", "--numstat", mb])
|
|
699
|
+
stats.update(_parse_numstat(mb_res.stdout))
|
|
700
|
+
|
|
701
|
+
else:
|
|
702
|
+
for rel in _iter_non_git_files(safe_root, cap=150):
|
|
703
|
+
stats[rel] = (_count_file_lines(safe_root / rel), 0)
|
|
704
|
+
files = sorted(stats.keys())
|
|
705
|
+
added = sum(v[0] for v in stats.values())
|
|
706
|
+
deleted = sum(v[1] for v in stats.values())
|
|
707
|
+
total_lines = added + deleted
|
|
708
|
+
file_count = len(files)
|
|
709
|
+
|
|
710
|
+
sensitive_paths = [p for p in files if SENSITIVE_PATH_RE.search(p)]
|
|
711
|
+
test_paths = [p for p in files if TEST_PATH_RE.search(p)]
|
|
712
|
+
code_paths = [p for p in files if Path(p).suffix.lower() in CODE_EXTS and p not in test_paths]
|
|
713
|
+
proof_paths = [p for p in files if Path(p).suffix.lower() in PROOF_EXTS and p not in test_paths]
|
|
714
|
+
shell_paths = [p for p in files if Path(p).suffix.lower() in SHELL_OR_SCRIPT_EXTS]
|
|
715
|
+
schema_paths = [p for p in files if Path(p).suffix.lower() in SCHEMA_OR_CONFIG_EXTS]
|
|
716
|
+
skill_paths = [p for p in files if SKILL_OR_PROMPT_RE.search(p)]
|
|
717
|
+
|
|
718
|
+
if file_count == 0:
|
|
719
|
+
measured_size = "none"
|
|
720
|
+
elif total_lines <= 30 and file_count <= 2 and not sensitive_paths:
|
|
721
|
+
measured_size = "S"
|
|
722
|
+
elif total_lines > 250 or file_count > 8 or len(sensitive_paths) >= 2:
|
|
723
|
+
measured_size = "L"
|
|
724
|
+
else:
|
|
725
|
+
measured_size = "M"
|
|
726
|
+
|
|
727
|
+
added_comments = _scan_added_comments(safe_root, files, effective_base, staged, head_sha) if in_git else []
|
|
728
|
+
workaround_smells = _scan_workaround_smells(safe_root, files, effective_base, staged, head_sha) if in_git else []
|
|
729
|
+
toy_shortcuts = _scan_toy_shortcuts(safe_root, files, effective_base, staged, head_sha) if in_git else []
|
|
730
|
+
backend_perf_findings = _scan_backend_perf_traps(safe_root, files)
|
|
731
|
+
proof_escapes = _scan_proof_escapes(safe_root, files)
|
|
732
|
+
reward_hacks = _scan_reward_hacks(safe_root, files, effective_base, staged)
|
|
733
|
+
questions = build_questions(
|
|
734
|
+
phase="checks",
|
|
735
|
+
files=files,
|
|
736
|
+
total_lines=total_lines,
|
|
737
|
+
file_count=file_count,
|
|
738
|
+
sensitive_paths=sensitive_paths,
|
|
739
|
+
code_paths=code_paths,
|
|
740
|
+
test_paths=test_paths,
|
|
741
|
+
shell_paths=shell_paths,
|
|
742
|
+
schema_paths=schema_paths,
|
|
743
|
+
skill_paths=skill_paths,
|
|
744
|
+
added_comments=added_comments,
|
|
745
|
+
workaround_smells=workaround_smells,
|
|
746
|
+
toy_shortcuts=toy_shortcuts,
|
|
747
|
+
backend_perf_findings=backend_perf_findings,
|
|
748
|
+
proof_paths=proof_paths,
|
|
749
|
+
proof_escapes=proof_escapes,
|
|
750
|
+
reward_hacks=reward_hacks,
|
|
751
|
+
)
|
|
752
|
+
recommend_cross_family = measured_size == "L" or bool(sensitive_paths) or bool(proof_paths)
|
|
753
|
+
tree_digest = compute_tree_digest(safe_root)
|
|
754
|
+
return {
|
|
755
|
+
"root": str(safe_root),
|
|
756
|
+
"in_git": in_git,
|
|
757
|
+
"head_sha": head_sha,
|
|
758
|
+
"tree_digest": tree_digest,
|
|
759
|
+
"base": effective_base,
|
|
760
|
+
"staged": staged,
|
|
761
|
+
"file_count": file_count,
|
|
762
|
+
"lines_added": added,
|
|
763
|
+
"lines_deleted": deleted,
|
|
764
|
+
"total_lines": total_lines,
|
|
765
|
+
"measured_size": measured_size,
|
|
766
|
+
"files": files,
|
|
767
|
+
"sensitive_paths": sensitive_paths,
|
|
768
|
+
"code_paths": code_paths,
|
|
769
|
+
"proof_paths": proof_paths,
|
|
770
|
+
"test_paths": test_paths,
|
|
771
|
+
"shell_paths": shell_paths,
|
|
772
|
+
"schema_paths": schema_paths,
|
|
773
|
+
"skill_paths": skill_paths,
|
|
774
|
+
"added_comment_count": len(added_comments),
|
|
775
|
+
"added_comments": added_comments[:25],
|
|
776
|
+
"workaround_smell_count": len(workaround_smells),
|
|
777
|
+
"workaround_smells": workaround_smells[:25],
|
|
778
|
+
"toy_shortcut_count": len(toy_shortcuts),
|
|
779
|
+
"toy_shortcuts": toy_shortcuts[:25],
|
|
780
|
+
"backend_perf_count": len(backend_perf_findings),
|
|
781
|
+
"backend_perf_findings": backend_perf_findings[:25],
|
|
782
|
+
"proof_escape_count": len(proof_escapes),
|
|
783
|
+
"proof_escapes": proof_escapes[:25],
|
|
784
|
+
"reward_hack_count": len(reward_hacks),
|
|
785
|
+
"reward_hacks": reward_hacks[:25],
|
|
786
|
+
"recommend_cross_family_skeptic": recommend_cross_family,
|
|
787
|
+
"questions": questions,
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
def build_questions(
|
|
792
|
+
phase: str,
|
|
793
|
+
files: list[str],
|
|
794
|
+
total_lines: int,
|
|
795
|
+
file_count: int,
|
|
796
|
+
sensitive_paths: list[str],
|
|
797
|
+
code_paths: list[str],
|
|
798
|
+
test_paths: list[str],
|
|
799
|
+
shell_paths: list[str],
|
|
800
|
+
schema_paths: list[str],
|
|
801
|
+
skill_paths: list[str],
|
|
802
|
+
added_comments: list[dict] | None = None,
|
|
803
|
+
workaround_smells: list[dict] | None = None,
|
|
804
|
+
toy_shortcuts: list[dict] | None = None,
|
|
805
|
+
added_comment_total: int | None = None,
|
|
806
|
+
workaround_smell_total: int | None = None,
|
|
807
|
+
toy_shortcut_total: int | None = None,
|
|
808
|
+
backend_perf_findings: list[dict] | None = None,
|
|
809
|
+
proof_paths: list[str] | None = None,
|
|
810
|
+
proof_escapes: list[dict] | None = None,
|
|
811
|
+
reward_hacks: list[dict] | None = None,
|
|
812
|
+
) -> list[dict]:
|
|
813
|
+
items: list[dict] = []
|
|
814
|
+
comment_count = added_comment_total if added_comment_total is not None else len(added_comments or [])
|
|
815
|
+
smell_count = workaround_smell_total if workaround_smell_total is not None else len(workaround_smells or [])
|
|
816
|
+
shortcut_count = toy_shortcut_total if toy_shortcut_total is not None else len(toy_shortcuts or [])
|
|
817
|
+
perf_list = list(backend_perf_findings or [])
|
|
818
|
+
p_paths = list(proof_paths or [])
|
|
819
|
+
p_escapes = list(proof_escapes or [])
|
|
820
|
+
rh_list = list(reward_hacks or [])
|
|
821
|
+
def add(qid: str, severity: str, category: str, prompt: str, trigger: str) -> None:
|
|
822
|
+
items.append(
|
|
823
|
+
{
|
|
824
|
+
"id": qid,
|
|
825
|
+
"severity": severity,
|
|
826
|
+
"category": category,
|
|
827
|
+
"prompt": prompt,
|
|
828
|
+
"trigger": trigger,
|
|
829
|
+
"status": "open",
|
|
830
|
+
"answer": "",
|
|
831
|
+
"receipt": "",
|
|
832
|
+
}
|
|
833
|
+
)
|
|
834
|
+
|
|
835
|
+
if phase in ("plan", "both"):
|
|
836
|
+
add(
|
|
837
|
+
"premise-check",
|
|
838
|
+
"critical",
|
|
839
|
+
"plan",
|
|
840
|
+
"What assumption in this plan could be wrong or an XY proxy, and what repo/runtime fact proves the premise holds?",
|
|
841
|
+
"always-plan",
|
|
842
|
+
)
|
|
843
|
+
add(
|
|
844
|
+
"irreversible-and-scope",
|
|
845
|
+
"critical",
|
|
846
|
+
"plan",
|
|
847
|
+
"Are all user deliverables accounted for in the scope ledger, and does any step cross a hard stop or outside-root write?",
|
|
848
|
+
"always-plan",
|
|
849
|
+
)
|
|
850
|
+
add(
|
|
851
|
+
"oracle-before-code",
|
|
852
|
+
"advisory",
|
|
853
|
+
"plan",
|
|
854
|
+
"What exact real-artifact command or failing-without-fix test will prove this change works before reporting done?",
|
|
855
|
+
"always-plan",
|
|
856
|
+
)
|
|
857
|
+
add(
|
|
858
|
+
"hardcore-ceiling",
|
|
859
|
+
"critical",
|
|
860
|
+
"hardcore",
|
|
861
|
+
"Hardcore Mode check: does this plan aim straight for the first-principles architectural ceiling (real algorithms, parallelism, solvers, native representations/LODs) instead of sandbagging into a toy MVP or hiding the best tier under '(Optional hardcore mode)'?",
|
|
862
|
+
"always-plan",
|
|
863
|
+
)
|
|
864
|
+
|
|
865
|
+
if phase in ("checks", "both"):
|
|
866
|
+
add(
|
|
867
|
+
"real-artifact-proof",
|
|
868
|
+
"critical",
|
|
869
|
+
"checks",
|
|
870
|
+
"Did you run the real command, app, or test suite AFTER your final edit with raw exit code 0 (never masked behind | head or | tail)?",
|
|
871
|
+
"always-checks",
|
|
872
|
+
)
|
|
873
|
+
add(
|
|
874
|
+
"scope-completeness",
|
|
875
|
+
"critical",
|
|
876
|
+
"checks",
|
|
877
|
+
"Does every deliverable requested by the user map to a verified change or an explicit blocker with unblock path?",
|
|
878
|
+
"always-checks",
|
|
879
|
+
)
|
|
880
|
+
if code_paths and not test_paths:
|
|
881
|
+
add(
|
|
882
|
+
"missing-regression-test",
|
|
883
|
+
"critical",
|
|
884
|
+
"checks",
|
|
885
|
+
f"Code changed ({', '.join(code_paths[:4])}) without test edits: what failing-without-fix test or live check proves the behavior cannot silently regress?",
|
|
886
|
+
"code-without-tests",
|
|
887
|
+
)
|
|
888
|
+
if test_paths:
|
|
889
|
+
add(
|
|
890
|
+
"no-check-theater",
|
|
891
|
+
"critical",
|
|
892
|
+
"checks",
|
|
893
|
+
"Would the new or touched tests fail if your production fix were reverted, and do they avoid mocking out the behavior under test?",
|
|
894
|
+
"tests-touched",
|
|
895
|
+
)
|
|
896
|
+
if sensitive_paths:
|
|
897
|
+
add(
|
|
898
|
+
"trust-boundary-fail-closed",
|
|
899
|
+
"critical",
|
|
900
|
+
"security",
|
|
901
|
+
f"Sensitive paths touched ({', '.join(sensitive_paths[:4])}): how do missing, malformed, or hostile inputs fail closed without leaking secrets or escaping root?",
|
|
902
|
+
"sensitive-paths",
|
|
903
|
+
)
|
|
904
|
+
if shell_paths:
|
|
905
|
+
add(
|
|
906
|
+
"exit-code-and-platform",
|
|
907
|
+
"advisory",
|
|
908
|
+
"platform",
|
|
909
|
+
"Do shell/script changes handle Windows paths, CRLF line endings, spaces in paths, and non-zero exit codes safely?",
|
|
910
|
+
"scripts-touched",
|
|
911
|
+
)
|
|
912
|
+
if skill_paths:
|
|
913
|
+
add(
|
|
914
|
+
"skill-and-link-validation",
|
|
915
|
+
"critical",
|
|
916
|
+
"skills",
|
|
917
|
+
"Did check_skill.py (and repo structural checks, byte budgets, and routing tests) pass after the final skill or prompt edit?",
|
|
918
|
+
"skills-touched",
|
|
919
|
+
)
|
|
920
|
+
if schema_paths:
|
|
921
|
+
add(
|
|
922
|
+
"schema-backcompat",
|
|
923
|
+
"advisory",
|
|
924
|
+
"data",
|
|
925
|
+
"Are config, JSON, or schema edits backwards-compatible and idempotent for existing callers and stored state?",
|
|
926
|
+
"schema-touched",
|
|
927
|
+
)
|
|
928
|
+
if total_lines > 200 or file_count > 6:
|
|
929
|
+
add(
|
|
930
|
+
"blast-radius-and-split",
|
|
931
|
+
"advisory",
|
|
932
|
+
"architecture",
|
|
933
|
+
f"Diff touches {total_lines} lines across {file_count} files: what indirect callers could break, and should any independent unit split out?",
|
|
934
|
+
"large-diff",
|
|
935
|
+
)
|
|
936
|
+
if added_comments:
|
|
937
|
+
high_scent = [c for c in added_comments if c.get("high_scent")]
|
|
938
|
+
locs = ", ".join(f"{c['path']}:{c['line']}" for c in added_comments[:4])
|
|
939
|
+
sev = "critical" if (high_scent or comment_count >= 3) else "advisory"
|
|
940
|
+
add(
|
|
941
|
+
"no-lying-comments",
|
|
942
|
+
sev,
|
|
943
|
+
"comments",
|
|
944
|
+
f"Diff adds {comment_count} code comment(s) ({locs}): comments rot and lie, and AI agents read comments instead of code. Delete narration/workaround/suppression comments via no-comments or prove each matches a strict keep exception.",
|
|
945
|
+
"added-comments",
|
|
946
|
+
)
|
|
947
|
+
if workaround_smells:
|
|
948
|
+
has_crit = any(s.get("critical") for s in workaround_smells)
|
|
949
|
+
locs = ", ".join(f"{s['path']}:{s['line']}({s['kind']})" for s in workaround_smells[:4])
|
|
950
|
+
sev = "critical" if (has_crit or smell_count >= 2) else "advisory"
|
|
951
|
+
add(
|
|
952
|
+
"no-workaround-smells",
|
|
953
|
+
sev,
|
|
954
|
+
"architecture",
|
|
955
|
+
f"Diff introduces {smell_count} workaround/foot-gun smell(s) ({locs}): eliminate the root cause or use a supported framework API/type instead of imperative timers, raw useEffect, or unsafe type casts.",
|
|
956
|
+
"workaround-smells",
|
|
957
|
+
)
|
|
958
|
+
if perf_list:
|
|
959
|
+
locs = ", ".join(f"{p['file']}:{p['line']}({p['rule_id']})" for p in perf_list[:4])
|
|
960
|
+
has_high = any(p.get("severity") == "high" for p in perf_list)
|
|
961
|
+
add(
|
|
962
|
+
"backend-systems-hygiene",
|
|
963
|
+
"critical" if has_high else "advisory",
|
|
964
|
+
"performance",
|
|
965
|
+
f"Diff triggers {len(perf_list)} backend/systems hot-path trap(s) ({locs}): eliminate N+1/await-in-loop waterfalls, sync-in-async blocking, missing HTTP timeouts, per-request pools, OFFSET scans, or cache/serialization bottlenecks per high-scale-server-optimization.md.",
|
|
966
|
+
"backend-perf-traps",
|
|
967
|
+
)
|
|
968
|
+
if p_escapes or p_paths:
|
|
969
|
+
esc_note = (
|
|
970
|
+
f" Static proof escapes found: {', '.join(f'{e['file']}:{e['line']}({e['rule_id']})' for e in p_escapes[:4])}."
|
|
971
|
+
if p_escapes else ""
|
|
972
|
+
)
|
|
973
|
+
add(
|
|
974
|
+
"proof-and-math-soundness",
|
|
975
|
+
"critical",
|
|
976
|
+
"formal",
|
|
977
|
+
f"Formal & mathematical proof soundness ({', '.join(p_paths[:4] or ['proofs'])}):{esc_note} "
|
|
978
|
+
"Verify zero sorry/admit/custom axiom/native_decide escapes via verify_proof.py audit-static, "
|
|
979
|
+
"check NL-to-formal statement alignment (quantifier order forall-exists vs exists-forall, n=0/1 boundaries, strict vs weak inequalities), "
|
|
980
|
+
"prove checks are able-to-fail (--mutate), and run two independent line-by-line audits on any non-kernel-certified step.",
|
|
981
|
+
"proof-touched",
|
|
982
|
+
)
|
|
983
|
+
if toy_shortcuts:
|
|
984
|
+
locs = ", ".join(f"{s['path']}:{s['line']}({s['kind']})" for s in toy_shortcuts[:4])
|
|
985
|
+
add(
|
|
986
|
+
"hardcore-craft-depth",
|
|
987
|
+
"critical",
|
|
988
|
+
"hardcore",
|
|
989
|
+
f"Hardcore Mode violation: diff introduces {shortcut_count} stub/toy shortcut(s) ({locs}). Replace placeholders/stubs/deferred TODOs with the real first-principles implementation and prove it on the real artifact.",
|
|
990
|
+
"toy-shortcuts",
|
|
991
|
+
)
|
|
992
|
+
elif code_paths and (total_lines > 30 or file_count > 2):
|
|
993
|
+
add(
|
|
994
|
+
"hardcore-craft-depth",
|
|
995
|
+
"critical",
|
|
996
|
+
"hardcore",
|
|
997
|
+
"Hardcore Mode audit: does this implementation ship the true first-principles architecture/algorithm rather than a watered-down approximation, single-threaded shortcut, or deferred '(optional hardcore mode)' compromise?",
|
|
998
|
+
"hardcore-code-change",
|
|
999
|
+
)
|
|
1000
|
+
if rh_list:
|
|
1001
|
+
locs = ", ".join(f"{r['file']}:{r['line']}({r['rule']})" for r in rh_list[:4])
|
|
1002
|
+
add(
|
|
1003
|
+
"no-reward-hacking",
|
|
1004
|
+
"critical",
|
|
1005
|
+
"integrity",
|
|
1006
|
+
f"Goodhart / Anti-Reward-Hacking violation: diff triggers {len(rh_list)} reward-hack signal(s) ({locs}). Restore full thresholds/tests, replace primitive stand-ins with real upstream outputs + provenance receipts (reward_guard.py), and verify side-by-side against the reference goal.",
|
|
1007
|
+
"reward-hacks",
|
|
1008
|
+
)
|
|
1009
|
+
elif any(re.search(r"(?:gate|eval|bench|score|metric|validat|render|mesh|spark|fidelity)", p, re.I) for p in files):
|
|
1010
|
+
add(
|
|
1011
|
+
"no-reward-hacking",
|
|
1012
|
+
"critical",
|
|
1013
|
+
"integrity",
|
|
1014
|
+
"Goodhart / Anti-Reward-Hacking check: did you keep every test/reference threshold intact (zero --min-iou 0 or .skip), record upstream build provenance (job_id + SHA-256), and confirm via an independent judge that the output fulfills the real goal rather than gaming scalar metrics?",
|
|
1015
|
+
"eval-or-pipeline-touched",
|
|
1016
|
+
)
|
|
1017
|
+
add(
|
|
1018
|
+
"gaps-and-overclaims",
|
|
1019
|
+
"critical",
|
|
1020
|
+
"honesty",
|
|
1021
|
+
"Audit your work and final report for gaps and overclaims: does every claim, count, link, and 'passes/works' statement match an observed file or fresh run on this tree, with every remaining gap or limit named explicitly?",
|
|
1022
|
+
"always-checks",
|
|
1023
|
+
)
|
|
1024
|
+
add(
|
|
1025
|
+
"deletion-test",
|
|
1026
|
+
"advisory",
|
|
1027
|
+
"simplicity",
|
|
1028
|
+
"Apply the deletion test: what newly added wrapper, flag, comment, or prose block can be deleted without losing required behavior?",
|
|
1029
|
+
"always-checks",
|
|
1030
|
+
)
|
|
1031
|
+
return items
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
def is_valid_receipt(receipt_text: str, root: Path | None = None) -> bool:
|
|
1035
|
+
text = receipt_text.strip()
|
|
1036
|
+
if len(text) < 4:
|
|
1037
|
+
return False
|
|
1038
|
+
if CMD_RECEIPT_RE.search(text) or URL_RECEIPT_RE.match(text):
|
|
1039
|
+
return True
|
|
1040
|
+
for raw_path, line_str in FILE_LINE_TOKEN_RE.findall(text):
|
|
1041
|
+
if raw_path.lower() in {"e.g", "i.e", "etc.py"}:
|
|
1042
|
+
continue
|
|
1043
|
+
if root is not None:
|
|
1044
|
+
cand = (root / raw_path).resolve()
|
|
1045
|
+
try:
|
|
1046
|
+
cand.relative_to(root.resolve())
|
|
1047
|
+
except ValueError:
|
|
1048
|
+
continue
|
|
1049
|
+
if cand.is_file():
|
|
1050
|
+
if line_str:
|
|
1051
|
+
line_no = int(line_str)
|
|
1052
|
+
total = _count_file_lines(cand)
|
|
1053
|
+
if 1 <= line_no <= max(1, total):
|
|
1054
|
+
return True
|
|
1055
|
+
else:
|
|
1056
|
+
return True
|
|
1057
|
+
elif line_str and int(line_str) >= 1:
|
|
1058
|
+
return True
|
|
1059
|
+
return False
|
|
1060
|
+
|
|
1061
|
+
|
|
1062
|
+
def _ensure_scratch_gitignore(root: Path) -> None:
|
|
1063
|
+
scratch_dir = ensure_contained(root / ".scratch", root)
|
|
1064
|
+
scratch_dir.mkdir(parents=True, exist_ok=True)
|
|
1065
|
+
gi = scratch_dir / ".gitignore"
|
|
1066
|
+
if not gi.exists():
|
|
1067
|
+
atomic_write_text(gi, "*\n!.gitignore\n", root)
|
|
1068
|
+
|
|
1069
|
+
|
|
1070
|
+
def cmd_check_diff(args: argparse.Namespace) -> int:
|
|
1071
|
+
report = inspect_diff(Path(args.root), base=args.base, staged=args.staged, explicit_files=args.files)
|
|
1072
|
+
if args.json:
|
|
1073
|
+
print(json.dumps(report, indent=2))
|
|
1074
|
+
else:
|
|
1075
|
+
print(
|
|
1076
|
+
f"size={report['measured_size']} files={report['file_count']} "
|
|
1077
|
+
f"lines=+{report['lines_added']}/-{report['lines_deleted']} "
|
|
1078
|
+
f"sensitive={len(report['sensitive_paths'])} "
|
|
1079
|
+
f"cross_family={report['recommend_cross_family_skeptic']}"
|
|
1080
|
+
)
|
|
1081
|
+
for q in report["questions"]:
|
|
1082
|
+
print(f"- [{q['severity']}] {q['id']}: {q['prompt']}")
|
|
1083
|
+
return 0
|
|
1084
|
+
|
|
1085
|
+
|
|
1086
|
+
def cmd_init(args: argparse.Namespace) -> int:
|
|
1087
|
+
if not SLUG_RE.fullmatch(args.slug):
|
|
1088
|
+
raise SystemExit(f"invalid slug {args.slug!r}: use lowercase kebab-case")
|
|
1089
|
+
root = reject_unsafe_root(Path(args.root))
|
|
1090
|
+
_ensure_scratch_gitignore(root)
|
|
1091
|
+
gdir = ensure_contained(root / ".scratch" / "self-grill" / args.slug, root)
|
|
1092
|
+
state_path = gdir / "grill.json"
|
|
1093
|
+
existing_answers: dict[str, dict] = {}
|
|
1094
|
+
if state_path.exists():
|
|
1095
|
+
if args.refresh:
|
|
1096
|
+
old_data = json.loads(state_path.read_text(encoding="utf-8"))
|
|
1097
|
+
for q in old_data.get("questions", []):
|
|
1098
|
+
if q.get("category") in ("plan", "hardcore") and q.get("trigger") == "always-plan" and q.get("status") != "open":
|
|
1099
|
+
existing_answers[q["id"]] = q
|
|
1100
|
+
elif not args.force:
|
|
1101
|
+
raise SystemExit(f"self-grill session already exists at {gdir}; pass --refresh or --force")
|
|
1102
|
+
|
|
1103
|
+
diff_info = inspect_diff(root, base=args.base, staged=args.staged, explicit_files=args.files)
|
|
1104
|
+
questions = build_questions(
|
|
1105
|
+
phase=args.phase,
|
|
1106
|
+
files=diff_info["files"],
|
|
1107
|
+
total_lines=diff_info["total_lines"],
|
|
1108
|
+
file_count=diff_info["file_count"],
|
|
1109
|
+
sensitive_paths=diff_info["sensitive_paths"],
|
|
1110
|
+
code_paths=diff_info["code_paths"],
|
|
1111
|
+
test_paths=diff_info["test_paths"],
|
|
1112
|
+
shell_paths=diff_info["shell_paths"],
|
|
1113
|
+
schema_paths=diff_info["schema_paths"],
|
|
1114
|
+
skill_paths=diff_info["skill_paths"],
|
|
1115
|
+
added_comments=diff_info["added_comments"],
|
|
1116
|
+
workaround_smells=diff_info["workaround_smells"],
|
|
1117
|
+
toy_shortcuts=diff_info["toy_shortcuts"],
|
|
1118
|
+
added_comment_total=diff_info["added_comment_count"],
|
|
1119
|
+
workaround_smell_total=diff_info["workaround_smell_count"],
|
|
1120
|
+
toy_shortcut_total=diff_info["toy_shortcut_count"],
|
|
1121
|
+
backend_perf_findings=diff_info["backend_perf_findings"],
|
|
1122
|
+
proof_paths=diff_info["proof_paths"],
|
|
1123
|
+
proof_escapes=diff_info["proof_escapes"],
|
|
1124
|
+
reward_hacks=diff_info["reward_hacks"],
|
|
1125
|
+
)
|
|
1126
|
+
for q in questions:
|
|
1127
|
+
if q["id"] in existing_answers:
|
|
1128
|
+
prev = existing_answers[q["id"]]
|
|
1129
|
+
q["status"] = prev["status"]
|
|
1130
|
+
q["answer"] = prev["answer"]
|
|
1131
|
+
q["receipt"] = prev["receipt"]
|
|
1132
|
+
|
|
1133
|
+
payload = {
|
|
1134
|
+
"slug": args.slug,
|
|
1135
|
+
"phase": args.phase,
|
|
1136
|
+
"root": str(root),
|
|
1137
|
+
"head_sha": diff_info["head_sha"],
|
|
1138
|
+
"tree_digest": diff_info["tree_digest"],
|
|
1139
|
+
"base": diff_info["base"],
|
|
1140
|
+
"staged": args.staged,
|
|
1141
|
+
"measured_size": diff_info["measured_size"],
|
|
1142
|
+
"file_count": diff_info["file_count"],
|
|
1143
|
+
"total_lines": diff_info["total_lines"],
|
|
1144
|
+
"sensitive_paths": diff_info["sensitive_paths"],
|
|
1145
|
+
"toy_shortcuts": diff_info["toy_shortcuts"],
|
|
1146
|
+
"reward_hacks": diff_info["reward_hacks"],
|
|
1147
|
+
"recommend_cross_family_skeptic": diff_info["recommend_cross_family_skeptic"],
|
|
1148
|
+
"questions": questions,
|
|
1149
|
+
}
|
|
1150
|
+
atomic_write_text(state_path, json.dumps(payload, indent=2) + "\n", root)
|
|
1151
|
+
out = {"dir": str(gdir), "state": str(state_path), **payload}
|
|
1152
|
+
if args.json:
|
|
1153
|
+
print(json.dumps(out, indent=2))
|
|
1154
|
+
else:
|
|
1155
|
+
print(f"initialized {gdir} ({len(questions)} questions, size={payload['measured_size']})")
|
|
1156
|
+
return 0
|
|
1157
|
+
|
|
1158
|
+
|
|
1159
|
+
def _load_state(gdir: Path) -> tuple[Path, Path, dict]:
|
|
1160
|
+
state_path = gdir / "grill.json"
|
|
1161
|
+
if not state_path.is_file():
|
|
1162
|
+
raise SystemExit(f"missing grill.json in {gdir}")
|
|
1163
|
+
data = json.loads(state_path.read_text(encoding="utf-8"))
|
|
1164
|
+
root = reject_unsafe_root(Path(data["root"]))
|
|
1165
|
+
ensure_contained(state_path, root)
|
|
1166
|
+
return root, state_path, data
|
|
1167
|
+
|
|
1168
|
+
|
|
1169
|
+
def cmd_answer(args: argparse.Namespace) -> int:
|
|
1170
|
+
gdir = Path(args.dir)
|
|
1171
|
+
root, state_path, data = _load_state(gdir)
|
|
1172
|
+
answer_text = args.answer.strip()
|
|
1173
|
+
receipt_text = (args.receipt or "").strip()
|
|
1174
|
+
if not answer_text:
|
|
1175
|
+
raise SystemExit("--answer cannot be empty")
|
|
1176
|
+
if args.status == "proven":
|
|
1177
|
+
if not receipt_text or not is_valid_receipt(receipt_text, root):
|
|
1178
|
+
raise SystemExit(
|
|
1179
|
+
"status 'proven' requires a verified --receipt (existing repo file:line, 'cmd:<cmd> -> exit 0', or URL)"
|
|
1180
|
+
)
|
|
1181
|
+
if args.status == "na" and len(answer_text) < 8:
|
|
1182
|
+
raise SystemExit("status 'na' requires a concrete reason in --answer")
|
|
1183
|
+
|
|
1184
|
+
matched = None
|
|
1185
|
+
for q in data["questions"]:
|
|
1186
|
+
if q["id"] == args.id:
|
|
1187
|
+
q["status"] = args.status
|
|
1188
|
+
q["answer"] = answer_text
|
|
1189
|
+
q["receipt"] = receipt_text
|
|
1190
|
+
matched = q
|
|
1191
|
+
break
|
|
1192
|
+
if matched is None:
|
|
1193
|
+
raise SystemExit(f"unknown question id {args.id!r}")
|
|
1194
|
+
|
|
1195
|
+
atomic_write_text(state_path, json.dumps(data, indent=2) + "\n", root)
|
|
1196
|
+
if args.json:
|
|
1197
|
+
print(json.dumps(matched, indent=2))
|
|
1198
|
+
else:
|
|
1199
|
+
print(f"recorded {matched['id']} -> {matched['status']}")
|
|
1200
|
+
return 0
|
|
1201
|
+
|
|
1202
|
+
|
|
1203
|
+
def evaluate_verdict(data: dict, root: Path | None = None, allow_stale: bool = False) -> dict:
|
|
1204
|
+
blocked = [q["id"] for q in data["questions"] if q["status"] == "blocked"]
|
|
1205
|
+
failed = [q["id"] for q in data["questions"] if q["status"] == "failed"]
|
|
1206
|
+
open_critical = [
|
|
1207
|
+
q["id"]
|
|
1208
|
+
for q in data["questions"]
|
|
1209
|
+
if q["severity"] == "critical" and q["status"] not in ("proven", "na")
|
|
1210
|
+
]
|
|
1211
|
+
missing_receipts = [
|
|
1212
|
+
q["id"]
|
|
1213
|
+
for q in data["questions"]
|
|
1214
|
+
if q["status"] == "proven" and not is_valid_receipt(q.get("receipt", ""), root)
|
|
1215
|
+
]
|
|
1216
|
+
open_advisory = [
|
|
1217
|
+
q["id"]
|
|
1218
|
+
for q in data["questions"]
|
|
1219
|
+
if q["severity"] != "critical" and q["status"] == "open"
|
|
1220
|
+
]
|
|
1221
|
+
stale_tree = False
|
|
1222
|
+
recorded_digest = data.get("tree_digest", "")
|
|
1223
|
+
live_digest = ""
|
|
1224
|
+
if root is not None and recorded_digest and data.get("phase") in ("checks", "both") and not allow_stale:
|
|
1225
|
+
if _is_git_root_or_worktree(root):
|
|
1226
|
+
live_digest = compute_tree_digest(root)
|
|
1227
|
+
if live_digest != recorded_digest:
|
|
1228
|
+
stale_tree = True
|
|
1229
|
+
|
|
1230
|
+
if blocked:
|
|
1231
|
+
verdict = "BLOCKED"
|
|
1232
|
+
elif failed or open_critical or missing_receipts or stale_tree:
|
|
1233
|
+
verdict = "NEEDS_WORK"
|
|
1234
|
+
else:
|
|
1235
|
+
verdict = "PASS"
|
|
1236
|
+
|
|
1237
|
+
return {
|
|
1238
|
+
"verdict": verdict,
|
|
1239
|
+
"slug": data["slug"],
|
|
1240
|
+
"phase": data["phase"],
|
|
1241
|
+
"head_sha": data.get("head_sha"),
|
|
1242
|
+
"tree_digest": recorded_digest,
|
|
1243
|
+
"live_tree_digest": live_digest or recorded_digest,
|
|
1244
|
+
"stale_tree": stale_tree,
|
|
1245
|
+
"measured_size": data.get("measured_size"),
|
|
1246
|
+
"total_questions": len(data["questions"]),
|
|
1247
|
+
"open_critical": open_critical,
|
|
1248
|
+
"failed": failed,
|
|
1249
|
+
"blocked": blocked,
|
|
1250
|
+
"missing_receipts": missing_receipts,
|
|
1251
|
+
"open_advisory": open_advisory,
|
|
1252
|
+
"recommend_cross_family_skeptic": data.get("recommend_cross_family_skeptic", False),
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
|
|
1256
|
+
def cmd_verdict(args: argparse.Namespace) -> int:
|
|
1257
|
+
root, _, data = _load_state(Path(args.dir))
|
|
1258
|
+
summary = evaluate_verdict(data, root=root, allow_stale=args.allow_stale)
|
|
1259
|
+
if summary["verdict"] == "PASS":
|
|
1260
|
+
latest_path = ensure_contained(root / ".scratch" / "self-grill" / "latest-pass.json", root)
|
|
1261
|
+
atomic_write_text(
|
|
1262
|
+
latest_path,
|
|
1263
|
+
json.dumps(
|
|
1264
|
+
{
|
|
1265
|
+
"status": "PASS",
|
|
1266
|
+
"slug": summary["slug"],
|
|
1267
|
+
"head_sha": summary["head_sha"],
|
|
1268
|
+
"tree_digest": summary["live_tree_digest"],
|
|
1269
|
+
},
|
|
1270
|
+
indent=2,
|
|
1271
|
+
)
|
|
1272
|
+
+ "\n",
|
|
1273
|
+
root,
|
|
1274
|
+
)
|
|
1275
|
+
if args.json:
|
|
1276
|
+
print(json.dumps(summary, indent=2))
|
|
1277
|
+
else:
|
|
1278
|
+
print(
|
|
1279
|
+
f"self-grill: {summary['verdict']} (phase={summary['phase']}, "
|
|
1280
|
+
f"open_critical={len(summary['open_critical'])}, failed={len(summary['failed'])}, "
|
|
1281
|
+
f"blocked={len(summary['blocked'])}, stale_tree={summary['stale_tree']})"
|
|
1282
|
+
)
|
|
1283
|
+
if args.strict and summary["verdict"] != "PASS":
|
|
1284
|
+
return 2
|
|
1285
|
+
return 0
|
|
1286
|
+
|
|
1287
|
+
|
|
1288
|
+
def build_prosecutor_bundle(
|
|
1289
|
+
root: Path,
|
|
1290
|
+
slug: str = "prosecutor",
|
|
1291
|
+
claims_text: str = "",
|
|
1292
|
+
confession_text: str = "",
|
|
1293
|
+
base: str | None = None,
|
|
1294
|
+
explicit_files: list[str] | None = None,
|
|
1295
|
+
) -> dict:
|
|
1296
|
+
safe_root = reject_unsafe_root(root)
|
|
1297
|
+
if not SLUG_RE.fullmatch(slug):
|
|
1298
|
+
raise SystemExit(f"invalid slug {slug!r}: use lowercase kebab-case")
|
|
1299
|
+
_ensure_scratch_gitignore(safe_root)
|
|
1300
|
+
diff_info = inspect_diff(safe_root, base=base, explicit_files=explicit_files)
|
|
1301
|
+
out_dir = ensure_contained(safe_root / ".scratch" / "self-grill" / slug, safe_root)
|
|
1302
|
+
out_dir.mkdir(parents=True, exist_ok=True)
|
|
1303
|
+
|
|
1304
|
+
claim_warnings = [m.group(0) for m in CLAIM_OVERCLAIM_RE.finditer(claims_text)] if claims_text else []
|
|
1305
|
+
sections: list[str] = [
|
|
1306
|
+
"# Adaptive Hotspot Prosecutor Bundle",
|
|
1307
|
+
f"- Project root: `{safe_root}`",
|
|
1308
|
+
f"- Measured diff size: `{diff_info['measured_size']}` ({diff_info['file_count']} files, +{diff_info['lines_added']}/-{diff_info['lines_deleted']} lines)",
|
|
1309
|
+
f"- Tree digest: `{diff_info['tree_digest']}`",
|
|
1310
|
+
f"- Sensitive paths: `{diff_info['sensitive_paths']}`",
|
|
1311
|
+
f"- Mechanical flags: comments={diff_info['added_comment_count']}, workaround_smells={diff_info['workaround_smell_count']}, toy_shortcuts={diff_info['toy_shortcut_count']}, reward_hacks={diff_info['reward_hack_count']}",
|
|
1312
|
+
]
|
|
1313
|
+
if claims_text.strip():
|
|
1314
|
+
sections.append("\n## Draft Claims Under Audit\n" + claims_text.strip())
|
|
1315
|
+
if claim_warnings:
|
|
1316
|
+
sections.append(f"\nMechanical universal-claim triggers to verify strictly: {claim_warnings}")
|
|
1317
|
+
if confession_text.strip():
|
|
1318
|
+
sections.append("\n## Part B1 — Builder Confession (Known Shortcuts & Risks)\n" + confession_text.strip())
|
|
1319
|
+
|
|
1320
|
+
sensitive_set = set(diff_info.get("sensitive_paths") or [])
|
|
1321
|
+
flagged_set = {
|
|
1322
|
+
x["path"]
|
|
1323
|
+
for bucket in ("workaround_smells", "toy_shortcuts", "added_comments")
|
|
1324
|
+
for x in (diff_info.get(bucket) or [])
|
|
1325
|
+
if "path" in x
|
|
1326
|
+
} | {x["file"] for x in (diff_info.get("backend_perf_findings") or []) if "file" in x} | {
|
|
1327
|
+
x["file"] for x in (diff_info.get("proof_escapes") or []) if "file" in x
|
|
1328
|
+
} | {
|
|
1329
|
+
x["file"] for x in (diff_info.get("reward_hacks") or []) if "file" in x
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
def _bundle_priority(rel: str) -> tuple[int, int, int, int, str]:
|
|
1333
|
+
ext = Path(rel).suffix.lower()
|
|
1334
|
+
is_code = int((ext in CODE_EXTS or ext in PROOF_EXTS) and not TEST_PATH_RE.search(rel))
|
|
1335
|
+
is_sens = int(rel in sensitive_set)
|
|
1336
|
+
is_flag = int(rel in flagged_set)
|
|
1337
|
+
line_cnt = _count_file_lines(safe_root / rel)
|
|
1338
|
+
return (-is_sens, -is_flag, -is_code, -line_cnt, rel)
|
|
1339
|
+
|
|
1340
|
+
ranked_files = sorted(diff_info["files"], key=_bundle_priority)
|
|
1341
|
+
selected_files = ranked_files[:25]
|
|
1342
|
+
omitted_files = ranked_files[25:]
|
|
1343
|
+
if omitted_files:
|
|
1344
|
+
sections.append(
|
|
1345
|
+
f"- Additional changed files outside top-25 bundle ({len(omitted_files)} — read directly if relevant): `{omitted_files[:30]}`"
|
|
1346
|
+
)
|
|
1347
|
+
|
|
1348
|
+
for rel in selected_files:
|
|
1349
|
+
target = safe_root / rel
|
|
1350
|
+
if not target.is_file() or target.is_symlink():
|
|
1351
|
+
continue
|
|
1352
|
+
try:
|
|
1353
|
+
lines = target.read_text(encoding="utf-8", errors="replace").splitlines()
|
|
1354
|
+
except OSError:
|
|
1355
|
+
continue
|
|
1356
|
+
max_whole_lines = 900 if Path(rel).suffix.lower() in PROOF_EXTS else 450
|
|
1357
|
+
if len(lines) <= max_whole_lines:
|
|
1358
|
+
numbered = "\n".join(f"{idx}: {line}" for idx, line in enumerate(lines, 1))
|
|
1359
|
+
sections.append(f"\n==================== FILE: {rel} ({len(lines)} lines) ====================\n{numbered}")
|
|
1360
|
+
else:
|
|
1361
|
+
patch_list = _collect_diff_patches(safe_root, [rel], diff_info["base"], False, diff_info["head_sha"]) if diff_info["in_git"] else []
|
|
1362
|
+
patch_preview = "\n".join(patch_list)[:18000].strip()
|
|
1363
|
+
if patch_preview:
|
|
1364
|
+
sections.append(
|
|
1365
|
+
f"\n==================== FILE (HUNK WINDOW, {len(lines)} total lines — read full ranges if needed): {rel} ====================\n{patch_preview}"
|
|
1366
|
+
)
|
|
1367
|
+
else:
|
|
1368
|
+
head_part = "\n".join(f"{idx}: {line}" for idx, line in enumerate(lines[:220], 1))
|
|
1369
|
+
tail_start = max(221, len(lines) - 119)
|
|
1370
|
+
tail_part = "\n".join(f"{idx}: {line}" for idx, line in enumerate(lines[tail_start - 1:], tail_start))
|
|
1371
|
+
window_preview = f"{head_part}\n... [{tail_start - 221} lines elided; read {rel}:221-{tail_start - 1} on disk] ...\n{tail_part}"
|
|
1372
|
+
sections.append(
|
|
1373
|
+
f"\n==================== FILE (UNTRACKED WINDOW, {len(lines)} total lines — read elided middle if needed): {rel} ====================\n{window_preview}"
|
|
1374
|
+
)
|
|
1375
|
+
prosecutor_prompt = (
|
|
1376
|
+
f"Read ONLY `{out_dir / 'prosecutor-bundle.md'}` first (read additional ranges in `{safe_root}` only for `[HUNK WINDOW]` files).\n"
|
|
1377
|
+
"Run the 3-step Adaptive Hotspot Prosecutor + Independent Sieve in a SINGLE pass:\n"
|
|
1378
|
+
"1. Adaptive Hotspot Map (5 lines): weight ~75% of probes on the highest-complexity code/regex/state/concurrency/security modules in the bundle and ~25% on Draft Claims & Docs vs literal code.\n"
|
|
1379
|
+
"2. Exhaustive Divergent Hunt: push past surface checks to brainstorm 50+ concrete candidate bugs, Goodhart reward hacks (weakened thresholds/tests, skipped references, procedural box/cone stand-ins, unverified provenance), false positives, false negatives, edge cases, and overclaims (do NOT filter early).\n"
|
|
1380
|
+
"3. Independent Prosecutor Sieve: keep ONLY 100% code-provable P0/P1/P2 Gaps, Reward Hacks, and text-vs-code Overclaims with exact `<file>:<line>`, concrete trigger input, and root-cause fix. Drop hypothetical '$90 trillion' filler."
|
|
1381
|
+
)
|
|
1382
|
+
bundle_path = out_dir / "prosecutor-bundle.md"
|
|
1383
|
+
atomic_write_text(bundle_path, "\n".join(sections) + "\n", safe_root)
|
|
1384
|
+
return {
|
|
1385
|
+
"bundle_path": str(bundle_path),
|
|
1386
|
+
"measured_size": diff_info["measured_size"],
|
|
1387
|
+
"file_count": diff_info["file_count"],
|
|
1388
|
+
"tree_digest": diff_info["tree_digest"],
|
|
1389
|
+
"claim_warnings": claim_warnings,
|
|
1390
|
+
"prosecutor_prompt": prosecutor_prompt,
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
|
|
1394
|
+
def cmd_bundle(args: argparse.Namespace) -> int:
|
|
1395
|
+
claims = sys.stdin.read() if args.claims_stdin else (Path(args.claims_file).read_text(encoding="utf-8") if args.claims_file else "")
|
|
1396
|
+
res = build_prosecutor_bundle(
|
|
1397
|
+
Path(args.root),
|
|
1398
|
+
slug=args.slug,
|
|
1399
|
+
claims_text=claims,
|
|
1400
|
+
confession_text=args.confession or "",
|
|
1401
|
+
base=args.base,
|
|
1402
|
+
explicit_files=args.files,
|
|
1403
|
+
)
|
|
1404
|
+
if args.json:
|
|
1405
|
+
print(json.dumps(res, indent=2))
|
|
1406
|
+
else:
|
|
1407
|
+
print(res["bundle_path"])
|
|
1408
|
+
print(res["prosecutor_prompt"])
|
|
1409
|
+
return 0
|
|
1410
|
+
|
|
1411
|
+
|
|
1412
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
1413
|
+
parser = argparse.ArgumentParser(description="Deterministic diff-aware self-grill and Adaptive Prosecutor helper.")
|
|
1414
|
+
sub = parser.add_subparsers(dest="cmd", required=True)
|
|
1415
|
+
|
|
1416
|
+
p_diff = sub.add_parser("check-diff", help="Inspect git diff and generate targeted self-grill questions.")
|
|
1417
|
+
p_diff.add_argument("--root", required=True)
|
|
1418
|
+
p_diff.add_argument("--base", default=None)
|
|
1419
|
+
p_diff.add_argument("--staged", action="store_true")
|
|
1420
|
+
p_diff.add_argument("--files", nargs="*", default=None)
|
|
1421
|
+
p_diff.add_argument("--json", action="store_true")
|
|
1422
|
+
p_diff.set_defaults(func=cmd_check_diff)
|
|
1423
|
+
|
|
1424
|
+
p_init = sub.add_parser("init", help="Initialize or refresh a contained self-grill ledger under .scratch/self-grill/<slug>.")
|
|
1425
|
+
p_init.add_argument("--root", required=True)
|
|
1426
|
+
p_init.add_argument("--slug", required=True)
|
|
1427
|
+
p_init.add_argument("--phase", choices=("plan", "checks", "both"), default="checks")
|
|
1428
|
+
p_init.add_argument("--base", default=None)
|
|
1429
|
+
p_init.add_argument("--staged", action="store_true")
|
|
1430
|
+
p_init.add_argument("--files", nargs="*", default=None)
|
|
1431
|
+
p_init.add_argument("--force", action="store_true")
|
|
1432
|
+
p_init.add_argument("--refresh", action="store_true")
|
|
1433
|
+
p_init.add_argument("--json", action="store_true")
|
|
1434
|
+
p_init.set_defaults(func=cmd_init)
|
|
1435
|
+
|
|
1436
|
+
p_ans = sub.add_parser("answer", help="Record an evidence-backed answer for a self-grill question.")
|
|
1437
|
+
p_ans.add_argument("--dir", required=True)
|
|
1438
|
+
p_ans.add_argument("--id", required=True)
|
|
1439
|
+
p_ans.add_argument("--status", choices=("proven", "na", "failed", "blocked"), required=True)
|
|
1440
|
+
p_ans.add_argument("--answer", required=True)
|
|
1441
|
+
p_ans.add_argument("--receipt", default="")
|
|
1442
|
+
p_ans.add_argument("--json", action="store_true")
|
|
1443
|
+
p_ans.set_defaults(func=cmd_answer)
|
|
1444
|
+
|
|
1445
|
+
p_ver = sub.add_parser("verdict", help="Compute PASS/NEEDS_WORK/BLOCKED gate verdict from recorded receipts.")
|
|
1446
|
+
p_ver.add_argument("--dir", required=True)
|
|
1447
|
+
p_ver.add_argument("--strict", action="store_true")
|
|
1448
|
+
p_ver.add_argument("--allow-stale", action="store_true")
|
|
1449
|
+
p_ver.add_argument("--json", action="store_true")
|
|
1450
|
+
p_ver.set_defaults(func=cmd_verdict)
|
|
1451
|
+
|
|
1452
|
+
p_bun = sub.add_parser("bundle", help="Pack a single-file Adaptive Hotspot Prosecutor bundle on disk.")
|
|
1453
|
+
p_bun.add_argument("--root", required=True)
|
|
1454
|
+
p_bun.add_argument("--slug", default="prosecutor")
|
|
1455
|
+
p_bun.add_argument("--base", default=None)
|
|
1456
|
+
p_bun.add_argument("--files", nargs="*", default=None)
|
|
1457
|
+
p_bun.add_argument("--claims-stdin", action="store_true")
|
|
1458
|
+
p_bun.add_argument("--claims-file", default=None)
|
|
1459
|
+
p_bun.add_argument("--confession", default="")
|
|
1460
|
+
p_bun.add_argument("--json", action="store_true")
|
|
1461
|
+
p_bun.set_defaults(func=cmd_bundle)
|
|
1462
|
+
|
|
1463
|
+
return parser
|
|
1464
|
+
|
|
1465
|
+
|
|
1466
|
+
def main(argv: list[str] | None = None) -> int:
|
|
1467
|
+
parser = build_parser()
|
|
1468
|
+
args = parser.parse_args(argv)
|
|
1469
|
+
return args.func(args)
|
|
1470
|
+
|
|
1471
|
+
|
|
1472
|
+
if __name__ == "__main__":
|
|
1473
|
+
raise SystemExit(main())
|