Skip to content

video_cut: ask whether a re-make draws frames, before running it (reelee#480) - #100

Merged
thorwhalen merged 2 commits into
mainfrom
feat/video-cut-reuse-predicate
Oct 13, 2026
Merged

thorwhalen merged 2 commits into
mainfrom
feat/video-cut-reuse-predicate

Conversation

@thorwhalen

@thorwhalen thorwhalen commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Adds braidio.transforms.video_cut_reuses_existing(project, skeleton): a free check, with no writes, that says whether executing a planned video_cut skeleton would reuse a cut already on disk or draw every frame again. On disk, reuse means a fresh equivalent, a re-verify in place, or an adopted cache hit.

Why: reeleehq/reelee#480. A surface that re-makes a commentary cut has to quote a caption fix (text pass only, seconds) separately from a camera or picture edit (every frame redrawn, minutes). Until now the answer was only available after the run, as rendered_frames.

How: _reuse is split into _reuse_candidate (the decision, read-only) and _reuse (applies it: re-verify or adopt). The quote and the run therefore read the same thing and cannot disagree. Behaviour of _reuse is unchanged.

Tests: test_the_reuse_quote_agrees_with_the_run_on_every_door covers five cases: a first render, an unchanged re-run, an editorial (caption) edit, a move edit, and a deleted file. In each case the quote is asked first, the test asserts it wrote nothing to the graph, then runs the same plan and checks the quote matched what happened. tests/test_video_transforms.py (82), test_downloads.py (51) and test_importing.py (93) pass.

Adversarial review

A fresh Opus reviewer found no confirmed bugs and its verdict was merge. It confirmed three things:

  • _reuse behaves exactly as before.
  • _reuse_candidate writes nothing.
  • The test fails under every predicate mutation that matters.

It raised three plausible items, all now addressed in a second commit:

  • The predicate now takes the same use_cache / force arguments as execute, so the quote matches the run by construction.
  • A skeleton that is not a video cut is refused with a ValueError.
  • The quote is documented as advisory, because a file deleted between the quote and the run changes the answer.

🤖 Generated with Claude Code

thorwhalen and others added 2 commits October 13, 2026 08:13
`video_cut_reuses_existing(project, skeleton)` answers, without writing,
whether executing a planned video_cut skeleton would reuse a cut on disk
(re-verify, adopt, or a fresh equivalent) or draw every frame again. It is
the decision `_reuse` makes, split out so the quote and the run read the same
thing: `_reuse` now applies `_reuse_candidate`'s answer.

First customer: reelee's per-cut re-make door (reeleehq/reelee#480), which
must quote a caption fix (seconds) apart from a camera edit (minutes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a non-cut skeleton

Review of #100 (plausible items): the quote now matches the run by construction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thorwhalen
thorwhalen merged commit 7afff81 into main Oct 13, 2026
12 checks passed
@thorwhalen
thorwhalen deleted the feat/video-cut-reuse-predicate branch October 13, 2026 08:35
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