feat(routing): task classifier + default rules + CI test fixes — M4-004/005 #316

Merged
jason.woltje merged 4 commits from feat/m4-classifier-seeds into main 2026-03-23 00:26:50 +00:00

4 Commits

Author SHA1 Message Date
50edfb6613 fix(tests): correct provider.service and chat-security test assertions
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline failed
- Fix ProviderService constructor call: pass null for optional credentialsService
- Update Anthropic model order to match AnthropicAdapter registration (opus first)
- Update OpenAI model list to match OpenAIAdapter (codex-gpt-5-4 only)
- Update Z.ai assertion to verify glm-5 is present (Pi registry includes additional models)
- Add reflect-metadata import to chat-security test to fix Reflect.getMetadata error

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 19:24:35 -05:00
6cd7737a2e feat(M4-004,M4-005): default routing rules seed data and task classifier
- Add DefaultRoutingRulesSeed service that inserts 11 default routing rules on startup if table is empty
- Implement classifyTask() using deterministic regex/keyword matching for taskType, complexity, and domain
- Add unit tests covering all task types, complexity levels, and domain detection with 60+ test cases

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 19:07:30 -05:00
aba7764043 feat(routing): add routing_rules schema, condition types, and action types (M4-001/002/003)
- Add routing_rules table to packages/db with scope, priority, conditions (jsonb), and action (jsonb) columns; generate migration 0004
- Define RoutingCondition, RoutingAction, RoutingRule, TaskClassification, and RoutingDecision types in apps/gateway/src/agent/routing/routing.types.ts
- Expand @mosaic/types routing/index.ts to export all M4 types (TaskType, Complexity, Domain, CostTier+local, Capability) alongside existing RoutingCriteria/RoutingResult
- Fix pre-existing type errors in routing.service.ts (local CostTier) and default-rules.ts (count optional chaining, unknown cast)
- Fix pre-existing Prettier violations in agent module and provider files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 19:02:29 -05:00
e020b78e3b chore(orchestrator): Wave 4 complete, Wave 5 in progress — 25/65 done
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline failed
M3-001/002/003/004/006/007/009 done (PRs #303,#306,#308-#311).
Wave 5: M3-005, M3-010/011, M4-001-005 in progress.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 19:01:06 -05:00