refactor: move daemon startup ownership

This commit is contained in:
Eric Wendland 2026-07-05 23:22:53 +02:00
commit d5a91c2396
4 changed files with 169 additions and 141 deletions

View file

@ -6,6 +6,13 @@ the shared Iroh endpoint, resource registry, module routing, and local control
socket. Control commands connect to the Unix socket and send typed JSONL
requests.
Within `geth-node`, daemon lifecycle code is separated from feature handlers:
`daemon.rs` owns `geth daemon run` startup, local socket binding, shutdown
signal handling, Iroh endpoint startup, the Iroh accept loop, and background
live-sync task spawning. Runtime registries for pubsub, pipes, and overlays live
behind narrow mutex-protected structs in `runtime.rs`. Local control and
protected peer-control feature dispatch remain separate refactor targets.
The local metadata store is SQLite product state. `geth-store` tracks a numeric
`schema_version` in the `meta` table and applies ordered migrations up to the
crate's current schema version when the store opens. Fresh database creation and

View file

@ -35,15 +35,15 @@ Goal: make the documented local quality gate pass before deeper refactors.
Goal: split `geth-node` into reviewable daemon subsystems without changing
behavior.
- `[~]` Extract daemon startup and runtime ownership.
- `[x]` Extract daemon startup and runtime ownership.
Acceptance criteria:
- `[ ]` Daemon startup, shutdown, signal handling, socket setup, and Iroh
- `[x]` Daemon startup, shutdown, signal handling, socket setup, and Iroh
endpoint ownership live outside the main feature handler module.
- `[x]` Iroh accept-loop and background live-sync task spawning live outside
the main feature handler module.
- `[x]` Runtime state is represented by narrow structs with documented
ownership and locking rules.
- `[ ]` Existing daemon startup and status tests pass unchanged.
- `[x]` Existing daemon startup and status tests pass unchanged.
- `[ ]` Extract local control routing.
Acceptance criteria: