feat: add cleanup.py for safe temp artifact removal#2
Merged
Conversation
- cleanup.py deletes tmp/prep/<slug>/ only after verifying outbox/<slug>/transcript.md exists - Hard guard: refuses to delete anything outside tmp/ - Uses shutil.rmtree, never shells out to rm - Supports --dry-run for preview - SKILL.md updated: Step 11 (mandatory cleanup), anti-pattern rule - 5 tests covering all safety guards
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add
cleanup.pyscript and a mandatory cleanup step (Step 11) to the skill workflow.Why
After processing,
tmp/prep/<slug>/retains audio chunks and intermediate files (50–150 MB per meeting). These were never cleaned up, accumulating disk waste.How
cleanup.py— deterministic, safe removal:outbox/<slug>/transcript.mdexists before deleting anything<project-root>/tmp/shutil.rmtree— never shells out torm--dry-runflag for preview (reports file count + size)--project-rootfor testabilitySKILL.md changes:
rmon temp filesTests: 5 cases covering refused-without-transcript, nonexistent slug, dry-run preservation, actual deletion, and inventory reporting.