mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-27 06:12:05 -07:00
- Track follow-up cleanup work in Backlog.md - Replace Date.now usage with shared nowMs helper - Add launcher args/parser and core regression tests
2.5 KiB
2.5 KiB
id, title, status, assignee, created_date, labels, milestone, dependencies, references, parent_task_id, priority
| id | title | status | assignee | created_date | labels | milestone | dependencies | references | parent_task_id | priority | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TASK-238.7 | Split src/main.ts into boot-phase services, runtimes, and handlers | To Do | 2026-03-27 00:00 |
|
m-0 |
|
|
TASK-238 | high |
Description
After the remaining inline runtime logic and composer gaps are extracted, src/main.ts should be split along boot-phase boundaries so the entrypoint stops mixing service construction, domain runtime composition, and handler wiring in one file. This task tracks that structural split: move service instantiation, runtime composition, and handler orchestration into dedicated boot modules, then leave src/main.ts as a thin lifecycle coordinator with clear startup-path selection.
Acceptance Criteria
- #1 Service instantiation lives in a dedicated boot module instead of a large inline setup block in
src/main.ts. - #2 Domain runtime composition lives in a dedicated boot module, separate from lifecycle and handler dispatch.
- #3 Handler/composer invocation lives in a dedicated boot module, with
src/main.tsreduced to app lifecycle and startup-path selection. - #4 Existing startup behavior remains unchanged across desktop and headless flows.
- #5 Focused tests cover the split surfaces, and the relevant runtime/typecheck gate passes.
Implementation Plan
Recommended sequence:
- Re-scan
src/main.tsafter TASK-238.6 lands and mark the remaining boot-phase seams by responsibility. - Extract service instantiation into
src/main/boot/services.tsor equivalent. - Extract runtime composition into
src/main/boot/runtimes.tsor equivalent. - Extract handler/composer orchestration into
src/main/boot/handlers.tsor equivalent. - Shrink
src/main.tsto startup-path selection, app lifecycle hooks, and minimal boot wiring. - Verify the split with focused entrypoint/runtime tests first, then run the broader runtime gate if the refactor crosses startup boundaries.
Guardrails:
- Keep the split behavior-preserving.
- Prefer small boot modules with narrow ownership over a new monolithic bootstrap layer.
- Do not reopen the inline logic work already tracked by TASK-238.6 unless a remaining seam truly belongs here.