rig-parts 2.63.1 → 2.64.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/cli.ts CHANGED
@@ -55,7 +55,7 @@ import { RETUNE_FILE, RETUNE_SPEC, retuneStage } from './src/retune.ts';
55
55
  import { checkPainting, DEFAULT_PAINTING_FORM, isPaintingForm, PAINTING_FORMS, paintingFormOf } from './src/paintcheck.ts';
56
56
  import { decodePngBytes, readPng, writePng } from './src/raster/png.ts';
57
57
  import { REQUIREMENTS_SENTENCE } from './src/requirements.ts';
58
- import { composeStage, IMAGE_SEP, PLATE, PROVENANCES, SCENE_CAMERA_REPORT_SPEC, SCENE_REPORT_FILE, SCENE_REPORT_SPEC, SCENE_SPEC } from './src/scene.ts';
58
+ import { type ComposeInput, composeStage, IMAGE_SEP, PLATE, PROVENANCES, refusePreviewLoopSeam, SCENE_CAMERA_REPORT_SPEC, SCENE_REPORT_FILE, SCENE_REPORT_SPEC, SCENE_SPEC } from './src/scene.ts';
59
59
  import { buildSheet, defaultCaption, type Tile, tilesFrom } from './src/sheet.ts';
60
60
  import { loadComparison, requiredProblems, structureLines } from './src/structure.ts';
61
61
  import { type ArgvTable, assembleOutputFiles, BUILD_RUN_FILE, CHECK_RUN_FILE, clearComposeRun, clearRunRecord, clearRunStamp, readPackageIdentity, recordArgv, rigOutputFiles, RUN_STAMP_FILE, RUN_STAMP_SPEC, writeRunRecord, writeRunStamp } from './src/runstamp.ts';
@@ -1046,7 +1046,16 @@ usage:
1046
1046
 
1047
1047
  rig-parts compose --scene <scene.json> --out <dir> [--requirements <file.json>] [--accept <bar>[,<bar>...]] [--page-size <px>]
1048
1048
  [--loop-seam-bar <channel-delta,pixels> --loop-seam-cap <loops>]
1049
+ [--output-profile preview] [--no-extremes]
1049
1050
  The loop seam flags measure the composed idle in check/, as for check.
1051
+ --no-extremes omits the extra extremes renders. --output-profile preview
1052
+ also omits published idle_frames/, contact.png and motion_heat.png, and
1053
+ implies --no-extremes. The gate and check requirements still apply.
1054
+ Opt-in success prints PREVIEW or NO EXTREMES and records output_profile
1055
+ in compose-run.json. When both flags are given, preview takes precedence.
1056
+ Preview uses the stock idle render for checks, then removes it.
1057
+ Preview refuses --loop-seam-bar (COMPOSE_PREVIEW_REQUIRED_CHECK) because
1058
+ check.json binds the first and wrap PNGs that must remain in idle_frames/.
1050
1059
  Bind several finished characters into one rig. The scene file (spec
1051
1060
  "${SCENE_SPEC}") states the canvas {width, height}, an optional plate
1052
1061
  {image, provenance: ${PROVENANCES.join(' | ')}, note?}, the characters
