Problem
src/service.ts is 3,298 lines — roughly 28% of source LOC in a single file, and it's the coordination core of the tool.
Proposal
Decompose by responsibility, e.g.:
- turn / stick state machine
- persistence (SQLite / WAL access)
- liveness / expiry / fencing
- the public service API surface
Why it matters
The coordination core is the part that most benefits from small, focused, individually-testable modules — both for review and for reasoning about the concurrency invariants (which is where the real risk in this tool lives).
Problem
src/service.tsis 3,298 lines — roughly 28% of source LOC in a single file, and it's the coordination core of the tool.Proposal
Decompose by responsibility, e.g.:
Why it matters
The coordination core is the part that most benefits from small, focused, individually-testable modules — both for review and for reasoning about the concurrency invariants (which is where the real risk in this tool lives).