spine-rigc 0.29.0 → 0.31.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/README.md CHANGED
@@ -533,9 +533,9 @@ first three work on any reference you have, and `bench` is a repository workflow
533
533
  and `bun run fetch-examples`. The reasoning behind them is in
534
534
  [the benchmark dossier](https://github.com/firejune/rigc/blob/main/docs/BENCHMARK.md).
535
535
 
536
- `build` and `validate` both default to `--profile spine` — the 30 validity rules, which
536
+ `build` and `validate` both default to `--profile spine` — the 31 validity rules, which
537
537
  ask *is this valid Spine 4.3 that any runtime plays correctly?* `--profile spine-html`
538
- adds all 45: the other 15 are one renderer's policy and one canvas budget's, and they
538
+ adds all 46: the other 15 are one renderer's policy and one canvas budget's, and they
539
539
  fire on perfectly correct editor-produced Spine data, which is why they are opt-in.
540
540
  ⇒ **That reason is about foreign data and does not carry to a rig you are authoring
541
541
  yourself: author under `--profile spine-html` and read the extra 15 as findings, and
@@ -681,7 +681,7 @@ letting `A17` blame the editor for the harness's own doing.
681
681
  | 📥 **[docs/INGEST.md](docs/INGEST.md)** | **working with a skeleton you did not author.** What every command can and cannot do with a foreign `skeleton.json`, reading it with the toolchain, transcription as the route that makes it yours, what each validator complaint means on an export, and the re-pivot/rename/extend recipes. Ships in the package too |
682
682
  | 🤖 **[docs/PROMPTING.md](docs/PROMPTING.md)** | **handing the authoring to an AI agent** — the prompt clauses a measured pilot run paid for, and what you can leave unsaid. Ships in the package too |
683
683
  | 🔬 **[docs/SPEC_COVERAGE.md](docs/SPEC_COVERAGE.md)** | Spine 4.3's full export surface against what rigc emits and what the official examples measurably use, with the ordered gap list |
684
- | 🎓 **[the benchmark dossier](https://github.com/firejune/rigc/blob/main/docs/BENCHMARK.md)** | **why you can trust the output.** The yardstick, `diff` and `check` and what neither can see, the eight-rung ladder and the spineboy graduation exam, the run viewer, the 45 named assertions with their profiles, and the selftest that has watched every one of them fire. Repository material — it is not in the npm package |
684
+ | 🎓 **[the benchmark dossier](https://github.com/firejune/rigc/blob/main/docs/BENCHMARK.md)** | **why you can trust the output.** The yardstick, `diff` and `check` and what neither can see, the eight-rung ladder and the spineboy graduation exam, the run viewer, the 46 named assertions with their profiles, and the selftest that has watched every one of them fire. Repository material — it is not in the npm package |
685
685
  | 📋 [LADDER.md](https://github.com/firejune/rigc/blob/main/docs/LADDER.md) · [GATE.md](https://github.com/firejune/rigc/blob/main/docs/GATE.md) · [PILOT.md](https://github.com/firejune/rigc/blob/main/docs/PILOT.md) | the live rung ledger, the clause statements a candidate is graded against, and how to run an agent through the ladder and score what comes back |
686
686
  | 🗺️ [ROADMAP.md](https://github.com/firejune/rigc/blob/main/ROADMAP.md) | where this is going, and where it has been. What 1.0 has to mean before the number is claimed — conditions rather than a feature list, because direction here comes from what users hit |
687
687
  | 📐 [CLAUDE.md](https://github.com/firejune/rigc/blob/main/CLAUDE.md) | **the doctrine** — why the validator's messages are the product, why nothing reaches disk before green, why no number is ever invented, and what a change has to keep. [CONTRIBUTING.md](https://github.com/firejune/rigc/blob/main/CONTRIBUTING.md) calls it worth ten minutes before a first patch. Repository material |
@@ -738,7 +738,7 @@ quality."* All six, with their verdicts, are in
738
738
  [docs/LADDER.md](https://github.com/firejune/rigc/blob/main/docs/LADDER.md).
739
739
 
740
740
  The whole dossier — the yardstick, `diff` and `check` and what neither of them can
741
- see, every rung, the run viewer, the 45 assertions and the selftest behind them — is
741
+ see, every rung, the run viewer, the 46 assertions and the selftest behind them — is
742
742
  [docs/BENCHMARK.md](https://github.com/firejune/rigc/blob/main/docs/BENCHMARK.md).
743
743
  Live rung status is
744
744
  [docs/LADDER.md](https://github.com/firejune/rigc/blob/main/docs/LADDER.md).
package/cli.ts CHANGED
@@ -75,6 +75,7 @@ import {
75
75
  type DiffReport,
76
76
  } from './src/diff.ts';
77
77
  import { ingest, IngestError, IngestSpecRefused, INGEST_GUTTERS, type IngestFinding, type IngestStage } from './src/ingest.ts';
78
+ import { NotAPngError } from './src/png.ts';
78
79
  import { copyAtlasPages } from './src/emit.ts';
79
80
  import {
80
81
  DEFAULT_PADDING,
@@ -535,7 +536,12 @@ function meshDepthNote(m: CompileResult['meshes'][number]): string {
535
536
  // hull against the triangulation's own outline. Without it the line reads
536
537
  // as a fault on every correct contour rig, which is a diagnostic authors
537
538
  // learn to ignore.
538
- if (m.depth.undrawn > 0) {
539
+ // Withheld, and said where the count would have stood (issue #750): the
540
+ // part's texels could not be located on its page, so there is no count
541
+ // that is about this part.
542
+ if (m.depth.unlocated !== undefined) {
543
+ parts.push(`the count of vertices on undrawn texels is not measured: ${m.depth.unlocated}. ${PAGE_GRID_UNLOCATED}`);
544
+ } else if (m.depth.undrawn !== null && m.depth.undrawn > 0) {
539
545
  parts.push(
540
546
  `${m.depth.undrawn} of ${m.vertices} vertices sample a texel the part image does not draw — ` +
541
547
  (m.kind === 'contour'
@@ -580,6 +586,17 @@ const MESH_KIND_NOTES: Record<CompileResult['meshes'][number]['kind'], string> =
580
586
  authored: 'authored geometry rigc did not build; it assumes nothing about the topology',
581
587
  };
582
588
 
589
+ /**
590
+ * Why a figure taken off a part's texels is withheld on a page whose file is
591
+ * not the size its atlas declares — the tail of every line that withholds one
592
+ * (issue #750). The page and its ratios come first, from `pageGridSaid`; this
593
+ * says what that does to the reading and where the repair is named.
594
+ */
595
+ const PAGE_GRID_UNLOCATED =
596
+ 'rigc lifts a part off its page at the coordinates the atlas states, and on this file those are not where the ' +
597
+ "part's texels are, so a figure taken there would describe another part of the page. " +
598
+ '`A06_ATLAS_PAGE_SIZE_MATCHES_PNG` refuses the page by the same ratio and names the `scale:` header that states it';
599
+
583
600
  /**
584
601
  * What a mesh measured about its own fit against the art it names, or nothing
585
602
  * for a mesh with no art to measure against.
@@ -598,6 +615,13 @@ const MESH_KIND_NOTES: Record<CompileResult['meshes'][number]['kind'], string> =
598
615
  * fill over transparent pixels with nothing anywhere saying so (issue #275).
599
616
  */
600
617
  function meshFit(m: CompileResult['meshes'][number]): string {
618
+ // The fit is a measurement against the part's texels, and on a page whose
619
+ // file is not its declared size the region lift does not have them (issue
620
+ // #750). It printed 68.49% / 76.24px there for a mesh that measures 100.00% /
621
+ // 16.00px on the page it was packed from — two plausible numbers about
622
+ // another part of the picture. So the line says what was not measured and
623
+ // why, in the place the figures stood, and prints no figure.
624
+ if (m.fitWithheld !== undefined) return ` fit not measured: ${m.fitWithheld}. ${PAGE_GRID_UNLOCATED}`;
601
625
  if (m.coverage === undefined) return '';
602
626
  const hole = m.holePixels ? `, enclosing ${m.holePixels}px of hole` : '';
603
627
  return ` covers ${(m.coverage * 100).toFixed(2)}% of the art, reaching ${m.overshoot?.toFixed(2) ?? '?'}px past it${hole}`;
@@ -2671,6 +2695,21 @@ function cmdExplain(flags: Record<string, string>): void {
2671
2695
  // the sentence saying so scrolled off the top. It is the invocation that has
2672
2696
  // to change, so it is refused before the report it cannot finish (issue #697).
2673
2697
  refuseUnposableArt(result, opts);
2698
+ // 📐 **A page whose file is not its declared size is said where the report
2699
+ // starts, and nothing is refused for it** (issue #750). `explain` never
2700
+ // gates, so on such a pack nothing stood between the region lift and the
2701
+ // figures it fed: the mesh block printed a fit taken off another part of the
2702
+ // page. The pack still compiles — a runtime draws it, and most of this report
2703
+ // (bones, slots, timelines) reads no texel at all — so the page is named
2704
+ // here, once, with the ratio `A06` refuses it by, and every figure that WOULD
2705
+ // have been taken off its texels is withheld on its own line and says so.
2706
+ // `build` prints no such line: `A06` is its statement of the same fact.
2707
+ for (const grid of result.pageGrids) {
2708
+ console.log(
2709
+ ` .. ${grid.said}: every figure below taken off this page's texels is withheld, and says so where it ` +
2710
+ `would have stood. ${PAGE_GRID_UNLOCATED}`,
2711
+ );
2712
+ }
2674
2713
  // `compile` has already parsed this file, so the read below cannot fail — but
2675
2714
  // it goes through the same parser rather than a cast, because the cast was the
2676
2715
  // last one in the repository and issue #307 was about exactly that.
@@ -3781,5 +3820,14 @@ try {
3781
3820
  console.error(`rigc ingest: ${err.message}`);
3782
3821
  process.exit(2);
3783
3822
  }
3823
+ // A page or frame that is not a PNG rigc can read, from any command that
3824
+ // opens one (`render`, `check`, `preview`, …) — issue #732. The sentence is
3825
+ // the one reader's and already names the file, what it is and what rigc
3826
+ // reads; a stack under it is the tool describing its own internals instead.
3827
+ // Exit 1, like a compile error: the invocation was fine, a file was not.
3828
+ if (err instanceof NotAPngError) {
3829
+ console.error(`rigc: ${err.message}`);
3830
+ process.exit(1);
3831
+ }
3784
3832
  throw err;
3785
3833
  }