@@ -1303,7 +1312,7 @@ const TAKES = {
1303
1312
  'comfy plate': { valued: ['--mode', '--painting', '--mask-from', '--occluder', '--out', '--graph', '--model', '--checkpoint-sha256', '--seed', '--grow', '--steps', '--cfg', '--prompt', '--negative', '--host', '--wait', '--timeout', '--poll'], switches: ['--holes', '--help'] },
1304
1313
  inputs: { valued: ['--source', '--config', '--out'], switches: ['--help'] },
1305
1314
  build: { valued: ['--config', '--source', '--full', '--head', '--out', '--seam', '--project', '--page-edges', '--pack-shape', '--page-size', '--requirements', '--idle-keys', '--lead-in', '--alt', '--set', '--environment', '--wind-band'], switches: ['--loop', '--seam-pairs', '--keep-stills', '--all-sets', '--no-extremes', '--help'] },
1306
- compose: { valued: ['--scene', '--out', '--requirements', '--accept', '--page-size', '--loop-seam-bar', '--loop-seam-cap'], switches: ['--help'] },
1315
+ compose: { valued: ['--scene', '--out', '--requirements', '--accept', '--page-size', '--loop-seam-bar', '--loop-seam-cap', '--output-profile'], switches: ['--no-extremes', '--help'] },
1307
1316
  'mesh-draft': { valued: ['--config', '--parts', '--out', '--requirements', '--idle-keys', '--page-edges', '--pack-shape', '--page-size'], switches: ['--more-triangles', '--help'] },
1308
1317
  'mesh-stats': { valued: ['--config', '--parts'], switches: ['--help'] },
1309
1318
  remesh: { valued: ['--rig', '--config', '--parts', '--part', '--mesh', '--delta', '--out', '--requirements', '--idle-keys', '--page-edges', '--pack-shape', '--page-size', '--input-check'], switches: ['--record-input-check', '--help'] },
@@ -1633,15 +1642,22 @@ function cmdRig(args: string[]): number {
1633
1642
  * the spawn from here. A call that fails carries which rigc ran it, path and
1634
1643
  * version ({@link rigcRunnerAt}, issue #337), and every refusal quoting it says so.
1635
1644
  */
1636
- /** The command's valued flags as `--flag value` pairs, each one its {@link TAKES} row holds; `required` must all be given. Its bare switches are taken out by the caller before this reads the rest. A string is a usage error. */
1637
- function flags(args: string[], command: Command, required: readonly string[]): Map<string, string> | string {
1645
+ /** Read the command's required and optional `--flag value` pairs, and collect its bare switches in `on` when supplied. A string is a usage error. */
1646
+ function flags(args: string[], command: Command, required: readonly string[], on?: Set<string>): Map<string, string> | string {
1638
1647
  const got = new Map<string, string>();
1639
- for (let i = 0; i < args.length; i += 2) {
1648
+ const switches: readonly string[] = TAKES[command].switches;
1649
+ for (let i = 0; i < args.length; i++) {
1640
1650
  const flag = args[i];
1651
+ if (on !== undefined && switches.includes(flag)) {
1652
+ if (on.has(flag)) return `${flag} is given twice`;
1653
+ on.add(flag);
1654
+ continue;
1655
+ }
1641
1656
  if (!takesValued(command, flag)) return notTaken(command, flag);
1642
1657
  if (args[i + 1] === undefined) return `${flag} needs a value`;
1643
1658
  if (got.has(flag)) return `${flag} is given twice`;
1644
1659
  got.set(flag, args[i + 1]);
1660
+ i++;
1645
1661
  }
1646
1662
  for (const k of required) if (!got.has(k)) return `${command} needs ${k} <value>`;
1647
1663
  return got;
@@ -2605,15 +2621,28 @@ function cmdBuild(args: string[]): number {
2605
2621
  }
2606
2622
 
2607
2623
  function cmdCompose(args: string[]): number {
2608
- const f = flags(args, 'compose', ['--scene', '--out']);
2624
+ const on = new Set<string>();
2625
+ const f = flags(args, 'compose', ['--scene', '--out'], on);
2609
2626
  if (typeof f === 'string') return usage(f);
2627
+ const profile = f.get('--output-profile');
2628
+ if (profile !== undefined && profile !== 'preview') return usage(`--output-profile ${JSON.stringify(profile)}; preview is required when this flag is given`);
2629
+ const outputProfile = profile ?? (on.has('--no-extremes') ? 'no-extremes' : undefined);
2610
2630
  const loopSeam = parseLoopSeamFlags(f);
2611
2631
  if (typeof loopSeam === 'string') return usage(loopSeam);
2612
2632
  const out = f.get('--out') as string;
2613
2633
  clearComposeRun(out);
2614
- let size: number | undefined;
2634
+ let input: ComposeInput;
2615
2635
  try {
2616
- size = parsePageSize(f.get('--page-size'));
2636
+ const size = parsePageSize(f.get('--page-size'));
2637
+ const req = f.get('--requirements');
2638
+ const accept = f.get('--accept');
2639
+ input = {
2640
+ scene: f.get('--scene') as string, out, ...(size === undefined ? {} : { pageSize: size }),
2641
+ ...(req === undefined ? {} : { requirements: req }), ...(accept === undefined ? {} : { accept: accept.split(',') }),
2642
+ ...(loopSeam === undefined ? {} : { loopSeam }),
2643
+ ...(outputProfile === undefined ? {} : { outputProfile }),
2644
+ };
2645
+ refusePreviewLoopSeam(input);
2617
2646
  } catch (err) {
2618
2647
  return printRefusal(err);
2619
2648
  }
@@ -2625,14 +2654,8 @@ function cmdCompose(args: string[]): number {
2625
2654
  }
2626
2655
  const scratch = mkdtempSync(join(tmpdir(), 'rig-parts-compose-'));
2627
2656
  try {
2628
- const req = f.get('--requirements');
2629
- const accept = f.get('--accept');
2630
2657
  const r = composeStage(
2631
- {
2632
- scene: f.get('--scene') as string, out, ...(size === undefined ? {} : { pageSize: size }),
2633
- ...(req === undefined ? {} : { requirements: req }), ...(accept === undefined ? {} : { accept: accept.split(',') }),
2634
- ...(loopSeam === undefined ? {} : { loopSeam }),
2635
- },
2658
+ input,
2636
2659
  { rig: rigcRunner(bin), check: rigcRunner(bin), checkBin: bin, scratch: join(scratch, 'gate') },
2637
2660
  console.log,
2638
2661
  );
package/docs/AUTHORING.md CHANGED
@@ -2500,6 +2500,18 @@ depth sheet or generated key, and adds no winding validator. Lattice meshes,
2500
2500
  head turns, unrelated animations and attachments absent from the generated
2501
2501
  body-turn deform get no contour/body-turn advice.
2502
2502
 
2503
+ **When a band width reverses a triangle (issue #1606).** A region's band `width` decides which
2504
+ outline and ring samples survive meshing, so two neighbouring widths can produce different
2505
+ triangulations of the same part. At some widths the triangulation leaves a sliver near the band
2506
+ cutoff, made of a persistent outline vertex and two ring samples with zero region share, and
2507
+ rigc reverses it at the body-turn extreme. On two public synthetic fixtures, width 14 refused
2508
+ (one triangle, 154.835 → −18.061 px²) while widths 13 and 15 built clean, and width 25 refused
2509
+ (13.556 → −1.985 px²) while 24 and 26 built clean, all at −15° on `body_turn` key 0. The field
2510
+ has no monotone direction: on both fixtures the narrower and the wider neighbour each cleared
2511
+ the refusal. When `RIG_CONTOUR_BODY_TURN_WINDING` names a contour mesh whose band width you just
2512
+ changed, try the widths on either side through the stock gate before you change any other
2513
+ field.
2514
+
2503
2515
  **Weights.** The nominal share `g` is 1 inside or on the region, `1 − d/band` at a
2504
2516
  distance `0 < d < band`, and 0 at or past the outer edge. With `band: 0`, the share
2505
2517
  steps directly from 1 to 0. The endpoints are decided exactly on the 1/256 px grid.
@@ -6695,7 +6707,7 @@ recorded transform. The record fields and sampling formula are specified in
6695
6707
  | <a id="RIG_EXPLICIT_ISLAND_COUNT"></a>`RIG_EXPLICIT_ISLAND_COUNT` | `explicit.islands.length` differs from the non-dust 4-connected art island count of `parts/<part>.png`; the missing or extra `<part>__island<N>` slot names and island pixel counts are named | supply one `explicit.islands` entry per non-dust art island (`<part>`, `<part>__island2`, …); nothing is written |
6696
6708
  | <a id="RIG_EXPLICIT_ALTERNATE"></a>`RIG_EXPLICIT_ALTERNATE` | an alternate set replaces a part bound to one accepted explicit payload | use a generated mesh for alternate artwork; no alternate is inferred from a base payload |
6697
6709
  | <a id="RIG_INFLUENCE_REACH"></a>`RIG_INFLUENCE_REACH` | an influence mesh's `radius` is at or under the distance from its farthest lattice vertex to that vertex's nearest link (issue #378): a link pulls only when it is nearer than `radius`, so that vertex would be pulled by none. The vertex, where it is and the distance are named | a `radius` above the distance named, or a segment nearer that part of the art |
6698
- | <a id="RIG_CONTOUR_BODY_TURN_WINDING"></a>`RIG_CONTOUR_BODY_TURN_WINDING` | config context appended inside `RIG_RIGC_GREEN` only for rigc's actual `A39_DEFORM_KEEPS_TRIANGLE_WINDING` failure on a contour mesh attachment in the `body_turn` generated by `config.turn.body` (issue #1306). Names the part, slot/attachment, failure frame, key index/time or bounding keys/measured span time, reversal count, and rigc's shown triangle indices, vertex triples and signed before/after areas; repeated gate lines get one added line per failure frame. Rigc's original text is retained | inspect `meshes.<part>.contour.maxEdge`, `meshes.<part>.contour.margin`, `meshes.<part>.contour.tolerance` and the part's depth sheet together. The outcome is not monotone in any field; no single field is a promised fix. Only rerunning rigc's gate decides whether the candidate passes; the diagnostic changes no mesh, depth or generated key and adds no validator |
6710
+ | <a id="RIG_CONTOUR_BODY_TURN_WINDING"></a>`RIG_CONTOUR_BODY_TURN_WINDING` | config context appended inside `RIG_RIGC_GREEN` only for rigc's actual `A39_DEFORM_KEEPS_TRIANGLE_WINDING` failure on a contour mesh attachment in the `body_turn` generated by `config.turn.body` (issue #1306). Names the part, slot/attachment, failure frame, key index/time or bounding keys/measured span time, reversal count, and rigc's shown triangle indices, vertex triples and signed before/after areas; repeated gate lines get one added line per failure frame. Rigc's original text is retained | inspect `meshes.<part>.contour.maxEdge`, `meshes.<part>.contour.margin`, `meshes.<part>.contour.tolerance` and the part's depth sheet together. The outcome is not monotone in any field; no single field is a promised fix. When the reversal follows a change of a region's band `width`, try the widths on either side first: the width decides which outline and ring samples survive meshing, and has no monotone direction (issue #1606). Only rerunning rigc's gate decides whether the candidate passes; the diagnostic changes no mesh, depth or generated key and adds no validator |
6699
6711
  | <a id="RIG_INFLUENCE_LATTICE"></a>`RIG_INFLUENCE_LATTICE` | rig-c's segments lattice refused the part at the declared `cell` (no pixel of the part holds art, or the cell is not a whole number of at least 1); rig-c's message is quoted | a part with art, or a whole `cell` of at least 1 |
6700
6712
  | <a id="RIG_RIGC_GREEN"></a>`RIG_RIGC_GREEN` | rig-c refused the rig; its own FAIL or compile-error line is quoted, and nothing was written. A `constraints` field rigc does not read, or a value it refuses, is this line in rigc's words (`constraint "aim" (ik) has a key this compiler does not read: "mixx" (did you mean "mix"?)`), as is `A25_DETACHED_BONE_PARENTAGE` on a declared scene target. So is an ik whose `bones` are more than two, or two of which the second is not the first's child: from rig-c 2.15.0 its rig-spec parser refuses both by name (`ik constraint "reach" names 3 bones …`, `ik constraint "reach": "hem1" is not a child of "body" ("hem0" stands between) …`; firejune/rigc#1205), and this package no longer refuses them itself (issue #103; it did from #92 while rigc's gate passed them). Under `--idle-keys ctl` a two-bone ik over a chain link and its child link is that second refusal too, because the child's `<link>_ctl` stands between them; rigc's remedy names the control, which a config cannot, so when rigc's line says that control alone stands between, the rig stage adds a sentence naming `--idle-keys direct` on the command that ran | the field rigc's line names; for the split pair, `rig --idle-keys direct` or `build --idle-keys direct`, as the line says, which keys the link in place — rig-c's own AUTHORING §5 maps each of its assertions (`node_modules/@rig-c/core/docs/AUTHORING.md`) |
6701
6713
 
@@ -7242,6 +7254,7 @@ and stay absent).
7242
7254
  | <a id="SCENE_INVARIANT_AGREES"></a>`SCENE_INVARIANT_AGREES` | two characters declare `invariants.idleDrivesMeshes` with different `why`s | rebuild with this package's `--idle-keys direct`, whose `why` is one sentence |
7243
7255
  | <a id="SCENE_IMAGE_NAME_FREE"></a>`SCENE_IMAGE_NAME_FREE` | two images compose to one file name (`<id>.<file>`: an id `x` with an image `y.cloth.png`, and an id `x.y` with `cloth.png`) | another id |
7244
7256
  | <a id="COMPOSE_RIGC_GREEN"></a>`COMPOSE_RIGC_GREEN` | rig-c refused the composed rig; its line is quoted. A field compose carries as written (a constraint's `mix`, a slot's setup attachment) is rigc's to judge | the build whose field it names |
7257
+ | <a id="COMPOSE_PREVIEW_REQUIRED_CHECK"></a>`COMPOSE_PREVIEW_REQUIRED_CHECK` | `--loop-seam-bar` with `--output-profile preview`. The `loop_seam` record in `check.json` binds the paths and SHA-256 hashes of the first and wrap PNGs under `check/idle_frames/`, which preview removes | `found=preview, required=default or no-extremes`. Use default diagnostics or `--no-extremes` to retain the bound PNGs |
7245
7258
  | `REQUIREMENTS_*` | the `--requirements` file, as for `check` | as for `check` |
7246
7259
 
7247
7260
  ### The command line
@@ -7481,7 +7494,7 @@ assemble*, at the end of this section):
7481
7494
 
7482
7495
  **Physics-on idle closure (opt-in, issue #1590).** Pass
7483
7496
  `--loop-seam-bar <channel-delta,pixels> --loop-seam-cap <loops>` together to
7484
- `check` or `compose`. Use decimal whole numbers: a channel delta from 0 to 255,
7497
+ `check` or `compose` (default diagnostics or `--no-extremes`). Use decimal whole numbers: a channel delta from 0 to 255,
7485
7498
  a nonnegative safe integer pixel limit, and a nonnegative safe integer warm-up
7486
7499
  cap. The rig must have an idle of positive duration. Core's warm-up search is
7487
7500
  incompatible with `check --environment`.
@@ -8029,12 +8042,12 @@ rig directory, copied away from its `parts.json`, reads `5 of 10`: the gate, the
8029
8042
 
8030
8043
  ### Composing several characters (`compose`, issue #74)
8031
8044
 
8032
- `rig-parts compose --scene <scene.json> --out <dir> [--requirements <file.json>] [--accept <bar>[,<bar>…]] [--page-size <px>] [--loop-seam-bar <channel-delta,pixels> --loop-seam-cap <loops>]`
8045
+ `rig-parts compose --scene <scene.json> --out <dir> [--requirements <file.json>] [--accept <bar>[,<bar>…]] [--page-size <px>] [--loop-seam-bar <channel-delta,pixels> --loop-seam-cap <loops>] [--output-profile preview] [--no-extremes]`
8033
8046
  binds characters this package already built into one rig. Each character runs the
8034
8047
  single-character path (§4, steps 0–9) on its own, already isolated input to a green
8035
8048
  `build` first; compose reads what that build wrote and changes nothing in it.
8036
- The paired loop seam flags apply to the composed idle under `<out>/check/`, at
8037
- the same viewport compose uses for the shipped frames.
8049
+ With default diagnostics or `--no-extremes`, the paired loop seam flags apply to
8050
+ the composed idle under `<out>/check/`, at the viewport used for the shipped frames.
8038
8051
 
8039
8052
  ```
8040
8053
  { "spec": "spine-parts-scene/1",
@@ -8351,6 +8364,36 @@ character's input arrives isolated); a composed `parts.json`, so the bars that
8351
8364
  read See-through tags are measured per character by its own `build`, not over the
8352
8365
  scene; a rig `build` did not write.
8353
8366
 
8367
+ #### Compose output profiles (issue #1610)
8368
+
8369
+ | Options | Omitted diagnostics under `<out>/check/` | Successful terminal verdict | `compose-run.json` `output_profile` |
8370
+ | --- | --- | --- | --- |
8371
+ | Neither flag | None selected for omission | `compose: PASS — …` | absent |
8372
+ | `--no-extremes` alone | `extremes/`, as in `check` and `build` | `compose: NO EXTREMES — checks met; …` | `"no-extremes"` |
8373
+ | `--output-profile preview`, with or without `--no-extremes` | `extremes/`, `idle_frames/`, `contact.png`, `motion_heat.png` | `compose: PREVIEW — checks met; …` | `"preview"` |
8374
+
8375
+ Preview uses Core's stock idle renderer and the existing readers for its
8376
+ frames and geometry. With any `canvas_clip: true` character, that render uses
8377
+ the authored stage viewport. Core generates a contact sheet alongside the
8378
+ temporary idle frames. Parts removes the idle render directory before preview
8379
+ success, skips copying the contact sheet to `check/contact.png`, and skips
8380
+ generating `check/motion_heat.png`. The rig-c gate, packed build, camera binding
8381
+ and check requirements still apply. The `[check]` diagnostics
8382
+ lines give the chosen flag as the reason for `extremes: SKIP` and, in preview,
8383
+ `idle diagnostics: SKIP`. These lines describe output omissions. Each bar and
8384
+ requirement retains its own outcome. Failed checks and accepted failing input
8385
+ bars still exit 1 and leave no compose receipt.
8386
+
8387
+ `preview` is the only accepted value for `--output-profile`. A valid pair of
8388
+ `--loop-seam-bar` and `--loop-seam-cap` in preview exits 1 with
8389
+ `COMPOSE_PREVIEW_REQUIRED_CHECK` (`found=preview, required=default or no-extremes`).
8390
+ The declared physics-on seam check embeds Core's `loop_seam` evidence in
8391
+ `check.json`. Its `first` and `wrap` entries bind the relative paths and SHA-256
8392
+ hashes of `f0000.png` and `loop-wrap.png` under the idle render directory.
8393
+ Both files must remain under `check/idle_frames/` for readers to verify the
8394
+ seam evidence after the run. This refusal clears `rig/`, `check/`, `scene.json` and
8395
+ `compose-run.json` under `--out` before the gate.
8396
+
8354
8397
  #### Keyed scene camera (issue #1596)
8355
8398
 
8356
8399
  A camera projects an already posed scene into the fixed canvas. It follows the
@@ -8459,11 +8502,12 @@ The rig-c gate, composed rig and packed atlas retain the full art, geometry and
8459
8502
  motion so offstage parts can enter the canvas during playback.
8460
8503
 
8461
8504
  When any character opts in, compose gives check renders the authored stage as
8462
- their viewport. Explicit diagnostic viewports take precedence. The retained
8505
+ their viewport, including the temporary stock idle render in preview. Explicit
8506
+ diagnostic viewports take precedence. With default diagnostics or `--no-extremes`, the retained
8463
8507
  `check/idle_frames/` and `check/contact.png` use check's existing preview size
8464
8508
  cap and sampling rate. `check/idle_frames/frames.json` records the stage in
8465
- `viewport` and identifies the pin in `pinned.by` as `--viewport`. Extremes use
8466
- their existing explicit diagnostic grid over the same stage box.
8509
+ `viewport` and identifies the pin in `pinned.by` as `--viewport`. The default
8510
+ extremes use their explicit diagnostic grid over the same stage box.
8467
8511
  The stage rectangle is `[-width/2, 0, width, height]` in rig-c world coordinates,
8468
8512
  y up. To verify native canvas pixels, render the packed build with the stage
8469
8513
  rectangle as `--viewport` and the larger canvas dimension as `--max`.
@@ -8483,12 +8527,13 @@ every character in the declared draw order.
8483
8527
  A fully green compose writes `compose-run.json` at the `--out` root, beside
8484
8528
  `scene.json`, with spec `rig-compose-run/1`. It removes a previous record before
8485
8529
  the stage begins, including before stage option validation; a refused input,
8486
- rig-c gate, check or accepted failing character leaves no record. With neither
8487
- canvas clipping nor a placement pivot declared, the existing rig, scene report
8488
- and check bytes and paths are stable. Core's separate `check/build/run.json`
8489
- retains its own clocks.
8530
+ rig-c gate, check or accepted failing character leaves no record. With default
8531
+ diagnostics and neither canvas clipping nor a placement pivot declared, the
8532
+ existing rig, scene report and check bytes and paths are stable. Core's separate
8533
+ `check/build/run.json` retains its own clocks.
8490
8534
 
8491
- The fixed top-level key order is `spec`, `scene`, `characters`, `plate`, `plates`:
8535
+ The fixed top-level key order is `spec`, `scene`, `characters`, `plate`, `plates`,
8536
+ then `output_profile` when selected.
8492
8537
 
8493
8538
  | entry | exact binding |
8494
8539
  | --- | --- |
@@ -8496,6 +8541,7 @@ The fixed top-level key order is `spec`, `scene`, `characters`, `plate`, `plates
8496
8541
  | `characters` | sorted by `id` in code-unit order. Each row has `id`, `build`, `files`, then `placement` only for `canvas_clip: true`. `build` is as declared and `files` contains `{path, sha256}` entries sorted by build-relative `path`. `placement` holds `{canvas_clip: true, bounds, clipped_bounds}` from the scene report |
8497
8542
  | `plate` | legacy plate `{path, sha256}`, with its image path as declared relative to the scene file, or `null` when absent |
8498
8543
  | `plates` | every named plate `{name, path, sha256}`, sorted by `name` in code-unit order; image paths as declared relative to the scene file; `[]` when absent |
8544
+ | `output_profile` | `"preview"` for `--output-profile preview`, including when paired with `--no-extremes`; `"no-extremes"` for `--no-extremes` alone; absent for default diagnostics |
8499
8545
 
8500
8546
  The raw `scene.sha256` binds the placement pivot declaration and its authored
8501
8547
  tracks. A pivot adds no receipt field. The `placement` entry retains its canvas
@@ -8510,13 +8556,14 @@ It does not enumerate the build directory: unused images, packed pages,
8510
8556
  source configs and the character's own `run.json` are excluded. A declared
8511
8557
  `parts.json` painting binding and editor receipts keep their existing validation;
8512
8558
  their declarations are bound through the containing input bytes. This record
8513
- inventories the listed compose inputs, not external requirements or CLI options.
8559
+ inventories the listed compose inputs and the selected output profile. External
8560
+ requirements and other CLI options are outside its inventory.
8514
8561
 
8515
8562
  Hashes are captured from the same byte buffers consumed before the gate, never
8516
8563
  by rereading inputs after it. Image hashes bind encoded file bytes, including
8517
8564
  any trailing bytes, rather than decoded pixels. Identical inputs at identical
8518
- supplied paths give identical record bytes; there are no clocks. A changed byte
8519
- changes its input entry's hash; if multiple entries reference one physical file,
8565
+ supplied paths with the same output profile give identical record bytes. A changed
8566
+ byte changes its input entry's hash. If multiple entries reference one physical file,
8520
8567
  each reference changes. Missing scene, build and plate files retain their named
8521
8568
  `SCENE_FILE`, `SCENE_BUILD_PRESENT` and `SCENE_PLATE_PRESENT` refusals.
8522
8569
 
@@ -10798,27 +10845,27 @@ Internal `SeamSupport.drawings` never enters check JSON. Named requirement
10798
10845
  | `SETUP_MATCHES_PAINTING.regions[].slots` | `SETUP_MATCHES_PAINTING.regions[].slots` | part when the supplied mapping resolves a piece; otherwise rig | evidence | resolved piece for slot; otherwise [] | [setuppainting.ts:176](../src/setuppainting.ts#L176) |
10799
10846
  | `SOURCE_EXPOSURE.rows` | `SOURCE_EXPOSURE.rows` | 'part' | finding when declared !== undefined && r.px > declared.max_px; otherwise evidence | [r.part] | [sourceexposure.ts:292](../src/sourceexposure.ts#L292) |
10800
10847
  | `SOURCE_EXPOSURE.unmeasured` | `SOURCE_EXPOSURE.unmeasured` | part when the supplied mapping resolves a piece; otherwise rig | finding when declared !== undefined; otherwise evidence | resolved piece for u.slot; otherwise [] | [sourceexposure.ts:293](../src/sourceexposure.ts#L293) |
10801
- | `STILL_REGIONS_DARK.*.crossing` | `STILL_REGIONS_DARK.*.crossing` | part when the supplied mapping resolves a piece; otherwise rig | finding | resolved piece for sl.name; otherwise [] | [check.ts:9523](../src/check.ts#L9523) |
10802
- | `STILL_REGIONS_DARK.*.still_slots` | `STILL_REGIONS_DARK.*.still_slots` | part when the supplied mapping resolves a piece; otherwise rig | evidence; finding when r.max > tolerance; otherwise evidence | resolved piece for slot; otherwise [] | [check.ts:9509](../src/check.ts#L9509), [check.ts:9514](../src/check.ts#L9514) |
10848
+ | `STILL_REGIONS_DARK.*.crossing` | `STILL_REGIONS_DARK.*.crossing` | part when the supplied mapping resolves a piece; otherwise rig | finding | resolved piece for sl.name; otherwise [] | [check.ts:9537](../src/check.ts#L9537) |
10849
+ | `STILL_REGIONS_DARK.*.still_slots` | `STILL_REGIONS_DARK.*.still_slots` | part when the supplied mapping resolves a piece; otherwise rig | evidence; finding when r.max > tolerance; otherwise evidence | resolved piece for slot; otherwise [] | [check.ts:9523](../src/check.ts#L9523), [check.ts:9528](../src/check.ts#L9528) |
10803
10850
  | `STRESS_OFF_CHAIN.not_read` | `STRESS_OFF_CHAIN.not_read` | 'part' | evidence | [r.part] | [check.ts:4299](../src/check.ts#L4299) |
10804
10851
  | `STRESS_OFF_CHAIN.per_part` | `STRESS_OFF_CHAIN.per_part` | 'part' | finding when poses.some(p => typeof p.reading === 'number' && p.reading > STRESS_RIGID); otherwise evidence | [r.part] | [check.ts:4287](../src/check.ts#L4287) |
10805
10852
  | `STRESS_OFF_CHAIN.per_part[].off_chain` | `STRESS_OFF_CHAIN.per_part[].off_chain` | 'part' | evidence | [r.part] | [check.ts:4287](../src/check.ts#L4287) |
10806
10853
  | `STRESS_OFF_CHAIN.per_part[].poses` | `STRESS_OFF_CHAIN.per_part[].poses` | 'part' | evidence; finding when shown > STRESS_RIGID; otherwise evidence | [r.part] | [check.ts:4255](../src/check.ts#L4255), [check.ts:4273](../src/check.ts#L4273) |
10807
- | `TEXTURE_STRETCH.per_mesh` | `TEXTURE_STRETCH.per_mesh` | part when the supplied mapping resolves a piece; otherwise rig | evidence; finding when severity > TEXTURE_STRETCH_CEILING; otherwise evidence | resolved piece for m.slot; otherwise [] | [check.ts:10290](../src/check.ts#L10290), [check.ts:10300](../src/check.ts#L10300) |
10808
- | `TIP_OVER_ROOT.parts` | `TIP_OVER_ROOT.parts` | 'part' | evidence; finding when !ok && !(!rigid && hanging.onLink && Math.max(c.root, c.tip) < TIP_TRAVEL_FLOOR); otherwise evidence | [p.name] | [check.ts:8898](../src/check.ts#L8898), [check.ts:8903](../src/check.ts#L8903), [check.ts:8924](../src/check.ts#L8924), [check.ts:8935](../src/check.ts#L8935) |
10854
+ | `TEXTURE_STRETCH.per_mesh` | `TEXTURE_STRETCH.per_mesh` | part when the supplied mapping resolves a piece; otherwise rig | evidence; finding when severity > TEXTURE_STRETCH_CEILING; otherwise evidence | resolved piece for m.slot; otherwise [] | [check.ts:10304](../src/check.ts#L10304), [check.ts:10314](../src/check.ts#L10314) |
10855
+ | `TIP_OVER_ROOT.parts` | `TIP_OVER_ROOT.parts` | 'part' | evidence; finding when !ok && !(!rigid && hanging.onLink && Math.max(c.root, c.tip) < TIP_TRAVEL_FLOOR); otherwise evidence | [p.name] | [check.ts:8912](../src/check.ts#L8912), [check.ts:8917](../src/check.ts#L8917), [check.ts:8938](../src/check.ts#L8938), [check.ts:8949](../src/check.ts#L8949) |
10809
10856
  | `WIND_BAND.pairs` | `WIND_BAND.pairs` | 'pair' | finding when !holdsAll; otherwise evidence | [p.a, p.b] | [check.ts:6833](../src/check.ts#L6833) |
10810
10857
  | `WIND_BAND.pairs[].steps` | `WIND_BAND.pairs[].steps` | 'pair' | finding when !s.holds; otherwise evidence | [p.a, p.b] | [check.ts:6844](../src/check.ts#L6844) |
10811
10858
  | `figure_openings.openings` | `figure_openings.openings` | 'pair' | finding | [ps.under, ps.above] | [check.ts:6150](../src/check.ts#L6150) |
10812
- | `loop_physics` | `loop_physics` | 'rig' | evidence | [] | [check.ts:7935](../src/check.ts#L7935) |
10813
- | `requirements.lines.* (bone)` | `requirements.lines.*` | 'rig' | finding when line.status === 'FAIL'; otherwise evidence | [] | [check.ts:8266](../src/check.ts#L8266) |
10814
- | `requirements.lines.* (seam)` | `requirements.lines.*` | 'pair' | finding when line.status === 'FAIL'; otherwise evidence | [r.part, r.neighbour] | [check.ts:8266](../src/check.ts#L8266) |
10815
- | `requirements.lines.* (stretch)` | `requirements.lines.*` | part when the supplied mapping resolves a piece; otherwise rig | finding when line.status === 'FAIL'; otherwise evidence | resolved piece for r.slot; otherwise [] | [check.ts:8266](../src/check.ts#L8266) |
10859
+ | `loop_physics` | `loop_physics` | 'rig' | evidence | [] | [check.ts:7947](../src/check.ts#L7947) |
10860
+ | `requirements.lines.* (bone)` | `requirements.lines.*` | 'rig' | finding when line.status === 'FAIL'; otherwise evidence | [] | [check.ts:8280](../src/check.ts#L8280) |
10861
+ | `requirements.lines.* (seam)` | `requirements.lines.*` | 'pair' | finding when line.status === 'FAIL'; otherwise evidence | [r.part, r.neighbour] | [check.ts:8280](../src/check.ts#L8280) |
10862
+ | `requirements.lines.* (stretch)` | `requirements.lines.*` | part when the supplied mapping resolves a piece; otherwise rig | finding when line.status === 'FAIL'; otherwise evidence | resolved piece for r.slot; otherwise [] | [check.ts:8280](../src/check.ts#L8280) |
10816
10863
  | `seam_cells.frames` | `frames` | 'pair' | evidence | [p.a, p.b] | [check.ts:5030](../src/check.ts#L5030) |
10817
10864
  | `seam_cells.frames[].cells` | `frames[].cells` | part when the supplied mapping resolves a piece; otherwise rig | evidence | resolved piece for cell.setupTop ?? ''; otherwise [] | [check.ts:4990](../src/check.ts#L4990) |
10818
10865
  | `seam_pairs` | `seam_pairs`; `seam_scope.whole_pairs`; `sets.*.seam_pairs`; `sets.*.seam_scope.whole_pairs` | subjects.length === 0 ? 'rig' : subjects.length === 1 ? 'part' : 'pair' | evidence | subjects | [check.ts:2708](../src/check.ts#L2708) |
10819
10866
  | `seam_scope.changes` | `seam_scope.changes`; `sets.*.seam_scope.changes` | 'rig' | evidence | [] | [check.ts:2186](../src/check.ts#L2186) |
10820
10867
  | `seam_scope.domain.states` | `seam_scope.domain.states`; `sets.*.seam_scope.domain.states` | 'rig' | evidence | [] | [check.ts:2271](../src/check.ts#L2271) |
10821
- | `seam_scope.pairs` | `seam_scope.pairs`; `sets.*.seam_scope.pairs` | subjects.length === 0 ? 'rig' : subjects.length === 1 ? 'part' : 'pair' | evidence | subjects | [check.ts:7785](../src/check.ts#L7785) |
10868
+ | `seam_scope.pairs` | `seam_scope.pairs`; `sets.*.seam_scope.pairs` | subjects.length === 0 ? 'rig' : subjects.length === 1 ? 'part' : 'pair' | evidence | subjects | [check.ts:7797](../src/check.ts#L7797) |
10822
10869
  | `seam_scope.population.pairs` | `seam_scope.population.pairs`; `sets.*.seam_scope.population.pairs` | 'pair' | evidence | row.parts | [check.ts:2642](../src/check.ts#L2642) |
10823
10870
  | `seam_scope.population.single_art` | `seam_scope.population.single_art`; `sets.*.seam_scope.population.single_art` | 'part' | evidence | [row.part] | [check.ts:2643](../src/check.ts#L2643) |
10824
10871
 
package/docs/STABILITY.md CHANGED
@@ -602,7 +602,7 @@ and do not certify visibility. See the
602
602
  | `check` | `--rig`, `--out`; optional `--parts`, `--source`, `--page-edges`, `--pack-shape`, `--page-size`, `--requirements`, `--seam-pairs`, `--keep-stills`, `--no-extremes` (issue #829), `--set` or `--all-sets` (issue #454), `--environment` (issue #538, additive), `--wind-band` (issue #590, additive), paired `--loop-seam-bar` and `--loop-seam-cap` (issue #1590), `--json` (issue #904), `--help` (`-h`) |
603
603
  | `loop` | `--frames`, `--out`; optional `--palette`, `--help` (`-h`) |
604
604
  | `build` | `--config`, `--source`, `--full`, `--out`; optional `--head` (as for `assemble`), `--seam`, `--project`, `--page-edges`, `--pack-shape`, `--page-size`, `--loop`, `--lead-in`, `--requirements`, `--idle-keys`, `--seam-pairs`, `--keep-stills`, `--no-extremes` (issue #829), `--alt` (as for `assemble`, issue #454), `--set` or `--all-sets` (as for `check`, issue #454), `--environment` (as for `check`, issue #538, additive), `--wind-band` (as for `check`, issue #590, additive), `--help` (`-h`) |
605
- | `compose` | `--scene`, `--out`; optional `--requirements`, `--accept`, `--page-size`, paired `--loop-seam-bar` and `--loop-seam-cap` (issue #1590), `--help` (`-h`) |
605
+ | `compose` | `--scene`, `--out`; optional `--requirements`, `--accept`, `--page-size`, paired `--loop-seam-bar` and `--loop-seam-cap` (issue #1590), `--output-profile` (`preview`) and `--no-extremes` (issue #1610), `--help` (`-h`) |
606
606
  | `mesh-draft` | `--config`, `--parts`, `--out`; optional `--requirements`, `--idle-keys` (ctl, direct), `--page-edges` (pot, free), `--pack-shape` (rect, polygon), `--page-size`, `--more-triangles`, `--help` (`-h`) |
607
607
  | `mesh-stats` | `--config`, `--parts`; optional `--help` (`-h`) (issue #566, additive: prints, writes nothing) |
608
608
  | `remesh` | `--rig`, `--config`, `--parts`, `--part`, `--out`, and one of `--mesh` or `--delta` (issue #526); optional `--requirements`, `--idle-keys` (ctl, direct), `--page-edges` (pot, free), `--pack-shape` (rect, polygon), `--page-size`, `--record-input-check` and `--input-check` (issue #617, additive: without them nothing `remesh` prints or writes changes), `--help` (`-h`) |
@@ -1194,7 +1194,8 @@ execution in historical evidence is inferred from a current export.
1194
1194
  | 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. |
1195
1195
  | 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, output bytes and console text. 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). |
1196
1196
  | 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 preserves default output bytes at the same paths, subject to the existing Core receipt clocks. |
1197
- | `compose-run.json` | `compose` | spec `rig-compose-run/1` (issue #1348), separate from `rig-run/1`; a stable contract as of 2.44.0. Written at the `--out` root only after the gate and check are green and no accepted failing character remains, so an `--accept` preview writes none. Fixed keys in order: `spec`, `scene` (`path`, `sha256`), `characters` (each `id`, `build`, `files`, each file `path`, `sha256`, then optional `placement`), `plate` (`path`, `sha256`, or null), `plates` (each `name`, `path`, `sha256`). Scene and plate paths are the supplied and declared paths; character file paths are build-relative. Characters sort by `id`, files by `path`, named plates by `name`, in code-unit order. Each character's files are exactly `check/check.json`, `parts.json`, `rig/rig.json`, `rig/motion.json` and each distinct image the default skin names under `rig/images/`, including a generator's depth image. Every `sha256` is of the raw file bytes compose consumed before the gate. Only a character with `canvas_clip: true` has `placement`, with `canvas_clip: true`, `bounds` and `clipped_bounds` in that order from the scene report. There are no clocks, directory extras, requirements or CLI-option inventory, so identical inputs at identical supplied paths give identical record bytes. Compose owns the name: a file of that name at the `--out` root is deleted at the start of every compose, before stage validation, so a refused rerun leaves none. For scenes without opt-in, legacy outputs retain stable bytes, with the existing nested Core receipt clock comparison described above. |
1197
+ | `compose-run.json` | `compose` | spec `rig-compose-run/1` (issue #1348), separate from `rig-run/1`; a stable contract as of 2.44.0. Written at the `--out` root only after the gate and check are green and no accepted failing character remains. Fixed keys in order: `spec`, `scene` (`path`, `sha256`), `characters` (each `id`, `build`, `files`, each file `path`, `sha256`, then optional `placement`), `plate` (`path`, `sha256`, or null), `plates` (each `name`, `path`, `sha256`), then optional `output_profile` (`"preview"` or `"no-extremes"`, issue #1610). Scene and plate paths are the supplied and declared paths; character file paths are build-relative. Characters sort by `id`, files by `path`, named plates by `name`, in code-unit order. Each character's files are exactly `check/check.json`, `parts.json`, `rig/rig.json`, `rig/motion.json` and each distinct image the default skin names under `rig/images/`, including a generator's depth image. Every `sha256` is of the raw file bytes compose consumed before the gate. Only a character with `canvas_clip: true` has `placement`, with `canvas_clip: true`, `bounds` and `clipped_bounds` in that order from the scene report. Identical inputs at identical supplied paths with the same output profile give identical record bytes. The receipt inventories the listed inputs and selected profile, without clocks. Compose owns the name: a file of that name at the `--out` root is deleted at the start of every compose, before stage validation, so a refused rerun leaves none. |
1198
+ | compose output profiles | `compose` | Issue #1610 adds `--no-extremes` to omit only the extremes diagnostic renders, and `--output-profile preview` to also omit `check/idle_frames/`, `check/contact.png` and `check/motion_heat.png`. Preview takes precedence when both flags are given. Preview uses the stock idle render and existing readers. Before preview success, Parts removes the idle render directory, including Core's temporary contact sheet, skips copying the sheet to the check root, and skips generating heat. Each omission has a diagnostic `SKIP` line naming its selected flag. The gate, camera binding and check requirements still apply. Success prints `compose: PREVIEW — checks met; …` or `compose: NO EXTREMES — checks met; …`, respectively, and writes `output_profile` as `"preview"` or `"no-extremes"`. Default compose keeps its existing file bytes (with the nested Core receipt clock comparison described above), output paths and `compose: PASS — …` line. `COMPOSE_PREVIEW_REQUIRED_CHECK` refuses a valid loop seam pair in preview with `found=preview, required=default or no-extremes`, because the `loop_seam` record in `check.json` binds the paths and hashes of first and wrap PNGs that must remain under `check/idle_frames/`. Compose clears its owned outputs before this refusal. See [Compose output profiles](AUTHORING.md#compose-output-profiles-issue-1610). |
1198
1199
  | the scene report | `compose` | spec `spine-parts-scene-report/1`; the plate block carries `sha256` of the plate PNG's bytes after `size` (issue #1183, additive under *What "stable" means here*: a new report key in a minor version, so the spec stays `/1`); `pack_mode` records `page_size` only when `--page-size <px>` is given (issue #1352, additive; without `--page-size`, rigc's default 2048 px page and padding 2 on each side bound any plate or region side to at most 2044 px before `CE_ATLAS_REGION_EXCEEDS_PAGE`) |
1199
1200
  | 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. Report /1 and the existing output inventory and bytes are preserved for scenes without a camera, subject to the existing Core receipt clocks. 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) |
1200
1201
  | `idle.png`, `idle-indexed.png`, `idle.gif` | `loop`, `build --loop` | APNG and GIF encodings of the rendered idle |
@@ -1333,7 +1334,9 @@ number from 0 to 255, and the pixel limit and cap are nonnegative safe integers.
1333
1334
  The pair requires a positive idle period and is incompatible with `--environment`.
1334
1335
  Core selects the first take meeting the RGBA bar from warm-up 0 through the cap,
1335
1336
  at the viewport used for the shipped idle, including the canvas viewport when
1336
- compose applies it. Without physics Core tries 0 only.
1337
+ compose applies it. Without physics Core tries 0 only. Compose supports the
1338
+ pair with default diagnostics or `--no-extremes`. With `--output-profile preview`,
1339
+ `COMPOSE_PREVIEW_REQUIRED_CHECK` refuses the pair before the gate.
1337
1340
 
1338
1341
  The optional `loop_seam` follows `loop_max_diff` and any `loop_physics` in the
1339
1342
  report. It contains Core's exact `rigc-loop-seam/1` object with `status: "met"`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rig-parts",
3
- "version": "2.63.1",
3
+ "version": "2.64.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": {
package/src/build.ts CHANGED
@@ -2201,6 +2201,8 @@ export interface CheckStageInput {
2201
2201
  keepStills?: boolean;
2202
2202
  /** Skip the extra extremes renders and remove stale extremes outputs (issue #829). */
2203
2203
  noExtremes?: boolean;
2204
+ /** Use the stock idle render as scratch for compose preview. */
2205
+ previewIdle?: boolean;
2204
2206
  /** Declared RGBA loop seam bar and warm-up cap for the shipped idle render (issue #1590). */
2205
2207
  loopSeam?: LoopSeamRequest;
2206
2208
  /** `check --set <name>` (issue #454): measure one declared alternate set's setup-pose seam and recomposite figures. */
@@ -2447,10 +2449,10 @@ export function requirementText(name: string, line: RequirementLine): string {
2447
2449
  * check wrote them, then the directories it wrote whole (`build`, and `idle_frames`, the requirements, seam and
2448
2450
  * setup-still directories when they were written). The `check-run.json` record lists the files under these.
2449
2451
  */
2450
- export function checkWrote(r: CheckReport, out: string): { written: string[]; dirs: string[] } {
2452
+ export function checkWrote(r: CheckReport, out: string, previewIdle = false): { written: string[]; dirs: string[] } {
2451
2453
  return {
2452
2454
  written: r.written,
2453
- dirs: ['build', ...(r.idle === null ? [] : ['idle_frames']), ...(r.requirements === null ? [] : [REQUIREMENTS_DIR]),
2455
+ dirs: ['build', ...(r.idle === null || previewIdle ? [] : ['idle_frames']), ...(r.requirements === null ? [] : [REQUIREMENTS_DIR]),
2454
2456
  ...(r.figures.seam_pairs === undefined ? [] : [SEAM_DIR]), ...(existsSync(join(out, STILL_DIR)) ? [STILL_DIR] : [])],
2455
2457
  };
2456
2458
  }
@@ -2471,7 +2473,7 @@ export function checkStage(input: CheckStageInput, rigc: RigcRunner, bin: string
2471
2473
  const r = runCheck(
2472
2474
  input.rig, input.out, rigc, input.parts, mode, input.source, input.requirements, input.seamPairs === true,
2473
2475
  input.keepStills === true, input.set, input.allSets === true, input.environment, input.requirementsAs, input.config,
2474
- input.windBand, input.noExtremes === true, input.supportSource, input.supportFigure, input.assemblyRules, input.loopSeam,
2476
+ input.windBand, input.noExtremes === true, input.supportSource, input.supportFigure, input.assemblyRules, input.loopSeam, input.previewIdle,
2475
2477
  );
2476
2478
  if (r.figures.environment !== undefined) log(` ${environmentLine(r.figures.environment)}`);
2477
2479
  log(` gate rig-play (rigc ${packedBuildLabel(mode)}), verbatim:`);
@@ -2559,7 +2561,7 @@ export function checkStage(input: CheckStageInput, rigc: RigcRunner, bin: string
2559
2561
  log(` ${summaryText(r.requirements.summary)}`);
2560
2562
  }
2561
2563
  log(` gate: rig-play ${fig.gate_spine_html_green ? 'green' : 'RED'} (${fig.rigc_entry.entry}${fig.rigc_entry.spine_core === null ? ', rigc\'s own validator' : `, the spine-core ${fig.rigc_entry.spine_core} round trip`})`);
2562
- const wrote = checkWrote(r, input.out);
2564
+ const wrote = checkWrote(r, input.out, input.previewIdle);
2563
2565
  log(` wrote ${[...wrote.written.map((w) => join(input.out, w)), ...wrote.dirs.map((d) => `${join(input.out, d)}/`)].join(', ')}`);
2564
2566
  for (const p of r.problems) log(failLine(p));
2565
2567
  log(checkSummaryLine(r));
package/src/check.ts CHANGED
@@ -233,7 +233,7 @@ const STILL_FPS = 10;
233
233
 
234
234
  /** The caller's RGBA seam bar and maximum number of warm-up loops. */
235
235
  export type LoopSeamRequest = { channelDelta: number; pixelsAbove: number; cap: number };
236
-
236
+ export const COMPOSE_PREVIEW_LOOP_SEAM_DETAIL = 'found=preview, required=default or no-extremes. The check.json loop_seam record binds the first and wrap PNG paths and hashes under check/idle_frames/, which preview removes.';
237
237
  const LOOP_SEAM_SPEC = 'rigc-loop-seam/1';
238
238
  export const LOOP_SEAM_BAR_UNMET = 'LOOP_SEAM_BAR_UNMET';
239
239
  const LOOP_SEAM_FILE = 'loop-seam.json';
@@ -6970,6 +6970,7 @@ function renderExtremes(build: string, out: string, animations: readonly string[
6970
6970
  * or `motion_heat.png`). A declared `loopSeam` requires a positive idle and
6971
6971
  * binds Core's met wrap-seam report to the shipped render. The keyed reading
6972
6972
  * still runs. `source` (`--source`) adds {@link SOURCE_LINE}.
6973
+ * Compose preview reads the stock idle render as scratch and omits the idle diagnostics.
6973
6974
  *
6974
6975
  * `requirements` (`--requirements`, issue #93) is read with the rig directory
6975
6976
  * and resolved against it before anything is built ({@link readRequirements},
@@ -6979,9 +6980,14 @@ function renderExtremes(build: string, out: string, animations: readonly string[
6979
6980
  * MEASURABLE is a problem. Without it nothing here reads, writes or prints
6980
6981
  * anything it did not before.
6981
6982
  */
6982
- export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, partsHome?: string, mode: PackMode = DEFAULT_PACK_MODE, source?: string, requirements?: string, seamPairsAsked = false, keepStills = false, set?: string, allSets = false, environment?: string, _requirementsAs: string | undefined = requirements, config?: InputFileRecord, windBand?: string, noExtremes = false, supportSource?: string, supportFigure?: Mask, assemblyRules?: AssemblyRules, loopSeam?: LoopSeamRequest): CheckReport {
6983
+ export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, partsHome?: string, mode: PackMode = DEFAULT_PACK_MODE, source?: string, requirements?: string, seamPairsAsked = false, keepStills = false, set?: string, allSets = false, environment?: string, _requirementsAs: string | undefined = requirements, config?: InputFileRecord, windBand?: string, noExtremes = false, supportSource?: string, supportFigure?: Mask, assemblyRules?: AssemblyRules, loopSeam?: LoopSeamRequest, previewIdle = false): CheckReport {
6983
6984
  const out = resolve(outDir);
6984
- if (loopSeam !== undefined) rmSync(join(out, 'check.json'), { force: true });
6985
+ if (loopSeam !== undefined || previewIdle) rmSync(join(out, 'check.json'), { force: true });
6986
+ if (previewIdle && loopSeam !== undefined) throw new PartsError([{
6987
+ code: 'COMPOSE_PREVIEW_REQUIRED_CHECK',
6988
+ object: '--loop-seam-bar',
6989
+ detail: COMPOSE_PREVIEW_LOOP_SEAM_DETAIL,
6990
+ }]);
6985
6991
  const pageSize = parsePageSize(mode.pageSize);
6986
6992
  let inp: CheckInputs;
6987
6993
  let reqFile: RequirementsFile | null = null;
@@ -7069,7 +7075,8 @@ export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, parts
7069
7075
  const animationNames = isRecord(inp.motion.animations) ? Object.keys(inp.motion.animations) : [];
7070
7076
  const selectedAlts = inp.parts === null || (set === undefined && !allSets) ? []
7071
7077
  : allSets ? inp.parts.alternates ?? [] : (inp.parts.alternates ?? []).filter(alt => alt.name === set);
7072
- preflightCheckPaths(animationNames, selectedAlts.map(alt => alt.name), reqFile, noExtremes);
7078
+ const omitExtremes = noExtremes || previewIdle;
7079
+ preflightCheckPaths(animationNames, selectedAlts.map(alt => alt.name), reqFile, omitExtremes);
7073
7080
  // A measured material failure is a check bar; unavailable data is a refusal.
7074
7081
  const rigcEntry = readRigcEntry(requireRigcVersion(rigc));
7075
7082
  /**
@@ -7102,6 +7109,9 @@ export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, parts
7102
7109
  const seamMotionDir = join(out, MOTION_SEAM_SCRATCH);
7103
7110
  const windBandDir = join(out, WIND_BAND_SCRATCH);
7104
7111
  for (const d of [join(out, 'extremes'), join(out, '_extremes'), buildDir, buildReportPath, idleDir, stillDir, isoDir, loopDir, seamDir, keptDir, join(out, 'setup_still_auto'), foldDir, seamMotionDir, windBandDir]) rmSync(d, { recursive: true, force: true });
7112
+ if (previewIdle) {
7113
+ for (const name of ['contact.png', 'motion_heat.png']) rmSync(join(out, name), { force: true });
7114
+ }
7105
7115
  const written: string[] = [];
7106
7116
  const write = (name: string, data: string): void => {
7107
7117
  writeFileSync(join(out, name), data);
@@ -7221,7 +7231,7 @@ export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, parts
7221
7231
  }
7222
7232
  loopSeamEvidence = checked?.report ?? null;
7223
7233
  const contact = join(idle.dir, 'contact.png');
7224
- if (existsSync(contact)) {
7234
+ if (!previewIdle && existsSync(contact)) {
7225
7235
  copyFileSync(contact, join(out, 'contact.png'));
7226
7236
  written.push('contact.png');
7227
7237
  }
@@ -7248,9 +7258,11 @@ export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, parts
7248
7258
  loop = maxRgbDiff(kept.frames[0].image, keptLast.image);
7249
7259
  loopSet = kept;
7250
7260
  }
7251
- const idleImages = idle.frames.map((f) => f.image);
7252
- writePng(join(out, 'motion_heat.png'), motionHeat(idleImages));
7253
- written.push('motion_heat.png');
7261
+ if (!previewIdle) {
7262
+ const idleImages = idle.frames.map((f) => f.image);
7263
+ writePng(join(out, 'motion_heat.png'), motionHeat(idleImages));
7264
+ written.push('motion_heat.png');
7265
+ }
7254
7266
  }
7255
7267
 
7256
7268
  // 3a. every animation, the idle included, read for folds by rigc (issues #320, #333, #363) — only when there is one; at
@@ -7327,7 +7339,7 @@ export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, parts
7327
7339
  level = levelLine(feet, inp.rig, levelReadings, fps, stripped.physics.length, levelProblems);
7328
7340
  }
7329
7341
  }
7330
- if (!noExtremes) extremesFrames = readJson(join(stripped === null ? foldDir : join(foldDir, 'on'), 'frames.json'), []);
7342
+ if (!omitExtremes) extremesFrames = readJson(join(stripped === null ? foldDir : join(foldDir, 'on'), 'frames.json'), []);
7331
7343
  } finally {
7332
7344
  rmSync(foldDir, { recursive: true, force: true });
7333
7345
  }
@@ -8019,13 +8031,14 @@ export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, parts
8019
8031
  ...readings,
8020
8032
  PASS: problems.length === 0,
8021
8033
  };
8034
+ if (previewIdle) rmSync(idleDir, { recursive: true, force: true });
8022
8035
  const publishCheck = (): void => {
8023
8036
  publishMotionSeamCells(out, motionSeam.required, motionCellEvidence, () => write('check.json', serializeCheckRows(figures)));
8024
8037
  if (motionSeam.required?.cells !== undefined) written.push(MOTION_CELLS_FILE);
8025
8038
  };
8026
8039
  if (motionSeam.worlds === undefined) publishCheck();
8027
8040
  else publishMotionSeamWorlds(out, seamMotionDir, motionSeam.worlds, publishCheck);
8028
- const extremes = noExtremes ? [] : renderExtremes(buildDir, out, animationNames, idle === null ? extremesFrames : readJson(join(idleDir, 'frames.json'), []), extremesFrames, measured);
8041
+ const extremes = omitExtremes ? [] : renderExtremes(buildDir, out, animationNames, idle === null ? extremesFrames : readJson(join(idleDir, 'frames.json'), []), extremesFrames, measured);
8029
8042
  if (existsSync(join(out, 'extremes'))) written.push('extremes/');
8030
8043
  const bars: CheckReport['bars'] = { measured: ['gate'], skipped: [] };
8031
8044
  const tally = (bar: string, reason: string | null): void => {
@@ -8081,6 +8094,7 @@ export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, parts
8081
8094
  ...(windBandRead === null ? {} : { windBand: windBandRead }),
8082
8095
  };
8083
8096
  } finally {
8097
+ if (previewIdle) rmSync(idleDir, { recursive: true, force: true });
8084
8098
  rmSync(seamMotionDir, { recursive: true, force: true });
8085
8099
  }
8086
8100
  }
package/src/runstamp.ts CHANGED
@@ -36,7 +36,7 @@ export interface RunStampFileEntry {
36
36
  sha256: string;
37
37
  }
38
38
 
39
- /** Compose's consumed inputs and opted-in placement, captured before its gate. */
39
+ /** Compose's consumed inputs and placement, with the output profile recorded on success. */
40
40
  export interface ComposeRun {
41
41
  spec: typeof COMPOSE_RUN_SPEC;
42
42
  scene: RunStampFileEntry;
@@ -52,6 +52,7 @@ export interface ComposeRun {
52
52
  }>;
53
53
  plate: RunStampFileEntry | null;
54
54
  plates: Array<{ name: string; path: string; sha256: string }>;
55
+ output_profile?: 'preview' | 'no-extremes';
55
56
  }
56
57
 
57
58
  export interface RunStampInputEntry<Role extends string = RunStampInputRole> {
package/src/scene.ts CHANGED
@@ -109,7 +109,7 @@ import { documentPageLookup, readModel, type ModelPageRegion } from '@rig-c/core
109
109
  import { CandidateAtlasError, CandidatePairError, CoreInputError, loadCandidate, PoserChoiceError, projector, renderFrame, SpineRuntimeError, throughPoser, type Piece, type Quad, type Viewport } from '@rig-c/core/render-shared';
110
110
  import { deformSliderCombinationProblem, type RigStop } from '@rig-c/core/rig';
111
111
  import { checkStage, gateThroughRigc, type Log } from './build.ts';
112
- import { ACCEPTABLE_BARS, barsNotMet, CHECK_SPEC, type CheckReport, DEFAULT_PACK_SHAPE, DEFAULT_PAGE_EDGES, IDLE_FPS, LOOP_SEAM_BAR_UNMET, type LoopSeamRequest, type PackMode, parsePageSize, requirementsNotPass, type RigcRunner } from './check.ts';
112
+ import { ACCEPTABLE_BARS, barsNotMet, CHECK_SPEC, type CheckReport, COMPOSE_PREVIEW_LOOP_SEAM_DETAIL, DEFAULT_PACK_SHAPE, DEFAULT_PAGE_EDGES, IDLE_FPS, LOOP_SEAM_BAR_UNMET, type LoopSeamRequest, type PackMode, parsePageSize, requirementsNotPass, type RigcRunner } from './check.ts';
113
113
  import { CONSTRAINT_BONE_FIELDS, editorReceiptProblems, ROOT_BONE } from './config.ts';
114
114
  import { cropToSpineY } from './coords.ts';
115
115
  import { failLine, PartsError, type Problem, refuseIfAny } from './errors.ts';
@@ -2414,6 +2414,8 @@ export interface ComposeInput {
2414
2414
  requirements?: string;
2415
2415
  /** Declared RGBA loop seam bar and warm-up cap for the composed idle render (issue #1590). */
2416
2416
  loopSeam?: LoopSeamRequest;
2417
+ /** The selected output profile, absent for the full diagnostics (issue #1610). */
2418
+ outputProfile?: ComposeRun['output_profile'];
2417
2419
  /** `--accept`: the bars every character's own check may fail and still be composed (issue #203). */
2418
2420
  accept?: readonly string[];
2419
2421
  }
@@ -2434,6 +2436,17 @@ export interface ComposeResult {
2434
2436
  check: CheckReport | null;
2435
2437
  }
2436
2438
 
2439
+ /** Refuse before resolving rigc in the CLI, and before the gate for direct stage callers. */
2440
+ export function refusePreviewLoopSeam(input: ComposeInput): void {
2441
+ if (input.outputProfile !== 'preview' || input.loopSeam === undefined) return;
2442
+ for (const p of COMPOSE_OWNS) rmSync(join(input.out, p), { recursive: true, force: true });
2443
+ throw new PartsError([{
2444
+ code: 'COMPOSE_PREVIEW_REQUIRED_CHECK',
2445
+ object: '--loop-seam-bar',
2446
+ detail: COMPOSE_PREVIEW_LOOP_SEAM_DETAIL,
2447
+ }]);
2448
+ }
2449
+
2437
2450
  /**
2438
2451
  * Load the scene and every build, compose, gate the result through rig-c
2439
2452
  * exactly as `rig` and `build` gate theirs ({@link gateThroughRigc}: `build
@@ -2461,6 +2474,11 @@ export function composeStage(input: ComposeInput, run: ComposeRunners, log: Log)
2461
2474
  return { stoppedAt: stage, composed, check: null };
2462
2475
  };
2463
2476
  const pageSize = parsePageSize(input.pageSize);
2477
+ try {
2478
+ refusePreviewLoopSeam(input);
2479
+ } catch (err) {
2480
+ return refused('compose', err);
2481
+ }
2464
2482
  mkdirSync(input.out, { recursive: true });
2465
2483
  for (const p of COMPOSE_OWNS) rmSync(join(input.out, p), { recursive: true, force: true });
2466
2484
  const mode: PackMode = { pageEdges: DEFAULT_PAGE_EDGES, packShape: DEFAULT_PACK_SHAPE, ...(pageSize === undefined ? {} : { pageSize }) };
@@ -2559,9 +2577,9 @@ export function composeStage(input: ComposeInput, run: ComposeRunners, log: Log)
2559
2577
  writeFileSync(reportPath, rigJsonText(r));
2560
2578
  say(`${wroteRig}, and ${reportPath}`);
2561
2579
  }
2580
+ const stage = r.characters.some(c => c.canvas_clip === true) ? composed.rig.skeleton : undefined;
2562
2581
  let checkRigc = run.check;
2563
- if (r.characters.some(c => c.canvas_clip === true)) {
2564
- const stage = composed.rig.skeleton;
2582
+ if (stage !== undefined) {
2565
2583
  const viewport = [stage.x, stage.y, stage.width, stage.height].join(',');
2566
2584
  checkRigc = args => run.check(args[0] === 'render' && !args.includes('--viewport') && !args.includes('--viewport-from')
2567
2585
  ? [...args, '--viewport', viewport]
@@ -2592,6 +2610,14 @@ export function composeStage(input: ComposeInput, run: ComposeRunners, log: Log)
2592
2610
  writeFileSync(reportPath, rigJsonText(composed.report));
2593
2611
  say(`${wroteRig}, and ${reportPath}`);
2594
2612
  };
2613
+ const preview = input.outputProfile === 'preview';
2614
+ const noExtremes = input.outputProfile !== undefined;
2615
+ const checkLog = prefix('check');
2616
+ if (noExtremes) {
2617
+ const flag = preview ? '--output-profile preview' : '--no-extremes';
2618
+ checkLog(` extremes: SKIP — ${flag} omits the extra diagnostic renders`);
2619
+ }
2620
+ if (preview) checkLog(' idle diagnostics: SKIP — --output-profile preview omits idle_frames/, contact.png and motion_heat.png');
2595
2621
  let report: CheckReport;
2596
2622
  try {
2597
2623
  report = checkStage({
@@ -2599,7 +2625,9 @@ export function composeStage(input: ComposeInput, run: ComposeRunners, log: Log)
2599
2625
  ...(pageSize === undefined ? {} : { pageSize }),
2600
2626
  ...(input.requirements === undefined ? {} : { requirements: input.requirements }),
2601
2627
  ...(input.loopSeam === undefined ? {} : { loopSeam: input.loopSeam }),
2602
- }, checkRigc, run.checkBin, prefix('check'));
2628
+ ...(noExtremes ? { noExtremes: true } : {}),
2629
+ ...(preview ? { previewIdle: true } : {}),
2630
+ }, checkRigc, run.checkBin, checkLog);
2603
2631
  } catch (err) {
2604
2632
  if (cameraBindingFailed) {
2605
2633
  for (const p of COMPOSE_OWNS) rmSync(join(input.out, p), { recursive: true, force: true });
@@ -2625,8 +2653,10 @@ export function composeStage(input: ComposeInput, run: ComposeRunners, log: Log)
2625
2653
  log(`compose: stopped at check; the composed rig's check is PASS${acceptedLine} (the composed rig and scene.json are written; the scene is for looking, not shipping)`);
2626
2654
  return { stoppedAt: 'check', composed, check: report };
2627
2655
  }
2628
- writeFileSync(join(input.out, COMPOSE_RUN_FILE), rigJsonText(composed.runRecord));
2629
- log(`compose: PASS — ${report.bars.measured.length} of ${report.bars.measured.length + report.bars.skipped.length} bar(s) measured; the packed atlas under ${join(input.out, 'check', 'build')} is the artifact`);
2656
+ const runRecord = input.outputProfile === undefined ? composed.runRecord : { ...composed.runRecord, output_profile: input.outputProfile };
2657
+ writeFileSync(join(input.out, COMPOSE_RUN_FILE), rigJsonText(runRecord));
2658
+ const verdict = preview ? 'PREVIEW — checks met;' : noExtremes ? 'NO EXTREMES — checks met;' : 'PASS —';
2659
+ log(`compose: ${verdict} ${report.bars.measured.length} of ${report.bars.measured.length + report.bars.skipped.length} bar(s) measured; the packed atlas under ${join(input.out, 'check', 'build')} is the artifact`);
2630
2660
  return { stoppedAt: null, composed, check: report };
2631
2661
  }
2632
2662