Repository navigation
feat: merge pristine.redb and changes.redb into atomic.redb - #230
Merged
Merged
Conversation
Repositories kept graph state in .atomic/pristine.redb and the provenance journal in .atomic/changes.redb. Both now live in one .atomic/atomic.redb. - atomic-core: a registry of every table (pristine/schema.rs) with a schema version in the new atomic_meta table. LegacyDatabases::merge_into copies each table through its typed definition into a fresh file, verifies a per-table digest against the source, refuses unknown non-empty tables, and leaves retired tables (stacks, channels, file_mtimes) behind. - atomic-repository: ensure_database merges a legacy layout on first open (atomic.redb.merging -> atomic.redb; old files kept in .atomic/legacy/<ts>/) and finishes an interrupted retirement. Concurrent openers serialize on the legacy file lock. open/open_existing/open_readonly wait up to 5s for a busy database. The change store can share the repository's redb handle (Repository::redb_change_store) or open an existing file without creating it. - atomic agent database-owner: opens atomic.redb only while serving a store request. Startup, Ping and Shutdown never touch it, so the owner no longer locks other atomic processes out of the repository. - hooks: close the repository before acknowledging a checkpoint, since the owner now opens the same file.
vinceblock99
marked this pull request as ready for review
October 2, 2026 02:50
geekgonecrazy
added a commit
that referenced
this pull request
Oct 6, 2026
- state.change_store: ensure_database (the legacy-layout merge) then open_existing on the merged atomic.redb — redb refuses a second concurrent handle, so the journal-port handlers keep the sequential open/use/drop discipline under the gate. - DirectJournalSink holds NO handle: each journal operation opens the merged database, runs, and drops it (the orchestrator opens the same file; the two can no longer coexist as concurrent handles). - atomic-repository: sync the #230 database module (pub database mod for the CLI's root-finder predicate) + the CandidateSet/BaggageEntry/ Coverage Deserialize derives for the triage wire.
geekgonecrazy
added a commit
that referenced
this pull request
Oct 7, 2026
#230 merged pristine.redb and changes.redb into a single atomic.redb, so a fresh init no longer writes pristine.redb — but the CLI's root finder still required it and could not discover #230-created repos at all. The finder now applies the same predicate Repository::find_root uses (has_database: atomic.redb, or the legacy pristine.redb before the merge), and the discovery integration test asserts the merged database file.
geekgonecrazy
added a commit
that referenced
this pull request
Oct 7, 2026
- state.change_store: ensure_database (the legacy-layout merge) then open_existing on the merged atomic.redb — redb refuses a second concurrent handle, so the journal-port handlers keep the sequential open/use/drop discipline under the gate. - DirectJournalSink holds NO handle: each journal operation opens the merged database, runs, and drops it (the orchestrator opens the same file; the two can no longer coexist as concurrent handles). - atomic-repository: sync the #230 database module (pub database mod for the CLI's root-finder predicate) + the CandidateSet/BaggageEntry/ Coverage Deserialize derives for the triage wire.
geekgonecrazy
added a commit
that referenced
this pull request
Oct 7, 2026
#230 merged pristine.redb and changes.redb into a single atomic.redb, so a fresh init no longer writes pristine.redb — but the CLI's root finder still required it and could not discover #230-created repos at all. The finder now applies the same predicate Repository::find_root uses (has_database: atomic.redb, or the legacy pristine.redb before the merge), and the discovery integration test asserts the merged database file.
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.
Merge
pristine.redbandchanges.redbinto.atomic/atomic.redbso repository state uses one database file.This PR covers database consolidation. Cross-table publication transactions and additional agent crash recovery are separate follow-up work. Protobuf/RPC contracts are unchanged.
Validated with the full workspace suite (9,116 passed), agent harness, real legacy repository migration and live Codex hook workflow; Clippy, rustdoc and formatting checks pass.
Before release, coordinate the matching
atomic-storageupdate for its directpristine.redbaccess and snapshot names.