feat(cortex): Epic 1 - Reflex Arc (Layer 1) classifier
Implement fast local intent classification with escalation-aware logic. Target: <20ms processing time for simple commands. E1.S1 - Pattern Matching - New reflex-classifier.ts with 7 intent types - Top-2 match tracking for ambiguity detection - Confidence thresholds (0.7) and ambiguity threshold (0.1) E1.S2 - Escalation Triggers - Multi-intent detection: "en", "daarna", "eerst", "vervolgens" - Context-dependent pronouns: "hij", "zij", "hem", "haar", "zijn" - Relative time expressions: "morgen", "overmorgen", "volgende week" E1.S3 - Ambiguity Detection - Top-2 score comparison (delta < 0.1 → escalate) - secondBestIntent and secondBestConfidence tracking - Low confidence escalation (< 0.7) E1.S4 - Unit Tests - 25 tests covering all scenarios - Performance test: 100 classifications in <1ms - Test runner: pnpm tsx (no Jest/Vitest setup required) New files: - lib/cortex/reflex-classifier.ts - lib/cortex/__tests__/reflex-classifier.test.ts Run tests: pnpm tsx lib/cortex/__tests__/reflex-classifier.test.ts Progress: 14 SP / 48 SP (29%) - E0 + E1 complete 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ export * from './types';
|
||||
export * from './use-cortex-voice';
|
||||
export * from './intent-classifier';
|
||||
export * from './intent-classifier-ai';
|
||||
export * from './reflex-classifier';
|
||||
export * from './entity-extractor';
|
||||
export * from './date-time-parser';
|
||||
export * from './logger';
|
||||
|
||||
Reference in New Issue
Block a user