Repository navigation
Remove an idle conversation's landed files, and keep its structure in skeletons - #65
Merged
Merged
Conversation
Upgrades from older builds are not supported, so a session such a build sent takes its owner at its next send, like any other session.
… skeletons storage.retention, -1 and off by default, removes the landed files of a conversation that was sent and has had nothing new land for that long, such as 72h or 30d. asz collect and asz server remove at the end of a pass, after the send, a conversation's files together, once its head round covers them and, with metrics derived, every file of it is derived. A conversation never sent is kept, and so is one holding provider bodies, for now. Each removed file is replaced by a skeleton, <name>.sk: Session Data, compressed with gzip, that keeps every record and part in its place with every identifier the index reads, a changes record's files and lines without their diff, an execution record's join, time and outcome, and no content. Its header records the file's digest, size and record count, when and by which removal it was removed, and what the receiver confirmed of it. The index rebuilt from skeletons is the index rebuilt from the landed files, byte for byte, so a conversation that becomes active again continues the same chain. Every scenario run twice, once removing everything after each send, sent the same files, rounds and metrics, byte for byte. On one root, 847.5 MB of landed files had skeletons of 29.6 MB. A removal writes removing.json first, then each skeleton, synced with the error of its first sync checked, then deletes each file whose skeleton reads whole and records its digest, then syncs every directory of the removed range before the intent goes. The next pass finishes a removal a crash or a power loss stopped, before anything lands, and no collector lands into a session while its removal is unfinished. Every reader of landed files reads a skeleton. The export never sends one, verify reports removed files apart, the page marks removed steps, asz show says a record was removed, LangSmith's next position goes on from one, and asz repack refuses a session with skeletons. Metrics turned on after a removal count the tokens a skeleton keeps.
wu-sheng
force-pushed
the
retention-skeletons
branch
from
October 13, 2026 02:40
c2775de to
fd44be6
Compare
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.
Step 4 of retention. A storage root no longer only grows.
What it does
storage.retention,-1and off by default, removes the landed files of a conversation that was sent and has had nothing new land for that long, such as72hor30d.asz collectandasz serverdo it at the end of a pass, after the send.A conversation's files go together, and only when all of these hold:
push.state: it was sent, or a send was tried.Sending is not waited for. Retention never runs over a scenario root.
Skeletons
Each removed file is replaced by
<name>.sk: Session Data, compressed with gzip. It keeps every record and part in its place, with every identifier the index reads, and no content.The header's new
removedobject records:The index rebuilt from skeletons is the index rebuilt from the landed files, byte for byte, so a conversation that becomes active again continues the same chain. A skeleton is never sent.
Measured on 2026-10-13 on one root: 7,235 landed files of 847.5 MB had skeletons of 29.6 MB, 3.5%.
Nothing lost
removing.jsonrecords the removal: its generation, the newest sequence it removes, and its phase.removing.jsonis deleted.Every pass finishes an unfinished removal before anything lands. No collector lands into a session while its removal is unfinished: it finds the session busy.
Readers
asz verifyremoved; follows a removal mid-read; keeps what it read for the chain head and the removal generation inremoval.state, so a separateasz viewsees a removalasz showasz repackAlso in this PR: the first commit takes out the owner adoption for
push.statefiles an older build wrote. Upgrades from older builds are not supported.Deferred to later steps:
sent_state_retentionand the retired marker.Tests
Each was proven by reverting its fix.
tests/chain/retention_test.gopkg/skeleton: the format.internal/storage: listing, digests, the counter, the intent, the removal generation, the fallback open, the busy lock.internal/verify: removed files reported, not verified.internal/view: whole-record steps, removed bodies not served.internal/config: parsing and overflow.internal/adapters/langsmith: the next position.cmd/asz: the pass line, scenario roots left alone, repack refusing, andshowandverify.