Repository navigation
Description
Found reviewing #1301.
A bundle may hold one file's content at two paths — ManifestEntry carries path + hash, and nothing dedupes entries by hash. When that hash names a DECDNMAN file manifest, both entries reconstruct it.
#1301 added a per-manifest-hash lock in PullCtx so the two reconstructions serialize rather than racing the same part directory. Under the default retention that also makes the second entry free: it finds the first's verified parts and pays nothing.
Under --no-keep-blobs it does not. The first entry deletes every part and the part directory before releasing the lock, so the second re-fetches — and re-pays for — every chunk. A 100 GB file at two paths costs 200 GB. Nothing in the output says so: both entries report Fetched(n) and the totals just add up.
The flag is documented (ADR 012 § Blob retention) as a disk option; this quietly makes it a billing one.
The reason #1301 did not simply fix it: ADR 012 § Blob retention pins the semantics as "delete immediately after reconstruction", so deferring the sweep contradicts the spec. That is a deliberate decision, not a code cleanup.
Options:
- Amend ADR 012 § Blob retention to "deleted when the invoking command completes", have
bundle pullpasskeep_blobs: trueper entry and sweep recorded part dirs once after all entries drain. Smallest behavior change; makes the lock's benefit uniform across modes. - Dedupe entries by blob hash before the fan-out: reconstruct once, then copy (or hardlink) to the other destination paths. Saves the paid re-fetch and the second concatenation pass in both modes, but appendix-bundles § Pull currently describes entries as independent (per-entry node selection, per-entry output, skip-existing per path), so it needs a note there and careful
--overwrite/skip-existing interaction per destination. - Warn only — tell the user at the point of re-fetch that N chunks already paid for this run were deleted by
--no-keep-blobs.
Option 1 is the smaller change; option 2 is strictly better for the user and strictly more work.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
fix(cli): correct manifest-lock claim, unblock cleanup, tighten guards
fix(cli): harden DECDNMAN reconstruction after review of #1293 (#1301)
altanoruc commentedon Jul 20, 2026
Automated triage note for a later run: this is small enough only after the behavior is chosen. Please select one outcome: command-lifetime retention plus an in-place ADR 012 amendment, per-hash entry deduplication, or warning-only. If deduplication is selected, pin copy vs hardlink and the per-destination overwrite/skip-existing behavior.