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. 🤖
Problem
clean-build.shpasses a fixed"build caches"allow-list toclean_apply_manifeston both apply paths (clean-build.shlines ~95 and ~120), regardless of--include-caches. Soclean-build.sh --apply --manifest <path>without--include-cachesstill acceptscachesentries 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
--manifestsurface.Fix direction
Derive the allowed classes from
INCLUDE_CACHES: pass"build"whenINCLUDE_CACHES=0and"build caches"only when--include-cachesis set, so a plain build apply accepts onlybuildlines. Add a TDD case: a build-only--applywith a manifest containing acachesline 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. 🤖