@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,845 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""SWE-bench Lite task runner driver (Phase C-1.6 hybrid mode).
|
|
3
|
+
|
|
4
|
+
Phase C-1 dry-run の patch 適用率 40% (corrupt hunk header 失敗 60%) を whole-file
|
|
5
|
+
mode で 60% (3/3 generated→applied = 100%) まで改善した一方、大規模 file 全文出力で
|
|
6
|
+
claude が timeout する failure class が出現 (2/5)。
|
|
7
|
+
|
|
8
|
+
Phase C-1.6 で追加:
|
|
9
|
+
|
|
10
|
+
- --patch-mode hybrid
|
|
11
|
+
Step A: whole-file mode を short timeout (--whole-file-timeout-sec, default 600s)
|
|
12
|
+
で試行。
|
|
13
|
+
Step B: timeout / empty patch なら unified-diff mode に fallback
|
|
14
|
+
(timeout = 残予算 = per_task_timeout_sec - whole-file 経過時間, 最低 180s)。
|
|
15
|
+
Step C: 成功した patch を採用。claude_meta.attempt_history に試行履歴を記録。
|
|
16
|
+
|
|
17
|
+
Phase C-1.5 から継続:
|
|
18
|
+
- --patch-mode {whole-file, unified-diff} 単独モードは引き続き利用可。
|
|
19
|
+
- --resume / --parallel / --cost-cap-usd / --save-raw / atomic write。
|
|
20
|
+
|
|
21
|
+
Usage (Phase C-1.6 dry-run):
|
|
22
|
+
python3 runner.py --tasks tasks/lite-50.json --limit 5 \
|
|
23
|
+
--patch-mode hybrid --per-task-timeout-sec 900 \
|
|
24
|
+
--save-raw --cost-cap-usd 5.0 \
|
|
25
|
+
--output results/dry-run-hybrid-2026-05-05.json
|
|
26
|
+
"""
|
|
27
|
+
from __future__ import annotations
|
|
28
|
+
|
|
29
|
+
import argparse
|
|
30
|
+
import concurrent.futures as cf
|
|
31
|
+
import difflib
|
|
32
|
+
import json
|
|
33
|
+
import os
|
|
34
|
+
import re
|
|
35
|
+
import shlex
|
|
36
|
+
import subprocess
|
|
37
|
+
import sys
|
|
38
|
+
import tempfile
|
|
39
|
+
import time
|
|
40
|
+
from datetime import datetime
|
|
41
|
+
from pathlib import Path
|
|
42
|
+
|
|
43
|
+
ROOT = Path(__file__).resolve().parent
|
|
44
|
+
sys.path.insert(0, str(ROOT))
|
|
45
|
+
from scoring import score_task # noqa: E402
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# === config loader (super lightweight YAML subset) ===
|
|
49
|
+
def _load_config() -> dict:
|
|
50
|
+
cfg_path = ROOT / "config.yml"
|
|
51
|
+
cfg: dict = {}
|
|
52
|
+
if not cfg_path.exists():
|
|
53
|
+
return cfg
|
|
54
|
+
for raw in cfg_path.read_text(encoding="utf-8").splitlines():
|
|
55
|
+
line = raw.split("#", 1)[0].rstrip()
|
|
56
|
+
if not line or ":" not in line:
|
|
57
|
+
continue
|
|
58
|
+
k, _, v = line.partition(":")
|
|
59
|
+
v = v.strip()
|
|
60
|
+
if not v:
|
|
61
|
+
continue
|
|
62
|
+
if v.lower() in ("true", "false"):
|
|
63
|
+
cfg[k.strip()] = v.lower() == "true"
|
|
64
|
+
else:
|
|
65
|
+
try:
|
|
66
|
+
cfg[k.strip()] = float(v) if "." in v else int(v)
|
|
67
|
+
except ValueError:
|
|
68
|
+
cfg[k.strip()] = v
|
|
69
|
+
return cfg
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
CFG = _load_config()
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
# ============================================================================
|
|
76
|
+
# Prompt builders
|
|
77
|
+
# ============================================================================
|
|
78
|
+
|
|
79
|
+
UNIFIED_DIFF_EXAMPLE = """\
|
|
80
|
+
diff --git a/src/example.py b/src/example.py
|
|
81
|
+
--- a/src/example.py
|
|
82
|
+
+++ b/src/example.py
|
|
83
|
+
@@ -10,7 +10,7 @@
|
|
84
|
+
def calculate(x):
|
|
85
|
+
# validate input
|
|
86
|
+
- if x < 0:
|
|
87
|
+
+ if x <= 0:
|
|
88
|
+
raise ValueError("x must be positive")
|
|
89
|
+
return x * 2
|
|
90
|
+
"""
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def _build_prompt_unified(task: dict) -> str:
|
|
94
|
+
"""強化版 unified-diff prompt。example diff + hunk header の厳格化指示。"""
|
|
95
|
+
repo = task["repo"]
|
|
96
|
+
base = task["base_commit"]
|
|
97
|
+
problem = task["problem_statement"]
|
|
98
|
+
hints = task.get("hints_text", "") or ""
|
|
99
|
+
|
|
100
|
+
return f"""You are an expert software engineer solving a real GitHub issue from {repo}.
|
|
101
|
+
|
|
102
|
+
# Repository
|
|
103
|
+
- repo: https://github.com/{repo}
|
|
104
|
+
- base commit: {base}
|
|
105
|
+
|
|
106
|
+
# Issue / Problem statement
|
|
107
|
+
{problem}
|
|
108
|
+
|
|
109
|
+
# Hints (optional)
|
|
110
|
+
{hints[:2000] if hints else "(none)"}
|
|
111
|
+
|
|
112
|
+
# Your task
|
|
113
|
+
Produce a single unified diff (`diff --git ...`) that fixes this issue.
|
|
114
|
+
The diff MUST apply cleanly to the base commit with `git apply`.
|
|
115
|
+
|
|
116
|
+
# CRITICAL: hunk header rules
|
|
117
|
+
- Every hunk starts with `@@ -ORIG_LINE,ORIG_COUNT +NEW_LINE,NEW_COUNT @@`
|
|
118
|
+
- ORIG_LINE / NEW_LINE are 1-based line numbers in the ORIGINAL file at the
|
|
119
|
+
start of the context shown in the hunk.
|
|
120
|
+
- ORIG_COUNT = number of lines in the hunk before changes (context + removed)
|
|
121
|
+
- NEW_COUNT = number of lines in the hunk after changes (context + added)
|
|
122
|
+
- Include AT LEAST 3 lines of context above and below each change.
|
|
123
|
+
- DO NOT guess line numbers. If unsure, output an empty patch.
|
|
124
|
+
|
|
125
|
+
# Example (correct format)
|
|
126
|
+
```
|
|
127
|
+
{UNIFIED_DIFF_EXAMPLE}```
|
|
128
|
+
|
|
129
|
+
# Strict output requirements
|
|
130
|
+
- Output ONLY the unified diff, no prose, no markdown fences, no explanation.
|
|
131
|
+
- Modify only files necessary to fix the issue. Do NOT modify test files.
|
|
132
|
+
- If you cannot produce a confident fix, output an empty patch (just whitespace).
|
|
133
|
+
"""
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def _build_prompt_whole_file(task: dict) -> str:
|
|
137
|
+
"""whole-file mode prompt。
|
|
138
|
+
|
|
139
|
+
claude は「PATH: <relative path>」 + `<<<FILE_START>>>` ... `<<<FILE_END>>>`
|
|
140
|
+
の形式で 1 つ以上の修正後ファイル全文を出力する。
|
|
141
|
+
runner.py が repo を clone し difflib で正規 unified diff を生成。
|
|
142
|
+
"""
|
|
143
|
+
repo = task["repo"]
|
|
144
|
+
base = task["base_commit"]
|
|
145
|
+
problem = task["problem_statement"]
|
|
146
|
+
hints = task.get("hints_text", "") or ""
|
|
147
|
+
|
|
148
|
+
return f"""You are an expert software engineer solving a real GitHub issue from {repo}.
|
|
149
|
+
|
|
150
|
+
# Repository
|
|
151
|
+
- repo: https://github.com/{repo}
|
|
152
|
+
- base commit: {base}
|
|
153
|
+
|
|
154
|
+
# Issue / Problem statement
|
|
155
|
+
{problem}
|
|
156
|
+
|
|
157
|
+
# Hints (optional)
|
|
158
|
+
{hints[:2000] if hints else "(none)"}
|
|
159
|
+
|
|
160
|
+
# Your task
|
|
161
|
+
Identify the file(s) that need to be modified and output the COMPLETE NEW
|
|
162
|
+
CONTENT of each file (the full file as it should look AFTER your fix).
|
|
163
|
+
|
|
164
|
+
# Output format (STRICT)
|
|
165
|
+
For each file you modify, output exactly this structure:
|
|
166
|
+
|
|
167
|
+
PATH: <relative/path/from/repo/root.py>
|
|
168
|
+
<<<FILE_START>>>
|
|
169
|
+
<the entire new content of the file, line by line>
|
|
170
|
+
<<<FILE_END>>>
|
|
171
|
+
|
|
172
|
+
# Rules
|
|
173
|
+
- Output paths relative to the repository root, NOT absolute paths.
|
|
174
|
+
- Include the FULL file content, not just the changed parts. The runner will
|
|
175
|
+
diff your output against the base commit to produce the patch.
|
|
176
|
+
- Do NOT modify test files (anything matching `test_*.py`, `*_test.py`,
|
|
177
|
+
`tests/**`, or with `test` in the path).
|
|
178
|
+
- Multiple files: repeat the PATH/FILE_START/FILE_END block for each file.
|
|
179
|
+
- Output NO prose, NO markdown fences, NO explanation. Only PATH/FILE blocks.
|
|
180
|
+
- If you cannot produce a confident fix, output exactly the literal string:
|
|
181
|
+
NO_FIX
|
|
182
|
+
"""
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
# ============================================================================
|
|
186
|
+
# Diff extraction & generation
|
|
187
|
+
# ============================================================================
|
|
188
|
+
|
|
189
|
+
def _extract_unified_diff(claude_output: str) -> str:
|
|
190
|
+
"""unified-diff mode: claude 出力から diff 部分のみ抽出。"""
|
|
191
|
+
m = re.search(r"```(?:diff|patch)?\s*\n(diff --git[\s\S]*?)```", claude_output)
|
|
192
|
+
if m:
|
|
193
|
+
return m.group(1).strip() + "\n"
|
|
194
|
+
idx = claude_output.find("diff --git")
|
|
195
|
+
if idx >= 0:
|
|
196
|
+
return claude_output[idx:].strip() + "\n"
|
|
197
|
+
return ""
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
_FILE_BLOCK_RE = re.compile(
|
|
201
|
+
r"PATH:\s*(?P<path>[^\r\n]+)\s*\n<<<FILE_START>>>\s*\n(?P<content>.*?)\n<<<FILE_END>>>",
|
|
202
|
+
re.DOTALL,
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
def _parse_whole_file_blocks(claude_output: str) -> list[tuple[str, str]]:
|
|
207
|
+
"""whole-file mode: claude 出力から (path, new_content) のリストを抽出。
|
|
208
|
+
|
|
209
|
+
NO_FIX 単体の場合は空リスト。
|
|
210
|
+
"""
|
|
211
|
+
if claude_output.strip() == "NO_FIX":
|
|
212
|
+
return []
|
|
213
|
+
out: list[tuple[str, str]] = []
|
|
214
|
+
for m in _FILE_BLOCK_RE.finditer(claude_output):
|
|
215
|
+
path = m.group("path").strip()
|
|
216
|
+
# exclude absolute path / parent traversal
|
|
217
|
+
if path.startswith("/") or ".." in path.split("/"):
|
|
218
|
+
continue
|
|
219
|
+
# exclude obvious test files (defense in depth; prompt も指示済)
|
|
220
|
+
lower = path.lower()
|
|
221
|
+
if (
|
|
222
|
+
lower.startswith("tests/")
|
|
223
|
+
or "/tests/" in lower
|
|
224
|
+
or lower.endswith("_test.py")
|
|
225
|
+
or "/test_" in lower
|
|
226
|
+
or lower.startswith("test_")
|
|
227
|
+
):
|
|
228
|
+
continue
|
|
229
|
+
content = m.group("content")
|
|
230
|
+
# ensure trailing newline
|
|
231
|
+
if not content.endswith("\n"):
|
|
232
|
+
content += "\n"
|
|
233
|
+
out.append((path, content))
|
|
234
|
+
return out
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
def _docker_get_file(image: str, repo: str, base_commit: str, rel_path: str, timeout: int = 90) -> tuple[bool, str]:
|
|
238
|
+
"""指定 repo@base_commit の rel_path の中身を取得 (docker 経由)。
|
|
239
|
+
|
|
240
|
+
存在しない場合は ("", False) ではなく (True, "") を返し「新規作成」と区別する。
|
|
241
|
+
成功時 (True, content)、git clone 失敗等は (False, error_msg)。
|
|
242
|
+
"""
|
|
243
|
+
cmd = [
|
|
244
|
+
"docker", "run", "--rm",
|
|
245
|
+
image, "bash", "-lc",
|
|
246
|
+
f"set -e; "
|
|
247
|
+
f"git clone --quiet --no-tags --filter=blob:none https://github.com/{repo}.git /tmp/r && "
|
|
248
|
+
f"cd /tmp/r && git checkout --quiet {base_commit} && "
|
|
249
|
+
f"if [ -f {shlex.quote(rel_path)} ]; then cat {shlex.quote(rel_path)}; else echo __NEW_FILE__; fi",
|
|
250
|
+
]
|
|
251
|
+
try:
|
|
252
|
+
proc = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
|
|
253
|
+
except subprocess.TimeoutExpired:
|
|
254
|
+
return False, "timeout fetching file"
|
|
255
|
+
if proc.returncode != 0:
|
|
256
|
+
return False, f"git fetch failed: {(proc.stderr or proc.stdout)[:200]}"
|
|
257
|
+
content = proc.stdout
|
|
258
|
+
if content.strip() == "__NEW_FILE__":
|
|
259
|
+
return True, ""
|
|
260
|
+
return True, content
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
def _generate_unified_diff_from_files(
|
|
264
|
+
files: list[tuple[str, str]],
|
|
265
|
+
image: str,
|
|
266
|
+
repo: str,
|
|
267
|
+
base_commit: str,
|
|
268
|
+
) -> tuple[str, str | None]:
|
|
269
|
+
"""whole-file blocks から正規 unified diff を生成。
|
|
270
|
+
|
|
271
|
+
各 file について: 元 content (docker 経由 git fetch) と new content を difflib で diff。
|
|
272
|
+
返り値: (patch_text, error_or_None)
|
|
273
|
+
"""
|
|
274
|
+
if not files:
|
|
275
|
+
return "", "no file blocks parsed"
|
|
276
|
+
|
|
277
|
+
parts: list[str] = []
|
|
278
|
+
for rel_path, new_content in files:
|
|
279
|
+
ok, original = _docker_get_file(image, repo, base_commit, rel_path)
|
|
280
|
+
if not ok:
|
|
281
|
+
return "", f"failed to fetch {rel_path}: {original}"
|
|
282
|
+
|
|
283
|
+
is_new = original == ""
|
|
284
|
+
|
|
285
|
+
old_lines = original.splitlines(keepends=True)
|
|
286
|
+
new_lines = new_content.splitlines(keepends=True)
|
|
287
|
+
# ensure final newline
|
|
288
|
+
if old_lines and not old_lines[-1].endswith("\n"):
|
|
289
|
+
old_lines[-1] += "\n"
|
|
290
|
+
if new_lines and not new_lines[-1].endswith("\n"):
|
|
291
|
+
new_lines[-1] += "\n"
|
|
292
|
+
|
|
293
|
+
if old_lines == new_lines:
|
|
294
|
+
# no change → skip
|
|
295
|
+
continue
|
|
296
|
+
|
|
297
|
+
# generate unified diff with `a/<path>` / `b/<path>` headers (git-style)
|
|
298
|
+
diff_iter = difflib.unified_diff(
|
|
299
|
+
old_lines,
|
|
300
|
+
new_lines,
|
|
301
|
+
fromfile=f"a/{rel_path}",
|
|
302
|
+
tofile=f"b/{rel_path}",
|
|
303
|
+
n=3,
|
|
304
|
+
)
|
|
305
|
+
diff_body = "".join(diff_iter)
|
|
306
|
+
if not diff_body.strip():
|
|
307
|
+
continue
|
|
308
|
+
|
|
309
|
+
# prepend `diff --git` header
|
|
310
|
+
header = f"diff --git a/{rel_path} b/{rel_path}\n"
|
|
311
|
+
if is_new:
|
|
312
|
+
header += "new file mode 100644\n"
|
|
313
|
+
parts.append(header + diff_body)
|
|
314
|
+
|
|
315
|
+
if not parts:
|
|
316
|
+
return "", "no actual changes (output identical to base)"
|
|
317
|
+
|
|
318
|
+
return "".join(parts), None
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
# ============================================================================
|
|
322
|
+
# Claude invocation
|
|
323
|
+
# ============================================================================
|
|
324
|
+
|
|
325
|
+
def _invoke_claude(prompt: str, model: str, max_budget_usd: float, timeout: int) -> tuple[str, dict]:
|
|
326
|
+
"""claude CLI -p で 1 タスクを解かせる。"""
|
|
327
|
+
cmd = [
|
|
328
|
+
"claude", "-p",
|
|
329
|
+
"--model", model,
|
|
330
|
+
"--output-format", "json",
|
|
331
|
+
"--input-format", "text",
|
|
332
|
+
"--max-budget-usd", str(max_budget_usd),
|
|
333
|
+
"--no-session-persistence",
|
|
334
|
+
"--permission-mode", "bypassPermissions",
|
|
335
|
+
"--disallowedTools", "Bash,Edit,Write,Read,Grep,Glob,WebSearch,WebFetch,Task",
|
|
336
|
+
]
|
|
337
|
+
env = os.environ.copy()
|
|
338
|
+
|
|
339
|
+
try:
|
|
340
|
+
proc = subprocess.run(
|
|
341
|
+
cmd, input=prompt, capture_output=True, text=True, timeout=timeout, env=env,
|
|
342
|
+
)
|
|
343
|
+
except subprocess.TimeoutExpired:
|
|
344
|
+
return "", {"error": "timeout", "cost_usd": 0.0}
|
|
345
|
+
|
|
346
|
+
raw = proc.stdout or ""
|
|
347
|
+
meta: dict = {"cost_usd": 0.0, "duration_ms": 0, "rc": proc.returncode}
|
|
348
|
+
text_response = raw
|
|
349
|
+
|
|
350
|
+
try:
|
|
351
|
+
parsed = json.loads(raw)
|
|
352
|
+
if isinstance(parsed, dict):
|
|
353
|
+
text_response = parsed.get("result") or parsed.get("text") or raw
|
|
354
|
+
usage = parsed.get("usage") or {}
|
|
355
|
+
meta["cost_usd"] = float(parsed.get("total_cost_usd") or usage.get("total_cost_usd") or 0.0)
|
|
356
|
+
meta["duration_ms"] = int(parsed.get("duration_ms") or 0)
|
|
357
|
+
except json.JSONDecodeError:
|
|
358
|
+
text_response = raw
|
|
359
|
+
|
|
360
|
+
if proc.returncode != 0:
|
|
361
|
+
meta["error"] = (proc.stderr or "")[:500]
|
|
362
|
+
return text_response, meta
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
# ============================================================================
|
|
366
|
+
# Per-task worker
|
|
367
|
+
# ============================================================================
|
|
368
|
+
|
|
369
|
+
def _attempt_whole_file(
|
|
370
|
+
task: dict, *, model: str, max_budget_usd: float, timeout: int, image: str,
|
|
371
|
+
) -> tuple[str, dict, str, str | None]:
|
|
372
|
+
"""Run whole-file mode once.
|
|
373
|
+
|
|
374
|
+
Returns: (claude_text, meta, diff, diff_gen_error).
|
|
375
|
+
"""
|
|
376
|
+
prompt = _build_prompt_whole_file(task)
|
|
377
|
+
claude_text, meta = _invoke_claude(
|
|
378
|
+
prompt, model=model, max_budget_usd=max_budget_usd, timeout=timeout,
|
|
379
|
+
)
|
|
380
|
+
files = _parse_whole_file_blocks(claude_text)
|
|
381
|
+
if not files:
|
|
382
|
+
return claude_text, meta, "", "no file blocks (or NO_FIX)"
|
|
383
|
+
diff, gen_err = _generate_unified_diff_from_files(
|
|
384
|
+
files, image=image, repo=task["repo"], base_commit=task["base_commit"],
|
|
385
|
+
)
|
|
386
|
+
return claude_text, meta, diff, gen_err
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
def _attempt_unified_diff(
|
|
390
|
+
task: dict, *, model: str, max_budget_usd: float, timeout: int,
|
|
391
|
+
) -> tuple[str, dict, str, str | None]:
|
|
392
|
+
"""Run unified-diff mode once.
|
|
393
|
+
|
|
394
|
+
Returns: (claude_text, meta, diff, diff_gen_error).
|
|
395
|
+
"""
|
|
396
|
+
prompt = _build_prompt_unified(task)
|
|
397
|
+
claude_text, meta = _invoke_claude(
|
|
398
|
+
prompt, model=model, max_budget_usd=max_budget_usd, timeout=timeout,
|
|
399
|
+
)
|
|
400
|
+
diff = _extract_unified_diff(claude_text)
|
|
401
|
+
err = None if diff.strip() else "no diff extracted"
|
|
402
|
+
return claude_text, meta, diff, err
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
def _save_raw_safe(save_raw_dir: Path | None, instance_id: str, suffix: str, text: str) -> None:
|
|
406
|
+
if save_raw_dir is None or not text:
|
|
407
|
+
return
|
|
408
|
+
try:
|
|
409
|
+
save_raw_dir.mkdir(parents=True, exist_ok=True)
|
|
410
|
+
(save_raw_dir / f"{instance_id}{suffix}").write_text(text, encoding="utf-8")
|
|
411
|
+
except OSError:
|
|
412
|
+
pass
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
# Hybrid mode: whole-file step A timeout (rest of budget goes to unified-diff fallback).
|
|
416
|
+
# Override via --whole-file-timeout-sec.
|
|
417
|
+
DEFAULT_WHOLE_FILE_TIMEOUT_SEC = 600
|
|
418
|
+
MIN_FALLBACK_TIMEOUT_SEC = 180
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
def _process_task(
|
|
422
|
+
task: dict,
|
|
423
|
+
*,
|
|
424
|
+
model: str,
|
|
425
|
+
patch_mode: str,
|
|
426
|
+
per_task_cost_cap_usd: float,
|
|
427
|
+
per_task_timeout_sec: int,
|
|
428
|
+
apply_only: bool,
|
|
429
|
+
image: str,
|
|
430
|
+
save_raw_dir: Path | None,
|
|
431
|
+
whole_file_timeout_sec: int = DEFAULT_WHOLE_FILE_TIMEOUT_SEC,
|
|
432
|
+
) -> dict:
|
|
433
|
+
"""1 task: prompt → claude → diff 生成 → score。result dict を返す。
|
|
434
|
+
|
|
435
|
+
patch_mode:
|
|
436
|
+
- whole-file: 1 attempt, whole-file mode
|
|
437
|
+
- unified-diff: 1 attempt, unified-diff mode
|
|
438
|
+
- hybrid: Step A whole-file (timeout=min(whole_file_timeout_sec, per_task_timeout_sec))
|
|
439
|
+
→ on empty/timeout: Step B unified-diff (remaining budget)
|
|
440
|
+
"""
|
|
441
|
+
instance_id = task["instance_id"]
|
|
442
|
+
|
|
443
|
+
attempt_history: list[dict] = []
|
|
444
|
+
used_mode = patch_mode
|
|
445
|
+
diff = ""
|
|
446
|
+
diff_gen_error: str | None = None
|
|
447
|
+
final_meta: dict = {"cost_usd": 0.0}
|
|
448
|
+
final_claude_text = ""
|
|
449
|
+
t0 = time.time()
|
|
450
|
+
|
|
451
|
+
if patch_mode == "whole-file":
|
|
452
|
+
claude_text, meta, diff, diff_gen_error = _attempt_whole_file(
|
|
453
|
+
task, model=model,
|
|
454
|
+
max_budget_usd=per_task_cost_cap_usd,
|
|
455
|
+
timeout=per_task_timeout_sec,
|
|
456
|
+
image=image,
|
|
457
|
+
)
|
|
458
|
+
final_meta = meta
|
|
459
|
+
final_claude_text = claude_text
|
|
460
|
+
attempt_history.append({
|
|
461
|
+
"mode": "whole-file", "diff_chars": len(diff),
|
|
462
|
+
"cost_usd": float(meta.get("cost_usd", 0.0)),
|
|
463
|
+
"error": meta.get("error") or diff_gen_error,
|
|
464
|
+
})
|
|
465
|
+
_save_raw_safe(save_raw_dir, instance_id, ".whole-file.txt", claude_text)
|
|
466
|
+
|
|
467
|
+
elif patch_mode == "unified-diff":
|
|
468
|
+
claude_text, meta, diff, diff_gen_error = _attempt_unified_diff(
|
|
469
|
+
task, model=model,
|
|
470
|
+
max_budget_usd=per_task_cost_cap_usd,
|
|
471
|
+
timeout=per_task_timeout_sec,
|
|
472
|
+
)
|
|
473
|
+
final_meta = meta
|
|
474
|
+
final_claude_text = claude_text
|
|
475
|
+
attempt_history.append({
|
|
476
|
+
"mode": "unified-diff", "diff_chars": len(diff),
|
|
477
|
+
"cost_usd": float(meta.get("cost_usd", 0.0)),
|
|
478
|
+
"error": meta.get("error") or diff_gen_error,
|
|
479
|
+
})
|
|
480
|
+
_save_raw_safe(save_raw_dir, instance_id, ".unified-diff.txt", claude_text)
|
|
481
|
+
|
|
482
|
+
elif patch_mode == "hybrid":
|
|
483
|
+
# Step A: whole-file
|
|
484
|
+
wf_timeout = min(whole_file_timeout_sec, per_task_timeout_sec)
|
|
485
|
+
wf_text, wf_meta, wf_diff, wf_err = _attempt_whole_file(
|
|
486
|
+
task, model=model,
|
|
487
|
+
max_budget_usd=per_task_cost_cap_usd,
|
|
488
|
+
timeout=wf_timeout,
|
|
489
|
+
image=image,
|
|
490
|
+
)
|
|
491
|
+
wf_elapsed = time.time() - t0
|
|
492
|
+
attempt_history.append({
|
|
493
|
+
"mode": "whole-file", "diff_chars": len(wf_diff),
|
|
494
|
+
"cost_usd": float(wf_meta.get("cost_usd", 0.0)),
|
|
495
|
+
"elapsed_sec": round(wf_elapsed, 2),
|
|
496
|
+
"error": wf_meta.get("error") or wf_err,
|
|
497
|
+
})
|
|
498
|
+
_save_raw_safe(save_raw_dir, instance_id, ".whole-file.txt", wf_text)
|
|
499
|
+
|
|
500
|
+
if wf_diff.strip():
|
|
501
|
+
# Step A succeeded; commit it.
|
|
502
|
+
used_mode = "hybrid:whole-file"
|
|
503
|
+
diff = wf_diff
|
|
504
|
+
diff_gen_error = wf_err
|
|
505
|
+
final_meta = wf_meta
|
|
506
|
+
final_claude_text = wf_text
|
|
507
|
+
else:
|
|
508
|
+
# Step B: unified-diff fallback. Budget = remaining wall time, min 180s.
|
|
509
|
+
remaining = per_task_timeout_sec - int(wf_elapsed)
|
|
510
|
+
ud_timeout = max(remaining, MIN_FALLBACK_TIMEOUT_SEC)
|
|
511
|
+
# Per-task cost cap subtracts what whole-file already burned.
|
|
512
|
+
wf_cost = float(wf_meta.get("cost_usd", 0.0))
|
|
513
|
+
ud_budget = max(per_task_cost_cap_usd - wf_cost, 0.10)
|
|
514
|
+
ud_text, ud_meta, ud_diff, ud_err = _attempt_unified_diff(
|
|
515
|
+
task, model=model,
|
|
516
|
+
max_budget_usd=ud_budget,
|
|
517
|
+
timeout=ud_timeout,
|
|
518
|
+
)
|
|
519
|
+
attempt_history.append({
|
|
520
|
+
"mode": "unified-diff", "diff_chars": len(ud_diff),
|
|
521
|
+
"cost_usd": float(ud_meta.get("cost_usd", 0.0)),
|
|
522
|
+
"elapsed_sec": round(time.time() - t0 - wf_elapsed, 2),
|
|
523
|
+
"error": ud_meta.get("error") or ud_err,
|
|
524
|
+
})
|
|
525
|
+
_save_raw_safe(save_raw_dir, instance_id, ".unified-diff.txt", ud_text)
|
|
526
|
+
|
|
527
|
+
if ud_diff.strip():
|
|
528
|
+
used_mode = "hybrid:unified-diff"
|
|
529
|
+
diff = ud_diff
|
|
530
|
+
diff_gen_error = ud_err
|
|
531
|
+
else:
|
|
532
|
+
used_mode = "hybrid:failed"
|
|
533
|
+
diff = ""
|
|
534
|
+
diff_gen_error = (
|
|
535
|
+
f"both attempts failed (whole-file: {wf_err or wf_meta.get('error')}; "
|
|
536
|
+
f"unified-diff: {ud_err or ud_meta.get('error')})"
|
|
537
|
+
)
|
|
538
|
+
|
|
539
|
+
# Aggregate meta (cost is sum of both attempts).
|
|
540
|
+
final_meta = {
|
|
541
|
+
"cost_usd": wf_cost + float(ud_meta.get("cost_usd", 0.0)),
|
|
542
|
+
"duration_ms": int(wf_meta.get("duration_ms", 0)) + int(ud_meta.get("duration_ms", 0)),
|
|
543
|
+
"rc": ud_meta.get("rc", wf_meta.get("rc")),
|
|
544
|
+
}
|
|
545
|
+
err_a = wf_meta.get("error")
|
|
546
|
+
err_b = ud_meta.get("error")
|
|
547
|
+
if err_a or err_b:
|
|
548
|
+
final_meta["error"] = err_b or err_a
|
|
549
|
+
final_claude_text = ud_text or wf_text
|
|
550
|
+
|
|
551
|
+
else:
|
|
552
|
+
raise ValueError(f"unknown patch_mode: {patch_mode}")
|
|
553
|
+
|
|
554
|
+
invoke_dur = time.time() - t0
|
|
555
|
+
final_meta["attempt_history"] = attempt_history
|
|
556
|
+
|
|
557
|
+
# Save the final adopted patch for forensics.
|
|
558
|
+
if save_raw_dir is not None:
|
|
559
|
+
_save_raw_safe(save_raw_dir, instance_id, ".txt", final_claude_text)
|
|
560
|
+
if diff:
|
|
561
|
+
_save_raw_safe(save_raw_dir, instance_id, ".patch", diff)
|
|
562
|
+
|
|
563
|
+
score = score_task(
|
|
564
|
+
task, diff,
|
|
565
|
+
image=image,
|
|
566
|
+
apply_only=apply_only,
|
|
567
|
+
timeout=per_task_timeout_sec,
|
|
568
|
+
)
|
|
569
|
+
|
|
570
|
+
return {
|
|
571
|
+
"instance_id": instance_id,
|
|
572
|
+
"repo": task["repo"],
|
|
573
|
+
"model": model,
|
|
574
|
+
"patch_mode": patch_mode,
|
|
575
|
+
"used_mode": used_mode,
|
|
576
|
+
"invoke_duration_sec": round(invoke_dur, 2),
|
|
577
|
+
"claude_meta": final_meta,
|
|
578
|
+
"diff_chars": len(diff),
|
|
579
|
+
"diff_gen_error": diff_gen_error,
|
|
580
|
+
"score": score.to_dict(),
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
# ============================================================================
|
|
585
|
+
# Resume support
|
|
586
|
+
# ============================================================================
|
|
587
|
+
|
|
588
|
+
def _load_existing_results(path: Path) -> dict[str, dict]:
|
|
589
|
+
"""既存 results.json から instance_id -> result の dict を返す。"""
|
|
590
|
+
if not path.exists():
|
|
591
|
+
return {}
|
|
592
|
+
try:
|
|
593
|
+
data = json.loads(path.read_text(encoding="utf-8"))
|
|
594
|
+
except (OSError, json.JSONDecodeError):
|
|
595
|
+
return {}
|
|
596
|
+
out: dict[str, dict] = {}
|
|
597
|
+
for r in data.get("results", []):
|
|
598
|
+
iid = r.get("instance_id")
|
|
599
|
+
if iid:
|
|
600
|
+
out[iid] = r
|
|
601
|
+
return out
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
def _atomic_write(path: Path, payload: dict) -> None:
|
|
605
|
+
"""temp file → rename で原子的に書き込み。"""
|
|
606
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
607
|
+
fd, tmp = tempfile.mkstemp(prefix=f".{path.name}.", dir=str(path.parent))
|
|
608
|
+
try:
|
|
609
|
+
with os.fdopen(fd, "w", encoding="utf-8") as f:
|
|
610
|
+
json.dump(payload, f, ensure_ascii=False, indent=2)
|
|
611
|
+
os.replace(tmp, path)
|
|
612
|
+
except Exception:
|
|
613
|
+
if os.path.exists(tmp):
|
|
614
|
+
os.unlink(tmp)
|
|
615
|
+
raise
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
# ============================================================================
|
|
619
|
+
# main
|
|
620
|
+
# ============================================================================
|
|
621
|
+
|
|
622
|
+
def main() -> int:
|
|
623
|
+
ap = argparse.ArgumentParser()
|
|
624
|
+
ap.add_argument("--tasks", required=True)
|
|
625
|
+
ap.add_argument("--limit", type=int, default=int(CFG.get("default_limit", 5)))
|
|
626
|
+
ap.add_argument("--model", default=CFG.get("model", "claude-sonnet-4-6"))
|
|
627
|
+
ap.add_argument("--output", required=True)
|
|
628
|
+
ap.add_argument("--cost-cap-usd", type=float, default=float(CFG.get("cost_cap_usd", 5.0)))
|
|
629
|
+
ap.add_argument("--per-task-cost-cap-usd", type=float, default=float(CFG.get("per_task_cost_cap_usd", 1.0)))
|
|
630
|
+
ap.add_argument("--per-task-timeout-sec", type=int, default=int(CFG.get("per_task_timeout_sec", 300)))
|
|
631
|
+
ap.add_argument("--apply-only", action="store_true", default=bool(CFG.get("apply_patch_only", True)))
|
|
632
|
+
ap.add_argument("--image", default=CFG.get("docker_image", "swe-bench-sandbox"))
|
|
633
|
+
ap.add_argument(
|
|
634
|
+
"--patch-mode",
|
|
635
|
+
choices=["whole-file", "unified-diff", "hybrid"],
|
|
636
|
+
default=CFG.get("patch_mode", "whole-file"),
|
|
637
|
+
help=(
|
|
638
|
+
"whole-file: claude returns full file content, runner generates diff via difflib. "
|
|
639
|
+
"unified-diff: claude writes the diff directly. "
|
|
640
|
+
"hybrid: try whole-file first; on timeout/empty fall back to unified-diff (recommended)."
|
|
641
|
+
),
|
|
642
|
+
)
|
|
643
|
+
ap.add_argument(
|
|
644
|
+
"--whole-file-timeout-sec", type=int,
|
|
645
|
+
default=int(CFG.get("whole_file_timeout_sec", 600)),
|
|
646
|
+
help="hybrid mode only: timeout for the whole-file step A (the rest of per-task budget goes to unified-diff fallback).",
|
|
647
|
+
)
|
|
648
|
+
ap.add_argument("--resume", type=str, default=None,
|
|
649
|
+
help="既存 results.json (--output と同じファイルでも別でも可) を読み完了 task をスキップ")
|
|
650
|
+
ap.add_argument("--parallel", type=int, default=int(CFG.get("parallel", 1)),
|
|
651
|
+
help="同時実行数。1 で逐次。")
|
|
652
|
+
ap.add_argument("--save-raw", action="store_true",
|
|
653
|
+
help="claude 生出力 / 生成 patch を results/raw/ に保存(forensic 用)")
|
|
654
|
+
args = ap.parse_args()
|
|
655
|
+
|
|
656
|
+
tasks_path = Path(args.tasks)
|
|
657
|
+
if tasks_path.suffix == ".jsonl":
|
|
658
|
+
with tasks_path.open("r", encoding="utf-8") as f:
|
|
659
|
+
tasks = [json.loads(line) for line in f if line.strip()]
|
|
660
|
+
else:
|
|
661
|
+
tasks = json.loads(tasks_path.read_text(encoding="utf-8"))
|
|
662
|
+
tasks = tasks[: args.limit]
|
|
663
|
+
|
|
664
|
+
if not tasks:
|
|
665
|
+
print("[error] no tasks loaded", file=sys.stderr)
|
|
666
|
+
return 1
|
|
667
|
+
|
|
668
|
+
out_path = Path(args.output)
|
|
669
|
+
resume_path = Path(args.resume) if args.resume else out_path
|
|
670
|
+
existing = _load_existing_results(resume_path) if (args.resume or out_path.exists()) else {}
|
|
671
|
+
skipped_ids = set(existing.keys())
|
|
672
|
+
|
|
673
|
+
todo = [t for t in tasks if t["instance_id"] not in skipped_ids]
|
|
674
|
+
|
|
675
|
+
print(
|
|
676
|
+
f"[start] runner: {len(tasks)} tasks total, {len(skipped_ids)} resumed, {len(todo)} to run | "
|
|
677
|
+
f"model={args.model} mode={args.patch_mode} parallel={args.parallel} cap=${args.cost_cap_usd}",
|
|
678
|
+
file=sys.stderr,
|
|
679
|
+
)
|
|
680
|
+
started_at = datetime.utcnow().isoformat() + "Z"
|
|
681
|
+
|
|
682
|
+
raw_dir = out_path.parent / "raw" if args.save_raw else None
|
|
683
|
+
|
|
684
|
+
# carry forward resumed results
|
|
685
|
+
results: list[dict] = list(existing.values())
|
|
686
|
+
cumulative_cost = sum(float(r.get("claude_meta", {}).get("cost_usd", 0.0)) for r in results)
|
|
687
|
+
cap_hit = False
|
|
688
|
+
|
|
689
|
+
def _flush() -> None:
|
|
690
|
+
summary = _build_summary(
|
|
691
|
+
tasks, results, started_at, args, cumulative_cost, cap_hit,
|
|
692
|
+
)
|
|
693
|
+
_atomic_write(out_path, {"summary": summary, "results": results})
|
|
694
|
+
|
|
695
|
+
if args.parallel <= 1:
|
|
696
|
+
# 逐次
|
|
697
|
+
for i, task in enumerate(todo, start=1):
|
|
698
|
+
iid = task["instance_id"]
|
|
699
|
+
print(f"\n[task {i}/{len(todo)}] {iid}", file=sys.stderr)
|
|
700
|
+
if cumulative_cost >= args.cost_cap_usd:
|
|
701
|
+
cap_hit = True
|
|
702
|
+
print(f"[cap-hit] cum=${cumulative_cost:.4f} >= cap=${args.cost_cap_usd}, stop", file=sys.stderr)
|
|
703
|
+
break
|
|
704
|
+
r = _process_task(
|
|
705
|
+
task,
|
|
706
|
+
model=args.model,
|
|
707
|
+
patch_mode=args.patch_mode,
|
|
708
|
+
per_task_cost_cap_usd=args.per_task_cost_cap_usd,
|
|
709
|
+
per_task_timeout_sec=args.per_task_timeout_sec,
|
|
710
|
+
apply_only=args.apply_only,
|
|
711
|
+
image=args.image,
|
|
712
|
+
save_raw_dir=raw_dir,
|
|
713
|
+
whole_file_timeout_sec=args.whole_file_timeout_sec,
|
|
714
|
+
)
|
|
715
|
+
cumulative_cost += float(r["claude_meta"].get("cost_usd", 0.0))
|
|
716
|
+
r["cumulative_cost_usd"] = round(cumulative_cost, 6)
|
|
717
|
+
results.append(r)
|
|
718
|
+
_flush()
|
|
719
|
+
print(
|
|
720
|
+
f" -> applies={r['score']['patch_applies']} "
|
|
721
|
+
f"cost=${r['claude_meta'].get('cost_usd', 0):.4f} "
|
|
722
|
+
f"cum=${cumulative_cost:.4f} dur={r['invoke_duration_sec']}s",
|
|
723
|
+
file=sys.stderr,
|
|
724
|
+
)
|
|
725
|
+
else:
|
|
726
|
+
# 並列
|
|
727
|
+
# 注意: cost cap は worker 完了時にチェック。in-flight は止められないが
|
|
728
|
+
# per-task cap で 1 task 上限はあり、worst case は parallel × per_task_cost_cap_usd オーバー。
|
|
729
|
+
with cf.ProcessPoolExecutor(max_workers=args.parallel) as pool:
|
|
730
|
+
future_to_task = {
|
|
731
|
+
pool.submit(
|
|
732
|
+
_process_task,
|
|
733
|
+
t,
|
|
734
|
+
model=args.model,
|
|
735
|
+
patch_mode=args.patch_mode,
|
|
736
|
+
per_task_cost_cap_usd=args.per_task_cost_cap_usd,
|
|
737
|
+
per_task_timeout_sec=args.per_task_timeout_sec,
|
|
738
|
+
apply_only=args.apply_only,
|
|
739
|
+
image=args.image,
|
|
740
|
+
save_raw_dir=raw_dir,
|
|
741
|
+
whole_file_timeout_sec=args.whole_file_timeout_sec,
|
|
742
|
+
): t
|
|
743
|
+
for t in todo
|
|
744
|
+
}
|
|
745
|
+
done_count = 0
|
|
746
|
+
for fut in cf.as_completed(future_to_task):
|
|
747
|
+
t = future_to_task[fut]
|
|
748
|
+
done_count += 1
|
|
749
|
+
try:
|
|
750
|
+
r = fut.result()
|
|
751
|
+
except Exception as e: # noqa: BLE001
|
|
752
|
+
r = {
|
|
753
|
+
"instance_id": t["instance_id"], "repo": t["repo"],
|
|
754
|
+
"model": args.model, "patch_mode": args.patch_mode,
|
|
755
|
+
"used_mode": args.patch_mode + ":exception",
|
|
756
|
+
"invoke_duration_sec": 0.0,
|
|
757
|
+
"claude_meta": {"cost_usd": 0.0, "error": str(e)[:300], "attempt_history": []},
|
|
758
|
+
"diff_chars": 0, "diff_gen_error": str(e)[:300],
|
|
759
|
+
"score": {
|
|
760
|
+
"task_id": t["instance_id"], "patch_generated": False,
|
|
761
|
+
"patch_applies": False, "apply_error": str(e)[:300],
|
|
762
|
+
"tests_run": False, "tests_passed": 0, "tests_failed": 0,
|
|
763
|
+
"test_log_excerpt": "", "duration_sec": 0.0,
|
|
764
|
+
},
|
|
765
|
+
}
|
|
766
|
+
cumulative_cost += float(r.get("claude_meta", {}).get("cost_usd", 0.0))
|
|
767
|
+
r["cumulative_cost_usd"] = round(cumulative_cost, 6)
|
|
768
|
+
results.append(r)
|
|
769
|
+
_flush()
|
|
770
|
+
print(
|
|
771
|
+
f"[done {done_count}/{len(todo)}] {r['instance_id']} "
|
|
772
|
+
f"applies={r['score']['patch_applies']} "
|
|
773
|
+
f"cost=${r['claude_meta'].get('cost_usd', 0):.4f} cum=${cumulative_cost:.4f}",
|
|
774
|
+
file=sys.stderr,
|
|
775
|
+
)
|
|
776
|
+
if cumulative_cost >= args.cost_cap_usd:
|
|
777
|
+
cap_hit = True
|
|
778
|
+
print(f"[cap-hit] cum=${cumulative_cost:.4f} >= cap, cancelling pending futures", file=sys.stderr)
|
|
779
|
+
for f2 in future_to_task:
|
|
780
|
+
if not f2.done():
|
|
781
|
+
f2.cancel()
|
|
782
|
+
break
|
|
783
|
+
|
|
784
|
+
_flush()
|
|
785
|
+
print(f"\n[done] wrote {out_path}", file=sys.stderr)
|
|
786
|
+
summary = _build_summary(tasks, results, started_at, args, cumulative_cost, cap_hit)
|
|
787
|
+
print(
|
|
788
|
+
f"[summary] applied={summary['patch_applied_count']}/{summary['tasks_run']} "
|
|
789
|
+
f"({summary['applied_rate']:.0%}) cost=${summary['cumulative_cost_usd']}",
|
|
790
|
+
file=sys.stderr,
|
|
791
|
+
)
|
|
792
|
+
return 0
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
def _build_summary(tasks, results, started_at, args, cumulative_cost, cap_hit):
|
|
796
|
+
n_run = len(results)
|
|
797
|
+
applied = sum(1 for r in results if r["score"].get("patch_applies"))
|
|
798
|
+
resolved = sum(
|
|
799
|
+
1 for r in results
|
|
800
|
+
if r["score"].get("patch_applies") and r["score"].get("tests_run")
|
|
801
|
+
and r["score"].get("tests_passed", 0) > 0 and r["score"].get("tests_failed", 0) == 0
|
|
802
|
+
)
|
|
803
|
+
|
|
804
|
+
# Mode breakdown for hybrid forensics.
|
|
805
|
+
mode_breakdown: dict[str, dict[str, int]] = {}
|
|
806
|
+
for r in results:
|
|
807
|
+
used = r.get("used_mode") or r.get("patch_mode") or "unknown"
|
|
808
|
+
slot = mode_breakdown.setdefault(used, {"selected": 0, "applied": 0})
|
|
809
|
+
slot["selected"] += 1
|
|
810
|
+
if r["score"].get("patch_applies"):
|
|
811
|
+
slot["applied"] += 1
|
|
812
|
+
|
|
813
|
+
# Aggregate fallback signal: count attempts per mode in attempt_history.
|
|
814
|
+
attempt_counts: dict[str, int] = {}
|
|
815
|
+
for r in results:
|
|
816
|
+
for a in r.get("claude_meta", {}).get("attempt_history", []) or []:
|
|
817
|
+
mode = a.get("mode", "unknown")
|
|
818
|
+
attempt_counts[mode] = attempt_counts.get(mode, 0) + 1
|
|
819
|
+
|
|
820
|
+
return {
|
|
821
|
+
"started_at": started_at,
|
|
822
|
+
"finished_at": datetime.utcnow().isoformat() + "Z",
|
|
823
|
+
"model": args.model,
|
|
824
|
+
"patch_mode": args.patch_mode,
|
|
825
|
+
"whole_file_timeout_sec": getattr(args, "whole_file_timeout_sec", None),
|
|
826
|
+
"per_task_timeout_sec": args.per_task_timeout_sec,
|
|
827
|
+
"parallel": args.parallel,
|
|
828
|
+
"tasks_total": len(tasks),
|
|
829
|
+
"tasks_run": n_run,
|
|
830
|
+
"patch_generated_count": sum(1 for r in results if r["score"].get("patch_generated")),
|
|
831
|
+
"patch_applied_count": applied,
|
|
832
|
+
"applied_rate": round(applied / n_run, 3) if n_run else 0.0,
|
|
833
|
+
"resolved_count": resolved,
|
|
834
|
+
"resolved_rate": round(resolved / n_run, 3) if n_run else 0.0,
|
|
835
|
+
"cumulative_cost_usd": round(cumulative_cost, 6),
|
|
836
|
+
"cost_cap_usd": args.cost_cap_usd,
|
|
837
|
+
"cost_cap_hit": cap_hit,
|
|
838
|
+
"apply_only": args.apply_only,
|
|
839
|
+
"mode_breakdown": mode_breakdown,
|
|
840
|
+
"attempt_counts": attempt_counts,
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
if __name__ == "__main__":
|
|
845
|
+
sys.exit(main())
|