Skip to content

Sedimentree fragment compaction - #164

Merged
lannbot merged 1 commit into
mainfrom
m4c/fragments
Sep 7, 2026
Merged

Sedimentree fragment compaction#164
lannbot merged 1 commit into
mainfrom
m4c/fragments

Conversation

@lannbot

@lannbot lannbot commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Compaction via automerge's native fragments (fragments(1..)/bundle_fragments, the same leading-zero-bytes rule as sedimentree) → sealed sedimentree fragments through add_fragments; covered loose commits pruned with Sedimentree::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 us tree no longer refills its adopted history from Drive (the document already has it); convergence unaffected.

Automerge armed.

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).
@lannbot
lannbot enabled auto-merge September 7, 2026 16:27
@lannbot
lannbot merged commit f274401 into main Sep 7, 2026
2 checks passed
@lannbot
lannbot deleted the m4c/fragments branch September 7, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants