Skip to content

sweep: multi-pattern FILES, resume on interrupt, RESET=1 #68

Description

@pruiz

Summary

Add three usability improvements to the deep sweep runner:

  1. FILES Makefile variable — accept comma-separated patterns (e.g. make sweep FILES="src/a.py,src/**/*.cs") alongside the existing single FILE variable.

  2. 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.

  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions