Summary
Add three usability improvements to the deep sweep runner:
-
FILES Makefile variable — accept comma-separated patterns (e.g. make sweep FILES="src/a.py,src/**/*.cs") alongside the existing single FILE variable.
-
Resume on interrupt — track successfully scanned files in a plain-text state file (tmp/sweep-state.txt). If the sweep is interrupted or a file fails, restarting will skip already-completed files and pick up where it left off.
-
RESET=1 / RESTART=1 — clear the state file and force a fresh sweep of all files.
Motivation
- Sweeping multiple files currently requires multiple
make sweep FILE=... invocations.
- If a long sweep is interrupted (CTRL-C, network issue, model error), there is no way to resume — you must restart from scratch or manually track which files finished.
- A plain-text state file (
tmp/sweep-state.txt, one path per line) keeps it simple, inspectable, and editable by hand.
Implementation plan
tools/run-sweep.py
- New
STATE_FILE constant -> tmp/sweep-state.txt
- Functions:
load_completed(), mark_done(file_path), clear_state()
- New CLI args:
--files (comma-separated), --reset (clear state)
main(): split --files into --file args, load/filter completed set, mark after each successful sweep, handle aggregate rollup for resumed runs (pull prior summaries for skipped files)
Makefile
sweep target: split FILES on ,, pass each as --file, propagate RESET/RESTART as --reset
- Keep backward compat with
FILE
docs/file-risk-sweeps.md
- Update examples and document resume/reset behavior
tests/test_run_sweep.py
- Cover state file lifecycle,
--files splitting, skip-on-resume, --reset, aggregate rollup with skipped files
Summary
Add three usability improvements to the deep sweep runner:
FILESMakefile variable — accept comma-separated patterns (e.g.make sweep FILES="src/a.py,src/**/*.cs") alongside the existing singleFILEvariable.Resume on interrupt — track successfully scanned files in a plain-text state file (
tmp/sweep-state.txt). If the sweep is interrupted or a file fails, restarting will skip already-completed files and pick up where it left off.RESET=1/RESTART=1— clear the state file and force a fresh sweep of all files.Motivation
make sweep FILE=...invocations.tmp/sweep-state.txt, one path per line) keeps it simple, inspectable, and editable by hand.Implementation plan
tools/run-sweep.pySTATE_FILEconstant ->tmp/sweep-state.txtload_completed(),mark_done(file_path),clear_state()--files(comma-separated),--reset(clear state)main(): split--filesinto--fileargs, load/filter completed set, mark after each successful sweep, handle aggregate rollup for resumed runs (pull prior summaries for skipped files)Makefilesweeptarget: splitFILESon,, pass each as--file, propagateRESET/RESTARTas--resetFILEdocs/file-risk-sweeps.mdtests/test_run_sweep.py--filessplitting, skip-on-resume,--reset, aggregate rollup with skipped files