spine-parts 2.19.2 → 2.19.4

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 CHANGED
@@ -7999,12 +7999,37 @@ All six scope/kind combinations occur in the generated CLI fixture. Existing
7999
7999
  top-level spec/version tag to advance; these fields are additive under its
8000
8000
  existing contract. Removing only the three `row_` fields recovers legacy JSON.
8001
8001
 
8002
- The table is generated from the actual `checkRow` calls, including their finding
8003
- predicates, by `bun tools/check_row_reference.ts --write`; the tree suite checks
8004
- it against the producers and rejects a planted omission. Subjects are explicit
8002
+ The registered families declare their permitted JSON paths in `src/checkrow.ts`.
8003
+ A TypeScript type walk independently inventories object-array paths in
8004
+ `CheckFigures`, including intersections, the object keyword and alternate sets.
8005
+ New paths require a registered family even when no fixture emits them. Open legacy figure dictionaries
8006
+ have explicit exclusions below and are checked by the recursive output schema; a
8007
+ new unknown-typed field also fails the type inventory.
8008
+ The recursive row schema rejects an unregistered object-array path, missing
8009
+ labels, or a family used at another path. Every registered family and projection
8010
+ has an emitted schema fixture. Scalar arrays and tuples are excluded because
8011
+ they contain no object rows; aggregate records are excluded except for the named
8012
+ `requirements.lines` row dictionary. These exclusions do not exclude nested arrays.
8013
+
8014
+ Selftests preload the schema guard at the check serializer and forward it to
8015
+ Bun descendants, including build stage children. A swallowed schema error still
8016
+ fails the process. Consumer commands do not load this test hook, gain no new
8017
+ failure, and serialize the same fields. The family tag is a symbol: object spreads
8018
+ retain it and JSON does not write it. The omission and path-mismatch plants use
8019
+ the same schema as this guard.
8020
+
8021
+ The table is generated from the registry and recursively discovered producer
8022
+ calls by `bun tools/check_row_reference.ts --write`. Import aliases resolve by
8023
+ TypeScript symbol identity; wrapper forwarding is not the coverage mechanism.
8024
+ The tree suite holds the generated table to its sources. Subjects are explicit
8005
8025
  in `row_subjects`; existing part/slot, front/back, a/b and parts fields remain
8006
8026
  unchanged. `seam_scope.whole_pairs` copies the `seam_pairs` producer rows without
8007
- the picture, and `sets.*` reuses the same seam producers.
8027
+ the picture, and `sets.*` reuses the same seam producers. A slot receives part
8028
+ scope only when its default-skin image mapping resolves one actual parts.json
8029
+ piece. A declared set image `<set>_<piece>.png` maps to that same piece;
8030
+ Unrelated mixed images, undeclared prefixes and omitted mappings receive rig scope.
8031
+ No slot-name fallback is used. Motion seam findings use the existing warning predicate on non-roots
8032
+ and the active-reading, banded failure predicate on roots.
8008
8033
 
8009
8034
  Scalar/string arrays (animations, frame indices, bones, constraint names and
8010
8035
  formatted chain/lag strings), numeric coordinate tuples, and aggregate blocks
@@ -8014,57 +8039,74 @@ no-reference-art totals) are fields of their parent reading, not independent
8014
8039
  row collections; they retain their existing shape. Arrays inside these records
