rig-parts 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cli.ts CHANGED
@@ -886,9 +886,12 @@ usage:
886
886
  the seam split by pair on a pass too, under check/seam/; the setup-pose
887
887
  still under check/setup_still/). check's --rig and --parts are refused:
888
888
  build's check reads the rig and the parts it wrote, <out>/rig and <out>.
889
- build's --source is the painting assemble reads and is not handed to
890
- the check, so check.json carries no SETUP_POSE_VS_SOURCE; run check
891
- --rig <out>/rig --parts <out> --source <painting> for that line.
889
+ build's --source is the painting assemble reads; it is handed to the
890
+ check only when the requirements file declares setup_painting, which
891
+ needs it (CHECK_SETUP_PAINTING_SOURCE otherwise), so the verdict is
892
+ check --source's. Without that declaration check.json carries no
893
+ SETUP_POSE_VS_SOURCE; run check --rig <out>/rig --parts <out> --source
894
+ <painting> for that line.
892
895
  --idle-keys is forwarded to the rig stage (as for rig) and defaults to
893
896
  ctl; the first line names it when it is direct. A config with a
894
897
  two-bone ik over chain links the idle keys needs --idle-keys direct:
package/docs/AUTHORING.md CHANGED
@@ -3580,8 +3580,12 @@ full loader before its assemble stage writes anything.
3580
3580
  `check --seam-pairs` writes on the same rig; `--out` is `build`'s (the check
3581
3581
  writes under `<out>/check`); `--rig` and `--parts` are refused, because the
3582
3582
  check reads the rig and the parts the build wrote (`<out>/rig`, `<out>`);
