mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-27 18:22:41 -08:00
3.0 KiB
3.0 KiB
id, title, status, assignee, created_date, updated_date, labels, dependencies, priority
| id | title | status | assignee | created_date | updated_date | labels | dependencies | priority | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TASK-94 | Reduce main.ts to thin composition root | In Progress | 2026-02-20 12:06 | 2026-02-21 03:40 |
|
|
high |
Description
src/main.ts still contains heavy deps-builder orchestration and high import concentration. Complete the composition-root refactor so main.ts owns boot wiring only and domain assembly moves behind registry/domain composer modules.
Action Steps
- Baseline current
main.tsfan-in (check:main-fanin,check:file-budgets,wc -l src/main.ts). - Introduce domain composer modules for repeated build-handler clusters (startup, overlay, jellyfin, anilist, ipc/shortcuts).
- Move
createBuild*MainDepsHandlercall clusters out ofmain.tsinto domain composer modules with narrow typed inputs. - Replace inline assembly in
main.tswith single-call composer invocations per domain. - Add/adjust unit tests for new composer modules to lock shape and wiring.
- Tighten
check:main-faninthresholds after refactor to prevent regression. - Re-run full config/core test gates and update
TASK-71progress.
Progress Notes
- 2026-02-21 baseline:
src/main.ts= 3129 LOC;check:main-fanin= 105 import lines / 9 unique runtime paths. - 2026-02-21 extraction slice: added composer modules
src/main/runtime/composers/jellyfin-remote-composer.tsandsrc/main/runtime/composers/anilist-setup-composer.ts; moved correspondingcreateBuild*MainDepsHandlerorchestration out ofmain.ts. - 2026-02-21 tests: added focused composer shape tests at
src/main/runtime/composers/jellyfin-remote-composer.test.tsandsrc/main/runtime/composers/anilist-setup-composer.test.ts. - 2026-02-21 guardrail tighten:
scripts/check-main-runtime-fanin.tsdefaults tightened toimport lines <= 110andunique runtime paths <= 11. - 2026-02-21 post-slice metrics:
src/main.ts= 3042 LOC;check:main-fanin --strict= 103 import lines / 11 unique runtime paths. - Remaining gap: startup/overlay/ipc/shortcuts composer extraction still required to fully meet thin composition-root target.
Acceptance Criteria
- #1
src/main.tsis composition-focused (boot/runtime wiring only; no broad deps-builder clusters). - #2 Runtime import paths in
src/main.tsstay domain-registry oriented (no relapse to per-leaf runtime imports). - #3
check:main-faninpasses under updated threshold. - #4
bun run test:core:distpasses with no CLI/IPC behavior regressions.
Definition of Done
- #1
src/main.tsLOC and fan-in metrics improve from pre-task baseline and are recorded in task notes. - #2 New composer modules are covered by focused tests.
- #3
TASK-71andTASK-85progress notes reflect completed slice and remaining gap.