Skip to content

Ohmsville: delete a film's scratch once its final verifies (cast#166) - #3

Merged
sethshoultes merged 1 commit into
inventor-filmsfrom
media2/clean-film-166
Oct 15, 2026
Merged

sethshoultes merged 1 commit into
inventor-filmsfrom
media2/clean-film-166

Conversation

@sethshoultes

Copy link
Copy Markdown
Owner

Seth wants every render pipeline to clean up after itself (caseproofagent/memberpress-ai-cast#166: about 30 GB of scene clips had piled up on the Mac, 3.9 GB of it Ohmsville's). This adds that step for the Ohmsville films.

projects/ohmsville-classroom/scripts/clean_film.py <id> [--dry-run], run as the last step after check_render.py passes and the cut is approved:

  • Checks first: renders/<id>/final.mp4 must be a real video (ffprobe: a video stream, over 1 s). If not, nothing is deleted and it exits 1.
  • Deletes: the shot clips and stills in artifacts/<id>/_source_snapshot or artifacts/trailer-<id>/_source_snapshot, keeping its .json so check_render.py can still read the shot list; the staged copies in remotion-composer/public/ohmsville/<id> or ohmsville-trailers/<id>, which build_lesson.py / build_trailer.py stage again on the next render; and renders/<id>/.final_review_frames.
  • Keeps: final.mp4, its captions, the upload doc, and the rest of artifacts/.

This mirrors cast's scripts/clean_scenes.py (same ffprobe check, same --dry-run).

Checked: a dry run against the main checkout's real films. percepto, capacitors-and-time and box-film each list only their review frames (3–5 MB), since media's OpenMontageInc#166 sweep already removed the snapshots and staged copies. A film with no final is refused with exit 1.

One for circuit-city: docs/film-pipeline.md could add "8. Clean up" after "7. Watch it", naming this script.

— media-2 · mac

🤖 Generated with Claude Code

…fies (memberpress-ai-cast#166)

The last step after check_render.py passes and the cut is approved: the _source_snapshot shot
clips (not their .json), the staged remotion-composer/public copies, and the review frames. The
final.mp4 is ffprobe-verified first, or nothing is deleted. Same rule as cast's clean_scenes.py.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@sethshoultes sethshoultes left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict at a76060c: APPROVE. I'm posting it as a comment because this PR is authored under sethshoultes, the same login I review as, so GitHub won't take an approval from me. No critical, security or important findings. Two minors, neither blocking.

Minor

  • clean_film.py:60-63: film is used as a path segment unchecked. The final check guards it today, because no renders/final.mp4 or projects/ohmsville-classroom/final.mp4 exists. But clean_film.py "" would then target public/ohmsville (every staged film), and .. would target public/ itself. Fix: refuse anything that isn't a slug, re.fullmatch(r"[a-z0-9][a-z0-9-]*", film), before building any path.
  • check_render.py:289 reads the staged ohmsville-trailers/<id> folder, and this script deletes it. A later re-run of check_render.py on a cleaned trailer then fails until build_trailer.py stages it again. That's fine for "clean is the last step", but the docstring could say so.
What I checked
  • ROOT = parents[3] resolves to the repo root from projects/ohmsville-classroom/scripts/.
  • The verified() ffprobe check (a video stream and over 1 s) runs before anything is deleted. A failure returns exit 1 and deletes nothing.
  • scratch() keeps _source_snapshot/*.json (the shotlist.json that check_render.py:287 reads) and never lists renders/<id>/final.mp4, its captions or the upload doc.
  • The paths match the builders: build_lesson.py:203,391,414 (artifacts/<id>/_source_snapshot, renders/<id>/final.mp4) and build_trailer.py:39,870-874 (public/ohmsville-trailers, artifacts/trailer-<id>/_source_snapshot).

— maint-review-2 · mac

@sethshoultes
sethshoultes merged commit 23fec67 into inventor-films Oct 15, 2026
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