Skip to content

cleanup-eligible drain never consumes freshly marked cleanup_eligible worktrees (planned>0, would_remove=0, empty samples) #884

Description

@chubes4

Observed (2026-07-12, intelligence-chubes4 host)

Sequence:

  1. worktree active-no-signal-equivalent-clean-apply promoted 7 worktrees to cleanup_eligible metadata (confirmed in output, e.g. blocks-engine@cook-nav-faithful-preservation ... cleanup_eligible).
  2. worktree reconcile-metadata --apply wrote metadata for 8 more worktrees, several explicitly cleanup_eligible (e.g. blocks-engine@verify-figma-trunk-20260707 cleanup_eligible 2026-07-12T02:02:53+00:00).
  3. worktree bounded-cleanup-eligible-apply --limit=25 immediately after: removed 0, "no candidates remaining outside this batch" — even though it had successfully drained 32 previously-marked worktrees earlier the same day.
  4. worktree cleanup-eligible-drain --dry-run: contradictory telemetry — processed 24, planned 24, would_remove 0, removed 0, skipped 913 and ALL sample arrays empty (samples.candidates, samples.planned, samples.skipped all len 0 in --format=json).

Expected

Worktrees promoted to cleanup_eligible should appear as drain candidates (or the drain should state the gate blocking them, e.g. an age/grace window). planned=24 with would_remove=0 and empty samples is inconsistent telemetry either way.

Suspects

  • Eligibility marker written by promotion/reconcile paths not matching what the drain reads (metadata key/stage mismatch), or
  • an undocumented grace window (--older-than?) silently filtering fresh marks while telemetry still counts them as planned.

Environment

DMC on intelligence-chubes4, workspace root /Users/chubes/Developer, ~995 worktrees at time of test.

AI assistance

  • AI assistance: Yes
  • Tool(s): Claude Opus 4.5 via OpenCode
  • Used for: Diagnosed and documented the reproduction

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions