@rig-c/parts 2.48.0 → 2.49.1

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
@@ -2067,7 +2067,7 @@ function cmdAssemble(args: string[]): number {
2067
2067
  const cfg = loadEarlyConfig(config, 'assemble', project as ProjectRule | undefined);
2068
2068
  if ((cfg.assemble.cuts ?? []).length === 0) return usage('assemble --emit-fill-masks requires at least one entry in config.assemble.cuts');
2069
2069
  emitFillMasksStage(
2070
- { source, full, head, config, outDir: flags.get('--emit-fill-masks') as string, ...(seam === undefined ? {} : { seam: seam as SeamRule }), ...(project === undefined ? {} : { project: project as ProjectRule }) },
2070
+ { source, full, head, config, outDir: flags.get('--emit-fill-masks') as string, ...(flags.has('--requirements') ? { requirements: flags.get('--requirements') as string } : {}), ...(seam === undefined ? {} : { seam: seam as SeamRule }), ...(project === undefined ? {} : { project: project as ProjectRule }) },
2071
2071
  console.log,
2072
2072
  );
2073
2073
  return EXIT_OK;
package/docs/AUTHORING.md CHANGED
@@ -206,7 +206,7 @@ read by no CPU stage).
206
206
  | `cloth` | `propose --cloth` only; no other stage reads it, so it moves no byte of any build | **authored**, optional (issue #364): one recipe per tag, `{"bottomwear": {…}, "back hair": {…}, "front hair": {…}}`, each `{chains, links, wind, gravity, split?, length_ratio?, strength?, damping?, alternate_damping?, translate?, swing?, part?, influence?}`. `influence` (issue #518) — `{across, max, shape, radius?}`: the parts this recipe meshes are drafted in the influence mode (`meshes.<part>.influence` above) at their lattice's cell, with `across`, `max` and `shape` as declared (each required — the reading behind the radius did not vary them) and `radius` as declared or, absent, drafted as the farthest vertex's distance plus 3 cells (the `influence.radius` row); without it the parts keep their lattice. `chains` — trees across the piece (for `back hair`, per side of the eye axis), a whole number, 1 or more; `links` — links from root to tip on every path, 1 or more; `split` — `{at, into}`: the first `at` links are the trunk, which forks into `into` (2 or more) branches; `at` below `links` (`CONFIG_CLOTH_SPLIT_BEFORE_TIP`); `length_ratio` — a path's last link over its first, above 0, default 0.5; `strength` — `{trunk, branch, edge}`, each above 0 and below the spring's stability bound (`CONFIG_CLOTH_SPRING_STABLE`), default 100 / 100 / 50; `damping` — in [0, 1], absent: rig-c's default; `alternate_damping` — the odd trees' damping, in [0, 1], beside `damping` and different from it (`CONFIG_CLOTH_ALTERNATE_DIFFERS`); `wind`, `gravity` — `[root, tip]`, each 0 or more, tip at or above root (`CONFIG_CLOTH_RESPONSE_GROWS_TO_TIP`); `translate` — the x and y mix of a dangling end's flutter, above 0 and at most 1; `swing` — `bottomwear` only, `{scales}`, one positive scale per tree (`CONFIG_CLOTH_SWING_SCALE_PER_TREE`); `part` — `bottomwear` only (`CONFIG_CLOTH_PART_ON_BOTTOMWEAR`), a non-empty part or cut-piece name: the `topwear` part that holds a skirt See-through returned inside it (a dress), or its skirt piece cut by `assemble.cuts`, which takes the skirt's trees (issue #402, *A skirt inside topwear* below; the part is checked by `propose`, `PROPOSE_CLOTH_PART`). The two defaults are the recipe's own, measured on its synthetic fixture (the recipe below). The recipe below says what each field drafts. The config written: `propose --cloth <config.json> --write-config <out.json>` (issue #537) writes this config's own text back with the sections the recipe drafts spliced in — `meshes.<part>` and `regions.<part>`, and `bones`, `constraints` and `motion.tracks` entry by entry by name (issue #552) — and every other byte as read; `--from <previous config>` (issue #571) takes an entry equal to the previous recipe's draft as the recipe's (*The config written*, under the recipe below) |
207
207
  | `proposed_rig_scale` | assemble, rig, build, `propose --from-config`/`--compare` | **proposed** by `propose` (issue #354): `parts.json`'s `scale_rig_per_source`, the `assemble.rig_scale` the rig sections (`bones`, `meshes`, `limbs`, `motion`) were drafted at. Held equal to `assemble.rig_scale` when present (`CONFIG_PROPOSED_RIG_SCALE`; 0, negative or not a number: `CONFIG_FIELD_TYPE`). Absent on a hand-authored config, where no byte of any output moves |
208
208
  | `motion_seams` | propose, assemble, check | Optional `[{part, neighbour}]`, using output part names. Each unordered pair is declared once; self-pairs, unknown names, wrong shapes and unknown fields refuse (`CONFIG_MOTION_SEAM`, `PARTS_MOTION_SEAM`, `CHECK_MOTION_SEAM_DECLARATION`). Empty adds no pair. Assemble copies the declaration into `parts.json`; check merges it with existing pairs and never regenerates a removed declaration. It uses the existing non-root WARN floor and changes no bar or exit status. See *Explicit motion seam observations* below. |
209
- | `requirements` | build (read in place of `--requirements` when the flag is not given), and so its check | **authored**, optional, never proposed (issue #556): a path, relative to the config file's directory, to the `spine-parts-requirements/1` file the build's check reads (§7, *Declared requirements*) — so a rig that needs one (a `not_swinging` part, a `may_fold`) rebuilds from its config alone. `build` reads it before assemble, as it reads the flag's file, and `check.json`'s `requirements.file` records it with `path` as declared. Given beside `--requirements`, the two must name the same file once resolved, or a file of the same bytes, and the declaration is read and recorded (a build given both writes what the config alone writes); otherwise `BUILD_REQUIREMENTS_CONFLICT`, naming both. Not a non-empty string: `CONFIG_FIELD_TYPE`; no such file, where the config is read from a path: `CONFIG_FILE_PRESENT`. `check`, `compose`, `mesh-draft`, `remesh` and `retune` do not read it: their `--requirements` is the only door. Absent, nothing is read and no byte of any output moves |
209
+ | `requirements` | build (read in place of `--requirements` when the flag is not given), and so its check; assemble, where a region take or a busy-visible figure mask reads requirements; and the assembly reading, wherever a stale check runs (`rig`, `check`, `depth-apply`) | **authored**, optional, never proposed (issue #556): a path, relative to the config file's directory, to the `spine-parts-requirements/1` file the build's check reads (§7, *Declared requirements*) — so a rig that needs one (a `not_swinging` part, a `may_fold`) rebuilds from its config alone. `build` reads it before assemble, as it reads the flag's file, and `check.json`'s `requirements.file` records it with `path` as declared. Given beside `--requirements`, the two must name the same file once resolved, or a file of the same bytes, and the declaration is read and recorded (a build given both writes what the config alone writes); otherwise `BUILD_REQUIREMENTS_CONFLICT`, naming both. When the file's content reaches assembly (a region take's `setup_painting.rgb_tolerance`, or a busy-visible `setup_painting.figure_mask`), `assemble` and `build` require this declaration to name the `--requirements` file, and refuse a flag without it as `ASSEMBLE_REQUIREMENTS_UNDECLARED` (issue #1418). Not a non-empty string: `CONFIG_FIELD_TYPE`; no such file, where the config is read from a path: `CONFIG_FILE_PRESENT`. `check`, `compose`, `mesh-draft`, `remesh` and `retune` do not read it for their own requirements: their `--requirements` is the only door. The assembly reading's stale check, which `rig`, `check` and `depth-apply` run against `parts.json`, does read it. Absent, nothing is read and no byte of any output moves |
210
210
 
211
211
  ### Drafting the chest carrier
212
212
 
@@ -990,7 +990,10 @@ one seed pixel on the target run canvas (integer x right, y down).
990
990
 
991
991
  The region is derived from base alpha < 128, donor alpha >= 128, and the
992
992
  maximum RGB channel difference after rounding each pixel source-over white.
993
- The tolerance is exactly `--requirements`' `setup_painting.rgb_tolerance`.
993
+ The tolerance is exactly `setup_painting.rgb_tolerance` in the requirements
994
+ file `config.requirements` names; `assemble --requirements` and `build
995
+ --requirements` are optional and, when given, must name the same file (the
996
+ same resolved file, or a file with the same bytes; issue #1418).
994
997
  A missing tolerance declaration is refused. The optional `reference` declares
995
998
  exactly one of `"source": true` (the stage's `--source`) or
996
999
  `"painting": "path/to/reference.png"` (config-relative), and `sha256`, the
@@ -4491,7 +4494,7 @@ existing hardlinks are refused before artifact output; the ordinary mode names
4491
4494
  | `layers <dir \| layers.json \| file.psd>` | keep the existing columns (`opaque_px` still means alpha >8) and append source-alpha boxes `drawn(a>8)` / `opaque(a>=250)` with exclusive right/bottom; name absent boxes, report the existing body-group union height at **CORE_ALPHA (>=250)** in **input-canvas px**, and show its >8 union separately; no anatomical height, ownership/erosion or painting registration is inferred ([units and rig-scale guidance](AUTHORING.md#4-the-command-order)) |
4492
4495
  | `sheet --source <png> --layers <path>… --out <png>` | a labelled contact sheet of the painting and every layer or part |
4493
4496
  | `assemble --propose-plan … [--write-config <config>]` | propose `assemble.plan` and `extend_below_crop` from the two runs, leaving out an implausible layer with a note naming the rule, naming in a note any full-run body no planned part covers, and naming every layer no row takes with why (empty, taken from the other run only, a plausibility rule; `nose`, never planned, with the row that lets `propose` read the head's pitch). Front/back hair reaching more than 8 rig pixels beyond a side or top edge receives explicit `edges`; each explicit edge has the same strict reach bar. The legacy bottom entry is retained unchanged; qualifying side/top edges receive a separate entry without bottom. With no qualifying side/top edge, the proposal remains unchanged. |
4494
- | `assemble --source --full --head --config --out [--seam] [--project]` | merge the two runs into rig-space parts, `parts.json`, the recomposite and its error map, and `run.json` (`spec` `rig-run/1`), and list the uncovered holes |
4497
+ | `assemble --source --full --head --config --out [--seam] [--project] [--requirements]` | merge the two runs into rig-space parts, `parts.json`, the recomposite and its error map, and `run.json` (`spec` `rig-run/1`), and list the uncovered holes. A region take's tolerance comes from `setup_painting.rgb_tolerance` in `config.requirements`'s file; under `ground: "busy"` with `project: "visible"`, so does `setup_painting.figure_mask`. `--requirements` is optional and, when given, must name the same file (the same resolved file, or the same bytes), or it is refused (`ASSEMBLE_REQUIREMENTS_UNDECLARED`, `BUILD_REQUIREMENTS_CONFLICT`) |
4495
4498
  | `diff-drafts --left <dir> --right <dir> --out <json>` | compare two assemble or build outputs (`rig/parts.json` + `rig/parts/` + `render/recomposite_rig.png`, or `parts.json` + `parts/` + `recomposite_rig.png`) and write `rig-parts-draft-diff/1` JSON: per-part status (`same`, `changed`, `added`, `removed`), file `sha256`, rig-pixel `box` and draw-order `index` per present side, `pixels_equal` and rig-space `pixels` (`changed_px`, `colour_px`, `alpha_px`, `bounds`) on changed parts, and `composite` ([Draft-to-draft assemble comparison](#draft-to-draft-assemble-comparison-issue-1369)) |
4496
4499
  | `head-crop-preflight --full <run> --canvas WxH --head-box '[left,top,right,bottom]'` | before the head run: JSON on stdout, one advice line per hit tag on stderr, exit 0 even when clipped. Counts original alpha > 8 full-run samples after centre registration through the square pad into painting coordinates: centres below left/top or at/above right/bottom are outside. Fractional boxes are accepted; corner samples count on both edges. No ghost cleanup, resampling, head run or assemble is needed. These counts cannot be compared with `ASSEMBLE_CROP_CLIPPED`, which counts rig pixels at alpha >= 128 after `cleanGhosts`. Preflight reads original samples before the head run exists, so soft fringes and ghost specks can be hits only here. Bottom is distinct because `extend_below_crop` handles it. Zero-hit tags remain in JSON. Existing pipeline outputs stay unchanged; help adds this command and guide reflects these documentation edits. |
4497
4500
  | `propose --head-box --full <run> --canvas WxH [--no-back-hair] [--write-config <config>]` | propose `seethrough.head_box` from the full run, held inside the painting; `--no-back-hair` leaves the back-hair layer out of that proposal |
@@ -4600,6 +4603,18 @@ than the config specifies, put the values used for assembly in `assemble.seam`
4600
4603
  and `assemble.project` in the config you pass to the standalone command.
4601
4604
  To use other values, re-run assemble with the config you intend to keep.
4602
4605
 
4606
+ A region take reads `setup_painting.rgb_tolerance` from the requirements
4607
+ file, and under `ground: "busy"` with `project: "visible"` assembly reads
4608
+ `setup_painting.figure_mask`. The digest binds both from `config.requirements`,
4609
+ so declare the file there: `assemble` reads it from there as `build` does,
4610
+ and `assemble --requirements` and `build --requirements` are optional and may
4611
+ name the same file, by any path that resolves to it or by a copy of its
4612
+ bytes. A `--requirements` file the config does not name is
4613
+ refused when either field reaches assembly
4614
+ ([`ASSEMBLE_REQUIREMENTS_UNDECLARED`](#ASSEMBLE_REQUIREMENTS_UNDECLARED), or
4615
+ [`BUILD_REQUIREMENTS_CONFLICT`](#BUILD_REQUIREMENTS_CONFLICT) when the config
4616
+ names another file), so a stamp never records a value assemble did not use.
4617
+
4603
4618
  Ordinary keyed-animation edits through `motion.animations_from` leave
4604
4619
  the assembly digest intact. Cloth changes can require reassembly when physics
4605
4620
  bone bindings change which part pairs move relative to each other under turn.
@@ -5328,7 +5343,7 @@ continues under that scarf end at all is the author's call: continued as a line
5328
5343
  its edge just above the polygon (x 306) to its edge at its hem (x 316, row 681), its
5329
5344
  outline lies right of every removed pixel, and an image of only that silhouette fills
5330
5345
  none of the 15,070 — `ASSEMBLE_UNDER_EMPTY` [observed]. Producing a hand-supplied PNG is the
5331
- author's; for a receipted plate route (issue #1230), run in order: (1) `rig-parts assemble --source <painting.png> --full <dir> [--head <dir>] --config <config.json> --emit-fill-masks <masks-dir>` to write `<masks-dir>/<into>.png` on the painting's grid (`[255, 255, 255, 255]` where `(polygon ∩ from alpha > 0)`, overlap band included, and `[0, 0, 0, 0]` elsewhere); (2) `rig-parts comfy plate --mode occluder --painting <painting.png> --occluder <masks-dir>/<into>.png --out <plate-dir>`; and (3) set `"under": {"plate": "<plate-dir>"}` on `assemble.cuts[i]` and re-run `rig-parts assemble` (or `build`).
5346
+ author's; for a receipted plate route (issue #1230), run in order: (1) `rig-parts assemble --source <painting.png> --full <dir> [--head <dir>] --config <config.json> [--requirements <file.json>] --emit-fill-masks <masks-dir>` to write `<masks-dir>/<into>.png` on the painting's grid (`[255, 255, 255, 255]` where `(polygon ∩ from alpha > 0)`, overlap band included, and `[0, 0, 0, 0]` elsewhere; where a region take or a busy-visible figure mask reads requirements, `--emit-fill-masks` reads `config.requirements` and optional `--requirements` by the same rule as `--out`); (2) `rig-parts comfy plate --mode occluder --painting <painting.png> --occluder <masks-dir>/<into>.png --out <plate-dir>`; and (3) set `"under": {"plate": "<plate-dir>"}` on `assemble.cuts[i]` and re-run `rig-parts assemble` (or `build`).
5332
5347
 
5333
5348
  **Splitting a horizontal hem between two plan layers (`assemble.edge_splits`, issue #1231).** `assemble.edge_splits` (`[{ "over": "<part>", "under": "<part>", "band": [x0, y0, x1, y1] }, ...]`) takes `assemble.plan` part names only (`over !== under`), so a part made by `assemble.cuts` is refused with `CONFIG_NAME_RESOLVES`. Its effect is a horizontal hem split between two plan layers on the rig grid inside `band` (`x0 < x1`, `y0 < y1`, upper bounds exclusive; `ASSEMBLE_PAINTING_BAND_INSIDE` when the box reaches outside the rig canvas), applied after ghost clean-up and rig-space resampling and before projection: per column `x` in `x0 .. x1 - 1`, `y*` is the first row in `y0 .. y1 - 1` (with `y + 1 < H`) with the largest vertical painting RGB step `max(|R(x,y) - R(x,y+1)|, |G(x,y) - G(x,y+1)|, |B(x,y) - B(x,y+1)|)` among rows where `over` has `alpha >= 128` (`EDGE_SPLIT_OVER_ALPHA`; columns with no such row are skipped), and for every row strictly below `y*` inside `band` (`y* + 1 .. y1 - 1`), where `over` has `alpha >= 128`, `over` is cleared to `[0, 0, 0, 0]` and `under` takes the painting's RGB there with `alpha = 255`, and where `over` has `0 < alpha < 128`, `over` is cleared to `[0, 0, 0, 0]`. It transfers static plan-layer ownership along a painted horizontal hem; it does not close a `cuts` seam that opens in motion.
5334
5349
 
@@ -5889,7 +5904,7 @@ recorded transform. The record fields and sampling formula are specified in
5889
5904
  | <a id="ASSEMBLE_REGION_TAKE_REFERENCE"></a>`ASSEMBLE_REGION_TAKE_REFERENCE` | a declared region reference is unreadable | supply the declared PNG, with `source: true` or `painting` and its byte hash |
5890
5905
  | <a id="ASSEMBLE_REGION_TAKE_REFERENCE_MATCH"></a>`ASSEMBLE_REGION_TAKE_REFERENCE_MATCH` | a reference hash or painting dimensions differ | supply the declared PNG and preserve the source geometry |
5891
5906
  | <a id="ASSEMBLE_REGION_TAKE_CONTAINMENT"></a>`ASSEMBLE_REGION_TAKE_CONTAINMENT` | a non-target part has no pre-take counterpart | retain the same neighbour part population before and after the take |
5892
- | <a id="ASSEMBLE_REGION_TAKE_TOLERANCE"></a>`ASSEMBLE_REGION_TAKE_TOLERANCE` | a region take has no authored `setup_painting.rgb_tolerance` | supply the same requirements file to assemble/build and check |
5907
+ | <a id="ASSEMBLE_REGION_TAKE_TOLERANCE"></a>`ASSEMBLE_REGION_TAKE_TOLERANCE` | a region take finds no authored `setup_painting.rgb_tolerance`: `config.requirements` is absent and no `--requirements` was given, or the requirements file it reads declares none. The detail names that file, or says no file was given | declare `setup_painting.rgb_tolerance` (an integer 0-255) in the file `config.requirements` names, or add `config.requirements` naming such a file; `--requirements`, when given, must name the same file |
5893
5908
  | <a id="ASSEMBLE_REGION_TAKE_GEOMETRY"></a>`ASSEMBLE_REGION_TAKE_GEOMETRY` | without `crop`, donor and target canvases or entire input RGBA differ; with `crop`, the original input differs from its declared square-padded crop; or the target head run is absent | supply the matching original input PNG and declare `crop` for a crop donor; a head take requires a target head run |
5894
5909
  | <a id="ASSEMBLE_REGION_TAKE_PART"></a>`ASSEMBLE_REGION_TAKE_PART` | the named plan part/run or its base/donor tag is absent, or the target is taken twice | name an existing plan part and one donor holding its tag |
5895
5910
  | <a id="ASSEMBLE_REGION_TAKE_EMPTY"></a>`ASSEMBLE_REGION_TAKE_EMPTY` | the derived qualifying region has 0 pixels | supply material missing from the base that covers and matches the painting |
@@ -6396,9 +6411,10 @@ outside the consumed inputs pending [#1177](https://github.com/rig-c/parts/issue
6396
6411
  | <a id="CHECK_SETUP_PAINTING_MEASURED"></a>`CHECK_SETUP_PAINTING_MEASURED` | missing native setup/ownership or unsupported clipping | supply observable textured setup geometry; an unavailable instrument never passes |
6397
6412
  | <a id="CHECK_BOUNDARY_COLOUR_STEP"></a>`CHECK_BOUNDARY_COLOUR_STEP` | the requirements file declares `boundary_colour.max_step_excess` and a part boundary's colour step in the rig's render exceeds the same boundary's step in the rig's own pieces by more than it; the part pair, the frame (`setup` or `idle frame <n> (t <s> s)`), the stage pixel, the excess, the declared allowance and both steps are quoted. Unlike [`CHECK_SETUP_MATCHES_PAINTING`](#CHECK_SETUP_MATCHES_PAINTING), which compares the painting per declared region at the setup pose, this compares against the rig's own flat pieces (`parts.json` placement at setup, each piece's rest colour through its art UVs on every idle frame), so a part drawn over its neighbour's line art is not a failure | the pair's rig image or mesh: `rig/images/<part>.png` (a texture stretched into its padded UVs, or a notch cut out of it), or that part's mesh in `config.json` `meshes` when the mesh cuts a corner off the art; see [Boundary colour step](#boundary-colour-step-issue-942) |
6398
6413
  | <a id="CHECK_BOUNDARY_COLOUR_UNMEASURED"></a>`CHECK_BOUNDARY_COLOUR_UNMEASURED` | `boundary_colour` is declared and the step cannot be taken: no `parts.json`, no `idle`, or a default-skin region or mesh image without a sequence, with a parts record, whose rig image is not its parts PNG with one even pad on every side (refused before anything is built); otherwise a drawn slot has no `parts.json` piece, is clipped, or its rig image is not its parts PNG with one even pad on every side (the slot and frame are named). Never a pass | make every drawn slot a `parts.json` piece, or drop `boundary_colour` from the requirements file (the bar then reports SKIP) |
6399
- | <a id="CHECK_BEHIND_PART_SEAMS"></a>`CHECK_BEHIND_PART_SEAMS` | `behind_seams` is declared and a selected pair exceeds its allowance in the independent `motion_opened` reading on an idle frame, in the `standing` reading at setup (compared against the parts' flat recomposite at their painted positions), or in either reading at an opted-in named turn pose; the pair, behind slots, reading, frame, counted seam cells and allowance are named | repair the declared seam in `parts/<part>.png` or `config.json` (`regions`, `meshes`, or `bones`), or author its allowance in `requirements.json` (`behind_seams.allowance` or `behind_seams.pairs[].allowance`); no WARN mode or rest-visible mask; see [Behind-part seams](#behind-part-seams-issue-1314) |
6400
- | <a id="CHECK_BEHIND_PART_SEAMS_UNMEASURED"></a>`CHECK_BEHIND_PART_SEAMS_UNMEASURED` | a pair with an authored effective threshold cannot read a mandatory population: selected pair, eligible behind slots, `--parts` manifest (`parts.json` and `parts/*.png`) for setup standing's flat recomposite, idle, readable setup, motion support, boundary population, or verified render/grid/material evidence; mandatory unread evidence makes the combined line FAIL. A missing threshold alone is a nonrequired SKIP and HOLE without this refusal code | for the detail `no --parts manifest was supplied; setup standing compares the setup render with the parts' flat recomposite`, supply `parts.json` and `parts/<part>.png` (or pass `--parts <dir>` on the `rig-parts check` command line). For the detail `standing endpoints include ambiguous half-alpha owners`, the line names the case and, for each case, the first endpoint in scan order with both members' alpha: *neither* member reaches 128/255 there (both members' soft edges paint the same cell, each below 128/255) or *both* do (the members' overlap reaches the gap's edge). Edit `parts/<part>.png` of one member, or its source layer, so that exactly one member reaches 128/255 at that endpoint and the other is below it or does not paint it; the corridor is then read and may fail [`CHECK_BEHIND_PART_SEAMS`](#CHECK_BEHIND_PART_SEAMS) on a real gap. A threshold at or above the cell's distance to the recomposite removes the cell from the reading altogether; the threshold decides what could count; it does not clear a cell that could. `requirements.json` `behind_seams.allowance` never clears an unread cell; removing `behind_seams.threshold` (or `behind_seams.pairs[].threshold`), or the pair from `behind_seams.pairs[]` in `requirements.json`, only silences the reading (issues #1405, #1408). For any other detail, supply the named measurement evidence in `parts/<part>.png`, `config.json` or `requirements.json` `behind_seams`; an invalid selected-pair override in `requirements.json` `behind_seams.pairs[]` also refuses by name, and existing renderer or sidecar refusals remain refusals |
6414
+ | <a id="CHECK_BEHIND_PART_SEAMS"></a>`CHECK_BEHIND_PART_SEAMS` | `behind_seams` is declared and a selected pair exceeds its allowance in the independent `motion_opened` reading on an idle frame, in the `standing` reading at setup (compared against the parts' flat recomposite at their painted positions), or in the `motion_opened` reading at an opted-in named turn pose (idle and turn `standing` are not measured); the pair, behind slots, reading, frame, counted seam cells and allowance are named | repair the declared seam in `parts/<part>.png` or `config.json` (`regions`, `meshes`, or `bones`), or author its allowance in `requirements.json` (`behind_seams.allowance` or `behind_seams.pairs[].allowance`); no WARN mode or rest-visible mask; see [Behind-part seams](#behind-part-seams-issue-1314) |
6415
+ | <a id="CHECK_BEHIND_PART_SEAMS_UNMEASURED"></a>`CHECK_BEHIND_PART_SEAMS_UNMEASURED` | a pair with an authored effective threshold cannot read a mandatory population: selected pair, eligible behind slots, `--parts` manifest (`parts.json` and `parts/*.png`) for setup standing's flat recomposite, idle, readable setup, motion support, boundary population, or verified render/grid/material evidence; mandatory unread evidence makes the combined line FAIL. A missing threshold alone is a nonrequired SKIP and HOLE without this refusal code | for the detail `no --parts manifest was supplied; setup standing compares the setup render with the parts' flat recomposite`, supply `parts.json` and `parts/<part>.png` (or pass `--parts <dir>` on the `rig-parts check` command line). For the detail `standing endpoints include ambiguous half-alpha owners` (measured at setup only), the line names the case and, for each case, the first endpoint in scan order with both members' alpha: *neither* member reaches 128/255 there (both members' soft edges paint the same cell, each below 128/255) or *both* do (the members' overlap reaches the gap's edge). Edit `parts/<part>.png` of one member, or its source layer, so that exactly one member reaches 128/255 at that endpoint and the other is below it or does not paint it; the corridor is then read and may fail [`CHECK_BEHIND_PART_SEAMS`](#CHECK_BEHIND_PART_SEAMS) on a real gap. A threshold at or above the cell's distance to the recomposite removes the cell from the reading altogether; the threshold decides what could count; it does not clear a cell that could. `requirements.json` `behind_seams.allowance` never clears an unread cell; removing `behind_seams.threshold` (or `behind_seams.pairs[].threshold`), or the pair from `behind_seams.pairs[]` in `requirements.json`, only silences the reading (issues #1405, #1408). When a turn pose (or idle frame) reads the `motion_opened` `HOLE` (`stock transported setup-overlap support is unavailable on every named turn pose; motion-opened is not measured`, or `stock transported setup-overlap support is unavailable on every idle frame; motion-opened is not measured`, or `both named front slots must draw on this frame`, or `no eligible slot is drawn strictly behind both pair members (including every fragment)`), give the pair's two front members a setup overlap band in `parts/<part>.png` or `config.json` (`regions`, `meshes`, or `bones`) and ensure both members and at least one rear slot in `behind_slots` draw in consistent order at setup and on every turn pose (or idle frame) so `motion_opened` can transport setup-overlap cells, or — when the pair is not a turn-tracked overlap seam — omit `behind_seams.turn` (or the pair's threshold in `requirements.json` `behind_seams`; issue #1412). For any other detail, supply the named measurement evidence in `parts/<part>.png`, `config.json` or `requirements.json` `behind_seams`; an invalid selected-pair override in `requirements.json` `behind_seams.pairs[]` also refuses by name, and existing renderer or sidecar refusals remain refusals |
6401
6416
  | <a id="SETUP_PAINTING_REQUIRED_LIMIT"></a>`SETUP_PAINTING_REQUIRED_LIMIT` | `setup_painting.required` is `true` and a limit the check needs is absent: `rgb_tolerance`, `regions`, or a region's `max_pixels` (the object names the region). Refused when the requirements file is read, before anything is built (issue #943) | author the named limit; none is derived from the art. Without `required` the same region reports SKIP |
6417
+ | <a id="SETUP_PAINTING_MOSTLY_UNCOVERED"></a>`SETUP_PAINTING_MOSTLY_UNCOVERED` | WARN only, never a refusal and never a bar (issue #1421): with neither `setup_painting.figure_mask` nor `setup_painting.backdrop` declared, more than half of a region's counted pixels are uncovered (`2 × uncovered > counted`, read off the region's `(uncovered)` slot row and its `pixel_count`; exactly half, or a region that counts nothing, does not warn). The line names the region and both figures. Without either declaration the count cannot tell painted background from missing figure, so on a scene painting the region's limit mostly measures background the rig does not draw | declare `setup_painting.figure_mask` (a figure-only rig on a scene painting) or `setup_painting.backdrop` (a full-frame painting over an opaque plate) to make the limit bind the figure; the verdict, `problems` and `check.json` do not change, and the summary line names the warning |
6402
6418
  | <a id="CHECK_SOURCE_GRID"></a>`CHECK_SOURCE_GRID` | the setup-pose still and its black-tinted twin (the coverage `SETUP_POSE_VS_SOURCE` reads) did not come back on one grid over one opaque background | a rigc problem; report it |
6403
6419
  | <a id="CHECK_RIGC_VERSION"></a>`CHECK_RIGC_VERSION` | `rigc --version` is below 1.4.0, or prints no version: its `render` has no `--geometry`, which `TEXTURE_STRETCH` reads. Refused before anything is built | `bun install` (this package depends on rig-c ^2.20.4), or put a newer `rigc` first on `PATH` |
6404
6420
  | <a id="CHECK_RIGC_ENTRY"></a><a id="CHECK_RIGC_ENTRY_READS"></a>`CHECK_RIGC_ENTRY`, `CHECK_RIGC_ENTRY_READS` | `rigc --version` names no entry (a rigc below 2.0.0), or names one in neither launcher form (`entry: cli.ts — @esotericsoftware/spine-core <v> present`, `entry: cli_core.ts — @esotericsoftware/spine-core absent — …`); `check.json`'s `rigc_entry` records the one that gated the build | `bun install` |
@@ -6448,7 +6464,8 @@ outside the consumed inputs pending [#1177](https://github.com/rig-c/parts/issue
6448
6464
  | <a id="CHECK_PACK_SHAPE"></a>`CHECK_PACK_SHAPE` | the pack line disagrees with the `--pack-shape` the build was run with — it ends `, shape rect` under `polygon` or `, shape polygon` under `rect`, or it has no shape clause (the 1.5–2.0 form, read as `rect`) under `polygon` | a rigc older than 2.1.0 on `PATH`: rigc 2.0.3 takes `--pack-shape` without a word, packs by rectangles and prints the form with no shape clause, so this refusal is what catches it — `bun install` (this package depends on rig-c ^2.20.4); otherwise a rigc problem, report it with `rigc --version` |
6449
6465
  | <a id="PACK_PAGE_SIZE"></a>`PACK_PAGE_SIZE` | `--page-size` is not a positive integer (e.g. `0`, `-1`, `1.5`, `"abc"` or `""`); the value found and the value required (`a positive integer`) are named, and nothing is built or written | a positive integer in px; rigc's own range and power-of-two rules are enforced by `rigc build --pack` itself |
6450
6466
  | <a id="BUILD_ARTIFACT_PRESENT"></a>`BUILD_ARTIFACT_PRESENT` | the packed build lacks its `.json`, `.atlas` or page | a rigc problem; report it |
6451
- | <a id="BUILD_REQUIREMENTS_CONFLICT"></a>`BUILD_REQUIREMENTS_CONFLICT` | `build --requirements <file>` names a file with other bytes than the one `config.requirements` declares (issue #556): the detail names both, each resolved (the flag against the working directory, the declaration against the config's) with its sha256 — or `no such file`. Refused before assemble writes anything. The same file by both, or a copy of its bytes, is not refused: the declaration is read and recorded | drop the flag to build from the config's file, or point `config.requirements` at the flag's |
6467
+ | <a id="BUILD_REQUIREMENTS_CONFLICT"></a>`BUILD_REQUIREMENTS_CONFLICT` | `build --requirements <file>` (or `assemble --requirements <file>` where requirements reach assembly) names a file that is not the one `config.requirements` declares — not the same resolved file, nor a file with the same bytes (issue #556): the detail names both, each resolved (the flag against the working directory, the declaration against the config's) with its sha256 — or `no such file`. Refused before assemble writes anything. `assemble` raises it too when the flag's file reaches assembly (issue #1418: a region take, or a busy-visible `setup_painting.figure_mask`), and then the detail ends naming that field. The same file by both, or a copy of its bytes, is not refused: the declaration is read and recorded | drop the flag to read the config's file, or point `config.requirements` at the flag's |
6468
+ | <a id="ASSEMBLE_REQUIREMENTS_UNDECLARED"></a>`ASSEMBLE_REQUIREMENTS_UNDECLARED` | `assemble --requirements <file>` or `build --requirements <file>` names a file whose content reaches assembly (a region take reads its `setup_painting.rgb_tolerance`; under `ground: "busy"` with `project: "visible"`, its `setup_painting.figure_mask`) while the config declares no `config.requirements` (issue #1418); `config.requirements` would have to name the same file, the same resolved file or a file with the same bytes. `assembly_config` reads only `config.requirements`, so the stamp could not hold what assemble used. The detail names the file, resolved, its sha256 and the field. Refused before anything is written. A flag file none of whose content reaches assembly is accepted | add the `"requirements"` entry the detail writes out, the file's path relative to the config's directory, to the config the detail names; the flag may stay, naming the same file |
6452
6469
  | <a id="BUILD_STAGE_REQUEST"></a>`BUILD_STAGE_REQUEST` | an internal build worker was given a missing or malformed request, an unknown stage, or incomplete runner, input, output or scratch paths; the worker refuses before running a stage. This is the internal process protocol, not a public command or option | invoke `rig-parts build` with its documented flags; if that command produces this refusal, report the named request defect rather than constructing or modifying a worker request |
6453
6470
  | <a id="REQUIREMENTS_FILE"></a>`REQUIREMENTS_FILE` | `--requirements` names no file, or one that does not parse as a JSON object. Refused before anything is built (by `build`, before assemble) | the path of a `spine-parts-requirements/1` file |
6454
6471
  | <a id="REQUIREMENTS_FIELD"></a>`REQUIREMENTS_FIELD` | a field of the file is missing, of the wrong type, or not one the format reads: `spec`, `fps` (a positive number when supplied, required only when a declared measurement reads the file's sampling rate, with no default), `requirements`, each requirement's `name` (letters, digits, underscores; once each), `kind`, `animation` and its kind's fields — every bar among them (`within_px`, `fraction`, `tolerance`, `least_drive` above 0, `within_degrees` from 0 to 180, `lo_degrees` ≤ `hi_degrees`, `within_ratio` ≥ 1) — and each target's `bone`, `animation` and exactly one of `at` and `keys` (times strictly increasing), and `not_planted`, `not_swinging`, `rises` and `rests` when given (each a non-empty list of part names, each once; no part both in `not_swinging` and in `rises` or `rests`), and `may_fold` when given (a non-empty list of `{ "slot", "animation", "why" }`, every one a non-blank string, each pair once; issue #320), and `pinholes` when given (an object whose one field, `required`, is `true` or `false`; issue #944), `seam_over_motion` when given (the same shape; issue #941), and `boundary_colour` when given (an object whose one field, `max_step_excess`, is an integer from 0 through 255; issue #942), and `motion_seams` when given (an array of `{part, neighbour}`, each an unordered pair of distinct output part names, once per list; issue #1269), and `behind_seams` when given (optional `threshold`, `allowance`, `pairs`, `turn: true`; each pair requires distinct nonempty `part` and `neighbour`, with optional `threshold` and `allowance`; thresholds are integers from 0 through 255, allowances are nonnegative safe integers, and reverse duplicates are invalid; issue #1314). `note`, `*_note` (strings) and `x-…` (any value) are read by nothing, as in the config | write the field; the bar is yours. For a pair read only by `seam_over_motion.required`, declare requirements-level `motion_seams` `[{part, neighbour}]` and omit a seam requirement; this leaves a frozen `parts.json` untouched. `config.motion_seams` remains an assemble-time carrier into `parts.json`. See the [carrier contract](#CONFIG_MOTION_SEAM) and [background over every frame](#background-over-every-frame-issue-941). |
@@ -7726,7 +7743,9 @@ it when the flag is not given: a build with `--requirements reqs.json`, typed fr
7726
7743
  config's directory, and a rebuild from a config declaring `"requirements": "reqs.json"`
7727
7744
  write the same bytes, every file (selftest `BU178`). A flag naming other bytes than the
7728
7745
  declaration is `BUILD_REQUIREMENTS_CONFLICT` (`BU179`); the same file by both, or a copy
7729
- of it, builds what the config alone builds (`BU180`). Without either, no `requirements`
7746
+ of it, builds what the config alone builds (`BU180`). When the file reaches assembly (a
7747
+ region take, or a busy-visible figure mask), `assemble` holds the same rule and refuses
7748
+ a flag the config does not declare (`ASSEMBLE_REQUIREMENTS_UNDECLARED`, selftest `URQ01`–`URQ08`). Without either, no `requirements`
7730
7749
  block is written and no byte moves.
7731
7750
 
7732
7751
  **Which config a build read** (issue #607). `build` records its config in the same
@@ -8002,6 +8021,25 @@ value. The region passes when its total count is at most its authored
8002
8021
  nonnegative integer `max_pixels`. Without that limit the region reports
8003
8022
  **SKIP**, including a zero-count region. An undeclared region has no verdict.
8004
8023
 
8024
+ A region counts the figure domain described below, owned and uncovered alike:
8025
+ its `(uncovered)` slot row is the counted pixels no setup piece draws. Without
8026
+ `figure_mask` or `backdrop` that row cannot tell painted background from
8027
+ missing figure, so on a scene painting (a painted background behind a
8028
+ figure-only rig) a limit taken from a build's `pixel_count` can mostly measure
8029
+ background, and a figure that moves or loses pixels inside the region still
8030
+ passes. When more than half of a region's counted pixels are uncovered
8031
+ (`2 × uncovered > counted`; exactly half, or no counted pixel, does not warn),
8032
+ `check` prints
8033
+ [`SETUP_PAINTING_MOSTLY_UNCOVERED`](#SETUP_PAINTING_MOSTLY_UNCOVERED) under the
8034
+ region, with both figures, and names it in the summary line. Declare
8035
+ `figure_mask` or `backdrop` to make the limit bind the figure. The warning is
8036
+ not a bar: the verdict, the problems and `check.json` are unchanged, and both
8037
+ figures are already there (`regions[].pixel_count` and the `(uncovered)` row of
8038
+ `regions[].slots`). With either declaration the warning is not read: a figure
8039
+ mask counts mask pixels only, and a backdrop leaves out painting within
8040
+ `rgb_tolerance` of the plate, so an uncovered pixel there is missing figure
8041
+ (or a plate that does not match the painting), which is what the limit reads.
8042
+
8005
8043
  An author for whom a SKIP here is not an acceptable outcome declares it:
8006
8044
  `"required": true` inside `setup_painting` (issue #943). The field states the
8007
8045
  requirement, not a kind of rig. With it, every limit must be authored: an
@@ -8333,8 +8371,24 @@ setup, followed by every full min/max corner; duplicate poses occur once.
8333
8371
  For yaw, pitch and body yaw this means six axis endpoints and eight corners.
8334
8372
  Each row names the planned and observed dial locals and observed slider mapped
8335
8373
  times, using independent t=0 reset samples rather than idle time. The turn block records selected pose names, per-pair native
8336
- frames and sampled/read/unmeasured pose counts, and separate standing and
8337
- motion-opened maxima. No sweep or temporal span is claimed. Its stock transported
8374
+ frames and sampled/read/unmeasured pose counts, the `motion_opened` status and
8375
+ maximum count, and the `standing` summary (`status: "SKIP"`, `reason`,
8376
+ `max_px: 0`). Because a turn pose is an independent `t=0` pose and the parts'
8377
+ flat recomposite is not transported to it, turn `standing` is never measured
8378
+ (issue #1412): on each turn pose, `turn.pairs[].frames[].standing` is `SKIP`
8379
+ with zero counts, `box: null`, `samples: []`, no `unread_cells` or
8380
+ `unread_corridors`, and its per-pose `reason`
8381
+ (`"not applicable: motion_opened reads the pair"` when `motion_opened` reads the
8382
+ pair on that pose, or
8383
+ `"turn standing is not measured: turn poses have no recomposite oracle, and the pair's turn reading is motion_opened"`
8384
+ when `motion_opened` cannot read that pose), while `motion_opened` is the turn
8385
+ reading. When a turn pose reads the `motion_opened` `HOLE`
8386
+ (`stock transported setup-overlap support is unavailable on every named turn pose; motion-opened is not measured`),
8387
+ give the pair a setup overlap band in `parts/<part>.png` or `config.json`
8388
+ (`regions`, `meshes`, or `bones`) and keep both members and at least one rear
8389
+ slot drawn in front/behind order across the turn poses so `motion_opened` can
8390
+ transport setup-overlap support, or omit `behind_seams.turn` (or the pair's
8391
+ threshold in `requirements.json`). No sweep or temporal span is claimed. Its stock transported
8338
8392
  setup-overlap evidence is computed separately with the official seam reader;
8339
8393
  the idle's exact stock binding is unchanged. One throwaway rig-c build appends a
8340
8394
  duration-0 animation for each selected pose, retaining the accepted setup,
@@ -8351,8 +8405,8 @@ the original accepted skeleton SHA-256 once. The scratch copy is removed even
8351
8405
  on refusal; without the turn opt-in no copy or extra build is created.
8352
8406
  A missing optional poser is a named HOLE. A missing dial persists turn SKIP and
8353
8407
  its HOLE; an effective T makes it a required-unmeasured failure. Legacy `turn.x`
8354
- has no finite range declaration and stays unread. Unread corridors cannot become
8355
- zero counts. Thresholds and per-pair allowances apply unchanged to turn. A pair
8408
+ has no finite range declaration and stays unread. Per-pair allowances apply
8409
+ unchanged to turn `motion_opened`. A pair
8356
8410
  without its own effective T stays SKIP with a HOLE; another pair's override
8357
8411
  does not make that optional reading fail the turn block.
8358
8412
 
@@ -8377,10 +8431,10 @@ The two readings are independent:
8377
8431
  transparent at the exact seam-cell centre, and setup attribution must show A
8378
8432
  or B covering that material. It uses no one-cell floor. A rigidly translated
8379
8433
  closed pair stays closed; no setup overlap band means this half is unmeasured
8380
- on idle.
8434
+ on idle and turn.
8381
8435
  - `standing` is measured at `setup` against the parts' flat recomposite at their
8382
- painted positions (issue #1408), and at opted-in turn poses
8383
- (`behind_seams.turn: true`) by pose endpoint contrast alone. At `setup`, it
8436
+ painted positions (issues #1408, #1412); it is not measured on idle frames or
8437
+ turn poses. At `setup`, it
8384
8438
  scans row and column runs whose combined A/B alpha is below 128/255, bracketed
8385
8439
  immediately by different unambiguous A/B owners (`1` and `2`), and compares
8386
8440
  the full setup render at each cell with the parts' flat recomposite
@@ -8417,15 +8471,18 @@ The two readings are independent:
8417
8471
  `reason: "no --parts manifest was supplied; setup standing compares the setup render with the parts' flat recomposite"`,
8418
8472
  records a `setup` `unmeasured[]` row, and with an authored T emits
8419
8473
  [`CHECK_BEHIND_PART_SEAMS_UNMEASURED`](#CHECK_BEHIND_PART_SEAMS_UNMEASURED).
8420
- On idle frames, `standing` is never measured: where a frame's `motion_opened`
8421
- is read, `frames[].standing` reports `SKIP` with
8422
- `reason: "not applicable: motion_opened reads the pair"`, zero counts,
8423
- `box: null`, `samples: []`, no unread fields, and no idle standing problem or
8424
- unmeasured row; where a frame's `motion_opened` cannot be read,
8425
- `frames[].standing` reports `SKIP` with
8474
+ On idle frames and opted-in turn poses, `standing` is never measured: where a
8475
+ frame's or pose's `motion_opened` is read, `frames[].standing` reports `SKIP`
8476
+ with `reason: "not applicable: motion_opened reads the pair"`, zero counts,
8477
+ `box: null`, `samples: []`, no unread fields, and no standing problem or
8478
+ unmeasured row; where `motion_opened` cannot be read on an idle frame or turn
8479
+ pose, `frames[].standing` reports `SKIP` with
8426
8480
  `reason: "idle standing is not measured: idle frames have no recomposite oracle, and the pair's idle reading is motion_opened"`
8427
- while `motion_opened` records its named `HOLE` (and `pairs[].standing`
8428
- carries the pair's idle summary reason). This bracketed-run definition does
8481
+ (on idle) or
8482
+ `reason: "turn standing is not measured: turn poses have no recomposite oracle, and the pair's turn reading is motion_opened"`
8483
+ (on turn) while `motion_opened` records its named `HOLE` (and
8484
+ `pairs[].standing` / `turn.pairs[].standing` carry the pair's idle or turn
8485
+ summary reason). This bracketed-run definition does
8429
8486
  not certify curved or diagonal openings.
8430
8487
 
8431
8488
  Setup standing in `BEHIND_PART_SEAMS` measures whether the rig's setup pose
@@ -8459,8 +8516,9 @@ grid and sampled/read/unmeasured frame counts. The `motion_opened` reading
8459
8516
  retains per-frame hits (`index`, `time`, `px`, `cell`, `area`, `box`),
8460
8517
  `max_px`, the earliest worst hit and contiguous `spans`; the idle `standing`
8461
8518
  summary (`pairs[].standing`) is always `SKIP` with its `reason`, zero counts,
8462
- `worst: null`, and empty `frames` and `spans` (while setup standing at
8463
- `pairs[].setup.standing` and turn standing poses retain their measured counts,
8519
+ `worst: null`, and empty `frames` and `spans`, and the turn `standing` summary
8520
+ (`turn.pairs[].standing`) is always `SKIP` with its `reason` and `max_px: 0`
8521
+ (while setup standing at `pairs[].setup.standing` retains its measured counts,
8464
8522
  `box` and `samples`).
8465
8523
  `max_run` is temporal, in frames and seconds; `max_spatial_run_cells` is the
8466
8524
  longest counted horizontal/vertical run, with world length equal to cells times
@@ -8470,18 +8528,16 @@ counts remain distinct. Overlapping pair counts are not a unique whole-rig
8470
8528
  area.
8471
8529
 
8472
8530
  Issue #1325 adds optional unread-corridor evidence to the per-frame `standing`
8473
- record at `BEHIND_PART_SEAMS.pairs[].setup.standing` (and on turn standing
8474
- frames when `behind_seams.turn: true`; idle `frames[].standing` is never
8475
- measured). The fields below are relative to that record. They describe
8531
+ record at `BEHIND_PART_SEAMS.pairs[].setup.standing` (idle `frames[].standing`
8532
+ and turn `turn.pairs[].frames[].standing` are never measured). The fields below
8533
+ are relative to that record. They describe
8476
8534
  bracketed low-alpha runs with an endpoint owner of 0 or 3 that have at least
8477
8535
  one cell differing from the parts' recomposite by more than T at setup
8478
8536
  (`dRecomposite > T`); they do not infer an owner or count those runs as
8479
8537
  measured contrast. At setup, `unread_corridors[].cells`, `cell_count` and
8480
8538
  `unread_cells` leave out cells within T of the recomposite (`dRecomposite <= T`)
8481
8539
  and report the remaining interior cells of the run, excluding its endpoints,
8482
- whether or not rear colour would qualify against endpoint contrast T (on turn
8483
- poses, which have no recomposite oracle, all interior cells of the run are
8484
- reported). A cell can be unread on one axis and readable on the other; unread
8540
+ whether or not rear colour would qualify against endpoint contrast T. A cell can be unread on one axis and readable on the other; unread
8485
8541
  evidence does not remove a measured hit.
8486
8542
 
8487
8543
  | Field | Contract |
@@ -8495,7 +8551,7 @@ evidence does not remove a measured hit.
8495
8551
  | `unread_corridors[].endpoints[][2]` | World-space x coordinate of the endpoint cell centre. |
8496
8552
  | `unread_corridors[].endpoints[][3]` | World-space y coordinate of the endpoint cell centre, y up. |
8497
8553
  | `unread_corridors[].endpoints[][4]` | Observed half-alpha owner code: 0 means neither A nor B reaches 128/255; 1 means only A does; 2 means only B does; 3 means both do. A and B are the selected pair's named members; 0 and 3 are not resolved by guessing. |
8498
- | `unread_corridors[].cells` | Interior native-cell centres as numeric `[world_x, world_y]` tuples, y up, left-to-right or top-to-bottom along the run, leaving out cells within T of the parts' recomposite at setup (on turn poses, all interior cells of the run). A centre may occur in multiple corridors. |
8554
+ | `unread_corridors[].cells` | Interior native-cell centres as numeric `[world_x, world_y]` tuples, y up, left-to-right or top-to-bottom along the run, leaving out cells within T of the parts' recomposite at setup. A centre may occur in multiple corridors. |
8499
8555
  | `unread_corridors[].cell_count` | The number of reported interior cells in this corridor (at setup, leaving out cells within T of the recomposite), exactly `cells.length`. |
8500
8556
  | `unread_corridors[].row_scope` | `pair`; the corridor observes the selected front pair, not an individual rear slot. |
8501
8557
  | `unread_corridors[].row_kind` | `evidence`, including when the required check fails. |
@@ -8511,7 +8567,9 @@ fully read frame.
8511
8567
  `sampled_frames`, `read_frames` and `unmeasured_frames` count idle frames only.
8512
8568
  An idle frame enters `read_frames` when `motion_opened` is read on that frame;
8513
8569
  when `motion_opened` is unavailable on that frame, the frame enters
8514
- `unmeasured_frames` (idle `standing` is never measured). Setup is reported
8570
+ `unmeasured_frames` (and on turn poses, `sampled_poses`, `read_poses` and
8571
+ `unmeasured_poses` follow the same `motion_opened` rule; idle and turn
8572
+ `standing` are never measured). Setup is reported
8515
8573
  separately at `pairs[].setup` and is not counted as an idle frame.
8516
8574
 
8517
8575
  A measured count above the effective allowance is
@@ -8521,7 +8579,7 @@ effective T reports a nonrequired SKIP and HOLE; missing T alone emits no
8521
8579
  PASS. With authored T, missing behind slots, `--parts` manifest for setup
8522
8580
  standing's recomposite, idle, setup, motion support, boundary population or
8523
8581
  verified render/material evidence cannot establish PASS. An unavailable reading
8524
- is SKIP; a partially unread setup (or turn) standing reading retains any
8582
+ is SKIP; a partially unread setup standing reading retains any
8525
8583
  measured FAIL as described above. An unread population reports a HOLE and emits
8526
8584
  [`CHECK_BEHIND_PART_SEAMS_UNMEASURED`](#CHECK_BEHIND_PART_SEAMS_UNMEASURED),
8527
8585
  making the combined line FAIL. Existing hard render and sidecar failures
@@ -9604,18 +9662,18 @@ Internal `SeamSupport.drawings` never enters check JSON. Named requirement
9604
9662
  | `ANIMATIONS_DO_NOT_FOLD.declared_not_folding` | `ANIMATIONS_DO_NOT_FOLD.declared_not_folding` | part when the supplied mapping resolves a piece; otherwise rig | finding | resolved piece for e.slot; otherwise [] | [check.ts:3697](../src/check.ts#L3697) |
9605
9663
  | `ANIMATIONS_DO_NOT_FOLD.folding` | `ANIMATIONS_DO_NOT_FOLD.folding` | part when the supplied mapping resolves a piece; otherwise rig | finding when entry === undefined; otherwise evidence | resolved piece for slot; otherwise [] | [check.ts:3659](../src/check.ts#L3659) |
9606
9664
  | `ART_JOINT_DISTANCE.joints` | `ART_JOINT_DISTANCE.joints` | 'rig' | finding when status === 'FAIL'; otherwise evidence | [] | [artjoints.ts:86](../src/artjoints.ts#L86) |
9607
- | `BEHIND_PART_SEAMS.contributors` | `BEHIND_PART_SEAMS.turn.pairs[].frames[].standing.samples[].contributors`; `BEHIND_PART_SEAMS.turn.pairs[].frames[].motion_opened.samples[].contributors`; `BEHIND_PART_SEAMS.pairs[].setup.motion_opened.samples[].contributors`; `BEHIND_PART_SEAMS.pairs[].setup.standing.samples[].contributors`; `BEHIND_PART_SEAMS.pairs[].frames[].motion_opened.samples[].contributors`; `BEHIND_PART_SEAMS.pairs[].frames[].standing.samples[].contributors` | 'pair' | evidence | [pair.a, pair.b] | [behindseams.ts:520](../src/behindseams.ts#L520) |
9608
- | `BEHIND_PART_SEAMS.hits` | `BEHIND_PART_SEAMS.pairs[].motion_opened.frames`; `BEHIND_PART_SEAMS.pairs[].standing.frames`; `BEHIND_PART_SEAMS.pairs[].motion_opened.worst`; `BEHIND_PART_SEAMS.pairs[].standing.worst` | 'pair' | finding when r.px > allowance; otherwise evidence | parts | [behindseams.ts:597](../src/behindseams.ts#L597) |
9609
- | `BEHIND_PART_SEAMS.pairs` | `BEHIND_PART_SEAMS.pairs` | 'pair' | finding when failed; otherwise evidence | parts | [behindseams.ts:682](../src/behindseams.ts#L682) |
9665
+ | `BEHIND_PART_SEAMS.contributors` | `BEHIND_PART_SEAMS.turn.pairs[].frames[].standing.samples[].contributors`; `BEHIND_PART_SEAMS.turn.pairs[].frames[].motion_opened.samples[].contributors`; `BEHIND_PART_SEAMS.pairs[].setup.motion_opened.samples[].contributors`; `BEHIND_PART_SEAMS.pairs[].setup.standing.samples[].contributors`; `BEHIND_PART_SEAMS.pairs[].frames[].motion_opened.samples[].contributors`; `BEHIND_PART_SEAMS.pairs[].frames[].standing.samples[].contributors` | 'pair' | evidence | [pair.a, pair.b] | [behindseams.ts:526](../src/behindseams.ts#L526) |
9666
+ | `BEHIND_PART_SEAMS.hits` | `BEHIND_PART_SEAMS.pairs[].motion_opened.frames`; `BEHIND_PART_SEAMS.pairs[].standing.frames`; `BEHIND_PART_SEAMS.pairs[].motion_opened.worst`; `BEHIND_PART_SEAMS.pairs[].standing.worst` | 'pair' | finding when r.px > allowance; otherwise evidence | parts | [behindseams.ts:608](../src/behindseams.ts#L608) |
9667
+ | `BEHIND_PART_SEAMS.pairs` | `BEHIND_PART_SEAMS.pairs` | 'pair' | finding when failed; otherwise evidence | parts | [behindseams.ts:693](../src/behindseams.ts#L693) |
9610
9668
  | `BEHIND_PART_SEAMS.pairs[].frames` | `BEHIND_PART_SEAMS.pairs[].frames` | | | | |
9611
9669
  | `BEHIND_PART_SEAMS.pairs[].setup` | `BEHIND_PART_SEAMS.pairs[].setup` | | | | |
9612
- | `BEHIND_PART_SEAMS.samples` | `BEHIND_PART_SEAMS.turn.pairs[].frames[].standing.samples`; `BEHIND_PART_SEAMS.turn.pairs[].frames[].motion_opened.samples`; `BEHIND_PART_SEAMS.pairs[].setup.motion_opened.samples`; `BEHIND_PART_SEAMS.pairs[].setup.standing.samples`; `BEHIND_PART_SEAMS.pairs[].frames[].motion_opened.samples`; `BEHIND_PART_SEAMS.pairs[].frames[].standing.samples` | 'pair' | evidence | [pair.a, pair.b] | [behindseams.ts:519](../src/behindseams.ts#L519) |
9613
- | `BEHIND_PART_SEAMS.spans` | `BEHIND_PART_SEAMS.pairs[].motion_opened.spans`; `BEHIND_PART_SEAMS.pairs[].standing.spans` | 'pair' | evidence | parts | [behindseams.ts:605](../src/behindseams.ts#L605) |
9614
- | `BEHIND_PART_SEAMS.turn.pairs` | `BEHIND_PART_SEAMS.turn.pairs` | 'pair' | finding when required; otherwise evidence; finding when motion.status === 'FAIL' &#124;&#124; standing.status === 'FAIL' &#124;&#124; threshold !== null && read !== turn.poses.length; otherwise evidence | [pair.a, pair.b]; parts | [behindseams.ts:712](../src/behindseams.ts#L712), [behindseams.ts:754](../src/behindseams.ts#L754) |
9670
+ | `BEHIND_PART_SEAMS.samples` | `BEHIND_PART_SEAMS.turn.pairs[].frames[].standing.samples`; `BEHIND_PART_SEAMS.turn.pairs[].frames[].motion_opened.samples`; `BEHIND_PART_SEAMS.pairs[].setup.motion_opened.samples`; `BEHIND_PART_SEAMS.pairs[].setup.standing.samples`; `BEHIND_PART_SEAMS.pairs[].frames[].motion_opened.samples`; `BEHIND_PART_SEAMS.pairs[].frames[].standing.samples` | 'pair' | evidence | [pair.a, pair.b] | [behindseams.ts:525](../src/behindseams.ts#L525) |
9671
+ | `BEHIND_PART_SEAMS.spans` | `BEHIND_PART_SEAMS.pairs[].motion_opened.spans`; `BEHIND_PART_SEAMS.pairs[].standing.spans` | 'pair' | evidence | parts | [behindseams.ts:616](../src/behindseams.ts#L616) |
9672
+ | `BEHIND_PART_SEAMS.turn.pairs` | `BEHIND_PART_SEAMS.turn.pairs` | 'pair' | finding when required; otherwise evidence; finding when motion.status === 'FAIL' &#124;&#124; standing.status === 'FAIL' &#124;&#124; threshold !== null && read !== turn.poses.length; otherwise evidence | [pair.a, pair.b]; parts | [behindseams.ts:723](../src/behindseams.ts#L723), [behindseams.ts:773](../src/behindseams.ts#L773) |
9615
9673
  | `BEHIND_PART_SEAMS.turn.pairs[].frames` | `BEHIND_PART_SEAMS.turn.pairs[].frames` | | | | |
9616
- | `BEHIND_PART_SEAMS.turn.unmeasured` | `BEHIND_PART_SEAMS.turn.unmeasured` | pair === null ? 'rig' : 'pair' | finding when mandatory; otherwise evidence | pair === null ? [] : [pair.a, pair.b] | [behindseams.ts:704](../src/behindseams.ts#L704) |
9617
- | `BEHIND_PART_SEAMS.unmeasured` | `BEHIND_PART_SEAMS.unmeasured` | pair === null ? 'rig' : 'pair'; 'rig' | finding when required; otherwise evidence; finding | pair === null ? [] : [pair.a, pair.b]; [] | [behindseams.ts:618](../src/behindseams.ts#L618), [behindseams.ts:955](../src/behindseams.ts#L955), [behindseams.ts:1003](../src/behindseams.ts#L1003) |
9618
- | `BEHIND_PART_SEAMS.unread_corridors` | `BEHIND_PART_SEAMS.turn.pairs[].frames[].standing.unread_corridors`; `BEHIND_PART_SEAMS.pairs[].setup.standing.unread_corridors`; `BEHIND_PART_SEAMS.pairs[].frames[].standing.unread_corridors` | 'pair' | evidence | [pair.a, pair.b] | [behindseams.ts:453](../src/behindseams.ts#L453) |
9674
+ | `BEHIND_PART_SEAMS.turn.unmeasured` | `BEHIND_PART_SEAMS.turn.unmeasured` | pair === null ? 'rig' : 'pair' | finding when mandatory; otherwise evidence | pair === null ? [] : [pair.a, pair.b] | [behindseams.ts:715](../src/behindseams.ts#L715) |
9675
+ | `BEHIND_PART_SEAMS.unmeasured` | `BEHIND_PART_SEAMS.unmeasured` | pair === null ? 'rig' : 'pair'; 'rig' | finding when required; otherwise evidence; finding | pair === null ? [] : [pair.a, pair.b]; [] | [behindseams.ts:629](../src/behindseams.ts#L629), [behindseams.ts:974](../src/behindseams.ts#L974), [behindseams.ts:1022](../src/behindseams.ts#L1022) |
9676
+ | `BEHIND_PART_SEAMS.unread_corridors` | `BEHIND_PART_SEAMS.turn.pairs[].frames[].standing.unread_corridors`; `BEHIND_PART_SEAMS.pairs[].setup.standing.unread_corridors`; `BEHIND_PART_SEAMS.pairs[].frames[].standing.unread_corridors` | 'pair' | evidence | [pair.a, pair.b] | [behindseams.ts:459](../src/behindseams.ts#L459) |
9619
9677
  | `BOUNDARY_COLOUR_STEP.over` | `BOUNDARY_COLOUR_STEP.over` | 'pair' | finding | r.parts | [boundarycolour.ts:221](../src/boundarycolour.ts#L221) |
9620
9678
  | `BOUNDARY_COLOUR_STEP.unmeasured` | `BOUNDARY_COLOUR_STEP.unmeasured` | part when the supplied mapping resolves a piece; otherwise rig | evidence | resolved piece for r.slot; otherwise [] | [boundarycolour.ts:222](../src/boundarycolour.ts#L222) |
9621
9679
  | `CLOTH_SETTLES.rows` | `CLOTH_SETTLES.rows` | 'rig' | finding when speeds.length > 0 && s < speeds.length; otherwise evidence | [] | [check.ts:6144](../src/check.ts#L6144) |
package/docs/STABILITY.md CHANGED
@@ -375,6 +375,47 @@ these new fields are missing from an older stamp, the stale refusal says
375
375
  that the stamp predates the binding and asks for one re-assemble with the
376
376
  same config.
377
377
 
378
+ A config with a region take (an `assemble.take` entry with `seed`) and a
379
+ `config.requirements` file that declares `setup_painting.rgb_tolerance` binds
380
+ that tolerance at `requirements.setup_painting.rgb_tolerance`. Under
381
+ `ground: "busy"` with `project: "visible"`, the `requirements.setup_painting`
382
+ field already binds the tolerance, so this field is not written there. A
383
+ config with no region take, or no declared tolerance, keeps its reading. A
384
+ stamp that lacks only this field is refused as `ASSEMBLY_CONFIG_STALE`, and
385
+ the refusal says that the stamp predates the binding and asks for one
386
+ re-assemble with the same config. The reading reads only `config.requirements`.
387
+
388
+ `assemble` and `build` refuse a `--requirements` file that `config.requirements`
389
+ does not name whenever its content reaches assembly: the config has a region
390
+ take (`setup_painting.rgb_tolerance`), or under `ground: "busy"` with
391
+ `project: "visible"` the file declares `setup_painting.figure_mask`. With no
392
+ `config.requirements` the refusal is `ASSEMBLE_REQUIREMENTS_UNDECLARED`; a
393
+ declaration naming another file is `BUILD_REQUIREMENTS_CONFLICT`, whose detail
394
+ then names the field that reaches assembly. "Names" is the rule
395
+ `BUILD_REQUIREMENTS_CONFLICT` already holds: the same file once resolved (the
396
+ flag against the working directory, the declaration against the config's
397
+ directory), or a file of the same bytes. A `--requirements` file whose content
398
+ reaches no assembly input is accepted as before and moves no byte. Where a
399
+ region take or a busy-visible figure mask reads requirements, `assemble` reads
400
+ them as `build` does: from `config.requirements`, with `--requirements`
401
+ optional and, when given, naming the same file. "The same file" here and in
402
+ both refusals means the same resolved file, or a file with the same bytes. So
403
+ every requirements value that changes what assemble takes or masks is in the
404
+ reading. A flag-only `cut_material` still decides whether
405
+ `cut_material_sources.json` is written, and a flag-only `pinholes.required`
406
+ still decides a refusal; neither changes the parts or the stamp.
407
+
408
+ Release order for the tolerance binding: a reader on Parts 2.48.0 or earlier
409
+ refuses a stamp this release writes for a config with a region take and a
410
+ declared tolerance outside busy-visible, with a false `ASSEMBLY_CONFIG_STALE`
411
+ at `config.requirements.setup_painting.rgb_tolerance`. So release Parts, then
412
+ Review, then Create, before those consumers read such stamps.
413
+
414
+ A stamp that predates both later bindings is refused with one sentence naming
415
+ both: `the recorded stamp predates split-take donor metadata and region-take
416
+ setup_painting.rgb_tolerance bindings. Re-run assemble once with the same
417
+ config`.
418
+
378
419
  The stable named subpath `@rig-c/parts/assembly-reading` exports
379
420
  `assemblyConfigReading(configPath: string, parts: PartsFile): AssemblyConfigRecord`
380
421
  and `assemblyConfigChanges(configPath: string, parts: PartsFile): string[]`.
@@ -1177,7 +1218,7 @@ remains a diagnostic and the bar uses the precedence below.
1177
1218
  | `CUT_JOINT_MATERIAL` | Declared joint cut-material support and crossing evidence | `undeclared` |
1178
1219
  | `SETUP_MATCHES_PAINTING` | Native-grid source vs rendered setup under authored regional mismatch limits | `undeclared`, `no-limit` (at least one region lacks a limit and none fail) |
1179
1220
  | `BOUNDARY_COLOUR_STEP` | Authored allowance for excess colour step between parts in idle | `undeclared` |
1180
- | `BEHIND_PART_SEAMS` | Authored thresholds for standing and motion-opened rear seam cells, including requested turn poses | `undeclared`, `no-complete-threshold-reading` (including no eligible pairs or an incomplete non-failing reading) |
1221
+ | `BEHIND_PART_SEAMS` | Authored thresholds for standing at setup and motion-opened rear seam cells, including `motion_opened` at requested turn poses | `undeclared`, `no-complete-threshold-reading` (including no eligible pairs or an incomplete non-failing reading) |
1181
1222
  | `SEAM_OVER_MOTION` | Body-root gap plus under-owned ghost floor and required zero-background seam readings | `no-root-gate`, `no-animation`, `no-complete-root-reading` (root evidence unmeasured) |
1182
1223
 
1183
1224
  | SEAM_OVER_MOTION precedence | Declared outcome |
@@ -1498,7 +1539,12 @@ Busy-ground visible assembly validates config.requirements and its flag correspo
1498
1539
  The optional `setup_painting` key in `spine-parts-requirements/1` adds a
1499
1540
  `SETUP_MATCHES_PAINTING` measurement when declared. It requires authored
1500
1541
  `rgb_tolerance` and named native-stage boxes. Each optional `max_pixels` is
1501
- that whole region's limit; omission is SKIP, never PASS. The optional boolean
1542
+ that whole region's limit; omission is SKIP, never PASS. With neither
1543
+ `figure_mask` nor `backdrop` declared, a region whose `(uncovered)` slot row is
1544
+ more than half its `pixel_count` adds one console line,
1545
+ `SETUP_PAINTING_MOSTLY_UNCOVERED` (issue #1421, a warning and not a bar), and
1546
+ the summary line names it; no exit code, problem or `check.json` byte moves.
1547
+ The optional boolean
1502
1548
  `setup_painting.required` (issue #943, additive) is the author's declaration
1503
1549
  that the check may not SKIP: with `true`, an absent `rgb_tolerance`, `regions`
1504
1550
  or region `max_pixels` is refused by name as `SETUP_PAINTING_REQUIRED_LIMIT`
@@ -1610,8 +1656,9 @@ reads that frame (or pair), or
1610
1656
  `reason: "idle standing is not measured: idle frames have no recomposite oracle, and the pair's idle reading is motion_opened"`
1611
1657
  when `motion_opened` cannot read that frame (or pair). `pairs[].standing` is
1612
1658
  the idle summary only; setup status is at `pairs[].setup.standing` (never folded
1613
- into `pairs[].standing`), and `BehindSeamsStanding` and `BehindSeamsReading`
1614
- carry an optional `reason` string when `status` is `"SKIP"`. `BEHIND_PART_SEAMS`
1659
+ into `pairs[].standing`), and `BehindSeamsStanding`, `BehindSeamsReading` and
1660
+ `BehindSeamsTurnPair['standing']` carry an optional `reason` string when
1661
+ `status` is `"SKIP"`. `BEHIND_PART_SEAMS`
1615
1662
  keeps `setup`, `motion_opened` and `standing` separate, names the selected pair
1616
1663
  and provenance, per-frame `behind_slots`, grid and sampled/read/unmeasured
1617
1664
  counts, and reports per-frame hits, worst counts, temporal spans and spatial
@@ -1625,9 +1672,9 @@ bracketed-run definition does not certify curved or diagonal openings.
1625
1672
 
1626
1673
  Per-cell samples are a bounded diagnostic sample; the counts are the
1627
1674
  measurement (issue #1403). Each measured `samples[]` list (setup standing, idle
1628
- `motion_opened` on every idle frame, and turn `standing` and `motion_opened` on
1629
- every turn pose; idle `standing` is never measured and its `samples[]` is always
1630
- `[]`) holds at most 64 rows.
1675
+ `motion_opened` on every idle frame, and turn `motion_opened` on every turn
1676
+ pose; idle and turn `standing` are never measured and their `samples[]` are
1677
+ always `[]`) holds at most 64 rows.
1631
1678
  A list that measured more holds 64 and gains `samples_omitted`, the number of
1632
1679
  rows left out; a list of 64 or fewer has no such field and is written as before.
1633
1680
  Standing keeps its 64 worst rows: counted first, then the larger of the two
@@ -1642,16 +1689,27 @@ this key no turn rows are written and existing `check.json` bytes are unchanged.
1642
1689
  With it, `BEHIND_PART_SEAMS.turn` records named independent reset poses: each
1643
1690
  dial's declared `from` and `max` with other dials at setup, then every full
1644
1691
  min/max corner, deduplicated in that order. It records planned and observed dial locals and observed slider mapped times, per-pair
1645
- `frames`, `sampled_poses`, `read_poses`, `unmeasured_poses`, and separate
1646
- `motion_opened` / `standing` status and maximum counts. There are no temporal
1692
+ `frames`, `sampled_poses`, `read_poses`, `unmeasured_poses`, `motion_opened`
1693
+ status and maximum count, and the `standing` summary (`status: "SKIP"`,
1694
+ `reason`, `max_px: 0`). There are no temporal
1647
1695
  spans: pose indices are sample identities, and time is 0 for every reset.
1648
1696
  Turn uses its own setup, rest geometry and transported stock seam evidence;
1649
- idle stock and idle counts are unchanged. The same thresholds, allowances,
1650
- rear-set and endpoint-ownership unread rules apply, without a recomposite
1651
- comparison (turn poses have no per-pose recomposite oracle, so turn standing is
1652
- judged by endpoint contrast alone and reports all interior cells of an unread
1653
- corridor). Optional unread-corridor evidence also applies
1654
- to turn standing rows. No declared dial persists turn SKIP and a named HOLE;
1697
+ idle stock and idle counts are unchanged. The same thresholds, allowances and
1698
+ rear-set rules apply to `motion_opened` on turn poses. Because a turn pose is
1699
+ an independent `t=0` pose and the parts' flat recomposite is not transported to
1700
+ it, turn `standing` is never measured (issue #1412), mirroring idle: on each
1701
+ turn pose, `turn.pairs[].frames[].standing` carries `status: "SKIP"` with zero
1702
+ counts, `box: null`, `samples: []`, no `unread_cells` or `unread_corridors`, and
1703
+ its per-pose `reason` (`"not applicable: motion_opened reads the pair"` when
1704
+ `motion_opened` reads the pair on that pose, or
1705
+ `"turn standing is not measured: turn poses have no recomposite oracle, and the pair's turn reading is motion_opened"`
1706
+ when `motion_opened` cannot read the pair on that pose), and the pair summary
1707
+ `turn.pairs[].standing` is `{ status: "SKIP", reason, max_px: 0 }` (carrying the
1708
+ motion-read reason when `turn.pairs[].motion_opened.status !== "SKIP"`, or the
1709
+ turn no-oracle reason when it is `"SKIP"`). Where `motion_opened` cannot read
1710
+ the pair on a turn pose, its existing named `HOLE` in `turn.unmeasured[]` stays
1711
+ in place, and with an authored effective T emits
1712
+ `CHECK_BEHIND_PART_SEAMS_UNMEASURED`. No declared dial persists turn SKIP and a named HOLE;
1655
1713
  an effective authored T makes that missing required reading a
1656
1714
  `CHECK_BEHIND_PART_SEAMS_UNMEASURED` failure. Legacy `turn.x` has no declared
1657
1715
  finite range and is explicitly unread, never given a guessed range. The
@@ -1670,8 +1728,8 @@ An unavailable poser or source is a HOLE. Other animations, between-sample turns
1670
1728
  skins remain unmeasured.
1671
1729
 
1672
1730
  Issue #1325 adds the following optional evidence fields to
1673
- `BEHIND_PART_SEAMS.pairs[].setup.standing` (and turn standing records when
1674
- `behind_seams.turn: true`; idle `frames[].standing` is never measured). Paths in
1731
+ `BEHIND_PART_SEAMS.pairs[].setup.standing` (idle `frames[].standing` and turn
1732
+ `turn.pairs[].frames[].standing` are never measured). Paths in
1675
1733
  the table are relative to that standing record.
1676
1734
 
1677
1735
  | Field | Stable meaning |
@@ -1680,7 +1738,7 @@ the table are relative to that standing record.
1680
1738
  | `unread_corridors` | Nonempty array of ambiguous-endpoint runs (at setup, those with at least one cell where `dRecomposite > T`), horizontal rows before vertical columns, each in native scan order. |
1681
1739
  | `unread_corridors[].axis` | `horizontal` or `vertical`. |
1682
1740
  | `unread_corridors[].endpoints` | Two `[grid_x, grid_y, world_x, world_y, owner]` tuples in left/right or top/bottom order. Grid indices are zero-based, x right and y down; world coordinates are cell centres, y up. Owner codes are 0 for neither A/B reaching half alpha, 1 for A only, 2 for B only and 3 for both; no owner is inferred. |
1683
- | `unread_corridors[].cells` | Interior world-centre `[x, y]` tuples in run order, excluding endpoints. On a corridor whose endpoint owner is ambiguous (`0` or `3`) at setup, cells within T of the parts' recomposite (`dRecomposite <= T`) are left out of the unread population; the remaining interior cells (and on turn poses, all interior cells of the run) are reported without a rear-colour or endpoint-contrast filter; intersections may repeat across corridors. |
1741
+ | `unread_corridors[].cells` | Interior world-centre `[x, y]` tuples in run order, excluding endpoints. On a corridor whose endpoint owner is ambiguous (`0` or `3`) at setup, cells within T of the parts' recomposite (`dRecomposite <= T`) are left out of the unread population; the remaining interior cells are reported without a rear-colour or endpoint-contrast filter; intersections may repeat across corridors. |
1684
1742
  | `unread_corridors[].cell_count` | The number of reported interior cells in that corridor (at setup, leaving out cells within T of the recomposite), exactly `cells.length`. |
1685
1743
  | `unread_corridors[].row_scope` | `pair`. |
1686
1744
  | `unread_corridors[].row_kind` | `evidence`. |
@@ -1695,10 +1753,11 @@ with `dRecomposite > T`) remains unread without choosing an A/B owner. Readable
1695
1753
  corridors retain their measured cells: a standing count above allowance remains
1696
1754
  FAIL even with unread corridors, while unread corridors without a measured
1697
1755
  excess leave standing SKIP. Required unread evidence still makes the combined
1698
- line FAIL. Idle `read_frames` counts idle frames where `motion_opened` is read
1699
- (idle `standing` is never measured); on turn poses, `read_poses` excludes
1700
- partially unread poses, including those whose measured count already fails,
1701
- keeping them in `unmeasured_poses`. Setup is reported separately at
1756
+ line FAIL. Idle `read_frames` counts idle frames where `motion_opened` is read,
1757
+ and turn `read_poses` counts turn poses where `motion_opened` is read (without
1758
+ a `turn.unmeasured[]` row for that pose; idle and turn `standing` are never
1759
+ measured); poses where `motion_opened` is unavailable remain in
1760
+ `unmeasured_poses`. Setup is reported separately at
1702
1761
  `pairs[].setup`.
1703
1762
  A boundary-colour PASS does not prove seam closure. Without `behind_seams`,
1704
1763
  existing configurations remain optional and their checks retain their behavior;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rig-c/parts",
3
- "version": "2.48.0",
3
+ "version": "2.49.1",
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": {
@@ -108,6 +108,8 @@ interface ReadingContext extends ReturnType<typeof digestFiles>, Required<Assemb
108
108
  limbs: unknown[];
109
109
  hybridWidths: ReadonlyMap<string, Array<{ set: string | null; width?: number }>>;
110
110
  setup: SetupPainting | undefined;
111
+ /** The declared tolerance a region take reads, when no setup_painting digest already holds it. */
112
+ regionTolerance: number | undefined;
111
113
  setupImage: (declaration: SetupPainting['figure_mask'] | SetupPainting['backdrop'], field: string) => unknown;
112
114
  authoredDepths: () => unknown;
113
115
  }
@@ -147,10 +149,15 @@ function nonempty<T>(value: T[] | undefined): T[] | undefined {
147
149
  return value?.length ? value : undefined;
148
150
  }
149
151
 
152
+ /** The region take's colour limit, bound from `config.requirements` (#1393). */
153
+ export const REGION_TOLERANCE_FIELD = 'requirements.setup_painting.rgb_tolerance';
154
+
150
155
  function projectionEntries(cfg: ProjectionSource) {
151
- // Follow-up #1393 covers effective requirements/receipt inputs. CLI
152
- // requirements values are read outside this config view. Only selected values
153
- // can be exemptions in the projection, such as the editor receipt ledger below.
156
+ // Requirements values reach this config view only through config.requirements.
157
+ // assemble and build refuse a --requirements file the config does not name
158
+ // when its content reaches assembly (#1418), so nothing assembly reads is outside it.
159
+ // Only selected values can be exemptions in the projection, such as the
160
+ // editor receipt ledger below.
154
161
  const a = cfg.assemble;
155
162
  // These fields used to enter the digest through the enumerable assemble spread.
156
163
  const authored = <K extends keyof typeof a>(key: K) => {
@@ -256,6 +263,7 @@ function projectionEntries(cfg: ProjectionSource) {
256
263
  figure_mask: ctx.setupImage(ctx.setup.figure_mask, 'figure_mask'),
257
264
  backdrop: ctx.setupImage(ctx.setup.backdrop, 'backdrop'),
258
265
  },
266
+ [REGION_TOLERANCE_FIELD]: ctx => ctx.regionTolerance,
259
267
  }),
260
268
  scene: bound(cfg.scene === undefined ? undefined : true),
261
269
  // Turn, meshes and regions reach existing carrier helpers as aggregates.
@@ -375,6 +383,12 @@ function readingContext(cfg: AssemblyView, parts: PartsFile, configPath: string,
375
383
  const requirementsPath = ground === 'busy' && cfg.requirements !== undefined
376
384
  ? resolve(base, cfg.requirements) : undefined;
377
385
  const setup = requirementsPath === undefined ? undefined : readRequirements(requirementsPath).setup_painting;
386
+ // A region take reads setup_painting.rgb_tolerance whatever the ground. The
387
+ // busy-visible setup_painting digest above already holds it; elsewhere it
388
+ // gets its own field, so no existing stamp moves where it was covered.
389
+ const regionTolerance = setup !== undefined || cfg.requirements === undefined ||
390
+ !(cfg.assemble.take ?? []).some(take => 'seed' in take)
391
+ ? undefined : readRequirements(resolve(base, cfg.requirements)).setup_painting?.rgb_tolerance;
378
392
  const setupImage = (declaration: SetupPainting['figure_mask'] | SetupPainting['backdrop'], field: string) =>
379
393
  declaration === undefined ? undefined : {
380
394
  ...declaration,
@@ -422,7 +436,7 @@ function readingContext(cfg: AssemblyView, parts: PartsFile, configPath: string,
422
436
  // Alternate skeleton and drawn registration also use the hierarchy.
423
437
  const bones = posesAlternate ? cfg.bones : geometry.length === 0 ? undefined : geometry;
424
438
  return {
425
- ...files, seam, project, ground, setup, setupImage, hasHeadRun,
439
+ ...files, seam, project, ground, setup, regionTolerance, setupImage, hasHeadRun,
426
440
  basePairs, physicsPairs, bones, limbs, hybridWidths,
427
441
  authoredDepths: () => cfg.depth === undefined ? undefined
428
442
  : [...authoredUnitDepths(cfg)].sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0),
@@ -457,6 +471,12 @@ export function isSplitTakeMetadataField(name: string): boolean {
457
471
  return /^assemble\.take\[(?:0|[1-9][0-9]*)\]\.meta$/.test(name);
458
472
  }
459
473
 
474
+ /** Fields added to the reading after stamps were first written, in sentence order. */
475
+ const LATER_BINDINGS: ReadonlyArray<{ field: (name: string) => boolean; binding: string }> = [
476
+ { field: isSplitTakeMetadataField, binding: 'split-take donor metadata' },
477
+ { field: name => name === REGION_TOLERANCE_FIELD, binding: 'region-take setup_painting.rgb_tolerance' },
478
+ ];
479
+
460
480
  export function assemblyConfigReading(configPath: string, parts: PartsFile): AssemblyConfigRecord {
461
481
  return readAssemblyConfig(loadEarlyConfig(configPath, 'assemble'), parts, configPath);
462
482
  }
@@ -484,10 +504,16 @@ export function refuseStaleAssembly(configPath: string, parts: PartsFile, loaded
484
504
  const current = readAssemblyConfig(cfg, parts, configPath, overrides);
485
505
  const changes = changedAssemblyFields(previous, current);
486
506
  if (changes.length === 0) return;
487
- const recorded = new Set(previous.fields.map(({ name }) => name));
488
- const predatesSplitMetadata = changes.every(name => isSplitTakeMetadataField(name) && !recorded.has(name));
489
- const detail = predatesSplitMetadata
490
- ? `assembly reading changed at ${changes.map(name => `config.${name}`).join(', ')}; the recorded stamp predates split-take donor metadata binding. Re-run assemble once with the same config`
491
- : assemblyChangeDetail(changes);
507
+ const detail = staleAssemblyDetail(changes, new Set(previous.fields.map(({ name }) => name)));
492
508
  throw new PartsError([{ code: 'ASSEMBLY_CONFIG_STALE', object: configPath, detail }]);
493
509
  }
510
+
511
+ /** The stale refusal's detail for `changes` against a stamp recording `recorded`; a stamp that lacks only later bindings is told so. */
512
+ export function staleAssemblyDetail(changes: readonly string[], recorded: ReadonlySet<string>): string {
513
+ // A field a newer binding adds, absent from the stamp, means the stamp predates that binding.
514
+ const predated = changes.map(name => recorded.has(name) ? undefined : LATER_BINDINGS.find(later => later.field(name)));
515
+ const bindings = LATER_BINDINGS.filter(later => predated.includes(later)).map(later => later.binding);
516
+ return predated.every(later => later !== undefined)
517
+ ? `assembly reading changed at ${changes.map(name => `config.${name}`).join(', ')}; the recorded stamp predates ${bindings.join(' and ')} binding${bindings.length > 1 ? 's' : ''}. Re-run assemble once with the same config`
518
+ : assemblyChangeDetail(changes);
519
+ }
@@ -17,6 +17,8 @@ export const BEHIND_SEAM_UNMEASURED_CODE = 'CHECK_BEHIND_PART_SEAMS_UNMEASURED';
17
17
  export const NO_PARTS_SETUP_STANDING_REASON = "no --parts manifest was supplied; setup standing compares the setup render with the parts' flat recomposite";
18
18
  export const IDLE_STANDING_MOTION_READ_REASON = 'not applicable: motion_opened reads the pair';
19
19
  export const IDLE_STANDING_NO_ORACLE_REASON = "idle standing is not measured: idle frames have no recomposite oracle, and the pair's idle reading is motion_opened";
20
+ export const TURN_STANDING_MOTION_READ_REASON = IDLE_STANDING_MOTION_READ_REASON;
21
+ export const TURN_STANDING_NO_ORACLE_REASON = "turn standing is not measured: turn poses have no recomposite oracle, and the pair's turn reading is motion_opened";
20
22
 
21
23
  export interface BehindSeams {
22
24
  /** Opt in to the rig's declared ranges; never supplies or guesses a range. */
@@ -50,6 +52,8 @@ export interface BehindSeamsFramesInput {
50
52
  plantSkipRecomposite?: true;
51
53
  /** Issue #1408 plant only: measure standing on idle frames without an oracle; production never sets it. */
52
54
  plantMeasureIdleStanding?: true;
55
+ /** Issue #1412 plant only: measure standing on turn poses without an oracle; production never sets it. */
56
+ plantMeasureTurnStanding?: true;
53
57
  }
54
58
  export interface BehindSeamsTurnPose {
55
59
  name: string;
@@ -77,7 +81,7 @@ export interface BehindSeamsTurnPair {
77
81
  read_poses: number;
78
82
  unmeasured_poses: number;
79
83
  motion_opened: { status: BehindSeamsCount['status']; max_px: number };
80
- standing: { status: BehindSeamsCount['status']; max_px: number };
84
+ standing: { status: BehindSeamsCount['status']; reason?: string; max_px: number };
81
85
  }
82
86
  export interface BehindSeamsTurnMeasured {
83
87
  status: BehindSeamsCount['status'];
@@ -116,7 +120,7 @@ export interface BehindSeamsUnreadCorridor {
116
120
  cell_count: number;
117
121
  }
118
122
  export interface BehindSeamsStanding extends BehindSeamsCount {
119
- /** Present when standing is SKIP: at setup without --parts, or on every idle frame. */
123
+ /** Present when standing is SKIP: at setup without --parts, or on every idle frame and turn pose. */
120
124
  reason?: string;
121
125
  /** Distinct grid cells across all unread corridors, including cross-axis intersections. */
122
126
  unread_cells?: number;
@@ -362,10 +366,13 @@ function readBehindFrame(api: BehindSeamsApi, input: BehindSeamsFramesInput, pai
362
366
  stock: BehindSeamsStockPair | undefined, threshold: number, allowance: number, unread: (frame: string, reason: string) => void,
363
367
  cache: Map<Frame, Map<string, RasterCache>>, pose?: BehindSeamsTurnPose): BehindSeamsFrame {
364
368
  const isIdle = !setup && pose === undefined;
369
+ const isTurn = pose !== undefined;
370
+ const plantIdleStanding = isIdle && input.plantMeasureIdleStanding === true;
371
+ const plantTurnStanding = isTurn && input.plantMeasureTurnStanding === true;
365
372
  const label = pose !== undefined ? `turn ${pose.name}` : setup ? 'setup' : `idle frame ${frame.index}`;
366
373
  const family = pose !== undefined ? 'BEHIND_PART_SEAMS.turn.pairs[].frames' : setup ? 'BEHIND_PART_SEAMS.pairs[].setup' : 'BEHIND_PART_SEAMS.pairs[].frames';
367
374
  const row: BehindSeamsFrame = { ...checkRow(family, 'pair', false, [pair.a, pair.b]), animation: pose !== undefined ? 'turn' : setup ? null : 'idle', index: frame.index, time: frame.time, ...(pose === undefined ? {} : { pose: pose.name, values: { ...pose.values }, ...(pose.observed_values === undefined ? {} : { observed_values: pose.observed_values, slider_times: pose.slider_times }) }), behind_slots: [], grid: null, motion_opened: emptyCount(),
368
- standing: isIdle ? { ...emptyCount('SKIP'), reason: IDLE_STANDING_NO_ORACLE_REASON } : emptyCount() };
375
+ standing: isIdle && !plantIdleStanding ? { ...emptyCount('SKIP'), reason: IDLE_STANDING_NO_ORACLE_REASON } : isTurn && !plantTurnStanding ? { ...emptyCount('SKIP'), reason: TURN_STANDING_NO_ORACLE_REASON } : emptyCount() };
369
376
  const fail = (reason: string): BehindSeamsFrame => { unread(label, reason); return row; };
370
377
  if (pair.unread !== undefined) return fail(pair.unread);
371
378
  if (frame.attachments === undefined) return fail('draw order/whole attachment geometry is unavailable');
@@ -396,8 +403,7 @@ function readBehindFrame(api: BehindSeamsApi, input: BehindSeamsFramesInput, pai
396
403
  rasters = { full: api.renderFrame(frame, input.pages, viewport, [0, 0, 0, 0]), hidden: api.renderFrame({ ...frame, pieces: frame.pieces.filter(p => !behind.has(p.slot)) }, input.pages, viewport, [0, 0, 0, 0]) };
397
404
  frameCache.set(cacheKey, rasters);
398
405
  }
399
- const plantIdleStanding = isIdle && input.plantMeasureIdleStanding === true;
400
- const measureStanding = pose !== undefined || plantIdleStanding || (setup && input.recomposite !== undefined && input.recomposite !== null);
406
+ const measureStanding = plantTurnStanding || plantIdleStanding || (setup && input.recomposite !== undefined && input.recomposite !== null);
401
407
  let recompositeDiff: ((k: number) => number) | null = null;
402
408
  if (setup) {
403
409
  if (input.recomposite === undefined || input.recomposite === null) {
@@ -581,6 +587,11 @@ function readBehindFrame(api: BehindSeamsApi, input: BehindSeamsFramesInput, pai
581
587
  ...emptyCount('SKIP'),
582
588
  reason: row.motion_opened.status !== 'SKIP' ? IDLE_STANDING_MOTION_READ_REASON : IDLE_STANDING_NO_ORACLE_REASON,
583
589
  };
590
+ } else if (isTurn && !plantTurnStanding) {
591
+ row.standing = {
592
+ ...emptyCount('SKIP'),
593
+ reason: row.motion_opened.status !== 'SKIP' ? TURN_STANDING_MOTION_READ_REASON : TURN_STANDING_NO_ORACLE_REASON,
594
+ };
584
595
  }
585
596
  return { ...row, ...checkRow(family, 'pair', row.standing.status === 'FAIL' || row.motion_opened.status === 'FAIL', [pair.a, pair.b]) };
586
597
  } catch (e) { return fail(`official raster/source reading unavailable: ${e instanceof Error ? e.message : String(e)}`); }
@@ -695,7 +706,7 @@ export function measureBehindSeamFrames(api: BehindSeamsApi, input: BehindSeamsF
695
706
  function measureBehindTurnFrames(api: BehindSeamsApi, input: BehindSeamsFramesInput, declared: BehindSeams, problems: Problem[]): BehindSeamsTurnMeasured {
696
707
  const turn = input.turn;
697
708
  const result: BehindSeamsTurnMeasured = { status: 'SKIP', poses: turn?.poses.map(p => p.name) ?? [], pairs: [], unmeasured: [],
698
- limitations: 'independent setup-reset turn endpoints and full range corners only; no sweep, idle motion, temporal spans or alternate skins; standing and transported setup-overlap are separate' };
709
+ limitations: 'independent setup-reset turn endpoints and full range corners only; no sweep, idle motion, temporal spans or alternate skins; standing is not measured on turn poses, and motion_opened is the turn reading' };
699
710
  if (turn?.poser !== undefined) result.limitations += `; poser ${turn.poser}`;
700
711
  if (turn?.sourceSkeletonSha256 !== undefined) result.limitations += `; original skeleton sha256 ${turn.sourceSkeletonSha256}`;
701
712
  const required = declared.threshold !== undefined || declared.pairs?.some(p => p.threshold !== undefined) === true;
@@ -712,7 +723,7 @@ function measureBehindTurnFrames(api: BehindSeamsApi, input: BehindSeamsFramesIn
712
723
  return { ...checkRow('BEHIND_PART_SEAMS.turn.pairs', 'pair', required, [pair.a, pair.b]), pair: pair.pair, parts: [pair.a, pair.b],
713
724
  threshold: override?.threshold ?? declared.threshold ?? null, allowance: override?.allowance ?? declared.allowance ?? 0,
714
725
  frames: [], sampled_poses: 0, read_poses: 0, unmeasured_poses: 0,
715
- motion_opened: { status: 'SKIP', max_px: 0 }, standing: { status: 'SKIP', max_px: 0 } };
726
+ motion_opened: { status: 'SKIP', max_px: 0 }, standing: { status: 'SKIP', reason: TURN_STANDING_NO_ORACLE_REASON, max_px: 0 } };
716
727
  });
717
728
  return result;
718
729
  }
@@ -740,24 +751,32 @@ function measureBehindTurnFrames(api: BehindSeamsApi, input: BehindSeamsFramesIn
740
751
  const row = readBehindFrame(api, posedInput, pair, frame, false, stockRows.length === 1 ? stockRows[0] : undefined,
741
752
  threshold, allowance, (where, why) => unread(pair, where, why, true), cache, pose);
742
753
  rows.push(row); cache.clear();
743
- for (const kind of ['motion_opened', 'standing'] as const) if (row[kind].status === 'FAIL') problems.push({ code: BEHIND_SEAM_CODE,
744
- object: `pair "${pair.pair}" turn ${pose.name} ${kind}`, detail: `${row[kind].px} native seam cells exceeds allowance ${allowance}; authored threshold ${threshold}; independent declared turn pose` });
754
+ if (row.motion_opened.status === 'FAIL') problems.push({ code: BEHIND_SEAM_CODE,
755
+ object: `pair "${pair.pair}" turn ${pose.name} motion_opened`, detail: `${row.motion_opened.px} native seam cells exceeds allowance ${allowance}; authored threshold ${threshold}; independent declared turn pose` });
756
+ if (input.plantMeasureTurnStanding === true && row.standing.status === 'FAIL') problems.push({ code: BEHIND_SEAM_CODE,
757
+ object: `pair "${pair.pair}" turn ${pose.name} standing`, detail: `${row.standing.px} native seam cells exceeds allowance ${allowance}; authored threshold ${threshold}; independent declared turn pose` });
745
758
  }
746
759
  }
747
- const read = rows.filter(row => row.motion_opened.status !== 'SKIP' && row.standing.status !== 'SKIP' &&
760
+ // Both clauses overlap on purpose, as in idle readFrames: every path leaving motion_opened SKIP also records turn.unmeasured[].
761
+ const read = rows.filter(row => row.motion_opened.status !== 'SKIP' &&
748
762
  !result.unmeasured.some(u => u.pair === pair.pair && u.frame === `turn ${row.pose}`)).length;
749
- const aggregate = (kind: 'motion_opened' | 'standing'): BehindSeamsTurnPair['standing'] => ({
763
+ const aggregate = (kind: 'motion_opened' | 'standing'): { status: BehindSeamsCount['status']; max_px: number } => ({
750
764
  status: rows.some(r => r[kind].status === 'FAIL') ? 'FAIL' : complete && rows.length === turn.poses.length && rows.every(r => r[kind].status === 'PASS') ? 'PASS' : 'SKIP',
751
765
  max_px: Math.max(0, ...rows.map(r => r[kind].px)),
752
766
  });
753
- const motion = aggregate('motion_opened'), standing = aggregate('standing');
767
+ const motion = aggregate('motion_opened');
768
+ const turnStandingReason = motion.status !== 'SKIP' ? TURN_STANDING_MOTION_READ_REASON : TURN_STANDING_NO_ORACLE_REASON;
769
+ const rawStanding = aggregate('standing');
770
+ const standing: BehindSeamsTurnPair['standing'] = input.plantMeasureTurnStanding === true
771
+ ? rawStanding
772
+ : { status: 'SKIP', reason: turnStandingReason, max_px: 0 };
754
773
  result.pairs.push({ ...checkRow('BEHIND_PART_SEAMS.turn.pairs', 'pair', motion.status === 'FAIL' || standing.status === 'FAIL' || threshold !== null && read !== turn.poses.length, parts),
755
774
  pair: pair.pair, parts, threshold, allowance, frames: rows, sampled_poses: turn.poses.length, read_poses: read, unmeasured_poses: turn.poses.length - read,
756
775
  motion_opened: motion, standing });
757
776
  }
758
777
  if (input.pairs.length === 0) unread(null, 'turn selection', 'no selected seam pair; turn boundary population is unavailable', required);
759
778
  result.status = result.pairs.some(p => p.motion_opened.status === 'FAIL' || p.standing.status === 'FAIL') || mandatoryUnread ? 'FAIL'
760
- : result.pairs.length === 0 || result.pairs.some(p => p.motion_opened.status === 'SKIP' || p.standing.status === 'SKIP') ? 'SKIP' : 'PASS';
779
+ : result.pairs.length === 0 || result.pairs.some(p => p.motion_opened.status === 'SKIP') ? 'SKIP' : 'PASS';
761
780
  return result;
762
781
  }
763
782
 
@@ -1025,7 +1044,7 @@ export function behindSeamLines(line: BehindSeamsMeasured | null): string[] {
1025
1044
  }),
1026
1045
  ...(line.turn === undefined ? [] : [
1027
1046
  `${BEHIND_SEAM_LINE}: turn ${line.turn.status} — ${line.turn.poses.length} preselected endpoint/corner pose(s); ${line.turn.limitations}`,
1028
- ...line.turn.pairs.flatMap(p => p.frames.map(f => `${BEHIND_SEAM_LINE}: pair "${p.pair}" turn ${f.pose} — motion_opened ${f.motion_opened.status}, ${f.motion_opened.px} cells; standing ${f.standing.status}, ${f.standing.px} cells; threshold ${p.threshold}, allowance ${p.allowance}`)),
1047
+ ...line.turn.pairs.flatMap(p => p.frames.map(f => `${BEHIND_SEAM_LINE}: pair "${p.pair}" turn ${f.pose} — motion_opened ${f.motion_opened.status}, ${f.motion_opened.px} cells; standing ${f.standing.reason !== undefined ? `${f.standing.status} (${f.standing.reason})` : f.standing.status}, ${f.standing.px} cells; threshold ${p.threshold}, allowance ${p.allowance}`)),
1029
1048
  ...line.turn.unmeasured.map(u => `${BEHIND_SEAM_LINE}: ${u.pair === null ? 'rig' : `pair "${u.pair}"`} ${u.frame} SKIP — ${u.reason}`),
1030
1049
  ]),
1031
1050
  ...line.unmeasured.map(u => {
package/src/build.ts CHANGED
@@ -382,6 +382,7 @@ function verifyUnderPlateMasks(
382
382
  }
383
383
 
384
384
  export interface EmitFillMasksInput {
385
+ requirements?: string;
385
386
  source: string;
386
387
  full: string;
387
388
  head: string | null;
@@ -391,15 +392,39 @@ export interface EmitFillMasksInput {
391
392
  project?: ProjectRule;
392
393
  }
393
394
 
395
+ function resolveAssemblyRequirements(
396
+ input: { requirements?: string; config: string },
397
+ cfg: Pick<ReturnType<typeof loadEarlyConfig>, 'requirements' | 'assemble'>,
398
+ project: ProjectRule,
399
+ requirementsFile: ReturnType<typeof readRequirements> | null = input.requirements === undefined ? null : readRequirements(input.requirements),
400
+ ): { requirements: BuildRequirements | null; effectiveSetup: ReturnType<typeof readRequirements>['setup_painting'] } {
401
+ const busyVisible = cfg.assemble.ground === 'busy' && project === 'visible';
402
+ const regionTake = (cfg.assemble.take ?? []).some(take => 'seed' in take);
403
+ // Issue #1418: a requirements file whose content reaches assembly must be the one config.requirements names,
404
+ // because assembly_config reads only config.requirements.
405
+ refuseUnnamedAssemblyRequirements(input.requirements, cfg.requirements, input.config, [
406
+ ...(regionTake ? ['setup_painting.rgb_tolerance (a region take)'] : []),
407
+ ...(busyVisible && requirementsFile?.setup_painting?.figure_mask !== undefined ? ['setup_painting.figure_mask (busy-visible)'] : []),
408
+ ]);
409
+ // Where requirements reach assembly, assemble reads them as build does: config.requirements, or the flag when the
410
+ // config declares none, the two being one file when both are given (buildRequirements). Elsewhere nothing here reads them.
411
+ const requirements = busyVisible || regionTake
412
+ ? buildRequirements(input.requirements, cfg.requirements, input.config) : null;
413
+ const effectiveSetup = requirements === null ? undefined : readRequirements(requirements.read).setup_painting;
414
+ return { requirements, effectiveSetup };
415
+ }
416
+
394
417
  export function emitFillMasksStage(input: EmitFillMasksInput, log: Log): Array<{ into: string; path: string; sha256: string; opaquePx: number }> {
418
+ const requirementsFile = input.requirements === undefined ? null : readRequirements(input.requirements);
395
419
  const cfg = loadEarlyConfig(input.config, 'assemble', input.project);
396
420
  const { seam, project } = effectiveAssemblyRules(cfg.assemble, input);
421
+ const { requirements, effectiveSetup } = resolveAssemblyRequirements(input, cfg, project, requirementsFile);
397
422
  const src = readSource(input.source);
398
423
  const read = readRuns(input.full, input.head);
399
424
  const takenRuns = applyTakenLayers(read, src, cfg, input.config);
400
425
  const receipts = readEditorReceipts(cfg.assemble.editor_receipts, input.config);
401
426
  const editedParts = readEditedParts(cfg.assemble.edited_parts, input.config, cfg.assemble.plan ?? []);
402
- const runs = applyTakenRegions(takenRuns, src, cfg, input.config, undefined, receipts, input.source);
427
+ const runs = applyTakenRegions(takenRuns, src, cfg, input.config, effectiveSetup, receipts, input.source, requirements?.read);
403
428
  const fields = stageFields(cfg, runs.single ? { w: src.width, h: src.height } : null);
404
429
  const strippedCuts = fields.cuts.map((q) => ({ from: q.from, into: q.into, polygon: q.polygon, draw: q.draw, overlap: q.overlap }));
405
430
  const caps = fields.limbs === undefined ? undefined : readCaps(input.config, fields.limbs);
@@ -504,8 +529,8 @@ function sourceCoverSet(result: AssembleResult, set: string | null, painting: st
504
529
 
505
530
  /** Read, assemble, and write only after every refusal has had its chance. Throws a PartsError on a refusal, having written nothing. */
506
531
  export function assembleStage(input: AssembleStageInput, outs: AssembleOutputs, log: Log): AssembleResult {
507
- // Flag-only figure masks and the region-take tolerance are effective
508
- // inputs outside the legacy config reading.
532
+ // A --requirements file that reaches assembly must be the one config.requirements
533
+ // names (#1418), so the assembly reading sees what assemble read.
509
534
  const requirementsFile = input.requirements === undefined ? null : readRequirements(input.requirements);
510
535
  const materialAsked = requirementsFile?.cut_material !== undefined;
511
536
  // Issue #944: the pinhole bar is measured only when the requirements file declares it required.
@@ -517,8 +542,7 @@ export function assembleStage(input: AssembleStageInput, outs: AssembleOutputs,
517
542
  const cfg = { ...projection.config, seethrough: projection.config.seethrough! };
518
543
  const supportDeclarations = JSON.stringify(cfg.assemble.cuts ?? []);
519
544
  const { seam, project } = effectiveAssemblyRules(cfg.assemble, input);
520
- const requirements = cfg.assemble.ground === 'busy' && project === 'visible'
521
- ? buildRequirements(input.requirements, cfg.requirements, input.config) : null;
545
+ const { requirements, effectiveSetup } = resolveAssemblyRequirements(input, cfg, project, requirementsFile);
522
546
  const src = readSource(input.source);
523
547
  const read = readRuns(input.full, input.head);
524
548
  // Issue #946: every declared receipt is held to its file, and under `required` every edited image needs one, before anything is assembled.
@@ -527,11 +551,11 @@ export function assembleStage(input: AssembleStageInput, outs: AssembleOutputs,
527
551
  // Issue #947: under `trace_parts`, a shape drawn in the config through a part's pixels is refused with them.
528
552
  refuseIfAny([...receipts.problems, ...missingReceipts(receipts, [...editedRunImages(read), ...editedConfigImages(input.config, cfg.assemble.cuts ?? [], cfg.limbs)]), ...untracedPartSources(cfg)]);
529
553
  const takenRuns = applyTakenLayers(read, src, cfg, input.config);
530
- const runs = applyTakenRegions(takenRuns, src, cfg, input.config, requirementsFile?.setup_painting, receipts, input.source);
554
+ const runs = applyTakenRegions(takenRuns, src, cfg, input.config, effectiveSetup, receipts, input.source, requirements?.read);
531
555
  for (const note of runs.notes) log(note.startsWith('WARN ') ? note : `note: ${note}`);
532
556
  const fields = projectedStageFields(cfg, runs.single ? { w: src.width, h: src.height } : null);
533
557
  const setupPainting = requirements === null || fields.ground !== 'busy' || project !== 'visible' ? undefined
534
- : readRequirements(requirements.read).setup_painting;
558
+ : effectiveSetup;
535
559
  const figureSupport = setupPainting === undefined ? undefined
536
560
  : readSetupFigureMask(setupPainting, requirements!.read, src, Math.trunc(src.width * fields.rigScale), Math.trunc(src.height * fields.rigScale));
537
561
  const rigSize: [number, number] = [Math.trunc(src.width * fields.rigScale), Math.trunc(src.height * fields.rigScale)];
@@ -2799,11 +2823,41 @@ export function buildRequirements(flag: string | undefined, declared: string | u
2799
2823
  {
2800
2824
  code: 'BUILD_REQUIREMENTS_CONFLICT',
2801
2825
  object: `--requirements ${flag} and config.requirements "${declared}"`,
2802
- detail: `the flag names ${resolve(flag)} (${shown(flagDigest)}) and the config declares ${fromConfig} (${shown(configDigest)}); a build reads one requirements file and records it, so the two must name the same file or the same bytes — drop the flag to build from the config's file, or point config.requirements at the flag's`,
2826
+ detail: `the flag names ${resolve(flag)} (${shown(flagDigest)}) and the config declares ${fromConfig} (${shown(configDigest)}). assemble and build read one requirements file, the one config.requirements names, so the flag must name the same file (the same resolved file, or a file of the same bytes) — drop the flag to read the config's file, or point config.requirements at the flag's`,
2803
2827
  },
2804
2828
  ]);
2805
2829
  }
2806
2830
 
2831
+ /**
2832
+ * Issue #1418: `assemble` and `build` read a region take's tolerance and the
2833
+ * busy-visible figure mask from the `--requirements` file, while
2834
+ * `assembly_config` reads `config.requirements` only. So when `reaching` names
2835
+ * a field of that file that assembly uses, the flag must name the file the
2836
+ * config declares: the same file once resolved (the flag against the current
2837
+ * directory, the declaration against the config's directory), or a file of the
2838
+ * same bytes, the rule {@link buildRequirements} holds. With no declaration it
2839
+ * is `ASSEMBLE_REQUIREMENTS_UNDECLARED`; two different files are
2840
+ * `BUILD_REQUIREMENTS_CONFLICT`, naming the fields. A flag none of whose
2841
+ * content reaches assembly is not judged here.
2842
+ */
2843
+ export function refuseUnnamedAssemblyRequirements(flag: string | undefined, declared: string | undefined, configPath: string, reaching: readonly string[]): void {
2844
+ if (flag === undefined || reaching.length === 0) return;
2845
+ const fields = reaching.join(' and ');
2846
+ if (declared === undefined) {
2847
+ const path = resolve(flag);
2848
+ const digest = existsSync(path) && statSync(path).isFile() ? `sha256 ${createHash('sha256').update(readFileSync(path)).digest('hex').slice(0, 16)}` : 'no such file';
2849
+ throw new PartsError([{
2850
+ code: 'ASSEMBLE_REQUIREMENTS_UNDECLARED',
2851
+ object: `--requirements ${flag}`,
2852
+ detail: `${path} (${digest}) gives assembly ${fields}, and config.requirements is absent; assembly_config reads only config.requirements, so a file that reaches assembly must be named there — add "requirements": ${JSON.stringify(relative(dirname(resolve(configPath)), path).split(sep).join('/'))} to ${configPath}`,
2853
+ }]);
2854
+ }
2855
+ try { buildRequirements(flag, declared, configPath); } catch (error) {
2856
+ if (!(error instanceof PartsError)) throw error;
2857
+ throw new PartsError(error.problems.map(problem => ({ ...problem, detail: `${problem.detail}; the flag's file gives assembly ${fields}` })));
2858
+ }
2859
+ }
2860
+
2807
2861
  /** The `build` refusal of a `check` flag whose value or report build supplies itself ({@link CHECK_FLAGS_IN_BUILD}), or null for any other flag. */
2808
2862
  export function suppliedCheckFlag(flag: string): string | null {
2809
2863
  const row = Object.hasOwn(CHECK_FLAGS_IN_BUILD, flag) ? CHECK_FLAGS_IN_BUILD[flag] : undefined;
package/src/check.ts CHANGED
@@ -4,7 +4,7 @@ import { readSetupFigureMask } from './setupfiguremask.ts';
4
4
  import { readSetupBackdrop } from './setupbackdrop.ts';
5
5
  import { COINCIDE_LINE, type SupportReport } from './coincide.ts';
6
6
  import { observeSupport } from './coincideio.ts';
7
- import { SETUP_PAINTING_LINE, UNDECLARED_SETUP_PAINTING_REASON, setupPaintingBounds, setupPaintingLine, type SetupPainting, type SetupPaintingLine, type SetupPaintingObservation } from './setuppainting.ts';
7
+ import { SETUP_PAINTING_LINE, SETUP_PAINTING_UNCOVERED_WARNING, UNDECLARED_SETUP_PAINTING_REASON, setupPaintingBounds, setupPaintingLine, setupPaintingWarningCount, type SetupPainting, type SetupPaintingLine, type SetupPaintingObservation } from './setuppainting.ts';
8
8
  import { readMaterialSources } from './cutmaterialio.ts';
9
9
  import { CUT_MATERIAL_LINE, checkJointMaterial, type MaterialLine } from './cutmaterial.ts';
10
10
  import { ART_JOINT_LINE, artJointLine, type ArtJointLine } from './artjoints.ts';
@@ -3289,9 +3289,9 @@ export function barsSummary(r: Pick<CheckReport, 'bars'>): string {
3289
3289
  return `${measured.length} of ${measured.length + skipped.length} bar(s) measured, ${skipped.length} skipped${skipped.length === 0 ? '' : ` (${skipped.map((s) => s.bar).join(', ')})`}`;
3290
3290
  }
3291
3291
 
3292
- /** The summary's warning clause: each warning line that read something, named, with the warnings they printed together; empty when none read. */
3293
- export function warningsClause(r: Pick<CheckReport, 'motionSeam' | 'cloth'>): string {
3294
- const read = [...(r.motionSeam.status === 'SKIP' || (r.motionSeam.roots !== undefined && r.motionSeam.pairs.every(p => p.root !== undefined)) ? [] : [{ name: MOTION_SEAM_LINE, n: r.motionSeam.warnings }]), ...(r.cloth.status === 'SKIP' ? [] : [{ name: CLOTH_LINE, n: r.cloth.warnings }])];
3292
+ /** The summary's warning clause: each warning line that read something, named, with the warnings they printed together, and `SETUP_PAINTING_MOSTLY_UNCOVERED` only when it printed one (issue #1421); empty when none read. */
3293
+ export function warningsClause(r: Pick<CheckReport, 'motionSeam' | 'cloth' | 'figures'>): string {
3294
+ const read = [...(r.motionSeam.status === 'SKIP' || (r.motionSeam.roots !== undefined && r.motionSeam.pairs.every(p => p.root !== undefined)) ? [] : [{ name: MOTION_SEAM_LINE, n: r.motionSeam.warnings }]), ...(r.cloth.status === 'SKIP' ? [] : [{ name: CLOTH_LINE, n: r.cloth.warnings }]), ...(setupPaintingWarningCount(r.figures[SETUP_PAINTING_LINE]) === 0 ? [] : [{ name: SETUP_PAINTING_UNCOVERED_WARNING, n: setupPaintingWarningCount(r.figures[SETUP_PAINTING_LINE]) }])];
3295
3295
  if (read.length === 0) return '';
3296
3296
  return `; ${read.reduce((a, x) => a + x.n, 0)} warning(s) (${read.map((x) => x.name).join(', ')}, not a bar)`;
3297
3297
  }
@@ -184,13 +184,56 @@ export function setupPaintingLine(
184
184
  ...(noLimit ? { reason: 'a region has no declared max_pixels; it is measured as SKIP, never PASS' } : {}) };
185
185
  }
186
186
 
187
+ /** Issue #1421: the named warning for a region whose count is mostly pixels no setup piece draws. A warning, never a bar. */
188
+ export const SETUP_PAINTING_UNCOVERED_WARNING = 'SETUP_PAINTING_MOSTLY_UNCOVERED';
189
+ export interface SetupPaintingUncovered {
190
+ region: string;
191
+ /** The region's `(uncovered)` slot row: counted pixels no setup piece draws (0 when the row is absent). */
192
+ uncovered: number;
193
+ /** The region's `pixel_count`: every counted pixel, owned or uncovered. */
194
+ counted: number;
195
+ }
196
+
197
+ /**
198
+ * Issue #1421: the regions whose counted pixels are mostly uncovered, read off
199
+ * the line alone, so every figure it names is already in check.json
200
+ * (`regions[].pixel_count` and the `(uncovered)` row of `regions[].slots`).
201
+ * "Mostly" is a strict majority, `2 * uncovered > counted`: exactly half does
202
+ * not warn, and a region that counts no pixel does not warn. It applies only
203
+ * when neither `figure_mask` nor `backdrop` is declared. With a figure mask a
204
+ * region counts mask pixels only, so its uncovered pixels are missing figure;
205
+ * with a backdrop a painted background within `rgb_tolerance` of the plate is
206
+ * not counted, so its uncovered pixels are painting that differs from the
207
+ * plate. Without either the count cannot tell painted background from missing
208
+ * figure, and that is what the warning says. The verdict never reads it.
209
+ */
210
+ export function setupPaintingUncovered(line: SetupPaintingLine): SetupPaintingUncovered[] {
211
+ if (line.figure_mask !== undefined || line.backdrop !== undefined) return [];
212
+ return line.regions.flatMap(r => {
213
+ const uncovered = r.slots.find(s => s.slot === '(uncovered)')?.pixel_count ?? 0;
214
+ return 2 * uncovered > r.pixel_count ? [{ region: r.name, uncovered, counted: r.pixel_count }] : [];
215
+ });
216
+ }
217
+
218
+ /** How many regions {@link setupPaintingUncovered} warns about; 0 for an observation without regions. */
219
+ export function setupPaintingWarningCount(line: SetupPaintingObservation | undefined): number {
220
+ return line === undefined || !('regions' in line) ? 0 : setupPaintingUncovered(line).length;
221
+ }
222
+
223
+ /** The console line for one {@link SetupPaintingUncovered}: the rule, the region, uncovered of counted, and the two declarations that make the limit bind the figure. */
224
+ export function setupPaintingUncoveredText(w: SetupPaintingUncovered): string {
225
+ return `${SETUP_PAINTING_LINE}: WARN ${SETUP_PAINTING_UNCOVERED_WARNING} region "${w.region}" — ${w.uncovered} of ${w.counted} counted pixels are uncovered (no setup piece draws them), more than half; without a figure mask or a backdrop this count cannot tell painted background from missing figure, so the region's limit mostly measures pixels the rig does not draw. To make it bind the figure, declare setup_painting.figure_mask (the figure's support on the painting grid) or setup_painting.backdrop (the opaque plate behind the figure); a warning, not a bar`;
226
+ }
227
+
187
228
  export function setupPaintingLines(line: SetupPaintingObservation): string[] {
188
229
  if (!('regions' in line)) return [`${SETUP_PAINTING_LINE}: SKIP — ${line.reason}`];
230
+ const warned = setupPaintingUncovered(line);
189
231
  return [`${SETUP_PAINTING_LINE}: ${line.status}${line.reason === undefined ? '' : ` — ${line.reason}`}; ${line.registration}; ${line.compositing}`,
190
232
  ...(line.outside_figure === undefined ? [] : [`${SETUP_PAINTING_LINE}: slot "(uncovered)" outside figure mask — pixelcount ${line.outside_figure.pixel_count}; UNBARRED, outside every region limit`]),
191
233
  ...(line.outside_figure_owned === undefined ? [] : [`${SETUP_PAINTING_LINE}: owned pixels outside figure mask — pixelcount ${line.outside_figure_owned.pixel_count}; UNBARRED, outside every region limit`]),
192
234
  ...line.regions.flatMap(r => [`${SETUP_PAINTING_LINE}: region "${r.name}" ${r.status} — box [${r.box.join(', ')}], pixelcount ${r.pixel_count}, limit ${r.limit ?? 'undeclared (SKIP)'}, RGB tolerance ${line.rgb_tolerance}`,
193
- ...r.slots.map(s => `${SETUP_PAINTING_LINE}: slot "${s.slot}" region "${r.name}" — box [${s.box.join(', ')}], pixelcount ${s.pixel_count}; region total ${r.pixel_count}, limit ${r.limit ?? 'undeclared (SKIP)'}`)])];
235
+ ...r.slots.map(s => `${SETUP_PAINTING_LINE}: slot "${s.slot}" region "${r.name}" — box [${s.box.join(', ')}], pixelcount ${s.pixel_count}; region total ${r.pixel_count}, limit ${r.limit ?? 'undeclared (SKIP)'}`),
236
+ ...warned.filter(w => w.region === r.name).map(setupPaintingUncoveredText)])];
194
237
  }
195
238
 
196
239
  /** Resolve an authored setup image against the requirements file that names it. */
package/src/takeregion.ts CHANGED
@@ -121,12 +121,14 @@ export function deriveTakenRegion(base: Layer, donor: Layer, painting: Raster, s
121
121
  export function applyTakenRegions(runs: Runs, painting: Raster, cfg: Pick<AssembleConfig, 'depth'> & {
122
122
  seethrough: Pick<AssembleConfig['seethrough'], 'head_box'> | undefined;
123
123
  assemble: Pick<AssembleConfig['assemble'], 'take' | 'plan'>;
124
- }, configPath: string, setup: SetupPainting | undefined, receipts: ReceiptLedger, sourcePath?: string): Runs {
124
+ }, configPath: string, setup: SetupPainting | undefined, receipts: ReceiptLedger, sourcePath?: string, requirementsPath?: string): Runs {
125
125
  const declarations = (cfg.assemble.take ?? []).filter((item): item is TakeRegion => 'seed' in item);
126
126
  if (declarations.length === 0) return runs;
127
127
  const tolerance = setup?.rgb_tolerance;
128
128
  if (typeof tolerance !== 'number' || !Number.isSafeInteger(tolerance) || tolerance < 0 || tolerance > 255) {
129
- return refuse('ASSEMBLE_REGION_TAKE_TOLERANCE', 'config.assemble.take', 'a region take requires --requirements declaring setup_painting.rgb_tolerance, the same authored integer check reads; no default is supplied');
129
+ return refuse('ASSEMBLE_REGION_TAKE_TOLERANCE', 'config.assemble.take', requirementsPath === undefined
130
+ ? 'no requirements file is given: config.requirements is absent and --requirements was not passed; a region take requires setup_painting.rgb_tolerance, an authored integer 0-255 that check reads too, with no default — name a requirements file in config.requirements and declare setup_painting.rgb_tolerance there'
131
+ : `${requirementsPath} declares no setup_painting.rgb_tolerance; a region take requires that authored integer 0-255, the one check reads too, with no default — declare it under setup_painting in that file, the one config.requirements names`);
130
132
  }
131
133
  if (cfg.depth !== undefined || [...runs.full.layers, ...runs.head.layers].some(layer => layer.depthSheet !== undefined)) {
132
134
  return refuse('ASSEMBLE_REGION_TAKE_BINDING', 'config.assemble.take', 'active scalar depth sheets have no region donor binding; a run without active scalar depth is required');