feat(foundation): backend seam (reads+writes), typed models, four-state mock, macOS CI, CDC tracer#3
Merged
Merged
Conversation
…te mock, macOS CI, CDC tracer Squash of the 16-task foundation milestone (atomic history on feat/foundation). Delivers: per-topic seam traits behind one Rc<dyn Backend> front door; mark_all_read write + persistent mock state (fixes POP-03); typed CdcRow models; four-state mock switch; macOS fmt/clippy/nextest CI gate; LiveTail primitive; Streams·CDC brought to parity through the seam (fetch/presentational split, simulated stream, four-state SSR tests); data/mock.rs split per-domain (<500 lines); pure-Dioxus SVG sparkline spike. Deferred: notify.rs / explorer/sidebar.rs seam bypasses; CDC live-stream-vs-base-state ownership (see docs/superpowers/notes/2026-06-18-cdc-stream-state-ownership.md).
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.
Squash of the 16-task foundation milestone. Atomic 16-commit TDD history preserved on
feat/foundation. 26 files, +1267/−583.Why
The app runs on mock data behind a single
ConnectionServicetrait. Before real NodeDB connectivity lands (blocked on NodeDB 0.5), the seam needed to be shaped so the real client plugs in without reshaping every screen: per-topic traits, typed models instead of tuples, a mock that can simulate all four async UI states, and a CI gate so regressions can't land silently. This PR is that foundation.What changed
Backend seam — one front door, per-topic traits
services/backend.rs(new):Backendsupertrait composingConnectionService + StreamsData, with a blanket impl. The app provides ONERc<dyn Backend>; each screen reads only the method it needs. Adding a future domain trait (Explorer, Admin, …) extends the bound — additive, never a reshape.services/streams_data.rs(new): Streams-tier reads. One method per screen's data; todaycdc_feed(). The seam — not the view — owns the native-doc → display-JSON mapping (sonic_rsat the boundary).services/connection_service.rs: first write through the seam —mark_all_read()with persistent mock state, so the notification feed stays consistent after reload (fixes POP-03: unread badge reappearing after mark-all-read).Four-state mock
MockConnectionServicegainsready()/empty()/erroring()constructors plus a delayed mode (MockBehavior), so every async screen can be driven through loading → loaded / empty / error in tests and demos without a server.Typed CDC models
models/cdc.rs(new):CdcRow { id, time, op, collection, payload_json }+CdcOpenum replace the anonymous tuples the view carried. Stableidenables keyed Dioxus lists (no index keys).Streams · CDC through the seam
views/streams/cdc.rs: rewritten to fetch viacdc_feed()with a fetch/presentational split; simulated live stream driven bytokiotime with a working Pause; four-state SSR render tests.components/live_tail.rs(new): reusableLiveTaillayout shell (toolbar/body/footer slots) so future live screens (Notify, MV, Console) compose the same chrome instead of re-emitting it.components/sparkline.rs(new): pure-Dioxus SVG sparkline spike — proves chart fidelity without a JS charting dep.Mock data reorganization
data/mock.rs(523 lines, over the 500-line repo limit) split per-domain intodata/mock/{connections,cdc,docs,notify}.rs.CI (first remote run = this PR)
.github/workflows/ci.yml(new): macOS runner,cargo fmt --check+clippy -D warnings+cargo nextest run --workspace, with cargo caching. This PR is the workflow's first-ever execution on GitHub.Tests
60/60 passing locally (fmt + clippy clean). Coverage added by this PR includes: mark-all-read persistence across reads, four-state
cdc_feedbehavior, loading→loaded transition without holding a signal guard across.await, stable/unique row ids, keyed-row SSR rendering, LiveTail slot rendering, sparkline SSR output.Deferred (tracked, intentionally out of scope)
notify.rs/explorer/sidebar.rsstill bypass the seam.Merge note
Rebase / fast-forward merge to keep
mainat exactly one commit for this milestone; GitHub's squash-merge would rewrite the hash and message.