Repository navigation
Description
Current delivered investigation and remaining ruling
PR #3737 is merged as 9a1cc6470110c5c41f015c1882bc1c0ef03ea1f5 on inspected main, with milestone 0.45.0. Its report is docs/plans/repository-storage-dedupe.md; retained commands are scripts/dedupe-bench.py and scripts/native-proof/dedupe-experiment.ts. The report recommends rejecting background dedupe because its measured savings violate current first-owner attribution, sealed-root accounting or checkpoint-delta assumptions. This is a recommendation, not a maintainer ruling.
Exact next action: the maintainer selects an outcome on #3515. A measured rejection makes app latency during dedupe, concurrent fetch/checkout/repack and manager restart during dedupe moot; record that disposition against this issue's conditional acceptance before closure. Selecting dedupe instead requires those three still-unmeasured cells here before implementation. Keep needs: decision and no agent-ready; preserve the original measurement criteria and 0.45.0 attribution. The latest comment explicitly released the implementation claim.
Out of scope
Enabling a timer or daemon, running on production data, full-filesystem scans by default, picking a new storage provider, relaxing capacity admission, or automatically deleting/rewriting user files. Deliverable is a measured recommendation and decision proposal, not deployment.
Context
The concrete storage owner is createNativeReferencePool (packages/ui-sdk/src/server/native-reference-pool.ts:272); root creation/reservations are at lines 605–653. Git fetch/checkout workers are packages/ui-server/src/brain/reference-transport.ts:133 and :149. The separate reference pool uses simple-quota first-owner attribution, while native brain checkpoints use a separate no-qgroup filesystem. Read docs/decisions/{reference-pool-accounting,native-brain-storage,reference-source-acquisition,managed-worktrees,provider-history}.md.
Btrfs exposes out-of-band deduplication; it does not deduplicate arbitrary writes automatically. Nightly maintenance is a candidate secondary optimization after acquisition and worktree sharing, not a substitute for it.
Scope
Compare incremental scheduled duperemove, bees, and no background dedupe plus preventive snapshots/reflinks, using reproducible offline Git workloads. Investigate each on the reference pool and assess brain-volume eligibility separately. Publish the compatibility matrix, measured cost/benefit, proposed owner/API boundary and an explicit selection or justified rejection.
Acceptance criteria
- Cite exact tested kernel, btrfs-progs and tool versions and upstream sources. Measure first/repeated scans, hash/state growth, CPU/RAM/I/O, metadata growth, unique allocated bytes actually saved, app latency and subsequent deletion/reclamation. Include already-shared files, independent copies, small files, compressed data and Git repack/GC output; do not equate apparent bytes with savings.
- Test simple-quota owner attribution/combined limits, retained source owners, admission/headroom ledgers and physical reclamation before/after dedupe and subsequent writes/deletion/restart. Determine whether cross-root or cross-principal sharing is permissible; no automatic widening of private sharing domains.
- Check read-only/sealed roots, COW/NOCOW/checksum compatibility, concurrent fetch/checkout/repack/GC, snapshot creation/deletion, incremental send and journal metadata deltas. Define exclusion or host-owner serialization that prevents false content edits, incomplete deltas, unbounded observations or invalid quota assumptions.
- Define identity-fenced eligible roots, mount/symlink escape refusal, privilege boundary, safe hash database location/permissions/quota/rotation, one-run locking, CPU/I/O/memory/runtime limits, low-space behavior, cancellation and crash recovery. A hash database is optimization state, never authoritative application state.
- State whether nightly scheduling is justified and select a maintenance window, trigger or alternative based on measurements. Define numeric success/regression thresholds and observable last success/failure/skipped status without claiming predicted savings as free capacity.
- Produce a maintainer decision prompt with acceptable outcomes: bounded duperemove, another qualified approach, or measured rejection with preventive sharing and residual-growth alerts. Identify exact changes to binding decisions and split any resulting implementation into bounded tasks. Do not enable bees merely because a nightly file-scoped tool is unsuitable.
Verification
Use disposable native Btrfs fixtures and generated Odysseus Git repositories, offline tool binaries/images and actual concurrent filesystem operations. Retain commands, version identities, metrics, failure/interrupt evidence and a content hash/Git fsck comparison. Benchmarking is separate from normal keyless tests; no production scan is authorized here.
Contract impact
Investigation only. Proposed new CLI/MCP/config/status surfaces must identify authoritative contract updates and additive/minor versus breaking/ruling requirements before implementation. Investigation delivery retains its existing 0.45.0 milestone; any safeguard implementation needs its own scope and release commitment.
Research starting points (checked 2026-11-03)
- https://btrfs.readthedocs.io/en/latest/Deduplication.html — dedupe may increase metadata; COW/checksum compatibility and send coordination matter. Confirm applicability against the tested kernel, not documentation for a newer kernel.
- https://github.com/markfasheh/duperemove/blob/master/markdown/duperemove.md — explicit dedupe mode, incremental hashfile and concurrency controls; verify exact supported options in the installed version.
- https://github.com/Zygo/bees/blob/master/docs/options.md — worker/load controls; https://github.com/Zygo/bees/blob/master/docs/btrfs-kernel.md — upstream compatibility notes and concurrent-operation hazards; not proof of compatibility with this manager.
- https://btrfs.readthedocs.io/en/latest/btrfs-quota.html#simple-quotas-squota
Triage 2026-11-08 at main 8752570331ffebdbb9233196412781f6cd71f3d9: Folded the merged investigation and conditional closure/measurement handoff into the current specification. No dedupe or safeguard branch is selected.
Maintainer decision — 2026-11-08
measured rejection of background dedupe (outcome 1 on #3515). Keep preventive snapshots/reflinks and implement the residual-growth safeguard on #3515.
The investigation's conditional acceptance is satisfied by this ruling. The three unmeasured cells (app latency during dedupe, concurrent fetch/checkout/repack, manager restart during dedupe) are moot and will not be measured. bees is not enabled. Closing as completed against this ruling. Attribution stays 0.45.0 (PR #3737).
Activity
schlessera commentedon Nov 8, 2026
Claimed (token
claim-3514-fc54b9ff) on branchspike/3514-bounded-dedupefrom main69e45194f. Its offline Git workload builds on the efficiency case of #3513 (PR #3676), which waits only on the open red-main incident before merging. Tool-cost measurements run on a real Btrfs filesystem here, and the pool-side simple-quota/sealed-root cells run in the hosted native fixture.schlessera commentedon Nov 8, 2026
Investigation delivered in PR #3737 (
docs/plans/repository-storage-dedupe.md), with the retained commandsscripts/dedupe-bench.pyandscripts/native-proof/dedupe-experiment.ts, and their exact versions and runs.Recommendation: reject background dedupe, keep preventive sharing, and add a residual-growth safeguard. The maintainer decision prompt is on #3515.
Not measured, and needed only if the ruling selects dedupe: app latency during a run, fetch/checkout/repack racing a dedupe, and manager restart after one. If the ruling is the measured rejection, those criteria are moot and this issue can close against that ruling.
docs(plans): evaluate bounded deduplication for managed Git storage
spike(ui-sdk): evaluate bounded deduplication for managed Git storage (…
schlessera commentedon Nov 8, 2026
Investigation merged: PR #3737, squash
9a1cc6470110c5c41f015c1882bc1c0ef03ea1f5on main (candidate confirmation run 42523232298, milestone 0.45.0).docs/plans/repository-storage-dedupe.md.scripts/dedupe-bench.pyandscripts/native-proof/dedupe-experiment.ts, with tested versions and run identities in the document.Next action (maintainer): rule on #3515.
Labelled
needs: decisionuntil then; releasing my claim.schlessera commentedon Nov 8, 2026
Decision (maintainer, 2026-11-08): measured rejection of background dedupe (outcome 1 on #3515). Keep preventive snapshots/reflinks and implement the residual-growth safeguard on #3515.
The investigation's conditional acceptance is satisfied by this ruling. The three unmeasured cells (app latency during dedupe, concurrent fetch/checkout/repack, manager restart during dedupe) are moot and will not be measured. bees is not enabled. Closing as completed against this ruling. Attribution stays 0.45.0 (PR #3737).
schlessera commentedon Nov 8, 2026
Closed against the measured-rejection ruling recorded above and on #3515.
CONTRACT: feat(ui-sdk): read-only reference pool growth status (#3515) (