Repository navigation
Description
Out of scope
New storage providers, host provisioning, replacing the existing allocator, portable fallback clones, unrelated native-proof repairs, changing Git history policy without a separate decision, and blanket workspace journal exclusions.
Context
acquire (packages/ui-server/src/brain/reference-source.ts:404) snapshots prior source for refresh; allocate (packages/ui-server/src/brain/reference-worktrees.ts:427) creates worktrees from sealed source. createNativeReferencePool (packages/ui-sdk/src/server/native-reference-pool.ts:272) owns allocation/admission. COPY_FLAGS (packages/ui-server/src/brain/turn-data-tree.ts:101) requests best-effort reflinks, while copies are used at lines 144 and 161. Native proof entry: scripts/native-proof/README.md:270 and scripts/prove-reference-pool.ts.
Read docs/decisions/{reference-worktrees,reference-source-acquisition,managed-worktrees,reference-pool-accounting,native-brain-storage,provider-history}.md. Existing #3209 owns its case-18 unstable-assessment harness defect; use its result rather than refiling/fixing that defect here. #3138's decided ordinary selected-repository path must stay independent of managed native availability.
Scope
Extend the existing offline native proof with a bounded Git workload and publish an efficiency/coverage report against exact candidate identities. Distinguish Git object reuse, checked-out file extent sharing and separate temporary-copy allocation. Investigate unsupported repository features rather than silently claiming coverage.
Acceptance criteria
- Use generated Odysseus repositories: many small source files, incompressible large files and changed commits. Exercise cold acquisition, repeat reads, unchanged and changed refresh, multiple managed worktrees from one source, isolated edits, preserved local commits, release/restart and source deletion while referenced.
- Record unique allocated data/metadata, per-owner squota charge, combined allocation, reservations and observed reclamation with declared metric basis. Include Git objects, checkout/index metadata and transient staging; no logical-size or st_blocks sum is called unique usage.
- Prove repeat reads avoid extra checkout roots; snapshot worktrees share inherited data; edits affect only their worktree; refresh only fetches required new objects. Set explicit fixture-based regression tolerances from measured baseline before asserting them; do not promise zero metadata cost.
- Compare relevant same-filesystem reflink and cross-filesystem copy paths, report concurrent peak disk use and admission behavior, and identify any copy-budget gap with a separately filed issue rather than an unbounded fallback here.
- Include concurrent readers/refresh, both backend tool paths, fresh/revoked authorization, write-time EDQUOT, cancellation and crash/recovery. Record health/WS latency, elapsed time, I/O and peak allocation for cold/warm runs with measured thresholds and exact kernel/Bun/btrfs-progs/candidate identities.
- Document clone depth/partial-object, LFS/submodule and linked-Git-worktree support or explicit refusal, repack/GC sharing loss and retained-owner accounting limits; verify against installed Git and upstream documentation.
- Retain a named mutation that replaces a snapshot with independent full-copy behavior or adds an avoidable checkout on warm reuse; prove the allocation/reuse assertion fails for the intended reason and passes after restore.
Verification
Run bun scripts/prove-reference-pool.ts and the relevant --integrated --backend=claude / --integrated --backend=pi cells using existing offline fixtures. Run focused tests through bun run test, required typecheck/lint and bun run check:pr --base origin/main for a PR. No provider API keys or test network; real Btrfs proof cannot be replaced by directory-backed doubles. Reverify source citations at pickup.
Contract impact
Proof/report only: no new public contract or behavior intended. Any actual runtime gap discovered is filed separately with contract/changeset assessment.
Primary sources
- https://git-scm.com/docs/git-worktree — linked worktrees share repository administration but have separate checkout state; this is not proof of shared file extents.
- https://git-scm.com/docs/git-clone — shallow history and object borrowing are distinct policies; borrowed-object lifetime needs examination before selection.
- https://btrfs.readthedocs.io/en/latest/btrfs-quota.html#simple-quotas-squota
2026-11-08 pickup at main 1619741f2: the turn-data-tree.ts citations had drifted by one line (COPY_FLAGS 100→101, copies 143/160→144/161) and are corrected above. All other citations held.
Blocked by #4079 (the backend-latency criterion only; the rest is in #4072).
Activity
test(ui-server): compare writable roots on exclusive extents in the e…
test(ui-server): census only the new root after a changed refresh
test(ui-server): assert measured efficiency tolerances
test: MUTATION (to be reverted) replace worktree snapshot sharing wit…
Revert the worktree full-copy mutation
schlessera commentedon Nov 8, 2026
Claimed (token
claim-3513-3bb6cefa) on branchtest/3513-storage-efficiencyfrom main1619741f2; draft PR #3676. Collision check on the native reference-pool proof paths: closure-only overlaps with broad draft PRs (#3054, #3056, #3059 and others), no direct path collisions. The local host cannot attach loop devices under rootless Docker, so the native cells are exercised through hosted runtime feedback.test(ui-server): measure repository and worktree allocation in the re…
schlessera commentedon Nov 8, 2026
Partial delivery merged: PR #3676, squash
2b468ab8a5928c66273b6ce54cf726f04f2db31eon main (candidate confirmation run 42520812699, milestone 0.45.0).Delivered: case 19 of the required reference pool proof (
scripts/native-proof/reference-efficiency.ts), documented inscripts/native-proof/README.md. It covers:reference-efficiency.json.EFFICIENCY_TOLERANCES, set from the hosted baseline (run 42475041809 at59caf001).43b0f549failedREFERENCE_EFFICIENCY_WORKTREES_SHARE_SOURCEin run 42479022403. The restored head passed run 42482120806.Remaining for this issue:
--integrated --backend=claude|pi) under this Git workload, with health/WS latency and cold/warm elapsed thresholds.EDQUOT, cancellation and crash/restart recovery under the Git workload (cases 3 and 10 cover synthetic roots only).To resume, extend case 19 or the integrated cell in
scripts/native-proof/reference-integration.native.ts, iterating throughbun scripts/request-heavy-feedback.ts <pr>. The local host cannot attach loop devices.Releasing my claim; the issue stays open and agent-ready for the remaining criteria.
7 remaining items
schlessera commentedon Nov 16, 2026
Progress on the remaining criteria, draft PR #4072:
runtime_host(heavy feedback run 43810765015): write-timeEDQUOTin a managed worktree and inside a refresh fetch, cancellation mid-fetch, and crash/restart recovery of aSIGKILLed app instance, all under case 19's Git workload. Every step also records its pool-device and process I/O, and the cold, warm and refresh steps record their peak allocation. A named mutation round (startup recovery skipping a writable staging root) is next.reference_sourcecall is refused because the turn's own scratch check and the reference transport's Git command each need the whole default maintenance budget. The refusal surfaces asunavailable. Filed as ui-server: a turn's first reference_source call is refused by the turn's own maintenance admission #4079.test/3513-integrated-latency: health andping/pongsampling, tool timing, sysfs peak, per-turn I/O andreference-integration-latency.json. Its thresholds are set once ui-server: a turn's first reference_source call is refused by the turn's own maintenance admission #4079 lets the cell run. To resume, rebase that branch, run it through a hosted probe as test(ui-server): qualify EDQUOT, cancellation and crash recovery under the Git workload (#3513) #4072 did, and set measuredINTEGRATED_TOLERANCES.Blocked by #4079
Revert "test(ui-server): MUTATION M1, reverted before ready: recovery…
test(ui-server): qualify EDQUOT, cancellation and crash recovery unde…
schlessera commentedon Nov 16, 2026
Claimed for implementation. Claim token:
claim-5f8283ed. Branch:test/3513-integrated-latency-thresholds.resumes after #4072 and #4079 (the previous claim, claim-6f21a113, ended with #4072's merge and is released here); path overlap with draft #4002 on scripts/native-proof/README.md; closure-only overlaps with other broad drafts
Revert "chore(scripts): TEMPORARY hosted probe measuring the integrat…
test(ui-server): hold the integrated reference cell to its measured h…
chore(scripts): TEMPORARY hosted mutation round for the integrated ce…
Revert "chore(scripts): TEMPORARY hosted mutation round for the integ…
test(ui-server): hold the integrated reference cell's latency to meas…
schlessera commentedon Nov 17, 2026
Merged in #4103 as
40779d498through 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.