Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.
docs(video-chain): section 9 of the video pipeline with what it takes from sprite-gen, that which faults refuse a frame is the caller's to read off the material, the routing table's video-chain and inspect-holds rows, the verb lists, and the CHANGELOG's Unreleased (v4.0.0) line
Soohong Kime22ff0e9bb59
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 1558035..b610336 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -41,6 +41,7 @@ All notable public changes to `sprite-gen` are recorded here. Versions track the- **New: `scene-render --fill-held auto` gives a layer cut from a filmed clip at the scene's times; the report gains `inspection.repeats` and `fill_held`; new `scene-render --between-cache DIR`.** By default, a layer whose asset is a cut of a filmed clip (a `video-loop` or `video-stop` strip, its sidecar names `source_cut`) and would show a cell again at the scene's frames (a 24 fps cut in a 60 fps scene, a `playback_rate` under 1) is given at the scene's times: each frame the cell its time falls on, or RIFE's frame between the two cells either side at its own time, judged as `video-loop` judges a frame made for a held cell. Held on purpose stays held: before the layer's start, a one-shot's end and `hold_last`, a run its strip lists in `holds`, and every layer that is not a video cut (a still, an atlas row, a pixel drawing), which holds its cells as drawn. A layer that shows no cell again keeps its cells as its timing picks them (at the strip's exact rate) and makes no frame; every strip's cells are now read at its exact rate, so a frame on a cell boundary of a 24, 60 or 15 fps strip can change (a 24 fps strip in a 20 fps scene showed frames 5, 10 and 15 as cells 5, 11 and 17 before, and now as cells 6, 12 and 18); strips at 25, 20, 30, 12 and 48 fps render byte for byte as before (pinned in tests). A frame between refused shows the nearer cell again and is named; with no RIFE installed the cells are given as cut and a warning names the frames and the install command; a RIFE that fails stops the render, naming `--fill-held off`. `--fill-held off` gives every layer's cells as its timing picks them. `inspection.repeats` is each layer's table of scene frames that show the cell the frame before shows: each run, the cell, whether it is held on purpose and why; `fill_held` is in the report. `--between-cache DIR` keeps the frames made between cells across renders, under the bytes of the two cells, the time and the RIFE that made them, and takes them from there on the next render; the report's `between_cache` counts hits and misses. Nothing is kept without it.- **New: `sprite-gen inspect-holds` (qa) reads a delivery for frames that show a figure's picture again and compares them with hold lists (`--holds`, `--gate`, `--key`, `--box`, `--log`, `--log-figure`).** It reads frames with alpha, a keyed clip with `--key`, a figure's box with `--box`, or a renderer's log of cells with `--log` and `--log-figure`, with the same rule as `held_fill.same_steps` on the figure's pixels. It compares them with hold lists (`--holds`, a strip's `holds`, the list form a renderer uses) and reports listed and unlisted holds; `--gate` exits 1 where any hold is on no list. A render that draws a figure at a new scale or sub-pixel place on every frame is read by its `--log`. Its full documentation is `docs/asset-tools.md` "Frames shown again".- **Fixed: `inspect-holds` reads a frame's largest part as a figure however few pixels it has, reads nothing in a `--box` that holds no pixel, exits 2 where no frame was read against the frame before, and reports `steps` and `inspected`; the Grok clip reading of `video`, `video-extend`, `video-edit` and `video-resume` does not read a clip whose every frame is the canvas alone.** A part is a speck, and is not read, where it holds under 2 % of the pixels of the frame's largest part, or under 64 px; the 64 px floor applied to every part, the frame's largest included, so a frame whose only figure had under 64 px read no figure at all: a 7 x 9 block (63 px) shown on three identical frames of a 24 x 24 clear canvas read an empty table and `--gate` exited 0 with nothing on stderr, although its frames 1 and 2 show the picture of the frame before, where an 8 x 8 block (64 px) read 2 unlisted holds and `--gate` exited 1. Now the 64 px floor is never more than half the frame's largest part, so the largest part is always a figure and a part half its size or more is a figure too (two small figures in one frame are both read); both blocks read 2 unlisted holds (frames 1-2) and `--gate` exits 1, and where a frame's largest part has 128 px or more the rule is exactly what it was. Dots of 1, 2 and 3 px far from the figure, the same on every frame, are still not read. With `--box`, two frames whose box held no pixel with alpha over 8 (clear there, or past the frame's edge) read as one picture shown again, so a box over clear frames, or past the frame's edge, read a hold on every frame after the first; now such a frame shows no figure there and two such frames are no picture shown again. The report gains each figure's `steps` (its frames read against the frame before; on a loop read across its wrap, the wrap is one step) and `inspected` (the number of figures read on one step or more); the other fields are unchanged, exit 0, 1 and 2 keep their meanings, and a reading that reads no frame against the frame before is now one of the errors (exit 2). A reading that reads no frame against the frame before (no frame: an empty folder, `--frames` that starts past the last frame of a folder, a video, a strip or a log, a log of no line; no figure on any frame: clear frames, frames whose every pixel has alpha 8 or under, a key that leaves nothing, a box that holds nothing, a log whose `--log-figure` keys name no cell on any line; no figure shown on two frames in a row, for example one frame) is an error: it exits 2 with or without `--gate`, its report is still printed on stdout and written to `--report` with `inspected` 0, and one line on stderr says why. Before, most of these passed `--gate` (exit 0, an empty table, nothing on stderr); an empty folder and a log of no line exited 2 but printed no report; a strip given `--frames` past its last cell was refused with the wrong reason (as opaque frames); a box over nothing failed the gate on frames that showed nothing. In Python, `inspect(...)` and `read(...)` in `sprite_gen.qa.holds` raise `NothingRead`, a `ValueError` whose `report` attribute is the report, with `inspected` 0. The Grok clip reading of `video`, `video-extend`, `video-edit` and `video-resume` read a clip whose every frame is the canvas alone (no pixel left once the canvas colour is taken out) as one run of all its frames, recorded as a hold the motion means, and said nothing; now such a clip is not read, its report's `held` is `read` false with `frames`, `background` and a `why`, the warning line says its frames were not read for a picture shown again, and the clip is still published.+- **New: `sprite-gen video-chain` plays pieces of keyed clips as one move at the caller's time (`--piece`, `--bridge`, `--out-fps`, `--places`, `--holds`, `--refuse`, `--fill-held`, `--gate`).** It joins keyed clips of matching canvas, key and rate, making frames between join points or retimed places with RIFE. A run of frames showing one picture, unless a list of holds meant names it, is made again between the poses beside it, and any unlisted frame showing the picture before it fails the run. Pieces that disagree in size, key, or rate, opaque frames, overlapping paths, or places off the chain refuse the run before anything is touched. By default every fault the judge finds refuses a frame; `--refuse` names those that do; which to leave out is the caller's to decide by looking at the material; `held`, the bar a frame made off its time must stand under and the final reading refuse whatever it says; a fault left out stays on the frame's record and a `warning:` line; the judge and its bars do not change. `held_fill` gains `FAULTS` and a `refuse` argument on `at_times` and `fill`, `loop.fill_cut` gains `refuse`, `frames` gains `KEYS_READ` and `key_kind`, a `held_fill` try gains `judged` and, with `refuse`, `kept_faults`, and the `video-frames` report gains `key_read`.- **Python callers.** `held_fill`: new `wrap_same`, `KEEPS`, `intended`, `again`, `strip_holds`; `premultiplied` (was `_premultiplied`); `fill(..., wrap=, drawn_on=)`; `reading(..., wrap=)`. `loop`: new `cut_again`; `fill_cut`, `fill_lines`, `out_fps_lines` (were `_fill_held`, `_fill_lines`, `_out_fps_lines`). `align`: new `filled`, `unfilled_source`, `CUT_AGAIN_DIR`; `align_set(..., fill_held=, out_fps=)`. `batch`: new `held_summary`, `loop_summary`, `cut_again_unaligned`; `align_gaits(..., fill_held=, out_fps=)`. `spec.assets`: new `frame_seconds`, `SNAP_MS`, `FrameSequence.index_at`. `scene.render.Renderer(..., fill_held=, interpolate=, between_cache=)`. New module `sprite_gen.qa.holds`. `stop.make_stop(..., fill_held=, interpolate=)`.- **Tests: `tests/video/test_no_repeat_default.py`, `tests/scene/test_scene_fill_held.py`, `tests/qa/test_inspect_holds.py`, `tests/gen/test_video_held.py`, `tests/video/test_face_bake_held.py` (new); `tests/video/test_held_fill.py`, `tests/video/test_stop.py`, `tests/video/test_face_layer.py`, `tests/video/test_root_motion.py`, `tests/video/test_loop_prop_seam_held.py`, `tests/video/test_motion_anchor.py` (changed).** `test_no_repeat_default.py` covers a loop's last cells, a cut one cell too long, the read again after the repairs, the strip's `holds`, `cut_args` and `cut_again`, the lifetime warning, the alignment's end fill, its cut again with the fill off and its refusal, `--out-fps` once aligned, a set with no held cell aligned as before, and `video-set` cutting aligned items as filmed and cutting again the ones no alignment took. `test_held_fill.py`'s wrap tests: a run at a loop's wrap is made, a last cell showing the first again is made and the first kept, a hold across the wrap longer than three cells kept whole, a cut played once reads no wrap. `test_stop.py`: the stop fills by default; with no held cell and with `--fill-held off` it is the pictures pinned before. `test_face_layer.py`, `test_root_motion.py` and `test_loop_prop_seam_held.py`: the strip metadata grows `fps` and `holds`, the old pins otherwise unchanged. `test_motion_anchor.py`: its anchored cells 5 to 7 differ by one pixel, so the test cuts with `--fill-held off` to check the anchor's own cells. No-repeat outputs keep their pictures: the six cuts pinned before, a stop with no held cell, a set aligned with no held cell (pinned on commit 4f5ccd5) and scenes at 25, 20, 30, 12 and 48 fps.diff --git a/SKILL.md b/SKILL.mdindex eb7cb90..58ba1f4 100644--- a/SKILL.md+++ b/SKILL.md@@ -99,6 +99,7 @@ front-facing observations also remain unchanged. Mirroring does not preserve lef| Where an ellipse is carried in every other cell, and what the move changes there (an arm crossing a chest moves with it; the stretch, the bend and the seam): a record and boards of every cell, nothing moved; a seam under a third moving region is not counted | `video-sway-inspect` (old name `video-follow-inspect`) | [video-pipeline](docs/video-pipeline.md#inspecting-a-sway--video-sway-inspect) || A set's directions on one sheet, standing on one ground line (a 3×3 board, an engine import) | `video-set-sheet` | [video-pipeline](docs/video-pipeline.md#7-one-sheet-for-a-set--video-set-sheet) || A walk or run that stops, from the clip's own start played backwards | `video-stop` | [video-pipeline](docs/video-pipeline.md#8-a-walk-or-run-that-stops--video-stop) |+| Pieces of keyed clips on one canvas played as one move, at the time the caller gives | `video-chain` | [video-pipeline](docs/video-pipeline.md#9-pieces-of-clips-played-as-one-move-video-chain) || Build a talking lower-face pack anchored to every frame of body motions from a reference and keyed clips. | `video-face` | [face-parts](docs/face-parts.md) || Bake a voice and the pack's face layer onto body frames, optionally after a clip's own mouth and sound. | `face-bake` | [face-parts](docs/face-parts.md#face-bake) || Compare the currently displayed loop with a final candidate, including after follow-through | `video-loop-compare` | [loop-comparison](docs/loop-comparison.md) |@@ -118,6 +119,7 @@ front-facing observations also remain unchanged. Mirroring does not preserve lef| Props or icons on a transparent sheet | `slice-sheet --chroma-key none --alpha-floor 64`, props with `--scale sheet --fit contain`, icons with `--fit contain` | [sheet-slicing](docs/sheet-slicing.md#props-and-icons-sheet-scale-and-contain-fit) || Standalone projected shadow | `shadow` | [asset-tools](docs/asset-tools.md#projected-shadows) || Duplicate poses, foot contact and stride measurement | `inspect-motion` | [asset-tools](docs/asset-tools.md#motion-and-contact-evidence) |+| Read a delivery for frames that show a figure's picture again and name them against hold lists | `inspect-holds` | [asset-tools](docs/asset-tools.md#frames-shown-again) || Optional scene placement, lighting, camera and render | `scene-render`, `scene-inspect` | [scene](docs/scene.md) || What the engine can do, for an agent or a tool to read once: every verb and argument, the providers each may call and be billed by (one JSON line, a quarter of every `--help`); a sandbox that reaches the providers through a relay: `SPRITE_GEN_<PROVIDER>_BASE_URL` (`OPENAI`, `XAI`, `ANTHROPIC`) moves a provider's calls and the files it hands back, `SPRITE_GEN_LOGINS=off` runs every call on its API key | `capabilities` | [capabilities](docs/capabilities.md), [provider addresses](docs/gen.md#provider-addresses) || Defaults | `defaults show`, `defaults save` (`--codex-unavailable ask\|grok\|openai`: what to do when codex cannot run), `defaults clear` | [user-workflow](docs/user-workflow.md#one-settings-owner) |diff --git a/docs/README.md b/docs/README.mdindex 936ee74..05c9f10 100644--- a/docs/README.md+++ b/docs/README.md@@ -40,7 +40,7 @@ flowchart LR| Pipeline / tool group / workflow | Entry doc | Verbs ||---|---|---|| **A · atlas rows** — one still becomes a runtime sprite sheet | [run-contract.md](run-contract.md) | `prepare` → `gen` / `gen-set` → `extract` → `compose-atlas`; optional `curation` and recompose |-| **B · video → loop** — one still becomes transparent motion loops | [video-pipeline.md](video-pipeline.md) | `video-canvas` → `video` (or `video-prompt` and a video MCP on your agent) → `video-frames` → `video-loop`, `video-set`, `video-cycle-align`, `video-sway`, the Sway layer (`video-sway-inspect` shows every cell of it and moves nothing; old names `video-follow`, `video-follow-inspect`), `video-set-sheet` (a set's directions on one sheet, on one ground line), `video-stop` (a walk or run that stops, from the clip's own start played backwards); `handed-check` for an item on one side; obstacle plate painted and erased (`--prop-plate`) |+| **B · video → loop** — one still becomes transparent motion loops | [video-pipeline.md](video-pipeline.md) | `video-canvas` → `video` (or `video-prompt` and a video MCP on your agent) → `video-frames` → `video-loop`, `video-set`, `video-cycle-align`, `video-sway`, the Sway layer (`video-sway-inspect` shows every cell of it and moves nothing; old names `video-follow`, `video-follow-inspect`), `video-set-sheet` (a set's directions on one sheet, on one ground line), `video-stop` (a walk or run that stops, from the clip's own start played backwards), `video-chain` (pieces of keyed clips on one canvas played as one move, at the time the caller gives); `handed-check` for an item on one side; obstacle plate painted and erased (`--prop-plate`) || **C · utilities** — imported images in, clean cuts out | [sheet-slicing.md](sheet-slicing.md) | `cutout`, `slice-sheet`, `unpack-atlas` || **D · post-processing** — finished sheets, refined | [recolor.md](recolor.md) | `recolor`, `recolor-palette`, breathing (compose, or `breathe` on a folder of frames), `export-pngs`, `export-aseprite` || **E · asset tools** — independent background, shadow and motion tools | [asset-tools.md](asset-tools.md) | `background-tile`, `shadow`, `inspect-motion`, `inspect-holds` |diff --git a/docs/loop-repair.md b/docs/loop-repair.mdindex 9e6f769..9a56672 100644--- a/docs/loop-repair.md+++ b/docs/loop-repair.md@@ -3499,6 +3499,7 @@ Where sprite-gen gives frames at a higher rate than it was given them:| `video-stop --fps` | The rate of the frames given, not an output rate | Unchanged; a stalled stop's held cells are made again by default (`video-stop --fill-held auto`) || `video-cycle-align --out-fps F` | None (new) | Every loop of the set at F, above the loops' own rate, once aligned: each cell at its own time, made between the cells beside it, never a cell shown again, every loop the same number of cells; `out_fps` and `source_fps` in the strip metadata; a rate not above the loops' own is refused; a loop already aligned at a higher rate is aligned again from its `cycle.source/` at its source rate || `video-set --out-fps` with an aligned set | Refused | The aligned walks and runs are given it once aligned (`video-cycle-align --out-fps`), the rest by `video-loop --out-fps` |+| `video-chain` (new) | None | RIFE's frames between, never a frame shown again on no list, under [video-pipeline.md section 9](video-pipeline.md#9-pieces-of-clips-played-as-one-move-video-chain) |### What it takes from sprite-gendiff --git a/docs/run-contract.md b/docs/run-contract.mdindex 5ea12b2..4e11d95 100644--- a/docs/run-contract.md+++ b/docs/run-contract.md@@ -271,6 +271,7 @@ path that only passes through an output and comes out of it again with `..` (for| `unpack-atlas` | see section 4 | the run dir, whose prior content `--force` replaces; an `--out-dir` inside an input is refused as well || `video-loop` | `--frames-dir` and every PNG found in it | `cycle/`, `cycle.source/`, `cycle.refused/`, `follow.source.png`, `<name>.strip.png`, `<name>.strip.json`, `<name>.gif`, `<name>.webp`, the report || `video-stop` | `--frames-dir` and every PNG found in it; `--loop` and the strip PNG beside it | `<name>.strip.png`, `<name>.strip.json`, `<name>.gif`, `<name>.webp`, the report |+| `video-chain` | Each `--piece`'s folder; `--places`; `--holds` | `keyed/`, `keyed.refused/`, the report || `video-frames` | `--clip`, `--reference` | `raw/` (its frames are replaced), `keyed/`, `keyed.refused/`, the report, `--source-manifest` || `correction-loop` | `--run-dir`, and every file, folder and link the best candidate's copy reads in it | `--out-dir` and everything the loop writes in it: each attempt's folder and the files in it, each candidate a provider makes, `best-candidate/`, the report || `logo` | `--mood`, `--lettering` | `lettering.png`, `logo.png`, `logo.rejected.png`, `logo.preview.png`, `mood.png` (when the run writes one), the report |diff --git a/docs/video-pipeline.md b/docs/video-pipeline.mdindex 52694ce..edf9dae 100644--- a/docs/video-pipeline.md+++ b/docs/video-pipeline.md@@ -26,6 +26,7 @@ still ──video-canvas──▶ canvas.png ──video──▶ clip.mp4 ─| `sprite-gen video-sway-inspect` | `sprite_gen/video/sway_inspect.py` | a loop directory + the ellipses `video-sway` takes -> a record of where each is carried in every cell and what the move changes there, and two boards of every cell; the loop directory is only read ([section 6](#inspecting-a-sway--video-sway-inspect)) || `sprite-gen video-set-sheet` | `sprite_gen/video/set_sheet.py` | the loop directories of one set, each with its `--view` → one sheet: a row per direction in compass order, one cell size, one ground line, every row as cut, + a record and an optional centre picture; the loop directories are only read ([section 7](#7-one-sheet-for-a-set--video-set-sheet)) || `sprite-gen video-stop` | `sprite_gen/video/stop.py` | keyed frames + a walk or run loop → one-shot stop strip (`loop: false`, `hold_last: true`), GIF, WebP, report ([section 8](#8-a-walk-or-run-that-stops--video-stop)) |+| `sprite-gen video-chain` | `sprite_gen/video/chain.py` | pieces of keyed clips on one canvas played as one move, at the time the caller gives → `keyed/`, `chain.report.json` |## 1. Canvas — the input frame decides the output frame@@ -1142,6 +1143,53 @@ sprite-gen video-stop --frames-dir run/frames/keyed --loop run/loop/run.strip.jsThe outputs are `<name>.strip.png`, `<name>.strip.json`, `<name>.gif` (plays once), `<name>.webp` (plays once), and `<name>.stop.report.json` (or `--report PATH`).+## 9. Pieces of clips played as one move: `video-chain`++Pieces of keyed clips on one canvas played as one move, at the time the caller gives. A cut joined from several clips is otherwise put together by hand by the user of the engine. The caller says what only the scene knows. Where the pieces join: a pose alike does not tell a join, a body is joined where its path goes on. When each frame shows: the time is read off a camera and an eye. The engine picks neither. It makes the frames between, judges them, shows no picture again and writes the record. This example joins an over clip and a run clip with a one-frame bridge, a place list, and a list of holds meant:++```bash+sprite-gen video-chain --piece over=clips/over:0:45 --piece run=clips/run:12:70 --bridge 1 \+ --places places.json --key green --fps 24 --holds meant.holds.json --refuse ghost,hole,doubled,held --out-dir chain+```++- **The pieces.** `--piece NAME=DIR:FROM:TO`, repeated, gives the pieces in the order they play: frames FROM..TO, both in, counted from 0 in name order, of the keyed PNGs in DIR or DIR/keyed. The pieces are one canvas, one key and one rate, or the chain is refused (exit 2, nothing touched): every frame the same size; every piece keyed the same way; one rate. Each is read from the `frames.report.json` `video-frames` wrote beside `keyed/` (its report now names the key it read, `key_read`, whichever `--key` it was given; a report that says only `auto`, an older one, speaks for no key), or given with `--key` (green, magenta, white, brightness) and `--fps` for a piece no report speaks for. A report that disagrees with `--key` or with another piece refuses the chain. A piece no report and no flag speaks for is refused. A piece whose frames are opaque is refused: a chain is of keyed frames.+- **The chain and bridges.** The chain is the frames of the pieces in turn, numbered from 0. `--bridge K` makes K frames between a join's two frames, at k/(K+1), and they take places on the chain. Once for every join, or once per join in order.+- **The time.** The time is one of three. By default, the chain runs at its own rate. `--out-fps F` resamples it evenly from its first frame to its last (it needs the pieces' rate). `--places FILE` is a JSON list, or an object's `places`, of a place on the chain for each frame delivered; a place off the chain is refused before anything is touched.+- **Frames between.** A place between two frames is made between them with RIFE and judged as `video-loop` judges a frame it makes (`held_fill.judge`), and made again at another fraction of `align.RETIME_T` within half the place's spacing where it is refused. A place no frame made is taken for is the nearer frame, named on a `warning:` line and in the record.+- **No picture shown again.** The frames delivered are read (`held_fill.same_steps`), and each run of frames showing one picture that the list of holds meant does not name is made again between the poses beside it, as `video-loop` makes a cut played once ([loop repair](loop-repair.md) section 7). The same rules keep a run longer than three frames, the chain's opening pose and its closing pose. `--fill-held off` makes none. A piece drawn on twos or threes (`held.measure` on its own frames) is not filled. `--holds FILE` is a list of holds meant in the format `inspect-holds` reads ([asset tools](asset-tools.md#frames-shown-again)), frames counted on the frames delivered: a hold on it stays and is never made away. Then the frames are read as `inspect-holds` reads a delivery (`qa.holds.inspect`): a frame still showing the picture before it, on no list, fails the chain by its number, exit 1, its frames left in `keyed.refused/` and no `keyed/` handed over. List a hold meant, or change the places or the pieces.+- **The faults that refuse a frame.** By default every fault the judge can find refuses a frame: `smear`, `outline`, `ghost`, `torn`, `hole`, `doubled`, `contact`, `held`. `--refuse FAULT,FAULT` names those that refuse. Which faults to leave out is the caller's to decide by looking at the material, as the time of a scene is; the engine does not pick. An example of why: art painted without a line reads as outline loss on every frame RIFE makes, since the dark line judges alone there, where it may be the material's own and no fault in it. The judge and its bars do not change. A name that is no fault is an error, exit 2. Three things refuse whatever `--refuse` says: `held` (a frame that shows a picture beside it is no frame between), the bar a frame made off its own time must stand under (`align.RETIME_WINDOW_MAX`), and the final reading. A fault found and not refused stays on that frame's record (`kept_faults`) and on a `warning:` line naming the frames. The record opens with the faults this run refused for (`refuse`).+- **No RIFE.** With no RIFE installed, a frame to make takes the nearer frame, with a `warning:` line naming the install command, and the record says so (`rife`). `--gate` fails it, exit 1. A chain with nothing to make needs no binary and says nothing. A RIFE that is installed and fails is an error, exit 2.+- **A chain that reads nothing.** A chain that reads nothing is an error, exit 2, never a chain with none shown again: no piece draws a figure, no frame read against the frame before (a chain of one frame), or none of its joins can be read. One join that cannot be read beside others that can is a `warning:` line.+- **Outputs and exit codes.** The outputs are `keyed/` (`frame-0001.png` on, a frame of a piece byte for byte as it came, a chain with nothing to make being copies of its frames), or `keyed.refused/`, and the report. An earlier run's `keyed/` and `keyed.refused/` are removed when the frames are read to be made, so a failed run hands over no old frames. Inputs and outputs that overlap are refused. The exit codes are 0 on success, 1 where a frame shown again is on no list (or `--gate` with no RIFE), and 2 on an error.+- **The record.** The report is `chain.report.json` (or `--report PATH`). It records `refuse`, `key`, `canvas`, `fill_held`, `gate`, and `pieces`. Under `joins`: each join's `from` and `into`, its pose distance `steps` in steps of the two pieces (the median step between their neighbouring frames, on the pose reading `video-stop` uses, `gait_fallback.poses`), and `closer`: the frame pairs within `--near` frames of it (default 6) whose poses are closer, nearest first, at most 5, with `closer_found` counting them all (these are told and never taken; `reads` false with `why` where it cannot be read). Under `chain`: `frames`, each piece's places, and `bridges`. Under `time`: the time settings. Under `frames`: each frame's `frame`, `place`, `source` (`{piece, frame}`, or `{between: [a, b], t}`, with `bridge: true` for a join's), its judged values (`judged`), its refused tries (`refused`), `kept_faults` and `nearer_frame` where they apply. It also records `held_fill`, `interpolator`, `drawn_pieces`, `holds`, `read` (the final reading), `rife`, `status`, `warnings`, and `error`.++### What it takes from sprite-gen++`video-chain` plays pieces of keyed clips as one move, using sprite-gen's existing rules where they answer a question the verb asks. A part that is its own says why.++| Part | Taken from | Owner of the rule |+|---|---|---|+| A frame at a place between two frames, and its tries | `held_fill.at_times`; the fractions and the bar, `align.RETIME_T`, `align.RETIME_WINDOW_MAX` | [loop-repair.md](loop-repair.md) section 7 |+| The judge | `held_fill.judge`, unchanged | [loop-repair.md](loop-repair.md) section 4 for the faults |+| A run made again and what is kept | `loop.fill_cut`, `held_fill.fill`, its lines `loop.fill_lines` | [loop-repair.md](loop-repair.md) section 7 |+| One picture or two | `held_fill.same_steps` | [loop-repair.md](loop-repair.md) section 7 |+| An even resample | `held_fill.times` | [loop-repair.md](loop-repair.md) section 7 |+| The final reading and the hold lists | `qa.holds.inspect`, `alpha_figures`, `read_lists`, `for_scene`, `NothingRead` | [asset-tools.md](asset-tools.md#frames-shown-again) |+| A piece drawn on twos or threes | `held.measure` | [loop-repair.md](loop-repair.md) section 7 |+| Pose distance | `gait_fallback.subject_boxes`, `gait_fallback.poses` | Section 8 of this document (`video-stop`) |+| RIFE located once a frame is asked for, and its install line | `loop._located`, `rife.RifeNotInstalled`, `rife.install_command` | |+| Overlapping inputs and outputs, the refused folder | `runio.refuse_overlap`, `frames.refused_dir` | [run-contract.md](run-contract.md) |+| The report's identities | `evidence.engine_identity`, `evidence.source_identity`; `loop.write_loop_report` | |++| Part | Why it is new |+|---|---|+| Reading a piece and refusing several that differ (`read_piece`, `_one_key`, `_one_rate`, `_canvas_and_box`) | No other verb takes frames from several folders. |+| The join's reading (`read_join`) | `video-stop` reads one distance to a loop, and nothing looks at frame pairs either side of a join. |+| The nearer frame with no RIFE (`_nearest`) | `held_fill.at_times` needs an interpolator. |+| Each place's spacing (`_spacing`) | `held_fill.upsample` has one rate, a list of places has none. |+| Which faults refuse (`held_fill.FAULTS`, the `refuse` argument through `held_fill._made`, `at_times`, `fill` and `loop.fill_cut`) | The judge had no way to hear what a caller knows of a material. None leaves every other verb as it was. |+| `video-frames`' `key_read` (`frames.key_kind`, split out of the function that read it) | A report that said only `auto` did not say what the frames were keyed on. |+## Related- [docs/README.md](README.md) — documentation index