Repository navigation
Description
Problem
The hourly cargo-target-janitor (infra/cargo-target-janitor) — the only mechanism enforcing the 150 GiB fleet Cargo-target cap — fails every run and has deleted nothing while the laptop disk filled to 100% (#6797 triage, 2026-11-07):
cargo-target-janitor: refusing cleanup: queue helper unavailable: /home/user/hatch/tools/repo-queue.py
(journalctl --user -u cargo-target-janitor.service, runs at 03:08Z / 04:00Z / 05:03Z on 2026-11-07, all exit 2.)
The janitor reads its never-delete claimed set through the retired Python repo-queue helper at ~/hatch/tools/repo-queue.py — a path removed by the fleet-binary migration (code#5362/#5412). Fail-closed is the right behaviour for an unavailable safety source; the defect is that the source path is permanently stale, so the refusal is permanent and silent (its run-record dir ~/.local/state/cargo-target-janitor/runs/ holds no recent runs, and nothing alerts on the repeated service failure).
Measured at triage (2026-11-07 ~05:35Z): in-scope targets ~/git/fleet/*/pkgs/id/target alone sum 274,701 MB vs the 150 GiB cap. Separately, two build-output classes sit outside the janitor's configured scope entirely: ~/git/fleet/queue/*/pkgs/id/target ≈ 82 GiB (one level deeper than its glob) and repo-root ~/git/fleet/*/target ≈ 114 GiB. ~/git/fleet totals 604 GiB across 1,704 entries (352 registered worktrees).
Requested change
- Restore a live queue-claims source for the janitor on the current fleet path: read claimed task IDs via the fleet queue binary / broker, and — while the queue backend is down (code#6619) — via the GitHub fallback claim markers, which are the claim of record in fallback mode. Preserve fail-closed semantics when no source is readable. Note cargo-target-janitor(queue_claims): offset pagination over the live claimed set can skip a still-claimed task — it loses never-delete protection #6790 (closed 2026-11-07) fixed offset pagination inside this same read; keep that fix and its tests.
- Decide the scope question with the numbers above and implement it: either extend discovery to
~/git/fleet/queue/*/pkgs/id/targetand~/git/fleet/*/target(with the same safety rules), or document in the README why those classes are excluded and name what owns them. - A run record (summary JSONL under
~/.local/state/cargo-target-janitor/runs/) is written on every run, including refusals, so a dead janitor is visible in its own state, not only in the systemd journal. - The existing deletion-safety tests cover the new source path (fixture claim sets, no live queue needed). Wiring those tests into CI is ci(cargo-target-janitor): test_cargo_target_janitor.py (13 tests, deletion-safety rules) run by no workflow — hourly timer runs the deleter, never its tests #5952 — coordinate, don't duplicate.
Acceptance
- A manual dry-run on the laptop completes and prints candidates + protected targets instead of the
queue helper unavailablerefusal. - The hourly user timer's next run after the fix exits 0 (or reports
over_capwith named protected targets) and leaves a run record. - Claimed-task, open-PR, and live-process protections behave exactly as before (existing tests pass, extended for the new source).
- If scope is extended: a dry-run enumerates the queue/ and repo-root target classes with sizes; if not, the README names their owner.
Refs: #6797 (triage), #6790 (closed, same read), #5952 (janitor tests in CI), #3372 (prior disk-full occurrence).
Activity
developing-today commentedon Nov 7, 2026
Picked up by
repo-worker-code-d— working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live whilerepo-worker-code-dposts progress markers; after 30 minutes of silence any other worker may pick this up.)developing-today commentedon Nov 7, 2026
Progress from
repo-worker-code-d: implementation in progress: worktree ~/git/fleet/fb-6812 (branch queue/fallback-6812-janitor-source) at origin/main 4367bcf. Design: helper source kept when the file exists; new GitHub fallback claims source (fleet queue fallback scan live/contested markers + queue/claimed-labelled issues, protection keyed by issue id for fallback-era branches); discovery extended to fleet/queue/* worktrees and repo-root cargo targets; refusal run records. Next: patch + tests.developing-today commentedon Nov 7, 2026
Progress from
repo-worker-code-d: targeted_tests_passed: janitor suite 29/29 on laptop (21 pre-existing + 8 new #6812 tests). Next: real dry-run against ~/git/fleet with the fallback claims source, README update, then PR.developing-today commentedon Nov 7, 2026
Progress from
repo-worker-code-d: pr_opened: PR #6820 (head e7fd286). Tests 31/31 + two real dry-runs verified (448 GiB enumerated, fallback source). Next: Codex gate, merge, install refreshed binary to ~/.local/bin, release.Merge pull request #6820 from developing-today/queue/fallback-6812-ja…
developing-today commentedon Nov 7, 2026
Released by
repo-worker-code-d(outcome: done). DONE: PR #6820 merged e380645 (= main HEAD); issue closed. Janitor fixed: claims source falls back to GitHub fallback claims when the retired repo-queue helper is absent (helper stays first choice), scope extended to fleet/queue/* and repo-root targets incl. scratch dirs (448 GiB / 94 targets enumerated), refusals now write run records. Tests 31/31; two real dry-runs clean (nothing deleted); refreshed binary installed to ~/.local/bin so the hourly timer uses it. Follow-up #6813 (fleet-monitor disk-headroom alert) remains queued.