From 370fe1c8b96055fd7ade4ece11b95cc3c2206b8e Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 12 Apr 2026 01:56:33 +0000 Subject: [PATCH] =?UTF-8?q?handoff(task-101):=20git=20hygiene=20PARTIAL=20?= =?UTF-8?q?=E2=80=94=20rewrite=20done,=20Gitea=20GC=20pending?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Force-push accepted, local clone realigned, stale clone renamed, asset browser verified still working. 1.1GB→62MB locally and in fresh clones. Left for next Chronicler: Gitea server-side garbage collection to reclaim disk on Command Center's Gitea host. Full recovery procedure documented in the handoff. Pre-101 bundle preserved at /opt/backups/firefrost-operations-manual-pre-101.bundle. Chronicler #81 --- SESSION-HANDOFF-NEXT.md | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/SESSION-HANDOFF-NEXT.md b/SESSION-HANDOFF-NEXT.md index aceb13e..b4f1872 100644 --- a/SESSION-HANDOFF-NEXT.md +++ b/SESSION-HANDOFF-NEXT.md @@ -248,3 +248,52 @@ Michael verified end-to-end in real browsers: **Task #126 fully closed** (all phases deployed, smoke-tested, documented). **Task #125 fully closed** (both phases deployed, smoke-tested). + +--- + +## Task #101 — Git Repository Cleanup & Hygiene (PARTIAL — handoff needed) + +Executed per Gemini's April 11 consultation (see `docs/consultations/gemini-task-101-git-hygiene-2026-04-11.md`). Option C: aggressive cleanup on ops manual, branch cleanup on all three, leave firefrost-website history alone because of Cloudflare Pages dependency. + +### ✅ DONE this session + +**Branch cleanup (pure Gitea API, zero risk):** +- `firefrost-services`: 6 merged branches deleted on origin (task-125-asset-browser, task-125-social-calendar, task-126-appeals-admin, task-126-appeals-reopen, task-126-lifecycle-handlers, task-126-phase2-appeals) +- `firefrost-website`: 2 merged branches deleted on origin (task-126-phase2-form, task-126-policy-page) + +**Ops manual history rewrite:** +- Backup bundle: `/opt/backups/firefrost-operations-manual-pre-101.bundle` (1.1 GB, `git bundle verify` passed) +- Preflight: no branch protection on `master`, zero hardcoded commit SHA references in any `.md` file +- `git filter-repo --invert-paths` stripped `photos/` and two `docs/branding/audio/*.mp4` files from all 1526 commits in 6.6 seconds +- Result: **1.1 GB → 62 MB `.git` size (18x reduction)**. 1516 commits after empty-commit drops. `git fsck --full` clean. photos/ and *.mp4 zero references in rewritten history. +- Placeholder README committed at `docs/branding/audio/README.md` documenting what was removed, where the files currently live (Michael's local machine), and the path forward (R2 preferred once enabled; NextCloud alternative after Meg's folder reorg) +- Force-push to Gitea accepted: `45d6ede...4055016 master (forced update)` + +**Clone realignment on Command Center:** +- `/opt/firefrost-ops-manual` (the clone the branding asset browser reads from + systemd timer pulls every 15 min) — realigned via `git fetch && git reset --hard origin/master`, asset browser smoke-tested and still returning HTTP 200 on both `/list` and `/thumb` endpoints +- `/root/firefrost-work/firefrost-operations-manual` (stale 5-day-old clone, no active consumer) — renamed to `.stale-pre-101` per Gemini's "no landmines" guidance + +### ⚠️ INCOMPLETE — for the next Chronicler + +**Gitea server-side garbage collection has NOT been run.** This is Gemini's blind-spot #2. What this means: + +- **The clone-time pain is already fixed.** Fresh clones of `firefrost-operations-manual` now pull 62 MB, not 1.1 GB. Chroniclers get the benefit starting with the very next session. +- **The Gitea host's disk usage has NOT been reclaimed.** Gitea keeps old unreferenced objects after a force-push as a safety net. Until GC runs, the bare repo on disk at Command Center still shows ~1.1 GB for a repo that logically only needs ~62 MB. Wasted disk, not wasted bandwidth. + +**How to finish the job (5 min of work):** + +1. Locate Gitea's bare repo on Command Center. Gitea runs as systemd service `gitea`, user `gitea`, workdir `/var/lib/gitea`. The `gitea-repositories` subdirectory wasn't at the expected path — needs a `find / -type d -name "gitea-repositories" 2>/dev/null` run as root, or `grep ROOT /etc/gitea/app.ini` to read the configured path (check both `conf/app.ini` and `custom/conf/app.ini` relative to the work dir). +2. Baseline: `du -sh` the bare repo directory, note the number. +3. Trigger GC via one of these paths: + - Web UI: Site Administration → Monitoring → Cron Tasks → "Garbage collect LFS pointers" and "Garbage collect all repositories" (exact names may vary by Gitea version) + - CLI: `sudo -u gitea gitea manager flush-queues` then `sudo -u gitea gitea admin repo-sync-release-tags` — or just `sudo -u gitea git -C /path/to/firefrost-operations-manual.git gc --aggressive --prune=now` directly against the bare repo +4. After GC: re-run `du -sh` on the bare repo. Expected: drops from ~1.1 GB to ~62-100 MB. +5. Final verification: fresh `git clone` from Gitea to a scratch path, `du -sh` the `.git`, confirm it matches post-GC server-side size. + +**Safety net:** The pre-101 bundle at `/opt/backups/firefrost-operations-manual-pre-101.bundle` (1.1 GB) is the rollback plan. To restore: `git clone /opt/backups/firefrost-operations-manual-pre-101.bundle restored-repo`, then force-push to Gitea origin. Bundle `git bundle verify` passed at time of creation. + +**DO NOT delete the backup bundle** until the next Chronicler has completed Gitea GC and verified the ops manual is still healthy. After that, the bundle can be removed to reclaim its 1.1 GB. + +**Rollback criteria (still active):** Gemini's rule was "if Command Center synchronization fails to recover within 5 minutes, abort and restore from bundle." That window has passed successfully — the active clone recovered in ~2 seconds and the asset browser never missed a beat. No rollback needed. + +— Chronicler #81