kimi
|
596daa26a6
|
refactor: split scorecard_service.py into focused modules (#1406)
Tests / lint (pull_request) Successful in 22s
Tests / test (pull_request) Failing after 25m52s
Splits the 517-line scorecard_service.py monolith into a proper package:
- types.py: PeriodType, AgentMetrics, ScorecardSummary dataclasses
- validators.py: Input validation, period bounds, actor extraction
- aggregators.py: Event collection, metrics aggregation, token queries
- calculators.py: Pattern detection algorithms, score calculations
- formatters.py: Narrative bullet generation, display formatting
- core.py: Main ScorecardService orchestrator (generate_scorecard, generate_all_scorecards)
- __init__.py: Clean public API exports
Benefits:
- Testable components in isolation
- Clear separation of concerns
- More maintainable dashboard logic
- No breaking changes to public API
Fixes #1406
|
2026-03-24 16:04:22 -04:00 |
|