1.4 KiB
1.4 KiB
Future Service Module Extractions
Recommended order for extracting remaining HTTP handlers into service/<domain>/
modules, following the conventions in service-modules.md.
Recommended Order
settings— small surface, few dependencies, good warm-upoauth— reads/writes token files; pure validation logic separates cleanlywizard— stateless generation logic is already mostly pure; thin I/O layerproject— project scaffolding; wrapsio::fs::scaffold, clean separationio(search/shell) — wrapsio::searchandio::shell; pure query-building separableanthropic— token-proxy handler; pure request-shaping + thin HTTP I/Ostories(workflow) — CRDT-backed story ops; typed errors for 400/404/409/500events— SSE handler; mostly framework wiring, but event filtering is pure
Special Case: ws
The WebSocket handler (http/ws.rs) is a dedicated harder extraction because
it mixes multiple concerns (chat dispatch, permission forwarding, SSE bridging)
and depends on long-lived async streams. Extract it last, after the above list
is complete and the service module pattern is well-established.
Notes
- Each extraction should link back to
docs/architecture/service-modules.mdin the story description to maintain consistency. - The
agentsextraction (story 604) is the reference implementation every future extraction should follow.