Skip to content
This repository was archived by the owner on Nov 15, 2026. It is now read-only.

fix(motion-reel): refuse a frames run the disk cannot hold, encode videos via .part (TOM-1222) - #113

Merged
tomlupo merged 2 commits into
mainfrom
fix/tom-1222-motion-reel-disk
Oct 5, 2026
Merged

tomlupo merged 2 commits into
mainfrom
fix/tom-1222-motion-reel-disk

Conversation

@qute-coder

@qute-coder qute-coder Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Closes TOM-1222

What

  • render.py frames renders 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 old frames/ is deleted, and it counts the old frames as reclaimable space.
  • encode.py encodes to NAME-master.part.mp4 and NAME.part.mp4 (one part_of() helper, shared with fresh()). It renames both over the final names only after ffmpeg exits 0 and both frame counts pass. On any failure, finally removes the partial files. The previous videos are never unlinked first.
  • references/pipeline.md names both behaviours.

Tests

claude/skills/visual/motion-reel/scripts/test_motion_reel.py: 7 tests, all pass, with a stubbed page, disk_usage and ffmpeg. The tests do not run a real render.

  • (a) A disk too small exits non-zero before any frame is written or deleted, and names 12.6 GiB needed and 1.0 GiB free. With check_space removed, this test goes red. Restored, it goes green.
  • (b) A stub ffmpeg writes partial bytes and exits 1. The previous reel-master.mp4 and reel.mp4 stay byte-identical, and no part file is left. With no previous videos, no file exists under either final name.
  • (c) A normal encode writes reel-master.mp4 and reel.mp4.
  • A frame-count mismatch keeps the previous videos.

Review leftovers (round 2, MINOR/NIT only)

  • MINOR: pipeline.md does not state the over-cap exception. When the share copy stays over --max-mb, both complete videos replace the old ones and the run exits non-zero, as on main. The encode.py docstring states it.
  • NIT: check_space follows symlinked files inside frames/ when it counts reclaimable bytes.
  • NIT: a --name ending in .part can collide with the part file of another name in the same project.
  • Accepted: the estimate is conservative (2x the sample) and has no override flag.

🤖 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.

  • standards — verdict SHIP, reviewed at b518fbc2a16a9838ab1a9a01288b3fbfff7656e5, range main...HEAD, at 2026-10-05T12:48:15+02:00

tomlupo and others added 2 commits October 5, 2026 12:43
…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
@qute-coder
qute-coder Bot requested a review from tomlupo October 5, 2026 10:48
@tomlupo
tomlupo merged commit abb6fb0 into main Oct 5, 2026
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant