Delete takedown scratch repos after each run #968

Closed
opened 2026-10-07 19:00:42 +00:00 by jared · 1 comment
Owner

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>/repo and leaves it there. /autoresearch loops 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.

du -sh ~/.cache/cc-os/takedown-runs
8.3G	/home/jared/.cache/cc-os/takedown-runs

No code deletes a scratch repo. Dir.mktmpdir is used only for temporary archives.

Reproduce

bin/takedown-run <case> && du -sh ~/.cache/cc-os/takedown-runs

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, --implement runs under inspection). The run records stay in results/; the scratch repo is rebuildable from the base commit.

Origin

  • Trigger: owner question in session 87a712ed about whether scratch copies come back during /autoresearch loops
  • Improvised this session: none
  • Chain: cache grows 8.3 GB ← no cleanup step after a run (lib/takedown/command/run_builder.rb:42 builds <scratch_root>/<stamp>/repo) ← Locations::SCRATCH is a persistent directory (lib/takedown/model/locations.rb:5). End: DESIGN (ScratchRepo).
  • Root candidate: none; this ticket.
  • Where: plugins/os-sdlc/eval/ticket-takedown/lib/takedown/adapter/scratch_repo.rb
  • Session: 87a712ed-cbfb-44d0-a970-d1bbff2fd148
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-prism-architect/87a712ed-cbfb-44d0-a970-d1bbff2fd148.jsonl

VERDICT: CREATE — 198 runs left 8.3 GB with no cleanup; chain ends in DESIGN; distinct from #967.

## 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>/repo` and leaves it there. `/autoresearch` loops 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. ``` du -sh ~/.cache/cc-os/takedown-runs ``` ``` 8.3G /home/jared/.cache/cc-os/takedown-runs ``` No code deletes a scratch repo. `Dir.mktmpdir` is used only for temporary archives. ## Reproduce ``` bin/takedown-run <case> && du -sh ~/.cache/cc-os/takedown-runs ``` 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, `--implement` runs under inspection). The run records stay in `results/`; the scratch repo is rebuildable from the base commit. ## Origin - Trigger: owner question in session 87a712ed about whether scratch copies come back during `/autoresearch` loops - Improvised this session: none - Chain: cache grows 8.3 GB ← no cleanup step after a run (lib/takedown/command/run_builder.rb:42 builds `<scratch_root>/<stamp>/repo`) ← `Locations::SCRATCH` is a persistent directory (lib/takedown/model/locations.rb:5). End: DESIGN (`ScratchRepo`). - Root candidate: none; this ticket. - Where: plugins/os-sdlc/eval/ticket-takedown/lib/takedown/adapter/scratch_repo.rb - Session: 87a712ed-cbfb-44d0-a970-d1bbff2fd148 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-prism-architect/87a712ed-cbfb-44d0-a970-d1bbff2fd148.jsonl VERDICT: CREATE — 198 runs left 8.3 GB with no cleanup; chain ends in DESIGN; distinct from #967.
Author
Owner

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 errors

Follow-ups: none

## Resolution **Done:** Pipeline#call releases the run's ScratchDir (<scratch_root>/<stamp>) 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 errors **Follow-ups:** none
jared closed this issue 2026-10-07 19:18:00 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#968
No description provided.