refactor(store): separate Store into pure DAO + EventBus + filesystem paths#135
Open
Fullstop000 wants to merge 2 commits intomainfrom
Open
refactor(store): separate Store into pure DAO + EventBus + filesystem paths#135Fullstop000 wants to merge 2 commits intomainfrom
Fullstop000 wants to merge 2 commits intomainfrom
Conversation
… paths Extract broadcast channels and filesystem paths from Store so it becomes a pure SQLite DAO. This enables backend swap (SQLite → Mongo/Supabase) without carrying non-storage concerns. Changes: - New EventBus owns stream_tx/trace_tx broadcast channels - Store stripped of stream_tx, trace_tx, data_dir, agents_dir_override - Store methods return StreamEvent tuples instead of broadcasting internally - AppState carries EventBus + data_dir + agents_dir - All handlers updated to destructure tuples and publish via EventBus - Test helpers updated for new build_router_with_services signature Tests: 344 lib + ~196 integration tests all pass
Gemini review found three [P1] silent event-drop regressions: 1. — dropped events for both human and agent members. Now captures and publishes. 2. — and dropped join events. Added variants that return ; regular methods keep backward-compatible return. Handler updated to use and publish. 3. — empty-run warning event was dropped. Added to , threaded through from . All 344 lib + ~196 integration tests pass. Playwright smoke: 8/10 pass (2 pre-existing failures on main).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracts broadcast channels and filesystem paths from
Storeso it becomes a pure SQLite DAO. This enables backend swap (SQLite → Mongo/Supabase) without carrying non-storage concerns.Changes
EventBus(src/server/event_bus.rs): Ownsstream_tx/trace_txbroadcast channels, decoupled from persistence.Storefields: Removedstream_tx,trace_tx,data_dir,agents_dir_override.StreamEventtuples; callers publish viaEventBus.AppState: Carriesevent_bus,data_dir,agents_dir.AgentManager::new: Takestrace_txexplicitly.build_router_with_lifecycle_and_dirandbuild_router_with_event_bus.Verification
cargo test --lib: 344 passedcargo test --tests: ~196 integration tests passed