Delete takedown scratch repos after each run #968
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#968
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The takedown eval harness never deletes its scratch repos. Each run copies the repo at a base commit into
~/.cache/cc-os/takedown-runs/<stamp>/repoand leaves it there./autoresearchloops will run the harness many more times, so the disk use grows with every run.Observed
On 2026-10-07 the cache held 198 runs.
No code deletes a scratch repo.
Dir.mktmpdiris used only for temporary archives.Reproduce
The size grows by one repo copy for each run.
Approach
The run deletes its scratch repo when it finishes, or the harness keeps only the scratch repos that a run still needs (for example,
--implementruns under inspection). The run records stay inresults/; the scratch repo is rebuildable from the base commit.Origin
/autoresearchloops<scratch_root>/<stamp>/repo) ←Locations::SCRATCHis a persistent directory (lib/takedown/model/locations.rb:5). End: DESIGN (ScratchRepo).VERDICT: CREATE — 198 runs left 8.3 GB with no cleanup; chain ends in DESIGN; distinct from #967.
Resolution
Done: Pipeline#call releases the run's ScratchDir (<scratch_root>/) in an ensure; deleted on success, failure, exception; kept with printed path when --implement fails
Evidence:
77ab3cb5; rake test 378 runs, 787 assertions, 0 failures, 0 errorsFollow-ups: none