OverviewFilesCommitsIssuesDocsReleasesPeers

atproto-room commits / 8e8d9f2

serve-membrane: record the projection's load-bearing assumption
projectRepoFrames reconstructs the record set from the #commit frames alone, which works only because a frame carries the record bytes for its own create/update ops and __commit__ entries replicate whole. That is also what buys the property worth keeping: a co-owner whose overlay bytes have not arrived can still serve a complete, self-consistent repo for any head whose frames it holds — no byte resolution, no live view. swarm-device.js:78 muses about a future step where "the firehose no longer carries them" (record bytes move wholly to the overlay files). That would break this projection AND SwarmDevice.restore/_recordsFromFirehose, which rest on the same property. It is not a plan of record in any doc, so this is a comment rather than a code change — but it should be a decision, not a surprise discovered by whoever tries it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
8e8d9f2b94b393222e5f40e4d1f52cf1d5e81104
by plankatron <fleeky@gmail.com> · 2026-07-27T14:02:12.000Z

Changed files (1) +11 -0

lib/serve-membrane.js +11 -0
……@@ -71,6 +71,17 @@ function entryDataCid (e) {
7171// block the frame ITSELF carries (buildCommitWrite puts them in newBlocks). Race-free: it depends on
7272// nothing but the frames. Returns the mutated map, or null if a referenced block is absent — a
7373// partially-replicated log we must NOT pretend to have reconstructed.
74//
75// ⚠ LOAD-BEARING ASSUMPTION: a #commit frame carries the record bytes for its own create/update ops,
76// and __commit__ entries replicate whole (blocks included) as autobase values. That is what lets this
77// reconstruct a complete record set with NO byte resolution and no live view — so a co-owner whose
78// overlay bytes have not arrived can still serve a complete, self-consistent repo for any head whose
79// frames it holds. SwarmDevice.restore/_recordsFromFirehose already depend on the same property.
80// hyper-proto-peer's swarm-device.js:78 muses about a future step where "the firehose no longer
81// carries them" (record bytes move wholly to the overlay files). Doing that would break BOTH this
82// projection and restore(); it would need the projection to resolve bytes through the record store
83// first, and would give up the no-byte-resolution property above. Not a plan of record anywhere —
84// noted so it is a decision rather than a surprise.
7485function applyFrames (byPath, frames) {
7586 for (const e of frames) {
7687 const blocks = new Map((e.blocks || []).map((b) => [b.cid, b.bytes]))