You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
buzz-db: break up lib.rs — move impl Db methods to domain modules #2
lib.rs is 9,491 lines with a single impl Db block containing 240 public methods. The majority are thin delegation wrappers that forward &self.pool to a free function in a domain module and add a #[datastore_span] attribute. This delegation layer alone accounts for ~5,000 lines of boilerplate.
Proposed change
Move each group of impl Db methods into their respective domain module files. Rust allows multiple impl Db blocks across files within the same crate, so channel.rs would own Db::create_channel, Db::add_member, etc. directly — eliminating the free-function-plus-wrapper indirection.
High — biggest single-file maintainability problem, mechanical to execute, reduces merge conflicts.
Dependencies
None — can be done independently. Items like extracting community.rs (#TBD) and moving misplaced types (#TBD) are naturally done alongside this.
🤖 AI review update (2026-08-23)
The goal is clear, but this should be an incremental tracker rather than a single 9,000-line relocation. Split work by domain (replacement, community, channel membership, API token/allowlist, reminders), and require each slice to move its tests and datastore spans while preserving public API behavior. This lowers merge-conflict and review risk in an active codebase.
#6815 — deletion facades and cross-domain serving-write boundary
#6890 — final private runtime/ and store/ source layout with a thin compatibility facade
The reconstructed stack removes crates/buzz-db/tests/store_ownership.rs everywhere and does not replace it with another path-sensitive ownership test. Each production patch remains byte-for-byte identical to its previously reviewed slice after that complete test-file diff is removed. The final structural PR makes ownership obvious in the source tree: runtime and genuinely cross-cutting infrastructure live under private runtime/ modules, domain persistence lives under private store/ modules, and existing consumer paths such as buzz_db::Db, buzz_db::channel::ChannelRecord, crate-root record exports, and inherent Db methods remain compatible through lib.rs re-exports.
Final cumulative Blox evidence at 61304ccbdc39f9b17cd12ca248ac058f797b0e43: formatting, diff checks, strict buzz-db/buzz-relay clippy, buzz-db checks and docs, relay consumer compilation, 111 non-PostgreSQL DB library tests, and the observability source test pass. A separate clean exact-head review passed all 200 ignored PostgreSQL-backed buzz-db tests individually against fresh native-PostgreSQL databases and confirmed identical SQL-line, metric-name, and datastore-span multisets versus the parent. Every reconstructed PR also received its own fresh clean exact-base/exact-head Blox review; no findings remain.
Final lib.rs: 56 physical lines. It contains module declarations and compatibility re-exports only; the private runtime/ and store/ namespaces are not exposed as new public API.
No PR was merged by this work and no tracker issue was closed.
🤖 The remaining issue #2 extraction work has been consolidated into one draft PR: block#6987 (main at e76c81968b65b0755b83efdd59dc3375c59ddf40 → codex/issue-2-store-extraction at cc14bc9d81ded60c30ec64c84234d37c9278b572). It covers API tokens, auth allowlists, reminders, event queries, threads, reactions, feeds, users/DMs, push, workflows/runs/approvals, relay membership/invites, product feedback, moderation/admin moderation, git repositories, archived identities, usage, partition maintenance, deletion, and the final private runtime/ / store/ layout. Merged block#6782 remains the channel-membership base. The prior remaining stack PRs will be closed as superseded only after block#6987 exact-head CI is green; no tracker issues are being closed here.
Completed by the incremental extraction series block#6668, block#6777, block#6782, and block#6987. buzz-db now separates runtime infrastructure from domain stores, and lib.rs is a small compatibility facade.
Activity
Extract community persistence (#6668)
TheSentinel454 commentedon Aug 25, 2026
🤖 The remaining issue #2 store-extraction work is published as a 26-layer stack in
block/buzz(block#6777 is merged; the remaining 25 PRs are drafts):runtime/andstore/source layout with a thin compatibility facadeThe reconstructed stack removes
crates/buzz-db/tests/store_ownership.rseverywhere and does not replace it with another path-sensitive ownership test. Each production patch remains byte-for-byte identical to its previously reviewed slice after that complete test-file diff is removed. The final structural PR makes ownership obvious in the source tree: runtime and genuinely cross-cutting infrastructure live under privateruntime/modules, domain persistence lives under privatestore/modules, and existing consumer paths such asbuzz_db::Db,buzz_db::channel::ChannelRecord, crate-root record exports, and inherentDbmethods remain compatible throughlib.rsre-exports.Final cumulative Blox evidence at
61304ccbdc39f9b17cd12ca248ac058f797b0e43: formatting, diff checks, strictbuzz-db/buzz-relayclippy,buzz-dbchecks and docs, relay consumer compilation, 111 non-PostgreSQL DB library tests, and the observability source test pass. A separate clean exact-head review passed all 200 ignored PostgreSQL-backedbuzz-dbtests individually against fresh native-PostgreSQL databases and confirmed identical SQL-line, metric-name, and datastore-span multisets versus the parent. Every reconstructed PR also received its own fresh clean exact-base/exact-head Blox review; no findings remain.Final
lib.rs: 56 physical lines. It contains module declarations and compatibility re-exports only; the privateruntime/andstore/namespaces are not exposed as new public API.No PR was merged by this work and no tracker issue was closed.
refactor(db): finish replaceable event store extraction (#6777)
test(db): use canonical channel roster fixtures (#6819)
refactor(db): split channel membership store (#6782)
TheSentinel454 commentedon Aug 28, 2026
🤖 The remaining issue #2 extraction work has been consolidated into one draft PR: block#6987 (
mainate76c81968b65b0755b83efdd59dc3375c59ddf40→codex/issue-2-store-extractionatcc14bc9d81ded60c30ec64c84234d37c9278b572). It covers API tokens, auth allowlists, reminders, event queries, threads, reactions, feeds, users/DMs, push, workflows/runs/approvals, relay membership/invites, product feedback, moderation/admin moderation, git repositories, archived identities, usage, partition maintenance, deletion, and the final privateruntime//store/layout. Merged block#6782 remains the channel-membership base. The prior remaining stack PRs will be closed as superseded only after block#6987 exact-head CI is green; no tracker issues are being closed here.refactor(db): extract domain stores from database runtime (#6987)
refactor(db): extract domain stores from database runtime (#6987)
TheSentinel454 commentedon Sep 3, 2026
Completed by the incremental extraction series block#6668, block#6777, block#6782, and block#6987. buzz-db now separates runtime infrastructure from domain stores, and lib.rs is a small compatibility facade.
Extract community persistence (#6668)
Extract community persistence (#6668)
Extract community persistence (block#6668)
refactor(db): finish replaceable event store extraction (block#6777)
test(db): use canonical channel roster fixtures (block#6819)
refactor(db): split channel membership store (block#6782)
refactor(db): extract domain stores from database runtime (block#6987)