@takuma-hirai/hirai-method 0.1.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/.claude/.stale-harness-state/last-check +0 -0
- package/.claude/CommonRules.md +121 -0
- package/.claude/agents/01-core-development/api-designer.md +237 -0
- package/.claude/agents/01-core-development/backend-developer.md +222 -0
- package/.claude/agents/01-core-development/design-bridge.md +127 -0
- package/.claude/agents/01-core-development/electron-pro.md +240 -0
- package/.claude/agents/01-core-development/frontend-developer.md +133 -0
- package/.claude/agents/01-core-development/fullstack-developer.md +235 -0
- package/.claude/agents/01-core-development/graphql-architect.md +238 -0
- package/.claude/agents/01-core-development/microservices-architect.md +239 -0
- package/.claude/agents/01-core-development/mobile-developer.md +283 -0
- package/.claude/agents/01-core-development/ui-designer.md +174 -0
- package/.claude/agents/01-core-development/websocket-engineer.md +150 -0
- package/.claude/agents/03-infrastructure/azure-infra-engineer.md +53 -0
- package/.claude/agents/03-infrastructure/cloud-architect.md +277 -0
- package/.claude/agents/03-infrastructure/database-administrator.md +287 -0
- package/.claude/agents/03-infrastructure/deployment-engineer.md +287 -0
- package/.claude/agents/03-infrastructure/devops-engineer.md +287 -0
- package/.claude/agents/03-infrastructure/devops-incident-responder.md +287 -0
- package/.claude/agents/03-infrastructure/docker-expert.md +278 -0
- package/.claude/agents/03-infrastructure/incident-responder.md +287 -0
- package/.claude/agents/03-infrastructure/kubernetes-specialist.md +287 -0
- package/.claude/agents/03-infrastructure/network-engineer.md +287 -0
- package/.claude/agents/03-infrastructure/platform-engineer.md +287 -0
- package/.claude/agents/03-infrastructure/security-engineer.md +277 -0
- package/.claude/agents/03-infrastructure/sre-engineer.md +287 -0
- package/.claude/agents/03-infrastructure/terraform-engineer.md +287 -0
- package/.claude/agents/03-infrastructure/terragrunt-expert.md +307 -0
- package/.claude/agents/03-infrastructure/windows-infra-admin.md +52 -0
- package/.claude/agents/04-quality-security/accessibility-tester.md +277 -0
- package/.claude/agents/04-quality-security/ad-security-reviewer.md +56 -0
- package/.claude/agents/04-quality-security/ai-writing-auditor.md +77 -0
- package/.claude/agents/04-quality-security/architect-reviewer.md +287 -0
- package/.claude/agents/04-quality-security/chaos-engineer.md +277 -0
- package/.claude/agents/04-quality-security/code-reviewer.md +287 -0
- package/.claude/agents/04-quality-security/compliance-auditor.md +277 -0
- package/.claude/agents/04-quality-security/debugger.md +287 -0
- package/.claude/agents/04-quality-security/error-detective.md +287 -0
- package/.claude/agents/04-quality-security/penetration-tester.md +287 -0
- package/.claude/agents/04-quality-security/performance-engineer.md +287 -0
- package/.claude/agents/04-quality-security/powershell-security-hardening.md +54 -0
- package/.claude/agents/04-quality-security/qa-expert.md +287 -0
- package/.claude/agents/04-quality-security/security-auditor.md +287 -0
- package/.claude/agents/04-quality-security/test-automator.md +287 -0
- package/.claude/agents/04-quality-security/ui-ux-tester.md +234 -0
- package/.claude/agents/06-developer-experience/build-engineer.md +286 -0
- package/.claude/agents/06-developer-experience/cli-developer.md +286 -0
- package/.claude/agents/06-developer-experience/dependency-manager.md +286 -0
- package/.claude/agents/06-developer-experience/documentation-engineer.md +276 -0
- package/.claude/agents/06-developer-experience/dx-optimizer.md +286 -0
- package/.claude/agents/06-developer-experience/git-workflow-manager.md +286 -0
- package/.claude/agents/06-developer-experience/legacy-modernizer.md +286 -0
- package/.claude/agents/06-developer-experience/mcp-developer.md +275 -0
- package/.claude/agents/06-developer-experience/powershell-module-architect.md +58 -0
- package/.claude/agents/06-developer-experience/powershell-ui-architect.md +135 -0
- package/.claude/agents/06-developer-experience/readme-generator.md +238 -0
- package/.claude/agents/06-developer-experience/refactoring-specialist.md +286 -0
- package/.claude/agents/06-developer-experience/slack-expert.md +232 -0
- package/.claude/agents/06-developer-experience/tooling-engineer.md +286 -0
- package/.claude/agents/09-meta-orchestration/agent-installer.md +97 -0
- package/.claude/agents/09-meta-orchestration/agent-organizer.md +287 -0
- package/.claude/agents/09-meta-orchestration/codebase-orchestrator.md +249 -0
- package/.claude/agents/09-meta-orchestration/context-manager.md +287 -0
- package/.claude/agents/09-meta-orchestration/error-coordinator.md +287 -0
- package/.claude/agents/09-meta-orchestration/it-ops-orchestrator.md +60 -0
- package/.claude/agents/09-meta-orchestration/knowledge-synthesizer.md +287 -0
- package/.claude/agents/09-meta-orchestration/multi-agent-coordinator.md +287 -0
- package/.claude/agents/09-meta-orchestration/performance-monitor.md +287 -0
- package/.claude/agents/09-meta-orchestration/task-distributor.md +287 -0
- package/.claude/agents/09-meta-orchestration/workflow-orchestrator.md +287 -0
- package/.claude/agents/10-research-analysis/competitive-analyst.md +287 -0
- package/.claude/agents/10-research-analysis/data-researcher.md +287 -0
- package/.claude/agents/10-research-analysis/market-researcher.md +287 -0
- package/.claude/agents/10-research-analysis/project-idea-validator.md +269 -0
- package/.claude/agents/10-research-analysis/research-analyst.md +287 -0
- package/.claude/agents/10-research-analysis/scientific-literature-researcher.md +151 -0
- package/.claude/agents/10-research-analysis/search-specialist.md +287 -0
- package/.claude/agents/10-research-analysis/trend-analyst.md +287 -0
- package/.claude/archive/README.md +47 -0
- package/.claude/archive/agents/02-language-specialists/angular-architect.md +287 -0
- package/.claude/archive/agents/02-language-specialists/cpp-pro.md +277 -0
- package/.claude/archive/agents/02-language-specialists/csharp-developer.md +287 -0
- package/.claude/archive/agents/02-language-specialists/django-developer.md +287 -0
- package/.claude/archive/agents/02-language-specialists/dotnet-core-expert.md +287 -0
- package/.claude/archive/agents/02-language-specialists/dotnet-framework-4.8-expert.md +306 -0
- package/.claude/archive/agents/02-language-specialists/elixir-expert.md +311 -0
- package/.claude/archive/agents/02-language-specialists/expo-react-native-expert.md +268 -0
- package/.claude/archive/agents/02-language-specialists/fastapi-developer.md +287 -0
- package/.claude/archive/agents/02-language-specialists/flutter-expert.md +287 -0
- package/.claude/archive/agents/02-language-specialists/golang-pro.md +277 -0
- package/.claude/archive/agents/02-language-specialists/java-architect.md +287 -0
- package/.claude/archive/agents/02-language-specialists/javascript-pro.md +277 -0
- package/.claude/archive/agents/02-language-specialists/kotlin-specialist.md +287 -0
- package/.claude/archive/agents/02-language-specialists/laravel-specialist.md +287 -0
- package/.claude/archive/agents/02-language-specialists/nextjs-developer.md +287 -0
- package/.claude/archive/agents/02-language-specialists/node-specialist.md +124 -0
- package/.claude/archive/agents/02-language-specialists/php-pro.md +287 -0
- package/.claude/archive/agents/02-language-specialists/powershell-5.1-expert.md +59 -0
- package/.claude/archive/agents/02-language-specialists/powershell-7-expert.md +57 -0
- package/.claude/archive/agents/02-language-specialists/python-pro.md +277 -0
- package/.claude/archive/agents/02-language-specialists/rails-expert.md +358 -0
- package/.claude/archive/agents/02-language-specialists/react-specialist.md +287 -0
- package/.claude/archive/agents/02-language-specialists/rust-engineer.md +287 -0
- package/.claude/archive/agents/02-language-specialists/spring-boot-engineer.md +287 -0
- package/.claude/archive/agents/02-language-specialists/sql-pro.md +287 -0
- package/.claude/archive/agents/02-language-specialists/swift-expert.md +287 -0
- package/.claude/archive/agents/02-language-specialists/symfony-specialist.md +354 -0
- package/.claude/archive/agents/02-language-specialists/typescript-pro.md +277 -0
- package/.claude/archive/agents/02-language-specialists/vue-expert.md +287 -0
- package/.claude/archive/agents/05-data-ai/ai-engineer.md +287 -0
- package/.claude/archive/agents/05-data-ai/data-analyst.md +277 -0
- package/.claude/archive/agents/05-data-ai/data-engineer.md +287 -0
- package/.claude/archive/agents/05-data-ai/data-scientist.md +287 -0
- package/.claude/archive/agents/05-data-ai/database-optimizer.md +287 -0
- package/.claude/archive/agents/05-data-ai/llm-architect.md +287 -0
- package/.claude/archive/agents/05-data-ai/machine-learning-engineer.md +277 -0
- package/.claude/archive/agents/05-data-ai/ml-engineer.md +287 -0
- package/.claude/archive/agents/05-data-ai/mlops-engineer.md +287 -0
- package/.claude/archive/agents/05-data-ai/nlp-engineer.md +287 -0
- package/.claude/archive/agents/05-data-ai/postgres-pro.md +287 -0
- package/.claude/archive/agents/05-data-ai/prompt-engineer.md +287 -0
- package/.claude/archive/agents/05-data-ai/reinforcement-learning-engineer.md +277 -0
- package/.claude/archive/agents/07-specialized-domains/api-documenter.md +277 -0
- package/.claude/archive/agents/07-specialized-domains/blockchain-developer.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/embedded-systems.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/fintech-engineer.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/game-developer.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/healthcare-admin.md +199 -0
- package/.claude/archive/agents/07-specialized-domains/iot-engineer.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/m365-admin.md +48 -0
- package/.claude/archive/agents/07-specialized-domains/mobile-app-developer.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/payment-integration.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/quant-analyst.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/risk-manager.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/seo-specialist.md +184 -0
- package/.claude/archive/agents/08-business-product/business-analyst.md +287 -0
- package/.claude/archive/agents/08-business-product/content-marketer.md +287 -0
- package/.claude/archive/agents/08-business-product/customer-success-manager.md +287 -0
- package/.claude/archive/agents/08-business-product/legal-advisor.md +287 -0
- package/.claude/archive/agents/08-business-product/license-engineer.md +295 -0
- package/.claude/archive/agents/08-business-product/product-manager.md +287 -0
- package/.claude/archive/agents/08-business-product/project-manager.md +287 -0
- package/.claude/archive/agents/08-business-product/sales-engineer.md +287 -0
- package/.claude/archive/agents/08-business-product/scrum-master.md +287 -0
- package/.claude/archive/agents/08-business-product/technical-writer.md +287 -0
- package/.claude/archive/agents/08-business-product/ux-researcher.md +287 -0
- package/.claude/archive/agents/08-business-product/wordpress-master.md +316 -0
- package/.claude/archive/skills/competitive-ads-extractor/SKILL.md +293 -0
- package/.claude/archive/skills/developer-growth-analysis/SKILL.md +322 -0
- package/.claude/archive/skills/document-docx/LICENSE.txt +30 -0
- package/.claude/archive/skills/document-docx/SKILL.md +197 -0
- package/.claude/archive/skills/document-docx/docx-js.md +350 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/mce/mc.xsd +75 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/pack.py +159 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/unpack.py +29 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/validate.py +69 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/validation/__init__.py +15 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/validation/base.py +951 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/validation/docx.py +274 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/validation/pptx.py +315 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/validation/redlining.py +279 -0
- package/.claude/archive/skills/document-docx/ooxml.md +610 -0
- package/.claude/archive/skills/document-docx/scripts/__init__.py +1 -0
- package/.claude/archive/skills/document-docx/scripts/document.py +1276 -0
- package/.claude/archive/skills/document-docx/scripts/templates/comments.xml +3 -0
- package/.claude/archive/skills/document-docx/scripts/templates/commentsExtended.xml +3 -0
- package/.claude/archive/skills/document-docx/scripts/templates/commentsExtensible.xml +3 -0
- package/.claude/archive/skills/document-docx/scripts/templates/commentsIds.xml +3 -0
- package/.claude/archive/skills/document-docx/scripts/templates/people.xml +3 -0
- package/.claude/archive/skills/document-docx/scripts/utilities.py +374 -0
- package/.claude/archive/skills/document-pdf/LICENSE.txt +30 -0
- package/.claude/archive/skills/document-pdf/SKILL.md +294 -0
- package/.claude/archive/skills/document-pdf/forms.md +205 -0
- package/.claude/archive/skills/document-pdf/reference.md +612 -0
- package/.claude/archive/skills/document-pdf/scripts/check_bounding_boxes.py +70 -0
- package/.claude/archive/skills/document-pdf/scripts/check_bounding_boxes_test.py +226 -0
- package/.claude/archive/skills/document-pdf/scripts/check_fillable_fields.py +12 -0
- package/.claude/archive/skills/document-pdf/scripts/convert_pdf_to_images.py +35 -0
- package/.claude/archive/skills/document-pdf/scripts/create_validation_image.py +41 -0
- package/.claude/archive/skills/document-pdf/scripts/extract_form_field_info.py +152 -0
- package/.claude/archive/skills/document-pdf/scripts/fill_fillable_fields.py +114 -0
- package/.claude/archive/skills/document-pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
- package/.claude/archive/skills/document-pptx/LICENSE.txt +30 -0
- package/.claude/archive/skills/document-pptx/SKILL.md +484 -0
- package/.claude/archive/skills/document-pptx/html2pptx.md +625 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/mce/mc.xsd +75 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/pack.py +159 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/unpack.py +29 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/validate.py +69 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/validation/__init__.py +15 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/validation/base.py +951 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/validation/docx.py +274 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/validation/pptx.py +315 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/validation/redlining.py +279 -0
- package/.claude/archive/skills/document-pptx/ooxml.md +427 -0
- package/.claude/archive/skills/document-pptx/scripts/html2pptx.js +979 -0
- package/.claude/archive/skills/document-pptx/scripts/inventory.py +1020 -0
- package/.claude/archive/skills/document-pptx/scripts/rearrange.py +231 -0
- package/.claude/archive/skills/document-pptx/scripts/replace.py +385 -0
- package/.claude/archive/skills/document-pptx/scripts/thumbnail.py +450 -0
- package/.claude/archive/skills/document-xlsx/LICENSE.txt +30 -0
- package/.claude/archive/skills/document-xlsx/SKILL.md +289 -0
- package/.claude/archive/skills/document-xlsx/recalc.py +178 -0
- package/.claude/archive/skills/image-enhancer/SKILL.md +99 -0
- package/.claude/archive/skills/meeting-insights-analyzer/SKILL.md +327 -0
- package/.claude/archive/skills/slack-gif-creator/LICENSE.txt +202 -0
- package/.claude/archive/skills/slack-gif-creator/SKILL.md +646 -0
- package/.claude/archive/skills/slack-gif-creator/core/color_palettes.py +302 -0
- package/.claude/archive/skills/slack-gif-creator/core/easing.py +230 -0
- package/.claude/archive/skills/slack-gif-creator/core/frame_composer.py +469 -0
- package/.claude/archive/skills/slack-gif-creator/core/gif_builder.py +246 -0
- package/.claude/archive/skills/slack-gif-creator/core/typography.py +357 -0
- package/.claude/archive/skills/slack-gif-creator/core/validators.py +264 -0
- package/.claude/archive/skills/slack-gif-creator/core/visual_effects.py +494 -0
- package/.claude/archive/skills/slack-gif-creator/requirements.txt +4 -0
- package/.claude/archive/skills/slack-gif-creator/templates/bounce.py +106 -0
- package/.claude/archive/skills/slack-gif-creator/templates/explode.py +331 -0
- package/.claude/archive/skills/slack-gif-creator/templates/fade.py +329 -0
- package/.claude/archive/skills/slack-gif-creator/templates/flip.py +291 -0
- package/.claude/archive/skills/slack-gif-creator/templates/kaleidoscope.py +211 -0
- package/.claude/archive/skills/slack-gif-creator/templates/morph.py +329 -0
- package/.claude/archive/skills/slack-gif-creator/templates/move.py +293 -0
- package/.claude/archive/skills/slack-gif-creator/templates/pulse.py +268 -0
- package/.claude/archive/skills/slack-gif-creator/templates/shake.py +127 -0
- package/.claude/archive/skills/slack-gif-creator/templates/slide.py +291 -0
- package/.claude/archive/skills/slack-gif-creator/templates/spin.py +269 -0
- package/.claude/archive/skills/slack-gif-creator/templates/wiggle.py +300 -0
- package/.claude/archive/skills/slack-gif-creator/templates/zoom.py +312 -0
- package/.claude/archive/skills/twitter-algorithm-optimizer/SKILL.md +327 -0
- package/.claude/archive/skills/video-downloader/SKILL.md +99 -0
- package/.claude/archive/skills/video-downloader/scripts/download_video.py +145 -0
- package/.claude/bash-whitelist-requests/2026-05-28-grep-find-rg.md +68 -0
- package/.claude/bash-whitelist-requests/2026-06-01-readonly-filters.md +76 -0
- package/.claude/bash-whitelist.txt +124 -0
- package/.claude/commands/agent-introspect.md +89 -0
- package/.claude/commands/apply-rules.md +363 -0
- package/.claude/commands/approve-design.md +219 -0
- package/.claude/commands/approve-org-money.md +267 -0
- package/.claude/commands/build.md +234 -0
- package/.claude/commands/commit.md +97 -0
- package/.claude/commands/context-fetch.md +113 -0
- package/.claude/commands/create-tool.md +496 -0
- package/.claude/commands/design-review.md +138 -0
- package/.claude/commands/design.md +807 -0
- package/.claude/commands/discharge-byproduct.md +208 -0
- package/.claude/commands/doc-review.md +165 -0
- package/.claude/commands/document-pair.md +76 -0
- package/.claude/commands/error-triage.md +435 -0
- package/.claude/commands/eval.md +70 -0
- package/.claude/commands/evolve.md +49 -0
- package/.claude/commands/finish-task.md +105 -0
- package/.claude/commands/gan-build.md +91 -0
- package/.claude/commands/gan-design.md +82 -0
- package/.claude/commands/gate-bypass.md +77 -0
- package/.claude/commands/gate-clear.md +45 -0
- package/.claude/commands/gate-status.md +46 -0
- package/.claude/commands/harness-audit.md +151 -0
- package/.claude/commands/hearing.md +138 -0
- package/.claude/commands/impact-check.md +486 -0
- package/.claude/commands/init-tasks.md +49 -0
- package/.claude/commands/instinct-export.md +47 -0
- package/.claude/commands/instinct-import.md +41 -0
- package/.claude/commands/instinct-status.md +43 -0
- package/.claude/commands/investigate.md +547 -0
- package/.claude/commands/learn.md +55 -0
- package/.claude/commands/lint-rules.md +400 -0
- package/.claude/commands/mode.md +58 -0
- package/.claude/commands/modify-feature.md +209 -0
- package/.claude/commands/module-review.md +149 -0
- package/.claude/commands/move-section.md +67 -0
- package/.claude/commands/new-draft.md +67 -0
- package/.claude/commands/new-feature.md +286 -0
- package/.claude/commands/new-task.md +156 -0
- package/.claude/commands/notification.md +107 -0
- package/.claude/commands/pm-start.md +119 -0
- package/.claude/commands/projects.md +32 -0
- package/.claude/commands/promote.md +43 -0
- package/.claude/commands/rasis-report.md +1323 -0
- package/.claude/commands/release-note.md +130 -0
- package/.claude/commands/reply-watch.md +149 -0
- package/.claude/commands/requirement.md +352 -0
- package/.claude/commands/resume-state.md +187 -0
- package/.claude/commands/reviewpr.md +118 -0
- package/.claude/commands/save-state.md +100 -0
- package/.claude/commands/sentry-pr.md +157 -0
- package/.claude/commands/start-task.md +87 -0
- package/.claude/commands/system-review.md +147 -0
- package/.claude/commands/task-bypass.md +70 -0
- package/.claude/commands/task-estimate.md +100 -0
- package/.claude/commands/template-apply.md +89 -0
- package/.claude/commands/test-design.md +116 -0
- package/.claude/commands/transfer-mismatch.md +317 -0
- package/.claude/commands/verify.md +51 -0
- package/.claude/evals/grader-loop-mode-autonomy.sh +165 -0
- package/.claude/evals/grader-system-reminder-attention.sh +99 -0
- package/.claude/evals/loop-mode-autonomy.md +121 -0
- package/.claude/evals/loop-mode-autonomy.results.template.md +133 -0
- package/.claude/evals/system-reminder-attention.md +123 -0
- package/.claude/evals/system-reminder-attention.results.template.md +93 -0
- package/.claude/evals/system-reminder-attention.runner.md +353 -0
- package/.claude/harness-config.local.yml +48 -0
- package/.claude/harness-config.yml +534 -0
- package/.claude/hooks/agent-marker-clear.sh +43 -0
- package/.claude/hooks/agent-marker-set.sh +40 -0
- package/.claude/hooks/agent-router-suggest.sh +123 -0
- package/.claude/hooks/autonomous-action-guard.sh +242 -0
- package/.claude/hooks/byproduct-discharge-guard.sh +128 -0
- package/.claude/hooks/check-md-mermaid.sh +144 -0
- package/.claude/hooks/check-required-env.sh +95 -0
- package/.claude/hooks/check-serena-mcp.sh +123 -0
- package/.claude/hooks/confidence-gate.sh +139 -0
- package/.claude/hooks/context-budget.sh +233 -0
- package/.claude/hooks/delegation-guard.sh +99 -0
- package/.claude/hooks/dispatcher-manifest.tsv +38 -0
- package/.claude/hooks/draft-flow-guard.sh +304 -0
- package/.claude/hooks/failure-loop-detect.sh +139 -0
- package/.claude/hooks/gateguard.sh +209 -0
- package/.claude/hooks/improvement-proposal.sh +112 -0
- package/.claude/hooks/init-tasks-on-start.sh +34 -0
- package/.claude/hooks/lib/bypass-logger.sh +82 -0
- package/.claude/hooks/lib/confidence-gate/bypass.sh +48 -0
- package/.claude/hooks/lib/confidence-gate/extract.sh +99 -0
- package/.claude/hooks/lib/confidence-gate/major-agent-filter.sh +59 -0
- package/.claude/hooks/lib/confidence-gate/messages.sh +53 -0
- package/.claude/hooks/lib/config-loader.sh +784 -0
- package/.claude/hooks/lib/delegation-guard/bash-whitelist.sh +323 -0
- package/.claude/hooks/lib/delegation-guard/git-deny.sh +188 -0
- package/.claude/hooks/lib/delegation-guard/protected-paths.sh +105 -0
- package/.claude/hooks/lib/delegation-guard/subagent-detect.sh +40 -0
- package/.claude/hooks/lib/dispatcher-core.sh +454 -0
- package/.claude/hooks/lib/improvement-proposal/aggregate.py +466 -0
- package/.claude/hooks/lib/improvement-proposal/cache.sh +78 -0
- package/.claude/hooks/lib/mode-loader.sh +80 -0
- package/.claude/hooks/lib/next-actions-parser.sh +153 -0
- package/.claude/hooks/lib/project-root.sh +60 -0
- package/.claude/hooks/list-md-plan-first-reminder.sh +143 -0
- package/.claude/hooks/loop-auto-progress-reminder.sh +108 -0
- package/.claude/hooks/loop-confirmation-detector.sh +241 -0
- package/.claude/hooks/mode-asana-prompt.sh +61 -0
- package/.claude/hooks/mode-enforce.sh +57 -0
- package/.claude/hooks/mode-session-start.sh +93 -0
- package/.claude/hooks/next-actions-surface.sh +136 -0
- package/.claude/hooks/notification-dispatcher.sh +9 -0
- package/.claude/hooks/notify.sh +27 -0
- package/.claude/hooks/parallel-subagent-reminder.sh +469 -0
- package/.claude/hooks/post-tool-use-dispatcher.sh +9 -0
- package/.claude/hooks/pre-tool-use-dispatcher.sh +9 -0
- package/.claude/hooks/reviewer-count-guard.sh +313 -0
- package/.claude/hooks/session-help-surface.sh +192 -0
- package/.claude/hooks/session-start-dispatcher.sh +9 -0
- package/.claude/hooks/session-start-wrapper.sh +156 -0
- package/.claude/hooks/stale-harness-detect.sh +422 -0
- package/.claude/hooks/stop-dispatcher.sh +9 -0
- package/.claude/hooks/stop.sh +25 -0
- package/.claude/hooks/subagent-stop-dispatcher.sh +9 -0
- package/.claude/hooks/task-rule-guard.sh +317 -0
- package/.claude/hooks/tests/run-tests.sh +23 -0
- package/.claude/hooks/tests/test-agent-marker-warn.sh +86 -0
- package/.claude/hooks/tests/test-check-required-env.sh +138 -0
- package/.claude/hooks/tests/test-confidence-gate.sh +170 -0
- package/.claude/hooks/tests/test-config-env-override.sh +220 -0
- package/.claude/hooks/tests/test-gate-disable.sh +118 -0
- package/.claude/hooks/tests/test-improvement-proposal.sh +284 -0
- package/.claude/hooks/tool-call-slip-detector.sh +188 -0
- package/.claude/hooks/user-prompt-submit-dispatcher.sh +9 -0
- package/.claude/hooks/why-x5-reminder.sh +45 -0
- package/.claude/hooks/why-x5-violation-detect.sh +152 -0
- package/.claude/hooks/workflow-guard.sh +263 -0
- package/.claude/mode.yml +28 -0
- package/.claude/project-rules/development-process.md +8 -0
- package/.claude/project-rules/git-workflow.md +8 -0
- package/.claude/project-rules/modes.md +8 -0
- package/.claude/project-rules/self-improvement.md +8 -0
- package/.claude/project-rules/task-management.md +8 -0
- package/.claude/project-rules/why-x5-output.md +8 -0
- package/.claude/project-rules/workflow.md +8 -0
- package/.claude/rules/development-process.md +293 -0
- package/.claude/rules/git-workflow.md +71 -0
- package/.claude/rules/modes.md +189 -0
- package/.claude/rules/self-improvement.md +76 -0
- package/.claude/rules/task-management.md +261 -0
- package/.claude/rules/why-x5-output.md +97 -0
- package/.claude/rules/workflow.md +157 -0
- package/.claude/rules-details/README.md +67 -0
- package/.claude/rules-details/development-process/confidence-gate.md +22 -0
- package/.claude/rules-details/development-process/cross-repo-write.md +35 -0
- package/.claude/rules-details/development-process/delegation-requirements.md +158 -0
- package/.claude/rules-details/development-process/harness-sync.md +21 -0
- package/.claude/rules-details/development-process/origin.md +13 -0
- package/.claude/rules-details/development-process/parallelization-origin.md +22 -0
- package/.claude/rules-details/development-process/research-reuse.md +22 -0
- package/.claude/rules-details/development-process/staging-strategy.md +47 -0
- package/.claude/rules-details/modes/artifacts.md +34 -0
- package/.claude/rules-details/modes/compliance-items.md +120 -0
- package/.claude/rules-details/modes/five-layer-enforcement.md +46 -0
- package/.claude/rules-details/modes/mode-hooks.md +51 -0
- package/.claude/rules-details/modes/origin.md +17 -0
- package/.claude/rules-details/self-improvement/l4-mechanics.md +36 -0
- package/.claude/rules-details/self-improvement/origin.md +8 -0
- package/.claude/rules-details/self-improvement/related-skills.md +35 -0
- package/.claude/rules-details/self-improvement/when-to-use-layers.md +39 -0
- package/.claude/rules-details/task-management/hook-enforcement.md +25 -0
- package/.claude/rules-details/task-management/mandatory-reading.md +20 -0
- package/.claude/rules-details/task-management/origin.md +12 -0
- package/.claude/rules-details/task-management/parking-lot.md +26 -0
- package/.claude/rules-details/task-management/plan-first.md +44 -0
- package/.claude/rules-details/task-management/six-articles.md +68 -0
- package/.claude/rules-details/task-management/task-migration.md +16 -0
- package/.claude/rules-details/task-management/ui-detection.md +11 -0
- package/.claude/rules-details/why-x5-output/examples.md +41 -0
- package/.claude/rules-details/why-x5-output/feedback-memory.md +14 -0
- package/.claude/rules-details/why-x5-output/origin.md +10 -0
- package/.claude/rules-details/why-x5-output/v1-v10-history.md +19 -0
- package/.claude/rules-details/workflow/10-stage.md +43 -0
- package/.claude/rules-details/workflow/14-stage.md +52 -0
- package/.claude/rules-details/workflow/byproduct-discharge.md +39 -0
- package/.claude/rules-details/workflow/draft-flow-guard.md +31 -0
- package/.claude/rules-details/workflow/fan-out.md +70 -0
- package/.claude/rules-details/workflow/mece-20.md +36 -0
- package/.claude/rules-details/workflow/origin.md +14 -0
- package/.claude/rules-details/workflow/refactoring.md +48 -0
- package/.claude/rules-details/workflow/related-skills.md +22 -0
- package/.claude/rules-details/workflow/reviewer-prompt.md +100 -0
- package/.claude/rules-details/workflow/session-persistence.md +46 -0
- package/.claude/rules-details/workflow/workflow-guard.md +36 -0
- package/.claude/scripts/__pycache__/harness-audit.cpython-313.pyc +0 -0
- package/.claude/scripts/agent-stocktake.py +421 -0
- package/.claude/scripts/check-md-mermaid.mjs +138 -0
- package/.claude/scripts/generate-settings.sh +0 -0
- package/.claude/scripts/harness-audit.py +1547 -0
- package/.claude/scripts/hc-config.sh +2265 -0
- package/.claude/scripts/init-tasks.sh +117 -0
- package/.claude/scripts/lib/enforcement-matrix-parse.sh +81 -0
- package/.claude/scripts/lib/hc-config-metadata.sh +190 -0
- package/.claude/scripts/lib/hc-config-web-server.js +1528 -0
- package/.claude/scripts/lib/hc-config-web-ui/app.js +1054 -0
- package/.claude/scripts/lib/hc-config-web-ui/index.html +130 -0
- package/.claude/scripts/lib/hc-config-web-ui/style.css +522 -0
- package/.claude/scripts/new-task-helper.sh +432 -0
- package/.claude/scripts/observe-repair.sh +437 -0
- package/.claude/scripts/observe-rotate.sh +311 -0
- package/.claude/scripts/statusline.sh +239 -0
- package/.claude/settings.generated.preview.json +211 -0
- package/.claude/settings.json +215 -0
- package/.claude/settings.local.example.json +20 -0
- package/.claude/settings.local.json +36 -0
- package/.claude/skills/agent-introspection-debugging/SKILL.md +123 -0
- package/.claude/skills/agent-router/README.md +137 -0
- package/.claude/skills/agent-router/SKILL.md +74 -0
- package/.claude/skills/agent-router/dispatch-table.yml +352 -0
- package/.claude/skills/agent-router/router.py +1086 -0
- package/.claude/skills/agent-router/samples/representative_prompts.txt +24 -0
- package/.claude/skills/agent-router/tests/__init__.py +0 -0
- package/.claude/skills/agent-router/tests/test_router.py +762 -0
- package/.claude/skills/artifacts-builder/LICENSE.txt +202 -0
- package/.claude/skills/artifacts-builder/SKILL.md +74 -0
- package/.claude/skills/artifacts-builder/scripts/bundle-artifact.sh +54 -0
- package/.claude/skills/artifacts-builder/scripts/init-artifact.sh +322 -0
- package/.claude/skills/artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
- package/.claude/skills/brand-guidelines/LICENSE.txt +202 -0
- package/.claude/skills/brand-guidelines/SKILL.md +73 -0
- package/.claude/skills/canvas-design/LICENSE.txt +202 -0
- package/.claude/skills/canvas-design/SKILL.md +130 -0
- package/.claude/skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
- package/.claude/skills/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- package/.claude/skills/changelog-generator/SKILL.md +104 -0
- package/.claude/skills/check-md-mermaid/SKILL.md +62 -0
- package/.claude/skills/connect/SKILL.md +156 -0
- package/.claude/skills/connect-apps/SKILL.md +80 -0
- package/.claude/skills/content-research-writer/SKILL.md +538 -0
- package/.claude/skills/continuous-agent-loop/SKILL.md +187 -0
- package/.claude/skills/continuous-learning-v2/SKILL.md +238 -0
- package/.claude/skills/continuous-learning-v2/config.json +35 -0
- package/.claude/skills/continuous-learning-v2/hooks/observe.sh +333 -0
- package/.claude/skills/continuous-learning-v2/instinct-cli.py +406 -0
- package/.claude/skills/domain-name-brainstormer/SKILL.md +212 -0
- package/.claude/skills/eval-harness/SKILL.md +100 -0
- package/.claude/skills/eval-harness/swe-bench/README.md +80 -0
- package/.claude/skills/eval-harness/swe-bench/config.yml +29 -0
- package/.claude/skills/eval-harness/swe-bench/docker/Dockerfile +25 -0
- package/.claude/skills/eval-harness/swe-bench/docker/docker-compose.yml +18 -0
- package/.claude/skills/eval-harness/swe-bench/results/dry-run-2026-05-04.json +137 -0
- package/.claude/skills/eval-harness/swe-bench/results/dry-run-comparison-2026-05-04.md +112 -0
- package/.claude/skills/eval-harness/swe-bench/results/dry-run-improved-2026-05-04.json +165 -0
- package/.claude/skills/eval-harness/swe-bench/results/raw/astropy__astropy-12907.patch +12 -0
- package/.claude/skills/eval-harness/swe-bench/results/raw/astropy__astropy-12907.txt +322 -0
- package/.claude/skills/eval-harness/swe-bench/results/raw/astropy__astropy-12907.whole-file.txt +322 -0
- package/.claude/skills/eval-harness/swe-bench/runner.py +845 -0
- package/.claude/skills/eval-harness/swe-bench/scoring.py +298 -0
- package/.claude/skills/eval-harness/swe-bench/tasks/fetch_tasks.py +81 -0
- package/.claude/skills/eval-harness/swe-bench/tasks/lite-50.json +702 -0
- package/.claude/skills/file-organizer/SKILL.md +433 -0
- package/.claude/skills/gan-style-harness/SKILL.md +111 -0
- package/.claude/skills/gateguard/.gateguard.yml +47 -0
- package/.claude/skills/gateguard/SKILL.md +99 -0
- package/.claude/skills/internal-comms/LICENSE.txt +202 -0
- package/.claude/skills/internal-comms/SKILL.md +32 -0
- package/.claude/skills/internal-comms/examples/3p-updates.md +47 -0
- package/.claude/skills/internal-comms/examples/company-newsletter.md +65 -0
- package/.claude/skills/internal-comms/examples/faq-answers.md +30 -0
- package/.claude/skills/internal-comms/examples/general-comms.md +16 -0
- package/.claude/skills/invoice-organizer/SKILL.md +446 -0
- package/.claude/skills/karpathy-guidelines/SKILL.md +67 -0
- package/.claude/skills/langsmith-fetch/SKILL.md +485 -0
- package/.claude/skills/lead-research-assistant/SKILL.md +199 -0
- package/.claude/skills/mcp-builder/LICENSE.txt +202 -0
- package/.claude/skills/mcp-builder/SKILL.md +328 -0
- package/.claude/skills/mcp-builder/reference/evaluation.md +602 -0
- package/.claude/skills/mcp-builder/reference/mcp_best_practices.md +915 -0
- package/.claude/skills/mcp-builder/reference/node_mcp_server.md +916 -0
- package/.claude/skills/mcp-builder/reference/python_mcp_server.md +752 -0
- package/.claude/skills/mcp-builder/scripts/connections.py +151 -0
- package/.claude/skills/mcp-builder/scripts/evaluation.py +373 -0
- package/.claude/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/.claude/skills/mcp-builder/scripts/requirements.txt +2 -0
- package/.claude/skills/raffle-winner-picker/SKILL.md +159 -0
- package/.claude/skills/repo-map/README.md +125 -0
- package/.claude/skills/repo-map/SKILL.md +128 -0
- package/.claude/skills/repo-map/examples/sample-output.md +1194 -0
- package/.claude/skills/repo-map/repo-map.py +715 -0
- package/.claude/skills/salesforce-e2e-testing/SKILL.md +116 -0
- package/.claude/skills/salesforce-e2e-testing/catalog-template.md +161 -0
- package/.claude/skills/salesforce-e2e-testing/methodology.md +179 -0
- package/.claude/skills/salesforce-e2e-testing/observation-rules.md +280 -0
- package/.claude/skills/salesforce-e2e-testing/pattern-taxonomy.md +392 -0
- package/.claude/skills/salesforce-e2e-testing/procedure-template.md +376 -0
- package/.claude/skills/skill-creator/LICENSE.txt +202 -0
- package/.claude/skills/skill-creator/SKILL.md +209 -0
- package/.claude/skills/skill-creator/scripts/init_skill.py +303 -0
- package/.claude/skills/skill-creator/scripts/package_skill.py +110 -0
- package/.claude/skills/skill-creator/scripts/quick_validate.py +65 -0
- package/.claude/skills/skill-share/SKILL.md +80 -0
- package/.claude/skills/tailored-resume-generator/SKILL.md +345 -0
- package/.claude/skills/template-skill/SKILL.md +6 -0
- package/.claude/skills/theme-factory/LICENSE.txt +202 -0
- package/.claude/skills/theme-factory/SKILL.md +59 -0
- package/.claude/skills/theme-factory/theme-showcase.pdf +0 -0
- package/.claude/skills/theme-factory/themes/arctic-frost.md +19 -0
- package/.claude/skills/theme-factory/themes/botanical-garden.md +19 -0
- package/.claude/skills/theme-factory/themes/desert-rose.md +19 -0
- package/.claude/skills/theme-factory/themes/forest-canopy.md +19 -0
- package/.claude/skills/theme-factory/themes/golden-hour.md +19 -0
- package/.claude/skills/theme-factory/themes/midnight-galaxy.md +19 -0
- package/.claude/skills/theme-factory/themes/modern-minimalist.md +19 -0
- package/.claude/skills/theme-factory/themes/ocean-depths.md +19 -0
- package/.claude/skills/theme-factory/themes/sunset-boulevard.md +19 -0
- package/.claude/skills/theme-factory/themes/tech-innovation.md +19 -0
- package/.claude/skills/verification-loop/SKILL.md +129 -0
- package/.claude/skills/webapp-testing/LICENSE.txt +202 -0
- package/.claude/skills/webapp-testing/SKILL.md +96 -0
- package/.claude/skills/webapp-testing/examples/console_logging.py +35 -0
- package/.claude/skills/webapp-testing/examples/element_discovery.py +40 -0
- package/.claude/skills/webapp-testing/examples/static_html_automation.py +33 -0
- package/.claude/skills/webapp-testing/scripts/with_server.py +106 -0
- package/.claude/templates/docs/draft/_DRAFT_TEMPLATE.md +162 -0
- package/.claude/templates/docs/draft/_TEST_DESIGN_TEMPLATE.md +76 -0
- package/.claude/templates/docs/tasks/_TASK_TEMPLATE.md +276 -0
- package/.claude/templates/docs/tasks/list.md +80 -0
- package/.claude/templates/docs/tasks/parking-lot.md +82 -0
- package/.claude/templates/settings.user-level.json.template +306 -0
- package/.claude/tests/SMOKE-CLASSIFICATION.md +199 -0
- package/.claude/tests/action-space-count-smoke.sh +130 -0
- package/.claude/tests/agent-router-suggest-wiring-smoke.sh +188 -0
- package/.claude/tests/audit-followups-smoke.sh +158 -0
- package/.claude/tests/autonomous-action-guard-relaxation-smoke.sh +479 -0
- package/.claude/tests/autonomous-action-guard-smoke.sh +187 -0
- package/.claude/tests/check-serena-mcp-smoke.sh +156 -0
- package/.claude/tests/common-rules-import-smoke.sh +209 -0
- package/.claude/tests/confidence-gate-smoke.sh +220 -0
- package/.claude/tests/config-feature-toggles-smoke.sh +389 -0
- package/.claude/tests/context-budget-smoke.sh +222 -0
- package/.claude/tests/custom-pm-commands-smoke.sh +93 -0
- package/.claude/tests/delegation-guard-code-smoke.sh +244 -0
- package/.claude/tests/delegation-guard-deny-layers-smoke.sh +356 -0
- package/.claude/tests/delegation-guard-readonly-filter-smoke.sh +205 -0
- package/.claude/tests/delegation-guard-search-whitelist-smoke.sh +152 -0
- package/.claude/tests/delegation-guard-segment-smoke.sh +109 -0
- package/.claude/tests/dispatcher-blocker-invariance-smoke.sh +700 -0
- package/.claude/tests/dispatcher-core-smoke.sh +452 -0
- package/.claude/tests/dispatcher-merge-matrix-smoke.sh +825 -0
- package/.claude/tests/dispatcher-success-stdout-smoke.sh +290 -0
- package/.claude/tests/draft-flow-guard-approved-dir-smoke.sh +234 -0
- package/.claude/tests/draft-flow-guard-smoke.sh +194 -0
- package/.claude/tests/dual-mode-portability-smoke.sh +131 -0
- package/.claude/tests/effective-hook-matrix-smoke.sh +261 -0
- package/.claude/tests/enforcement-mismatch-smoke.sh +263 -0
- package/.claude/tests/fixtures/cascade-sample.jsonl +9 -0
- package/.claude/tests/fixtures/next-actions/case-clean.md +14 -0
- package/.claude/tests/fixtures/next-actions/case-with-red.md +16 -0
- package/.claude/tests/fixtures/next-actions/case-with-yellow-only.md +14 -0
- package/.claude/tests/fixtures/normal-broken-scatter.jsonl +5 -0
- package/.claude/tests/fixtures/task-71/blocker-baseline.tsv +24 -0
- package/.claude/tests/fixtures/task-71/settings-inventory.tsv +37 -0
- package/.claude/tests/fixtures/transcript-50pct.jsonl +2 -0
- package/.claude/tests/fixtures/transcript-60pct.jsonl +2 -0
- package/.claude/tests/fixtures/transcript-80pct.jsonl +2 -0
- package/.claude/tests/fixtures/transcript-95pct.jsonl +2 -0
- package/.claude/tests/fixtures/workflow-guard/case-2-mid.json +21 -0
- package/.claude/tests/fixtures/workflow-guard/case-3-blocked.json +33 -0
- package/.claude/tests/fixtures/workflow-guard/case-4-clean.json +27 -0
- package/.claude/tests/fixtures/workflow-guard/case-8-modify.json +23 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-1.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-2.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-3.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-4.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-5.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-6.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-7.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-8.json +1 -0
- package/.claude/tests/gateguard-smoke.sh +213 -0
- package/.claude/tests/git-deny-mainline-policy-smoke.sh +222 -0
- package/.claude/tests/harness-audit-c-batch-smoke.sh +270 -0
- package/.claude/tests/harness-audit-compare-smoke.sh +186 -0
- package/.claude/tests/harness-audit-pipeline-health-smoke.sh +326 -0
- package/.claude/tests/harness-config-local-smoke.sh +232 -0
- package/.claude/tests/hc-config-git-policy-smoke.sh +241 -0
- package/.claude/tests/hc-config-key-parity-smoke.sh +149 -0
- package/.claude/tests/hc-config-migration-smoke.sh +251 -0
- package/.claude/tests/hc-config-script-smoke.sh +1106 -0
- package/.claude/tests/hc-config-tui-smoke.sh +801 -0
- package/.claude/tests/hc-config-web-ui-smoke.sh +3224 -0
- package/.claude/tests/hook-cwd-robustness-smoke.sh +206 -0
- package/.claude/tests/hook-frequency-tweaks-smoke.sh +312 -0
- package/.claude/tests/improvement-proposal-cache-smoke.sh +238 -0
- package/.claude/tests/install-sh-overwrite-all-smoke.sh +274 -0
- package/.claude/tests/install-sh-regen-settings-smoke.sh +301 -0
- package/.claude/tests/install-sh-sync-drift-smoke.sh +285 -0
- package/.claude/tests/layer-b-context-isolation-smoke.sh +392 -0
- package/.claude/tests/list-md-plan-first-reminder-smoke.sh +313 -0
- package/.claude/tests/loop-auto-progress-smoke.sh +372 -0
- package/.claude/tests/loop-confirmation-detector-smoke.sh +674 -0
- package/.claude/tests/new-task-batch-update-smoke.sh +664 -0
- package/.claude/tests/next-actions-hooks-smoke.sh +283 -0
- package/.claude/tests/npx-cli-smoke.sh +696 -0
- package/.claude/tests/observe-flock-smoke.sh +223 -0
- package/.claude/tests/observe-jq-parse-smoke.sh +250 -0
- package/.claude/tests/observe-repair-smoke.sh +475 -0
- package/.claude/tests/observe-rotate-smoke.sh +428 -0
- package/.claude/tests/observe-subagent-stop-smoke.sh +476 -0
- package/.claude/tests/parallel-subagent-reminder-smoke.sh +918 -0
- package/.claude/tests/project-root-smoke.sh +140 -0
- package/.claude/tests/project-rules-protection-smoke.sh +199 -0
- package/.claude/tests/review-required-min-count-smoke.sh +286 -0
- package/.claude/tests/reviewer-count-guard-smoke.sh +490 -0
- package/.claude/tests/rule-architecture-smoke.sh +418 -0
- package/.claude/tests/rule-change-draft-flow-guard-smoke.sh +343 -0
- package/.claude/tests/run-all-smokes.sh +340 -0
- package/.claude/tests/session-help-surface-smoke.sh +224 -0
- package/.claude/tests/session-start-parallel-smoke.sh +165 -0
- package/.claude/tests/sessionstart-budget-smoke.sh +185 -0
- package/.claude/tests/sessionstart-footprint-smoke.sh +258 -0
- package/.claude/tests/settings-dispatcher-baseline-smoke.sh +709 -0
- package/.claude/tests/settings-generation-feature-pruning-smoke.sh +196 -0
- package/.claude/tests/stale-harness-detect-smoke.sh +974 -0
- package/.claude/tests/statusline-smoke.sh +180 -0
- package/.claude/tests/task-rule-guard-smoke.sh +656 -0
- package/.claude/tests/tool-call-slip-detector-smoke.sh +101 -0
- package/.claude/tests/wave-precheck-template-smoke.sh +159 -0
- package/.claude/tests/why-x5-violation-detect-smoke.sh +157 -0
- package/.claude/tests/workflow-guard-smoke.sh +266 -0
- package/CLAUDE.md +75 -0
- package/LICENSE +21 -0
- package/README.md +790 -0
- package/bin/cli.js +395 -0
- package/docs/INVENTORY.md +163 -0
- package/install.sh +769 -0
- package/package.json +25 -0
|
@@ -0,0 +1,762 @@
|
|
|
1
|
+
"""Unit tests for agent-router. Standard library only."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import io
|
|
6
|
+
import json
|
|
7
|
+
import os
|
|
8
|
+
import sys
|
|
9
|
+
import tempfile
|
|
10
|
+
import unittest
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
from unittest import mock
|
|
13
|
+
|
|
14
|
+
# Make the parent directory importable.
|
|
15
|
+
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
|
16
|
+
|
|
17
|
+
import router # type: ignore # noqa: E402
|
|
18
|
+
|
|
19
|
+
TABLE_PATH = Path(__file__).resolve().parent.parent / "dispatch-table.yml"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _isolated_history_path() -> Path:
|
|
23
|
+
"""Return a per-test history path that lives under a tmp dir so tests
|
|
24
|
+
never touch the user\'s real ~/.claude/agent-router-history.json."""
|
|
25
|
+
tmpdir = Path(tempfile.mkdtemp(prefix="agent-router-test-"))
|
|
26
|
+
return tmpdir / "history.json"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class IsolatedRouteMixin:
|
|
30
|
+
"""Mixin that swaps DEFAULT_HISTORY_PATH and disables history recording
|
|
31
|
+
by default for tests that do not explicitly opt in."""
|
|
32
|
+
|
|
33
|
+
def setUp(self) -> None: # type: ignore[override]
|
|
34
|
+
self._history_path = _isolated_history_path()
|
|
35
|
+
# Patch DEFAULT_HISTORY_PATH so any code path that reads it picks up
|
|
36
|
+
# the temp path.
|
|
37
|
+
self._patch = mock.patch.object(router, "DEFAULT_HISTORY_PATH", self._history_path)
|
|
38
|
+
self._patch.start()
|
|
39
|
+
# Phase 6: redirect dispatch.jsonl telemetry away from the real
|
|
40
|
+
# ~/.claude/homunculus tree.
|
|
41
|
+
self._homunculus_root = self._history_path.parent / "homunculus"
|
|
42
|
+
self._homunculus_patch = mock.patch.object(
|
|
43
|
+
router, "DEFAULT_HOMUNCULUS_ROOT", self._homunculus_root
|
|
44
|
+
)
|
|
45
|
+
self._homunculus_patch.start()
|
|
46
|
+
|
|
47
|
+
def tearDown(self) -> None: # type: ignore[override]
|
|
48
|
+
self._homunculus_patch.stop()
|
|
49
|
+
self._patch.stop()
|
|
50
|
+
try:
|
|
51
|
+
self._history_path.unlink(missing_ok=True)
|
|
52
|
+
# Recursive cleanup for the homunculus tree if present.
|
|
53
|
+
import shutil
|
|
54
|
+
if self._homunculus_root.exists():
|
|
55
|
+
shutil.rmtree(self._homunculus_root, ignore_errors=True)
|
|
56
|
+
self._history_path.parent.rmdir()
|
|
57
|
+
except OSError:
|
|
58
|
+
pass
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class ParseTableTests(unittest.TestCase):
|
|
62
|
+
def test_parses_real_table(self):
|
|
63
|
+
table = router.load_table(TABLE_PATH)
|
|
64
|
+
self.assertEqual(table.fallback, "general-purpose")
|
|
65
|
+
self.assertGreater(len(table.keywords), 100)
|
|
66
|
+
self.assertGreaterEqual(table.threshold, 0.0)
|
|
67
|
+
self.assertLessEqual(table.threshold, 1.0)
|
|
68
|
+
self.assertGreater(table.saturation, 0.0)
|
|
69
|
+
|
|
70
|
+
def test_parses_minimal_inline_yaml(self):
|
|
71
|
+
text = (
|
|
72
|
+
"threshold: 0.5\n"
|
|
73
|
+
"saturation: 4.0\n"
|
|
74
|
+
"specialty_boost: 0.25\n"
|
|
75
|
+
"fallback: general-purpose\n"
|
|
76
|
+
"keywords:\n"
|
|
77
|
+
" review: code-reviewer\n"
|
|
78
|
+
" \"code review\": code-reviewer\n"
|
|
79
|
+
" audit: { agent: security-auditor, weight: 1.5 }\n"
|
|
80
|
+
)
|
|
81
|
+
table = router.parse_dispatch_table(text)
|
|
82
|
+
self.assertEqual(table.threshold, 0.5)
|
|
83
|
+
self.assertEqual(table.saturation, 4.0)
|
|
84
|
+
self.assertEqual(table.specialty_boost, 0.25)
|
|
85
|
+
self.assertEqual(table.fallback, "general-purpose")
|
|
86
|
+
self.assertEqual(table.keywords["review"], ("code-reviewer", 1.0))
|
|
87
|
+
self.assertEqual(table.keywords["code review"], ("code-reviewer", 1.0))
|
|
88
|
+
self.assertEqual(table.keywords["audit"], ("security-auditor", 1.5))
|
|
89
|
+
|
|
90
|
+
def test_parser_strips_inline_comments(self):
|
|
91
|
+
text = (
|
|
92
|
+
"fallback: general-purpose # default fallback\n"
|
|
93
|
+
"keywords:\n"
|
|
94
|
+
" review: code-reviewer # quality\n"
|
|
95
|
+
)
|
|
96
|
+
table = router.parse_dispatch_table(text)
|
|
97
|
+
self.assertEqual(table.fallback, "general-purpose")
|
|
98
|
+
self.assertEqual(table.keywords["review"], ("code-reviewer", 1.0))
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class TokenizeTests(unittest.TestCase):
|
|
102
|
+
def test_lowercases_and_filters_stop_words(self):
|
|
103
|
+
tokens = router.tokenize("Please REVIEW the API for security issues")
|
|
104
|
+
self.assertIn("review", tokens)
|
|
105
|
+
self.assertIn("api", tokens)
|
|
106
|
+
self.assertIn("security", tokens)
|
|
107
|
+
self.assertNotIn("the", tokens)
|
|
108
|
+
self.assertNotIn("for", tokens)
|
|
109
|
+
|
|
110
|
+
def test_keeps_hyphenated_tokens(self):
|
|
111
|
+
tokens = router.tokenize("setup ci-cd via github-actions and run e2e")
|
|
112
|
+
self.assertIn("ci-cd", tokens)
|
|
113
|
+
self.assertIn("github-actions", tokens)
|
|
114
|
+
self.assertIn("e2e", tokens)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
class RoutingDispatchTests(IsolatedRouteMixin, unittest.TestCase):
|
|
118
|
+
@classmethod
|
|
119
|
+
def setUpClass(cls):
|
|
120
|
+
cls.table = router.load_table(TABLE_PATH)
|
|
121
|
+
|
|
122
|
+
def _route(self, prompt, **kwargs):
|
|
123
|
+
kwargs.setdefault("record_history", False)
|
|
124
|
+
kwargs.setdefault("history_path", self._history_path)
|
|
125
|
+
return router.route(prompt, table=self.table, **kwargs)
|
|
126
|
+
|
|
127
|
+
def test_security_review_routes_to_security_auditor(self):
|
|
128
|
+
r = self._route("review the auth module for SQL injection vulnerabilities")
|
|
129
|
+
self.assertFalse(r.fallback)
|
|
130
|
+
self.assertEqual(r.agent, "security-auditor")
|
|
131
|
+
self.assertGreaterEqual(r.confidence, 0.30)
|
|
132
|
+
|
|
133
|
+
def test_debug_prompt_routes_to_debugger(self):
|
|
134
|
+
r = self._route("debug the failing payment webhook and trace the exception")
|
|
135
|
+
self.assertFalse(r.fallback)
|
|
136
|
+
# debugger or error-detective both acceptable; debugger should win
|
|
137
|
+
self.assertIn(r.agent, {"debugger", "error-detective"})
|
|
138
|
+
|
|
139
|
+
def test_react_component_routes_to_react_specialist(self):
|
|
140
|
+
r = self._route("write a react component with hooks and tsx for the dashboard")
|
|
141
|
+
self.assertFalse(r.fallback)
|
|
142
|
+
self.assertIn(r.agent, {"react-specialist", "frontend-developer", "typescript-pro"})
|
|
143
|
+
|
|
144
|
+
def test_terraform_routes_to_terraform_engineer(self):
|
|
145
|
+
r = self._route("write terraform hcl for our aws infrastructure with iac best practices")
|
|
146
|
+
self.assertFalse(r.fallback)
|
|
147
|
+
self.assertEqual(r.agent, "terraform-engineer")
|
|
148
|
+
|
|
149
|
+
def test_kubernetes_prompt_routes_to_kubernetes_specialist(self):
|
|
150
|
+
r = self._route("kubectl apply the helm chart and inspect the failing pod logs")
|
|
151
|
+
self.assertFalse(r.fallback)
|
|
152
|
+
self.assertEqual(r.agent, "kubernetes-specialist")
|
|
153
|
+
|
|
154
|
+
def test_postgres_query_routes_to_postgres_pro(self):
|
|
155
|
+
r = self._route("optimize this postgres query and add the right index")
|
|
156
|
+
self.assertFalse(r.fallback)
|
|
157
|
+
self.assertIn(r.agent, {"postgres-pro", "database-optimizer", "sql-pro"})
|
|
158
|
+
|
|
159
|
+
def test_documentation_prompt_routes_to_docs_engineer(self):
|
|
160
|
+
r = self._route("write a tutorial guide and update the documentation")
|
|
161
|
+
self.assertFalse(r.fallback)
|
|
162
|
+
self.assertEqual(r.agent, "documentation-engineer")
|
|
163
|
+
|
|
164
|
+
def test_test_automation_routes_to_test_automator(self):
|
|
165
|
+
r = self._route("add pytest tests with TDD and verify coverage")
|
|
166
|
+
self.assertFalse(r.fallback)
|
|
167
|
+
self.assertEqual(r.agent, "test-automator")
|
|
168
|
+
|
|
169
|
+
def test_empty_prompt_returns_fallback(self):
|
|
170
|
+
r = self._route("")
|
|
171
|
+
self.assertTrue(r.fallback)
|
|
172
|
+
self.assertEqual(r.agent, self.table.fallback)
|
|
173
|
+
|
|
174
|
+
def test_no_keyword_match_returns_fallback(self):
|
|
175
|
+
r = self._route("zzzzz qqqqq xxxx kkkkk wwwww gibberish yyyyy zzzzz")
|
|
176
|
+
self.assertTrue(r.fallback)
|
|
177
|
+
self.assertEqual(r.agent, self.table.fallback)
|
|
178
|
+
|
|
179
|
+
def test_low_confidence_returns_fallback_with_low_threshold_table(self):
|
|
180
|
+
# Build an isolated table with a stricter threshold to verify the
|
|
181
|
+
# fallback path triggers when the top candidate is below it.
|
|
182
|
+
text = (
|
|
183
|
+
"threshold: 0.9\n"
|
|
184
|
+
"saturation: 6.0\n"
|
|
185
|
+
"specialty_boost: 0.5\n"
|
|
186
|
+
"fallback: general-purpose\n"
|
|
187
|
+
"keywords:\n"
|
|
188
|
+
" slack: slack-expert\n"
|
|
189
|
+
)
|
|
190
|
+
strict_table = router.parse_dispatch_table(text)
|
|
191
|
+
r = router.route(
|
|
192
|
+
"just a quick mention of slack in passing",
|
|
193
|
+
table=strict_table,
|
|
194
|
+
record_history=False,
|
|
195
|
+
history_path=self._history_path,
|
|
196
|
+
)
|
|
197
|
+
self.assertTrue(r.fallback)
|
|
198
|
+
self.assertEqual(r.agent, "general-purpose")
|
|
199
|
+
|
|
200
|
+
def test_specialty_boost_applies_when_multiple_keywords_hit(self):
|
|
201
|
+
# "review", "code review" both target code-reviewer → specialty boost
|
|
202
|
+
r = self._route("please do a code review of this PR")
|
|
203
|
+
self.assertFalse(r.fallback)
|
|
204
|
+
self.assertEqual(r.agent, "code-reviewer")
|
|
205
|
+
self.assertGreater(len(r.matched_keywords), 1)
|
|
206
|
+
|
|
207
|
+
def test_explain_includes_candidates(self):
|
|
208
|
+
r = self._route("review the code and run tests", explain=True)
|
|
209
|
+
self.assertTrue(r.candidates)
|
|
210
|
+
# Top candidate should match top-level agent
|
|
211
|
+
self.assertEqual(r.candidates[0]["agent"], r.agent)
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
class CoverageTests(IsolatedRouteMixin, unittest.TestCase):
|
|
215
|
+
"""Sanity-check that representative prompts route somewhere reasonable."""
|
|
216
|
+
|
|
217
|
+
REPRESENTATIVE = [
|
|
218
|
+
("review the auth module for security issues", {"security-auditor", "code-reviewer"}),
|
|
219
|
+
("debug the failing test", {"debugger", "test-automator", "error-detective"}),
|
|
220
|
+
("dockerize this node service", {"docker-expert", "node-specialist"}),
|
|
221
|
+
("write a next.js app router page with server components", {"nextjs-developer"}),
|
|
222
|
+
("optimize the slow postgres query plan", {"postgres-pro", "database-optimizer", "sql-pro"}),
|
|
223
|
+
("add a stripe payment endpoint", {"payment-integration", "api-designer"}),
|
|
224
|
+
("write a prd for the new feature", {"product-manager"}),
|
|
225
|
+
("research competitor pricing pages", {"competitive-analyst", "research-analyst", "market-researcher"}),
|
|
226
|
+
("set up kubernetes ingress with helm", {"kubernetes-specialist"}),
|
|
227
|
+
("write tdd unit tests with pytest", {"test-automator"}),
|
|
228
|
+
]
|
|
229
|
+
|
|
230
|
+
@classmethod
|
|
231
|
+
def setUpClass(cls):
|
|
232
|
+
cls.table = router.load_table(TABLE_PATH)
|
|
233
|
+
|
|
234
|
+
def test_coverage_routes_at_least_70_percent(self):
|
|
235
|
+
hits = 0
|
|
236
|
+
misses: list[str] = []
|
|
237
|
+
for prompt, expected in self.REPRESENTATIVE:
|
|
238
|
+
r = router.route(
|
|
239
|
+
prompt,
|
|
240
|
+
table=self.table,
|
|
241
|
+
record_history=False,
|
|
242
|
+
history_path=self._history_path,
|
|
243
|
+
)
|
|
244
|
+
if not r.fallback and r.agent in expected:
|
|
245
|
+
hits += 1
|
|
246
|
+
else:
|
|
247
|
+
misses.append(f"{prompt!r} → {r.agent} (fallback={r.fallback})")
|
|
248
|
+
ratio = hits / len(self.REPRESENTATIVE)
|
|
249
|
+
self.assertGreaterEqual(
|
|
250
|
+
ratio,
|
|
251
|
+
0.7,
|
|
252
|
+
msg=f"Only {hits}/{len(self.REPRESENTATIVE)} routed correctly. Misses: {misses}",
|
|
253
|
+
)
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
# ---------------------------------------------------------------------------
|
|
257
|
+
# Phase 2 tests
|
|
258
|
+
# ---------------------------------------------------------------------------
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
class NameNormalizationTests(unittest.TestCase):
|
|
262
|
+
def setUp(self):
|
|
263
|
+
self.known = {
|
|
264
|
+
"code-reviewer", "security-auditor", "test-automator",
|
|
265
|
+
"react-specialist", "general-purpose", "qa-expert",
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
def test_exact_match_passes_through(self):
|
|
269
|
+
self.assertEqual(router.normalize_agent_name("code-reviewer", self.known), "code-reviewer")
|
|
270
|
+
|
|
271
|
+
def test_underscore_to_hyphen(self):
|
|
272
|
+
self.assertEqual(router.normalize_agent_name("code_reviewer", self.known), "code-reviewer")
|
|
273
|
+
|
|
274
|
+
def test_space_to_hyphen(self):
|
|
275
|
+
self.assertEqual(router.normalize_agent_name("Code Reviewer", self.known), "code-reviewer")
|
|
276
|
+
|
|
277
|
+
def test_case_insensitive(self):
|
|
278
|
+
self.assertEqual(router.normalize_agent_name("SECURITY-AUDITOR", self.known), "security-auditor")
|
|
279
|
+
|
|
280
|
+
def test_quotes_stripped(self):
|
|
281
|
+
self.assertEqual(router.normalize_agent_name('"react-specialist"', self.known), "react-specialist")
|
|
282
|
+
|
|
283
|
+
def test_unknown_returns_none(self):
|
|
284
|
+
self.assertIsNone(router.normalize_agent_name("nonexistent-agent", self.known))
|
|
285
|
+
|
|
286
|
+
def test_empty_returns_none(self):
|
|
287
|
+
self.assertIsNone(router.normalize_agent_name("", self.known))
|
|
288
|
+
self.assertIsNone(router.normalize_agent_name(" ", self.known))
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
class CycleDetectionTests(IsolatedRouteMixin, unittest.TestCase):
|
|
292
|
+
def test_cycle_detection_blocks_repeat(self):
|
|
293
|
+
prompt = "review the auth module"
|
|
294
|
+
# Seed history with the same agent
|
|
295
|
+
router.record_dispatch(prompt, "code-reviewer", self._history_path)
|
|
296
|
+
self.assertTrue(
|
|
297
|
+
router.detect_cycle(prompt, "code-reviewer", self._history_path)
|
|
298
|
+
)
|
|
299
|
+
|
|
300
|
+
def test_cycle_detection_allows_different_agent(self):
|
|
301
|
+
prompt = "review the auth module"
|
|
302
|
+
router.record_dispatch(prompt, "code-reviewer", self._history_path)
|
|
303
|
+
self.assertFalse(
|
|
304
|
+
router.detect_cycle(prompt, "security-auditor", self._history_path)
|
|
305
|
+
)
|
|
306
|
+
|
|
307
|
+
def test_cycle_detection_no_history_returns_false(self):
|
|
308
|
+
self.assertFalse(
|
|
309
|
+
router.detect_cycle("anything", "code-reviewer", self._history_path)
|
|
310
|
+
)
|
|
311
|
+
|
|
312
|
+
def test_route_breaks_cycle_to_alternative(self):
|
|
313
|
+
# Pre-populate history with a same-prompt dispatch to security-auditor.
|
|
314
|
+
prompt = "review the auth module for SQL injection"
|
|
315
|
+
router.record_dispatch(prompt, "security-auditor", self._history_path)
|
|
316
|
+
table = router.load_table(TABLE_PATH)
|
|
317
|
+
result = router.route(
|
|
318
|
+
prompt,
|
|
319
|
+
table=table,
|
|
320
|
+
history_path=self._history_path,
|
|
321
|
+
record_history=False,
|
|
322
|
+
)
|
|
323
|
+
self.assertTrue(result.cycle_broken)
|
|
324
|
+
self.assertNotEqual(result.agent, "security-auditor")
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
class LLMFallbackTests(IsolatedRouteMixin, unittest.TestCase):
|
|
328
|
+
@classmethod
|
|
329
|
+
def setUpClass(cls):
|
|
330
|
+
cls.table = router.load_table(TABLE_PATH)
|
|
331
|
+
|
|
332
|
+
def test_high_confidence_does_not_call_llm(self):
|
|
333
|
+
"""Score 0.6+ → keyword result, LLM not invoked."""
|
|
334
|
+
called = []
|
|
335
|
+
|
|
336
|
+
def fake_runner(candidates, prompt_text, timeout):
|
|
337
|
+
called.append(prompt_text)
|
|
338
|
+
return ('{"agent": "test-automator", "confidence": 0.9, "reason": "x"}',
|
|
339
|
+
{"cost_usd": 0.001})
|
|
340
|
+
|
|
341
|
+
# "review the code and audit for security" generates a strong keyword
|
|
342
|
+
# signal — confidence should easily exceed 0.5.
|
|
343
|
+
r = router.route(
|
|
344
|
+
"review the auth module for SQL injection vulnerabilities and security issues",
|
|
345
|
+
table=self.table,
|
|
346
|
+
use_llm_fallback=True,
|
|
347
|
+
llm_threshold=0.5,
|
|
348
|
+
llm_runner=fake_runner,
|
|
349
|
+
history_path=self._history_path,
|
|
350
|
+
record_history=False,
|
|
351
|
+
)
|
|
352
|
+
# If keyword confidence is already high, llm_used must be False.
|
|
353
|
+
if r.confidence >= 0.5:
|
|
354
|
+
self.assertFalse(r.llm_used, msg=f"LLM unexpectedly called: {called!r}")
|
|
355
|
+
self.assertEqual(called, [])
|
|
356
|
+
|
|
357
|
+
def test_low_confidence_calls_llm(self):
|
|
358
|
+
"""Score < 0.5 → LLM selector is invoked and result honored."""
|
|
359
|
+
invocations = []
|
|
360
|
+
|
|
361
|
+
def fake_runner(candidates, prompt_text, timeout):
|
|
362
|
+
invocations.append(prompt_text)
|
|
363
|
+
return ('{"agent": "code-reviewer", "confidence": 0.85, "reason": "matched"}',
|
|
364
|
+
{"cost_usd": 0.002})
|
|
365
|
+
|
|
366
|
+
# A prompt with weak keyword signal: only one matching keyword.
|
|
367
|
+
r = router.route(
|
|
368
|
+
"I would like assistance with my mobile work",
|
|
369
|
+
table=self.table,
|
|
370
|
+
use_llm_fallback=True,
|
|
371
|
+
llm_threshold=0.99, # force LLM path
|
|
372
|
+
llm_runner=fake_runner,
|
|
373
|
+
history_path=self._history_path,
|
|
374
|
+
record_history=False,
|
|
375
|
+
)
|
|
376
|
+
self.assertTrue(r.llm_used)
|
|
377
|
+
self.assertEqual(len(invocations), 1)
|
|
378
|
+
self.assertEqual(r.agent, "code-reviewer")
|
|
379
|
+
self.assertGreaterEqual(r.llm_cost_usd, 0.001)
|
|
380
|
+
|
|
381
|
+
def test_llm_timeout_falls_back_to_keyword(self):
|
|
382
|
+
def fake_runner(candidates, prompt_text, timeout):
|
|
383
|
+
return (None, {"error": "timeout", "cost_usd": 0.0})
|
|
384
|
+
|
|
385
|
+
r = router.route(
|
|
386
|
+
"review the code carefully",
|
|
387
|
+
table=self.table,
|
|
388
|
+
use_llm_fallback=True,
|
|
389
|
+
llm_threshold=0.99,
|
|
390
|
+
llm_runner=fake_runner,
|
|
391
|
+
llm_max_attempts=3,
|
|
392
|
+
history_path=self._history_path,
|
|
393
|
+
record_history=False,
|
|
394
|
+
)
|
|
395
|
+
# LLM was tried but failed; result keeps keyword agent and surfaces error.
|
|
396
|
+
self.assertTrue(r.llm_used)
|
|
397
|
+
self.assertEqual(r.llm_attempts, 3)
|
|
398
|
+
self.assertIn("timeout", r.reason)
|
|
399
|
+
|
|
400
|
+
def test_llm_invalid_json_retries_then_falls_back(self):
|
|
401
|
+
attempts = {"n": 0}
|
|
402
|
+
|
|
403
|
+
def fake_runner(candidates, prompt_text, timeout):
|
|
404
|
+
attempts["n"] += 1
|
|
405
|
+
return ("not-a-json output ¯\\_(ツ)_/¯", {"cost_usd": 0.001})
|
|
406
|
+
|
|
407
|
+
r = router.route(
|
|
408
|
+
"build something",
|
|
409
|
+
table=self.table,
|
|
410
|
+
use_llm_fallback=True,
|
|
411
|
+
llm_threshold=0.99,
|
|
412
|
+
llm_runner=fake_runner,
|
|
413
|
+
llm_max_attempts=3,
|
|
414
|
+
history_path=self._history_path,
|
|
415
|
+
record_history=False,
|
|
416
|
+
)
|
|
417
|
+
self.assertEqual(attempts["n"], 3)
|
|
418
|
+
self.assertTrue(r.llm_used)
|
|
419
|
+
self.assertEqual(r.llm_attempts, 3)
|
|
420
|
+
|
|
421
|
+
def test_llm_unknown_agent_falls_back(self):
|
|
422
|
+
def fake_runner(candidates, prompt_text, timeout):
|
|
423
|
+
return ('{"agent": "made-up-agent-9999", "confidence": 0.9, "reason": "x"}',
|
|
424
|
+
{"cost_usd": 0.001})
|
|
425
|
+
|
|
426
|
+
r = router.route(
|
|
427
|
+
"build something",
|
|
428
|
+
table=self.table,
|
|
429
|
+
use_llm_fallback=True,
|
|
430
|
+
llm_threshold=0.99,
|
|
431
|
+
llm_runner=fake_runner,
|
|
432
|
+
llm_max_attempts=3,
|
|
433
|
+
history_path=self._history_path,
|
|
434
|
+
record_history=False,
|
|
435
|
+
)
|
|
436
|
+
self.assertTrue(r.llm_used)
|
|
437
|
+
self.assertEqual(r.llm_attempts, 3)
|
|
438
|
+
self.assertIn("unknown agent", r.reason)
|
|
439
|
+
|
|
440
|
+
def test_llm_normalized_agent_name(self):
|
|
441
|
+
"""LLM returning 'Code Reviewer' (with spaces) maps to 'code-reviewer'."""
|
|
442
|
+
def fake_runner(candidates, prompt_text, timeout):
|
|
443
|
+
return ('{"agent": "Code Reviewer", "confidence": 0.7, "reason": "x"}',
|
|
444
|
+
{"cost_usd": 0.001})
|
|
445
|
+
|
|
446
|
+
r = router.route(
|
|
447
|
+
"build something",
|
|
448
|
+
table=self.table,
|
|
449
|
+
use_llm_fallback=True,
|
|
450
|
+
llm_threshold=0.99,
|
|
451
|
+
llm_runner=fake_runner,
|
|
452
|
+
history_path=self._history_path,
|
|
453
|
+
record_history=False,
|
|
454
|
+
)
|
|
455
|
+
self.assertTrue(r.llm_used)
|
|
456
|
+
self.assertEqual(r.agent, "code-reviewer")
|
|
457
|
+
|
|
458
|
+
def test_llm_disabled_by_default(self):
|
|
459
|
+
called = []
|
|
460
|
+
|
|
461
|
+
def fake_runner(candidates, prompt_text, timeout):
|
|
462
|
+
called.append(prompt_text)
|
|
463
|
+
return ('{"agent": "code-reviewer", "confidence": 0.9, "reason": "x"}',
|
|
464
|
+
{"cost_usd": 0.001})
|
|
465
|
+
|
|
466
|
+
# use_llm_fallback NOT passed → defaults to False → never invoked.
|
|
467
|
+
router.route(
|
|
468
|
+
"vague prompt with no keyword",
|
|
469
|
+
table=self.table,
|
|
470
|
+
llm_runner=fake_runner,
|
|
471
|
+
history_path=self._history_path,
|
|
472
|
+
record_history=False,
|
|
473
|
+
)
|
|
474
|
+
self.assertEqual(called, [])
|
|
475
|
+
|
|
476
|
+
def test_llm_response_with_code_fences_parsed(self):
|
|
477
|
+
def fake_runner(candidates, prompt_text, timeout):
|
|
478
|
+
return ("```json\n" + '{"agent": "code-reviewer", "confidence": 0.8, "reason": "x"}' + "\n```",
|
|
479
|
+
{"cost_usd": 0.001})
|
|
480
|
+
|
|
481
|
+
r = router.route(
|
|
482
|
+
"build something",
|
|
483
|
+
table=self.table,
|
|
484
|
+
use_llm_fallback=True,
|
|
485
|
+
llm_threshold=0.99,
|
|
486
|
+
llm_runner=fake_runner,
|
|
487
|
+
history_path=self._history_path,
|
|
488
|
+
record_history=False,
|
|
489
|
+
)
|
|
490
|
+
self.assertTrue(r.llm_used)
|
|
491
|
+
self.assertEqual(r.agent, "code-reviewer")
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
class HistoryRecordingTests(IsolatedRouteMixin, unittest.TestCase):
|
|
495
|
+
def test_record_dispatch_persists(self):
|
|
496
|
+
router.record_dispatch("hello", "code-reviewer", self._history_path)
|
|
497
|
+
history = router._load_history(self._history_path)
|
|
498
|
+
self.assertEqual(len(history), 1)
|
|
499
|
+
self.assertEqual(history[0]["dispatched"], "code-reviewer")
|
|
500
|
+
self.assertIn("ts", history[0])
|
|
501
|
+
self.assertIn("prompt_hash", history[0])
|
|
502
|
+
|
|
503
|
+
def test_history_trims_at_100(self):
|
|
504
|
+
for i in range(150):
|
|
505
|
+
router.record_dispatch(f"prompt-{i}", "code-reviewer", self._history_path)
|
|
506
|
+
history = router._load_history(self._history_path)
|
|
507
|
+
self.assertEqual(len(history), 100)
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
# ---------------------------------------------------------------------------
|
|
511
|
+
# Phase 3 + Phase 6 tests
|
|
512
|
+
# ---------------------------------------------------------------------------
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
class ThreeStageFallbackTests(IsolatedRouteMixin, unittest.TestCase):
|
|
516
|
+
"""Phase 3 — keyword → llm → previous → general-purpose ladder."""
|
|
517
|
+
|
|
518
|
+
@classmethod
|
|
519
|
+
def setUpClass(cls):
|
|
520
|
+
cls.table = router.load_table(TABLE_PATH)
|
|
521
|
+
|
|
522
|
+
def test_three_stage_fallback_to_previous(self):
|
|
523
|
+
"""LLM fails → previous-agent layer kicks in with the prior dispatch."""
|
|
524
|
+
prompt = "totally vague help me out please friend"
|
|
525
|
+
|
|
526
|
+
# Seed history: this same prompt previously routed to react-specialist.
|
|
527
|
+
router.record_dispatch(prompt, "react-specialist", self._history_path)
|
|
528
|
+
|
|
529
|
+
def failing_runner(_candidates, _prompt_text, _timeout):
|
|
530
|
+
return (None, {"error": "timeout", "cost_usd": 0.0})
|
|
531
|
+
|
|
532
|
+
r = router.route(
|
|
533
|
+
prompt,
|
|
534
|
+
table=self.table,
|
|
535
|
+
use_llm_fallback=True,
|
|
536
|
+
llm_threshold=0.99,
|
|
537
|
+
llm_runner=failing_runner,
|
|
538
|
+
llm_max_attempts=2,
|
|
539
|
+
history_path=self._history_path,
|
|
540
|
+
record_history=False,
|
|
541
|
+
record_dispatch_log=False,
|
|
542
|
+
)
|
|
543
|
+
self.assertEqual(r.agent, "react-specialist")
|
|
544
|
+
self.assertFalse(r.fallback)
|
|
545
|
+
self.assertIn("previous", r.fallback_chain)
|
|
546
|
+
# Order: keyword → llm → previous
|
|
547
|
+
self.assertEqual(r.fallback_chain[:3], ["keyword", "llm", "previous"])
|
|
548
|
+
self.assertNotIn("general-purpose", r.fallback_chain)
|
|
549
|
+
|
|
550
|
+
def test_previous_skipped_if_general(self):
|
|
551
|
+
"""Previous dispatch == general-purpose ⇒ skip 3rd layer, land at 4th."""
|
|
552
|
+
prompt = "vague question with no keyword signal at all qqxx"
|
|
553
|
+
|
|
554
|
+
# Seed history with general-purpose itself — the previous-layer should
|
|
555
|
+
# treat that as "no signal" and skip directly to general-purpose.
|
|
556
|
+
router.record_dispatch(prompt, self.table.fallback, self._history_path)
|
|
557
|
+
|
|
558
|
+
def failing_runner(_candidates, _prompt_text, _timeout):
|
|
559
|
+
return (None, {"error": "no candidate", "cost_usd": 0.0})
|
|
560
|
+
|
|
561
|
+
r = router.route(
|
|
562
|
+
prompt,
|
|
563
|
+
table=self.table,
|
|
564
|
+
use_llm_fallback=True,
|
|
565
|
+
llm_threshold=0.99,
|
|
566
|
+
llm_runner=failing_runner,
|
|
567
|
+
llm_max_attempts=2,
|
|
568
|
+
history_path=self._history_path,
|
|
569
|
+
record_history=False,
|
|
570
|
+
record_dispatch_log=False,
|
|
571
|
+
)
|
|
572
|
+
self.assertEqual(r.agent, self.table.fallback)
|
|
573
|
+
self.assertTrue(r.fallback)
|
|
574
|
+
# previous layer must NOT appear; chain ends at general-purpose.
|
|
575
|
+
self.assertNotIn("previous", r.fallback_chain)
|
|
576
|
+
self.assertEqual(r.fallback_chain[-1], "general-purpose")
|
|
577
|
+
|
|
578
|
+
def test_fallback_chain_keyword_only_for_high_conf(self):
|
|
579
|
+
"""High-confidence keyword route must report only the keyword layer."""
|
|
580
|
+
r = router.route(
|
|
581
|
+
"review the auth module for SQL injection vulnerabilities and security",
|
|
582
|
+
table=self.table,
|
|
583
|
+
history_path=self._history_path,
|
|
584
|
+
record_history=False,
|
|
585
|
+
record_dispatch_log=False,
|
|
586
|
+
)
|
|
587
|
+
self.assertFalse(r.fallback)
|
|
588
|
+
self.assertEqual(r.fallback_chain, ["keyword"])
|
|
589
|
+
|
|
590
|
+
def test_fallback_chain_includes_general_when_no_keyword(self):
|
|
591
|
+
"""No keyword + LLM disabled → chain is keyword → general-purpose."""
|
|
592
|
+
r = router.route(
|
|
593
|
+
"zzzzz qqqqq xxxx kkkkk wwwww gibberish yyyyy zzzzz",
|
|
594
|
+
table=self.table,
|
|
595
|
+
history_path=self._history_path,
|
|
596
|
+
record_history=False,
|
|
597
|
+
record_dispatch_log=False,
|
|
598
|
+
)
|
|
599
|
+
self.assertTrue(r.fallback)
|
|
600
|
+
self.assertEqual(r.fallback_chain, ["keyword", "general-purpose"])
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
class DispatchLogTests(IsolatedRouteMixin, unittest.TestCase):
|
|
604
|
+
"""Phase 6-A — dispatch.jsonl telemetry."""
|
|
605
|
+
|
|
606
|
+
@classmethod
|
|
607
|
+
def setUpClass(cls):
|
|
608
|
+
cls.table = router.load_table(TABLE_PATH)
|
|
609
|
+
|
|
610
|
+
def _read_log(self):
|
|
611
|
+
log_path = router.dispatch_log_path(self._homunculus_root)
|
|
612
|
+
if not log_path.exists():
|
|
613
|
+
return []
|
|
614
|
+
out = []
|
|
615
|
+
for line in log_path.read_text(encoding="utf-8").splitlines():
|
|
616
|
+
line = line.strip()
|
|
617
|
+
if not line:
|
|
618
|
+
continue
|
|
619
|
+
out.append(json.loads(line))
|
|
620
|
+
return out
|
|
621
|
+
|
|
622
|
+
def test_dispatch_jsonl_appended(self):
|
|
623
|
+
router.route(
|
|
624
|
+
"review the auth module for SQL injection",
|
|
625
|
+
table=self.table,
|
|
626
|
+
history_path=self._history_path,
|
|
627
|
+
record_history=False,
|
|
628
|
+
record_dispatch_log=True,
|
|
629
|
+
homunculus_root=self._homunculus_root,
|
|
630
|
+
)
|
|
631
|
+
rows = self._read_log()
|
|
632
|
+
self.assertEqual(len(rows), 1)
|
|
633
|
+
row = rows[0]
|
|
634
|
+
self.assertIn("ts", row)
|
|
635
|
+
self.assertIn("prompt_hash", row)
|
|
636
|
+
self.assertIn("dispatched_agent", row)
|
|
637
|
+
self.assertIn("fallback_layer", row)
|
|
638
|
+
self.assertIn("confidence", row)
|
|
639
|
+
self.assertIn("cost_usd", row)
|
|
640
|
+
self.assertIn("cycle_broken", row)
|
|
641
|
+
self.assertEqual(row["dispatched_agent"], "security-auditor")
|
|
642
|
+
# Fallback layer for a clean keyword hit must be "keyword".
|
|
643
|
+
self.assertEqual(row["fallback_layer"], "keyword")
|
|
644
|
+
|
|
645
|
+
def test_dispatch_jsonl_atomic(self):
|
|
646
|
+
"""Atomic append: even if the existing file is partially written, the
|
|
647
|
+
next call must produce a clean, fully-parseable JSONL."""
|
|
648
|
+
log_path = router.dispatch_log_path(self._homunculus_root)
|
|
649
|
+
log_path.parent.mkdir(parents=True, exist_ok=True)
|
|
650
|
+
# Simulate a corrupted partial-write from a crashed process.
|
|
651
|
+
log_path.write_text("{\"partial\": tru", encoding="utf-8")
|
|
652
|
+
|
|
653
|
+
router.append_dispatch_log(
|
|
654
|
+
log_path,
|
|
655
|
+
prompt="hello",
|
|
656
|
+
dispatched_agent="code-reviewer",
|
|
657
|
+
fallback_layer="keyword",
|
|
658
|
+
confidence=0.7,
|
|
659
|
+
cost_usd=0.0,
|
|
660
|
+
)
|
|
661
|
+
# Final file must end with a newline and last line must parse.
|
|
662
|
+
text = log_path.read_text(encoding="utf-8")
|
|
663
|
+
self.assertTrue(text.endswith("\n"))
|
|
664
|
+
last_line = [ln for ln in text.splitlines() if ln.strip()][-1]
|
|
665
|
+
record = json.loads(last_line)
|
|
666
|
+
self.assertEqual(record["dispatched_agent"], "code-reviewer")
|
|
667
|
+
self.assertEqual(record["fallback_layer"], "keyword")
|
|
668
|
+
# No partial temp files left around.
|
|
669
|
+
leftovers = list(log_path.parent.glob("dispatch.jsonl.tmp.*"))
|
|
670
|
+
self.assertEqual(leftovers, [])
|
|
671
|
+
|
|
672
|
+
def test_dispatch_jsonl_skipped_when_no_record(self):
|
|
673
|
+
router.route(
|
|
674
|
+
"review the auth module for security",
|
|
675
|
+
table=self.table,
|
|
676
|
+
history_path=self._history_path,
|
|
677
|
+
record_history=False,
|
|
678
|
+
record_dispatch_log=False,
|
|
679
|
+
homunculus_root=self._homunculus_root,
|
|
680
|
+
)
|
|
681
|
+
log_path = router.dispatch_log_path(self._homunculus_root)
|
|
682
|
+
self.assertFalse(log_path.exists())
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
class HarnessAuditRouterIntegrationTests(unittest.TestCase):
|
|
686
|
+
"""Phase 6-B — `harness-audit.py --router` output schema."""
|
|
687
|
+
|
|
688
|
+
def test_router_subcommand_runs_against_temp_log(self):
|
|
689
|
+
import subprocess
|
|
690
|
+
import tempfile
|
|
691
|
+
|
|
692
|
+
scripts = (
|
|
693
|
+
Path(__file__).resolve().parents[3]
|
|
694
|
+
/ "scripts" / "harness-audit.py"
|
|
695
|
+
)
|
|
696
|
+
if not scripts.exists():
|
|
697
|
+
self.skipTest(f"harness-audit.py not found at {scripts}")
|
|
698
|
+
|
|
699
|
+
# Build a synthetic dispatch.jsonl under a tmp homunculus root.
|
|
700
|
+
with tempfile.TemporaryDirectory() as td:
|
|
701
|
+
home = Path(td)
|
|
702
|
+
project_dir = home / "projects" / "synthetic-test"
|
|
703
|
+
project_dir.mkdir(parents=True)
|
|
704
|
+
log = project_dir / "dispatch.jsonl"
|
|
705
|
+
rows = [
|
|
706
|
+
{
|
|
707
|
+
"ts": "2026-05-05T01:02:03Z",
|
|
708
|
+
"prompt_hash": "abc",
|
|
709
|
+
"dispatched_agent": "code-reviewer",
|
|
710
|
+
"fallback_layer": "keyword",
|
|
711
|
+
"confidence": 0.71,
|
|
712
|
+
"cost_usd": 0.0,
|
|
713
|
+
"cycle_broken": False,
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
"ts": "2026-05-05T01:02:04Z",
|
|
717
|
+
"prompt_hash": "def",
|
|
718
|
+
"dispatched_agent": "security-auditor",
|
|
719
|
+
"fallback_layer": "llm",
|
|
720
|
+
"confidence": 0.65,
|
|
721
|
+
"cost_usd": 0.002,
|
|
722
|
+
"cycle_broken": False,
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"ts": "2026-05-05T01:02:05Z",
|
|
726
|
+
"prompt_hash": "ghi",
|
|
727
|
+
"dispatched_agent": "general-purpose",
|
|
728
|
+
"fallback_layer": "general-purpose",
|
|
729
|
+
"confidence": 0.0,
|
|
730
|
+
"cost_usd": 0.0,
|
|
731
|
+
"cycle_broken": False,
|
|
732
|
+
},
|
|
733
|
+
]
|
|
734
|
+
log.write_text(
|
|
735
|
+
"\n".join(json.dumps(r, ensure_ascii=False) for r in rows) + "\n",
|
|
736
|
+
encoding="utf-8",
|
|
737
|
+
)
|
|
738
|
+
|
|
739
|
+
# Invoke the subcommand with the synthetic root.
|
|
740
|
+
proc = subprocess.run(
|
|
741
|
+
[
|
|
742
|
+
sys.executable, str(scripts),
|
|
743
|
+
"--router",
|
|
744
|
+
"--router-homunculus-root", str(home),
|
|
745
|
+
],
|
|
746
|
+
capture_output=True, text=True, timeout=15,
|
|
747
|
+
)
|
|
748
|
+
self.assertEqual(proc.returncode, 0, msg=proc.stderr)
|
|
749
|
+
out = proc.stdout
|
|
750
|
+
|
|
751
|
+
# Schema spot-checks.
|
|
752
|
+
self.assertIn("Router Dispatch Audit", out)
|
|
753
|
+
self.assertIn("total dispatches", out.lower())
|
|
754
|
+
self.assertIn("keyword", out)
|
|
755
|
+
self.assertIn("llm", out)
|
|
756
|
+
self.assertIn("general-purpose", out)
|
|
757
|
+
self.assertIn("named-agent rate", out.lower())
|
|
758
|
+
|
|
759
|
+
|
|
760
|
+
|
|
761
|
+
if __name__ == "__main__":
|
|
762
|
+
unittest.main()
|