8015
8040
  are still labelled (for example the level worst's `through` and posed joints).
8016
8041
  Changed drawing identities have rig scope because generated slots need not name a part.
8042
+ A seam row with two `(no art)` entries has zero named subjects and rig scope;
8043
+ a singleton has part scope and two named contributors have pair scope. These
8044
+ raw rows remain evidence, including residuals outside all reference art.
8017
8045
  Internal `SeamSupport.drawings` never enters check JSON. Named requirement
8018
8046
  `lines` are the one dictionary of individual rows and are also labelled;
8019
8047
  `sets` is a dictionary of whole check blocks.
8020
8048
 
8021
8049
  <!-- check-row-table:begin -->
8022
- | Row family | row_scope | row_kind | row_subjects (producer expression) | Producer |
8023
- | --- | --- | --- | --- | --- |
8024
- | `ANIMATIONS_DO_NOT_FOLD.declared_not_folding` | 'part' | finding | [e.slot] | [check.ts:3516](../src/check.ts#L3516) |
8025
- | `ANIMATIONS_DO_NOT_FOLD.folding` | 'part' | finding when entry === undefined; otherwise evidence | [slot] | [check.ts:3478](../src/check.ts#L3478) |
8026
- | `ART_JOINT_DISTANCE.joints` | 'rig' | finding when status === 'FAIL'; otherwise evidence | [] | [artjoints.ts:86](../src/artjoints.ts#L86) |
8027
- | `BOUNDARY_COLOUR_STEP.over` | 'pair' | finding | r.parts | [boundarycolour.ts:220](../src/boundarycolour.ts#L220) |
8028
- | `BOUNDARY_COLOUR_STEP.unmeasured` | 'part' | evidence | [r.slot] | [boundarycolour.ts:221](../src/boundarycolour.ts#L221) |
8029
- | `CLOTH_SETTLES.rows` | 'rig' | finding when speeds.length > 0 && s < speeds.length; otherwise evidence | [] | [check.ts:5801](../src/check.ts#L5801) |
8030
- | `CUT_JOINT_MATERIAL.rows` | 'part' | finding when r.status === 'FAIL'; otherwise evidence | [r.part] | [cutmaterial.ts:280](../src/cutmaterial.ts#L280) |
8031
- | `FEET_STAY_LEVEL.feet` | 'part' | finding when row.status === 'FAIL'; otherwise evidence | [row.part] | [check.ts:3717](../src/check.ts#L3717) |
8032
- | `FEET_STAY_LEVEL.feet[].worst.through` | 'rig' | evidence | [] | [check.ts:3692](../src/check.ts#L3692) |
8033
- | `LIMB_ONE_BONE.parts` | 'part' | finding when fail; otherwise evidence | [p.name] | [check.ts:4009](../src/check.ts#L4009) |
8034
- | `PART_SUPPORT_REPORT.pairs` | 'pair' | evidence; finding when length > 0; otherwise evidence | [F.name, B.name] | [coincide.ts:114](../src/coincide.ts#L114), [coincide.ts:130](../src/coincide.ts#L130) |
8035
- | `PART_SUPPORT_REPORT.raw_pairs` | 'pair' | evidence | [F.name, B.name] | [coincide.ts:110](../src/coincide.ts#L110) |
8036
- | `PART_SUPPORT_REPORT.unowned.regions` | 'rig' | finding | [] | [coincide.ts:145](../src/coincide.ts#L145) |
8037
- | `SEAM_OVER_MOTION.pairs` | 'pair' | evidence | [p.a, p.b] | [check.ts:5202](../src/check.ts#L5202) |
8038
- | `SEAM_OVER_MOTION.required.pairs` | 'pair' | finding when open > 0; otherwise evidence | [p.a, p.b] | [check.ts:4610](../src/check.ts#L4610) |
8039
- | `SEAM_OVER_MOTION.roots.unmeasured` | 'part' | evidence | [root.part] | [check.ts:5179](../src/check.ts#L5179) |
8040
- | `SEAM_OVER_MOTION.rows` | 'pair' | finding when p.status === 'read' && opens.length > 0; otherwise evidence; finding when r.status === 'read' && r.opens.length > 0; otherwise evidence | [want.a, want.b]; pairs.filter(p => p.pair === r.pair).flatMap(p => [p.a, p.b]) | [check.ts:5141](../src/check.ts#L5141), [check.ts:5205](../src/check.ts#L5205) |
8041
- | `SEAM_OVER_MOTION.rows[].cells` | 'pair' | evidence | [want.a, want.b] | [check.ts:5154](../src/check.ts#L5154) |
8042
- | `SEAM_OVER_MOTION.rows[].joint_contact.reasons` | 'pair' | evidence | [want.a, want.b] | [check.ts:5144](../src/check.ts#L5144) |
8043
- | `SEAM_OVER_MOTION.rows[].pose_at_worst.joints` | 'rig' | evidence | [] | [motionseampose.ts:53](../src/motionseampose.ts#L53) |
8044
- | `SEAM_OVER_MOTION.worlds.*.rows` | 'pair' | evidence | [want.a, want.b] | [check.ts:5138](../src/check.ts#L5138) |
8045
- | `SEAM_OVER_RANGE.joints` | 'part' | evidence; finding when poses.some(p => p.status === 'FAIL'); otherwise evidence | [j.part] | [check.ts:4333](../src/check.ts#L4333), [check.ts:4379](../src/check.ts#L4379) |
8046
- | `SEAM_OVER_RANGE.joints[].poses` | 'part' | finding when fail; otherwise evidence | [j.part] | [check.ts:4377](../src/check.ts#L4377) |
8047
- | `SETUP_MATCHES_PAINTING.regions` | 'rig' | finding when status === 'FAIL'; otherwise evidence | [] | [setuppainting.ts:174](../src/setuppainting.ts#L174) |
8048
- | `SETUP_MATCHES_PAINTING.regions[].slots` | slot === '(uncovered)' ? 'rig' : 'part' | evidence | slot === '(uncovered)' ? [] : [slot] | [setuppainting.ts:175](../src/setuppainting.ts#L175) |
8049
- | `STILL_REGIONS_DARK.*.crossing` | 'part' | finding | [sl.name] | [check.ts:8744](../src/check.ts#L8744) |
8050
- | `STILL_REGIONS_DARK.*.still_slots` | 'part' | evidence; finding when r.max > tolerance; otherwise evidence | [slot] | [check.ts:8730](../src/check.ts#L8730), [check.ts:8735](../src/check.ts#L8735) |
8051
- | `STRESS_OFF_CHAIN.not_read` | 'part' | evidence | [r.part] | [check.ts:3937](../src/check.ts#L3937) |
8052
- | `STRESS_OFF_CHAIN.per_part` | 'part' | finding when poses.some(p => typeof p.reading === 'number' && p.reading > STRESS_RIGID); otherwise evidence | [r.part] | [check.ts:3925](../src/check.ts#L3925) |
8053
- | `STRESS_OFF_CHAIN.per_part[].off_chain` | 'part' | evidence | [r.part] | [check.ts:3925](../src/check.ts#L3925) |
8054
- | `STRESS_OFF_CHAIN.per_part[].poses` | 'part' | evidence; finding when shown > STRESS_RIGID; otherwise evidence | [r.part] | [check.ts:3893](../src/check.ts#L3893), [check.ts:3911](../src/check.ts#L3911) |
8055
- | `TEXTURE_STRETCH.per_mesh` | 'part' | evidence; finding when severity > TEXTURE_STRETCH_CEILING; otherwise evidence | [m.slot] | [check.ts:9378](../src/check.ts#L9378), [check.ts:9388](../src/check.ts#L9388) |
8056
- | `TIP_OVER_ROOT.parts` | 'part' | evidence; finding when !ok && !(!rigid && hanging.onLink && Math.max(c.root, c.tip) < TIP_TRAVEL_FLOOR); otherwise evidence | [p.name] | [check.ts:8160](../src/check.ts#L8160), [check.ts:8165](../src/check.ts#L8165), [check.ts:8186](../src/check.ts#L8186), [check.ts:8197](../src/check.ts#L8197) |
8057
- | `WIND_BAND.pairs` | 'pair' | finding when !holdsAll; otherwise evidence | [p.a, p.b] | [check.ts:6305](../src/check.ts#L6305) |
8058
- | `WIND_BAND.pairs[].steps` | 'pair' | finding when !s.holds; otherwise evidence | [p.a, p.b] | [check.ts:6316](../src/check.ts#L6316) |
8059
- | `figure_openings.openings` | 'pair' | finding | [ps.under, ps.above] | [check.ts:5622](../src/check.ts#L5622) |
8060
- | `loop_physics` | 'rig' | evidence | [] | [check.ts:7283](../src/check.ts#L7283) |
8061
- | `requirements.lines.* (bone)` | 'rig' | finding when line.status === 'FAIL'; otherwise evidence | [] | [check.ts:7579](../src/check.ts#L7579) |
8062
- | `requirements.lines.* (seam)` | 'pair' | finding when line.status === 'FAIL'; otherwise evidence | [r.part, r.neighbour] | [check.ts:7579](../src/check.ts#L7579) |
8063
- | `requirements.lines.* (stretch)` | 'part' | finding when line.status === 'FAIL'; otherwise evidence | [r.slot] | [check.ts:7579](../src/check.ts#L7579) |
8064
- | `seam_pairs` | pair[0] === SEAM_NO_ART ? 'rig' : pair[1] === SEAM_NO_ART ? 'part' : 'pair' | evidence | pair.filter(p => p !== SEAM_NO_ART) | [check.ts:2479](../src/check.ts#L2479) |
8065
- | `seam_scope.changes` | 'rig' | evidence | [] | [check.ts:1958](../src/check.ts#L1958) |
8066
- | `seam_scope.domain.states` | 'rig' | evidence | [] | [check.ts:2043](../src/check.ts#L2043) |
8067
- | `seam_scope.pairs` | row.parts[0] === SEAM_NO_ART ? 'rig' : row.parts[1] === SEAM_NO_ART ? 'part' : 'pair' | evidence | row.parts.filter(p => p !== SEAM_NO_ART) | [check.ts:7193](../src/check.ts#L7193) |
8068
- | `seam_scope.population.pairs` | 'pair' | evidence | row.parts | [check.ts:2414](../src/check.ts#L2414) |
8069
- | `seam_scope.population.single_art` | 'part' | evidence | [row.part] | [check.ts:2415](../src/check.ts#L2415) |
8050
+ | Row family | Registered JSON paths | row_scope | row_kind | row_subjects (producer expression) | Producer |
8051
+ | --- | --- | --- | --- | --- | --- |
8052
+ | `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:3518](../src/check.ts#L3518) |
8053
+ | `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:3480](../src/check.ts#L3480) |
8054
+ | `ART_JOINT_DISTANCE.joints` | `ART_JOINT_DISTANCE.joints` | 'rig' | finding when status === 'FAIL'; otherwise evidence | [] | [artjoints.ts:86](../src/artjoints.ts#L86) |
8055
+ | `BOUNDARY_COLOUR_STEP.over` | `BOUNDARY_COLOUR_STEP.over` | 'pair' | finding | r.parts | [boundarycolour.ts:221](../src/boundarycolour.ts#L221) |
8056
+ | `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) |
8057
+ | `CLOTH_SETTLES.rows` | `CLOTH_SETTLES.rows` | 'rig' | finding when speeds.length > 0 && s < speeds.length; otherwise evidence | [] | [check.ts:5812](../src/check.ts#L5812) |
8058
+ | `CUT_JOINT_MATERIAL.rows` | `CUT_JOINT_MATERIAL.rows` | 'part' | finding when r.status === 'FAIL'; otherwise evidence | [r.part] | [cutmaterial.ts:280](../src/cutmaterial.ts#L280) |
8059
+ | `FEET_STAY_LEVEL.feet` | `FEET_STAY_LEVEL.feet` | 'part' | finding when row.status === 'FAIL'; otherwise evidence | [row.part] | [check.ts:3719](../src/check.ts#L3719) |
8060
+ | `FEET_STAY_LEVEL.feet[].worst.through` | `FEET_STAY_LEVEL.feet[].worst.through` | 'rig' | evidence | [] | [check.ts:3694](../src/check.ts#L3694) |
8061
+ | `LIMB_ONE_BONE.parts` | `LIMB_ONE_BONE.parts` | 'part' | finding when fail; otherwise evidence | [p.name] | [check.ts:4011](../src/check.ts#L4011) |
8062
+ | `PART_SUPPORT_REPORT.pairs` | `PART_SUPPORT_REPORT.pairs` | 'pair' | evidence; finding when length > 0; otherwise evidence | [F.name, B.name] | [coincide.ts:114](../src/coincide.ts#L114), [coincide.ts:130](../src/coincide.ts#L130) |
8063
+ | `PART_SUPPORT_REPORT.raw_pairs` | `PART_SUPPORT_REPORT.raw_pairs` | 'pair' | evidence | [F.name, B.name] | [coincide.ts:110](../src/coincide.ts#L110) |
8064
+ | `PART_SUPPORT_REPORT.unowned.regions` | `PART_SUPPORT_REPORT.unowned.regions` | 'rig' | finding | [] | [coincide.ts:145](../src/coincide.ts#L145) |
8065
+ | `SEAM_OVER_MOTION.pairs` | `SEAM_OVER_MOTION.pairs` | 'pair' | evidence | [p.a, p.b] | [check.ts:5209](../src/check.ts#L5209) |
8066
+ | `SEAM_OVER_MOTION.required.pairs` | `SEAM_OVER_MOTION.required.pairs` | 'pair' | finding when open > 0; otherwise evidence | [p.a, p.b] | [check.ts:4612](../src/check.ts#L4612) |
8067
+ | `SEAM_OVER_MOTION.roots.unmeasured` | `SEAM_OVER_MOTION.roots.unmeasured` | 'part' | evidence | [root.part] | [check.ts:5186](../src/check.ts#L5186) |
8068
+ | `SEAM_OVER_MOTION.rows` | `SEAM_OVER_MOTION.rows` | 'pair'; unique ? 'pair' : 'rig' | finding when motionSeamFinding(want.root !== undefined, p.status, p.banded, opens.length); otherwise evidence; finding when motionSeamFinding(rootNames.has(r.pair), r.status, r.banded, r.opens.length); otherwise evidence | [want.a, want.b]; unique ? [pair.a, pair.b] : [] | [check.ts:5143](../src/check.ts#L5143), [check.ts:5215](../src/check.ts#L5215) |
8069
+ | `SEAM_OVER_MOTION.rows[].cells` | `SEAM_OVER_MOTION.rows[].cells` | 'pair' | evidence | [want.a, want.b] | [check.ts:5156](../src/check.ts#L5156) |
8070
+ | `SEAM_OVER_MOTION.rows[].joint_contact.reasons` | `SEAM_OVER_MOTION.rows[].joint_contact.reasons` | 'pair' | evidence | [want.a, want.b] | [check.ts:5146](../src/check.ts#L5146) |
8071
+ | `SEAM_OVER_MOTION.rows[].pose_at_worst.joints` | `SEAM_OVER_MOTION.rows[].pose_at_worst.joints` | 'rig' | evidence | [] | [motionseampose.ts:53](../src/motionseampose.ts#L53) |
8072
+ | `SEAM_OVER_MOTION.worlds.*.rows` | `SEAM_OVER_MOTION.worlds.*.rows` | 'pair' | evidence | [want.a, want.b] | [check.ts:5140](../src/check.ts#L5140) |
8073
+ | `SEAM_OVER_RANGE.joints` | `SEAM_OVER_RANGE.joints` | 'part' | evidence; finding when poses.some(p => p.status === 'FAIL'); otherwise evidence | [j.part] | [check.ts:4335](../src/check.ts#L4335), [check.ts:4381](../src/check.ts#L4381) |
8074
+ | `SEAM_OVER_RANGE.joints[].poses` | `SEAM_OVER_RANGE.joints[].poses` | 'part' | finding when fail; otherwise evidence | [j.part] | [check.ts:4379](../src/check.ts#L4379) |
8075
+ | `SETUP_MATCHES_PAINTING.regions` | `SETUP_MATCHES_PAINTING.regions` | 'rig' | finding when status === 'FAIL'; otherwise evidence | [] | [setuppainting.ts:174](../src/setuppainting.ts#L174) |
8076
+ | `SETUP_MATCHES_PAINTING.regions[].slots` | `SETUP_MATCHES_PAINTING.regions[].slots` | part when the supplied mapping resolves a piece; otherwise rig | evidence | resolved piece for slot; otherwise [] | [setuppainting.ts:175](../src/setuppainting.ts#L175) |
8077
+ | `STILL_REGIONS_DARK.*.crossing` | `STILL_REGIONS_DARK.*.crossing` | part when the supplied mapping resolves a piece; otherwise rig | finding | resolved piece for sl.name; otherwise [] | [check.ts:8757](../src/check.ts#L8757) |
8078
+ | `STILL_REGIONS_DARK.*.still_slots` | `STILL_REGIONS_DARK.*.still_slots` | part when the supplied mapping resolves a piece; otherwise rig | evidence; finding when r.max > tolerance; otherwise evidence | resolved piece for slot; otherwise [] | [check.ts:8743](../src/check.ts#L8743), [check.ts:8748](../src/check.ts#L8748) |
8079
+ | `STRESS_OFF_CHAIN.not_read` | `STRESS_OFF_CHAIN.not_read` | 'part' | evidence | [r.part] | [check.ts:3939](../src/check.ts#L3939) |
8080
+ | `STRESS_OFF_CHAIN.per_part` | `STRESS_OFF_CHAIN.per_part` | 'part' | finding when poses.some(p => typeof p.reading === 'number' && p.reading > STRESS_RIGID); otherwise evidence | [r.part] | [check.ts:3927](../src/check.ts#L3927) |
8081
+ | `STRESS_OFF_CHAIN.per_part[].off_chain` | `STRESS_OFF_CHAIN.per_part[].off_chain` | 'part' | evidence | [r.part] | [check.ts:3927](../src/check.ts#L3927) |
8082
+ | `STRESS_OFF_CHAIN.per_part[].poses` | `STRESS_OFF_CHAIN.per_part[].poses` | 'part' | evidence; finding when shown > STRESS_RIGID; otherwise evidence | [r.part] | [check.ts:3895](../src/check.ts#L3895), [check.ts:3913](../src/check.ts#L3913) |
8083
+ | `TEXTURE_STRETCH.per_mesh` | `TEXTURE_STRETCH.per_mesh` | part when the supplied mapping resolves a piece; otherwise rig | evidence; finding when severity > TEXTURE_STRETCH_CEILING; otherwise evidence | resolved piece for m.slot; otherwise [] | [check.ts:9391](../src/check.ts#L9391), [check.ts:9401](../src/check.ts#L9401) |
8084
+ | `TIP_OVER_ROOT.parts` | `TIP_OVER_ROOT.parts` | 'part' | evidence; finding when !ok && !(!rigid && hanging.onLink && Math.max(c.root, c.tip) < TIP_TRAVEL_FLOOR); otherwise evidence | [p.name] | [check.ts:8172](../src/check.ts#L8172), [check.ts:8177](../src/check.ts#L8177), [check.ts:8198](../src/check.ts#L8198), [check.ts:8209](../src/check.ts#L8209) |
8085
+ | `WIND_BAND.pairs` | `WIND_BAND.pairs` | 'pair' | finding when !holdsAll; otherwise evidence | [p.a, p.b] | [check.ts:6316](../src/check.ts#L6316) |
8086
+ | `WIND_BAND.pairs[].steps` | `WIND_BAND.pairs[].steps` | 'pair' | finding when !s.holds; otherwise evidence | [p.a, p.b] | [check.ts:6327](../src/check.ts#L6327) |
8087
+ | `figure_openings.openings` | `figure_openings.openings` | 'pair' | finding | [ps.under, ps.above] | [check.ts:5633](../src/check.ts#L5633) |
8088
+ | `loop_physics` | `loop_physics` | 'rig' | evidence | [] | [check.ts:7295](../src/check.ts#L7295) |
8089
+ | `requirements.lines.* (bone)` | `requirements.lines.*` | 'rig' | finding when line.status === 'FAIL'; otherwise evidence | [] | [check.ts:7591](../src/check.ts#L7591) |
8090
+ | `requirements.lines.* (seam)` | `requirements.lines.*` | 'pair' | finding when line.status === 'FAIL'; otherwise evidence | [r.part, r.neighbour] | [check.ts:7591](../src/check.ts#L7591) |
8091
+ | `requirements.lines.* (stretch)` | `requirements.lines.*` | part when the supplied mapping resolves a piece; otherwise rig | finding when line.status === 'FAIL'; otherwise evidence | resolved piece for r.slot; otherwise [] | [check.ts:7591](../src/check.ts#L7591) |
8092
+ | `seam_pairs` | `seam_pairs`; `seam_scope.whole_pairs`; `sets.*.seam_pairs`; `sets.*.seam_scope.whole_pairs` | subjects.length === 0 ? 'rig' : subjects.length === 1 ? 'part' : 'pair' | evidence | subjects | [check.ts:2480](../src/check.ts#L2480) |
8093
+ | `seam_scope.changes` | `seam_scope.changes`; `sets.*.seam_scope.changes` | 'rig' | evidence | [] | [check.ts:1958](../src/check.ts#L1958) |
8094
+ | `seam_scope.domain.states` | `seam_scope.domain.states`; `sets.*.seam_scope.domain.states` | 'rig' | evidence | [] | [check.ts:2043](../src/check.ts#L2043) |
8095
+ | `seam_scope.pairs` | `seam_scope.pairs`; `sets.*.seam_scope.pairs` | subjects.length === 0 ? 'rig' : subjects.length === 1 ? 'part' : 'pair' | evidence | subjects | [check.ts:7205](../src/check.ts#L7205) |
8096
+ | `seam_scope.population.pairs` | `seam_scope.population.pairs`; `sets.*.seam_scope.population.pairs` | 'pair' | evidence | row.parts | [check.ts:2414](../src/check.ts#L2414) |
8097
+ | `seam_scope.population.single_art` | `seam_scope.population.single_art`; `sets.*.seam_scope.population.single_art` | 'part' | evidence | [row.part] | [check.ts:2415](../src/check.ts#L2415) |
8098
+
8099
+ | Open serialized type path | Reason for schema exclusion |
8100
+ | --- | --- |
8101
+ | `BLINK_NO_HOLE.*` | Open judgement figures; every emitted nested object row is schema checked. |
8102
+ | `BREATH_VISIBLE.*` | Open judgement figures; every emitted nested object row is schema checked. |
8103
+ | `CHAIN_LAG.*` | Open judgement figures; every emitted nested object row is schema checked. |
8104
+ | `RECOMPOSITE_HOLES.*` | Open reported figures; every emitted nested object row is schema checked. |
8105
+ | `SETUP_POSE_VS_SOURCE.*` | Open reported figures; every emitted nested object row is schema checked. |
8106
+ | `STILL_REGIONS_DARK.*` | Open judgement figures; every emitted nested object row is schema checked. |
8107
+ | `STRESS_OFF_CHAIN.*` | Open judgement figures; every emitted nested object row is schema checked. |
8108
+ | `TEXTURE_STRETCH.*` | Open judgement figures; every emitted nested object row is schema checked. |
8109
+ | `TIP_OVER_ROOT.*` | Open judgement figures; every emitted nested object row is schema checked. |
8110
+ | `requirements.lines.*.*` | Open requirement figures; the dictionary rows and nested object arrays are schema checked. |
8111
+ | `sets.*.RECOMPOSITE_HOLES.*` | Open alternate reported figures; every emitted nested object row is schema checked. |
8070
8112
  <!-- check-row-table:end -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spine-parts",
3
- "version": "2.19.2",
3
+ "version": "2.19.4",
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
  "bin": {
@@ -64,7 +64,7 @@
64
64
  "smoke": "bun scripts/install_smoke.ts",
65
65
  "typecheck": "bunx tsc --noEmit",
66
66
  "lint": "bunx eslint .",
67
- "prepublishOnly": "bun run typecheck && bun run lint && bun run selftest"
67
+ "prepublishOnly": "node scripts/prepublish.cjs"
68
68
  },
69
69
  "dependencies": {
70
70
  "ag-psd": "^31.0.2",
@@ -1,4 +1,4 @@
1
- import { checkRow } from './checkrow.ts';
1
+ import { checkRow, checkSlotRow, checkSlotParts } from './checkrow.ts';
2
2
  /**
3
3
  * Issue #942: the colour step across part boundaries, against the rig's own pieces.
4
4
  *
@@ -116,6 +116,7 @@ export function measureBoundaryColour(api: Api, input: BoundaryColourInput, decl
116
116
  const W = input.stage.width, H = input.stage.height;
117
117
  const vp = { minX: input.stage.x, minY: input.stage.y, maxX: input.stage.x + W, maxY: input.stage.y + H, scale: 1, width: W, height: H };
118
118
  const project = api.projector(vp);
119
+ const slotParts = checkSlotParts(input.rig, input.parts.parts.map(p => p.name), input.parts.alternates?.map(set => set.name) ?? []);
119
120
  const records = new Map(input.parts.parts.map((p) => [p.name, p]));
120
121
  const sources = new Map<string, Source | string>();
121
122
  const unmeasured: BoundaryColourUnmeasured[] = [];
@@ -218,7 +219,7 @@ export function measureBoundaryColour(api: Api, input: BoundaryColourInput, decl
218
219
  boundary_pairs: boundaryPairs,
219
220
  worst,
220
221
  over: over.map(r => ({ ...r, ...checkRow('BOUNDARY_COLOUR_STEP.over', 'pair', true, r.parts) })),
221
- unmeasured: unmeasured.map(r => ({ ...r, ...checkRow('BOUNDARY_COLOUR_STEP.unmeasured', 'part', false, [r.slot]) })),
222
+ unmeasured: unmeasured.map(r => ({ ...r, ...checkSlotRow('BOUNDARY_COLOUR_STEP.unmeasured', false, r.slot, slotParts) })),
222
223
  alternates: 'not measured',
223
224
  };
224
225
  }
package/src/check.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { checkRow } from './checkrow.ts';
1
+ import { checkRow, checkSlotRow, checkSlotParts, serializeCheckRows } from './checkrow.ts';
2
2
  import { readSetupFigureMask } from './setupfiguremask.ts';
3
3
  import { readSetupBackdrop } from './setupbackdrop.ts';
4
4
  import { COINCIDE_LINE, type SupportReport } from './coincide.ts';
@@ -1986,7 +1986,7 @@ export function officialRenderer(): OfficialRenderer {
1986
1986
 
1987
1987
  /** Observe the actual setup on the declared stage grid. No frame-zero motion,
1988
1988
  * fitted alignment, flat recomposite or duplicate core validation. */
1989
- export function measureSetupPainting(build: string, stage: StageBox, source: Raster, declared: SetupPainting, problems: Problem[], backdrop?: Raster, figureMask?: Uint8Array): SetupPaintingLine {
1989
+ export function measureSetupPainting(build: string, stage: StageBox, source: Raster, declared: SetupPainting, problems: Problem[], backdrop?: Raster, figureMask?: Uint8Array, slotParts?: ReadonlyMap<string, string>): SetupPaintingLine {
1990
1990
  const api = officialRenderer();
1991
1991
  const skeleton = join(build, 'skeleton.json'), atlas = join(build, 'skeleton.atlas');
1992
1992
  const candidate = api.loadCandidate({ skeletonText: readFileSync(skeleton, 'utf8'), atlasText: readFileSync(atlas, 'utf8'), atlasDir: build, label: 'setup versus painting' }, { skeleton, atlas }, undefined);
@@ -2010,7 +2010,7 @@ export function measureSetupPainting(build: string, stage: StageBox, source: Ras
2010
2010
  }
2011
2011
  const painting = sourceInRig(whiteSource, W, H);
2012
2012
  const setup = api.renderFrame(pose, candidate.pages, vp, [0, 0, 0, 0]);
2013
- return setupPaintingLine(declared, painting, { width: W, height: H, data: new Uint8ClampedArray(setup.data) }, figureSilhouette(painting).data, owners, pose.pieces.map(p => p.slot), problems, backdrop === undefined ? undefined : sourceInRig(backdrop, W, H), figureMask);
2013
+ return setupPaintingLine(declared, painting, { width: W, height: H, data: new Uint8ClampedArray(setup.data) }, figureSilhouette(painting).data, owners, pose.pieces.map(p => p.slot), problems, backdrop === undefined ? undefined : sourceInRig(backdrop, W, H), figureMask, slotParts);
2014
2014
  }
2015
2015
 
2016
2016
  /** One decoder/poser lifetime per state; retain only finite bounds and identities, never atlas pages or rasters. */
@@ -2475,8 +2475,9 @@ function seamPairRowsFrom(seam: SeamFigures, parts: readonly PlacedAlpha[], rigS
2475
2475
  // A part over no other art is named first, then SEAM_NO_ART.
2476
2476
  const pair: [string, string] = acc.a < 0 ? [name(acc.b), SEAM_NO_ART] : [name(acc.a), name(acc.b)];
2477
2477
  const file = `${String(i + 1).padStart(Math.max(2, width), '0')}_${pair.map((n) => (n === SEAM_NO_ART ? 'no-art' : n)).join('_')}.png`;
2478
+ const subjects = pair.filter(p => p !== SEAM_NO_ART);
2478
2479
  const cut = acc.a >= 0 && parts[acc.a].from === parts[acc.b].from ? { cut: { from: parts[acc.a].from, differing_copies_px: acc.differing } } : {};
2479
- return { row: { ...checkRow('seam_pairs', pair[0] === SEAM_NO_ART ? 'rig' : pair[1] === SEAM_NO_ART ? 'part' : 'pair', false, pair.filter(p => p !== SEAM_NO_ART)), parts: pair, px_over_40: acc.over40,
2480
+ return { row: { ...checkRow('seam_pairs', subjects.length === 0 ? 'rig' : subjects.length === 1 ? 'part' : 'pair', false, subjects), parts: pair, px_over_40: acc.over40,
2480
2481
  ...(acc.outside > 0 ? { outside_authored_px: acc.outside } : {}), px_over_80: acc.over80, frame_box: acc.f, rig_box: acc.r, ...cut, picture: `${SEAM_DIR}/${file}` }, pixels: acc.pixels };
2481
2482
  });
2482
2483
  }
@@ -3449,6 +3450,7 @@ export function foldsLine(
3449
3450
  physicsList: readonly LoopPhysics[] = [],
3450
3451
  motion: Record<string, unknown> = {},
3451
3452
  context?: WeightStepContext,
3453
+ slotParts?: ReadonlyMap<string, string>,
3452
3454
  ): FoldsLine {
3453
3455
  const toSide = (m: FoldingMesh | undefined): FoldSide | null =>
3454
3456
  m === undefined ? null : { frames: m.frames, worst_frame: m.worstFrame, worst_triangles: m.worstTriangles, line: m.line };
@@ -3475,7 +3477,7 @@ export function foldsLine(
3475
3477
  const onlyPhysicsOn = on !== undefined && off === undefined;
3476
3478
  const constraints = onlyPhysicsOn ? meshPhysicsConstraints(rig, slot, attachment, physicsList) : [];
3477
3479
  const row: FoldRow = {
3478
- ...checkRow('ANIMATIONS_DO_NOT_FOLD.folding', 'part', entry === undefined, [slot]),
3480
+ ...checkSlotRow('ANIMATIONS_DO_NOT_FOLD.folding', entry === undefined, slot, slotParts),
3479
3481
  animation: name,
3480
3482
  slot,
3481
3483
  attachment,
@@ -3513,7 +3515,7 @@ export function foldsLine(
3513
3515
  detail: `rigc render --folds at ${fps} fps${physics}${sideClause}: ${r.line}; ${foldBonesText(rig, motion, r.slot, r.attachment, r.worst_frame, worstOf.get(r) ?? [], context)}; no triangle turned over against the setup pose is required — a fold the art means is declared in the --requirements file's may_fold, { "slot": "${r.slot}", "animation": "${r.animation}", "why": … }`,
3514
3516
  });
3515
3517
  }
3516
- const declaredNotFolding = mayFold.filter((e) => !folding.some((r) => r.slot === e.slot && r.animation === e.animation)).map((e) => ({ ...checkRow('ANIMATIONS_DO_NOT_FOLD.declared_not_folding', 'part', true, [e.slot]), slot: e.slot, animation: e.animation }));
3518
+ const declaredNotFolding = mayFold.filter((e) => !folding.some((r) => r.slot === e.slot && r.animation === e.animation)).map((e) => ({ ...checkSlotRow('ANIMATIONS_DO_NOT_FOLD.declared_not_folding', true, e.slot, slotParts), slot: e.slot, animation: e.animation }));
3517
3519
  for (const e of declaredNotFolding) {
3518
3520
  problems.push({
3519
3521
  code: `CHECK_${FOLD_LINE}`,
@@ -5138,7 +5140,7 @@ function readSeamRows(dir: string, animations: readonly string[], fps: number, p
5138
5140
  worldRows?.push({ ...checkRow('SEAM_OVER_MOTION.worlds.*.rows', 'pair', false, [want.a, want.b]), pair: want.pair, animation, status: p.status, drawn: p.drawn, banded: p.banded, gap: kinds.gap, ghost: kinds.ghost });
5139
5141
  const opens = [...over.keys()].sort((x, y) => x - y);
5140
5142
  rows.push({
5141
- ...checkRow('SEAM_OVER_MOTION.rows', 'pair', p.status === 'read' && opens.length > 0, [want.a, want.b]),
5143
+ ...checkRow('SEAM_OVER_MOTION.rows', 'pair', motionSeamFinding(want.root !== undefined, p.status, p.banded, opens.length), [want.a, want.b]),
5142
5144
  pair: want.pair,
5143
5145
  animation,
5144
5146
  ...(setup ? {} : { joint_contact: contact === undefined ? undefined : { ...contact, reasons: contact.reasons.map(r => ({ ...r, ...checkRow('SEAM_OVER_MOTION.rows[].joint_contact.reasons', 'pair', false, [want.a, want.b]) })) } }),
@@ -5159,6 +5161,11 @@ function readSeamRows(dir: string, animations: readonly string[], fps: number, p
5159
5161
  return rows;
5160
5162
  }
5161
5163
 
5164
+ /** Share the existing non-root warning and active root failure predicates. */
5165
+ export function motionSeamFinding(root: boolean, status: string, banded: number, opens: number): boolean {
5166
+ return opens > 0 && (!root || (status === 'read' && banded > 0));
5167
+ }
5168
+
5162
5169
  /** Only active proven roots gate gapOpen plus UNDER-owned ghost; existing warnings/floor are unchanged. */
5163
5170
  export function motionSeamLine(pairs: MotionSeamPair[], animations: string[], fps: number, rows: MotionSeamRow[], reason?: string, problems: Problem[] = [], unmeasuredRoots: readonly MotionUnmeasuredRoot[] = []): MotionSeamLine {
5164
5171
  const roots = pairs.filter(p => p.root !== undefined);
@@ -5202,7 +5209,11 @@ export function motionSeamLine(pairs: MotionSeamPair[], animations: string[], fp
5202
5209
  pairs: pairs.map(p => ({ ...p, ...checkRow('SEAM_OVER_MOTION.pairs', 'pair', false, [p.a, p.b]) })),
5203
5210
  animations,
5204
5211
  warnings,
5205
- rows: rows.map(r => ({ ...r, ...checkRow('SEAM_OVER_MOTION.rows', 'pair', r.status === 'read' && r.opens.length > 0, pairs.filter(p => p.pair === r.pair).flatMap(p => [p.a, p.b])) })),
5212
+ rows: rows.map(r => {
5213
+ const pair = pairs.find(p => p.pair === r.pair);
5214
+ const unique = pair !== undefined && pairs.filter(p => p.pair === r.pair).every(p => p.a === pair.a && p.b === pair.b);
5215
+ return { ...r, ...checkRow('SEAM_OVER_MOTION.rows', unique ? 'pair' : 'rig', motionSeamFinding(rootNames.has(r.pair), r.status, r.banded, r.opens.length), unique ? [pair.a, pair.b] : []) };
5216
+ }),
5206
5217
  ...(rootGate === undefined ? {} : { roots: rootGate }),
5207
5218
  };
5208
5219
  }
@@ -6726,7 +6737,7 @@ export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, parts
6726
6737
  const fr = measured(['render', '--candidate', buildDir, '--folds', ...geometry, '--fps', String(fps), '--max', String(FOLD_RENDER_MAX), '--out', foldDir]);
6727
6738
  if (fr.status !== 0) refuseIfAny(rigcFailed(`render --folds${geometry.map((g) => ` ${g}`).join('')} --fps ${fps}`, fr, fr.out.split('\n').filter((l) => l.includes('FAIL') || l.includes('rigc:'))));
6728
6739
  const readings = filterFolds(readFoldSets(foldDir, animationNames, fps, fr.out));
6729
- folds = foldsLine(animationNames, fps, 0, readings, mayFoldForRun, reqFile === null ? null : reqFile.path, foldProblems, readings, inp.rig, [], inp.motion, { config, stage: inp.stage });
6740
+ folds = foldsLine(animationNames, fps, 0, readings, mayFoldForRun, reqFile === null ? null : reqFile.path, foldProblems, readings, inp.rig, [], inp.motion, { config, stage: inp.stage }, checkSlotParts(inp.rig, inp.parts?.parts.map(p => p.name) ?? [], inp.parts?.alternates?.map(set => set.name) ?? []));
6730
6741
  if (feet.length > 0) {
6731
6742
  const sets = readJson(join(foldDir, 'frames.json'), []);
6732
6743
  const listed = sets !== null && Array.isArray(sets.sets) ? sets.sets.filter(isRecord) : [];
@@ -6747,7 +6758,7 @@ export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, parts
6747
6758
  if (frOff.status !== 0) refuseIfAny(rigcFailed(`render --folds${geometry.map((g) => ` ${g}`).join('')} --fps ${fps} (physics constraint(s) left out)`, frOff, frOff.out.split('\n').filter((l) => l.includes('FAIL') || l.includes('rigc:'))));
6748
6759
  const readingsOn = filterFolds(readFoldSets(onDir, animationNames, fps, frOn.out));
6749
6760
  const readingsOff = filterFolds(readFoldSets(offDir, animationNames, fps, frOff.out));
6750
- folds = foldsLine(animationNames, fps, stripped.physics.length, readingsOn, mayFoldForRun, reqFile === null ? null : reqFile.path, foldProblems, readingsOff, inp.rig, stripped.physics, inp.motion, { config, stage: inp.stage });
6761
+ folds = foldsLine(animationNames, fps, stripped.physics.length, readingsOn, mayFoldForRun, reqFile === null ? null : reqFile.path, foldProblems, readingsOff, inp.rig, stripped.physics, inp.motion, { config, stage: inp.stage }, checkSlotParts(inp.rig, inp.parts?.parts.map(p => p.name) ?? [], inp.parts?.alternates?.map(set => set.name) ?? []));
6751
6762
  if (feet.length > 0) {
6752
6763
  const sets = readJson(join(offDir, 'frames.json'), []);
6753
6764
  const listed = sets !== null && Array.isArray(sets.sets) ? sets.sets.filter(isRecord) : [];
@@ -6823,7 +6834,7 @@ export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, parts
6823
6834
  const geometryPath = join(idle.dir, GEOMETRY_FILE);
6824
6835
  const geometry = readGeometry(geometryPath, idle.written);
6825
6836
  idleGeometry = geometry;
6826
- stretch = stretchLine(geometry, geometryPath, problems, { ...inp, config });
6837
+ stretch = stretchLine(geometry, geometryPath, problems, { ...inp, config }, checkSlotParts(inp.rig, inp.parts?.parts.map(p => p.name) ?? [], inp.parts?.alternates?.map(set => set.name) ?? []));
6827
6838
  if (full !== null) still = stillLine(full, idle, geometry, geometryPath, problems, notPlanted);
6828
6839
  }
6829
6840
 
@@ -7100,7 +7111,7 @@ export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, parts
7100
7111
  if (sr.status !== 0) refuseIfAny(rigcFailed('render (the setup-pose still)', sr, sr.out.split('\n').filter((l) => l.includes('FAIL'))));
7101
7112
  const stillSet = readFrameSet(join(stillDir, 'render'));
7102
7113
  partSupport = observeSupport(join(stillDir, 'build'), inp, supportSource, supportFigure);
7103
- if (reqFile?.setup_painting !== undefined && inp.source !== null) setupPainting = measureSetupPainting(join(stillDir, 'build'), inp.stage, inp.source.painting, reqFile.setup_painting, problems, setupBackdrop, setupFigureMask);
7114
+ if (reqFile?.setup_painting !== undefined && inp.source !== null) setupPainting = measureSetupPainting(join(stillDir, 'build'), inp.stage, inp.source.painting, reqFile.setup_painting, problems, setupBackdrop, setupFigureMask, checkSlotParts(inp.rig, inp.parts?.parts.map(p => p.name) ?? [], inp.parts?.alternates?.map(set => set.name) ?? []));
7104
7115
  if (fixedSkeleton !== undefined) {
7105
7116
  const geometryPath = join(stillSet.dir, GEOMETRY_FILE);
7106
7117
  const geometry = readGeometry(geometryPath, stillSet.written);
@@ -7190,7 +7201,8 @@ export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, parts
7190
7201
  const affected = pixels.filter(q => effects.mask[q] !== 0).length;
7191
7202
  const reasons: Partial<SeamEffects['reasons']> = {};
7192
7203
  for (const q of pixels) { const reason = SEAM_EFFECT_REASONS[effects.cellReasons[q]]; reasons[reason] = (reasons[reason] ?? 0) + 1; }
7193
- return { ...checkRow('seam_scope.pairs', row.parts[0] === SEAM_NO_ART ? 'rig' : row.parts[1] === SEAM_NO_ART ? 'part' : 'pair', false, row.parts.filter(p => p !== SEAM_NO_ART)), parts: row.parts, whole_px_over_40: row.px_over_40, affected_px_over_40: affected, inherited_px_over_40: row.px_over_40 - affected, reasons };
7204
+ const subjects = row.parts.filter(p => p !== SEAM_NO_ART);
7205
+ return { ...checkRow('seam_scope.pairs', subjects.length === 0 ? 'rig' : subjects.length === 1 ? 'part' : 'pair', false, subjects), parts: row.parts, whole_px_over_40: row.px_over_40, affected_px_over_40: affected, inherited_px_over_40: row.px_over_40 - affected, reasons };
7194
7206
  }),
7195
7207
  };
7196
7208
  const altMean = round3(altSeam.mean);
@@ -7358,7 +7370,7 @@ export function runCheck(rigDir: string, outDir: string, rigc: RigcRunner, parts
7358
7370
  problems.unshift(...barProblems);
7359
7371
  problems.push(...cutMaterialProblems, ...foldProblems, ...levelProblems, ...stressProblems, ...limbProblems, ...sweepProblems, ...motionRootProblems, ...reqProblems);
7360
7372
  figures.PASS = problems.length === 0;
7361
- const publishCheck = (): void => write('check.json', `${JSON.stringify(figures, null, 1)}\n`);
7373
+ const publishCheck = (): void => write('check.json', serializeCheckRows(figures));
7362
7374
  if (motionSeam.worlds === undefined) publishCheck();
7363
7375
  else publishMotionSeamWorlds(out, seamMotionDir, motionSeam.worlds, publishCheck);
7364
7376
  const extremes = noExtremes ? [] : renderExtremes(buildDir, out, animationNames, idle === null ? extremesFrames : readJson(join(idleDir, 'frames.json'), []), extremesFrames, measured);
@@ -7576,7 +7588,7 @@ export function measureRequirements(inp: CheckInputs, file: RequirementsFile, bu
7576
7588
  }
7577
7589
  line = { ...followLine(r, d.poses, released.poses, full.poses), released_copy: door ?? 'built as forced: rig-c\'s gate passed it with no further declaration' };
7578
7590
  }
7579
- lines[r.name] = { ...line, ...(r.kind === 'seam' ? checkRow('requirements.lines.* (seam)', 'pair', line.status === 'FAIL', [r.part, r.neighbour]) : r.kind === 'stretch' ? checkRow('requirements.lines.* (stretch)', 'part', line.status === 'FAIL', [r.slot]) : checkRow('requirements.lines.* (bone)', 'rig', line.status === 'FAIL', [])) };
7591
+ lines[r.name] = { ...line, ...(r.kind === 'seam' ? checkRow('requirements.lines.* (seam)', 'pair', line.status === 'FAIL', [r.part, r.neighbour]) : r.kind === 'stretch' ? checkSlotRow('requirements.lines.* (stretch)', line.status === 'FAIL', r.slot, checkSlotParts(inp.rig, inp.parts?.parts.map(p => p.name) ?? [], inp.parts?.alternates?.map(set => set.name) ?? [])) : checkRow('requirements.lines.* (bone)', 'rig', line.status === 'FAIL', [])) };
7580
7592
  const p = requirementProblem(r, line);
7581
7593
  if (p !== null) problems.push(p);
7582
7594
  }
@@ -8689,6 +8701,7 @@ interface StillHalf {
8689
8701
  * bar ({@link crossingOf}). No render grid enters either half.
8690
8702
  */
8691
8703
  export function stillLine(inp: FullInputs, idle: FrameSet, geo: IdleGeometry | null, geometryPath: string, problems: Problem[], notPlanted: readonly string[] = []): JudgementLine {
8704
+ const slotParts = checkSlotParts(inp.rig, inp.parts.parts.map(p => p.name), inp.parts.alternates?.map(set => set.name) ?? []);
8692
8705
  const face = partsTagged(inp.parts, FACE_TAGS);
8693
8706
  const { all: allFeet, held: feet, declared } = plantedFeet(inp.parts, notPlanted);
8694
8707
  if (face.length === 0 && allFeet.length === 0) return skip(`no part comes from a See-through ${tagWords([...FACE_TAGS, ...FEET_TAGS])} layer, so there is no still region to read`);
@@ -8727,12 +8740,12 @@ export function stillLine(inp: FullInputs, idle: FrameSet, geo: IdleGeometry | n
8727
8740
  const tolerance = stillTolerance(coordMax, entryMax);
8728
8741
  for (const { slot, r } of readings) {
8729
8742
  if (r.max === null) {
8730
- rows.push({ ...checkRow('STILL_REGIONS_DARK.*.still_slots', 'part', false, [slot]), slot, unmeasured: 'no idle frame shows it' });
8743
+ rows.push({ ...checkSlotRow('STILL_REGIONS_DARK.*.still_slots', false, slot, slotParts), slot, unmeasured: 'no idle frame shows it' });
8731
8744
  continue;
8732
8745
  }
8733
8746
  sumSq += r.sumSq;
8734
8747
  weight += r.weight;
8735
- rows.push({ ...checkRow('STILL_REGIONS_DARK.*.still_slots', 'part', r.max > tolerance, [slot]), slot, max_rig_px: sig4(r.max), rms_rig_px: sig4(r.weight > 0 ? Math.sqrt(r.sumSq / r.weight) : 0) });
8748
+ rows.push({ ...checkSlotRow('STILL_REGIONS_DARK.*.still_slots', r.max > tolerance, slot, slotParts), slot, max_rig_px: sig4(r.max), rms_rig_px: sig4(r.weight > 0 ? Math.sqrt(r.sumSq / r.weight) : 0) });
8736
8749
  if (worst === null || r.max > worst.max) worst = { slot, max: r.max, frame: frameIndex(r.frame) };
8737
8750
  if (r.max > tolerance) over.push({ slot, max: r.max, frame: frameIndex(r.frame) as number });
8738
8751
  }
@@ -8741,7 +8754,7 @@ export function stillLine(inp: FullInputs, idle: FrameSet, geo: IdleGeometry | n
8741
8754
  if (still.includes(sl.name) || !record.has(sl.name)) continue;
8742
8755
  const c = crossingOf(artOf(sl.name), inp.stage, shownOf(sl.name), maps, region);
8743
8756
  // Art that only touches the region within the arithmetic's tolerance has not entered it.
8744
- if (c !== null && c.depth > tolerance) crossing.push({ ...checkRow('STILL_REGIONS_DARK.*.crossing', 'part', true, [sl.name]), slot: sl.name, depth_rig_px: round3(c.depth), area_rig_px2: round3(c.area), frame: frameIndex(c.frame) });
8757
+ if (c !== null && c.depth > tolerance) crossing.push({ ...checkSlotRow('STILL_REGIONS_DARK.*.crossing', true, sl.name, slotParts), slot: sl.name, depth_rig_px: round3(c.depth), area_rig_px2: round3(c.area), frame: frameIndex(c.frame) });
8745
8758
  }
8746
8759
  const rms = weight > 0 ? Math.sqrt(sumSq / weight) : 0;
8747
8760
  return {
@@ -9356,7 +9369,7 @@ export function edgeBonesText(rig: Record<string, unknown>, motion: Record<strin
9356
9369
  * bones its two vertices hang on and their chains ({@link edgeBonesText}, issue
9357
9370
  * #314).
9358
9371
  */
9359
- export function stretchLine(geo: IdleGeometry | null, path: string, problems: Problem[], bound?: Pick<CheckInputs, 'rig' | 'motion'> & WeightStepContext): JudgementLine {
9372
+ export function stretchLine(geo: IdleGeometry | null, path: string, problems: Problem[], bound?: Pick<CheckInputs, 'rig' | 'motion'> & WeightStepContext, slotParts?: ReadonlyMap<string, string>): JudgementLine {
9360
9373
  if (geo === null) return skip(`${path} does not exist; \`rigc render --geometry\` (rig-c ${RIGC_GEOMETRY_VERSION} or later) writes it, and the skinned mesh vertices are read from it`);
9361
9374
  if (geo.meshes.length === 0) return skip('the rig draws no mesh attachment (every slot is a region), so there is no triangle to stretch');
9362
9375
  const figures = stretchFigures(geo.meshes, geo.frames);
@@ -9375,7 +9388,7 @@ export function stretchLine(geo: IdleGeometry | null, path: string, problems: Pr
9375
9388
  });
9376
9389
  }
9377
9390
  if (m.max === null || m.min === null) {
9378
- rows.push({ ...checkRow('TEXTURE_STRETCH.per_mesh', 'part', false, [m.slot]), slot: m.slot, triangles: m.triangles, unmeasured: 'no idle frame shows this attachment' });
9391
+ rows.push({ ...checkSlotRow('TEXTURE_STRETCH.per_mesh', false, m.slot, slotParts), slot: m.slot, triangles: m.triangles, unmeasured: 'no idle frame shows this attachment' });
9379
9392
  continue;
9380
9393
  }
9381
9394
  const sMax = stretchSeverity(m.max.ratio);
@@ -9385,7 +9398,7 @@ export function stretchLine(geo: IdleGeometry | null, path: string, problems: Pr
9385
9398
  if (worst === null || severity > worst.severity) worst = { mesh: m, at, severity };
9386
9399
  maxAll = maxAll === null ? m.max.ratio : Math.max(maxAll, m.max.ratio);
9387
9400
  minAll = minAll === null ? m.min.ratio : Math.min(minAll, m.min.ratio);
9388
- rows.push({ ...checkRow('TEXTURE_STRETCH.per_mesh', 'part', severity > TEXTURE_STRETCH_CEILING, [m.slot]), slot: m.slot, triangles: m.triangles, max_ratio: round3(m.max.ratio), max_at: stretchAtText(m.max), min_ratio: round3(m.min.ratio), min_at: stretchAtText(m.min), severity });
9401
+ rows.push({ ...checkSlotRow('TEXTURE_STRETCH.per_mesh', severity > TEXTURE_STRETCH_CEILING, m.slot, slotParts), slot: m.slot, triangles: m.triangles, max_ratio: round3(m.max.ratio), max_at: stretchAtText(m.max), min_ratio: round3(m.min.ratio), min_at: stretchAtText(m.min), severity });
9389
9402
  if (severity > TEXTURE_STRETCH_CEILING) {
9390
9403
  failed = true;
9391
9404
  const step = bound === undefined ? '' : weightStepText(bound.rig, m.slot, m.attachment, at.edge, bound);
package/src/checkrow.ts CHANGED
@@ -2,15 +2,71 @@
2
2
  * The family literal anchors the generated reference table; it is not serialized.
3
3
  * Finding is the producer's existing bar/warning decision, never a status guess.
4
4
  */
5
+ /** Registered JSON paths, including projections of the same producer rows. */
6
+ export const CHECK_ROW_PATHS = {
7
+ 'ANIMATIONS_DO_NOT_FOLD.declared_not_folding': ['ANIMATIONS_DO_NOT_FOLD.declared_not_folding'],
8
+ 'ANIMATIONS_DO_NOT_FOLD.folding': ['ANIMATIONS_DO_NOT_FOLD.folding'],
9
+ 'ART_JOINT_DISTANCE.joints': ['ART_JOINT_DISTANCE.joints'],
10
+ 'BOUNDARY_COLOUR_STEP.over': ['BOUNDARY_COLOUR_STEP.over'],
11
+ 'BOUNDARY_COLOUR_STEP.unmeasured': ['BOUNDARY_COLOUR_STEP.unmeasured'],
12
+ 'CLOTH_SETTLES.rows': ['CLOTH_SETTLES.rows'],
13
+ 'CUT_JOINT_MATERIAL.rows': ['CUT_JOINT_MATERIAL.rows'],
14
+ 'FEET_STAY_LEVEL.feet': ['FEET_STAY_LEVEL.feet'],
15
+ 'FEET_STAY_LEVEL.feet[].worst.through': ['FEET_STAY_LEVEL.feet[].worst.through'],
16
+ 'LIMB_ONE_BONE.parts': ['LIMB_ONE_BONE.parts'],
17
+ 'PART_SUPPORT_REPORT.pairs': ['PART_SUPPORT_REPORT.pairs'],
18
+ 'PART_SUPPORT_REPORT.raw_pairs': ['PART_SUPPORT_REPORT.raw_pairs'],
19
+ 'PART_SUPPORT_REPORT.unowned.regions': ['PART_SUPPORT_REPORT.unowned.regions'],
20
+ 'SEAM_OVER_MOTION.pairs': ['SEAM_OVER_MOTION.pairs'],
21
+ 'SEAM_OVER_MOTION.required.pairs': ['SEAM_OVER_MOTION.required.pairs'],
22
+ 'SEAM_OVER_MOTION.roots.unmeasured': ['SEAM_OVER_MOTION.roots.unmeasured'],
23
+ 'SEAM_OVER_MOTION.rows': ['SEAM_OVER_MOTION.rows'],
24
+ 'SEAM_OVER_MOTION.rows[].cells': ['SEAM_OVER_MOTION.rows[].cells'],
25
+ 'SEAM_OVER_MOTION.rows[].joint_contact.reasons': ['SEAM_OVER_MOTION.rows[].joint_contact.reasons'],
26
+ 'SEAM_OVER_MOTION.rows[].pose_at_worst.joints': ['SEAM_OVER_MOTION.rows[].pose_at_worst.joints'],
27
+ 'SEAM_OVER_MOTION.worlds.*.rows': ['SEAM_OVER_MOTION.worlds.*.rows'],
28
+ 'SEAM_OVER_RANGE.joints': ['SEAM_OVER_RANGE.joints'],
29
+ 'SEAM_OVER_RANGE.joints[].poses': ['SEAM_OVER_RANGE.joints[].poses'],
30
+ 'SETUP_MATCHES_PAINTING.regions': ['SETUP_MATCHES_PAINTING.regions'],
31
+ 'SETUP_MATCHES_PAINTING.regions[].slots': ['SETUP_MATCHES_PAINTING.regions[].slots'],
32
+ 'STILL_REGIONS_DARK.*.crossing': ['STILL_REGIONS_DARK.*.crossing'],
33
+ 'STILL_REGIONS_DARK.*.still_slots': ['STILL_REGIONS_DARK.*.still_slots'],
34
+ 'STRESS_OFF_CHAIN.not_read': ['STRESS_OFF_CHAIN.not_read'],
35
+ 'STRESS_OFF_CHAIN.per_part': ['STRESS_OFF_CHAIN.per_part'],
36
+ 'STRESS_OFF_CHAIN.per_part[].off_chain': ['STRESS_OFF_CHAIN.per_part[].off_chain'],
37
+ 'STRESS_OFF_CHAIN.per_part[].poses': ['STRESS_OFF_CHAIN.per_part[].poses'],
38
+ 'TEXTURE_STRETCH.per_mesh': ['TEXTURE_STRETCH.per_mesh'],
39
+ 'TIP_OVER_ROOT.parts': ['TIP_OVER_ROOT.parts'],
40
+ 'WIND_BAND.pairs': ['WIND_BAND.pairs'],
41
+ 'WIND_BAND.pairs[].steps': ['WIND_BAND.pairs[].steps'],
42
+ 'figure_openings.openings': ['figure_openings.openings'],
43
+ 'loop_physics': ['loop_physics'],
44
+ 'requirements.lines.* (bone)': ['requirements.lines.*'],
45
+ 'requirements.lines.* (seam)': ['requirements.lines.*'],
46
+ 'requirements.lines.* (stretch)': ['requirements.lines.*'],
47
+ 'seam_pairs': ['seam_pairs', 'seam_scope.whole_pairs', 'sets.*.seam_pairs', 'sets.*.seam_scope.whole_pairs'],
48
+ 'seam_scope.changes': ['seam_scope.changes', 'sets.*.seam_scope.changes'],
49
+ 'seam_scope.domain.states': ['seam_scope.domain.states', 'sets.*.seam_scope.domain.states'],
50
+ 'seam_scope.pairs': ['seam_scope.pairs', 'sets.*.seam_scope.pairs'],
51
+ 'seam_scope.population.pairs': ['seam_scope.population.pairs', 'sets.*.seam_scope.population.pairs'],
52
+ 'seam_scope.population.single_art': ['seam_scope.population.single_art', 'sets.*.seam_scope.population.single_art'],
53
+ } as const;
54
+ export type CheckRowFamily = keyof typeof CHECK_ROW_PATHS;
55
+ /** Enumerable so object spread preserves provenance; JSON never serializes symbols. */
56
+ export const CHECK_ROW_FAMILY: unique symbol = Symbol.for('@rig-c/parts/check-row-family');
57
+ /** Test preloads recognize serialized documents even in packed-install copies. */
58
+ export const CHECK_ROW_DOCUMENT: unique symbol = Symbol.for('@rig-c/parts/check-row-document');
59
+
5
60
  export type CheckRowScope = 'part' | 'pair' | 'rig';
6
61
  export interface CheckRowLabels {
62
+ [CHECK_ROW_FAMILY]: CheckRowFamily;
7
63
  row_scope: CheckRowScope;
8
64
  row_kind: 'finding' | 'evidence';
9
65
  /** Actual named parts only; rig observations have no implied part attribution. */
10
66
  row_subjects: string[];
11
67
  }
12
- export function checkRow(_family: string, scope: CheckRowScope, finding: boolean, subjects: readonly string[]): CheckRowLabels {
13
- return { row_scope: scope, row_kind: finding ? 'finding' : 'evidence', row_subjects: [...subjects] };
68
+ export function checkRow(family: CheckRowFamily, scope: CheckRowScope, finding: boolean, subjects: readonly string[]): CheckRowLabels {
69
+ return { [CHECK_ROW_FAMILY]: family, row_scope: scope, row_kind: finding ? 'finding' : 'evidence', row_subjects: [...subjects] };
14
70
  }
15
71
 
16
72
  /** Legacy figures for human-readable formatters and compatibility oracles. */
@@ -21,3 +77,29 @@ export function withoutCheckRows(value: unknown): unknown {
21
77
  .map(([key, entry]) => [key, withoutCheckRows(entry)]));
22
78
  return value;
23
79
  }
80
+
81
+ /** A slot alone proves no part identity. The caller supplies a witnessed mapping. */
82
+ export function checkSlotRow(family: CheckRowFamily, finding: boolean, slot: string, pieces?: ReadonlyMap<string, string>): CheckRowLabels {
83
+ const part = pieces?.get(slot);
84
+ return checkRow(family, part === undefined ? 'rig' : 'part', finding, part === undefined ? [] : [part]);
85
+ }
86
+
87
+ /** Serialization has no production validation side effect; tests guard this boundary. */
88
+ export function serializeCheckRows(value: unknown): string {
89
+ const document = value !== null && typeof value === 'object' && !Array.isArray(value) ? { ...value, [CHECK_ROW_DOCUMENT]: true } : value;
90
+ return `${JSON.stringify(document, null, 1)}\n`;
91
+ }
92
+
93
+ /** Resolve default-skin drawings only to one manifest piece, including declared set images. */
94
+ export function checkSlotParts(rig: Readonly<Record<string, unknown>>, partNames: readonly string[], alternateSets: readonly string[] = []): ReadonlyMap<string, string> {
95
+ const record = (v: unknown): v is Record<string, unknown> => v !== null && typeof v === 'object' && !Array.isArray(v);
96
+ const skin = record(rig.skins) && record(rig.skins.default) ? rig.skins.default : {};
97
+ const named = new Set(partNames), mapping = new Map<string, string>();
98
+ for (const [slot, drawings] of Object.entries(skin)) {
99
+ if (!record(drawings)) continue;
100
+ const names = Object.values(drawings).map(d => record(d) && typeof d.image === 'string' && d.sequence === undefined && ['region', 'mesh'].includes(typeof d.type === 'string' ? d.type : 'region') ? d.image.replace(/\.png$/, '') : undefined);
101
+ const candidates = names.length === 0 ? [] : [...named].filter(part => names.every(name => name !== undefined && (name === part || alternateSets.some(set => name === `${set}_${part}`))));
102
+ if (candidates.length === 1) mapping.set(slot, candidates[0]);
103
+ }
104
+ return mapping;
105
+ }
@@ -1,4 +1,4 @@
1
- import { checkRow } from './checkrow.ts';
1
+ import { checkRow, checkSlotRow } from './checkrow.ts';
2
2
  /** Authored source-painting limits over actual renderer setup pixels (#887). */
3
3
  import { refuseIfAny, type Problem } from './errors.ts';
4
4
  import type { Raster } from './raster/types.ts';
@@ -128,7 +128,7 @@ export const UNDECLARED_SETUP_PAINTING_REASON = 'setup_painting is undeclared; s
128
128
  */
129
129
  export function setupPaintingLine(
130
130
  declared: SetupPainting, source: Raster, setup: Raster, figure: Uint8Array,
131
- owners: Int32Array, slots: readonly string[], problems: Problem[], backdrop?: Raster, figureMask?: Uint8Array,
131
+ owners: Int32Array, slots: readonly string[], problems: Problem[], backdrop?: Raster, figureMask?: Uint8Array, slotParts?: ReadonlyMap<string, string>,
132
132
  ): SetupPaintingLine {
133
133
  refuseIfAny(setupPaintingProblems(declared, 'setup_painting'));
134
134
  refuseIfAny(setupPaintingBounds(declared, source.width, source.height));
@@ -172,7 +172,7 @@ export function setupPaintingLine(
172
172
  }
173
173
  const status = r.max_pixels === undefined ? 'SKIP' : count > r.max_pixels ? 'FAIL' : 'PASS';
174
174
  const result: SetupPaintingReading = { ...r, ...checkRow('SETUP_MATCHES_PAINTING.regions', 'rig', status === 'FAIL', []), status, pixel_count: count, limit: r.max_pixels ?? null,
175
- slots: [...rows].map(([slot, row]) => ({ ...checkRow('SETUP_MATCHES_PAINTING.regions[].slots', slot === '(uncovered)' ? 'rig' : 'part', false, slot === '(uncovered)' ? [] : [slot]), slot, box: [row.x0, row.y0, row.x1 - row.x0, row.y1 - row.y0], pixel_count: row.pixels })) };
175
+ slots: [...rows].map(([slot, row]) => ({ ...checkSlotRow('SETUP_MATCHES_PAINTING.regions[].slots', false, slot, slotParts), slot, box: [row.x0, row.y0, row.x1 - row.x0, row.y1 - row.y0], pixel_count: row.pixels })) };
176
176
  if (status === 'FAIL') {
177
177
  for (const row of result.slots) problems.push({ code: 'CHECK_SETUP_MATCHES_PAINTING', object: `region "${r.name}" slot "${row.slot}"`, detail: `box [${row.box.join(', ')}], pixelcount ${row.pixel_count}; region pixelcount ${count} > declared limit ${r.max_pixels}, RGB tolerance ${declared.rgb_tolerance}; compare the actual setup to the source painting on the declared stage grid` });
178
178
  }