@rig-c/parts 2.48.0 → 2.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/AUTHORING.md +81 -43
- package/docs/STABILITY.md +75 -21
- package/package.json +1 -1
- package/src/assembly-reading.ts +35 -9
- package/src/behindseams.ts +33 -14
- package/src/build.ts +47 -6
- package/src/takeregion.ts +4 -2
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
|
|
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.
|
|
@@ -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
|
|
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,8 +6411,8 @@ 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
|
|
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
|
|
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 |
|
|
6402
6417
|
| <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
6418
|
| <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` |
|
|
@@ -6448,7 +6463,8 @@ outside the consumed inputs pending [#1177](https://github.com/rig-c/parts/issue
|
|
|
6448
6463
|
| <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
6464
|
| <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
6465
|
| <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
|
|
6466
|
+
| <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 |
|
|
6467
|
+
| <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
6468
|
| <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
6469
|
| <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
6470
|
| <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 +7742,9 @@ it when the flag is not given: a build with `--requirements reqs.json`, typed fr
|
|
|
7726
7742
|
config's directory, and a rebuild from a config declaring `"requirements": "reqs.json"`
|
|
7727
7743
|
write the same bytes, every file (selftest `BU178`). A flag naming other bytes than the
|
|
7728
7744
|
declaration is `BUILD_REQUIREMENTS_CONFLICT` (`BU179`); the same file by both, or a copy
|
|
7729
|
-
of it, builds what the config alone builds (`BU180`).
|
|
7745
|
+
of it, builds what the config alone builds (`BU180`). When the file reaches assembly (a
|
|
7746
|
+
region take, or a busy-visible figure mask), `assemble` holds the same rule and refuses
|
|
7747
|
+
a flag the config does not declare (`ASSEMBLE_REQUIREMENTS_UNDECLARED`, selftest `URQ01`–`URQ08`). Without either, no `requirements`
|
|
7730
7748
|
block is written and no byte moves.
|
|
7731
7749
|
|
|
7732
7750
|
**Which config a build read** (issue #607). `build` records its config in the same
|
|
@@ -8333,8 +8351,24 @@ setup, followed by every full min/max corner; duplicate poses occur once.
|
|
|
8333
8351
|
For yaw, pitch and body yaw this means six axis endpoints and eight corners.
|
|
8334
8352
|
Each row names the planned and observed dial locals and observed slider mapped
|
|
8335
8353
|
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,
|
|
8337
|
-
|
|
8354
|
+
frames and sampled/read/unmeasured pose counts, the `motion_opened` status and
|
|
8355
|
+
maximum count, and the `standing` summary (`status: "SKIP"`, `reason`,
|
|
8356
|
+
`max_px: 0`). Because a turn pose is an independent `t=0` pose and the parts'
|
|
8357
|
+
flat recomposite is not transported to it, turn `standing` is never measured
|
|
8358
|
+
(issue #1412): on each turn pose, `turn.pairs[].frames[].standing` is `SKIP`
|
|
8359
|
+
with zero counts, `box: null`, `samples: []`, no `unread_cells` or
|
|
8360
|
+
`unread_corridors`, and its per-pose `reason`
|
|
8361
|
+
(`"not applicable: motion_opened reads the pair"` when `motion_opened` reads the
|
|
8362
|
+
pair on that pose, or
|
|
8363
|
+
`"turn standing is not measured: turn poses have no recomposite oracle, and the pair's turn reading is motion_opened"`
|
|
8364
|
+
when `motion_opened` cannot read that pose), while `motion_opened` is the turn
|
|
8365
|
+
reading. When a turn pose reads the `motion_opened` `HOLE`
|
|
8366
|
+
(`stock transported setup-overlap support is unavailable on every named turn pose; motion-opened is not measured`),
|
|
8367
|
+
give the pair a setup overlap band in `parts/<part>.png` or `config.json`
|
|
8368
|
+
(`regions`, `meshes`, or `bones`) and keep both members and at least one rear
|
|
8369
|
+
slot drawn in front/behind order across the turn poses so `motion_opened` can
|
|
8370
|
+
transport setup-overlap support, or omit `behind_seams.turn` (or the pair's
|
|
8371
|
+
threshold in `requirements.json`). No sweep or temporal span is claimed. Its stock transported
|
|
8338
8372
|
setup-overlap evidence is computed separately with the official seam reader;
|
|
8339
8373
|
the idle's exact stock binding is unchanged. One throwaway rig-c build appends a
|
|
8340
8374
|
duration-0 animation for each selected pose, retaining the accepted setup,
|
|
@@ -8351,8 +8385,8 @@ the original accepted skeleton SHA-256 once. The scratch copy is removed even
|
|
|
8351
8385
|
on refusal; without the turn opt-in no copy or extra build is created.
|
|
8352
8386
|
A missing optional poser is a named HOLE. A missing dial persists turn SKIP and
|
|
8353
8387
|
its HOLE; an effective T makes it a required-unmeasured failure. Legacy `turn.x`
|
|
8354
|
-
has no finite range declaration and stays unread.
|
|
8355
|
-
|
|
8388
|
+
has no finite range declaration and stays unread. Per-pair allowances apply
|
|
8389
|
+
unchanged to turn `motion_opened`. A pair
|
|
8356
8390
|
without its own effective T stays SKIP with a HOLE; another pair's override
|
|
8357
8391
|
does not make that optional reading fail the turn block.
|
|
8358
8392
|
|
|
@@ -8377,10 +8411,10 @@ The two readings are independent:
|
|
|
8377
8411
|
transparent at the exact seam-cell centre, and setup attribution must show A
|
|
8378
8412
|
or B covering that material. It uses no one-cell floor. A rigidly translated
|
|
8379
8413
|
closed pair stays closed; no setup overlap band means this half is unmeasured
|
|
8380
|
-
on idle.
|
|
8414
|
+
on idle and turn.
|
|
8381
8415
|
- `standing` is measured at `setup` against the parts' flat recomposite at their
|
|
8382
|
-
painted positions (
|
|
8383
|
-
|
|
8416
|
+
painted positions (issues #1408, #1412); it is not measured on idle frames or
|
|
8417
|
+
turn poses. At `setup`, it
|
|
8384
8418
|
scans row and column runs whose combined A/B alpha is below 128/255, bracketed
|
|
8385
8419
|
immediately by different unambiguous A/B owners (`1` and `2`), and compares
|
|
8386
8420
|
the full setup render at each cell with the parts' flat recomposite
|
|
@@ -8417,15 +8451,18 @@ The two readings are independent:
|
|
|
8417
8451
|
`reason: "no --parts manifest was supplied; setup standing compares the setup render with the parts' flat recomposite"`,
|
|
8418
8452
|
records a `setup` `unmeasured[]` row, and with an authored T emits
|
|
8419
8453
|
[`CHECK_BEHIND_PART_SEAMS_UNMEASURED`](#CHECK_BEHIND_PART_SEAMS_UNMEASURED).
|
|
8420
|
-
On idle frames, `standing` is never measured: where a
|
|
8421
|
-
is read, `frames[].standing` reports `SKIP`
|
|
8422
|
-
`reason: "not applicable: motion_opened reads the pair"`, zero counts,
|
|
8423
|
-
`box: null`, `samples: []`, no unread fields, and no
|
|
8424
|
-
unmeasured row; where
|
|
8425
|
-
`frames[].standing` reports `SKIP` with
|
|
8454
|
+
On idle frames and opted-in turn poses, `standing` is never measured: where a
|
|
8455
|
+
frame's or pose's `motion_opened` is read, `frames[].standing` reports `SKIP`
|
|
8456
|
+
with `reason: "not applicable: motion_opened reads the pair"`, zero counts,
|
|
8457
|
+
`box: null`, `samples: []`, no unread fields, and no standing problem or
|
|
8458
|
+
unmeasured row; where `motion_opened` cannot be read on an idle frame or turn
|
|
8459
|
+
pose, `frames[].standing` reports `SKIP` with
|
|
8426
8460
|
`reason: "idle standing is not measured: idle frames have no recomposite oracle, and the pair's idle reading is motion_opened"`
|
|
8427
|
-
|
|
8428
|
-
|
|
8461
|
+
(on idle) or
|
|
8462
|
+
`reason: "turn standing is not measured: turn poses have no recomposite oracle, and the pair's turn reading is motion_opened"`
|
|
8463
|
+
(on turn) while `motion_opened` records its named `HOLE` (and
|
|
8464
|
+
`pairs[].standing` / `turn.pairs[].standing` carry the pair's idle or turn
|
|
8465
|
+
summary reason). This bracketed-run definition does
|
|
8429
8466
|
not certify curved or diagonal openings.
|
|
8430
8467
|
|
|
8431
8468
|
Setup standing in `BEHIND_PART_SEAMS` measures whether the rig's setup pose
|
|
@@ -8459,8 +8496,9 @@ grid and sampled/read/unmeasured frame counts. The `motion_opened` reading
|
|
|
8459
8496
|
retains per-frame hits (`index`, `time`, `px`, `cell`, `area`, `box`),
|
|
8460
8497
|
`max_px`, the earliest worst hit and contiguous `spans`; the idle `standing`
|
|
8461
8498
|
summary (`pairs[].standing`) is always `SKIP` with its `reason`, zero counts,
|
|
8462
|
-
`worst: null`, and empty `frames` and `spans
|
|
8463
|
-
`pairs[].
|
|
8499
|
+
`worst: null`, and empty `frames` and `spans`, and the turn `standing` summary
|
|
8500
|
+
(`turn.pairs[].standing`) is always `SKIP` with its `reason` and `max_px: 0`
|
|
8501
|
+
(while setup standing at `pairs[].setup.standing` retains its measured counts,
|
|
8464
8502
|
`box` and `samples`).
|
|
8465
8503
|
`max_run` is temporal, in frames and seconds; `max_spatial_run_cells` is the
|
|
8466
8504
|
longest counted horizontal/vertical run, with world length equal to cells times
|
|
@@ -8470,18 +8508,16 @@ counts remain distinct. Overlapping pair counts are not a unique whole-rig
|
|
|
8470
8508
|
area.
|
|
8471
8509
|
|
|
8472
8510
|
Issue #1325 adds optional unread-corridor evidence to the per-frame `standing`
|
|
8473
|
-
record at `BEHIND_PART_SEAMS.pairs[].setup.standing` (
|
|
8474
|
-
|
|
8475
|
-
|
|
8511
|
+
record at `BEHIND_PART_SEAMS.pairs[].setup.standing` (idle `frames[].standing`
|
|
8512
|
+
and turn `turn.pairs[].frames[].standing` are never measured). The fields below
|
|
8513
|
+
are relative to that record. They describe
|
|
8476
8514
|
bracketed low-alpha runs with an endpoint owner of 0 or 3 that have at least
|
|
8477
8515
|
one cell differing from the parts' recomposite by more than T at setup
|
|
8478
8516
|
(`dRecomposite > T`); they do not infer an owner or count those runs as
|
|
8479
8517
|
measured contrast. At setup, `unread_corridors[].cells`, `cell_count` and
|
|
8480
8518
|
`unread_cells` leave out cells within T of the recomposite (`dRecomposite <= T`)
|
|
8481
8519
|
and report the remaining interior cells of the run, excluding its endpoints,
|
|
8482
|
-
whether or not rear colour would qualify against endpoint contrast T
|
|
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
|
|
8520
|
+
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
8521
|
evidence does not remove a measured hit.
|
|
8486
8522
|
|
|
8487
8523
|
| Field | Contract |
|
|
@@ -8495,7 +8531,7 @@ evidence does not remove a measured hit.
|
|
|
8495
8531
|
| `unread_corridors[].endpoints[][2]` | World-space x coordinate of the endpoint cell centre. |
|
|
8496
8532
|
| `unread_corridors[].endpoints[][3]` | World-space y coordinate of the endpoint cell centre, y up. |
|
|
8497
8533
|
| `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
|
|
8534
|
+
| `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
8535
|
| `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
8536
|
| `unread_corridors[].row_scope` | `pair`; the corridor observes the selected front pair, not an individual rear slot. |
|
|
8501
8537
|
| `unread_corridors[].row_kind` | `evidence`, including when the required check fails. |
|
|
@@ -8511,7 +8547,9 @@ fully read frame.
|
|
|
8511
8547
|
`sampled_frames`, `read_frames` and `unmeasured_frames` count idle frames only.
|
|
8512
8548
|
An idle frame enters `read_frames` when `motion_opened` is read on that frame;
|
|
8513
8549
|
when `motion_opened` is unavailable on that frame, the frame enters
|
|
8514
|
-
`unmeasured_frames` (
|
|
8550
|
+
`unmeasured_frames` (and on turn poses, `sampled_poses`, `read_poses` and
|
|
8551
|
+
`unmeasured_poses` follow the same `motion_opened` rule; idle and turn
|
|
8552
|
+
`standing` are never measured). Setup is reported
|
|
8515
8553
|
separately at `pairs[].setup` and is not counted as an idle frame.
|
|
8516
8554
|
|
|
8517
8555
|
A measured count above the effective allowance is
|
|
@@ -8521,7 +8559,7 @@ effective T reports a nonrequired SKIP and HOLE; missing T alone emits no
|
|
|
8521
8559
|
PASS. With authored T, missing behind slots, `--parts` manifest for setup
|
|
8522
8560
|
standing's recomposite, idle, setup, motion support, boundary population or
|
|
8523
8561
|
verified render/material evidence cannot establish PASS. An unavailable reading
|
|
8524
|
-
is SKIP; a partially unread setup
|
|
8562
|
+
is SKIP; a partially unread setup standing reading retains any
|
|
8525
8563
|
measured FAIL as described above. An unread population reports a HOLE and emits
|
|
8526
8564
|
[`CHECK_BEHIND_PART_SEAMS_UNMEASURED`](#CHECK_BEHIND_PART_SEAMS_UNMEASURED),
|
|
8527
8565
|
making the combined line FAIL. Existing hard render and sidecar failures
|
|
@@ -9604,18 +9642,18 @@ Internal `SeamSupport.drawings` never enters check JSON. Named requirement
|
|
|
9604
9642
|
| `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
9643
|
| `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
9644
|
| `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:
|
|
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:
|
|
9609
|
-
| `BEHIND_PART_SEAMS.pairs` | `BEHIND_PART_SEAMS.pairs` | 'pair' | finding when failed; otherwise evidence | parts | [behindseams.ts:
|
|
9645
|
+
| `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) |
|
|
9646
|
+
| `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) |
|
|
9647
|
+
| `BEHIND_PART_SEAMS.pairs` | `BEHIND_PART_SEAMS.pairs` | 'pair' | finding when failed; otherwise evidence | parts | [behindseams.ts:693](../src/behindseams.ts#L693) |
|
|
9610
9648
|
| `BEHIND_PART_SEAMS.pairs[].frames` | `BEHIND_PART_SEAMS.pairs[].frames` | | | | |
|
|
9611
9649
|
| `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:
|
|
9613
|
-
| `BEHIND_PART_SEAMS.spans` | `BEHIND_PART_SEAMS.pairs[].motion_opened.spans`; `BEHIND_PART_SEAMS.pairs[].standing.spans` | 'pair' | evidence | parts | [behindseams.ts:
|
|
9614
|
-
| `BEHIND_PART_SEAMS.turn.pairs` | `BEHIND_PART_SEAMS.turn.pairs` | 'pair' | finding when required; otherwise evidence; finding when motion.status === 'FAIL' || standing.status === 'FAIL' || threshold !== null && read !== turn.poses.length; otherwise evidence | [pair.a, pair.b]; parts | [behindseams.ts:
|
|
9650
|
+
| `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) |
|
|
9651
|
+
| `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) |
|
|
9652
|
+
| `BEHIND_PART_SEAMS.turn.pairs` | `BEHIND_PART_SEAMS.turn.pairs` | 'pair' | finding when required; otherwise evidence; finding when motion.status === 'FAIL' || standing.status === 'FAIL' || 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
9653
|
| `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:
|
|
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:
|
|
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:
|
|
9654
|
+
| `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) |
|
|
9655
|
+
| `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) |
|
|
9656
|
+
| `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
9657
|
| `BOUNDARY_COLOUR_STEP.over` | `BOUNDARY_COLOUR_STEP.over` | 'pair' | finding | r.parts | [boundarycolour.ts:221](../src/boundarycolour.ts#L221) |
|
|
9620
9658
|
| `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
9659
|
| `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 |
|
|
@@ -1610,8 +1651,9 @@ reads that frame (or pair), or
|
|
|
1610
1651
|
`reason: "idle standing is not measured: idle frames have no recomposite oracle, and the pair's idle reading is motion_opened"`
|
|
1611
1652
|
when `motion_opened` cannot read that frame (or pair). `pairs[].standing` is
|
|
1612
1653
|
the idle summary only; setup status is at `pairs[].setup.standing` (never folded
|
|
1613
|
-
into `pairs[].standing`), and `BehindSeamsStanding
|
|
1614
|
-
carry an optional `reason` string when
|
|
1654
|
+
into `pairs[].standing`), and `BehindSeamsStanding`, `BehindSeamsReading` and
|
|
1655
|
+
`BehindSeamsTurnPair['standing']` carry an optional `reason` string when
|
|
1656
|
+
`status` is `"SKIP"`. `BEHIND_PART_SEAMS`
|
|
1615
1657
|
keeps `setup`, `motion_opened` and `standing` separate, names the selected pair
|
|
1616
1658
|
and provenance, per-frame `behind_slots`, grid and sampled/read/unmeasured
|
|
1617
1659
|
counts, and reports per-frame hits, worst counts, temporal spans and spatial
|
|
@@ -1625,9 +1667,9 @@ bracketed-run definition does not certify curved or diagonal openings.
|
|
|
1625
1667
|
|
|
1626
1668
|
Per-cell samples are a bounded diagnostic sample; the counts are the
|
|
1627
1669
|
measurement (issue #1403). Each measured `samples[]` list (setup standing, idle
|
|
1628
|
-
`motion_opened` on every idle frame, and turn `
|
|
1629
|
-
|
|
1630
|
-
`[]`) holds at most 64 rows.
|
|
1670
|
+
`motion_opened` on every idle frame, and turn `motion_opened` on every turn
|
|
1671
|
+
pose; idle and turn `standing` are never measured and their `samples[]` are
|
|
1672
|
+
always `[]`) holds at most 64 rows.
|
|
1631
1673
|
A list that measured more holds 64 and gains `samples_omitted`, the number of
|
|
1632
1674
|
rows left out; a list of 64 or fewer has no such field and is written as before.
|
|
1633
1675
|
Standing keeps its 64 worst rows: counted first, then the larger of the two
|
|
@@ -1642,16 +1684,27 @@ this key no turn rows are written and existing `check.json` bytes are unchanged.
|
|
|
1642
1684
|
With it, `BEHIND_PART_SEAMS.turn` records named independent reset poses: each
|
|
1643
1685
|
dial's declared `from` and `max` with other dials at setup, then every full
|
|
1644
1686
|
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`,
|
|
1646
|
-
|
|
1687
|
+
`frames`, `sampled_poses`, `read_poses`, `unmeasured_poses`, `motion_opened`
|
|
1688
|
+
status and maximum count, and the `standing` summary (`status: "SKIP"`,
|
|
1689
|
+
`reason`, `max_px: 0`). There are no temporal
|
|
1647
1690
|
spans: pose indices are sample identities, and time is 0 for every reset.
|
|
1648
1691
|
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
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1692
|
+
idle stock and idle counts are unchanged. The same thresholds, allowances and
|
|
1693
|
+
rear-set rules apply to `motion_opened` on turn poses. Because a turn pose is
|
|
1694
|
+
an independent `t=0` pose and the parts' flat recomposite is not transported to
|
|
1695
|
+
it, turn `standing` is never measured (issue #1412), mirroring idle: on each
|
|
1696
|
+
turn pose, `turn.pairs[].frames[].standing` carries `status: "SKIP"` with zero
|
|
1697
|
+
counts, `box: null`, `samples: []`, no `unread_cells` or `unread_corridors`, and
|
|
1698
|
+
its per-pose `reason` (`"not applicable: motion_opened reads the pair"` when
|
|
1699
|
+
`motion_opened` reads the pair on that pose, or
|
|
1700
|
+
`"turn standing is not measured: turn poses have no recomposite oracle, and the pair's turn reading is motion_opened"`
|
|
1701
|
+
when `motion_opened` cannot read the pair on that pose), and the pair summary
|
|
1702
|
+
`turn.pairs[].standing` is `{ status: "SKIP", reason, max_px: 0 }` (carrying the
|
|
1703
|
+
motion-read reason when `turn.pairs[].motion_opened.status !== "SKIP"`, or the
|
|
1704
|
+
turn no-oracle reason when it is `"SKIP"`). Where `motion_opened` cannot read
|
|
1705
|
+
the pair on a turn pose, its existing named `HOLE` in `turn.unmeasured[]` stays
|
|
1706
|
+
in place, and with an authored effective T emits
|
|
1707
|
+
`CHECK_BEHIND_PART_SEAMS_UNMEASURED`. No declared dial persists turn SKIP and a named HOLE;
|
|
1655
1708
|
an effective authored T makes that missing required reading a
|
|
1656
1709
|
`CHECK_BEHIND_PART_SEAMS_UNMEASURED` failure. Legacy `turn.x` has no declared
|
|
1657
1710
|
finite range and is explicitly unread, never given a guessed range. The
|
|
@@ -1670,8 +1723,8 @@ An unavailable poser or source is a HOLE. Other animations, between-sample turns
|
|
|
1670
1723
|
skins remain unmeasured.
|
|
1671
1724
|
|
|
1672
1725
|
Issue #1325 adds the following optional evidence fields to
|
|
1673
|
-
`BEHIND_PART_SEAMS.pairs[].setup.standing` (
|
|
1674
|
-
`
|
|
1726
|
+
`BEHIND_PART_SEAMS.pairs[].setup.standing` (idle `frames[].standing` and turn
|
|
1727
|
+
`turn.pairs[].frames[].standing` are never measured). Paths in
|
|
1675
1728
|
the table are relative to that standing record.
|
|
1676
1729
|
|
|
1677
1730
|
| Field | Stable meaning |
|
|
@@ -1680,7 +1733,7 @@ the table are relative to that standing record.
|
|
|
1680
1733
|
| `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
1734
|
| `unread_corridors[].axis` | `horizontal` or `vertical`. |
|
|
1682
1735
|
| `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
|
|
1736
|
+
| `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
1737
|
| `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
1738
|
| `unread_corridors[].row_scope` | `pair`. |
|
|
1686
1739
|
| `unread_corridors[].row_kind` | `evidence`. |
|
|
@@ -1695,10 +1748,11 @@ with `dRecomposite > T`) remains unread without choosing an A/B owner. Readable
|
|
|
1695
1748
|
corridors retain their measured cells: a standing count above allowance remains
|
|
1696
1749
|
FAIL even with unread corridors, while unread corridors without a measured
|
|
1697
1750
|
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
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1751
|
+
line FAIL. Idle `read_frames` counts idle frames where `motion_opened` is read,
|
|
1752
|
+
and turn `read_poses` counts turn poses where `motion_opened` is read (without
|
|
1753
|
+
a `turn.unmeasured[]` row for that pose; idle and turn `standing` are never
|
|
1754
|
+
measured); poses where `motion_opened` is unavailable remain in
|
|
1755
|
+
`unmeasured_poses`. Setup is reported separately at
|
|
1702
1756
|
`pairs[].setup`.
|
|
1703
1757
|
A boundary-colour PASS does not prove seam closure. Without `behind_seams`,
|
|
1704
1758
|
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.
|
|
3
|
+
"version": "2.49.0",
|
|
4
4
|
"description": "AI-authored 2D character parts from one anime painting and its See-through layer decomposition: measured parts, weighted-mesh rig specs, verified through rig-c before anything is written. A CLI for agents that cannot see the image.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
package/src/assembly-reading.ts
CHANGED
|
@@ -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
|
-
//
|
|
152
|
-
//
|
|
153
|
-
//
|
|
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
|
|
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
|
+
}
|
package/src/behindseams.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
-
|
|
744
|
-
object: `pair "${pair.pair}" turn ${pose.name}
|
|
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
|
-
|
|
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'):
|
|
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')
|
|
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'
|
|
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
|
@@ -504,8 +504,8 @@ function sourceCoverSet(result: AssembleResult, set: string | null, painting: st
|
|
|
504
504
|
|
|
505
505
|
/** Read, assemble, and write only after every refusal has had its chance. Throws a PartsError on a refusal, having written nothing. */
|
|
506
506
|
export function assembleStage(input: AssembleStageInput, outs: AssembleOutputs, log: Log): AssembleResult {
|
|
507
|
-
//
|
|
508
|
-
//
|
|
507
|
+
// A --requirements file that reaches assembly must be the one config.requirements
|
|
508
|
+
// names (#1418), so the assembly reading sees what assemble read.
|
|
509
509
|
const requirementsFile = input.requirements === undefined ? null : readRequirements(input.requirements);
|
|
510
510
|
const materialAsked = requirementsFile?.cut_material !== undefined;
|
|
511
511
|
// Issue #944: the pinhole bar is measured only when the requirements file declares it required.
|
|
@@ -517,8 +517,19 @@ export function assembleStage(input: AssembleStageInput, outs: AssembleOutputs,
|
|
|
517
517
|
const cfg = { ...projection.config, seethrough: projection.config.seethrough! };
|
|
518
518
|
const supportDeclarations = JSON.stringify(cfg.assemble.cuts ?? []);
|
|
519
519
|
const { seam, project } = effectiveAssemblyRules(cfg.assemble, input);
|
|
520
|
-
const
|
|
520
|
+
const busyVisible = cfg.assemble.ground === 'busy' && project === 'visible';
|
|
521
|
+
const regionTake = (cfg.assemble.take ?? []).some(take => 'seed' in take);
|
|
522
|
+
// Issue #1418: a requirements file whose content reaches assembly must be the one config.requirements names,
|
|
523
|
+
// because assembly_config reads only config.requirements.
|
|
524
|
+
refuseUnnamedAssemblyRequirements(input.requirements, cfg.requirements, input.config, [
|
|
525
|
+
...(regionTake ? ['setup_painting.rgb_tolerance (a region take)'] : []),
|
|
526
|
+
...(busyVisible && requirementsFile?.setup_painting?.figure_mask !== undefined ? ['setup_painting.figure_mask (busy-visible)'] : []),
|
|
527
|
+
]);
|
|
528
|
+
// Where requirements reach assembly, assemble reads them as build does: config.requirements, or the flag when the
|
|
529
|
+
// config declares none, the two being one file when both are given (buildRequirements). Elsewhere nothing here reads them.
|
|
530
|
+
const requirements = busyVisible || regionTake
|
|
521
531
|
? buildRequirements(input.requirements, cfg.requirements, input.config) : null;
|
|
532
|
+
const effectiveSetup = requirements === null ? undefined : readRequirements(requirements.read).setup_painting;
|
|
522
533
|
const src = readSource(input.source);
|
|
523
534
|
const read = readRuns(input.full, input.head);
|
|
524
535
|
// Issue #946: every declared receipt is held to its file, and under `required` every edited image needs one, before anything is assembled.
|
|
@@ -527,11 +538,11 @@ export function assembleStage(input: AssembleStageInput, outs: AssembleOutputs,
|
|
|
527
538
|
// Issue #947: under `trace_parts`, a shape drawn in the config through a part's pixels is refused with them.
|
|
528
539
|
refuseIfAny([...receipts.problems, ...missingReceipts(receipts, [...editedRunImages(read), ...editedConfigImages(input.config, cfg.assemble.cuts ?? [], cfg.limbs)]), ...untracedPartSources(cfg)]);
|
|
529
540
|
const takenRuns = applyTakenLayers(read, src, cfg, input.config);
|
|
530
|
-
const runs = applyTakenRegions(takenRuns, src, cfg, input.config,
|
|
541
|
+
const runs = applyTakenRegions(takenRuns, src, cfg, input.config, effectiveSetup, receipts, input.source, requirements?.read);
|
|
531
542
|
for (const note of runs.notes) log(note.startsWith('WARN ') ? note : `note: ${note}`);
|
|
532
543
|
const fields = projectedStageFields(cfg, runs.single ? { w: src.width, h: src.height } : null);
|
|
533
544
|
const setupPainting = requirements === null || fields.ground !== 'busy' || project !== 'visible' ? undefined
|
|
534
|
-
:
|
|
545
|
+
: effectiveSetup;
|
|
535
546
|
const figureSupport = setupPainting === undefined ? undefined
|
|
536
547
|
: readSetupFigureMask(setupPainting, requirements!.read, src, Math.trunc(src.width * fields.rigScale), Math.trunc(src.height * fields.rigScale));
|
|
537
548
|
const rigSize: [number, number] = [Math.trunc(src.width * fields.rigScale), Math.trunc(src.height * fields.rigScale)];
|
|
@@ -2799,11 +2810,41 @@ export function buildRequirements(flag: string | undefined, declared: string | u
|
|
|
2799
2810
|
{
|
|
2800
2811
|
code: 'BUILD_REQUIREMENTS_CONFLICT',
|
|
2801
2812
|
object: `--requirements ${flag} and config.requirements "${declared}"`,
|
|
2802
|
-
detail: `the flag names ${resolve(flag)} (${shown(flagDigest)}) and the config declares ${fromConfig} (${shown(configDigest)})
|
|
2813
|
+
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
2814
|
},
|
|
2804
2815
|
]);
|
|
2805
2816
|
}
|
|
2806
2817
|
|
|
2818
|
+
/**
|
|
2819
|
+
* Issue #1418: `assemble` and `build` read a region take's tolerance and the
|
|
2820
|
+
* busy-visible figure mask from the `--requirements` file, while
|
|
2821
|
+
* `assembly_config` reads `config.requirements` only. So when `reaching` names
|
|
2822
|
+
* a field of that file that assembly uses, the flag must name the file the
|
|
2823
|
+
* config declares: the same file once resolved (the flag against the current
|
|
2824
|
+
* directory, the declaration against the config's directory), or a file of the
|
|
2825
|
+
* same bytes, the rule {@link buildRequirements} holds. With no declaration it
|
|
2826
|
+
* is `ASSEMBLE_REQUIREMENTS_UNDECLARED`; two different files are
|
|
2827
|
+
* `BUILD_REQUIREMENTS_CONFLICT`, naming the fields. A flag none of whose
|
|
2828
|
+
* content reaches assembly is not judged here.
|
|
2829
|
+
*/
|
|
2830
|
+
export function refuseUnnamedAssemblyRequirements(flag: string | undefined, declared: string | undefined, configPath: string, reaching: readonly string[]): void {
|
|
2831
|
+
if (flag === undefined || reaching.length === 0) return;
|
|
2832
|
+
const fields = reaching.join(' and ');
|
|
2833
|
+
if (declared === undefined) {
|
|
2834
|
+
const path = resolve(flag);
|
|
2835
|
+
const digest = existsSync(path) && statSync(path).isFile() ? `sha256 ${createHash('sha256').update(readFileSync(path)).digest('hex').slice(0, 16)}` : 'no such file';
|
|
2836
|
+
throw new PartsError([{
|
|
2837
|
+
code: 'ASSEMBLE_REQUIREMENTS_UNDECLARED',
|
|
2838
|
+
object: `--requirements ${flag}`,
|
|
2839
|
+
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}`,
|
|
2840
|
+
}]);
|
|
2841
|
+
}
|
|
2842
|
+
try { buildRequirements(flag, declared, configPath); } catch (error) {
|
|
2843
|
+
if (!(error instanceof PartsError)) throw error;
|
|
2844
|
+
throw new PartsError(error.problems.map(problem => ({ ...problem, detail: `${problem.detail}; the flag's file gives assembly ${fields}` })));
|
|
2845
|
+
}
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2807
2848
|
/** 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
2849
|
export function suppliedCheckFlag(flag: string): string | null {
|
|
2809
2850
|
const row = Object.hasOwn(CHECK_FLAGS_IN_BUILD, flag) ? CHECK_FLAGS_IN_BUILD[flag] : undefined;
|
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',
|
|
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');
|