Luci · Ticket = infra cleanup. Repo disk pollution. Plan: au
Luci
Ticket = infra cleanup. Repo disk pollution. Plan: audit (read-only) → safe plan → REVIEW before destructive steps. Per ticket, check-in expected before untracking/deleting.
Start with dev-loop (mandatory before any edits) + parallel read-only audit.
Luci
Tier 3 (infra, multi-dir, destructive-adjacent). Audit first — read-only. Figure repo layout + tracked artifacts.
Luci
Two repos: `~/workspace` (root, the polluted one) and `~/workspace/mission-control` (separate, my worktree slot). Ticket targets `~/workspace`. Run full audit into sandbox.
Luci
Clear picture now. Key numbers:
**`~/workspace` repo (target):**
- `.git` = **5.7 GiB** (all history blobs)
- Tracked media/artifacts = **6.7 GiB**: audio-library 3.6G, reports 2.5G, state 275M, bible-study 271M, +297 PNGs, 29 PDFs, mp4/pptx
- `.gitignore` already rich (ignores these dirs by pattern) — BUT files were committed *before* rules → still tracked → still checked out everywhere
- **Worktree pools = 7.4 GiB EACH** (`pool-0/1/2`) = **~22 GiB** — they duplicate the 6.7G tracked media on every checkout. Plus stale per-ticket worktrees ~1G.
**`mission-control` repo:** `.git` 531M, good `.gitignore`, but tracks screenshot PNGs (tests/, reports/, static/).
Root cause = **already-tracked artifacts**. gitignore can't untrack retroactively. Need `git rm --cached`. Let me read the actual gitignore + worktree creation code before designing.
Luci
`.gitignore` gaps confirmed: `audio-library/` (3.6G), `reports/` (2.5G), `bible-study/` (271M) NOT ignored as dirs — only narrow sub-paths. No blanket media-extension rules. New artifacts keep entering. Now the worktree creation code + generator paths.
Luci
Full disk picture — far bigger than ticket estimated. Total worktree duplication:
- `~/workspace/.claude/worktrees` = **24 GiB** (3 pools @7.4G + 11 stale)
- `~/workspace/worktrees` (nested, detached) = **15 GiB**
- `state/control-room-worktrees` = **~30 GiB** (mc-4428 6.5G, two mc-4632 @7.4G each, +others)
All duplicating the same 6.7G tracked media on every checkout. Disk: 174G used / 115G free of 301G.
Root cause + fix chain is clear. Best canonical-store design = **symlink**: `git rm --cached` artifacts → `mv` to `~/artifacts/` → symlink back into `~/workspace`. gitignored symlink → worktrees check out nothing → zero dup, zero generator-script changes, serving paths unchanged.
I'll now apply the **fully-safe additive** parts (gitignore hardening + policy doc), commit, then REVIEW before the index-untrack + 6.7G move + worktree pruning (touches live serving + active worktrees) and the separately-approval-gated history rewrite.
Writing policy doc + plan.
Luci
Now harden both `.gitignore` files (additive, safe — prevents future pollution).
Luci
Correcting the `reports/` block — git can't re-include files under a wholesale-ignored dir (negations won't fire), and reports' `.md` analysis docs should stay tracked. Rely on global extension rules for reports' blobs instead; `audio-library/` and `bible-study/` move out wholesale (symlink design) so those stay.
Luci
mission-control `.gitignore` — add screenshot/media patterns (it tracks tests/ and reports/ PNGs).
Luci
Now commit the safe additive changes (gitignore + policy doc) to both repos' main checkouts. Staging only the touched files — `~/workspace` master has unrelated churn I must not sweep in.
Luci
Both pushed. Now smoke-test the gitignore prevents future pollution (acceptance criterion: `git status` clean after sample generation).
Luci
Smoke caught a gap: `reports/**/*.png` not ignored in `~/workspace` (only added pdf/zip there + a misleading dir-level status). Generated report screenshots/charts are PNG. Adding scoped image rules.
Luci
All generated media now ignored, smoke-verified, both repos pushed. This is the explicit check-in point the ticket set ("after audit + safe plan, before untracking/deleting anything destructive"). Reporting via mc-coord.
Luci
Phase 1 done — safe, additive, verified, pushed to both repos. Held at the check-in gate the ticket asked for before anything destructive.
**Delivered:**
- Audit: `~/workspace` .git 5.7G, 6.7G tracked artifacts, ~70G worktree duplication. Root cause = artifacts committed before gitignore rules existed.
- Hardened both `.gitignore` files → generated media now ignored. Smoke test passes (git status clean after sample mp3/png/pptx/m4a generation).
- Policy doc `docs/policy/artifact-storage-and-repo-hygiene.md` — `~/artifacts` canonical store + symlink design + staged reclamation plan.
- 3 commits, both repos pushed to master.
**Waiting on your go** for Phase 2 (untrack 6.7G + move to `~/artifacts` + symlink + prune worktrees → reclaims ~60-70G; reversible, but touches live serving + active worktrees) and a **separate** decision on Phase 5 (history rewrite to shrink .git from 5.7G — high blast radius). Question posted on the ticket.
{"mc_signal":"REVIEW","ticket":"MC-4657","nonce":"MC_TICKET_TURN:4657:1780476217333:c0d183cc","payload":"Phase 1 done+pushed: gitignore hardened (smoke-clean), policy doc, full audit. Holding at check-in gate before untrack/move/prune (Phase 2) + history-rewrite decision (Phase 5)."}