# Buildbox Disk Pressure Layout

audience: AI coding agents first.

# Outcome
status: DONE
task IDs: #1
source request: Owner reports Debian1/2/3 root filesystems under constant pressure while separate 83 GB scratch filesystems mounted at `/var/lib/buildbox` remain mostly empty. Measure actual pressure, test hypothesis that agent sessions and worktrees dominate, and recommend robust storage layout. Analysis/recommendation only; MUST NOT migrate or delete data without later explicit request.

## Acceptance criteria

- Measure filesystem capacity and inode pressure on Debian1, Debian2, Debian3 with constant-time filesystem metadata.
- Attribute pressure using bounded metadata and known state locations; MUST NOT recursively scan `~/Projects`.
- Inspect agent-session metadata, worktree counts/paths, caches, containers, journals, and build artifact roots only with bounded commands.
- Explain whether `/var/lib/buildbox` mount placement wastes useful capacity.
- Recommend robust target layout, migration boundaries, cleanup policy, and risks.
- Preserve all existing sessions, worktrees, caches, and artifacts during diagnosis.

## Preserved WIP

- Shared checkout WIP untouched.
- Buildbox filesystems read-only during diagnosis.
- No service, mount, symlink, worktree, cache, or agent-session mutation authorized.

## Constraints

- Read host identity and reachability from `~/.claude/buildbox-hosts.json`; NEVER hardcode unregistered hosts.
- Contact only registry hosts marked reachable.
- Debian1/2/3 are headless; SSH on registered access door is only routine path.
- Treat apparent free space and directory totals as evidence, not assumptions.
- MUST NOT run `du` or any recursive traversal under `/home/user/Projects`; it takes hours and is outside required evidence.
- Use constant-time or bounded commands only; owner needs a prompt recommendation.

## Execution steps

1. Inspect all three filesystems, inode use, mount layout, and block-device/LVM allocation using constant-time metadata.
2. Inspect known agent/session, worktree, cache, container, journal, and build roots with counts or shallow metadata only; NEVER recursively scan `~/Projects`.
3. Compare hosts and identify recurring versus host-specific pressure.
4. Recommend minimum robust layout and lifecycle policy; distinguish immediate relief from durable correction.
5. Record measurements and recommendation; stop without mutation.

## Current receipt

- 2026-08-13: Owner clarified scope is buildboxes Debian1/2/3, not workstation.
- Registry confirms Debian1/2/3 are reachable and each has scratch disk mounted at `/var/lib/buildbox`.
- Owner corrected investigation method: recursive `du` under buildbox `~/Projects` takes hours, is unnecessary, and MUST NOT run.
- Constant-time evidence: root usage is Debian1 91% (11 GiB free), Debian2 95% (5.5 GiB free), Debian3 91% (9.4 GiB free). Scratch usage is Debian1 30% (78 GiB free), Debian2 67% (38 GiB free), Debian3 93% (8.1 GiB free).
- Scratch disk is already bind-mounted into `/home/user/builds`, `.npm`, `.local/share/pnpm`, `.dev-tools`, `.cargo/registry`; mount placement itself is not primary defect.
- `/home/user/Projects` is small on measured Debian1/2 data (3.5/2.3 GB); `.claude` is ~0.28 GB; registered Overdeck worktree counts are 3/1 on returned host metadata. Agent sessions/worktrees are not main pressure.
- Major root consumers surfaced by bounded prior scan: multiple ~4 GB `runs/incident-blockers-focused*` trees, 3–4+ GB GitHub Actions runner installations/workspaces, Debian2 ~11.2 GB `.cache` including ~2.9 GB Playwright. Debian1 `/home/user` totals ~90.6 GB and Debian2 ~94.4 GB despite scratch-backed `builds` appearing in path totals.
- Journals are only 89–144 MB; rootless Podman has ~3.8 GB fully reclaimable on Debian1/2 and is absent/empty on Debian3.
- Recommendation: keep `/var/lib/buildbox` as scratch filesystem and continue exact bind mounts; add `/home/user/runs`, GitHub Actions `_work`/tool caches, `.cache/ms-playwright`, and sandbox/offload state as scratch-backed bind mounts with explicit lifecycle quotas. Do not move whole `/home`, `~/Projects`, or `.claude`; do not use symlink forests.
- Debian3 scratch is itself 93% full, so migration alone cannot fix it; enforce retention/garbage collection and reserve thresholds across both filesystems first.

## Next executable action

None. Analysis and recommendation delivered. Any migration or cleanup requires a new implementation request with per-host rollback and capacity checks.
