refactor: clarify resource control boundaries

This commit is contained in:
Eric Wendland 2026-07-05 23:48:21 +02:00
commit d443b82f1a
5 changed files with 275 additions and 64 deletions

View file

@ -10,10 +10,13 @@ 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. `local_control.rs` owns async local `ControlRequest`
routing and safe trace-field classification before delegating to feature
handlers. Runtime registries for pubsub, pipes, and overlays live behind narrow
mutex-protected structs in `runtime.rs`. Command-family handler modules and
protected peer-control feature dispatch remain separate refactor targets.
routing, safe trace-field classification, and named peer/resource/local handler
families before delegating to feature implementations. `resource_contracts.rs`
records the review boundary for each resource family: resource ID patterns,
capabilities, and mutation or host-access points. Runtime registries for
pubsub, pipes, and overlays live behind narrow mutex-protected structs in
`runtime.rs`. Protected peer-control ALPN dispatch remains a separate refactor
target.
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

View file

@ -45,11 +45,11 @@ behavior.
ownership and locking rules.
- `[x]` Existing daemon startup and status tests pass unchanged.
- `[~]` Extract local control routing.
- `[x]` Extract local control routing.
Acceptance criteria:
- `[x]` Local `ControlRequest` dispatch is a routing layer, not the home of
every feature implementation.
- `[ ]` Each command family has a small handler module or function group.
- `[x]` Each command family has a small handler module or function group.
- `[x]` Local-only behavior remains covered by existing integration tests.
- `[~]` Extract protected peer-control routing.
@ -64,13 +64,13 @@ behavior.
repeating peer-card boilerplate.
- `[x]` Remote request tests still prove discovery alone grants no access.
- `[ ]` Extract resource module handlers.
- `[x]` Extract resource module handlers.
Acceptance criteria:
- `[ ]` CAS/file-root, KV, DB, document, pubsub, pipe, SSH, and overlay
- `[x]` CAS/file-root, KV, DB, document, pubsub, pipe, SSH, and overlay
handlers are separated enough that each can be reviewed independently.
- `[ ]` Each module documents its resource IDs, capabilities, and mutation
- `[x]` Each module documents its resource IDs, capabilities, and mutation
points.
- `[ ]` No generic `geth-common` crate is introduced.
- `[x]` No generic `geth-common` crate is introduced.
- `[x]` Extract live-sync engine.
Acceptance criteria: