Skip to content

feat: add cleanup.py for safe temp artifact removal#2

Merged
dimdasci merged 2 commits into
mainfrom
feat/cleanup-script
May 15, 2026
Merged

feat: add cleanup.py for safe temp artifact removal#2
dimdasci merged 2 commits into
mainfrom
feat/cleanup-script

Conversation

@dimdasci

Copy link
Copy Markdown
Owner

What

Add cleanup.py script 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:

  • Verifies outbox/<slug>/transcript.md exists before deleting anything
  • Hard guard: only operates under <project-root>/tmp/
  • Uses shutil.rmtree — never shells out to rm
  • --dry-run flag for preview (reports file count + size)
  • --project-root for testability

SKILL.md changes:

  • Step 11 — Cleanup added as mandatory post-acceptance step
  • Gate 2 branches now include cleanup before stop
  • New anti-pattern: Don't run rm on temp files
  • Cleanup CLI added to references list

Tests: 5 cases covering refused-without-transcript, nonexistent slug, dry-run preservation, actual deletion, and inventory reporting.

dimdasci added 2 commits May 15, 2026 16:16
- 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
@dimdasci
dimdasci merged commit e84f4d3 into main May 15, 2026
1 check passed
@dimdasci
dimdasci deleted the feat/cleanup-script branch May 15, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant