Skip to content

Add operator-safe bounded cleanup apply for obvious candidates #216

@chubes4

Description

@chubes4

Problem

DMC has pieces for cleanup plans, chunks, and system-task scheduling, but the local workspace still has hundreds of worktrees and the operator cannot safely reclaim obvious candidates end-to-end without hitting slow dry-run/apply paths.

Known current state on intelligence-chubes4:

  • ~789 worktrees
  • Cheap inventory found a small number of explicit cleanup_eligible candidates
  • Artifact dry-run timed out
  • Full worktree list timed out

Existing related issues cover chunks/progress/artifact emergency paths, but the remaining operator gap is a single bounded, safe apply path for obvious candidates that does not require an exhaustive scan first.

Expected

There should be a command/ability/task path that applies only explicit, cheap, high-confidence cleanup candidates in bounded batches.

Notes

  • Examples: lifecycle cleanup_eligible with clean worktree, reviewed artifact rows from known profiles, stale rows already validated by current metadata.
  • It must revalidate before deletion.
  • It must not require GitHub lookup or full workspace status by default.
  • It should be job-backed/resumable and produce evidence.

Acceptance criteria

  • Operator can run a bounded apply for obvious candidates without full scan.
  • Each deletion/reclaim is revalidated immediately before mutation.
  • Dirty/unpushed/ambiguous/missing metadata rows remain protected.
  • Evidence reports processed, removed, skipped, bytes reclaimed, and continuation state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions