Repository navigation
Description
Out of scope
Any background deduplication (duperemove, bees or another extent-rewriting tool), production schedules/runbooks, arbitrary host-path cleanup, destructive Git maintenance, provider plugins, a new shipped binary or dependency, deleting or rewriting user files, or turning an observation into a capacity guarantee.
Context
Former dependencies (2026-11-09): #3514 closed against the ruling; #3513's remaining outputs (backend tool-path latency, workload EDQUOT/cancellation/crash, per-step I/O) are not inputs to this status, which reads only the simple-quota charges the manager already observes, with thresholds fixed by the ruling.
The existing host-only native manager owns storage. createNativeReferencePool (packages/ui-sdk/src/server/native-reference-pool.ts:272), with its create path at the create declaration (line 604) and its reservation path, fences identities and reservations. COPY_FLAGS (packages/ui-server/src/brain/turn-data-tree.ts:101) requests best-effort reflink copying, not blanket sharing. The investigation is docs/plans/repository-storage-dedupe.md (PR #3737). Read docs/decisions/{reference-pool-accounting,native-brain-storage,provider-history}.md before implementation.
Scope
Per the 2026-11-08 ruling: reject background dedupe and add a read-only residual-growth status on the existing pool accounting basis, through the existing native manager and the brain-native-store pool CLI. Record the rejection in docs/decisions/reference-pool-accounting.md.
Acceptance criteria
-
docs/decisions/reference-pool-accounting.mdgains a short record: background dedupe is rejected, with the three measured reasons (cross-root owner re-attribution, sealed-root modification, false checkpoint deltas) and a link todocs/plans/repository-storage-dedupe.md. - The
brain-native-store poolgrowth status (--json) reports, from the same simple-quota accounting the manager already reads, each worktree's charge versus its source charge, each changed refresh versus a cold acquisition, and retained sources per repository+revision across domains. It flags a worktree above 25 %, a refresh above 0.75× and more than 2 retained sources, as documented named constants. - Each flag carries the observed bytes and the threshold. Nothing reports forecast savings or freed capacity. Missing or unreadable accounting reads as
unavailable, never as zero. - The status is read-only: no extent rewriting, deletion, reset or reservation change. No agent-facing tool, credentials or arbitrary path selector is exposed. A stale root identity or a cross-mount/symlink target is refused.
- Generated Odysseus repositories on a native Btrfs fixture trigger each flag and a clean pool triggers none. A named failing-first/restored mutation of each threshold comparison and of the unavailable-not-zero rule is recorded.
- An additive
CONTRACT:commit updates the authoritative CLI component, with a changeset.
Verification
Focused bun run test, lint/typecheck, the relevant native proof cells on real Btrfs, and bun run check:pr --base origin/main. Use generated Odysseus repositories and assert child exit codes. Mocked command predicates are not runtime proof.
Contract impact
Additive CLI --json output on brain-native-store pool. It ships in a minor with the authoritative CLI component updated in the same CONTRACT: commit. No shipped binary or dependency is added.
Maintainer decision — 2026-11-08
outcome 1. Background dedupe is rejected on the measured evidence; build preventive sharing plus a residual-growth safeguard.
- No duperemove, bees or any extent rewriting. No new binary or dependency.
- Add a read-only growth status on the existing pool accounting basis, through the existing native manager and the
brain-native-store poolCLI (--json). It flags:- a worktree whose charge is above 25 % of its source charge;
- a changed refresh above 0.75× a cold acquisition;
- more than two retained sources of one repository and revision across domains.
- It reports measured bytes and thresholds only, never forecast savings or freed capacity.
- Record the rejection briefly in
docs/decisions/reference-pool-accounting.md, linkingdocs/plans/repository-storage-dedupe.md. - Classification: additive CLI
--jsoncontract change, shipped in a minor (CONTRACT:commit, authoritative CLI component, changeset).
This replaces the earlier deferral; the body is rewritten around this outcome. blocked stays for now because #3513 is still open: lift it once its remaining outputs are confirmed unnecessary for this status, or once it closes.
Earlier decision record
Maintainer deferral — 2026-11-08 (superseded)
Wait for measured results from both #3513 and #3514 before selecting a mechanism, eligible-root/domain matrix or numeric budget. The maintainer explicitly retains needs: decision and blocked for that later ruling. No background-dedupe tool, monitoring-only scope or no-implementation outcome is selected now.
The investigations have delivered the partial results summarized below. Revisit this issue against those reports and their remaining qualification, rather than waiting for a report that is already published; merely closing them is not evidence that a safeguard is approved. Preserve the existing preventive-sharing and capacity/accounting/recovery rules in the meantime. No safeguard implementation is authorized by this deferral.
Decision needed (resolved)
After #3513 supplies the allocation/sharing coverage report and #3514 supplies the measured compatibility and cost/benefit matrix, the maintainer must select the safeguard, eligible roots/volumes/sharing domains, concrete host owner and exact authority boundary. Record numeric CPU/I/O/memory/runtime/state/headroom limits and the trigger or maintenance window. Neither investigation's closure alone approves implementation.
The alternatives already required by #3514 are:
- Bounded incremental duperemove: eligible only if the measured tool/kernel/filesystem combination preserves simple-quota first-owner accounting, retained-owner lifetime, send/journal correctness and the agreed application-latency/headroom limits. A managed hash-state budget and identity-fenced, serialized run remain required.
- Another qualified approach: use only the measured candidate and exact eligible scope from ui-sdk: evaluate bounded deduplication for managed Git storage #3514, with the same accounting, authority, cancellation and recovery proof. An unsuitable nightly file-scoped tool does not by itself qualify a persistent scanner such as bees.
- Measured rejection of background dedupe: retain preventive snapshots/reflinks and implement the bounded residual-allocation growth/status/alert safeguard selected by the ruling. Report observed allocations and limits without treating forecast savings as capacity.
Recommendation, not approval: keep preventive sharing as the baseline. Select background dedupe only if #3513/#3514 show meaningful observed savings within the recorded safety and latency bounds; otherwise prefer the measured no-dedupe safeguard. No specific tool, volume, privilege or numeric budget is selected by this triage.
Completion evidence: a recorded maintainer ruling naming the selected branch, measured source/tool/kernel identities, eligible-domain matrix, numeric limits, owner/serialization/recovery and operator-result contract, plus any binding decision amendment. Fold that result into this issue's scope and acceptance criteria (or explicitly record a no-implementation outcome) before removing needs: decision. Keep blocked until both required investigation outputs are verified.
2026-11-04 triage at main 53b862123d7b8e4c9d039859fabdc9fc6ad4cd36: Verified that #3513 and #3514 remain open at p2; retained both actual blockers and the mechanism/budget ruling. The required new machine-readable operator surface needs contract review. No new runtime qualification or implementation is claimed.
Triage 2026-11-08 at main 1619741f291f525d17cde4970a5ada40644117c1: Re-read the still-open p2 #3513/#3514 briefs and current storage-owner source. Made the existing alternatives, conditional recommendation and ruling evidence explicit; both blockers and needs: decision remain.
2026-11-08 decision reconciliation: recorded the maintainer's explicit wait-for-measurements choice. At that deferral both investigations were open. Current delivery is recorded below; needs: decision and blocked remain until the actual required investigation outputs and ruling are satisfied, with no agent-ready label.
Measured inputs at the time of the ruling
#3513 delivered a partial Git-workload proof/report through #3676 (2b468ab8a5928c66273b6ce54cf726f04f2db31e); the issue remains open for both integrated backend paths, health/WS and cold/warm latency, workload-specific EDQUOT/cancellation/crash-restart, and per-step I/O. #3514 delivered its investigation through #3737 (9a1cc6470110c5c41f015c1882bc1c0ef03ea1f5); that issue remains open for the ruling or conditional further dedupe measurements. Both commits are ancestors of inspected main. Keep both canonical blockers and the maintainer's explicit deferral; a merged partial report does not satisfy an issue's remaining required outputs.
The latest concrete proposal, still unapproved, is folded here from the investigation's decision prompt:
The investigation is in docs/plans/repository-storage-dedupe.md (PR #3737). These are the measured facts that bear on the ruling:
- Preventive sharing already covers the common case. Two managed worktrees add 1.6 % of their source, and a changed refresh costs 0.39× a cold acquisition (ui-server: qualify allocation and latency across repository acquisition and managed worktrees #3513, hosted run 42475041809). A dedupe scan over snapshot-shared data saves nothing.
- Dedupe recovers real bytes in two places: the same repository held in several domains, and repack or linked Git worktrees inside a worktree. That was 72 MB of 216 MB locally, at under 1 s of scan and 87–120 MB RSS per 200 MB, with incremental reruns of about 50 ms (duperemove 0.15.2, Linux 7.0).
- On the owned pool (hosted run 42504379233, kernel 7.0.0-1017-azure), every one of those savings breaks a binding rule:
- Cross-root dedupe moves the destination's data onto the source owner's simple-quota charge. A released source then stays
deletedwith the charge, and is never reclaimed while the destination lives. - Dedupe into a sealed read-only root succeeds without refusal and leaves its recorded owner charge stale.
- Dedupe inside a worktree between checkpoints reports false content edits in the checkpoint delta and frees nothing while the older checkpoint lives.
- Cross-root dedupe moves the destination's data onto the source owner's simple-quota charge. A released source then stays
Question: which outcome should this issue implement?
- Measured rejection: preventive sharing plus a residual-growth safeguard (recommended). Add a growth status on the existing pool accounting basis through the existing manager and
brain-native-store poolCLI. It flags a worktree above 25 % of its source charge, a changed refresh above 0.75× cold, or more than two retained sources of one repository and revision across domains. It reports measured bytes only. Consequences: an additive CLI--jsoncontract change (minor), a short rejection record inreference-pool-accounting.md, no binary or dependency, no extent rewriting. - Bounded duperemove on writable worktrees without retained checkpoints only. Consequences: it needs rulings to allow cross-root sharing and to credit a released owner's retained charge to the roots that reference it. It needs exclusion of sealed roots, checkpoints and the brain store; a new shipped tool (the pinned image has duperemove 0.11.2); and the unmeasured app-latency, concurrency and restart cells first. The eligible set is small and lives at most three days.
- bees. Not recommended: whole-filesystem, unpackaged for the pinned image, same attribution and delta effects.
This is the recommendation only; it is not a ruling. needs: decision stays until the maintainer selects an outcome and it is folded into the acceptance criteria.
Triage 2026-11-08 at main 8752570331ffebdbb9233196412781f6cd71f3d9: Replaced the stale absence-of-reports claim with both merged reports, their exact partial-delivery limits and the existing decision options. Retained both genuine dependencies and needs: decision; no threshold or mechanism is approved.
2026-11-08: rewrote scope, out of scope and acceptance criteria around the measured-rejection ruling. Removed needs: decision and added agent-ready; blocked stays while #3513 is open.
2026-11-09: lifted blocked per the ruling's condition — #3513's open outputs are confirmed unnecessary for this status (see comment).
Activity
schlessera commentedon Nov 8, 2026
Decision (maintainer, 2026-11-08): Defer the safeguard selection until the measured results from both #3513 and #3514 are available.
No deduplication mechanism, eligible-root matrix or numeric run budget is qualified yet. The later ruling must select the mechanism/scope/budgets from the actual allocation, compatibility, latency and recovery evidence; investigation closure alone is not approval.
The maintainer explicitly chose to keep
needs: decisionandblockedfor that later ruling. Do not addagent-readyor start safeguard implementation. The body now records this deferral; the two investigation issues remain independent and open.schlessera commentedon Nov 8, 2026
Decision prompt (from #3514, PR #3737)
The investigation is in
docs/plans/repository-storage-dedupe.md(PR #3737). These are the measured facts that bear on the ruling:deletedwith the charge, and is never reclaimed while the destination lives.Question: which outcome should this issue implement?
brain-native-store poolCLI. It flags a worktree above 25 % of its source charge, a changed refresh above 0.75× cold, or more than two retained sources of one repository and revision across domains. It reports measured bytes only. Consequences: an additive CLI--jsoncontract change (minor), a short rejection record inreference-pool-accounting.md, no binary or dependency, no extent rewriting.This is the recommendation only; it is not a ruling.
needs: decisionstays until the maintainer selects an outcome and it is folded into the acceptance criteria.schlessera commentedon Nov 8, 2026
Decision (maintainer, 2026-11-08): outcome 1. Background dedupe is rejected on the measured evidence; build preventive sharing plus a residual-growth safeguard.
brain-native-store poolCLI (--json). It flags:docs/decisions/reference-pool-accounting.md, linkingdocs/plans/repository-storage-dedupe.md.--jsoncontract change, shipped in a minor (CONTRACT:commit, authoritative CLI component, changeset).This replaces the earlier deferral; the body is rewritten around this outcome.
blockedstays for now because #3513 is still open: lift it once its remaining outputs are confirmed unnecessary for this status, or once it closes.schlessera commentedon Nov 9, 2026
Claim
wi-3515-growth, branchfeat/3515-pool-growth-status.blockedlifted under the ruling's condition. #3514 is closed against the ruling. #3513's remaining outputs are not inputs to this status:The status reads only the simple-quota owner charges that
referencePoolAccountingalready computes per root (packages/ui-sdk/src/server/native-reference-pool.ts:149), and its thresholds are fixed by the ruling. #3513 stays open for its own criteria.Implementation notes, within the ruling:
from-chain root with no source) was sealed. That seal-time charge is persisted, because a released root's recorded charge later shrinks to what it retains. Older records without it read asunavailable.referenceSourceNamehashes the canonical repository and revision. Retained sources are counted per name across views.Collision check on the cited files: closure-only reports, with no direct path overlap.
CONTRACT: chore(api-report): record poolGrowth in the ui-server surfa…
schlessera commentedon Nov 9, 2026
Implementation is complete in #3806 (draft, mergeable at
260b1713). Native growth proof is green in hosted feedback run 42652529226, and both milestones are 0.45.0.Landing paused before confirmation because the local integration checkout became unusable. No lease is held. The exact resume steps are on #3806. I am releasing this claim so another worker, or a resumed session, can confirm and merge it. The PR stays as-is.
schlessera commentedon Nov 15, 2026
Claimed for implementation. Claim token:
claim-b1eda1e9. Branch:feat/3515-pool-growth-resume.Resuming the ownerless draft #3806 (same approach) onto this branch; #3806 will be closed in favour of the new PR. Collision check pending, recorded on the PR.
CONTRACT: feat(ui-sdk): read-only reference pool growth status (#3515) (
schlessera commentedon Nov 16, 2026
Merged in #4064 as
132505f0bthrough the integration lease (orchestrator merge queue for 0.45.0). Candidate confirmation passed on the exact head; the squash's own main run carries the post-merge heavy categories.