Relationships
#4006 Team mode: serve sends the compacted base, so a serve-mode checkout can catch up past compaction
Opened by stack72 · 10/27/2026
Background
swamp-club#3985 gives a v3 checkout a serve upstream: its commits.db is a follower copy of serve's commit log, filled from serve's GET changes?cursor= and GET partitions/{p}/commits?after= (see "Team mode: the CLI's serve upstream" in design/enablers/datastores.md).
Serve compacts its log (compactHistory, the retention pass). A read that starts at or below the compaction point answers 410 commits_compacted, and serve has no route that sends the compacted base. So a fresh checkout of a datastore serve has compacted, or a copy that fell behind the compaction point, cannot catch up. Today it is refused with a clear error.
What to build
A serve route that sends a caller the compacted base of its namespace, filtered as the changes feed filters commits, plus the client side that loads it into the follower copy (as SqliteReadModel loads readCompactedBase locally) and continues the feed after the compaction point.
- The base is filtered per caller with the same read rules as
GET changes(a security boundary: a caller must not learn records it may not read). - The client loads it, records the compaction point and serve's heads, then pages the feed from there.
Done when
- A fresh serve-mode checkout of a compacted datastore catches up and reads what a solo checkout of the same datastore reads, restricted to what the caller may read.
- A test shows a caller never receives a compacted record it may not read.
Open
No activity in this phase yet.
Sign in to post a ripple.