Skip to content

repo-hygiene: clean-build.sh --apply accepts caches manifest entries without --include-caches (wrong-tier bypass) #1076

Description

@kyle-sexton

Problem

clean-build.sh passes a fixed "build caches" allow-list to clean_apply_manifest on both apply paths (clean-build.sh lines ~95 and ~120), regardless of --include-caches. So clean-build.sh --apply --manifest <path> without --include-caches still accepts caches entries from a caller-supplied manifest and removes cache targets (.pytest_cache/, .ruff_cache/, …) even though the invocation selected the build-only tier. A stale or mistaken cache manifest thus bypasses the wrong-tier hardening that the ALLOWED-classes parameter exists to enforce.

Low severity (caches are regenerable, and it requires a caller-supplied/stale manifest), but it defeats the tier-isolation guard on the documented --manifest surface.

Fix direction

Derive the allowed classes from INCLUDE_CACHES: pass "build" when INCLUDE_CACHES=0 and "build caches" only when --include-caches is set, so a plain build apply accepts only build lines. Add a TDD case: a build-only --apply with a manifest containing a caches line must reject it (Rejected (wrong tier)) and leave the cache target in place.

Context

Surfaced by a Codex review comment on PR #1066 (Batch D), but the code lives in clean-build.sh (landed via #1023) — out of that PR's scope, so tracked here. Part of the repo-hygiene hardening umbrella #1003.

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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