Sedimentree fragment compaction - #164
Merged
Merged
Conversation
automerge 0.11 and sedimentree share one partitioning rule (leading zero bytes of the change hash), and automerge builds the fragments itself: after every local mutation and every absorb that landed content, each automerge-backed tree's level>=1 fragments that are not yet in storage are bundled, sealed as one keyhive envelope (app trees; us stays plaintext) whose ancestors name the boundary fragments' keys, added through subduction's add_fragments, and the loose commits they cover are pruned from storage by Sedimentree::minimize — only fragments anchored to other held fragments authorise a drop. A fragment's members ride in its bundle, so their entries leave the head set and a chain of fragments stays one entry point; a joiner reads history from the fragment. Remote fragments are absorbed as bundles. Drive stores fragments under domain-separated names; a pulled object the document has already applied but this device no longer holds loose is refused rather than re-ingested (no ledger: the document's applied set is the predicate). Only a device holding the plaintext can build, by construction; two devices with one causal graph build the same fragment. Store objects are never deleted (cost recorded).
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.
Compaction via automerge's native fragments (
fragments(1..)/bundle_fragments, the same leading-zero-bytes rule as sedimentree) → sealed sedimentree fragments throughadd_fragments; covered loose commits pruned withSedimentree::minimize(only fragments anchored to held fragments authorise a drop); fragment envelopes name the boundary fragments' keys so the head set stays one entry point across a chain; remote fragments absorbed as bundles; Drive pushes/pulls fragments (domain-separated names) and refuses re-ingest of objects the document already applied.Design record: "Fragments" under §"Read-back and partitions" (who may build, identity, store objects not deleted).
Tests: 22 engine (forced fragment ≈ 256 writes; restore, peer sync, later joiner, two-fragment chain = one entry point, determinism), 70 kernel (Drive pushes the fragment; fewer objects than mutations). e2e 17/17 ×2. Runtime wasm +4%.
Behaviour note: a joiner's
ustree no longer refills its adopted history from Drive (the document already has it); convergence unaffected.Automerge armed.