Collapse src/config/resolve.ts into an orchestrated pipeline over domain modules, wire launcher regression coverage into test scripts, and sync backlog/subagent tracking artifacts for completed TASK-74/TASK-96/TASK-98 follow-up planning.
4.5 KiB
id, title, status, assignee, created_date, updated_date, labels, dependencies, priority
| id | title | status | assignee | created_date | updated_date | labels | dependencies | priority | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TASK-96 | Split config resolve into domain modules | Done |
|
2026-02-21 07:15 | 2026-02-21 20:10 |
|
|
high |
Description
src/config/resolve.ts remains oversized and mixes unrelated concerns. Split into domain-focused modules while preserving behavior and public API.
Action Steps
- Capture baseline: LOC, exported symbols, and current test coverage touching config resolution.
- Create domain modules under
src/config/resolve/:env-paths.tssubtitle-style.tsintegrations.tsvalidation-errors.ts
- Keep
src/config/resolve.tsas thin orchestrator/barrel that composes domain resolvers. - Add seam tests per new module; keep existing config suite green.
- Verify no call-site changes required outside config service layer.
- Run verification gate:
bun run build,bun run test:config:dist,bun run check:file-budgets. - Record before/after LOC and ownership map in task notes.
Acceptance Criteria
- #1
src/config/resolve.tsreduced to orchestration/barrel role. - #2 New domain modules exist with clear single-responsibility boundaries.
- #3 Existing config behavior preserved with passing tests.
- #4 New seam tests cover domain-specific resolution logic.
- #5 File-budget report shows measurable reduction in hotspot file size.
Implementation Plan
Execution plan (2026-02-21 codex refresh):
- Capture baseline metrics (
wc -l src/config/resolve.ts,bun run check:file-budgets) and keep evidence in notes. - Ensure seam test coverage exists for extracted domain modules (
src/config/resolve/anki-connect.test.ts,src/config/resolve/subtitle-style.test.ts,src/config/resolve/jellyfin.test.ts) and wire config test scripts so these tests run in src + dist lanes. - Reduce
src/config/resolve.tsto orchestration facade by composing extracted modules in stable order:createResolveContextapplyTopLevelConfigapplyCoreDomainConfigapplySubtitleDomainConfigapplyIntegrationConfigapplyImmersionTrackingConfigapplyAnkiConnectResolution
- Verify no behavior drift with required gates:
bun run build,bun run test:config:dist,bun run check:file-budgets. - Record before/after LOC + budget results and finalize acceptance criteria / DoD in task metadata (no commit).
Implementation Notes
[baseline] wc -l src/config/resolve.ts => 1414 LOC.
[baseline] bun run check:file-budgets reports src/config/resolve.ts: 1415 LOC and 17 files over 500 LOC.
[implementation] Reduced src/config/resolve.ts to orchestration facade that now composes extracted domain modules in stable order: top-level -> core -> subtitle -> integrations -> immersion-tracking -> anki-connect.
[implementation] Wired config seam tests into official config lanes by updating package.json scripts test:config:src and test:config:dist to include src/config/resolve/{anki-connect,subtitle-style,jellyfin}.test.ts (and compiled dist equivalents).
[verification] bun run build && bun run test:config:dist && bun run check:file-budgets passed. Config dist lane now runs 48 tests including seam tests; all passing.
[metrics] LOC before/after: wc -l src/config/resolve.ts baseline 1414 -> final 33.
[metrics] Budget before/after: baseline report showed 18 files over 500 LOC including src/config/resolve.ts: 1415 LOC; final report shows 17 files over 500 LOC and src/config/resolve.ts no longer over budget.
Final Summary
Refactored config resolution into domain-focused modules and reduced src/config/resolve.ts to a thin orchestration facade while preserving behavior. Added/wired resolver seam tests into src+dist config test lanes and verified with required gates (build, test:config:dist, check:file-budgets) plus before/after LOC and budget evidence.
Definition of Done
- #1 Baseline and final LOC metrics recorded in Implementation Notes.
- #2
bun run buildandbun run test:config:distpass. - #3
bun run check:file-budgetscompleted and attached in notes.