This repository was archived by the owner on Nov 15, 2026. It is now read-only.
Repository navigation
fix(motion-reel): refuse a frames run the disk cannot hold, encode videos via .part (TOM-1222) - #113
Merged
Merged
Conversation
…deos via .part (TOM-1222) render.py frames renders one sample frame, estimates the bytes all frames need (the larger of 1.25 bytes a pixel and twice the sample), and exits non-zero before it writes a frame when the filesystem cannot hold them with 1 GiB to spare. The message names the size it needs and the free size. encode.py encodes both videos to NAME-master.mp4.part and NAME.mp4.part, checks their frame counts there, and renames them over the final names only when both pass. A failed encode removes the partial files and keeps the previous videos; it no longer unlinks them first. Tests: scripts/test_motion_reel.py (stubbed page, disk_usage and ffmpeg). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FWReiQHtDMNfYNou9h55pq
…aming (TOM-1222 review) Review round 1 (both axes SHIP) minors: check_space runs before the old frames/ is deleted and counts it as reclaimable; encode parts use part_of() (x.part.mp4) like fresh(), so no -f flag; the docstring states the over-cap exception; tests cover a frame-count mismatch and old frames kept on refusal. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FWReiQHtDMNfYNou9h55pq
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Closes TOM-1222
What
render.py framesrenders one sample frame (the middle one, because frame 0 is often black). It then estimates the bytes all frames need: the larger of 1.25 bytes a pixel and twice the sample, times the frame count. It refuses with a non-zero exit when the filesystem cannot hold that with 1 GiB to spare. The message names the needed size and the free size. The check runs before the oldframes/is deleted, and it counts the old frames as reclaimable space.encode.pyencodes toNAME-master.part.mp4andNAME.part.mp4(onepart_of()helper, shared withfresh()). It renames both over the final names only after ffmpeg exits 0 and both frame counts pass. On any failure,finallyremoves the partial files. The previous videos are never unlinked first.references/pipeline.mdnames both behaviours.Tests
claude/skills/visual/motion-reel/scripts/test_motion_reel.py: 7 tests, all pass, with a stubbed page,disk_usageand ffmpeg. The tests do not run a real render.check_spaceremoved, this test goes red. Restored, it goes green.reel-master.mp4andreel.mp4stay byte-identical, and no part file is left. With no previous videos, no file exists under either final name.reel-master.mp4andreel.mp4.Review leftovers (round 2, MINOR/NIT only)
--max-mb, both complete videos replace the old ones and the run exits non-zero, as on main. Theencode.pydocstring states it.check_spacefollows symlinked files insideframes/when it counts reclaimable bytes.--nameending in.partcan collide with the part file of another name in the same project.🤖 Generated with Claude Code
https://claude.ai/code/session_01FWReiQHtDMNfYNou9h55pq
Review provenance
The in-session review axes, and the commit each one actually read. A verdict against a branch NAME has no referent — the name moves. Check freshness with
qute_review_freshness.py <owner/repo> <pr#>; it exits 1 when an axis is stale and 2 when it cannot tell.SHIP, reviewed atb518fbc2a16a9838ab1a9a01288b3fbfff7656e5, rangemain...HEAD, at2026-10-05T12:48:15+02:00