deepmodebot 0.9.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +20 -0
- package/.claude-plugin/marketplace.json +2 -2
- package/.omp-plugin/marketplace.json +2 -2
- package/README.md +38 -5
- package/bin/deepmodebot.mjs +257 -4
- package/lib/clients.mjs +50 -3
- package/lib/tree.mjs +64 -10
- package/native/dmb-gate/Cargo.toml +13 -0
- package/native/dmb-gate/src/agents.rs +110 -0
- package/native/dmb-gate/src/ci.rs +1032 -0
- package/native/dmb-gate/src/cleanup.rs +198 -0
- package/native/dmb-gate/src/gap.rs +1376 -0
- package/native/dmb-gate/src/guard.rs +135 -0
- package/native/dmb-gate/src/main.rs +535 -0
- package/native/dmb-gate/src/map.rs +173 -0
- package/native/dmb-gate/src/perf.rs +347 -0
- package/native/dmb-gate/src/reward.rs +2867 -0
- package/native/dmb-gate/src/sim.rs +969 -0
- package/native/dmb-gate/src/skill_check.rs +171 -0
- package/native/dmb-gate/src/slop.rs +2004 -0
- package/native/dmb-gate/src/ui.rs +842 -0
- package/native/dmb-gate/src/util.rs +260 -0
- package/native/dmb-net/go.mod +3 -0
- package/native/dmb-net/main.go +624 -0
- package/native/dmb-net/main_test.go +122 -0
- package/package.json +12 -2
- package/plugins/deepmodebot/.antigravity-plugin/plugin.json +1 -1
- package/plugins/deepmodebot/.antigravity-plugin/skills/deep/SKILL.md +5 -5
- package/plugins/deepmodebot/.antigravity-plugin/skills/pr-thread/SKILL.md +1 -1
- package/plugins/deepmodebot/.antigravity-plugin/skills/review-pr/SKILL.md +2 -2
- package/plugins/deepmodebot/.antigravity-plugin/skills/suggest/SKILL.md +13 -0
- package/plugins/deepmodebot/.antigravity-plugin/skills/tournament/SKILL.md +2 -2
- package/plugins/deepmodebot/.claude-plugin/plugin.json +1 -1
- package/plugins/deepmodebot/.codex-plugin/plugin.json +46 -0
- package/plugins/deepmodebot/agents/comment-sicko.md +29 -0
- package/plugins/deepmodebot/agents/researcher.md +29 -0
- package/plugins/deepmodebot/agents/reviewer.md +29 -0
- package/plugins/deepmodebot/agents/scout.md +28 -0
- package/plugins/deepmodebot/agents/security-reviewer.md +27 -0
- package/plugins/deepmodebot/commands/deep.md +7 -6
- package/plugins/deepmodebot/commands/research.md +8 -0
- package/plugins/deepmodebot/commands/suggest.md +10 -0
- package/plugins/deepmodebot/commands/tournament.md +2 -2
- package/plugins/deepmodebot/hooks/hooks.json +12 -2
- package/plugins/deepmodebot/hooks.json +1 -1
- package/plugins/deepmodebot/scripts/antigravity-guard.mjs +862 -26
- package/plugins/deepmodebot/scripts/omp-mcp-server.mjs +179 -47
- package/plugins/deepmodebot/skills/agent-harnesses/SKILL.md +4 -6
- package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/check_antigravity.py +3 -0
- package/plugins/deepmodebot/skills/agent-harnesses/references/ai-native-tooling.md +4 -0
- package/plugins/deepmodebot/skills/agent-harnesses/references/ai-sdk-selection.md +3 -1
- package/plugins/deepmodebot/skills/agent-harnesses/references/antigravity.md +3 -3
- package/plugins/deepmodebot/skills/agent-harnesses/references/delegation-efficiency.md +12 -2
- package/plugins/deepmodebot/skills/agent-harnesses/references/protocols.md +11 -3
- package/plugins/deepmodebot/skills/app-automation-relay/SKILL.md +17 -0
- package/plugins/deepmodebot/skills/app-automation-relay/assets/relay_server.ts +364 -0
- package/plugins/deepmodebot/skills/app-automation-relay/references/adapter-cookbook.md +15 -0
- package/plugins/deepmodebot/skills/app-automation-relay/references/wire-protocol.md +23 -0
- package/plugins/deepmodebot/skills/cloud-devsecops/SKILL.md +4 -3
- package/plugins/deepmodebot/skills/cloud-devsecops/references/cloudflare-edge.md +43 -0
- package/plugins/deepmodebot/skills/cloud-devsecops/references/local-emulators.md +15 -2
- package/plugins/deepmodebot/skills/contribute/SKILL.md +3 -35
- package/plugins/deepmodebot/skills/create-formal-verification-skill/LICENSE +21 -0
- package/plugins/deepmodebot/skills/create-formal-verification-skill/NOTICE.md +16 -0
- package/plugins/deepmodebot/skills/create-formal-verification-skill/SKILL.md +71 -0
- package/plugins/deepmodebot/skills/create-verification-skill/SKILL.md +2 -2
- package/plugins/deepmodebot/skills/deep-learning/LICENSE +21 -0
- package/plugins/deepmodebot/skills/deep-learning/SKILL.md +33 -0
- package/plugins/deepmodebot/skills/deep-learning/references/neural-architectures.md +43 -0
- package/plugins/deepmodebot/skills/deep-learning/references/papers-and-repos.md +128 -0
- package/plugins/deepmodebot/skills/deep-learning/references/reinforcement-learning.md +57 -0
- package/plugins/deepmodebot/skills/deep-learning/references/training-optimization.md +40 -0
- package/plugins/deepmodebot/skills/deep-learning/references/weight-space-programming.md +76 -0
- package/plugins/deepmodebot/skills/deep-learning/scripts/hf_passes.py +166 -0
- package/plugins/deepmodebot/skills/deep-learning/scripts/wsp.py +493 -0
- package/plugins/deepmodebot/skills/deep-stack/SKILL.md +1 -1
- package/plugins/deepmodebot/skills/deep-stack/references/design-workflow.md +46 -92
- package/plugins/deepmodebot/skills/deep-stack/references/isolate.md +1 -0
- package/plugins/deepmodebot/skills/deep-stack/references/prove.md +6 -0
- package/plugins/deepmodebot/skills/deep-stack/references/stack.md +11 -1
- package/plugins/deepmodebot/skills/deepmodebot/SKILL.md +83 -146
- package/plugins/deepmodebot/skills/deepmodebot/assets/agents-md/agents_md.py +67 -24
- package/plugins/deepmodebot/skills/deepmodebot/assets/autoroute/autoroute.py +1026 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/cleanup/self_cleanup.py +305 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/claude-guard.sh +4 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/claude_guard.py +736 -6
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/holdout_guard_cases.json +272 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/omp-contain.ts +861 -9
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/design.py +3 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/record.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/rehearsal_gate.py +536 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/review.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/f2p-gate/f2p_gate.py +547 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/formal-verification/verify_proof.py +638 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/gap-audit/gap_audit.py +1047 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/gen-ui/gen_ui.py +1782 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard-patterns.txt +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard.sh +55 -7
- package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard.ts +55 -5
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/ghapp.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/install.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/local-ci/local_ci.py +796 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/local-ci/slop_gate.py +1049 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/loop.py +748 -46
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/plan.py +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/windows_job.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/memory/project_memory.py +928 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/mutation/mutation_gate.py +798 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/bench_harness.py +48 -21
- package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/perf_audit.py +339 -5
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/diff_coverage.py +96 -6
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/pr_agent_local.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/arena.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/show_thread.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/prompt-tools/prompt_tools.py +1239 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/quota-guard/quota_guard.py +424 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/repo-references.json +477 -1
- package/plugins/deepmodebot/skills/deepmodebot/assets/reward-guard/reward_guard.py +3447 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rule-paths.json +100 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rule_ledger.py +1671 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rules_watch.py +436 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_enrich.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_meta.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_transcript_relay.js +13 -10
- package/plugins/deepmodebot/skills/deepmodebot/assets/security-audit/static_sec_audit.py +275 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/self-grill/self_grill.py +2049 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/setup/model_setup.py +329 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/setup/project_setup.py +348 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/sim/sim.py +856 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/tournament/tournament.py +304 -18
- package/plugins/deepmodebot/skills/deepmodebot/assets/worker-gate/worker_gate.py +237 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/workspace-map/workspace_map.py +121 -78
- package/plugins/deepmodebot/skills/deepmodebot/references/README.md +14 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/catalog.md +17 -11
- package/plugins/deepmodebot/skills/deepmodebot/references/contain.md +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/delegation.md +18 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/flows.md +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/full-scope.md +9 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/authoring-a-skill.md +1 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/babysit.md +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/end-to-end.md +12 -9
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/feature.md +7 -3
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/hillclimb.md +3 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/investigation.md +4 -4
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/opening-a-pr.md +1 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/perf-issue.md +13 -10
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/refactoring.md +6 -6
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/reference-rebuild.md +1 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/run-a-goal.md +3 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/self-authoring.md +1 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/setup.md +1 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/visual-parity.md +1 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/work-a-queue.md +4 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/principles/hardcore-mode.md +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/principles/no-reward-hacking.md +8 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/principles/test-behavior-not-implementation.md +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/principles/type-system-discipline.md +2 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/rule-approval.md +71 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/architect.md +10 -24
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/architecture-review.md +5 -4
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/arena.md +3 -3
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/autoroute.md +50 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/blast-radius.md +1 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/catchup-video.md +13 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/correct.md +9 -7
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/course.md +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/devex-review.md +13 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/expand-contract.md +13 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/formal-verification.md +33 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/gen-ui.md +60 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/grill.md +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/how.md +7 -18
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/inner-loop.md +12 -8
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/model-setup.md +14 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/modernize-pr.md +15 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/mutation-testing.md +35 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/no-comments.md +5 -5
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/panel.md +9 -5
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pr-conversation.md +1 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pr-review.md +8 -5
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pre-commit.md +1 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/prior-art.md +33 -38
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/product-lens.md +12 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/prompt-upgrade.md +30 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/recall.md +1 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/reframe.md +18 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/release-and-canary.md +10 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/research.md +62 -89
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/security-audit.md +5 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/self-grill.md +54 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/sharpen.md +3 -3
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/show-me-your-work.md +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/sim.md +41 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/sme-review.md +3 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/suggest.md +24 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/swarm.md +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/tdd.md +12 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/teach.md +2 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/tournament.md +30 -18
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/variant-analysis.md +11 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/video-forensics.md +46 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/visual-e2e.md +10 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/webhook-ui.md +11 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/writing-for-agents.md +6 -0
- package/plugins/deepmodebot/skills/deepmodebot/scripts/check_skill.py +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/scripts/trending.py +141 -18
- package/plugins/deepmodebot/skills/deepmodebot/worker.md +28 -0
- package/plugins/deepmodebot/skills/domain-rules/SKILL.md +13 -119
- package/plugins/deepmodebot/skills/domain-rules/references/backend-system-design.md +19 -1
- package/plugins/deepmodebot/skills/domain-rules/references/engineering-practice.md +7 -0
- package/plugins/deepmodebot/skills/domain-rules/references/language-ecosystems.md +11 -0
- package/plugins/deepmodebot/skills/domain-rules/references/sources.md +108 -0
- package/plugins/deepmodebot/skills/frontend-ui/SKILL.md +30 -131
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/canvas.css +42 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/editorial.css +39 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/layouts.css +95 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/swiss.css +40 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/tactile.css +41 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/workbench.css +50 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/mobbin-animations.md +49 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/mobbin-shipped-apps.md +46 -24
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/motion-clips.md +27 -258
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/motion-graphics.md +26 -51
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/pinterest-animations.md +22 -195
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/00-art-direction.md +39 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/01-workflow.md +27 -24
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/02-review-rubric.md +23 -17
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/03-ai-tells.md +22 -45
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/04-components.md +11 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/04a-agent-ui.md +32 -152
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/05-motion.md +36 -91
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/05a-motion-graphics.md +14 -120
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06-typography-layout.md +11 -10
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06a-color.md +9 -9
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06b-media-icons-charts.md +19 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06c-product-shots-craft.md +42 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/07-copy.md +5 -6
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/08-quality-floor.md +28 -56
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/09-steering-agents.md +9 -7
- package/plugins/deepmodebot/skills/frontend-ui/scripts/motion_diff.py +259 -0
- package/plugins/deepmodebot/skills/frontend-ui/scripts/ui_audit.py +496 -0
- package/plugins/deepmodebot/skills/maintain-formal-verification-skill/LICENSE +21 -0
- package/plugins/deepmodebot/skills/maintain-formal-verification-skill/NOTICE.md +16 -0
- package/plugins/deepmodebot/skills/maintain-formal-verification-skill/SKILL.md +68 -0
- package/plugins/deepmodebot/skills/maintain-verification-skill/SKILL.md +1 -1
- package/plugins/deepmodebot/skills/office-documents/SKILL.md +24 -0
- package/plugins/deepmodebot/skills/office-documents/references/documents-docx-pdf.md +15 -0
- package/plugins/deepmodebot/skills/office-documents/references/presentations-pptx.md +15 -0
- package/plugins/deepmodebot/skills/office-documents/references/spreadsheets-xlsx.md +15 -0
- package/plugins/deepmodebot/skills/office-documents/scripts/doc_audit.py +230 -0
- package/plugins/deepmodebot/skills/project-brief/SKILL.md +2 -19
- package/plugins/deepmodebot/skills/project-brief/assets/pr-overlap.py +4 -0
- package/plugins/deepmodebot/skills/project-brief/assets/sync-roadmap.py +4 -0
- package/plugins/deepmodebot/skills/project-brief/references/claim-contract.md +55 -0
- package/plugins/deepmodebot/skills/research/SKILL.md +18 -0
- package/plugins/deepmodebot/skills/secrets-and-auth/SKILL.md +1 -1
- package/plugins/deepmodebot/skills/seo-and-geo/SKILL.md +29 -0
- package/plugins/deepmodebot/skills/seo-and-geo/references/geo-and-agentic-web.md +30 -0
- package/plugins/deepmodebot/skills/seo-and-geo/references/technical-and-schema.md +25 -0
- package/plugins/deepmodebot/skills/seo-and-geo/scripts/seo_audit.py +282 -0
- package/plugins/deepmodebot/skills/software-architecture/SKILL.md +2 -2
- package/plugins/deepmodebot/skills/software-architecture/references/backend-infrastructure.md +5 -0
- package/plugins/deepmodebot/skills/software-architecture/references/monorepos.md +1 -0
- package/plugins/deepmodebot/skills/statechart/LICENSE +21 -0
- package/plugins/deepmodebot/skills/statechart/NOTICE.md +21 -0
- package/plugins/deepmodebot/skills/statechart/SKILL.md +106 -0
- package/plugins/deepmodebot/skills/statechart/references/render.md +93 -0
- package/plugins/deepmodebot/skills/statechart/references/tooling.md +78 -0
- package/plugins/deepmodebot/skills/statechart/scripts/backends/cfg.ts +33 -0
- package/plugins/deepmodebot/skills/statechart/scripts/backends/mermaid.ts +249 -0
- package/plugins/deepmodebot/skills/statechart/scripts/backends/plain-text.ts +72 -0
- package/plugins/deepmodebot/skills/statechart/scripts/backends/report.ts +177 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/config.ts +276 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/dot.ts +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/marks.ts +93 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/messages.ts +52 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/spec.ts +114 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/trace.ts +24 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/value.ts +166 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/verdict.ts +40 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/view.ts +119 -0
- package/plugins/deepmodebot/skills/statechart/scripts/ir.ts +547 -0
- package/plugins/deepmodebot/skills/statechart/scripts/janitor.ts +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/kill.ts +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/package.json +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/annotate.ts +128 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/label.ts +269 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/lift.ts +85 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/loop-check.ts +68 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/paths.ts +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/reach.ts +135 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/region-check.ts +97 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/regions.ts +295 -0
- package/plugins/deepmodebot/skills/statechart/scripts/pipeline.ts +76 -0
- package/plugins/deepmodebot/skills/statechart/scripts/run.ts +500 -0
- package/plugins/deepmodebot/skills/statechart/scripts/statechart +29 -0
- package/plugins/deepmodebot/skills/statechart/scripts/statechart.ts +165 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/ConfigOracle.java +63 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/chart.test.ts +1253 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Braces.mmd +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Escapes.mmd +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Phases.mmd +29 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/cli.test.ts +1344 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/config-fuzz.test.ts +263 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/Counter.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/Counter.tla +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/chart.mmd +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/report.md +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/verdict-1.out +49 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/ChartRun.out +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.tla +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/chart.mmd +26 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/graph.dot +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/report.md +20 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.out +82 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-3.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/chart.mmd +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/report.md +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.out +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/ChartRun.out +69 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/chart.mmd +85 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/graph.dot +70 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/report.md +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.out +67 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.out +85 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.cfg +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.tla +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/chart.mmd +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/graph.dot +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/report.md +31 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.out +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/ChartRun.out +55 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.tla +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/chart.mmd +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/graph.dot +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/report.md +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.out +33 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-2.out +54 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/ChartRun.out +54 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.tla +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/chart.mmd +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/graph.dot +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/report.md +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/verdict-1.out +46 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.tla +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterSteps.tla +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/chart.mmd +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/graph.dot +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/report.md +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/sany.out +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.out +78 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.tla +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/chart.mmd +26 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/graph.dot +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/report.md +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/chart.mmd +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/graph.dot +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/report.md +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.out +76 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/chart.mmd +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/graph.dot +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/report.md +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.out +67 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/ChartRun.out +62 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.cfg +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.tla +24 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/Moves.tla +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/chart.mmd +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/graph.dot +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/report.md +23 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/sany.out +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.out +66 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.out +74 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-4.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/ChartRun.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.tla +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/chart.mmd +18 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/graph.dot +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/report.md +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.out +33 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.tla +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/chart.mmd +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/graph.dot +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/report.md +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/verdict-1.out +49 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/ChartRun.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.tla +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/chart.mmd +30 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/graph.dot +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/report.md +27 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.out +87 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-4.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/ChartRun.out +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.tla +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/chart.mmd +23 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/graph.dot +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/report.md +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/ChartRun.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/CounterView.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/CounterView.tla +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/chart.mmd +23 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/graph.dot +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/report.md +27 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-2.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-3.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-3.out +87 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-4.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/DieHard.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/DieHard.tla +38 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/chart.mmd +92 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/graph.dot +126 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/report.md +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-1.out +91 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/ChartRun.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.cfg +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/chart.mmd +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/report.md +25 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.out +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/chart.mmd +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/graph.dot +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/report.md +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.out +72 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/Login.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/Login.tla +62 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/chart.mmd +28 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/graph.dot +40 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/report.md +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/verdict-1.out +47 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.tla +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/chart.mmd +28 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/graph.dot +37 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/report.md +8 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/verdict-1.out +47 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/ChartRun.out +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.tla +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/chart.mmd +44 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/graph.dot +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/report.md +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.out +83 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/ChartRun.out +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.tla +103 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/chart.mmd +43 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/graph.dot +93 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/report.md +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-2.out +72 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/view.mjs +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.tla +100 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/chart.mmd +31 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/graph.dot +85 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/report.md +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/verdict-1.out +47 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/view.mjs +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayer.tla +103 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.tla +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/chart.mmd +42 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/graph.dot +93 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/report.md +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-2.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-3.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.out +66 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-6.out +49 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/view.mjs +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.cfg +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/chart.mmd +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/graph.dot +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/report.md +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/sany.out +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/verdict-1.out +70 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ChartRun.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/Shadow.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/Shadow.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ShadowLib.tla +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ShadowSub.tla +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/chart.mmd +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/report.md +8 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/sany.out +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/verdict-1.out +65 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.tla +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/chart.mmd +23 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/graph.dot +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/report.md +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.out +65 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.out +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/ChartRun.out +69 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.tla +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/chart.mmd +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/graph.dot +297 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/report.md +20 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.out +95 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.tla +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/chart.mmd +37 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/graph.dot +223 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/report.md +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/verdict-1.out +47 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.out +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.cfg +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/chart.mmd +18 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/graph.dot +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/report.md +29 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.out +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/ChartRun.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.tla +8 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/chart.mmd +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/report.md +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.out +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus.test.ts +441 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/differential.test.ts +565 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/drawn.ts +20 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/grid/Grid.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/grid/Grid.tla +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/grid/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/java.ts +63 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/labels.ts +648 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/messages.test.ts +226 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/pipeline.test.ts +270 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/plain-tlc.test.ts +255 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/render.test.ts +145 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/tlc-out.test.ts +90 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/tlc.ts +158 -0
- package/plugins/deepmodebot/skills/statechart/scripts/tsconfig.json +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/worker.ts +35 -0
- package/plugins/deepmodebot/agents/reviewer/agent.md +0 -33
- package/plugins/deepmodebot/agents/scout/agent.md +0 -34
- package/plugins/deepmodebot/agents/security-reviewer/agent.md +0 -30
- package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/bun.lock +0 -391
- package/plugins/deepmodebot/skills/deepmodebot/assets/agents-md/test_agents_md.py +0 -146
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_antigravity_guard.py +0 -483
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_audit_regressions.py +0 -139
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_contain.py +0 -301
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_omp_mcp.py +0 -602
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_design.py +0 -69
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_evidence.py +0 -160
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_record.py +0 -180
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_review.py +0 -265
- package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/test_git_guard.py +0 -192
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_bot.py +0 -2182
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_brand.py +0 -19
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_local_updates.py +0 -691
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_review_context.py +0 -127
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_workspace_cleanup.py +0 -496
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_loop.py +0 -1426
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_plan.py +0 -320
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_windows_job.py +0 -326
- package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/test_bench_harness.py +0 -55
- package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/test_perf_audit.py +0 -53
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/test_diff_coverage.py +0 -94
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/test_arena.py +0 -610
- package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/test_yt_enrich.py +0 -250
- package/plugins/deepmodebot/skills/deepmodebot/assets/tournament/test_tournament.py +0 -654
- package/plugins/deepmodebot/skills/deepmodebot/assets/workspace-map/test_workspace_map.py +0 -879
|
@@ -0,0 +1,1026 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Pure LLM semantic auto-routing loop with live disk catalog discovery and deterministic checks & balances.
|
|
3
|
+
|
|
4
|
+
python autoroute.py route --root <repo> --stdin [--harness auto|agy|claude|codex] [--json] <<'EOF'
|
|
5
|
+
python autoroute.py menu --root <repo> --stdin [--json] <<'EOF'
|
|
6
|
+
python autoroute.py verify --root <repo> --prompt <text> --decision-stdin [--critic-round 2] [--strict] [--json] <<'EOF'
|
|
7
|
+
python autoroute.py reroute --root <repo> --current-mode <mode> --current-size <size> [--failed-attempts N] [--json]
|
|
8
|
+
"""
|
|
9
|
+
import argparse
|
|
10
|
+
import importlib.util
|
|
11
|
+
import json
|
|
12
|
+
import os
|
|
13
|
+
import re
|
|
14
|
+
import shutil
|
|
15
|
+
import subprocess
|
|
16
|
+
import sys
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
from typing import Callable
|
|
19
|
+
|
|
20
|
+
sys.dont_write_bytecode = True
|
|
21
|
+
|
|
22
|
+
NO_WINDOW = getattr(subprocess, "CREATE_NO_WINDOW", 0)
|
|
23
|
+
SKILL_DIR = Path(__file__).resolve().parents[2]
|
|
24
|
+
PLUGINS_SKILLS_DIR = SKILL_DIR.parent
|
|
25
|
+
ASSETS_DIR = SKILL_DIR / "assets"
|
|
26
|
+
|
|
27
|
+
READ_ONLY_MODES = frozenset({
|
|
28
|
+
"investigation", "runtime-forensics", "trace-forensics", "triage",
|
|
29
|
+
"pr-review", "grill", "product-lens", "devex-review", "self-grill", "tournament", "research", "flows",
|
|
30
|
+
"architecture-review", "retro", "course", "questionnaire", "re-explain",
|
|
31
|
+
"security-audit", "variant-analysis", "pr-agent", "blast-radius", "sharpen", "reframe", "reflect", "recall", "catchup-video",
|
|
32
|
+
"interrogate", "sme-review", "formal-verification", "statechart", "prior-art", "wizard",
|
|
33
|
+
"scrape", "suggest", "teach", "why", "how", "autoroute",
|
|
34
|
+
"goal-review", "workspace-map", "open-design-evidence", "deep-stack", "seo-and-geo",
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
FLEXIBLE_SIZE_MODES = frozenset({
|
|
38
|
+
"eval", "arena", "prompt-upgrade", "self-authoring", "video-forensics", "gen-ui", "webhook-ui", "model-setup",
|
|
39
|
+
"modernize-pr", "expand-contract", "release-and-canary", "mutation-testing", "office-documents",
|
|
40
|
+
"pause-safely", "triage", "inner-loop", "tool-routing", "agent-collaboration", "visual-e2e",
|
|
41
|
+
"create-verification-skill", "maintain-verification-skill",
|
|
42
|
+
"create-formal-verification-skill", "maintain-formal-verification-skill",
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
SENSITIVE_RE = re.compile(
|
|
46
|
+
r"(?<![A-Za-z0-9_])(?:\.env\b|\.github/workflows\b)"
|
|
47
|
+
r"|\b(?:auth|oauth|jwt|session|token|tokens|secret|secrets|password|passwords|credential|credentials"
|
|
48
|
+
r"|rbac|acl|permission|permissions|migration|migrations|stripe|billing|payment|payments|webhook|webhooks"
|
|
49
|
+
r"|security|encrypt|decrypt|crypto|signature|ci\s+(?:workflow|pipeline|config|yaml|yml)"
|
|
50
|
+
r"|hooks?\.json|mcp_config|agents\.md|claude\.md|env\s+var|trust\s+boundary|sanitiz\w*|parser)\b",
|
|
51
|
+
re.I,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
MINIMAL_OPT_OUT_TOKEN_RE = re.compile(
|
|
55
|
+
r"\b(?:minimal\s+(?:fix|patch|change|diff|mvp)|quick\s+(?:spike|hack|fix|typo)|throwaway\s+(?:prototype|spike)"
|
|
56
|
+
r"|just\s+a\s+typo|one[- ]line\s+(?:fix|tweak)|tiny\s+(?:fix|tweak)|no\s+hardcore|skip\s+hardcore)\b",
|
|
57
|
+
re.I,
|
|
58
|
+
)
|
|
59
|
+
NEGATION_CLAUSE_RE = re.compile(
|
|
60
|
+
r"\b(?:no|not|never|without|don'?t|do\s+not|avoid|instead\s+of|refuse|forbid)\b",
|
|
61
|
+
re.I,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
HARDCORE_SYSTEM_RE = re.compile(
|
|
65
|
+
r"\b(?:hardcore\s+mode|volumetric|density\s+field|domain\s+warp|hydraulic\s+erosion|wave\s+function\s+collapse"
|
|
66
|
+
r"|wfc|dual\s+contouring|surface\s+nets|editablemesh|voxel\s+mesh|parallel\s+luau|actor\s+pool"
|
|
67
|
+
r"|custom\s+(?:engine|compiler|solver|renderer|scheduler|allocator|mesher)|distributed\s+consensus"
|
|
68
|
+
r"|zero[- ]copy|lock[- ]free|full\s+rewrite|from\s+scratch|real[- ]time\s+physics|procedural\s+generation"
|
|
69
|
+
r"|n\+1|query\s+plan|connection\s+pool|backpressure|transactional\s+outbox|singleflight|cursor\s+pagination"
|
|
70
|
+
r"|tail\s+latency|simd|arena\s+allocator|ring\s+buffer|flat\s+hash)\b",
|
|
71
|
+
re.I,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
STRUGGLE_SIGNAL_RE = re.compile(
|
|
75
|
+
r"\b(?:i'?m\s+(?:struggling|stuck)|struggling\s+with|stuck\s+on|keeps?\s+(?:breaking|failing|crashing)"
|
|
76
|
+
r"|still\s+(?:broken|not\s+working|failing)|idk\s+why\b.*\b(?:work|broken|fail)|tried\s+\d+\s+times)\b",
|
|
77
|
+
re.I,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
LEAN_QUOTA_RE = re.compile(
|
|
81
|
+
r"\b(?:lean\s+mode|quota[- ]safe|save\s+(?:weekly\s+)?(?:usage|quota|tokens)"
|
|
82
|
+
r"|low\s+token|without\s+(?:burning|killing)\s+(?:weekly\s+)?(?:quota|usage))\b",
|
|
83
|
+
re.I,
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
SPECIALIZED_SIGNALS = (
|
|
87
|
+
("gen-ui", re.compile(r"\b(?:a2ui|gen[- ]ui|generative\s+ui)\b|\b(?:interactive|visual)\s+(?:cockpit|surface|ui)\b.{0,35}\b(?:human|talk|visualize|decisions?|prompts?)\b", re.I)),
|
|
88
|
+
("video-forensics", re.compile(r"\b(?:rea[- ]video|videomd|video\.md)\b|\b(?:reverse[- ]engineer|break\s+down|remake|deconstruct)\b.{0,35}\bvideo\b|\bis\s+this\s+video\s+ai\b", re.I)),
|
|
89
|
+
("runtime-forensics", re.compile(r"\b(?:memory\s+leak|leaking\s+ram|idle\s+cpu|cpu\s+(?:spike|stuck)\b|freez(?:e|es|ing)\b|hangs?\b|oom\b)|\bcpu\s+100%(?![A-Za-z0-9_])", re.I)),
|
|
90
|
+
("trace-forensics", re.compile(r"(?<![A-Za-z0-9_])\.(?:cpuprofile|heapsnapshot)\b|\b(?:cpuprofile|heap\s+snapshot|chrome\s+trace|flamegraph)\b", re.I)),
|
|
91
|
+
("perf-issue", re.compile(r"\b(?:\d+(?:\.\d+)?x\s+slower|got\s+slower|slowness|latency\s+(?:spike|regression)|p9[59]\b.{0,30}\b(?:ms|s|slow|high|jumped)|n\+1\b|(?:optimize|speed\s+up)\b.{0,45}\b(?:endpoint|route|query|queries|api|backend|server|throughput|latency|serialization|pool))\b", re.I)),
|
|
92
|
+
("hillclimb", re.compile(r"\b(?:hillclimb|from\s+\d+\s*(?:ms|s|%)\s+(?:down\s+)?(?:to|below|under)\s+\d+|below\s+\d+\s*ms|step\s+by\s+step.*(?:latency|accuracy|throughput))", re.I)),
|
|
93
|
+
("visual-parity", re.compile(r"\b(?:pixel[- ]exact|pixel\s+diff|visual\s+parity|pixel[- ]for[- ]pixel)\b", re.I)),
|
|
94
|
+
("reference-rebuild", re.compile(r"\b(?:rebuild\b.*\b(?:match|like)\s+[A-Z][a-z]+|to\s+the\s+standard\s+of)\b")),
|
|
95
|
+
("prototype", re.compile(r"\b(?:throwaway\s+(?:prototype|spike)|quick\s+spike|prototype\b.*\b(?:test\s+whether|beats?|compare))\b", re.I)),
|
|
96
|
+
("session-pickup", re.compile(r"\b(?:pick\s+up\s+where\s+(?:the\s+)?(?:previous|last)\s+agent|take\s+over\b.*\bin[- ]flight)\b", re.I)),
|
|
97
|
+
("pause-safely", re.compile(r"\b(?:pause\s+safely|checkpoint\s+and\s+pause|resume\s+tomorrow)\b", re.I)),
|
|
98
|
+
("reframe", re.compile(r"(?:^\s*/?reframe\b|\b(?:expert\s+words\s+for\s+what\s+(?:i'?m|we'?re)\s+building|what\s+is\s+this\s+problem\s+called|teach\s+(?:me\s+)?the\s+expert\s+(?:words|terms|vocabulary))\b)", re.I)),
|
|
99
|
+
("catchup-video", re.compile(r"\b(?:catchup[- ]video|catch[- ]up\s+video|subtitled\s+(?:catch[- ]?up\s+|recap\s+)?video|video\s+recap\s+of\s+what\s+happened)\b", re.I)),
|
|
100
|
+
("webhook-ui", re.compile(r"\b(?:webhook[- ]ui|make[- ]bot[- ]ui)\b|\b(?:custom|tailscale|local)\s+(?:ui|page|dashboard|buttons?)\b.{0,45}\b(?:wake|trigger|post\s+to)\b.{0,30}\bwebhook\b", re.I)),
|
|
101
|
+
("model-setup", re.compile(r"\b(?:model[- ]setup|per[- ]role\s+models?|configure\s+(?:my\s+|role\s+)?models?\s+(?:and\s+)?(?:reasoning\s+)?budget)\b", re.I)),
|
|
102
|
+
("modernize-pr", re.compile(r"\b(?:modernize[- ]pr|modernize\s+this\s+pr|rebase\s+this\s+old\s+pr|revive\s+this\s+(?:old\s+)?(?:pr|branch)|is\s+this\s+pr\s+still\s+worth\s+landing)\b", re.I)),
|
|
103
|
+
("expand-contract", re.compile(r"\b(?:expand[- /]contract|zero[- ]downtime\s+(?:migration|column|schema|rename|drop|cutover)|dual[- ]write.*backfill)\b", re.I)),
|
|
104
|
+
("release-and-canary", re.compile(r"\b(?:canary\s+(?:check|monitor\w*|rollout)|monitor\s+after\s+deploy|post[- ]deploy\s+canary|document[- ]release|update\s+docs\s+after\s+ship)\b", re.I)),
|
|
105
|
+
("devex-review", re.compile(r"\b(?:devex[- ]review|dx\s+(?:plan\s+)?review|developer\s+experience\s+review|check\s+developer\s+onboarding|cli\s+ergonomics\s+review)\b", re.I)),
|
|
106
|
+
("product-lens", re.compile(r"\b(?:product[- ]lens|ceo\s+review|founder[- ]mode\s+review|10[- ]star\s+(?:product|experience)|painkiller\s+(?:vs|or)\s+vitamin)\b", re.I)),
|
|
107
|
+
("variant-analysis", re.compile(r"\b(?:variant[- ]analysis|hunt\s+(?:for\s+)?(?:all\s+)?sibling\s+(?:bugs|vulnerabilities)|find\s+every\s+variant\s+of\s+this\s+(?:bug|vuln))\b", re.I)),
|
|
108
|
+
("mutation-testing", re.compile(r"\b(?:mutation[- ]test(?:ing|s)?|kill\s+surviving\s+mutants|cargo[- ]mutants|mutmut|stryker)\b", re.I)),
|
|
109
|
+
("statechart", re.compile(r"(?:^\s*/?statechart\b|\b(?:tla\+?\s+statechart|mermaid\s+statechart\b.*\bcounterexample|draw\b.*\btla\+?\s+model\s+as\s+a?\s*statechart)\b)", re.I)),
|
|
110
|
+
("formal-verification", re.compile(r"\btla\+(?![A-Za-z0-9_])|\b(?:tlc|statechart|lean\s*4?|lean\s+proof|mathlib|coq|rocq|isabelle|smt2|z3|comparator|nanoda|bombadil|model[- ]check|property[- ]based\s+ui|(?:formalize|prove)\s+(?:this|the)\s+(?:theorem|lemma|conjecture|invariant))\b|(?<![A-Za-z0-9_])\.(?:lean|tla|smt2)\b", re.I)),
|
|
111
|
+
("suggest", re.compile(r"\b(?:deepmode\s+suggest|suggest\s+(?:me\s+)?(?:some\s+)?(?:full[- ]scope\s+)?prompts?|what\s+prompts?\s+should\s+i\s+run|what\s+should\s+i\s+(?:fix|work\s+on)\s+next)\b", re.I)),
|
|
112
|
+
("research", re.compile(r"(?:^\s*/?(?:deepmodebot:)?research\b|\b(?:adversarial\s+research|sota\s+(?:research|gap\s+matrix|gaps?)|research\b.{0,45}\b(?:gaps?\s+in|vs\s+our\s+repo|differential\s+gap)|sweep\s+(?:github\s+)?orgs?\b))", re.I)),
|
|
113
|
+
("prompt-upgrade", re.compile(r"\b(?:make\s+my\s+prompt\s+better|(?:review|improve|upgrade|rewrite|fix)\s+(?:my|this)\s+prompt|convert\b.*\bdeepmode\s*prompt)\b", re.I)),
|
|
114
|
+
("grill", re.compile(r"(?:^\s*grill(?:\s+(?:it|this|me))?\s*[?!.]*$|(?:\bare\s+you\s+sure\W+grill\b)|\bgrill\s+(?:me|this\s+plan|my\s+plan|our\s+plan|it)\b|\bpoke\s+holes\s+in\b)", re.I)),
|
|
115
|
+
("self-grill", re.compile(r"\b(?:self[- ]grill|check\s+theater|mocking\s+stuff|tests\s+are\s+actually\s+catching|grill\s+(?:my|our|the|this)\s+(?:checks?|diff|tests?|code|work|implementation)|(?:find|look\s+for|hunt(?:\s+for)?|check\s+for)\s+(?:\d+\s+)?(?!(?:architecture|architectural|research)\s+gaps?\b)gaps?\b|(?<!suggest\s)overclaims?\b|what\s+(?:gaps?\s+)?did\s+(?:you|we)\s+miss|^are\s+you\s+sure\s*[?!.]*$)", re.I)),
|
|
116
|
+
("no-comments", re.compile(r"\b(?:no[- ]comments|comment[- ]sicko|(?:strip|remove|delete|clean)\b.{0,30}\bcomments)\b", re.I)),
|
|
117
|
+
("worktree-cleanup", re.compile(r"\b(?:clean\s+up|prune|delete|remove)\b.{0,25}\bworktrees?\b", re.I)),
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
REFERENCE_SKILL_SIGNALS = (
|
|
121
|
+
("skill://frontend-ui", re.compile(r"\b(?:react|next\.?js|css|tailwind|shadcn|ui|ux|a2ui|vibe[- ]coded|ai\s+studio|sidebar|modal|animation|animations|remotion|hyperframes|figma|pixel|a11y|accessibility|dashboard|layout|chat\s+ui)\b", re.I)),
|
|
122
|
+
("skill://secrets-and-auth", re.compile(r"(?<![A-Za-z0-9_])\.env\b|\b(?:auth|oauth|jwt|login|password|secret|secrets|credential|credentials|mfa|sso|api\s+key|rbac|session\s+token)\b", re.I)),
|
|
123
|
+
("skill://software-architecture", re.compile(r"\b(?:postgres|sqlite|mysql|database|schema|migration|monorepo|queue|redis|kafka|microservice|api\s+design|data\s+model|domain\s+model|orm|prisma|drizzle|sqlalchemy|pgx|asyncpg|npgsql|foreign\s+key|n\+1|pagination|cursor|connection\s+pool|outbox|timeout|backpressure)\b", re.I)),
|
|
124
|
+
("skill://cloud-devsecops", re.compile(r"\b(?:docker|kubernetes|k8s|terraform|iac|aws|gcp|azure|iam|s3|bucket|ci/cd|github\s+actions|container|helm)\b", re.I)),
|
|
125
|
+
("skill://agent-harnesses", re.compile(r"\b(?:omp|claude\s+code|codex|antigravity|mcp|acp|a2a|ag[- ]ui|a2ui|webmcp|subagent|subagents|teamwork|weekly\s+usage|quota|hooks\.json|skill\.md)\b", re.I)),
|
|
126
|
+
("skill://domain-rules", re.compile(r"\b(?:llm|rag|evals?|rate\s+limit|distributed|concurrency|race\s+condition|deadlock|caching|idempoten\w*|incident|legacy\s+code|backend|server|endpoint|fastapi|starlette|express|axum|tokio|goroutine|event\s+loop|n\+1|tail\s+latency|p9[59]|throughput|rps|serialization|orjson|gzip|cache\s+stampede|singleflight|simd|cache\s+line|arena|unordered_map)\b", re.I)),
|
|
127
|
+
("skill://deep-stack", re.compile(r"\b(?:what\s+stack|tech\s+stack|pick\s+a\s+stack|choose\s+a\s+stack|greenfield\s+stack)\b", re.I)),
|
|
128
|
+
("skill://seo-and-geo", re.compile(r"\b(?:seo|geo/aeo|json[- ]ld|schema\.org|sitemap\.xml|robots\.txt|llms\.txt|core\s+web\s+vitals|agentic\s+browsing|hreflang|opengraph)\b", re.I)),
|
|
129
|
+
("skill://office-documents", re.compile(r"(?<![A-Za-z0-9_])\.(?:xlsx|pptx|docx|pdf)\b|\b(?:spreadsheet|excel\s+workbook|powerpoint|slide\s+deck|word\s+document|openpyxl|python[- ]pptx|python[- ]docx|fillable\s+pdf)\b", re.I)),
|
|
130
|
+
("skill://deep-learning", re.compile(r"\b(?:reinforcement\s+learning|ppo|grpo|sac|world\s+model|gnn|equivariant|pinns?|neural\s+operator|weight[- ]space\s+programming|muon\s+optimizer)\b", re.I)),
|
|
131
|
+
("skill://app-automation-relay", re.compile(r"\b(?:automation\s+relay|control\s+adapter\b.*\b(?:desktop|mobile|terminal|app)|observe\s*->\s*act\s*->\s*wait)\b", re.I)),
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
CONCRETE_ANCHOR_RE = re.compile(
|
|
135
|
+
r"(?:[A-Za-z0-9_./-]+\.[A-Za-z0-9]{1,6}\b|#\d+\b|https?://\S+|\bPR\s*#?\d+\b)",
|
|
136
|
+
re.I,
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
DEFAULT_PANEL_SEATS = [
|
|
140
|
+
"claude-haiku-5-5-high",
|
|
141
|
+
"gpt-6-luna",
|
|
142
|
+
"gemini-4-flash",
|
|
143
|
+
]
|
|
144
|
+
|
|
145
|
+
STRIPPED_API_KEY_VARS = (
|
|
146
|
+
"ANTHROPIC_API_KEY",
|
|
147
|
+
"ANTHROPIC_AUTH_TOKEN",
|
|
148
|
+
"OPENAI_API_KEY",
|
|
149
|
+
"CODEX_API_KEY",
|
|
150
|
+
"GEMINI_API_KEY",
|
|
151
|
+
"GOOGLE_API_KEY",
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def _load_sibling(name: str, rel_path: str):
|
|
156
|
+
path = ASSETS_DIR / rel_path
|
|
157
|
+
spec = importlib.util.spec_from_file_location(name, path)
|
|
158
|
+
mod = importlib.util.module_from_spec(spec)
|
|
159
|
+
sys.modules[spec.name] = mod
|
|
160
|
+
spec.loader.exec_module(mod)
|
|
161
|
+
return mod
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def has_minimal_opt_out(text: str) -> bool:
|
|
165
|
+
for m in MINIMAL_OPT_OUT_TOKEN_RE.finditer(text):
|
|
166
|
+
tok = m.group(0).lower()
|
|
167
|
+
if tok in ("no hardcore", "skip hardcore"):
|
|
168
|
+
return True
|
|
169
|
+
clause_prefix = re.split(r"[.;!?]", text[: m.start()])[-1]
|
|
170
|
+
if NEGATION_CLAUSE_RE.search(clause_prefix):
|
|
171
|
+
continue
|
|
172
|
+
return True
|
|
173
|
+
return False
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def _first_summary_line(md_path: Path) -> str:
|
|
177
|
+
try:
|
|
178
|
+
lines = md_path.read_text(encoding="utf-8", errors="replace").splitlines()
|
|
179
|
+
except OSError:
|
|
180
|
+
return ""
|
|
181
|
+
body_start = 0
|
|
182
|
+
if lines and lines[0].strip() == "---":
|
|
183
|
+
end_idx = None
|
|
184
|
+
for idx in range(1, min(len(lines), 30)):
|
|
185
|
+
if lines[idx].strip() == "---":
|
|
186
|
+
end_idx = idx
|
|
187
|
+
break
|
|
188
|
+
if end_idx is not None:
|
|
189
|
+
body_start = end_idx + 1
|
|
190
|
+
for idx in range(1, end_idx):
|
|
191
|
+
m = re.match(r'^description:\s*(.*)$', lines[idx])
|
|
192
|
+
if m:
|
|
193
|
+
val = m.group(1).strip().strip('"').strip("'")
|
|
194
|
+
if val in (">", "|", ">-", "|-", ""):
|
|
195
|
+
collected = []
|
|
196
|
+
for sub in lines[idx + 1 : end_idx]:
|
|
197
|
+
if sub.startswith((" ", "\t")) and sub.strip():
|
|
198
|
+
collected.append(sub.strip())
|
|
199
|
+
else:
|
|
200
|
+
break
|
|
201
|
+
if collected:
|
|
202
|
+
return " ".join(collected)[:140]
|
|
203
|
+
elif val:
|
|
204
|
+
return val[:140]
|
|
205
|
+
for line in lines[body_start : body_start + 15]:
|
|
206
|
+
s = line.strip()
|
|
207
|
+
if not s or s.startswith("#") or s == "---":
|
|
208
|
+
continue
|
|
209
|
+
return s[:140]
|
|
210
|
+
return ""
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
def discover_live_catalog(root: Path | None = None) -> dict:
|
|
214
|
+
playbooks: dict[str, dict] = {}
|
|
215
|
+
techniques: dict[str, dict] = {}
|
|
216
|
+
references: dict[str, dict] = {}
|
|
217
|
+
sibling_skills: dict[str, dict] = {}
|
|
218
|
+
|
|
219
|
+
pb_dir = SKILL_DIR / "references" / "playbooks"
|
|
220
|
+
if pb_dir.is_dir():
|
|
221
|
+
for md in sorted(pb_dir.glob("*.md")):
|
|
222
|
+
playbooks[md.stem] = {
|
|
223
|
+
"kind": "playbook",
|
|
224
|
+
"file": f"references/playbooks/{md.name}",
|
|
225
|
+
"dir": SKILL_DIR,
|
|
226
|
+
"summary": _first_summary_line(md),
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
tech_dir = SKILL_DIR / "references" / "techniques"
|
|
230
|
+
if tech_dir.is_dir():
|
|
231
|
+
for md in sorted(tech_dir.glob("*.md")):
|
|
232
|
+
techniques[md.stem] = {
|
|
233
|
+
"kind": "technique",
|
|
234
|
+
"file": f"references/techniques/{md.name}",
|
|
235
|
+
"dir": SKILL_DIR,
|
|
236
|
+
"summary": _first_summary_line(md),
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (SKILL_DIR / "references" / "flows.md").is_file():
|
|
240
|
+
references["flows"] = {
|
|
241
|
+
"kind": "reference",
|
|
242
|
+
"file": "references/flows.md",
|
|
243
|
+
"dir": SKILL_DIR,
|
|
244
|
+
"summary": _first_summary_line(SKILL_DIR / "references" / "flows.md"),
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if PLUGINS_SKILLS_DIR.is_dir():
|
|
248
|
+
for smd in sorted(PLUGINS_SKILLS_DIR.glob("*/SKILL.md")):
|
|
249
|
+
name = smd.parent.name
|
|
250
|
+
if name == SKILL_DIR.name:
|
|
251
|
+
continue
|
|
252
|
+
sibling_skills[name] = {
|
|
253
|
+
"kind": "skill",
|
|
254
|
+
"file": f"skill://{name}",
|
|
255
|
+
"dir": smd.parent,
|
|
256
|
+
"summary": _first_summary_line(smd),
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if root is not None and root.is_dir():
|
|
260
|
+
for base in (".omp/skills", ".claude/skills", ".agents/skills"):
|
|
261
|
+
sdir = root / base
|
|
262
|
+
if sdir.is_dir():
|
|
263
|
+
for smd in sorted(sdir.glob("*/SKILL.md")):
|
|
264
|
+
name = smd.parent.name
|
|
265
|
+
if name not in sibling_skills and name != SKILL_DIR.name:
|
|
266
|
+
sibling_skills[name] = {
|
|
267
|
+
"kind": "project-skill",
|
|
268
|
+
"file": f"skill://{name}",
|
|
269
|
+
"dir": smd.parent,
|
|
270
|
+
"summary": _first_summary_line(smd),
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
return {
|
|
274
|
+
"playbooks": playbooks,
|
|
275
|
+
"techniques": techniques,
|
|
276
|
+
"references": references,
|
|
277
|
+
"sibling_skills": sibling_skills,
|
|
278
|
+
"local_modes": {**playbooks, **techniques, **references},
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
def gather_repo_facts(root: Path | None) -> dict:
|
|
283
|
+
if root is None:
|
|
284
|
+
return {"has_root": False}
|
|
285
|
+
self_grill = _load_sibling("ar_self_grill", "self-grill/self_grill.py")
|
|
286
|
+
safe_root = self_grill.reject_unsafe_root(root)
|
|
287
|
+
diff = self_grill.inspect_diff(safe_root)
|
|
288
|
+
verify_skills = []
|
|
289
|
+
for base in (".omp/skills", ".claude/skills", ".agents/skills"):
|
|
290
|
+
d = safe_root / base
|
|
291
|
+
if d.is_dir():
|
|
292
|
+
for child in sorted(d.glob("verify-*/SKILL.md")):
|
|
293
|
+
verify_skills.append(child.relative_to(safe_root).as_posix())
|
|
294
|
+
entries = [
|
|
295
|
+
p.name for p in safe_root.iterdir()
|
|
296
|
+
if p.name not in {".git", ".scratch", ".worktrees", ".DS_Store"}
|
|
297
|
+
]
|
|
298
|
+
return {
|
|
299
|
+
"has_root": True,
|
|
300
|
+
"root": str(safe_root),
|
|
301
|
+
"empty_dir": len(entries) == 0,
|
|
302
|
+
"has_factory": (safe_root / "factory.json").is_file(),
|
|
303
|
+
"has_glossary_or_adrs": (safe_root / "GLOSSARY.md").is_file() or (safe_root / "docs" / "adr").is_dir(),
|
|
304
|
+
"verify_skills": verify_skills,
|
|
305
|
+
"diff_size": diff["measured_size"],
|
|
306
|
+
"diff_files": diff["file_count"],
|
|
307
|
+
"diff_sensitive_paths": diff["sensitive_paths"][:10],
|
|
308
|
+
"diff_added_comments": diff["added_comment_count"],
|
|
309
|
+
"diff_workaround_smells": diff["workaround_smell_count"],
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
def detect_expected_reference_skills(prompt: str, available_skills: dict[str, dict] | None = None) -> list[str]:
|
|
314
|
+
hits = []
|
|
315
|
+
for skill_uri, pat in REFERENCE_SKILL_SIGNALS:
|
|
316
|
+
sname = skill_uri.removeprefix("skill://")
|
|
317
|
+
if available_skills is not None and sname not in available_skills:
|
|
318
|
+
continue
|
|
319
|
+
if pat.search(prompt):
|
|
320
|
+
hits.append(skill_uri)
|
|
321
|
+
return hits
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
def detect_specialized_signals(prompt: str) -> list[str]:
|
|
325
|
+
hits = []
|
|
326
|
+
for mode, pat in SPECIALIZED_SIGNALS:
|
|
327
|
+
if pat.search(prompt):
|
|
328
|
+
hits.append(mode)
|
|
329
|
+
return hits
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
def build_menu_packet(prompt: str, root: Path | None = None) -> dict:
|
|
333
|
+
cleaned = " ".join(prompt.strip().split())
|
|
334
|
+
if not cleaned:
|
|
335
|
+
raise SystemExit("prompt cannot be empty")
|
|
336
|
+
repo_facts = gather_repo_facts(root)
|
|
337
|
+
safe_root = Path(repo_facts["root"]) if repo_facts.get("has_root") else None
|
|
338
|
+
catalog = discover_live_catalog(root=safe_root)
|
|
339
|
+
tournament = _load_sibling("ar_tournament", "tournament/tournament.py")
|
|
340
|
+
prior = tournament.classify_prompt(
|
|
341
|
+
cleaned,
|
|
342
|
+
has_factory=bool(repo_facts.get("has_factory")),
|
|
343
|
+
empty_dir=bool(repo_facts.get("empty_dir")),
|
|
344
|
+
)
|
|
345
|
+
ref_hints = detect_expected_reference_skills(cleaned, catalog["sibling_skills"])
|
|
346
|
+
spec_hints = detect_specialized_signals(cleaned)
|
|
347
|
+
prompt_tools = _load_sibling("ar_prompt_tools", "prompt-tools/prompt_tools.py")
|
|
348
|
+
clarification = prompt_tools.analyze_ambiguity(cleaned, root=safe_root)
|
|
349
|
+
compact_playbooks = [f"{k} (route_file: {v['file']}): {v['summary']}" for k, v in catalog["playbooks"].items()]
|
|
350
|
+
compact_techniques = [f"{k} (route_file: {v['file']}): {v['summary']}" for k, v in catalog["techniques"].items()]
|
|
351
|
+
compact_references = [f"{k} (route_file: {v['file']}): {v['summary']}" for k, v in catalog["references"].items()]
|
|
352
|
+
compact_ref_skills = [f"{v['file']} (route_file: {v['file']}): {v['summary']}" for v in catalog["sibling_skills"].values()]
|
|
353
|
+
|
|
354
|
+
minimal_opt_out = has_minimal_opt_out(cleaned)
|
|
355
|
+
hardcore_default = not minimal_opt_out
|
|
356
|
+
hardcore_system_hit = bool(HARDCORE_SYSTEM_RE.search(cleaned))
|
|
357
|
+
|
|
358
|
+
schema = {
|
|
359
|
+
"decoded_intent": "The user's objective, observable success evidence, and allowed delivery boundary",
|
|
360
|
+
"deliverables": ["1. concrete deliverable", "2. ..."],
|
|
361
|
+
"primary_mode": "exact mode name from Playbooks, Techniques, References, or qualified skill://<name> from Sibling Skills",
|
|
362
|
+
"route_file": "exact route_file from the catalog",
|
|
363
|
+
"secondary_techniques": ["optional companion technique names, e.g. self-grill, no-comments, security-audit"],
|
|
364
|
+
"reference_skills": ["optional skill://<name> URIs from Sibling Skills"],
|
|
365
|
+
"size": "S | M | L | none",
|
|
366
|
+
"self_grill": "none | plan | checks | both",
|
|
367
|
+
"hardcore_mode": hardcore_default,
|
|
368
|
+
"hardcore_ceiling": "1-sentence first-principles maximal-craft engineering target (never a watered-down MVP)",
|
|
369
|
+
"confidence": 0.9,
|
|
370
|
+
"runner_up": "closest alternative mode name",
|
|
371
|
+
"why_not_runner_up": "concrete reason primary_mode beats runner_up",
|
|
372
|
+
"needs_prompt_upgrade": False,
|
|
373
|
+
"hard_stops": [],
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
llm_router_prompt = (
|
|
377
|
+
"You are deepmodebot's LLM semantic auto-router in HARDCORE MODE by default. "
|
|
378
|
+
"Read what the user literally typed — including typos, shorthand, compound asks, frustration/struggle, "
|
|
379
|
+
"skepticism ('are you sure', 'grill', 'what did you miss', 'find gaps/overclaims'), media/video breakdown "
|
|
380
|
+
"requests ('rea-video', 'VIDEO.md', 'how was this video made', 'remake this video'), or multi-system builds — "
|
|
381
|
+
"and choose the best primary_mode, companion techniques, reference_skills, size, and self_grill mode purely from "
|
|
382
|
+
"semantic understanding against the live catalog below (never naive keyword matching).\n"
|
|
383
|
+
"Routing guidance:\n"
|
|
384
|
+
"- Decide the user's intended outcome before choosing a mode. Preserve the distinction between what "
|
|
385
|
+
"they want, how they suggested doing it, and what they authorized. A proxy is not the outcome. "
|
|
386
|
+
"Do not expand the task or infer permission to publish, deploy, send, or spend from an indirect goal.\n"
|
|
387
|
+
"- Hardcore Mode is ON by default: aim straight for the first-principles architectural ceiling and promote any "
|
|
388
|
+
"'(Optional hardcore mode)' tier into a mandatory deliverable unless the user explicitly asked for a minimal fix or throwaway prototype.\n"
|
|
389
|
+
"- Read-only/discovery/audit modes (investigation, runtime-forensics, trace-forensics, pr-review, grill, self-grill, "
|
|
390
|
+
"tournament, suggest, formal-verification, etc.) MUST use size='none'.\n"
|
|
391
|
+
"- If the user doubts prior work ('are you sure', 'what did you miss', 'find gaps/overclaims'), route to 'self-grill' "
|
|
392
|
+
"(Confession + Adaptive Hotspot Prosecutor + Sieve). If stress-testing a plan/idea ('grill it', 'grill this plan'), route to 'grill'.\n"
|
|
393
|
+
"- If the user is stuck or struggling ('keeps breaking', 'stuck', 'doesn't work'), route to 'bug-fix' (or 'runtime-forensics') "
|
|
394
|
+
"at size M/L with secondary_techniques including 'self-grill' and 'why'.\n"
|
|
395
|
+
"- If breaking down or remaking a video, route to 'video-forensics' (plus skill://frontend-ui when remaking motion graphics).\n"
|
|
396
|
+
"- If building Google A2UI (v1.0) declarative agent surfaces or generating an interactive visual UI/cockpit to talk to the human, route to 'gen-ui' (plus skill://frontend-ui).\n"
|
|
397
|
+
"- If optimizing backend/API/DB latency, throughput, N+1 queries, connection pools, serialization, or memory layout, route to 'perf-issue' (or 'hillclimb' for iterative metric targets) and attach skill://domain-rules + skill://software-architecture.\n"
|
|
398
|
+
"Output ONLY valid JSON matching the schema (no markdown prose outside JSON).\n\n"
|
|
399
|
+
f"User prompt:\n{cleaned}\n\n"
|
|
400
|
+
f"Live repo facts:\n{json.dumps(repo_facts, indent=2)}\n\n"
|
|
401
|
+
f"Playbooks ({len(compact_playbooks)}):\n- " + "\n- ".join(compact_playbooks) + "\n\n"
|
|
402
|
+
f"Techniques ({len(compact_techniques)}):\n- " + "\n- ".join(compact_techniques) + "\n\n"
|
|
403
|
+
f"References ({len(compact_references)}):\n- " + "\n- ".join(compact_references) + "\n\n"
|
|
404
|
+
f"Sibling Skills ({len(compact_ref_skills)}):\n- " + "\n- ".join(compact_ref_skills) + "\n\n"
|
|
405
|
+
f"Required JSON schema:\n{json.dumps(schema, indent=2)}"
|
|
406
|
+
)
|
|
407
|
+
|
|
408
|
+
return {
|
|
409
|
+
"prompt": cleaned,
|
|
410
|
+
"routing_engine": "llm-semantic",
|
|
411
|
+
"repo_facts": repo_facts,
|
|
412
|
+
"advisory_only": True,
|
|
413
|
+
"hardcore_mode": hardcore_default,
|
|
414
|
+
"pre_flight_clarification": clarification,
|
|
415
|
+
"advisory_prior": {
|
|
416
|
+
"deprecated_offline_only": True,
|
|
417
|
+
"mode": prior["mode"],
|
|
418
|
+
"size": prior["size"],
|
|
419
|
+
"self_grill": prior["self_grill"],
|
|
420
|
+
"hardcore_mode": hardcore_default,
|
|
421
|
+
"hardcore_system_signal": hardcore_system_hit,
|
|
422
|
+
"specialized_hints": spec_hints,
|
|
423
|
+
"reference_skill_hints": ref_hints,
|
|
424
|
+
},
|
|
425
|
+
"catalog_counts": {
|
|
426
|
+
"playbooks": len(catalog["playbooks"]),
|
|
427
|
+
"techniques": len(catalog["techniques"]),
|
|
428
|
+
"references": len(catalog["references"]),
|
|
429
|
+
"sibling_skills": len(catalog["sibling_skills"]),
|
|
430
|
+
},
|
|
431
|
+
"decision_schema": schema,
|
|
432
|
+
"llm_router_prompt": llm_router_prompt,
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
def _validate_route_file(route_file: str, primary: str, mode: dict) -> str | None:
|
|
437
|
+
expected_file = mode["file"]
|
|
438
|
+
if route_file == expected_file:
|
|
439
|
+
return None
|
|
440
|
+
if expected_file.startswith("skill://") and route_file.startswith(expected_file + "/"):
|
|
441
|
+
base_dir = mode["dir"].resolve()
|
|
442
|
+
sub_target = (base_dir / route_file[len(expected_file) + 1:]).resolve()
|
|
443
|
+
try:
|
|
444
|
+
sub_target.relative_to(base_dir)
|
|
445
|
+
except ValueError:
|
|
446
|
+
return f"route_file {route_file!r} escapes skill root"
|
|
447
|
+
if not sub_target.is_file():
|
|
448
|
+
return f"route_file {route_file!r} does not exist on disk"
|
|
449
|
+
return None
|
|
450
|
+
return f"route_file {route_file!r} does not match primary_mode {primary!r} (expected {expected_file!r})"
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
def verify_decision(
|
|
454
|
+
decision: dict,
|
|
455
|
+
prompt: str = "",
|
|
456
|
+
root: Path | None = None,
|
|
457
|
+
critic_round: int = 1,
|
|
458
|
+
enforce_regex_hints: bool = True,
|
|
459
|
+
) -> dict:
|
|
460
|
+
repo_facts = gather_repo_facts(root)
|
|
461
|
+
safe_root = Path(repo_facts["root"]) if repo_facts.get("has_root") else None
|
|
462
|
+
catalog = discover_live_catalog(root=safe_root)
|
|
463
|
+
local_modes = catalog["local_modes"]
|
|
464
|
+
techniques = catalog["techniques"]
|
|
465
|
+
sibling_skills = catalog["sibling_skills"]
|
|
466
|
+
|
|
467
|
+
violations: list[str] = []
|
|
468
|
+
warnings: list[str] = []
|
|
469
|
+
auto_repairs: dict = {}
|
|
470
|
+
|
|
471
|
+
raw_primary = str(decision.get("primary_mode", "")).strip()
|
|
472
|
+
primary = raw_primary.removeprefix("skill://")
|
|
473
|
+
route_file = str(decision.get("route_file", "")).strip()
|
|
474
|
+
sibling = sibling_skills.get(primary)
|
|
475
|
+
sibling_uri = f"skill://{primary}"
|
|
476
|
+
if raw_primary == sibling_uri or route_file == sibling_uri or route_file.startswith(sibling_uri + "/"):
|
|
477
|
+
mode = sibling
|
|
478
|
+
else:
|
|
479
|
+
mode = local_modes.get(primary) or sibling
|
|
480
|
+
if mode is None:
|
|
481
|
+
violations.append(f"unknown primary_mode {raw_primary!r}: must match a live playbook, technique, reference, or sibling skill")
|
|
482
|
+
else:
|
|
483
|
+
if not route_file:
|
|
484
|
+
route_file = mode["file"]
|
|
485
|
+
auto_repairs["route_file"] = route_file
|
|
486
|
+
else:
|
|
487
|
+
rf_err = _validate_route_file(route_file, raw_primary, mode)
|
|
488
|
+
if rf_err:
|
|
489
|
+
violations.append(rf_err)
|
|
490
|
+
|
|
491
|
+
raw_sec = decision.get("secondary_techniques")
|
|
492
|
+
if raw_sec is not None and not isinstance(raw_sec, list):
|
|
493
|
+
violations.append("secondary_techniques must be a JSON list of technique names")
|
|
494
|
+
sec_list: list[str] = []
|
|
495
|
+
else:
|
|
496
|
+
sec_list = [str(x).strip() for x in (raw_sec or []) if str(x).strip()]
|
|
497
|
+
|
|
498
|
+
raw_refs = decision.get("reference_skills")
|
|
499
|
+
if raw_refs is not None and not isinstance(raw_refs, list):
|
|
500
|
+
violations.append("reference_skills must be a JSON list of skill:// URIs")
|
|
501
|
+
ref_list: list[str] = []
|
|
502
|
+
else:
|
|
503
|
+
ref_list = []
|
|
504
|
+
for ref in (raw_refs or []):
|
|
505
|
+
ref_str = str(ref).strip()
|
|
506
|
+
if not ref_str:
|
|
507
|
+
continue
|
|
508
|
+
rest = ref_str.removeprefix("skill://")
|
|
509
|
+
parts = [p for p in rest.split("/") if p]
|
|
510
|
+
if not parts:
|
|
511
|
+
violations.append(f"invalid reference_skill {ref_str!r}")
|
|
512
|
+
continue
|
|
513
|
+
sname = parts[0]
|
|
514
|
+
if sname not in sibling_skills:
|
|
515
|
+
violations.append(f"unknown reference_skill {ref_str!r}: skill {sname!r} not found in plugin or repo")
|
|
516
|
+
continue
|
|
517
|
+
base_dir = sibling_skills[sname]["dir"]
|
|
518
|
+
if len(parts) > 1:
|
|
519
|
+
if ".." in parts:
|
|
520
|
+
violations.append(f"reference_skill {ref_str!r} escapes skill root")
|
|
521
|
+
continue
|
|
522
|
+
sub_target = (base_dir / "/".join(parts[1:])).resolve()
|
|
523
|
+
try:
|
|
524
|
+
sub_target.relative_to(base_dir.resolve())
|
|
525
|
+
except ValueError:
|
|
526
|
+
violations.append(f"reference_skill {ref_str!r} escapes skill root")
|
|
527
|
+
continue
|
|
528
|
+
if not sub_target.is_file():
|
|
529
|
+
violations.append(f"reference_skill {ref_str!r} does not exist on disk")
|
|
530
|
+
continue
|
|
531
|
+
norm_ref = f"skill://{sname}/{'/'.join(parts[1:])}"
|
|
532
|
+
else:
|
|
533
|
+
norm_ref = f"skill://{sname}"
|
|
534
|
+
if norm_ref not in ref_list:
|
|
535
|
+
ref_list.append(norm_ref)
|
|
536
|
+
size = str(decision.get("size", "")).strip()
|
|
537
|
+
if size not in ("S", "M", "L", "none"):
|
|
538
|
+
violations.append(f"invalid size {size!r}: must be S, M, L, or none")
|
|
539
|
+
|
|
540
|
+
self_grill_mode = str(decision.get("self_grill", "")).strip()
|
|
541
|
+
if self_grill_mode not in ("none", "plan", "checks", "both"):
|
|
542
|
+
violations.append(f"invalid self_grill {self_grill_mode!r}: must be none, plan, checks, or both")
|
|
543
|
+
|
|
544
|
+
try:
|
|
545
|
+
confidence = float(decision.get("confidence", 0.0))
|
|
546
|
+
except (TypeError, ValueError):
|
|
547
|
+
confidence = 0.0
|
|
548
|
+
violations.append("confidence must be a number between 0.0 and 1.0")
|
|
549
|
+
if not (0.0 <= confidence <= 1.0):
|
|
550
|
+
violations.append(f"confidence {confidence} out of range [0.0, 1.0]")
|
|
551
|
+
|
|
552
|
+
deliverables = decision.get("deliverables") or []
|
|
553
|
+
if not isinstance(deliverables, list) or not deliverables:
|
|
554
|
+
violations.append("deliverables must be a non-empty list covering full request scope")
|
|
555
|
+
|
|
556
|
+
raw_intent = decision.get("decoded_intent")
|
|
557
|
+
decoded_intent = raw_intent.strip() if isinstance(raw_intent, str) else ""
|
|
558
|
+
if not decoded_intent:
|
|
559
|
+
violations.append("decoded_intent must be a nonblank string")
|
|
560
|
+
|
|
561
|
+
sensitive_prompt = bool(SENSITIVE_RE.search(prompt)) if prompt else False
|
|
562
|
+
sensitive_diff = bool(repo_facts.get("diff_sensitive_paths"))
|
|
563
|
+
is_sensitive = sensitive_prompt or sensitive_diff
|
|
564
|
+
minimal_opt_out = has_minimal_opt_out(prompt) if prompt else False
|
|
565
|
+
hardcore_system = bool(HARDCORE_SYSTEM_RE.search(prompt)) if prompt else False
|
|
566
|
+
raw_hardcore = decision.get("hardcore_mode", True)
|
|
567
|
+
if not isinstance(raw_hardcore, bool):
|
|
568
|
+
violations.append(f"hardcore_mode must be boolean, got {raw_hardcore!r}")
|
|
569
|
+
hardcore_mode = True
|
|
570
|
+
else:
|
|
571
|
+
hardcore_mode = raw_hardcore
|
|
572
|
+
hardcore_ceiling = str(decision.get("hardcore_ceiling", "")).strip()
|
|
573
|
+
|
|
574
|
+
is_flexible = primary in FLEXIBLE_SIZE_MODES
|
|
575
|
+
is_read_only = (primary in READ_ONLY_MODES) and not is_flexible
|
|
576
|
+
if is_read_only and size != "none":
|
|
577
|
+
violations.append(f"read-only/discovery mode {primary!r} must have size 'none', got {size!r}")
|
|
578
|
+
if primary and not is_read_only and not is_flexible and size == "none":
|
|
579
|
+
violations.append(f"execution mode {primary!r} cannot have size 'none'")
|
|
580
|
+
if is_sensitive and size == "S":
|
|
581
|
+
violations.append("sensitive domain or diff (auth/secrets/migrations/payments/CI/agent-config) cannot be sized S; use M or L")
|
|
582
|
+
if is_sensitive and not is_read_only and size != "none" and self_grill_mode not in ("checks", "both"):
|
|
583
|
+
violations.append("sensitive execution work requires post-edit diff verification; set self_grill to 'both' or 'checks'")
|
|
584
|
+
if primary and not is_read_only and size != "none" and not hardcore_mode and not minimal_opt_out and primary != "prototype":
|
|
585
|
+
violations.append("Hardcore Mode is ON by default; do not set hardcore_mode=false without an explicit minimal/prototype opt-out in the user prompt")
|
|
586
|
+
if primary and not is_read_only and size == "S" and not minimal_opt_out and (hardcore_system or len(deliverables) >= 2):
|
|
587
|
+
violations.append("ambitious hardcore or multi-deliverable task cannot be under-sized to S; use M or L")
|
|
588
|
+
|
|
589
|
+
why_not = str(decision.get("why_not_runner_up", "")).strip()
|
|
590
|
+
if primary == "tournament" and prompt and CONCRETE_ANCHOR_RE.search(prompt) and len(why_not) < 15:
|
|
591
|
+
violations.append("routing to 'tournament' despite concrete file/PR/anchor requires a concrete why_not_runner_up justification")
|
|
592
|
+
|
|
593
|
+
claimed_critic = bool(decision.get("critic_reviewed", False))
|
|
594
|
+
if claimed_critic and critic_round < 2:
|
|
595
|
+
violations.append("critic_reviewed=true is only valid on --critic-round 2 after a Round-1 CRITIC_REQUIRED pass")
|
|
596
|
+
critic_verified = claimed_critic and critic_round >= 2
|
|
597
|
+
|
|
598
|
+
critic_reasons: list[str] = []
|
|
599
|
+
if confidence < 0.80 and not critic_verified:
|
|
600
|
+
critic_reasons.append(f"confidence {confidence:.2f} < 0.80")
|
|
601
|
+
|
|
602
|
+
spec_hints = detect_specialized_signals(prompt) if (prompt and enforce_regex_hints) else []
|
|
603
|
+
if spec_hints and primary not in spec_hints and not critic_verified:
|
|
604
|
+
critic_reasons.append(
|
|
605
|
+
f"prompt contains specialized signal(s) {spec_hints} but router picked {primary!r}"
|
|
606
|
+
)
|
|
607
|
+
|
|
608
|
+
present_skill_roots = {r.split("/")[2] if r.startswith("skill://") else r.split("/")[0] for r in ref_list}
|
|
609
|
+
expected_refs = detect_expected_reference_skills(prompt, sibling_skills) if prompt else []
|
|
610
|
+
missing_refs = [r for r in expected_refs if r.removeprefix("skill://") not in present_skill_roots]
|
|
611
|
+
if missing_refs:
|
|
612
|
+
warnings.append(f"recommended reference_skills omitted: {missing_refs}")
|
|
613
|
+
auto_repairs["add_reference_skills"] = missing_refs
|
|
614
|
+
struggle_hit = bool(STRUGGLE_SIGNAL_RE.search(prompt)) if prompt else False
|
|
615
|
+
if struggle_hit and size == "S":
|
|
616
|
+
violations.append("user is stuck/struggling; do not under-size to S — use M/L with self_grill and attack-the-premise")
|
|
617
|
+
|
|
618
|
+
if (size in ("M", "L") and not is_read_only) or struggle_hit:
|
|
619
|
+
missing_sec = [t for t in ("self-grill", "no-comments") if t not in sec_list and primary != t] if not is_read_only else (["self-grill"] if "self-grill" not in sec_list and primary != "self-grill" else [])
|
|
620
|
+
if struggle_hit and "why" not in sec_list and primary != "why":
|
|
621
|
+
missing_sec.append("why")
|
|
622
|
+
if is_sensitive and "security-audit" not in sec_list and primary != "security-audit":
|
|
623
|
+
missing_sec.append("security-audit")
|
|
624
|
+
if hardcore_mode and (size == "L" or hardcore_system) and len(deliverables) >= 2 and "architect" not in sec_list and primary != "architect":
|
|
625
|
+
missing_sec.append("architect")
|
|
626
|
+
if missing_sec:
|
|
627
|
+
warnings.append(f"recommended secondary_techniques omitted for {size} work: {missing_sec}")
|
|
628
|
+
auto_repairs["add_secondary_techniques"] = missing_sec
|
|
629
|
+
|
|
630
|
+
final_sec = sorted(set(sec_list) | set(auto_repairs.get("add_secondary_techniques", [])))
|
|
631
|
+
for tech in final_sec:
|
|
632
|
+
if tech not in techniques:
|
|
633
|
+
violations.append(f"unknown secondary_technique {tech!r}: not found in references/techniques/")
|
|
634
|
+
|
|
635
|
+
if violations:
|
|
636
|
+
status = "REJECTED"
|
|
637
|
+
elif critic_reasons:
|
|
638
|
+
status = "CRITIC_REQUIRED"
|
|
639
|
+
else:
|
|
640
|
+
status = "APPROVED"
|
|
641
|
+
|
|
642
|
+
critic_prompt = ""
|
|
643
|
+
if status != "APPROVED":
|
|
644
|
+
next_round = min(2, max(2, critic_round))
|
|
645
|
+
critic_prompt = (
|
|
646
|
+
f"You are the Adversarial Route Critic (round {next_round} of 2). Attack the proposed route decision below. "
|
|
647
|
+
"Check: (1) based on what the user literally typed, does a more specific playbook or technique fit better than primary_mode? "
|
|
648
|
+
"(2) did the decoded intent or deliverables drop a user goal, substitute a proxy, or widen authorization? "
|
|
649
|
+
"(3) are size, self_grill, secondary_techniques, and reference_skills accurate and safe? "
|
|
650
|
+
"Output ONLY the corrected full JSON decision with \"critic_reviewed\": true.\n\n"
|
|
651
|
+
f"Original prompt: {prompt}\n"
|
|
652
|
+
f"Proposed decision: {json.dumps(decision, indent=2)}\n"
|
|
653
|
+
f"Gate violations: {violations}\n"
|
|
654
|
+
f"Critic triggers: {critic_reasons}\n"
|
|
655
|
+
f"Auto-repair hints: {json.dumps(auto_repairs)}"
|
|
656
|
+
)
|
|
657
|
+
|
|
658
|
+
if size == "S":
|
|
659
|
+
model_tier, effort = "S", "low"
|
|
660
|
+
elif primary in ("investigation", "recall", "flows", "worktree-cleanup"):
|
|
661
|
+
model_tier, effort = "S", "medium"
|
|
662
|
+
elif size == "L" or primary in ("tournament", "architecture-review", "security-audit", "interrogate", "arena", "formal-verification"):
|
|
663
|
+
model_tier, effort = "L", "xhigh"
|
|
664
|
+
elif is_sensitive or is_read_only:
|
|
665
|
+
model_tier, effort = "L", "high"
|
|
666
|
+
else:
|
|
667
|
+
model_tier, effort = "M", "medium"
|
|
668
|
+
|
|
669
|
+
final_refs = sorted(set(ref_list) | set(auto_repairs.get("add_reference_skills", [])))
|
|
670
|
+
if status == "APPROVED":
|
|
671
|
+
read_targets = list(dict.fromkeys([
|
|
672
|
+
route_file if route_file.startswith("skill://") else f"skill://deepmodebot/{route_file}",
|
|
673
|
+
*(f"skill://deepmodebot/{techniques[t]['file']}" for t in final_sec),
|
|
674
|
+
*final_refs,
|
|
675
|
+
]))
|
|
676
|
+
qg = _load_sibling("ar_quota_guard", "quota-guard/quota_guard.py")
|
|
677
|
+
outer_harness = qg.detect_outer_harness(root=safe_root)
|
|
678
|
+
lean_quota = bool(decision.get("lean_mode")) or (bool(LEAN_QUOTA_RE.search(prompt)) if prompt else False)
|
|
679
|
+
is_merge_gate = primary in ("shipping", "opening-a-pr", "pr-conversation", "work-a-queue")
|
|
680
|
+
quota_budget = qg.compute_quota_plan(
|
|
681
|
+
size=size if size in ("S", "M", "L", "none") else "M",
|
|
682
|
+
mode=primary,
|
|
683
|
+
diff_lines=int(repo_facts.get("diff_lines", 0) or 0),
|
|
684
|
+
is_sensitive=is_sensitive,
|
|
685
|
+
outer_harness=outer_harness,
|
|
686
|
+
lean_mode=lean_quota,
|
|
687
|
+
is_merge_gate=is_merge_gate,
|
|
688
|
+
)
|
|
689
|
+
if quota_budget["nested_anti_stacking"] or lean_quota:
|
|
690
|
+
panel_seats = []
|
|
691
|
+
else:
|
|
692
|
+
panel_seats = list(DEFAULT_PANEL_SEATS) if (size == "L" or primary in ("tournament", "arena", "interrogate", "security-audit", "shipping")) else []
|
|
693
|
+
|
|
694
|
+
return {
|
|
695
|
+
"status": status,
|
|
696
|
+
"critic_round": critic_round,
|
|
697
|
+
"violations": violations,
|
|
698
|
+
"critic_reasons": critic_reasons,
|
|
699
|
+
"warnings": warnings,
|
|
700
|
+
"auto_repairs": auto_repairs,
|
|
701
|
+
"critic_prompt": critic_prompt,
|
|
702
|
+
"locked_plan": {
|
|
703
|
+
"decoded_intent": decoded_intent,
|
|
704
|
+
"primary_mode": primary,
|
|
705
|
+
"route_file": route_file,
|
|
706
|
+
"secondary_techniques": final_sec,
|
|
707
|
+
"reference_skills": final_refs,
|
|
708
|
+
"read_targets": read_targets,
|
|
709
|
+
"size": size,
|
|
710
|
+
"self_grill": self_grill_mode,
|
|
711
|
+
"hardcore_mode": hardcore_mode,
|
|
712
|
+
"hardcore_ceiling": hardcore_ceiling,
|
|
713
|
+
"model_tier": model_tier,
|
|
714
|
+
"effort": effort,
|
|
715
|
+
"panel_seats": panel_seats,
|
|
716
|
+
"quota_budget": quota_budget,
|
|
717
|
+
"deliverables": deliverables,
|
|
718
|
+
} if status == "APPROVED" else None,
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
def _extract_json_object(raw_text: str) -> dict:
|
|
723
|
+
text = raw_text.strip()
|
|
724
|
+
if not text:
|
|
725
|
+
raise ValueError("empty LLM response")
|
|
726
|
+
try:
|
|
727
|
+
outer = json.loads(text)
|
|
728
|
+
if isinstance(outer, dict):
|
|
729
|
+
if "primary_mode" in outer:
|
|
730
|
+
return outer
|
|
731
|
+
for key in ("result", "response", "text", "output", "content", "message"):
|
|
732
|
+
val = outer.get(key)
|
|
733
|
+
if isinstance(val, dict) and "primary_mode" in val:
|
|
734
|
+
return val
|
|
735
|
+
if isinstance(val, str) and "{" in val:
|
|
736
|
+
text = val.strip()
|
|
737
|
+
break
|
|
738
|
+
except ValueError:
|
|
739
|
+
pass
|
|
740
|
+
|
|
741
|
+
fenced = re.search(r"```(?:json)?\s*(\{.*?\})\s*```", text, re.S)
|
|
742
|
+
if fenced:
|
|
743
|
+
try:
|
|
744
|
+
parsed_fenced = json.loads(fenced.group(1))
|
|
745
|
+
if isinstance(parsed_fenced, dict):
|
|
746
|
+
return parsed_fenced
|
|
747
|
+
except ValueError:
|
|
748
|
+
pass
|
|
749
|
+
decoder = json.JSONDecoder()
|
|
750
|
+
best_dict: dict | None = None
|
|
751
|
+
best_span = -1
|
|
752
|
+
idx = text.find("{")
|
|
753
|
+
while idx >= 0:
|
|
754
|
+
try:
|
|
755
|
+
obj, end_idx = decoder.raw_decode(text, idx)
|
|
756
|
+
if isinstance(obj, dict):
|
|
757
|
+
if "primary_mode" in obj:
|
|
758
|
+
return obj
|
|
759
|
+
if (end_idx - idx) > best_span:
|
|
760
|
+
best_dict = obj
|
|
761
|
+
best_span = end_idx - idx
|
|
762
|
+
except ValueError:
|
|
763
|
+
pass
|
|
764
|
+
idx = text.find("{", idx + 1)
|
|
765
|
+
if best_dict is not None:
|
|
766
|
+
return best_dict
|
|
767
|
+
raise ValueError(f"could not locate JSON object in LLM output: {text[:200]!r}")
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
def _prefer_native_exe_on_windows(name: str, found: str) -> str:
|
|
771
|
+
if os.name != "nt" or not found.lower().endswith((".cmd", ".bat")):
|
|
772
|
+
return found
|
|
773
|
+
if name == "agy":
|
|
774
|
+
local_agy = Path(os.environ.get("LOCALAPPDATA", "")) / "agy" / "bin" / "agy.exe"
|
|
775
|
+
if local_agy.is_file():
|
|
776
|
+
return str(local_agy)
|
|
777
|
+
sibling_exe = Path(found).with_suffix(".exe")
|
|
778
|
+
if sibling_exe.is_file():
|
|
779
|
+
return str(sibling_exe)
|
|
780
|
+
return found
|
|
781
|
+
|
|
782
|
+
|
|
783
|
+
def _resolve_subscription_harness(harness: str) -> tuple[str, list[str]]:
|
|
784
|
+
choice = harness.lower().strip()
|
|
785
|
+
if choice == "omp":
|
|
786
|
+
raise SystemExit("refusing 'omp' harness for LLM routing: omp model token spend is forbidden; use agy, claude, or codex")
|
|
787
|
+
candidates = ("agy", "claude", "codex") if choice == "auto" else (choice,)
|
|
788
|
+
for name in candidates:
|
|
789
|
+
exe = shutil.which(name)
|
|
790
|
+
if not exe:
|
|
791
|
+
continue
|
|
792
|
+
exe = _prefer_native_exe_on_windows(name, exe)
|
|
793
|
+
if name == "agy":
|
|
794
|
+
return "agy", [exe, "-p"]
|
|
795
|
+
if name == "claude":
|
|
796
|
+
return "claude", [exe, "-p", "--tools", "", "--output-format", "json"]
|
|
797
|
+
if name == "codex":
|
|
798
|
+
return "codex", [exe, "exec", "-s", "read-only", "--skip-git-repo-check"]
|
|
799
|
+
raise SystemExit(f"no subscription LLM CLI found for harness={harness!r} (checked: {', '.join(candidates)})")
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
def invoke_subscription_llm(prompt_text: str, harness: str = "auto", cwd: Path | None = None, timeout_sec: int = 90) -> str:
|
|
803
|
+
resolved_name, base_cmd = _resolve_subscription_harness(harness)
|
|
804
|
+
env = {k: v for k, v in os.environ.items() if k not in STRIPPED_API_KEY_VARS}
|
|
805
|
+
cmd = [*base_cmd, prompt_text]
|
|
806
|
+
res = subprocess.run(
|
|
807
|
+
cmd,
|
|
808
|
+
cwd=str(cwd) if cwd else None,
|
|
809
|
+
env=env,
|
|
810
|
+
capture_output=True,
|
|
811
|
+
text=True,
|
|
812
|
+
encoding="utf-8",
|
|
813
|
+
errors="replace",
|
|
814
|
+
timeout=timeout_sec,
|
|
815
|
+
check=False,
|
|
816
|
+
creationflags=NO_WINDOW,
|
|
817
|
+
)
|
|
818
|
+
if res.returncode != 0:
|
|
819
|
+
raise RuntimeError(f"{resolved_name} exited {res.returncode}: {(res.stderr or res.stdout).strip()[:300]}")
|
|
820
|
+
return res.stdout
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
def route_with_llm(
|
|
824
|
+
prompt: str,
|
|
825
|
+
root: Path | None = None,
|
|
826
|
+
harness: str = "auto",
|
|
827
|
+
llm_runner: Callable[[str, int], str | dict] | None = None,
|
|
828
|
+
) -> dict:
|
|
829
|
+
packet = build_menu_packet(prompt, root=root)
|
|
830
|
+
safe_root = Path(packet["repo_facts"]["root"]) if packet["repo_facts"].get("has_root") else None
|
|
831
|
+
runner = llm_runner or (lambda p, _r: invoke_subscription_llm(p, harness=harness, cwd=safe_root))
|
|
832
|
+
|
|
833
|
+
raw_r1 = runner(packet["llm_router_prompt"], 1)
|
|
834
|
+
dec_r1 = raw_r1 if isinstance(raw_r1, dict) else _extract_json_object(str(raw_r1))
|
|
835
|
+
ver_r1 = verify_decision(dec_r1, prompt=packet["prompt"], root=safe_root, critic_round=1)
|
|
836
|
+
rounds = [{"round": 1, "decision": dec_r1, "verification": ver_r1}]
|
|
837
|
+
|
|
838
|
+
if ver_r1["status"] == "APPROVED":
|
|
839
|
+
return {
|
|
840
|
+
"status": "APPROVED",
|
|
841
|
+
"routing_engine": "llm-semantic",
|
|
842
|
+
"rounds_used": 1,
|
|
843
|
+
"locked_plan": ver_r1["locked_plan"],
|
|
844
|
+
"rounds": rounds,
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
raw_r2 = runner(ver_r1["critic_prompt"], 2)
|
|
848
|
+
dec_r2 = raw_r2 if isinstance(raw_r2, dict) else _extract_json_object(str(raw_r2))
|
|
849
|
+
dec_r2["critic_reviewed"] = True
|
|
850
|
+
ver_r2 = verify_decision(dec_r2, prompt=packet["prompt"], root=safe_root, critic_round=2)
|
|
851
|
+
rounds.append({"round": 2, "decision": dec_r2, "verification": ver_r2})
|
|
852
|
+
|
|
853
|
+
return {
|
|
854
|
+
"status": ver_r2["status"],
|
|
855
|
+
"routing_engine": "llm-semantic",
|
|
856
|
+
"rounds_used": 2,
|
|
857
|
+
"locked_plan": ver_r2["locked_plan"],
|
|
858
|
+
"violations": ver_r2["violations"],
|
|
859
|
+
"rounds": rounds,
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
def evaluate_reroute(root: Path, current_mode: str, current_size: str, failed_attempts: int = 0, competing_shapes: int = 1) -> dict:
|
|
864
|
+
repo_facts = gather_repo_facts(root)
|
|
865
|
+
triggers: list[str] = []
|
|
866
|
+
new_size = current_size
|
|
867
|
+
add_techniques: list[str] = []
|
|
868
|
+
add_principles: list[str] = []
|
|
869
|
+
recommended_mode = current_mode
|
|
870
|
+
|
|
871
|
+
size_rank = {"none": 0, "S": 1, "M": 2, "L": 3}
|
|
872
|
+
diff_size = repo_facts.get("diff_size", "none")
|
|
873
|
+
if size_rank.get(diff_size, 0) > size_rank.get(current_size, 0):
|
|
874
|
+
triggers.append(f"diff grew from {current_size} to {diff_size} ({repo_facts['diff_files']} files)")
|
|
875
|
+
new_size = diff_size
|
|
876
|
+
|
|
877
|
+
if repo_facts.get("diff_sensitive_paths"):
|
|
878
|
+
triggers.append(f"diff touched sensitive path(s): {repo_facts['diff_sensitive_paths'][:3]}")
|
|
879
|
+
if new_size in ("none", "S"):
|
|
880
|
+
new_size = "M"
|
|
881
|
+
add_techniques.extend(["security-audit", "self-grill"])
|
|
882
|
+
|
|
883
|
+
if failed_attempts >= 2:
|
|
884
|
+
triggers.append(f"{failed_attempts} failed attempts sharing a premise -> pause and apply attack-the-premise")
|
|
885
|
+
add_techniques.append("self-grill")
|
|
886
|
+
add_principles.append("attack-the-premise")
|
|
887
|
+
if current_mode in ("bug-fix", "feature"):
|
|
888
|
+
recommended_mode = "investigation"
|
|
889
|
+
|
|
890
|
+
if competing_shapes >= 2:
|
|
891
|
+
triggers.append(f"{competing_shapes} competing design shapes -> sketch with architect or arena")
|
|
892
|
+
add_techniques.append("architect" if competing_shapes == 2 else "arena")
|
|
893
|
+
|
|
894
|
+
if repo_facts.get("diff_added_comments", 0) > 0:
|
|
895
|
+
triggers.append(f"diff added {repo_facts['diff_added_comments']} code comment(s) -> run no-comments")
|
|
896
|
+
add_techniques.append("no-comments")
|
|
897
|
+
if repo_facts.get("diff_workaround_smells", 0) > 0:
|
|
898
|
+
triggers.append(f"diff added {repo_facts['diff_workaround_smells']} workaround smell(s) -> run self-grill")
|
|
899
|
+
add_techniques.append("self-grill")
|
|
900
|
+
|
|
901
|
+
return {
|
|
902
|
+
"reroute_needed": bool(triggers),
|
|
903
|
+
"current_mode": current_mode,
|
|
904
|
+
"recommended_mode": recommended_mode,
|
|
905
|
+
"current_size": current_size,
|
|
906
|
+
"recommended_size": new_size,
|
|
907
|
+
"add_techniques": sorted(set(add_techniques)),
|
|
908
|
+
"add_principles": sorted(set(add_principles)),
|
|
909
|
+
"triggers": triggers,
|
|
910
|
+
"repo_facts": repo_facts,
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
def cmd_route(args: argparse.Namespace) -> int:
|
|
915
|
+
raw = sys.stdin.read() if args.stdin else (args.prompt or "")
|
|
916
|
+
root = Path(args.root) if args.root else None
|
|
917
|
+
res = route_with_llm(raw, root=root, harness=args.harness)
|
|
918
|
+
if args.json:
|
|
919
|
+
print(json.dumps(res, indent=2))
|
|
920
|
+
else:
|
|
921
|
+
plan = res.get("locked_plan") or {}
|
|
922
|
+
print(
|
|
923
|
+
f"autoroute ({res['routing_engine']}, rounds={res['rounds_used']}): {res['status']} "
|
|
924
|
+
f"mode={plan.get('primary_mode')} file={plan.get('route_file')} size={plan.get('size')}"
|
|
925
|
+
)
|
|
926
|
+
return 0 if res["status"] == "APPROVED" else 2
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
def cmd_menu(args: argparse.Namespace) -> int:
|
|
930
|
+
raw = sys.stdin.read() if args.stdin else (args.prompt or "")
|
|
931
|
+
root = Path(args.root) if args.root else None
|
|
932
|
+
packet = build_menu_packet(raw, root=root)
|
|
933
|
+
if args.json:
|
|
934
|
+
print(json.dumps(packet, indent=2))
|
|
935
|
+
else:
|
|
936
|
+
print(packet["llm_router_prompt"])
|
|
937
|
+
return 0
|
|
938
|
+
|
|
939
|
+
|
|
940
|
+
def cmd_verify(args: argparse.Namespace) -> int:
|
|
941
|
+
if args.strict and not (args.prompt or "").strip():
|
|
942
|
+
raise SystemExit("verify --strict requires a non-empty --prompt")
|
|
943
|
+
raw_dec = sys.stdin.read() if args.decision_stdin else Path(args.decision_file).read_text(encoding="utf-8")
|
|
944
|
+
try:
|
|
945
|
+
decision = json.loads(raw_dec)
|
|
946
|
+
except ValueError as err:
|
|
947
|
+
raise SystemExit(f"invalid decision JSON: {err}") from err
|
|
948
|
+
root = Path(args.root) if args.root else None
|
|
949
|
+
res = verify_decision(decision, prompt=args.prompt or "", root=root, critic_round=args.critic_round)
|
|
950
|
+
if args.json:
|
|
951
|
+
print(json.dumps(res, indent=2))
|
|
952
|
+
else:
|
|
953
|
+
print(f"autoroute: {res['status']} violations={len(res['violations'])} critic_reasons={len(res['critic_reasons'])}")
|
|
954
|
+
if args.strict and res["status"] != "APPROVED":
|
|
955
|
+
return 2
|
|
956
|
+
return 0
|
|
957
|
+
|
|
958
|
+
|
|
959
|
+
def cmd_reroute(args: argparse.Namespace) -> int:
|
|
960
|
+
res = evaluate_reroute(
|
|
961
|
+
Path(args.root),
|
|
962
|
+
current_mode=args.current_mode,
|
|
963
|
+
current_size=args.current_size,
|
|
964
|
+
failed_attempts=args.failed_attempts,
|
|
965
|
+
competing_shapes=args.competing_shapes,
|
|
966
|
+
)
|
|
967
|
+
if args.json:
|
|
968
|
+
print(json.dumps(res, indent=2))
|
|
969
|
+
else:
|
|
970
|
+
print(
|
|
971
|
+
f"reroute_needed={res['reroute_needed']} mode={res['current_mode']}->{res['recommended_mode']} "
|
|
972
|
+
f"size={res['current_size']}->{res['recommended_size']} add={res['add_techniques']}"
|
|
973
|
+
)
|
|
974
|
+
return 0
|
|
975
|
+
|
|
976
|
+
|
|
977
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
978
|
+
parser = argparse.ArgumentParser(description="Pure LLM semantic auto-routing loop with checks and balances.")
|
|
979
|
+
sub = parser.add_subparsers(dest="cmd", required=True)
|
|
980
|
+
|
|
981
|
+
p_rt = sub.add_parser("route", help="Semantically route a user prompt using the subscription LLM + 2-round verifier.")
|
|
982
|
+
p_rt.add_argument("--stdin", action="store_true")
|
|
983
|
+
p_rt.add_argument("--prompt", default="")
|
|
984
|
+
p_rt.add_argument("--root", default=None)
|
|
985
|
+
p_rt.add_argument("--harness", choices=("auto", "agy", "claude", "codex"), default="auto")
|
|
986
|
+
p_rt.add_argument("--json", action="store_true")
|
|
987
|
+
p_rt.set_defaults(func=cmd_route)
|
|
988
|
+
|
|
989
|
+
p_menu = sub.add_parser("menu", help="Build live disk catalog menu and repo facts packet for the LLM router.")
|
|
990
|
+
p_menu.add_argument("--stdin", action="store_true")
|
|
991
|
+
p_menu.add_argument("--prompt", default="")
|
|
992
|
+
p_menu.add_argument("--root", default=None)
|
|
993
|
+
p_menu.add_argument("--json", action="store_true")
|
|
994
|
+
p_menu.set_defaults(func=cmd_menu)
|
|
995
|
+
|
|
996
|
+
p_ver = sub.add_parser("verify", help="Verify an LLM route decision against checks and balances.")
|
|
997
|
+
p_ver.add_argument("--root", default=None)
|
|
998
|
+
p_ver.add_argument("--prompt", default="")
|
|
999
|
+
dec_group = p_ver.add_mutually_exclusive_group(required=True)
|
|
1000
|
+
dec_group.add_argument("--decision-stdin", action="store_true")
|
|
1001
|
+
dec_group.add_argument("--decision-file", default=None)
|
|
1002
|
+
p_ver.add_argument("--critic-round", type=int, choices=(1, 2), default=1)
|
|
1003
|
+
p_ver.add_argument("--strict", action="store_true")
|
|
1004
|
+
p_ver.add_argument("--json", action="store_true")
|
|
1005
|
+
p_ver.set_defaults(func=cmd_verify)
|
|
1006
|
+
|
|
1007
|
+
p_re = sub.add_parser("reroute", help="Evaluate mid-flight re-route triggers from live repo state.")
|
|
1008
|
+
p_re.add_argument("--root", required=True)
|
|
1009
|
+
p_re.add_argument("--current-mode", required=True)
|
|
1010
|
+
p_re.add_argument("--current-size", choices=("S", "M", "L", "none"), required=True)
|
|
1011
|
+
p_re.add_argument("--failed-attempts", type=int, default=0)
|
|
1012
|
+
p_re.add_argument("--competing-shapes", type=int, default=1)
|
|
1013
|
+
p_re.add_argument("--json", action="store_true")
|
|
1014
|
+
p_re.set_defaults(func=cmd_reroute)
|
|
1015
|
+
|
|
1016
|
+
return parser
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
def main(argv: list[str] | None = None) -> int:
|
|
1020
|
+
parser = build_parser()
|
|
1021
|
+
args = parser.parse_args(argv)
|
|
1022
|
+
return args.func(args)
|
|
1023
|
+
|
|
1024
|
+
|
|
1025
|
+
if __name__ == "__main__":
|
|
1026
|
+
raise SystemExit(main())
|