src.integrations.enhanced_task_classifier module#
Enhanced Task Type Classification System.
Provides robust task type identification with expanded keyword lists, pattern matching, and context-aware classification for 95%+ accuracy.
- class src.integrations.enhanced_task_classifier.ClassificationResult[source]#
Bases:
objectResult of task type classification with confidence.
- class src.integrations.enhanced_task_classifier.EnhancedTaskClassifier[source]#
Bases:
objectEnhanced task classifier with expanded keywords and pattern matching.
Improvements over basic classifier: - Expanded keyword lists based on real-world usage - Regular expression pattern matching - Context-aware classification - Confidence scoring - Support for compound task names
- TASK_KEYWORDS = {TaskType.DEPLOYMENT: {'primary': ['deploy', 'deployment', 'release', 'launch', 'rollout', 'publish'], 'secondary': ['production', 'staging', 'live', 'go-live', 'ship', 'deliver', 'distribution', 'installation', 'setup', 'migration', 'upgrade', 'rollback', 'hotfix'], 'verbs': ['deploy', 'release', 'launch', 'publish', 'ship', 'deliver', 'distribute', 'install', 'migrate']}, TaskType.DESIGN: {'primary': ['design', 'architect', 'plan', 'planning', 'architecture', 'blueprint', 'specification', 'spec', 'specs', 'research', 'analyze', 'analysis', 'study', 'investigate'], 'secondary': ['wireframe', 'mockup', 'prototype', 'diagram', 'model', 'schema', 'structure', 'layout', 'interface', 'ui/ux', 'ux', 'ui', 'workflow', 'concept', 'draft', 'outline', 'framework', 'pattern', 'template'], 'verbs': ['design', 'plan', 'architect', 'draft', 'outline', 'conceptualize', 'define', 'specify', 'model']}, TaskType.DOCUMENTATION: {'primary': ['document', 'documentation', 'docs', 'readme', 'guide', 'manual', 'wiki', 'tutorial'], 'secondary': ['howto', 'how-to', 'reference', 'api-docs', 'changelog', 'notes', 'instructions', 'help', 'faq', 'examples', 'samples', 'comments', 'annotations', 'description', 'explanation', 'onboarding'], 'verbs': ['document', 'write', 'annotate', 'comment', 'describe', 'explain', 'detail', 'add']}, TaskType.IMPLEMENTATION: {'primary': ['implement', 'build', 'develop', 'code', 'program', 'construct', 'engineer', 'fix', 'bug', 'bugfix', 'patch', 'repair'], 'secondary': ['feature', 'functionality', 'component', 'module', 'service', 'api', 'endpoint', 'integration', 'backend', 'frontend', 'database', 'logic', 'algorithm', 'function', 'class', 'handler', 'controller', 'middleware'], 'verbs': ['implement', 'build', 'create', 'develop', 'code', 'write', 'add', 'integrate', 'setup', 'configure', 'establish', 'construct', 'generate', 'produce']}, TaskType.INFRASTRUCTURE: {'primary': ['infrastructure', 'setup', 'configure', 'provision', 'environment', 'devops'], 'secondary': ['server', 'database', 'network', 'docker', 'kubernetes', 'k8s', 'container', 'vm', 'cloud', 'aws', 'azure', 'gcp', 'ci/cd', 'pipeline', 'monitoring', 'logging', 'security', 'firewall', 'ssl', 'dns', 'cdn'], 'verbs': ['setup', 'configure', 'provision', 'install', 'initialize', 'bootstrap', 'orchestrate', 'manage']}, TaskType.INTEGRATION: {'primary': ['integration verification', 'build verification', 'smoke test', 'startup verification', 'system verification'], 'secondary': ['health check', 'port check', 'endpoint verification', 'runtime verification', 'startup check'], 'verbs': ['verify integration', 'verify build', 'verify startup', 'smoke test']}, TaskType.TESTING: {'primary': ['test', 'testing', 'qa', 'quality', 'verify', 'validate', 'check', 'assert'], 'secondary': ['unit', 'integration', 'e2e', 'end-to-end', 'functional', 'regression', 'smoke', 'acceptance', 'performance', 'load', 'stress', 'coverage', 'suite', 'scenario', 'case', 'cases', 'spec', 'specification', 'behavior'], 'verbs': ['test', 'verify', 'validate', 'check', 'ensure', 'confirm', 'assert', 'examine', 'inspect', 'audit']}}#
- TASK_PATTERNS = {TaskType.DEPLOYMENT: ['(?:deploy|release)\\s+(?:to|on)\\s+(?:production|staging|live)', '(?:setup|configure)\\s+(?:the\\s+)?deployment\\s+(?:pipeline|process)', '(?:publish|ship)\\s+(?:the\\s+)?(?:application|app|service)', '(?:rollout|launch)\\s+(?:the\\s+)?(?:feature|update|version)', '(?:migrate|upgrade)\\s+(?:the\\s+)?(?:production|live)\\s+(?:environment|system)'], TaskType.DESIGN: ['(?:create|define|plan)\\s+(?:the\\s+)?(?:system|application|software)\\s+(?:architecture|design)', 'design\\s+(?:the\\s+)?(?:data|database)\\s+(?:model|schema|structure)', '(?:create|design)\\s+(?:ui|ux|user\\s+interface|user\\s+experience)', '(?:define|specify)\\s+(?:api|interface)\\s+(?:contracts?|specifications?)', '(?:plan|design)\\s+(?:the\\s+)?(?:workflow|process|flow)'], TaskType.DOCUMENTATION: ['(?:document|write\\s+documentation)\\s+(?:for|about)', '(?:create|write|update)\\s+(?:the\\s+)?(?:api|user|developer)\\s+(?:docs|documentation|guide)', '(?:add|write)\\s+(?:code\\s+)?comments?\\s+(?:to|for)', '(?:create|update)\\s+(?:the\\s+)?readme(?:\\.md)?', '(?:write|create)\\s+(?:a\\s+)?(?:tutorial|guide|manual)'], TaskType.IMPLEMENTATION: ['(?:implement|build|create)\\s+(?:the\\s+)?(?:\\w+\\s+)?(?:feature|functionality|component)', '(?:add|integrate)\\s+(?:\\w+\\s+)?(?:support|integration)\\s+(?:for|with)', '(?:develop|code|write)\\s+(?:the\\s+)?(?:\\w+\\s+)?(?:api|service|endpoint)', '(?:create|build)\\s+(?:the\\s+)?(?:\\w+\\s+)?(?:backend|frontend|ui)', '(?:implement|add)\\s+(?:\\w+\\s+)?(?:logic|algorithm|handler)'], TaskType.INFRASTRUCTURE: ['(?:setup|configure)\\s+(?:the\\s+)?(?:ci/cd|pipeline|automation)', '(?:provision|create)\\s+(?:the\\s+)?(?:infrastructure|environment)', '(?:configure|setup)\\s+(?:the\\s+)?(?:monitoring|logging|alerts)', '(?:install|setup)\\s+(?:and\\s+configure\\s+)?(?:docker|kubernetes|k8s)', '(?:create|setup)\\s+(?:the\\s+)?(?:server|network)(?!\\s+connection)', '(?:setup|configure)\\s+(?:the\\s+)?database\\s+(?:cluster|infrastructure|environment|server)'], TaskType.INTEGRATION: ['(?:integration|build|startup)\\s+verification', '(?:verify|check)\\s+(?:the\\s+)?(?:build|startup|integration)', 'smoke\\s+test\\s+(?:the\\s+)?(?:application|app|project)', '(?:verify|check)\\s+(?:the\\s+)?(?:app|application)\\s+(?:works|runs|starts|responds)'], TaskType.TESTING: ['write.*tests?', '(?:write|create|add)\\s+(?:unit\\s+)?tests?\\s+(?:for|to)', '(?:test|verify|validate)\\s+(?:the\\s+)?(?:\\w+\\s+)?(?:functionality|feature|component)', '(?:create|write)\\s+(?:integration|e2e|end-to-end)\\s+tests?', '(?:ensure|verify|check)\\s+(?:that|if)\\s+(?:\\w+\\s+)?(?:works?|functions?)', '(?:add|improve)\\s+test\\s+coverage']}#
- classify_with_confidence(task)[source]#
Classify a task and return detailed results with confidence.
- Parameters:
task (
Task) – Task to classify- Returns:
ClassificationResult with type, confidence, and reasoning
- Return type: