Protect recoverable sidecars from retention prune (#61)#71
Merged
willwashburn merged 3 commits intomainfrom Apr 25, 2026
Merged
Protect recoverable sidecars from retention prune (#61)#71willwashburn merged 3 commits intomainfrom
willwashburn merged 3 commits intomainfrom
Conversation
Default `burn content prune` (and the opportunistic prune that runs on every CLI invocation) now skips sidecars whose upstream source session file still exists under one of the adapter roots. The data is recoverable via `burn rebuild --content`, so retention-only deletion was silently lossy. Pass `--force` (or set `RELAYBURN_PRUNE_FORCE=1`) to bypass the check and reclaim disk regardless. The ledger package stays decoupled from adapter-specific paths: `pruneContent` accepts an optional `isRecoverable(sessionId)` callback, and `PruneResult` gains a `skippedRecoverable` count alongside `filesDeleted` / `bytesFreed`. The CLI builds the source index from the same walker helpers `ingest.ts` already uses (`walkJsonl`, `walkOpencodeSessions`, plus the Claude project dir scan). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The 0.11.0 - 2026-04-25 header was accidentally dropped from packages/ledger/CHANGELOG.md, folding the released "Plans config primitives" entry into [Unreleased]. Every other package CHANGELOG and the root CHANGELOG still carry that header, so this restores the lockstep-release invariant called out in AGENTS.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Resolve packages/ledger/CHANGELOG.md conflict by keeping the PR's Unreleased Changed entry alongside the released 0.14.1 / 0.13.1 sections that landed on main.
Comment on lines
+33
to
+35
| ### Fixed | ||
|
|
||
| - **`burn content prune` (and the opportunistic prune that runs on every CLI invocation) no longer deletes sidecars whose upstream source file still exists** — the data is recoverable via `burn rebuild --content`, so retention-only deletion was silently lossy. Default `burn content prune` now reports a `kept N recoverable sidecars whose source files still exist` line alongside the deletion count. Pass `--force` (or set `RELAYBURN_PRUNE_FORCE=1`) to bypass the check and reclaim disk regardless. (#61) |
Contributor
There was a problem hiding this comment.
🔴 CLI CHANGELOG entry placed under already-released [0.13.1] instead of [Unreleased]
The AGENTS.md rule states: "Curate [Unreleased] in the relevant per-package packages/*/CHANGELOG.md as you land PRs." The new ### Fixed entry for the source-aware prune feature is added under the already-released ## [0.13.1] - 2026-04-25 section instead of under the empty ## [Unreleased] section at packages/cli/CHANGELOG.md:8. The ledger CHANGELOG (packages/ledger/CHANGELOG.md:10-12) correctly places its entry under [Unreleased], making this inconsistent as well.
Prompt for agents
The new Fixed entry (lines 33-35 of packages/cli/CHANGELOG.md) is placed under the already-released section [0.13.1]. Per AGENTS.md, new changelog entries must be curated under [Unreleased]. Move the ### Fixed block (lines 33-36) from its current position under [0.13.1] to immediately after the ## [Unreleased] header at line 8. The [Unreleased] section is currently empty (just the header followed by a blank line), so insert the ### Fixed subsection and its bullet there.
Was this helpful? React with 👍 or 👎 to provide feedback.
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.
Fixes #61.
Summary
burn content prune(and the opportunistic prune on every CLI invocation) no longer deletes sidecars whose upstream session file still exists. The data is recoverable viaburn rebuild --content, so retention-only deletion was silently lossy.pruneContentaccepts an optionalisRecoverable(sessionId)callback and now returnsPruneResult.skippedRecoverablealongsidefilesDeleted/bytesFreed. The ledger package stays free of adapter-specific paths — the CLI builds the source index from the same walker helpersingest.tsalready uses (walkJsonl,walkOpencodeSessions, plus the Claude project dir scan).burn content prune --forceandRELAYBURN_PRUNE_FORCE=1for unattended automation. The CLI prints akept N recoverable sidecars whose source files still existline when the protection kicked in, with a hint to use--force.Test plan
pnpm install && pnpm run test:ts(345 tests pass)pruneContentwithisRecoverablereturning true: file kept, counted inskippedRecoverable.pruneContentwithisRecoverablereturning false: file pruned per existing retention rule.pruneContentwithoutisRecoverable: existing retention behavior unchanged (acts like--force).isRecoverablepredicate is awaited.isRecoverablefalls through to retention (fail-closed-to-prune so a broken source index can't accumulate forever).--forceflag suppresses the recoverable-source check and the kept-recoverable output line.RELAYBURN_PRUNE_FORCE=1env var has the same effect as--force.