Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.
release: 2.39.0 candidate — source restoration, verified jump repair, follow inspection
Soohong Kim3b0ff0a61562
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 96ef374..afe1e93 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,11 +2,21 @@All notable public changes to `sprite-gen` are recorded here. Versions track the `version:` field in `SKILL.md` and `pyproject.toml`.-## Unreleased-+## v2.39.0 - A damaged cell is restored from its own source frame; a faulty in-between is no longer adopted; a follow-through is shown in every cell++- **Output change: a jump repair adopts RIFE's in-between only when it has no interpolation fault.** In a walk or run loop (`video-loop --repair auto|on`), the frame that breaks a jump used to be replaced by whatever RIFE drew between its two neighbours. RIFE's frame is now a proposal, measured against those neighbours with `rife.smear` and adopted only without a fault: a smear inside the body (`dark_excess` over 0.001), a lost outline (`outline_loss` over 0.05) or an empty frame keeps the filmed frame. These are the bounds cycle alignment already used, now one policy for both (`sprite_gen/video/interpolation_quality.py`). The limit of 3 (`MAX_REPAIRS`) counts interpolation calls, rejected proposals included; a rejected target is not tried again in that run, and a target next to a frame already made is skipped while an independent one remains, where it used to end the search. The report's `jump_repair` adds `attempts`, `blocked` and, per round, `target`, the `original` and `proposal` measurements, `faults` and `outcome` (`accepted` or `rejected`). A rejection keeps the filmed frame and its jump: it is not a verdict on the loop. [docs/loop-repair.md](docs/loop-repair.md).+- **Output change: a loop records the source it was cut from.** `video-loop`'s report adds `source` (one sha256 over the ordered keyed PNGs' own sha256s, their count and the fps, read before cleanup, size hold and anchoring), `producer` (a fingerprint of the measuring code), for a walk or run `gait` (cut-local silhouette signals, `status: "unverified"`: they do not identify the character's own feet), and under `--anchor none` or `body` `source_projection` (the cleanup recipe, the body ramp and each frame's pixel digest before the jump repair). The strip's meta adds `sample_indices`, `source_rect` (null under `--anchor feet`) and `source_cut` (the source, the cut's start and length, and the source frame of each cell). The cells, the GIF and the WebP are what 2.38.0 writes but for the jump repair above.+- **New `sprite-gen video-loop-compare`: the loop shown now against a candidate, read from the final files.** It reads each side's final strip and meta (after `video-follow`, if that ran) and its loop report for provenance only, never for a seam score or a pass, and writes a `sprite-gen-video-loop-comparison` (schema 1, `same-sample-defects-v1`): the sha256 and size of every file as given, a digest of the decoded cells, and per axis the two values and whether they compare. It orders only defects measured at the same source samples, timing, crop and scale: smear and outline loss frame by frame against each frame's actual neighbours, without averaging a worse frame away, and the seam over the native canvas; a worse axis is `regressed`. `improved` also needs every sample's coverage byte for byte the same, and colour changes only in frames that failed the interpolation bounds and now pass them. Another cut, an aligned strip without a proven source mapping, missing or inconsistent evidence and changed coverage are `unknown`; equal pixels and timing are `non_regressing`, never `improved`; the gait stays `unverified`. Every verdict, `unknown` included, exits 0; invalid input, disagreeing geometry and I/O failures are errors. An application that replaces a result on its own should take only `improved`. [docs/loop-comparison.md](docs/loop-comparison.md).+- **New source restoration: `video-source-manifest`, `video-frames --source-manifest`, `video-loop-repair`, and `video-loop-compare` given the origin and the source.** A cell the loop report lists as made by the jump repair, which carries a smear or outline fault that the source frame at the same time does not, is rebuilt from that source frame, with no interpolation. In that cell a pixel that differs from the source becomes the source's, unless the source's pixel would raise the key-colour guard there: where that excess is exactly one step that the cell's resample made out of source pixels with none, the source's pixel is written with the keyed channels one step lower and its own coverage; anywhere else the delivered pixel stays, and if that leaves a coverage the source does not have, the proposal ends `unknown` and writes nothing. Nothing is blended, moved or taken from another frame; the cut, the metadata bytes, every other cell and the GIF and WebP schedules stay as delivered. `video-source-manifest` (or `video-frames --source-manifest` with `--reference`) receipts the clip, the canvas, the frames report, the ordered keyed PNGs and the clip's presentation timestamps. `video-loop-repair` takes the current five files (strip, meta, loop report, GIF, WebP), the origin's (the five the first restoration started from; on a first request the same five again) and the source, and writes one candidate into a new `--out-dir` and a repair report, for one of up to three independent cells (`--proposal-index`). Every request rebuilds the current loop from the origin and the source and recomputes the receipt kept in the loop report rather than trusting it. `video-loop-compare` with the same origin, source and repair evidence measures the five final files again: `improved` needs the one changed cell to be exactly that copy with the source's coverage, a measured fault cleared, no other cell, metadata byte or playback interval changed, and no protected axis worse; key excess is counted per pixel, so less of it elsewhere does not hide new spill. A correspondence the engine cannot prove exactly (legacy evidence it cannot explain, a follow-through, cycle alignment, size hold, motion anchoring) is `unknown`, not a guess; source, origin or evidence files that are missing or changed are an error. Only a final `improved` is grounds to adopt a candidate. Repair report schema 3, comparison schema 4, metric `source-restoration-v3`, policy `key-protected-source-copy-one-step-cap-v1`; evidence of the two unreleased drafts (`source-restoration-v1`, `-v2`) is refused, never read as v3. The cell resample is unchanged and caps nothing; it now publishes the source pixels each cell pixel is mixed from (`resample.mix_windows`), which the restoration reads. [docs/loop-comparison.md](docs/loop-comparison.md#restoring-the-active-cut-from-source).+- **A synthetic example, end to end: `scripts/dev/source_restoration_demo.py`.** It draws a small walker (twelve keyed frames at twice the cell's size, and a clip of them over green for real timestamps) and a stand-in for a delivered loop whose cells 4 and 9 are in-betweens that melted: outline and two-colour belt drawn in the body's colour, feet a pale ghost. From there only the verbs above run: `video-source-manifest`, two `video-loop-repair` requests, each compared `improved` by `video-loop-compare`, the second on the first's adopted files with the same origin, and a third that is a byte-exact no-op. It ends with an error unless every other cell, the metadata bytes, the GIF and WebP schedules and the origin's files are unchanged, each restored cell has the source's coverage and its outline fault cleared, no key excess is introduced, and the belt's one-step excess, which the resample makes where its two colours meet, is capped in each restored cell. Its `summary.json` holds no path or time. It is a new synthetic example, not a measurement of any delivered loop; the GIFs below are its two engine GIFs with each pixel drawn 3 × 3.+- **`tests/video/test_loop_compare.py`, `tests/video/test_source_restoration.py`, `tests/video/test_loop_repair.py` and `tests/video/test_strip_resample.py`** use synthetic loops. Identical pixels are never `improved`; an outline restored with the bob kept is `improved` and its inverse `regressed`; a follow-through is measured from the final pixels; another cut with a better report ratio, a flattened pose and flattened colour motion cannot win. Restoration keeps normal motion and timing, offers the next independent proposal within the budget, is a no-op on a clean loop, refuses forged or changed source receipts and tampered final files, keeps key spill out while restoring the rest of the cell, ends a proposal whose protected pixel has another coverage, caps a one-step excess the resample made and keeps a deeper one or one a source pixel carries, and rebuilds every later request from the origin. A blocked worst jump does not hide an independent one; faulty proposals keep the originals and use the call budget; with the real RIFE (`tests/video/test_rife.py`) an in-between that loses the outline is rejected and the filmed middle frame kept. The resample's published windows hold every pixel its colour filter mixes, and a mix can carry more key hue than the colours under it.- **New `sprite-gen video-follow-inspect`: where a follow-through carries each region in every cell, with nothing moved.** `video-follow` is given an ellipse in the strip's first cell and carries it with the body into every other; inside the carried ellipse every pixel moves, whatever it is a picture of. For the first cell somebody looked. For the others nobody did: an arm that swings across a chest is inside the chest's ellipse there and moves with it, and so does a sleeve of the chest's own colour, which no count of colours finds. Where the ellipse lies in those cells was written nowhere — the record keeps the body's bob and the strip's rounded offsets, from which the carry cannot be worked back for a strip of more than thirteen cells, and `--board` draws two cells. `video-follow-inspect` takes `video-follow`'s arguments (all but `--board`), reads the strip as cut and solves it with the same code, and writes into `--out-dir` `follow-inspect.json` and two boards of every cell. The record has, per cell, how far the regions are carried (`carry_px`, whole pixels) and per region the carried ellipse, its own offset and reach, how near that is to folding it, the least area of the source a pixel of the moved cell takes (`jacobian_min`: 0 where the picture stops and one line of the source is drawn across many — a region lowered by `--on-fold lower` is drawn nearly stopped where it moves most, not folded and stretched), the pixels the ellipse covers and how many are body, and the pixels the move changes; per region its gain and whether it is held; and the follow-through as `video-follow` records it. It names what it was read from: the strip's and the meta's sha256, the regions, the settings, the way the motion is read (`follow.POLICY`) and the engine's version, and `input_id`, one sha256 over those — the same before and after `video-follow` is run on the loop, another after a new cut, an alignment, a changed region or setting. It holds no path and no time: the same loop asked the same way writes the same record byte for byte. `follow-inspect.source.png` has the cells as cut and `follow-inspect.moved.png` the cells as `video-follow` would write them, each region's carried ellipse ringed just outside it; they are two files so that whoever says what is inside an ellipse can read the cells as cut alone, and each has a `pixels_sha256` over its pixels beside its file's. **The engine does not read what is inside an ellipse and does not guess it**: every region is `ownership: "unknown"` in every cell, from its centre to its rim, and `video-follow` still moves every cell. The loop directory is only read — not the strip, not its meta, not the `follow.source.png` that `video-follow` keeps — and an `--out-dir` at or under it is refused; what `video-follow` refuses, the inspection refuses in the same words under its own name. `video-follow` writes what 2.38.0 writes: strip, GIF, WebP, record, printed summary, messages and `--help`, byte for byte. Its body is now `follow.read_request` (the request, read and checked), `follow.solve` (an `Answer`: the motion, each region's gain, every cell's move) and the writing, and the inspection reads the first two; `follow.move_field` and `follow.region_weight` are the move and the weight `move_regions` draws with. [docs/video-pipeline.md](docs/video-pipeline.md#inspecting-a-follow-through--video-follow-inspect).- **`tests/video/test_follow_inspect.py`** draws a figure whose head and torso sway by whole pixels, across once a cycle and down twice: the carry of every cell is the sway as drawn, and the ellipse is carried by it. The record's `follow` is what `video-follow` then writes to the strip's meta; every pixel `video-follow` changed is inside the carried ellipse the record gave, counted alike; each cell is on both boards at its box, as cut and as written, with the ring only on the board pixels just outside the ellipse. Three regions take a gain each, and the one held is carried and ringed and moves nothing; regions given in the other order keep their numbers and swap their places. The loop directory is the same before and after, byte and time, as cut and after a follow-through, and a loop inspected first is followed byte for byte as one that was not. The same loop asked twice writes the same three files; after `video-follow` the id is the same; a cycle turned by one cell, one more pixel in one cell, another delay or another key in the cut's record is another id; so is each of gain, freq, zeta, on-fold and every number of a region, and not the boards' scale or columns. What `video-follow` refuses is refused in the same words and writes nothing. The least area is the steepest of the weight along the move, to 0.05, and under 0.15 for a region lowered to its limit. A forearm of the torso's own colour across the chest in five cells leaves the carry and the record's `follow` as the bare figure's, is on the board of the cells as cut inside the ring, moves with the chest on the other board, and is marked in no cell.+| As delivered: cells 4 and 9 are melted in-betweens | After two `video-loop-repair` requests, each compared `improved` |+|---|---|+|  |  |+## v2.38.0 - A body that is not one person stands square from behind and walks from behind without turning- **Output change: a body that is not one person stands square from behind, and walks or runs from behind without turning.** With `--body-plan` (a quadruped, a body without legs, a scene of several figures), the back still's view sentence (`STILL_VIEW_TEXT_ANY_BODY["back"]`, read by `still_view_text` and `gen --direction back`) now also says the body is square to the viewer and symmetric left to right: the back of the head centred above the body, neither side showing more than the other, any tail rising from the middle. A walk or run seen from behind says, after what the body stands on, that it stays level, square and straight the whole time, never turning or angling to either side so neither side comes into view, and does not sway from side to side, any tail held raised where it is with only its tip swaying (`BACK_GAIT_TEXT_ANY_BODY`; for a scene, every figure), in the built-in sentence and after a caller's `--motion` alike. A four-legged back still drawn from a three-quarter reference had come out turned, its head to one side and its tail to the other, and the walk filmed from it turned further until a flank showed and swayed; with both sentences the still was drawn straight behind and the walk held square. A person's prompts are unchanged, byte for byte; the front, side and diagonal views and every other state are unchanged.diff --git a/SKILL.md b/SKILL.mdindex def18d6..2a6c569 100644--- a/SKILL.md+++ b/SKILL.md@@ -1,6 +1,6 @@---name: sprite-gen-version: 2.38.0+version: 2.39.0description: "Generates images and game sprites through GPT or Grok with guided provider choices, separate saved defaults, automatic cleanup and optional curation. Handles sprite requests, ordinary image generation/editing, standalone image-to-video clips (i2v, animate this still, 그록 영상, 이매진 비디오, 스틸 움직여줘, first/last frame, reference-to-video, 영상 이어붙이기, 영상 편집, extend/edit a clip), clips from a video MCP on the agent (ZCRE, 지크 MCP), chroma removal, animation atlases, video loops, 큐레이션뷰, image candidates, 팔레트 스왑, palette swap, recolor, rig layers, engine exports, repeating backgrounds, projected shadows, motion/contact inspection and optional scene composition from existing assets."license: Apache-2.0depends_on:diff --git a/docs/release.md b/docs/release.mdindex d78ed8d..38537c4 100644--- a/docs/release.md+++ b/docs/release.md@@ -17,9 +17,11 @@ GitHub-hosted CI(GitHub Actions)는 쓰지 않는다. 테스트 게이트와 whelavapipe 에서는 첫 업로드에서 죽는다 — 그래서 그런 호스트에서는 RIFE 를 떼어 내되 조용히 건너뛰지는않는다.-**미결 (2026-10-06)**: GitHub CI 를 걷어낸 뒤로 리눅스 RIFE(`--rife-only`)는 아직 한 번도 재지 못했다 —-마지막 측정은 v2.35.0 의 CI 다. 진짜 리눅스 커널의 x86-64 호스트가 준비되면 이 변경이 들어간 커밋과-다음 릴리즈(v2.38.0) 커밋에서 `--rife-only` 를 돌려 채운다. 채우면 이 문단을 지운다.+통과는 커밋 하나의 것이다. 어떤 커밋에서 잰 레인 — 한 번의 exit 0 이든, `--rife-only` 의 exit 0 이든 —+은 다른 커밋의 통과가 아니다. 이전 릴리즈나 부모 커밋의 통과를 다음 커밋으로 옮겨 적지 않고, 머지할+커밋과 태그 커밋을 각각 그 SHA 의 깨끗한 클론에서 잰다. `--rife-unmeasured` 로 잰 커밋은 같은 SHA 의+`--rife-only` 가 exit 0 으로 끝나기 전까지 레인을 통과하지 않은 것이다. 패키지도 그 SHA 의 것이다:+`SOURCE_SHA` 가 태그 커밋이 아닌 디렉터리는 그 릴리즈에 쓰지 못한다(아래 5).## 한 묶음diff --git a/pyproject.toml b/pyproject.tomlindex b288ac2..6d2378c 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -12,7 +12,7 @@ build-backend = "setuptools.build_meta"name = "sprite-gen"# Release discipline: keep this package metadata version synchronized with# SKILL.md's `version:` field in the same release commit.-version = "2.38.0"+version = "2.39.0"description = "Component-row pipeline for clean 2D game sprites and animation atlases"readme = "README.md"license = "Apache-2.0"