Edit package: clips, takes.csv, manifest (#66) #123

Merged
crowmaki merged 2 commits from issue-66-edit-package-clips into main 2026-10-09 18:01:05 +00:00
Owner

Closes #66. Part of #24.

What

The Export Section (/export) writes an Edit package: the picked Scenes' Takes in a folder an editor can import straight into Resolve. Timelines (#67) and re-sync / _Removed/ (#68) are later tickets.

  • Choosing what to export: a Scene picker (every Scene starts picked), a Circled Takes only filter, and a package folder that the Project remembers (schema step 37). Export reports progress clip by clip. Staleness never blocks export.
  • Layout: each Scene gets a bin named by its zero-padded frozen number and ASCII-safe place, for example 001 MARKS HOUSE - KITCHEN/. Inside it, each Setup gets a sub-bin of clips named like their Takes: 1A/1A-1.mov, and 1B/1B_1-1.mov for a Setup with several Shots. NG Takes are left out.
  • Clips: every clip is a .mov that starts at 01:00:00:00, with PCM audio.
    • A final is its stamped ProRes master, hard-linked from the media folder. If the link fails (for example, on another volume), it is copied.
    • A draft is remuxed: its H.264 picture is copied, and the job's audio is muxed in as pcm_s24le with the timecode.
  • takes.csv: UTF-8 and CRLF, with the Resolve test kit's header strings.
    • Tag=1 for circled Takes, blank otherwise, and never 2 or Good Take.
    • Description is the Setup's framing note. Keywords is draft or final, plus stale.
    • Comments holds the Take notes, with @3.2s prefixes on timecoded ones.
    • Custom columns: Seed, Profile, Pinned.
  • manifest.json: each Take's full recorded TakeDetail (composed prompt, slot inputs and their Lock snapshots, Generation profile, workflow id, version and hash, seed, and reroll and frame-from chain), plus the packaged Rendition's id, kind and blake3 hash.

Export follows the Bounce pattern. It is planned under the session lock, then written by ffmpeg outside it. Every file is written beside its place and then renamed into it.

Tests

crates/studio-core/tests/edit_package.rs drives ProjectSession against the fake ComfyUI and real ffmpeg. It checks:

  • the package tree;
  • Circled only;
  • script order;
  • takes.csv against a golden fixture in the Resolve kit's shape;
  • .mov, timecode and PCM on every clip, using ffmpeg probes;
  • that the final is hard-linked: an append to the master shows in the clip;
  • the manifest's inputs and hash;
  • the stale keyword;
  • progress;
  • that the folder is remembered across a reopen;
  • that a bad request is refused.

cargo test --workspace --all-features (802 passed), bun test src (245 passed), and bun run check (0 errors) all pass.

Screenshots

The Export Section. These were taken without ComfyUI, so the Project has no Takes and the export wrote 0 clips. Real clips are covered by the tests above.

Export section

After exporting

Not done, for review

  • The golden CSV is a committed fixture built in the Resolve kit's shape (scratch/resolve-test is gitignored). Importing it into Resolve is still a manual check.
  • The manifest records Lock snapshot and chain ids from TakeDetail, not copies of their content.
  • A Take with no audio file fails the whole export instead of being skipped. Every H3 job writes audio, so this shouldn't happen in practice.
Closes #66. Part of #24. ## What The Export Section (`/export`) writes an **Edit package**: the picked Scenes' Takes in a folder an editor can import straight into Resolve. Timelines (#67) and re-sync / `_Removed/` (#68) are later tickets. - **Choosing what to export:** a Scene picker (every Scene starts picked), a **Circled Takes only** filter, and a package folder that the Project remembers (schema step 37). Export reports progress clip by clip. Staleness never blocks export. - **Layout:** each Scene gets a bin named by its zero-padded frozen number and ASCII-safe place, for example `001 MARKS HOUSE - KITCHEN/`. Inside it, each Setup gets a sub-bin of clips named like their Takes: `1A/1A-1.mov`, and `1B/1B_1-1.mov` for a Setup with several Shots. NG Takes are left out. - **Clips:** every clip is a `.mov` that starts at `01:00:00:00`, with PCM audio. - A final is its stamped ProRes master, hard-linked from the media folder. If the link fails (for example, on another volume), it is copied. - A draft is remuxed: its H.264 picture is copied, and the job's audio is muxed in as `pcm_s24le` with the timecode. - **`takes.csv`:** UTF-8 and CRLF, with the Resolve test kit's header strings. - `Tag=1` for circled Takes, blank otherwise, and never `2` or `Good Take`. - `Description` is the Setup's framing note. `Keywords` is `draft` or `final`, plus `stale`. - `Comments` holds the Take notes, with `@3.2s` prefixes on timecoded ones. - Custom columns: `Seed`, `Profile`, `Pinned`. - **`manifest.json`:** each Take's full recorded `TakeDetail` (composed prompt, slot inputs and their Lock snapshots, Generation profile, workflow id, version and hash, seed, and reroll and frame-from chain), plus the packaged Rendition's id, kind and blake3 hash. Export follows the Bounce pattern. It is planned under the session lock, then written by ffmpeg outside it. Every file is written beside its place and then renamed into it. ## Tests `crates/studio-core/tests/edit_package.rs` drives `ProjectSession` against the fake ComfyUI and real ffmpeg. It checks: - the package tree; - Circled only; - script order; - `takes.csv` against a golden fixture in the Resolve kit's shape; - `.mov`, timecode and PCM on every clip, using ffmpeg probes; - that the final is hard-linked: an append to the master shows in the clip; - the manifest's inputs and hash; - the `stale` keyword; - progress; - that the folder is remembered across a reopen; - that a bad request is refused. `cargo test --workspace --all-features` (802 passed), `bun test src` (245 passed), and `bun run check` (0 errors) all pass. ## Screenshots The Export Section. These were taken without ComfyUI, so the Project has no Takes and the export wrote 0 clips. Real clips are covered by the tests above. ![Export section](https://git.crowmaki.me/attachments/a6477261-d7ba-4972-9f56-8974f2604f98) ![After exporting](https://git.crowmaki.me/attachments/cf5aa6c9-bdb4-491c-be8e-89ec536b7dac) ## Not done, for review - The golden CSV is a committed fixture built in the Resolve kit's shape (`scratch/resolve-test` is gitignored). Importing it into Resolve is still a manual check. - The manifest records Lock snapshot and chain **ids** from `TakeDetail`, not copies of their content. - A Take with no audio file fails the whole export instead of being skipped. Every H3 job writes audio, so this shouldn't happen in practice.
File > Export edit package writes the picked Scenes' Takes into a folder
an editor can take straight into Resolve. Each Scene gets a bin named by
its zero-padded frozen number and ASCII-safe place, with a sub-bin per
Setup of `12A-3.mov` clips (`12B_1-3.mov` for a segmented Shot). Every
Take that isn't NG and has a Rendition goes in, or only circled ones.
Staleness never blocks export.

A clip is the Take's stamped ProRes master, hard-linked from the media
folder when it can be and copied otherwise, or else its draft remuxed
into a .mov with the job's audio as PCM and a 01:00:00:00 timecode.
takes.csv carries the Resolve test kit's headers (Tag=1 for circled,
never 2, never Good Take) plus Seed, Profile and Pinned. manifest.json
records each Take's full recorded inputs and the packaged Rendition's id
and hash.

Export is planned under the session lock and written by ffmpeg outside
it, with progress per clip and every file moved into place whole. The
package folder is remembered per Project (schema step 37).

Co-Authored-By: Claude <noreply@anthropic.com>
Export lives in the Export Section at /export, as ADR-0006's route map
has it, instead of a File menu dialog. The Section reuses Block,
Checkbox and Button, and every Scene starts picked.

takes.csv's header sits beside the typed row it heads, a Take's clip is
built by one helper, the stamped-master path is shared with the
post-steps, and a Scene number that doesn't start with a digit is no
longer padded.

Co-Authored-By: Claude <noreply@anthropic.com>
crowmaki deleted branch issue-66-edit-package-clips 2026-10-09 18:01:05 +00:00
Sign in to join this conversation.
No description provided.