Skip to content

refactor(insight): split DataProcessor into focused single-responsibi…#2269

Open
wenshao wants to merge 1 commit intoQwenLM:mainfrom
wenshao:refactor/split-data-processor
Open

refactor(insight): split DataProcessor into focused single-responsibi…#2269
wenshao wants to merge 1 commit intoQwenLM:mainfrom
wenshao:refactor/split-data-processor

Conversation

@wenshao
Copy link
Collaborator

@wenshao wenshao commented Mar 11, 2026

…lity classes

The 1131-line DataProcessor class handled four distinct concerns: metrics calculation, LLM session analysis, qualitative insight generation, and orchestration. This splits it into:

  • MetricsCalculator (269 lines): heatmaps, streaks, tool usage, durations
  • SessionAnalyzer (388 lines): LLM-based session facet analysis and aggregation
  • QualitativeInsightGenerator (407 lines): 8 parallel LLM insight calls
  • DataProcessor (144 lines): slim orchestrator delegating to the above

Tests updated to test each class directly (no more private method casts). All 35 existing tests pass unchanged.

TLDR

Dive Deeper

Reviewer Test Plan

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

…lity classes

The 1131-line DataProcessor class handled four distinct concerns:
metrics calculation, LLM session analysis, qualitative insight generation,
and orchestration. This splits it into:

- MetricsCalculator (269 lines): heatmaps, streaks, tool usage, durations
- SessionAnalyzer (388 lines): LLM-based session facet analysis and aggregation
- QualitativeInsightGenerator (407 lines): 8 parallel LLM insight calls
- DataProcessor (144 lines): slim orchestrator delegating to the above

Tests updated to test each class directly (no more private method casts).
All 35 existing tests pass unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant