Files
EvoScientist/scripts/cleanup_old_runs.py
T
m4 c2743251e9 Initial commit of EvoScientist framework
Self-evolving AI scientist framework built on LangGraph/LangChain with
CLI/TUI core, FastAPI gateway, and Next.js frontend.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
2026-07-13 08:07:45 +08:00

24 lines
836 B
Python

"""One-time cleanup: delete old `~/.evoscientist/runs/` directories.
Run after migration to confirm all threads use ``data/`` instead of ``runs/``.
"""
import shutil
from pathlib import Path
runs_dir = Path.home() / ".evoscientist" / "runs"
if not runs_dir.exists():
print("No old runs/ directory found. Nothing to clean.")
else:
total = sum(1 for d in runs_dir.iterdir() if d.is_dir())
print(f"Found {total} user directories in runs/")
for user_dir in runs_dir.iterdir():
if user_dir.is_dir():
n_threads = sum(1 for t in user_dir.iterdir() if t.is_dir())
print(f" {user_dir.name}: {n_threads} threads")
confirm = input(f"\nDelete entire {runs_dir}? [y/N] ")
if confirm.lower() == "y":
shutil.rmtree(runs_dir)
print("Done.")
else:
print("Skipped.")