rig-parts 2.67.0 → 2.69.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/STABILITY.md CHANGED
@@ -51,6 +51,41 @@ It binds the files at invocation and cannot prove that inference used that input
51
51
  See
52
52
  [Per-part provider maps](AUTHORING.md#per-part-provider-maps-897).
53
53
 
54
+ ## Parts replacement record
55
+
56
+ `replace-parts` (issue #1635) writes a separate parts set and adds a relative
57
+ POSIX `replacement_record` path to its `parts.json`. The path is
58
+ `.parts-replacements/<source-sha256>.json` within the output set.
59
+
60
+ | Field | Meaning |
61
+ | --- | --- |
62
+ | `spec` | Literal `rig-parts-replacement/1`. |
63
+ | `source_sha256` | SHA-256 digest of the source set inventory, computed for every replacement. If supplied, `--source-sha256` must match this digest. |
64
+ | `result_sha256` | SHA-256 digest of the result inventory, including `parts.json` and excluding the new replacement record itself. |
65
+ | `rig_size` | The unchanged rig grid `[width, height]` in pixels. |
66
+ | `replaced` | Per-edit entries carrying `part`, `receipt`, `changed_px`, `changed_counted_px`, `changed_excluded_px`, and `removed_opaque_px`. Optional `removed_opaque_regions` describes connected removals. Optional `historical` holds superseded source measurements. A part with scalar depth also carries `depth` with its before and after SHA-256 values (`from_sha256` and `sha256`), `reseeded`, support and measured reading. Reseeding can return an identical sheet. |
67
+ | `copied` | Sorted relative POSIX paths for files copied byte-for-byte. |
68
+ | `rederived` | Sorted relative POSIX paths regenerated for the revised set. |
69
+ | `omitted` | Sorted relative POSIX paths from the source set excluded from the revised set. |
70
+
71
+ Both digests hash compact UTF-8 JSON with a trailing LF. The inventory is an
72
+ array of `{path, bytes, sha256}` rows for regular files, with relative POSIX
73
+ paths sorted by code unit. The `receipt` carries the edit's author declaration
74
+ and the two encoded PNG hashes. `from_sha256` is required even when the caller
75
+ omits `--source-sha256`. The record binds the revised set to the recorded input
76
+ set. See the [authoring command](AUTHORING.md#replace-parts) for the edit
77
+ file and validation rules.
78
+
79
+ The stable named entry `@rig-c/parts/replace-parts` exports the following
80
+ without loading the CLI.
81
+
82
+ | Export | Contract |
83
+ | --- | --- |
84
+ | `replacementTreeDigest(root: string, options?: { result?: boolean }): string` | Returns the lowercase source inventory digest by default. Result mode discovers and excludes the active record through `parts.json` and requires that record to exist. |
85
+ | `REPLACEMENT_RECORD_SPEC` | Literal `rig-parts-replacement/1`. |
86
+ | `readReplacementRecord(bytes: Uint8Array): ReplacementRecord` | Parses the UTF-8 JSON record and reports all detected shape problems together. |
87
+ | `ReplacementRecord` | Type of the record described above. |
88
+
54
89
  ## Parts-stage integrity report
55
90
 
56
91
  `rig-parts check-parts --parts <assembled-dir> --out <disjoint-report-dir>
@@ -591,6 +626,7 @@ and do not certify visibility. See the
591
626
  | command | flags |
592
627
  | --- | --- |
593
628
  | `edited-part` | `--config`, `--part`, `--file`, `--from`, exactly one of `--editor` or `--producer`; optional `--parts` (`parts.json`), `--rig-config`, `--help` (`-h`) |
629
+ | `replace-parts` | `--parts`, `--edits`, `--out`; optional `--source-sha256`, `--help` (`-h`) (issue #1635, [replacement record](#parts-replacement-record)) |
594
630
  | `external-receipt` | `--kind` (mask), `--file`, `--painting`, `--producer`, `--out`; or `--verify`; or `--help` (`-h`) |
595
631
  | `diff-components` | `--stack`, `--painting`, `--parts`, `--floor`; optional `--threshold`, `--figure`, `--owners`, `--help` (`-h`); exactly one of `--out`, `--verify` (issues #1005, #1291; exhaustive native error inventory, `rig-parts-diff-components/1` by default and `rig-parts-diff-components/2` with `--owners`, and byte-bound reader for both) |
596
632
  | `diff-drafts` | `--left`, `--right`, `--out`; optional `--help` (`-h`) (issue #1369; draft-to-draft assemble comparison, `rig-parts-draft-diff/1`) |
@@ -1206,7 +1242,7 @@ execution in historical evidence is inferred from a current export.
1206
1242
  | `input-check.json` | `remesh --record-input-check`, `retune --record-input-check` | spec `rig-parts-input-check/1` (issue #617, additive): `versions` (`parts`, `rigc` — `rigc --version`'s whole output), `options` (`page_edges`, `pack_shape`, `page_size` when `--page-size` is given, `requirements` — null, or `path` as resolved and `sha256`), `rig` and `parts` (`dir` as resolved, `files` — `path`, `bytes`, `sha256` per file: every file under `--rig`; `parts.json` and every file under `parts/`), `check` (the input's check side as `remesh.json` carries it); `--input-check` reads it back, and either command's serves the other |
1207
1243
  | composed turn producer inputs | `compose` | issue #1344 intentionally admits previously refused yaw/pitch derive maps, turn deform offsets/transforms, depth-grid generator images, bone inherit modes and producer mesh/fold invariants; every embedded reference is resolved and prefixed except the shared default skin. Mesh-slot ceilings sum and per-mesh triangle ceilings take the maximum, using actual counts only for unbudgeted members. Weighted lengths scale; image-sized depth grids at scale other than 1 are refused by `SCENE_SCALE_EXACT`. Other nested constructs remain refused. Previously passing scene payloads are byte-identical; the existing `check/check.json` requirement is retained, so `rig` plus `rigc build` alone is not a checked character. |
1208
1244
  | named scene plates | `compose` | issue #1345 adds optional `plates[]`: required `name`, `image`, `provenance`, `at: [x, y]`; optional `note`, `editor_receipts`, `opaque_backdrop`. `at` is two finite integers for the image top-left in canvas pixels, y down from the top-left origin; negatives/outside allowed, no scale, native image size including oversize. Each bone/slot/attachment uses its declared name, bone under root at `(0,0)`; attachment centre is `stage.x + at[0] + width/2`, `cropToSpineY(at[1] + height/2, canvas.height)`. Each layer's token is required exactly once in draw order, with duplicate/missing/unknown/collision refusals. Names cannot collide with root, legacy plate, shared idle, character ids or prefixed bones/slots/animations; a plate name already refused by `SCENE_PLATE_NAME_FREE` or `SCENE_PLATE_NAME_UNIQUE` does not also draw a cascaded `SCENE_ORDER_COMPLETE` (issue #1350). Only that layer's explicit `opaque_backdrop: true` exempts it from compose alpha checks; an opaque declared backdrop must additionally meet width >= canvas.width AND height >= canvas.height (the rig stage), matching core 3.8.0 A19 size inference; otherwise SCENE_PLATE_BACKDROP_SIZE refuses before emission (placement coverage of the stage is the scene author's, not checked by the tool). Transparent layers have no size floor. rigc A19 remains enabled. Named images use `scene-plate.<index>.png` (atlas region `scene-plate.<index>`, by declaration index) with collision checks. The `[compose]` header line names composed `plates[]` in declaration order (`<N> named plate(s): <name>, ...`) when `plates[]` is non-empty and prints `no plate` only when neither `plate` nor `plates[]` is present (issue #1350). The report includes its additive `plates` array with declaration, native size and PNG hash when named plates are declared. Omitting the declaration retains fixed first-plate behavior. |
1209
- | scene named animations | `compose` | issue #1346 adds optional `scene.animations`, a name-to-rigc-MotionAnimation map resolved against final scene bones/groups/easings. A scene-authored key on `root` moves the whole scene, including plates and characters. Imported character animations, including `idle`, are refused with `SCENE_ROOT_SHARED` if they key `root` directly or through a group. New names add clips at their own declared durations; `idle` appends timelines while retaining existing character tracks, deforms, metadata and physics. Without `idle_repeats`, idle duration mismatch is `SCENE_DURATION_AGREES`. Issue #1511 adds `characters[].idle_repeats`, a safe integer of at least two requiring an explicit scene idle. Its declared duration equals each source period times its count exactly, with an omitted count playing once. Each repeated source must close at its non-wrapping stored end. Character keys and absolute Bezier time handles repeat on the source clock, with one equivalent key at a shared endpoint and continuous physics across it. Scene timelines append once, prefixed side clips keep their durations, and the gated composed idle also closes at its stored end. `scene.json` retains each source `idle_duration`, adds `idle_repeats` only on opted-in rows, and gives the scene period as top-level `idle_duration`. `compose-run.json` keeps its schema. Imported non-idle names remain reserved. Core owns missing fields, unknown bones/references, duplicate property tracks and bad times. Unknown prefixed bones also name the character ID. Generated names `<id>:yaw_dial`, `<id>:pitch_dial`, and `<id>:<turn.body.slider>` (default `<id>:body_yaw_dial`) are stable; renaming them requires a major version. A dial exists only when generated by its character. Rotation keys use that slider's declared `[from, max]` bounds; out-of-range values are `SCENE_DIAL_KEY_RANGE`, unreadable bounds `SCENE_DIAL_RANGE_DECLARED`, never guessed. Slider-input keys require explicit numeric values; derive inputs are refused as `SCENE_DIAL_KEY_DECLARED`, including derive alongside a raw value. Bounds apply to the matching scalar or paired translate/scale/shear input channel; inherited group names are refused with `CE_COMPILE_ANIMATION_GROUP_UNKNOWN`. Each declared clip's gated posed endpoint values at 0 and duration with physics omitted must agree before emission (`SCENE_ANIMATION_LOOP_CLOSES`); physics-on frames are not measured by this check. Core `check/build/run.json` records fresh `started_at` and `finished_at` clocks. |
1245
+ | scene named animations | `compose` | issue #1346 adds optional `scene.animations`, a name-to-rigc-MotionAnimation map resolved against final scene bones/groups/easings. A scene-authored key on `root` moves the whole scene, including plates and characters. Imported character animations, including `idle`, are refused with `SCENE_ROOT_SHARED` if they key `root` directly or through a group. New names add clips at their own declared durations; `idle` appends timelines while retaining existing character tracks, deforms, metadata and physics. Without `idle_repeats`, idle duration mismatch is `SCENE_DURATION_AGREES`. Issue #1511 adds `characters[].idle_repeats`, a safe integer of at least two requiring an explicit scene idle. Its declared duration equals each source period times its count exactly, with an omitted count playing once. Each repeated source must close at its non-wrapping stored end. Character keys and absolute Bezier time handles repeat on the source clock, with one equivalent key at a shared endpoint and continuous physics across it. Scene timelines append once, prefixed side clips keep their durations, and the gated composed idle also closes at its stored end. `scene.json` retains each source `idle_duration`, adds `idle_repeats` only on opted-in rows, and gives the scene period as top-level `idle_duration`. `compose-run.json` keeps its schema. Imported non-idle names remain reserved. Core owns missing fields, unknown bones/references, duplicate property tracks and bad times. Unknown prefixed bones also name the character ID. Generated names `<id>:yaw_dial`, `<id>:pitch_dial`, and `<id>:<turn.body.slider>` (default `<id>:body_yaw_dial`) are stable; renaming them requires a major version. A dial exists only when generated by its character. Rotation keys use that slider's inclusive `[from, max]` bounds. Omitted `from` defaults to zero and `max` must be explicit and finite. Out-of-range values are `SCENE_DIAL_KEY_RANGE`. Missing `max`, malformed bounds and reversed bounds are `SCENE_DIAL_RANGE_DECLARED`. Slider-input keys require explicit numeric values; derive inputs are refused as `SCENE_DIAL_KEY_DECLARED`, including derive alongside a raw value. Bounds apply to the matching scalar or paired translate/scale/shear input channel; inherited group names are refused with `CE_COMPILE_ANIMATION_GROUP_UNKNOWN`. Each declared clip's gated posed endpoint values at 0 and duration with physics omitted must agree before emission (`SCENE_ANIMATION_LOOP_CLOSES`); physics-on frames are not measured by this check. Core `check/build/run.json` records fresh `started_at` and `finished_at` clocks. |
1210
1246
  | scene loop refusal detail | `compose` | Issue #1358 enriches `SCENE_ANIMATION_LOOP_CLOSES` with the first differing bone or slot, channel, start/end values and numeric tolerance 0 (exact equality), and issue #1590 states in the detail that it checks posed endpoint values with physics omitted and does not measure physics-on frames. The existing exact JSON endpoint comparison is unchanged: bones, slots, draw order, drawn geometry, clipping polygons and clipped geometry remain covered. Selection follows that family order, then producer row and field order; geometry-only differences name the slot and geometry channel. Physics is omitted from this posed-value comparison, and the refusal code, acceptance, emitted rig/motion and built scene bytes are unchanged. |
1211
1247
  | scene canvas framing | `compose` | Issue #1491 adds optional `characters[].canvas_clip` to `spine-parts-scene/1`. Literal `true` requires finite placed bounds, overflow past a canvas edge and an intersection with positive width and height. The respective refusals are `SCENE_CHARACTER_CLIP_BOUNDS`, `SCENE_CHARACTER_CLIP_UNUSED` and `SCENE_CHARACTER_CLIP_EMPTY`. Other explicit values are `SCENE_FIELD_TYPE`. Omitting the key retains the exact containment rule and console text for that character. The opted-in character row in `scene.json` adds `canvas_clip: true` and `clipped_bounds` after the original `bounds`. Both boxes are canvas pixels, y down, with exclusive right and bottom edges. The console appends the clipped box only for those rows. The rig-c gate and packed build retain the full art and geometry. For a scene with any opt-in, compose check renders use the stage viewport unless the render specifies its own. Preview size caps and sampling stay in effect. Native-size renders and consumer playback use the authored stage rectangle as described in [Canvas framing for intentional overflow](AUTHORING.md#canvas-framing-for-intentional-overflow-issue-1491). |
1212
1248
  | scene placement pivot | `compose` | Issue #1498 adds optional literal `true` at `characters[].placement_pivot` in `spine-parts-scene/1`. It emits the identity `<id>:placement` under `root` and requires a scene-authored `translate`, `translatex` or `translatey` key in final scene pixels. The existing placement math stays on the original first-level bones, root regions and root weights. Source root bindings use the unkeyed identity `<id>:root` child when needed. `SCENE_FIELD_TYPE` refuses other explicit values, `SCENE_PIVOT_NAME_FREE` a source bone collision, `SCENE_PIVOT_DECLARED` an unresolved pivot targeted directly or through a bone group without an opt-in, `SCENE_PIVOT_UNUSED` an unused declaration and `SCENE_PIVOT_TRACK` a forbidden property or carrier key. `SCENE_PLATE_NAME_FREE` still governs named plate collisions. Core's unknown-bone refusal, rig gate, scene clip timing and endpoint closure still apply. `scene.json` adds `placement_pivot` with the generated name after the bounds fields and counts the generated bones for that character. `compose-run.json` binds the declaration through `scene.sha256` with its existing shape and key order. Omitting the declaration retains shared-root placement. |
@@ -1218,7 +1254,8 @@ execution in historical evidence is inferred from a current export.
1218
1254
  | keyed scene camera | `compose` | optional `camera` in `spine-parts-scene/1` (issue #1596). A camera scene writes `spine-parts-scene-report/2` at the existing `scene.json` path with its keyed camera, sampled coverage and framing verdict, and packed model SHA-256. Scenes without a camera write report /1. Both report specs include `scene_driven` on new writes. The camera path uses Core animation easing and the posed backdrop at each sampled frame. Rig, motion and stock check outputs retain their existing semantics. The compose input receipt stays `rig-compose-run/1`. See [Keyed scene camera](AUTHORING.md#keyed-scene-camera-issue-1596) |
1219
1255
  | physics clips and scene repeats | `compose` | Issue #1615 adds `characters[].with_idle` and top-level `repeats` to `spine-parts-scene/1`. Each physics-only side clip requires literal `false` at any character scale or a safe integer count of at least 1 at scale 1. Numeric declarations fold whole periods into `idle` with exact duration equality. Both values retain `<id>:<clip>` subject to the character's scale checks, and the character report row echoes `with_idle` when declared. A scene repeat count is a safe integer of at least 2 on an authored take. Its duration remains the whole take length. Its tracks, deforms and camera keys use the exact duration divided by the count as their period. Repeated camera keys are expanded in report /2, with coverage on the full take clock and per-frame figure measurements. See [Physics clips and scene repeats](AUTHORING.md#physics-clips-and-scene-repeats-issue-1615) |
1220
1256
  | `idle.png`, `idle-indexed.png`, `idle.gif` | `loop`, `build --loop` | APNG and GIF encodings of the rendered idle |
1221
- | `run.json` | `rig`, `assemble` | spec `rig-run/1` (issue #1165, additive): `spec`, `package` (`name`, `version`), `command` (`"rig"` or `"assemble"`), `started_at` and `finished_at` (UTC ISO-8601 millisecond timestamps ending in `Z`, read in the CLI layer), `config` (`path` relative to `--out`, `sha256` of the config file on disk), `inputs` on `assemble` (issues #1316, #1554, additive: one `{role, path, sha256}` entry for each of `--source`, `--full` and `--head` that was given, in that order, with `path` relative to `--out` by the per-platform link rule — naming `<dir>/layers.json` when given a directory — and `sha256` of the file `path` names), and `outputs` (`path` relative to `--out`, `sha256` of each written output file on disk, sorted by `path` in code-unit order and excluding `run.json` itself); written only after the command's gate is green |
1257
+ | `run.json` | `rig`, `assemble` | spec `rig-run/1` (issue #1165, additive): `spec`, `package` (`name`, `version`), `command` (`"rig"` or `"assemble"`), `started_at` and `finished_at` (UTC ISO-8601 millisecond timestamps ending in `Z`, read in the CLI layer), `config` (`path` relative to `--out`, `sha256` of the config file on disk), `parts_input` on standalone `rig` (`path`, `sha256`, issue #1636), `inputs` on `assemble` (issues #1316, #1554, additive: one `{role, path, sha256}` entry for each of `--source`, `--full` and `--head` that was given, in that order, with `path` relative to `--out` by the per-platform link rule — naming `<dir>/layers.json` when given a directory — and `sha256` of the file `path` names), and `outputs` (`path` relative to `--out`, `sha256` of each written output file on disk, sorted by `path` in code-unit order and excluding `run.json` itself); written only after the command's gate is green |
1258
+ | `check-run.json` | `check` | spec `rig-run/2`. Fixed keys in order are `spec`, `package`, `command`, `started_at`, `finished_at`, optional `parts_input` (`path`, `sha256`, issue #1636), `outputs` and `argv`. See the [run record contract](#run-record-check-runjson-and-build-runjson-spec-rig-run2). |
1222
1259
  | the difference inventory (`--out`) | `diff-components` | spec `rig-parts-diff-components/1` by default (issue #1005: `stack`, `painting`, `definition`, `error_px`, `uncovered_error_px`, `components` — each `id`, `px`, `box`, `coverage`, `uncovered_px`, `borders` — and `below_floor`, byte-identical to 2.38.1), and spec `rig-parts-diff-components/2` under `--owners` (issue #1291: adds `owners` — each `{part, px}`, the topmost `parts.json` part above `COVERED_ALPHA` per covered pixel, back to front — before `borders` on every component); `--verify` verifies both `/1` and `/2` reports (with `--owners`, `/2` is required), while a `/1`-only reader (`readDiffComponents(text, input, [DIFF_COMPONENTS_SPEC])`) refuses `/2` by name |
1223
1260
  | the draft comparison (`--out`) | `diff-drafts` | spec `rig-parts-draft-diff/1` (issue #1369), a stable contract as of 2.45.0: fixed keys in order `spec`, `left` and `right` (each `parts_sha256`, `part_count`, `composite_sha256`), `canvas` (`width`, `height`), `order` (`"same"` or `"changed"`), `parts` (one entry per part name in the union of both sides, sorted by `name` in code-unit order: `name`, `status`, then `left` and `right` on the sides that hold the part, each `sha256`, `box`, `index`, then `pixels_equal` and `pixels` on `changed` only), `composite` and `summary`; no clock and no file paths. The command records no threshold and judges nothing; it exits 0 whenever the report is written. [Draft-to-draft assemble comparison](AUTHORING.md#draft-to-draft-assemble-comparison-issue-1369) defines each field. |
1224
1261
  | the external mask receipt (`--out`) | `external-receipt` | spec `rig-parts-external-receipt/1` (issue #1368), a stable contract as of 2.45.0: keys in write order `spec`, `kind` (`"mask"`), `file` and `painting` (each `path` relative to the receipt directory, then `sha256` of the file bytes), `grid` (`width`, `height` of the decoded painting) and `producer` (`tool`, optional `model`, then exactly one of `checkpoint_sha256`, `graph_sha256`, `script_sha256`); UTF-8 JSON, two-space indentation, trailing newline. `--verify` reads it back and writes nothing. The producer is the caller's declaration, not a proof of which tool made the mask. [External mask receipt](AUTHORING.md#external-mask-receipt) defines each field. |
@@ -1393,10 +1430,12 @@ inherit a scene-keyed parent, and a constraint can read a scene-keyed input. See
1393
1430
  ### Check report (`rig-parts-check/1`)
1394
1431
 
1395
1432
  `check --clip-stretch <scene.json>` has its own text and exit status. It exits
1396
- 0 when every take has a measurable passing peak, 1 on a refusal, failing bar
1397
- or missing reading, and 2 on usage errors. It writes no `check.json`,
1398
- `check-run.json`, or scene output. The ordinary check report, verdict and
1399
- compose admission retain their existing meanings.
1433
+ 0 when every played take has a measurable passing peak and all dial rows report
1434
+ `PASS` or `SKIP`, 1 on a refusal, failing bar or missing required reading, and
1435
+ 2 on usage errors. It writes no `check.json`, `check-run.json`, or scene output.
1436
+ The ordinary check report, verdict and compose admission retain their existing meanings.
1437
+ The [slider stretch contract](#slider-stretch-diagnostic-issue-1627) defines
1438
+ the dial rows and their effect on the verdict.
1400
1439
 
1401
1440
  Spec `rig-parts-check/1` (issues #1372, #1378) is a stable contract as of
1402
1441
  2.45.0, the first version that writes it.
@@ -1498,6 +1537,48 @@ Compose reads `bar_outcomes` on a report that declares this spec (issue
1498
1537
  readers, the historical interpretation is kept, including for reports
1499
1538
  written before this version.
1500
1539
 
1540
+ #### Slider stretch diagnostic (issue #1627)
1541
+
1542
+ Stock `check.json` gains `slider_stretch` immediately after `TEXTURE_STRETCH`
1543
+ when the rig has a slider, including when its range is undeclared. The block
1544
+ has `fps` (the 12 Hz clip frame grid), `limit` (the `TEXTURE_STRETCH` limit),
1545
+ and `rows` (one per slider/clip binding, using the rig's local names).
1546
+
1547
+ A bone-driven slider's inclusive range bounds its configured local or world
1548
+ input property. Omitted `from` defaults to zero. `max` must be explicit, and
1549
+ any declared endpoint must be a finite number. The scene diagnostic reads
1550
+ the final bounds in composed units. Malformed or reversed bounds fail.
1551
+ Missing `max` reports `SKIP` with `no declared dial range; declare max to
1552
+ measure texture stretch`. A time-driven slider also reports `SKIP`.
1553
+ The authored `max` is editor metadata. Core applies its own mapping and
1554
+ clamp or wrap, and the clip supplies no inferred endpoint.
1555
+ Equal endpoints keep the resolved range and report `SKIP` with zero samples.
1556
+ The console prints only the reason after the binding name, for example
1557
+ `declared dial range [0, 0] has equal endpoints`, using the actual endpoints.
1558
+
1559
+ | Row fields | Meaning |
1560
+ | --- | --- |
1561
+ | `slider`, `clip`, `status` | Binding names and the diagnostic outcome, `PASS`, `FAIL`, or `SKIP`. |
1562
+ | `range`, `sample_count` | Inclusive resolved `[from, max]`, or `null` when no valid bone-driven range resolves, and the number of dial samples read. A complete sweep reads 13 evenly spaced values including both endpoints. Equal endpoints retain `[from, max]` with zero samples. |
1563
+ | `last_passing_dial` | `{ lower, upper }` walking outward from midpoint sample 6: each side is the last consecutive passing grid sample (`from` or `max` when that side never fails), or `null` when midpoint sample 6 itself fails (by stretch or pose refusal). Present exactly when `peak` is; a row is `PASS` iff `lower === from` and `upper === max` (issue #1632). |
1564
+ | `peak` | `severity` (raw), `gate` (rounded), `dial_value`, `sample` (zero-based ordinal), `clip_frame` (integer on the clip grid, `null` off-grid), `clip_time_s` (applied time after wrapping), `slot`, `attachment`, `triangle`, `vertices`, `edge`, `area_share` (the peak triangle's rest area over its mesh's total rest area, rounded to 6 decimals), and `on_hull` (`true` iff at least one of the triangle's undirected edges is used by only one triangle of the mesh's rest triangles). Present when a peak was measured (issues #1627, #1632). |
1565
+ | `reason` | Explains an unmeasured `SKIP`, refused bounds, or an incomplete sweep. A `SKIP` has zero samples and omits `last_passing_dial` and `peak`. A measured failing peak remains a `FAIL` when a different sample is missing. |
1566
+ | `row_scope`, `row_kind`, `row_subjects` | Standard check-row metadata. The scope is `rig` with no part subjects. A `FAIL` is an advisory finding. |
1567
+
1568
+ The stock console displays measured `FAIL` rows at the existing `WARN` level.
1569
+ Slider outcome counts are separate from ordinary bar totals. `slider_stretch`
1570
+ has no entry in `bar_outcomes` and does not affect stock `PASS`, exit status,
1571
+ or compose admission. The report retains spec `rig-parts-check/1`.
1572
+
1573
+ `check --clip-stretch` opts into the same reset-pose measurement on the composed
1574
+ rig, with each dial sampled independently and compared with canonical rest
1575
+ using the stock stretch metric. It prints `CHECK_SLIDER_STRETCH` rows using
1576
+ composed names. Slider-only clips have dial rows. Clips with an explicitly
1577
+ declared played role also have `CHECK_CLIP_STRETCH` rows. The diagnostic still
1578
+ writes only text. A failed or incomplete declared sweep exits 1. A slider
1579
+ `SKIP` leaves the exit unchanged. Existing played take and idle
1580
+ verdicts still apply. See [the authoring guide](AUTHORING.md#slider-applied-clip-stretch-issue-1627).
1581
+
1501
1582
  ### Run stamp (`run.json`, spec `rig-run/1`)
1502
1583
 
1503
1584
  The CLI commands `rig` and `assemble` (when writing `--out`) write `<out>/run.json`
@@ -1511,6 +1592,7 @@ after all stage gates pass and all other output files are on disk:
1511
1592
  "started_at": "2026-11-07T00:00:00.000Z",
1512
1593
  "finished_at": "2026-11-07T00:00:01.000Z",
1513
1594
  "config": { "path": "../config.json", "sha256": "<hex>" },
1595
+ "parts_input": { "path": "../assembly", "sha256": "<hex>" },
1514
1596
  "outputs": [
1515
1597
  { "path": "images/cloth.png", "sha256": "<hex>" },
1516
1598
  { "path": "mesh_report.json", "sha256": "<hex>" },
@@ -1529,12 +1611,18 @@ additive): one `{ "role", "path", "sha256" }` entry (keys in that order) for eac
1529
1611
  `head` (an input not given is absent from the list, never `null` or guessed), with
1530
1612
  `/`-separated `path` relative to `--out` by the `rig-run/2` link rule (naming
1531
1613
  `<dir>/layers.json` when the input is a directory, issue #1554) and `sha256` of the file
1532
- `path` names on disk; `rig` writes no `inputs` key. Every `sha256` is computed from the bytes on disk after writing. A refused
1533
- run writes no `run.json`. By default, `started_at` and `finished_at` record wall-clock
1614
+ `path` names on disk; `rig` writes no `inputs` key. Standalone `rig` writes
1615
+ `parts_input` immediately after `config` (issue #1636), with `path` and `sha256`
1616
+ in that order. The directory named by `--parts` is rebased relative to `--out`
1617
+ by the same realpath rule as `config.path`. A directory that coincides with
1618
+ `--out` is recorded as `.`. The digest follows the [parts input snapshot](#parts-input-snapshot)
1619
+ contract. The config, assemble input and output hashes use the file bytes on disk
1620
+ after writing. A refused run writes no `run.json`. By default, `started_at` and
1621
+ `finished_at` record wall-clock
1534
1622
  time read in `cli.ts` (`src/` remains pure). With that default, `run.json` is outside
1535
1623
  the byte-for-byte
1536
1624
  determinism comparisons (`RG03`, `RG19`, `AS07`); for the same input at the same
1537
- relative `--config` layout, two `run.json` files differ only in `started_at` and
1625
+ receipt-relative input layout, two `run.json` files differ only in `started_at` and
1538
1626
  `finished_at`.
1539
1627
 
1540
1628
  Set `SOURCE_DATE_EPOCH` to opt into a fixed clock: both timestamps equal that
@@ -1546,7 +1634,7 @@ fractional, non-numeric, noncanonical and out-of-range values refuse
1546
1634
  `RUN_STAMP_EPOCH`, naming the variable, found value and requirement before any
1547
1635
  output is written or an existing stamp is removed. Unset preserves the existing
1548
1636
  wall-clock path and stamp format. Fixed clocks make stamps byte-identical for
1549
- identical inputs and the same relative config layout.
1637
+ identical inputs and the same receipt-relative input layout.
1550
1638
 
1551
1639
  `outputs` lists exactly the files the stage wrote in this run, derived from what the
1552
1640
  stage returns, not from a walk of `--out`: a stray or earlier file under `--out` is
@@ -1556,13 +1644,14 @@ neither hashed nor listed. Before the stage starts, the command removes an earli
1556
1644
  `package.json` without a non-empty `name` and `version` refuses `RUN_STAMP_PACKAGE`
1557
1645
  and writes no stamp. `build` and the in-process stages write no `run.json`.
1558
1646
 
1559
- `rig-run/1` is stable: its keys, their order and their meaning do not change within
1560
- the spec. A key added, removed or redefined is a new spec version.
1647
+ `rig-run/1` preserves the order and meaning of existing keys. The optional
1648
+ `parts_input` is additive and older stamps may omit it.
1561
1649
 
1562
1650
  ### Run record (`check-run.json` and `build-run.json`, spec `rig-run/2`)
1563
1651
 
1564
- `check` writes `<out>/check-run.json` whenever the run completed its check report,
1565
- green or not (issue #1541). `build` originally wrote `<out>/build-run.json` in this
1652
+ `check` writes `<out>/check-run.json` after the check report completes and the
1653
+ parts input snapshot is verified. The record can accompany a report with failing
1654
+ bars (issue #1541). `build` originally wrote `<out>/build-run.json` in this
1566
1655
  format. Its current contract is [the build run record](#build-run-record-build-runjson-spec-rig-run3). The names
1567
1656
  cannot be a `run.json`: `rig` and `assemble` write `rig-run/1` as `run.json`, and
1568
1657
  rigc writes its own `run.json` in a packed build directory (`check/build/`). Neither
@@ -1583,8 +1672,15 @@ file is in `check.json`, and no byte comparison this package makes reads them.
1583
1672
  }
1584
1673
  ```
1585
1674
 
1586
- Key order is fixed as shown: `spec`, `package`, `command`, `started_at`,
1587
- `finished_at`, `config` (`build` only; `check` reads no config), `outputs`, `argv`.
1675
+ The historical `build` key order is shown above. In `check-run.json` the fixed
1676
+ order is `spec`, `package`, `command`, `started_at`, `finished_at`, optional
1677
+ `parts_input`, `outputs`, `argv`. The `parts_input` object contains `path` and
1678
+ `sha256` in that order. Its directory is the explicit `--parts` or, when check
1679
+ reads a `parts.json` beside the rig, the `--rig` directory. The path is rebased
1680
+ relative to `--out` by the `config.path` directory and link rule below, with `.`
1681
+ for `--out` itself. The digest follows the [parts input snapshot](#parts-input-snapshot)
1682
+ contract. When check runs without a parts set, the key is absent and the legacy
1683
+ receipt bytes are preserved at the same clock.
1588
1684
  `package` and the two times (`SOURCE_DATE_EPOCH` included) are as in `rig-run/1`.
1589
1685
  `config` is the config's `sha256` and its path relative to `--out`, using the
1590
1686
  same directory spelling rule as `argv` below. A config given through a link is
@@ -1608,12 +1704,23 @@ is `.`. A path on another Windows drive is written as given. These arguments
1608
1704
  reproduce the check when run from the `--out` directory with the same package
1609
1705
  version. A switch's default is not written, so a later
1610
1706
  version that changed it would replay differently; that is why the version is in
1611
- `package`. The record is written after the report, in place, and is never a reason to refuse
1612
- the check; a run killed while writing it can leave a partial record, and no other
1613
- file.
1707
+ `package`. The record is written in place after the report and verification of the
1708
+ parts input snapshot. A run killed while writing the record can leave it partial.
1614
1709
 
1615
1710
  `rig-run/2` is stable on the same terms as `rig-run/1`. The `check` record retains
1616
- the same format and bytes for the same files, invocation, version and times.
1711
+ the same bytes for the same files, invocation, version and times.
1712
+
1713
+ #### Parts input snapshot
1714
+
1715
+ `parts_input.sha256` is the source-mode digest returned by
1716
+ `replacementTreeDigest` from `@rig-c/parts/replace-parts` on the resolved input
1717
+ directory. It covers all regular files in that directory, including any
1718
+ replacement record. The CLI takes
1719
+ the snapshot before clearing its previous receipt or writing stage outputs. An
1720
+ `--out` that overlaps the input directory can change that inventory during the
1721
+ run, so the record identifies the pre-stage tree. With disjoint directories the
1722
+ CLI also compares the digest after the stage. A change to that digest or to the
1723
+ resolved parts directory refuses the receipt as `RUN_PARTS_INPUT_CHANGED`.
1617
1724
 
1618
1725
  ### Build run record (`build-run.json`, spec `rig-run/3`)
1619
1726
 
@@ -1728,8 +1835,9 @@ in the package.
1728
1835
 
1729
1836
  ## rig-c
1730
1837
 
1731
- `dependencies` takes `@rig-c/core` `3.11.0` exactly. Core 3.11.0 supplies the idle
1732
- render's `--loop-seam-bar` and `--loop-seam-cap` support. Bun 1.4 or later
1838
+ `dependencies` takes `@rig-c/core` `3.12.0` exactly. Core supplies the idle
1839
+ render's `--loop-seam-bar` and `--loop-seam-cap` support and the `poseSlider`
1840
+ reading used for independent dial samples. Bun 1.4 or later
1733
1841
  is the declared floor (`engines.bun` `>=1.4.0`; older 1.4 releases are not tested in
1734
1842
  CI, which runs `latest`, and compatibility with an older 1.4 release is handled when
1735
1843
  reported as an issue). What this package relies on in rig-c, every import
@@ -1741,7 +1849,8 @@ read off `src/` and `cli.ts`:
1741
1849
  `skinningEnvelopeBone`, `writeMeshQualityReport` and their types),
1742
1850
  `@rig-c/core/meshcompare` (`compareMeshesInMotion`, `comparePreparedMotion`,
1743
1851
  `prepareMotionReference`), `@rig-c/core/compile` (`f32`), `@rig-c/core/core`
1744
- (`RUNTIME_PI`), `@rig-c/core/deformgen` (`evaluateDeformTransform`),
1852
+ (`RUNTIME_PI`, `poseSlider`, `readModel`, `underNoSkin`),
1853
+ `@rig-c/core/deformgen` (`evaluateDeformTransform`),
1745
1854
  `@rig-c/core/environment` (`ENVIRONMENT_SPEC`, `EnvironmentError`,
1746
1855
  `environmentResponse`, `readEnvironmentSchedule`), `@rig-c/core/errors`
1747
1856
  (`CompileError`), `@rig-c/core/font5x7` (`GLYPH_H`, `drawText`),
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "rig-parts",
3
- "version": "2.67.0",
3
+ "version": "2.69.0",
4
4
  "description": "AI-authored 2D character parts from one anime painting and its See-through layer decomposition: measured parts, weighted-mesh rig specs, verified through rig-c before anything is written. A CLI for agents that cannot see the image.",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  "./assembly-reading": "./src/assembly-reading.ts",
8
8
  "./physics-clips": "./src/physics-clips.ts",
9
+ "./replace-parts": "./src/replacementrecord.ts",
9
10
  "./cloth-targets.json": "./src/cloth-targets.json",
10
11
  "./*": "./*"
11
12
  },
@@ -76,7 +77,7 @@
76
77
  },
77
78
  "dependencies": {
78
79
  "ag-psd": "^31.0.2",
79
- "@rig-c/core": "3.11.0"
80
+ "@rig-c/core": "3.12.0"
80
81
  },
81
82
  "devDependencies": {
82
83
  "@esotericsoftware/spine-core": "4.3.13",
package/src/build.ts CHANGED
@@ -101,7 +101,7 @@ import {
101
101
  } from './autoreplay.ts';
102
102
  import { physicsLines } from './physicscontrib.ts';
103
103
  import { besideIdleLine, checkSummaryLine, inputFileRecord, type InputFileRecord, CLOTH_LINE, type ClothLine, clothWarnText, figureOpeningLines, frameRuns, MOTION_SEAM_LINE, type MotionSeamLine, type MotionSeamPlant, motionSeamRequiredLine, motionSeamWarnText, motionJointContactLines, FOLD_LINE, type FoldsLine, LEVEL_LINE, type LevelLine, LIMB_LINE, type LimbLine, STRESS_LINE, SWEEP_LINE, type SweepLine, buildGateLines, causeLines, environmentLine, IDLE_FPS, IDLE_MAX_PX, maxRgbDiff, REQUIREMENTS_DIR, type CheckReport, type PackLine, DEFAULT_PACK_SHAPE, DEFAULT_PAGE_EDGES, GATE_PROFILE, JUDGEMENT_LINES, type JudgementLine, packedBuildArgs, packedBuildLabel, type PackMode, parsePageSize, readCheckEnvironment, readWindBand, type PackShape, type PageEdges, readFrameSet, rigcFailed, rigcIdentity, rigcRanClause, REPORTED_LINES, type ReportedLine, type RigcRunner, runCheck, SEAM_DIR, SEAM_MEAN_BAR, seamPairText, seamRigPxText, SOURCE_LINE, SEAM_PX_BAR, SEAM_PX_LEVEL, SEAM_PX_LEVEL_HIGH, SPINEBOY_YARDSTICK, STILL_DIR, WIND_BAND_LINE, windBandLines } from './check.ts';
104
- import type { LoopSeamRequest } from './check.ts';
104
+ import { sliderStretchLine, type LoopSeamRequest } from './check.ts';
105
105
  import { type CharacterConfig, type Cut, type Extend, loadConfigAndAnimations, loadConfigWithBytes, loadEarlyConfig, type Patch, type PlanEntry } from './config.ts';
106
106
  import { coreCompileGuideLine, failLine, foldName, PartsError, type Problem, refuseIfAny } from './errors.ts';
107
107
  import { editedConfigImages, editedRunImages, missingReceipts, readEditorReceipts } from './editreceipt.ts';
@@ -116,6 +116,7 @@ import { type LayerSet, readLayers } from './layers.ts';
116
116
  import { placeBoneEntriesForSkeleton, poseBoneEntriesForDrawn, REGISTER_OFFSET_BAR, REGISTER_SCALE_BAR, registeredWithinBar, registerSkeleton, SKELETON_LIMB_BONES, skeletonDrawnLength, skeletonLimbJoints } from './limbs.ts';
117
117
  import { type AlternatePartsRecord, PAINTING_IN_RIG_FILE, FRONT_SUFFIX, type OccluderPlateRecord, type PartRecord, partImageReference, depthImageReference, readParts, readPartsManifest, type RecompositeRecord, type SingleRunPad, tagOf, writeParts } from './parts.ts';
118
118
  import { encodePngBytes, readPng, writePng } from './raster/png.ts';
119
+ import { verifyReplacementRecord } from './replaceparts.ts';
119
120
  import type { Raster } from './raster/types.ts';
120
121
  import { type Mask, newMask } from './raster/types.ts';
121
122
  import { type OtherLimbs, splitLines, capOwnershipLines, type SplitCount } from './assemble.ts';
@@ -1948,6 +1949,7 @@ export interface RigInputs {
1948
1949
  export function readRigInputs(config: string, partsDir: string, assemblyRules?: AssemblyRules): RigInputs {
1949
1950
  const { config: cfg, animations: from } = loadConfigAndAnimations(config);
1950
1951
  const parts = readParts(join(partsDir, 'parts.json'));
1952
+ verifyReplacementRecord(partsDir, parts);
1951
1953
  refuseStaleAssembly(config, parts, cfg, assemblyRules);
1952
1954
  const images = new Map<string, Raster>();
1953
1955
  const depthProblems: Problem[] = [];
@@ -2158,6 +2160,9 @@ export function rigStage(input: RigStageInput, rigc: RigcRunner, scratch: string
2158
2160
  if (importedClipNames.length > 0 || Object.keys(rig.motion.animations).some(name => name !== 'idle')) {
2159
2161
  log(' Side clips have not been measured for texture stretch. Run rig-parts check --clip-stretch <scene.json> to measure them.');
2160
2162
  }
2163
+ if (rig.rig.constraints?.some(constraint => constraint.type === 'slider') === true) {
2164
+ log(' Slider dial ranges have not been measured for texture stretch. Run rig-parts check on this rig or rig-parts check --clip-stretch <scene.json>.');
2165
+ }
2161
2166
  log(`rig-parts rig: wrote ${join(input.out, 'rig.json')}, motion.json, mesh_report.json and ${rig.images.length} image(s) under ${join(input.out, 'images')}`);
2162
2167
  return rig;
2163
2168
  }
@@ -2523,6 +2528,7 @@ export function checkStage(input: CheckStageInput, rigc: RigcRunner, bin: string
2523
2528
  }
2524
2529
  }
2525
2530
  for (const name of JUDGEMENT_LINES) log(` ${judgementLine(name, fig[name])}`);
2531
+ for (const row of fig.slider_stretch?.rows ?? []) log(sliderStretchLine(row, true));
2526
2532
  const folds = fig[FOLD_LINE];
2527
2533
  if (folds !== undefined) for (const l of foldsLines(folds)) log(` ${l}`);
2528
2534
  const level = fig[LEVEL_LINE];