GeezerVison is showing github.com — Scratch-yard reaper for ~/git/fleet: keep text/scripts/markdown, reap the rest · Issue #7093 · developing-today/code
Scratch-yard reaper for ~/git/fleet: keep text/scripts/markdown, reap the rest #7093DescriptionBackground
Child of the #7079 stranded-work audit. The laptop's ~/git/fleet is not a working clone — it is a lane scratch yard wearing a repo's name: a shell clone with 4 tracked files and no remotes, holding 1,581 top-level untracked entries, ~610,000 files, ~242 GB. Composition (measured 2026-11-07): 1,276 probe-* throwaway sandboxes, ~240 task dirs, 198 nested clones of the real repos, watcher-bench fixture floods (371k generated .txt files), and large duplicated Rust build output (~75k target/ segments; the 25 largest files are 0.7–1 GB debug binaries duplicated across ID task checkouts). Spot-checked nested clones are clean with heads equal to their live remote tips — nothing is stranded in them. The yard is in LIVE use (new dirs created during the audit itself).
Drew's disposition rule (2026-11-07 21:31 CST): KEEP text, scripts, and markdown. The yard's human-authored ephemera is preserved; everything else is reappable.
Spec — build a scratch-yard reaper for ~/git/fleet
A scheduled, janitor-pattern reaper (same operating rules as the disk janitor), run on the laptop against ~/git/fleet only.
KEEP — archive-first
- Every human-authored text/script/markdown file anywhere in the yard:
.md .txt .sh .py .ts .js .json .yaml .yml .toml .log and equivalent human-authored text (lane logs, PR-body drafts, triage notes, probe scripts, docs).
- The ~92 loose root files are the known-precious set — archive ALL of them.
- Archive exactly like the disk janitor: gather into the dated archive layout (archive branch / janitor archive tree), commit ALL, push, and VERIFY the push landed before any removal of a kept file's original. Nothing kept is ever deleted before its archive copy is verified.
REAP — only after the keep-archive verifies
- Build output and duplicated bulk:
target/ trees, .o/.d/.rmeta/.rlib artifacts, dist/, node_modules/.
- Bench fixture floods: watcher-bench
.txt fixtures are GENERATED bulk despite the .txt extension — the keep rule covers human-authored text, not fixture floods. The reaper MUST use provenance/size heuristics (fixture dirs by name, per-file and per-dir caps, generated-content markers) to separate fixture bulk from authored text, and its run plan must state the heuristics it applied.
- Nested clones whose heads are verified clean AND equal to their remote tips (nothing unlanded). A nested clone with ANY unlanded state (dirty files, unpushed commits, detached work not on a remote) is archive-first, never reaped blind.
Safety gates
- Age gate: reap only entries idle ≥ 4 hours (the janitor's rule). The yard is in live use — never touch an entry with recent mtimes, an attached live process, or a registered worktree pointing into it.
- No recursive/wildcard deletes of anything not inventoried by the run's own scan; every reap is a named entry from the run report.
- First runs are dry-run/report-only until the keep-archive path is proven end-to-end.
Report per run
- GB reclaimed, files kept/archived (count + archive ref), entries reaped (count + GB), entries skipped (active or dirty) BY NAME.
Acceptance
- Reaper exists as a repeatable tool + schedule on the laptop, scoped to
~/git/fleet.
- One full run report demonstrating: keep-archive verified before reap, age gate respected, live entries untouched, GB reclaimed counted.
- The ~242 GB yard trends down without losing a single human-authored file.
Acceptance criteria
- The reaper exists as a repeatable tool plus a schedule on the laptop, scoped to
~/git/fleet only.
- The keep-archive (all human-authored text/scripts/markdown, including the ~92 loose root files) is committed, pushed, and the push verified BEFORE any kept file's original is removed.
- Reaping respects the safety gates: entries idle ≥ 4 hours only, no live-process or registered-worktree entries touched, no recursive/wildcard deletes — every reap is a named entry from the run's own scan.
- Bench fixture floods are separated from authored text by stated provenance/size heuristics recorded in the run report.
- One full run report demonstrates: keep-archive verified before reap, age gate respected, live entries untouched, GB reclaimed counted, entries kept/reaped/skipped (by name) listed.
- The ~242 GB yard trends down without losing a single human-authored file.
Activitydeveloping-today commented on Nov 8, 2026 dezren39 commented on Nov 8, 2026 Correction — no archive branches; preservation = pushed or PR'd (2026-11-07)
This issue's spec was written tonight with the framing "archive-first (commit ALL + push verified before any removal, janitor-style)." That framing carries a false premise, corrected by Drew 2026-11-07 21:57 CST: "no, nobody said make archive branches you just did that." The janitor's archive/janitor-* branch mechanism was an assistant invention, never Drew's order. This issue is aligned to the corrected rule:
"Just don't lose it. Once you push you can delete locally. Once a PR is made you can close it, delete the branch, or merge into main. PRs never go away." — Drew, 2026-11-07 22:00 CST
Applied to the yard reaper:
- The safety invariant is NO LOSS, with exactly two sanctioned permanence mechanisms: (1) a push to origin — then local deletion is fine; (2) a PR — a permanent record; then close it, delete the branch, or merge into main.
- Preservation never means "kept as a local or remote branch for safety." No
archive/* branches are minted by this reaper, ever.
- The KEEP set (text, scripts, markdown, docs, authored files) is extracted by review → PR: changes worth keeping go up as a PR (finish and merge, or close with the record). Bulk — build output, generated fixture floods, duplicated binaries — is discarded once the keep set is safe.
- Interim, until the review pipeline exists: keep the copy LOCALLY (laptop
~/janitor-archive/held-local/), move the yard entry to the recoverable trash, and file the extraction as a queue task instead of pushing a branch.
Everything else in the spec (the keep-rule itself, nested-clone verification, the 4-hour age gate, live-use protection, per-run reporting) stands unchanged. dezren39 commented on Nov 8, 2026 Second correction — the local-hold interim in the comment above was wrong (2026-11-07)
The closing bullet of my correction comment above (6717017924) — "Interim, until the review pipeline exists: keep the copy LOCALLY (laptop ~/janitor-archive/held-local/), move the yard entry to the recoverable trash, and file the extraction as a queue task instead of pushing a branch" — was wrong. Drew, 2026-11-07 22:06 CST: "what the fuck part of push upstream just don't lose it makes you think copy stays local is what I wanted to hear."
There is no local preservation tier. Drew's rule is push upstream or PR; a copy held on the same machine preserves nothing. That bullet is superseded by this comment.
Applied to the yard reaper, corrected
Drew's rule (2026-11-07 22:00 CST): "Just don't lose it. Once you push you can delete locally. Once a PR is made you can close it, delete the branch, or merge into main. PRs never go away."
- Content worth keeping is committed and pushed upstream under its own branch name; the extraction PR (finish+merge or close) is the record; local deletion only after the push verifies.
- Bulk that isn't worth a commit is trash (recoverable window) — never a locally held "archive copy," and never an
archive/* branch.
- Keep-set extraction (text, scripts, markdown, docs) follows review → PR, exactly as the corrected comment above states; only the local-hold interim is struck.
Worktree clause (Drew, 2026-11-07 22:07 CST)
"work trees don't have to have a branch"
Worktrees do not need named branches — they just need to live on a branch. A worktree checked out on a queue/* branch is already on a normal branch; nothing about yard cleanup needs an invented branch. The causal arrow in fleet lore was backwards: lanes carried branches because the worktrees did (the fleet runs branch-per-task), not the reverse. added effort/lLarge: multi-day or open-ended; expect staged check-ins area/infraInfrastructure, deployment, and operations meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added on Nov 8, 2026dezren39 commented on Nov 8, 2026 Intake review
Related: parent stranded-work audit issue #7079 (this is its child); the disk-janitor pattern it mirrors.
Still live (monitor check this run): no open PR found implementing a scratch-yard reaper; the yard measurements in the body are from 2026-11-07.
Notes: Drew's disposition rule is recorded in the body (2026-11-07 21:31 CST: keep text, scripts, and markdown) — that decision is already made; what remains is building the tool to his spec. The archive-first ordering (verify the push before any removal) is the safety core and is non-negotiable per the fleet delete guardrail.
Risks: The yard is in live use — the age/process/worktree gates are what stand between the reaper and a lane's active scratch. The .txt fixture flood (371k generated files) is the main misclassification risk in both directions.
Suggested approach: build the scanner/report first and run dry-run/report-only until the keep-archive path is proven end-to-end, exactly as the spec's safety gates require; only then enable reaping on the schedule.
— fleet monitor intake (repo-fleet-monitor, 2026-11-07 run); acceptance criteria appended to the body and labels normalized this pass. developing-today commented on Nov 8, 2026 Landed 2026-11-08 (Drew's order: "make it land wtf").
Why it hadn't landed: task 12665 sat queued ~18h, never claimed, so the specced reaper was never built. Two sibling tools already ran hourly but neither covers the yard's non-worktree bulk: worktree-reaper.service (registered linked worktrees only — reaped 64 trees / 165.5 GB at 15:03 CST and 38 trees / 3.7 GB at 16:08 CST today) and cargo-target-janitor (target/ trees under a 150 GiB cap only).
What was built: infra/yard-reaper/ — the cargo-target-janitor engine (fail-closed liveness: broker claimed ids + GitHub-fallback claimed issues + paginated open-PR reads, per-removal re-verification, write-ahead JSONL run logs) widened with whole-entry classification, shipped as a new tool; the janitor itself untouched. It also runs the identical 150 GiB target-cap plan every run, and install-units.sh retires the standalone janitor timer so the cap keeps exactly one enforcer.
Keep rule as encoded: nested clone reapable only when fully clean AND HEAD == live remote tip; scratch tree reapable only with zero keep-set files outside bulk subtrees (keep suffixes .md/.txt/.sh/.py/.ts/.js/.json/.yaml/.yml/.toml/.log; bulk = target, dist, node_modules, .git, cache, .cache, vendor, .bun, .npm, .venv, pycache); registered worktrees excluded (registration merged from every primary under ~/git); ≥4h idle gate for entries, 48h for targets; claimed task/issue, open PR, and live-process cwd gates re-verified fresh per removal — a tripped gate stops the run, never skips ahead. Whole entries move to recoverable trash ~/.local/share/Trash/yard-reaper/<run-id>/, named one by one. Hard examination holds: 7780-1931-slice1 and 11081 (both verified present and untouched after every pass).
Schedule (verified): yard-reaper.timer enabled + active, hourly. Proof: the 17:08 CST timer fire started a real run on its own (it refused safely — see below), next trigger 18:07 CST. cargo-target-janitor.timer disabled by the install.
Runs so far:
- Dry run
yard-run-20261108T221134Z: 1,469 entries classified — 404 eligible (scratch, no keep-set, 0.31 GiB total), 1,010 holds-keep-set, ~55 active-within-4h, examination holds excluded by name. Target plan selected 0 (the janitor's own run had just enforced the cap; 73.7 GB of targets remain, under the 150 GiB cap).
- First bounded apply
yard-run-20261108T222041Z (cap 25): 25 entries reaped to trash (4,599,808 B), 379 deferred, no refusals, no errors.
- systemd-path apply
yard-run-20261108T223133Z: 100 entries reaped to trash (11,481,088 B), 279 deferred. Total across passes: 125 entries, ~16 MB — the eligible class is genuinely tiny probe dirs (Oct 27–31). The hourly runs drain the remaining 279.
- Timer-fired run
yard-run-20261108T230816Z: refused, exit 2, zero reaped — the GitHub fallback for claimed issues (gh api ... labels=queue/claimed) returned non-zero (the laptop's user gh identity is under GitHub's secondary rate limit, hit repeatedly today). Fail-closed worked as designed: nothing was reaped on an unverifiable gate. Recorded here rather than hidden: when the rate limit clears, scheduled runs proceed; the broker claimed-ids source is unaffected.
Yard size: 294,742,306,816 B (274.50 GiB) fresh du before the passes; 205,045,211,136 B (190.97 GiB) measured as the 22:31Z run completed (the last few reaps after the measure were ~MBs of probe dirs). Attribution, honestly: the yard-reaper's own new-scope yield today is ~16 MB — the drop is dominated by the sibling worktree-reaper's concurrent runs (~169 GB today) plus normal fleet churn. The morning's 565 GB figure predates those reaps. Of the 274.50 GiB, 164.73 GiB is accounted by targets + non-target entries; the remainder is registered-worktree working files (the worktree-reaper's domain). The yard's bulk is live/registered work and keep-set material, not unexamined garbage.
Held set (by name, with reasons): 7780-1931-slice1 + 11081 — hard examination holds, untouched. 1,010 entries — keep-set files present (authored text/scripts/logs; e.g. 1627-scratch with prove.sh/proof.txt/server.log, watcher-bench-195 with 5 harness logs in results/, unregistered task dirs with repo/ checkouts whose heads were not proven equal to the live remote tip). ~55 entries — active within the 4h gate at scan time. Registered worktrees — the worktree-reaper's domain, excluded by design.
Queue task 12665: still queued in repo-health-code-pilot. The repo-queue claim verb takes the queue head (priority order), not a task id — verified live: a claim attempt took the head task instead, and completion/checkpoint verbs require a live claim by the worker identity. There is no verb to claim or complete a specific queued task out of order, so the row cannot be honestly flipped from here; this comment is the completion evidence, and the task's linked issue closing is the signal the queue's own reconciliation consumes. (The accidental head-task claim during this probing was cancelled immediately; no other task was touched.)
Run logs: ~/.local/state/yard-reaper/runs/ on the laptop. Closing: the reaper is built, merged, installed, on an hourly timer, has completed two apply passes, and its fail-closed refusal path is proven live. dezren39 commented on Nov 10, 2026 🤖 Agent note · done — already completed
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|