3583
- `--source` is the painting assemble reads and is not handed to the check, so
3584
- `check.json` carries no `SETUP_POSE_VS_SOURCE` — run
3583
+ `--source` is the painting assemble reads; it is handed to the check only
3584
+ when the requirements file (`--requirements` or `config.requirements`)
3585
+ declares `setup_painting`, which cannot be measured without it (issue #978),
3586
+ so that declaration reads the same verdict under `build` as under
3587
+ `check --source`. Without the declaration `check.json` carries no
3588
+ `SETUP_POSE_VS_SOURCE` and no byte moves — run
3585
3589
  `rig-parts check --rig out/rig --parts out --out <dir> --source inputs/painting.png`
3586
3590
  for that line.
3587
3591
  `rig-parts compare --left config.json --right out/rig/rig.json` reads the rig
package/docs/STABILITY.md CHANGED
@@ -543,7 +543,11 @@ or region `max_pixels` is refused by name as `SETUP_PAINTING_REQUIRED_LIMIT`
543
543
  when the file is read, before anything is built, and no limit is derived; a
544
544
  fully limited declaration measures, prints and writes the same bytes as
545
545
  without the field. Absent or `false`, every reading in this section is
546
- unchanged. The optional `pinholes` key (issue #944, additive) declares
546
+ unchanged. `build` hands its `--source` painting to its check when, and only
547
+ when, the requirements file it reads declares `setup_painting` (issue #978),
548
+ so the declaration reads the verdict `check --source` reads on the same output;
549
+ a build whose requirements do not declare it, or that reads none, writes the
550
+ bytes it wrote before. The optional `pinholes` key (issue #944, additive) declares
547
551
  `assemble`'s pinhole bar: with `{"required": true}`, `assemble` (and `build`'s
548
552
  assemble) refuses every pinhole of the base set's flat parts stack by name as
549
553
  `ASSEMBLE_PINHOLES` before anything is written — the bar is 0 and takes no
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rig-parts",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "AI-authored 2D character parts from one anime painting and its See-through layer decomposition: measured parts, weighted-mesh rig specs, verified through rig-c before anything is written. A CLI for agents that cannot see the image.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "dependencies": {
70
70
  "ag-psd": "^31.0.2",
71
- "@rig-c/core": "3.1.1"
71
+ "@rig-c/core": "3.2.0"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@esotericsoftware/spine-core": "4.3.13",
package/src/build.ts CHANGED
@@ -2291,7 +2291,7 @@ export const CHECK_FLAGS_IN_BUILD: Readonly<Record<string, CheckFlagInBuild>> =
2291
2291
  '--rig': { as: 'supplied', why: 'its check reads the rig its rig stage writes, <out>/rig; run check --rig to measure another rig' },
2292
2292
  '--out': { as: 'own', why: 'build\'s own --out; its check writes under <out>/check' },
2293
2293
  '--parts': { as: 'supplied', why: 'its check reads the parts its assemble stage writes, <out>; run check --parts to measure against others' },
2294
- '--source': { as: 'own', why: 'the painting assemble reads; it is not handed to the check, so check.json carries no SETUP_POSE_VS_SOURCE — run check --rig <out>/rig --parts <out> --source <painting> for that line' },
2294
+ '--source': { as: 'own', why: 'the painting assemble reads; it is handed to the check only when the requirements file declares setup_painting (issue #978), so check.json otherwise carries no SETUP_POSE_VS_SOURCE — run check --rig <out>/rig --parts <out> --source <painting> for that line' },
2295
2295
  '--page-edges': { as: 'forwarded' },
2296
2296
  '--pack-shape': { as: 'forwarded' },
2297
2297
  '--requirements': { as: 'forwarded' },
@@ -2434,6 +2434,9 @@ export function build(input: BuildInput, run: BuildRunners, log: Log): BuildResu
2434
2434
 
2435
2435
  let req: BuildRequirements | null = null;
2436
2436
  let configRecord: InputFileRecord | null = null;
2437
+ // Issue #978: the painting is handed to the check only when the requirements file declares setup_painting, which
2438
+ // cannot be measured without it; a build without that declaration hands it nothing, as before, and writes the same bytes.
2439
+ let paintingForCheck: string | null = null;
2437
2440
  try {
2438
2441
  // build runs rig next, which needs the whole config, so the full loader is
2439
2442
  // asked first: a config rig would refuse is refused before assemble writes
@@ -2447,7 +2450,7 @@ export function build(input: BuildInput, run: BuildRunners, log: Log): BuildResu
2447
2450
  configRecord = inputFileRecord(loaded.bytes, input.config);
2448
2451
  req = buildRequirements(input.requirements, loaded.config.requirements, input.config);
2449
2452
  // The same for the requirements file's own shape; its names resolve against the rig, in the check, before it builds.
2450
- if (req !== null) readRequirements(req.read);
2453
+ if (req !== null && readRequirements(req.read).setup_painting !== undefined) paintingForCheck = input.source;
2451
2454
  // And the schedule (issue #538), by rigc's own reader, as check reads it.
2452
2455
  if (input.environment !== undefined) readCheckEnvironment(input.environment);
2453
2456
  // And the steady-wind band spec (issue #590), as check reads it.
@@ -2469,7 +2472,7 @@ export function build(input: BuildInput, run: BuildRunners, log: Log): BuildResu
2469
2472
 
2470
2473
  let report: CheckReport;
2471
2474
  try {
2472
- report = stages.check({ rig: join(out, 'rig'), parts: out, out: join(out, 'check'), pageEdges: input.pageEdges, packShape: input.packShape, ...(req === null ? {} : { requirements: req.read, requirementsAs: req.recorded }), seamPairs: input.seamPairs === true, keepStills: input.keepStills === true, noExtremes: input.noExtremes === true, ...(input.set === undefined ? {} : { set: input.set }), allSets: input.allSets === true, ...(input.environment === undefined ? {} : { environment: input.environment }), ...(input.windBand === undefined ? {} : { windBand: input.windBand }), ...(configRecord === null ? {} : { config: configRecord }) }, run.check, run.checkBin, prefixed('check'));
2475
+ report = stages.check({ rig: join(out, 'rig'), parts: out, out: join(out, 'check'), pageEdges: input.pageEdges, packShape: input.packShape, ...(req === null ? {} : { requirements: req.read, requirementsAs: req.recorded }), ...(paintingForCheck === null ? {} : { source: paintingForCheck }), seamPairs: input.seamPairs === true, keepStills: input.keepStills === true, noExtremes: input.noExtremes === true, ...(input.set === undefined ? {} : { set: input.set }), allSets: input.allSets === true, ...(input.environment === undefined ? {} : { environment: input.environment }), ...(input.windBand === undefined ? {} : { windBand: input.windBand }), ...(configRecord === null ? {} : { config: configRecord }) }, run.check, run.checkBin, prefixed('check'));
2473
2476
  } catch (err) {
2474
2477
  return refused('check', err);
2475
2478
  }