Skip to content

repo-hygiene: clean-build/clean-caches run ~10 unpruned full-tree find walks per repo — measured 40x overhead #993

Description

@kyle-sexton

Problem

clean-build.sh + clean-caches.sh run one full-tree find per pattern (7 CLEAN_BUILD_DIR_NAMES + 1 build glob + 1 cache dir name + 1 cache glob ≈ 10 walks per repo), and the ! -path exclusions only filter output — they do not -prune, so every walk still descends .git/, node_modules/, .venv/.

Measured

Same large repo (medley, .NET + node), same machine (Windows/NTFS):

Approach Time
single find with -prune + -o alternation, incl. du sizes 16.7 s
skill dry-run (10 walks, unpruned) >10 min (killed, never finished)

Dry-run alone exceeded the 120 s Bash timeout; a fleet sweep pays this per repo, then pays it again at --apply (gate flow enumerates twice; see manifest issue).

Fix direction

Single walk: find ROOT \( -name .git -o -name node_modules -o -name .venv \) -prune -o \( -type d \( -name bin -o … \) -o -type f \( -name '*.binlog' -o … \) \) -print, then apply per-path protections on the result list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: highSignificant impact, or blocks an imminent release; staff this cycle.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions