Skip to content

repo-hygiene: clean-batch apply should validate plan records against the requested --tier #1081

Description

@kyle-sexton

Problem

clean-batch.sh --apply --batch-plan <path> dispatches purely on each plan line's kind (REPO/GITDIR); the apply-time --tier flag is informational only. A stale or swapped plan therefore executes the plan's full gated content while the banner reports the (narrower) requested tier — e.g. --tier build dry-run followed by --tier caches --apply --batch-plan <build-plan> removes both bin/ and .pytest_cache/ while printing Tier: caches.

Bounded: every removed path was still enumerated and confirmation-gated at plan creation (the plan IS the gated set), so nothing un-gated is ever removed — the defect is scope misrepresentation at apply time, not an ungated deletion.

Fix direction

At apply, validate plan records against the requested tier (reject build-class REPO records under --tier caches, gate the GITDIR arm on a git-bearing tier) or drop the apply-time --tier flag entirely so the plan is the sole authority and the banner reflects the plan, not the flag.

Related

Work-class: C3 (bug-fix-shaped) — attended triage 2026-07-23, operator-ratified. 🤖

Metadata

Metadata

Assignees

Labels

agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.priority: lowNice-to-have, cosmetic, or speculative; opportunistic.status: readyTriaged, unblocked, and fully specified; eligible to pick up.work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions