Skip to content

prep_wake_samples leaves stale clips when re-run into a populated output dir #8

Description

@jamditis

Found during PR #4 review (Codex, prep_wake_samples.py:218).

Problem

Re-running prep into an existing samples/positive or samples/negative directory after a recording is shortened, re-segmented, or replaced with fewer utterances overwrites only the current indices. Older higher-numbered WAVs from the previous run remain. Downstream training globs the whole directory, so the stale clips are silently included even though process() reports only the newly written count.

Why it matters

This is in the normal iterate-on-recordings workflow (re-record, re-run prep), so it bites during routine use, not just an edge case. The training set silently accumulates orphaned clips.

Approach

Before writing, clear prior outputs for the same class (with a confirmation or a --clean flag to avoid surprise deletion), or write to a fresh run-stamped subdir, or maintain a manifest and prune files not in the current run. Document the chosen behavior.

Acceptance criteria

  • Re-running prep does not leave clips from a previous run in the output dir (or the behavior is explicit and documented).
  • The reported count matches the files present after the run.
  • A test covers the re-run-with-fewer-clips case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreliabilityCorrectness, error handling, and unattended robustness

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions