spine-rigc 1.9.3 → 1.9.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
|
@@ -5847,7 +5847,7 @@ Fix A00 and run it again.
|
|
|
5847
5847
|
| `A03_REGION_WIDTH_HEIGHT_FINITE` | both | a region loaded `NaN` or a non-positive size — the attachment has no `image` and no `width`/`height`. **SKIP** when the skeleton carries no region attachment |
|
|
5848
5848
|
| `A04_MESH_TRIANGLES_AND_ENCODING` | both | authored mesh geometry: triangle count not a multiple of 3, an index out of range, or a `vertices` length that disagrees with `uvs` (the weighted/unweighted trap) **SKIP** when the skeleton carries no mesh attachment |
|
|
5849
5849
|
| `A05_CURVE_ARRAY_LENGTH` | both | a raw `curve` with the wrong number of values, a non-finite number in one, or a curve on a timeline that cannot take one. Four numbers **per value channel**. **SKIP** when no animation carries a timeline at all. Timelines with no `curve` on any key still PASS: every timeline name is checked against the channel table whether or not a curve sits on one |
|
|
5850
|
-
| `A06_ATLAS_PAGE_SIZE_MATCHES_PNG` | both ◑ | the atlas `size:` disagrees with the PNG on disk — the message names the ratio it measured on **each** axis and the header that states the same art truthfully, and §0.2 has the whole of it: a runtime maps a region as a fraction of the DECLARED size and never reads the texture's own, so such a page draws, and what it breaks is every reader that addresses the page in texels. A uniform ratio is a `size:`/`scale:` pair away from honest and the message prints it; two ratios are not, because `scale:` carries one number, and the message says so rather than offering a header that would not work. **Or** a region's rectangle is not inside the page it names — rotation honoured, so a region at `rotate: 90` or `270` occupies `height x width` of the page and a region that fits only because it is turned is inside it. The message names the region, the rectangle it occupies, the page and the page's size. That clause is **validity** and runs under both profiles: a rectangle outside its page makes `u2 > 1` and samples whatever the wrap mode returns, and `--atlas-in` already refuses the same rectangle at compile time (§0.2). Under `spine-html` also: `pma`, rotation, and two regions on one page over the same texels — a packed page must be **one part covering it exactly** (the unpacked convention) or a **tiling**, and what that message names is the pair that shares texels. **Or** the page file is not a PNG at all, and then nothing about its size is measured: the message carries the page's path and the size the atlas declares, and names what the file is by its first bytes — one of WebP, JPEG, GIF, KTX, KTX2 by its signature, or no image format rigc recognises, the bytes in hex either way — or calls it **truncated** when it begins as a PNG and runs out before its `IEND` (§0.2). That clause is validity too: nothing in rigc can read such a page back. **SKIP** when the atlas declares no page |
|
|
5850
|
+
| `A06_ATLAS_PAGE_SIZE_MATCHES_PNG` | both ◑ | the atlas `size:` disagrees with the PNG on disk — the message names the ratio it measured on **each** axis and the header that states the same art truthfully, and §0.2 has the whole of it: a runtime maps a region as a fraction of the DECLARED size and never reads the texture's own, so such a page draws, and what it breaks is every reader that addresses the page in texels. A uniform ratio is a `size:`/`scale:` pair away from honest and the message prints it; two ratios are not, because `scale:` carries one number, and the message says so rather than offering a header that would not work. **Or** a region's rectangle is not inside the page it names — rotation honoured, so a region at `rotate: 90` or `270` occupies `height x width` of the page and a region that fits only because it is turned is inside it. The message names the region, the rectangle it occupies, the page and the page's size. That clause is **validity** and runs under both profiles: a rectangle outside its page makes `u2 > 1` and samples whatever the wrap mode returns, and `--atlas-in` already refuses the same rectangle at compile time (§0.2). Under `spine-html` also: `pma`, rotation, and two regions on one page over the same texels — a packed page must be **one part covering it exactly** (the unpacked convention) or a **tiling**, and what that message names is the pair that shares texels. **Or** the page file is not a PNG at all, and then nothing about its size is measured: the message carries the page's path and the size the atlas declares, and names what the file is by its first bytes — one of WebP, JPEG, GIF, KTX, KTX2 by its signature, or no image format rigc recognises, the bytes in hex either way — or calls it **truncated** when it begins as a PNG and runs out before its `IEND` (§0.2). That clause is validity too: nothing in rigc can read such a page back. **SKIP** when the atlas declares no page — and, rather than a PASS, when a page's file is **not on disk** and nothing else here failed: that page's size was not measured, so the reason names the pages not read (or says none was, when every file is missing) and points at `A17`, which fails naming each missing file — one missing file is named once, by the rule whose subject it is. With another `A06` failure standing, the missing page is `A17`'s alone |
|
|
5851
5851
|
| `A07_ATLAS_TEXT_SHAPE` | both | atlas text: a region name with stray whitespace, or a blank line splitting a page block. rigc writes the atlas, so this means a hand-edited file. Three sentences are about blank lines and name three different repairs: `line 1: the file begins with a blank line` (or `with N blank lines` for a run, one finding) is a blank before the first page name — delete it; `line N: the file ends with a blank line` (or `with N blank lines`, one finding) is a blank after the last page block's final line — delete it, since rigc ends the file on one newline; `line N: consecutive blank lines` is two blank lines side by side between the first page and the last — delete one. None of the three is `the last page block declares no region`, which means a page name and its fields with no region after them. rigc writes none of the three: under `--atlas-in` the pack's blank lines are put in rigc's shape on re-emission (§0.2), so any of them means a file rigc did not write, handed to `validate`. ⚠️ An atlas with **no page block at all** — no non-blank line — is not one of those: its subject is absent, so this reports **SKIP** naming the byte count it read, and so do the four rules below whose subject is a page ([#608](https://github.com/firejune/rigc/issues/608)). A rig whose skins need no art writes exactly that file (§3.4), and before #608 this row refused it with two findings naming a page block that was not there. What an empty atlas does **not** excuse is an attachment that wants a region out of it — that is `A08` |
|
|
5852
5852
|
| `A08_REGION_NAMES_MATCH_ATTACHMENTS` | both | three things, and the message says which: an attachment whose `path` names **no region** of this atlas; a `path` carrying **stray whitespace**, printed quoted so you can see it; an **atlas region name** carrying stray whitespace (`A07` names that same line with its line number). The first two are read off the raw file **before** the loader is asked, so the miss is named here with the skin, the slot, the placeholder and the attachment's own name — the four things `AtlasAttachmentLoader`'s own `Region not found in atlas: <path> (attachment: <name>)` does not carry. There is no `spine-html` clause here — a placeholder is free to differ from the region its `path` names **SKIP** when no attachment names a region *and* the atlas declares none — both of its subjects at once |
|
|
5853
5853
|
| `A09_ANIMATION_DURATION_MATCHES_SPEC` | both | the loaded duration ≠ the declared one, or the two sides disagree about which animations exist (R7). Asymmetric by design: a frame of slack for an animation that ends early, and none worth the name for a key *past* the declared end, which is the same rule §4.5 states at compile time — held here against a skeleton the compiler never saw. **SKIP** when neither side has an animation at all — a static rig has no duration |
|
|
@@ -5858,9 +5858,9 @@ Fix A00 and run it again.
|
|
|
5858
5858
|
| `A14_NO_FULL_FRAME_MESH` | renderer | a mesh spans the whole stage — a full-frame canvas that can never dirty-skip. **SKIP** when the skeleton declares no stage (§3.1): there is no full frame to span, and *unmeasured* must not print the same green as *measured and clear* |
|
|
5859
5859
|
| `A15_IDLE_NO_MESH_BONE_KEYS` | renderer | the `idle` animation keys a bone that drives a mesh, directly or as a control bone. The rule assumes meshes are mostly static — the renderer skips redrawing a mesh nothing moved — so it has three states. **FAIL per bone** when the rig declares nothing: `idle keys bone "X", which drives a mesh — meshes never idle-skip`, and the **first** of those lines, once per run, names the case: `K bone(s) keyed by idle drive meshes; if this idle is meant to deform them (a painting rig), declare invariants.idleDrivesMeshes: { "why": … } in the rig spec — or, where the motion belongs to a pivot above the mesh, key that pivot one link up (FACE.md §3)`. It rides the first finding, so the count of FAIL lines is still the count of bones. **SKIP with the cost** when the rig declares `invariants.idleDrivesMeshes` (§3.7): `declared by the rig ("<why>"): idle keys N bone(s) that drive M mesh attachment(s) totalling V vertices — "a", "b" — and each of those meshes is recomputed on every frame it is shown`. **FAIL on a stale declaration** — declared, and the `idle` keys no mesh-driving bone, carries no bone timeline or does not exist: `the rig "X" declares invariants.idleDrivesMeshes ("…"), but "idle" keys no bone that drives a mesh, so the declaration switches off nothing — remove it`. Otherwise **SKIP** when there is no `idle` animation, or when the one there is carries no bone timeline — a rule whose subject does not exist is unmeasured and not satisfied |
|
|
5860
5860
|
| `A16_SKELETON_VERSION_4_3` | both | the `skeleton.spine` label is not on the 4.3 line (`4.3`, `4.3.N`, `4.3.N-suffix`) |
|
|
5861
|
-
| `A17_ATLAS_PAGE_FILES_EXIST` | both | a page the atlas declares is not a file. Check `--images` and `--out`. **SKIP** when the atlas declares no page — as it is for `A06`, `A19` and `A27`; see `A07` |
|
|
5861
|
+
| `A17_ATLAS_PAGE_FILES_EXIST` | both | a page the atlas declares is not a file. Check `--images` and `--out`. This is the one rule that names a missing page file; `A06` and `A19` SKIP over the page they could not read and point here rather than naming it again. **SKIP** when the atlas declares no page — as it is for `A06`, `A19` and `A27`; see `A07` |
|
|
5862
5862
|
| `A18_DETERMINISTIC_EMIT` | both | a second compile of the same inputs differed — in `skeleton.json`, `skeleton.atlas` or the model document `skeleton.model.json`, the one named (the document's first differing line with it). That is a compiler bug, not a spec bug — report it |
|
|
5863
|
-
| `A19_OVERLAY_PNGS_HAVE_ALPHA` | renderer | an overlay part cannot draw a transparent pixel, so it would paint a solid rectangle over what is behind it. **The texels decide, on both routes**; the file header is only the fast negative. A file with no alpha channel (colour type 4 or 6) and no `tRNS` chunk has nowhere to keep a clear texel and is refused without being opened, by a sentence that names its colour type — so re-export it as RGBA, or as an indexed / greyscale PNG that keeps its `tRNS`. A file whose header says it **could** be transparent is opened and read until its first texel below full alpha; one clear texel passes, and none is refused in the words the packed route uses for a region, naming the file and what it can hold — `is opaque in every one of its 200x80 texels` … `its file can hold transparency — colour type 6 (truecolour + alpha) carries an alpha channel — and no texel uses it`. Saving as RGBA is not the repair: the runtime draws the texels, not the declaration. On a loose page the file is the part, so the whole decoded image is the rectangle and no atlas coordinate is read. Only the base plate may be opaque, and which image that is is decided once for both routes: the plate the build names — on a cut manifest, the part whose window is the crop — and, only when it names none, an image at least the stage's size. The rig's statement comes first because the two can disagree: a stage stated small enough for an overlay to cover would otherwise exempt that overlay. A rig spec cannot name a base plate, so a stageless rig-spec build, and `validate <dir>` on a stageless skeleton, has nothing to decide it; an opaque part there is refused with *"nothing here decides which image that is: this skeleton declares no stage size to measure one against"* and the two ways to decide it — a `skeleton` stage the plate covers, or a cut manifest (for `validate`, the specs it was built from: `--rig`, `--motion` and the `--manifest`). Indexed-with-`tRNS` — the usual output of ImageMagick, "Export as PNG-8", GIMP's indexed mode, aseprite and pngquant — **passes**: it is transparent art. On a **shared** page the question is asked per REGION over the decoded page rather than per file, because a packed page's own file all but always declares transparency — its gutter is transparent — and the file-level question would then be answered by the packing rather than by the art. ⚠️ **That scan states its verdict over the texels it READ, and never over texels that are not on the page**: a rectangle partly on its page is judged over the part that is on it, and the message carries both counts — `opaque in every one of the 77 texels of its 12x8 rectangle at -1,-1 … the other 19 of the 96 it declares are not on the page and are not measured here`. A rectangle with **no** texel on the page is reported **not measured** by name — the region, its rectangle, the page image's size, and the pointer to `A06`, which is the rule that judges a region's rectangle — and no verdict about opacity is printed at all. ⚠️ **A page whose IMAGE is not the size the atlas declares for it is the same non-measurement for every region on it**, and the clause above does not cover that case: a page rescaled after packing leaves most rectangles partly on it, at coordinates that address a different part of the picture, so a scan would come back with a confident verdict over texels nobody had located — on a two-region pack at a uniform 0.5 an opaque part's failure **disappears**, the scan finding a transparent texel 32 texels away from it. The row names the page's two sizes and points at `A06`, which judges the page grid and prints the header that repairs it (§0.2). It stays a failure rather than becoming a SKIP because a SKIP is per ASSERTION: it would delete the verdicts on every other part of the same page, and an assertion cannot be skipped and failed at once without the report counting it twice. ⚠️ **A page file that cannot be read as PNG at all is the same non-measurement for every part on it**: one row per page naming its parts and pointing at `A06`, which names what the file is. **SKIP** when the atlas declares no page |
|
|
5863
|
+
| `A19_OVERLAY_PNGS_HAVE_ALPHA` | renderer | an overlay part cannot draw a transparent pixel, so it would paint a solid rectangle over what is behind it. **The texels decide, on both routes**; the file header is only the fast negative. A file with no alpha channel (colour type 4 or 6) and no `tRNS` chunk has nowhere to keep a clear texel and is refused without being opened, by a sentence that names its colour type — so re-export it as RGBA, or as an indexed / greyscale PNG that keeps its `tRNS`. A file whose header says it **could** be transparent is opened and read until its first texel below full alpha; one clear texel passes, and none is refused in the words the packed route uses for a region, naming the file and what it can hold — `is opaque in every one of its 200x80 texels` … `its file can hold transparency — colour type 6 (truecolour + alpha) carries an alpha channel — and no texel uses it`. Saving as RGBA is not the repair: the runtime draws the texels, not the declaration. On a loose page the file is the part, so the whole decoded image is the rectangle and no atlas coordinate is read. Only the base plate may be opaque, and which image that is is decided once for both routes: the plate the build names — on a cut manifest, the part whose window is the crop — and, only when it names none, an image at least the stage's size. The rig's statement comes first because the two can disagree: a stage stated small enough for an overlay to cover would otherwise exempt that overlay. A rig spec cannot name a base plate, so a stageless rig-spec build, and `validate <dir>` on a stageless skeleton, has nothing to decide it; an opaque part there is refused with *"nothing here decides which image that is: this skeleton declares no stage size to measure one against"* and the two ways to decide it — a `skeleton` stage the plate covers, or a cut manifest (for `validate`, the specs it was built from: `--rig`, `--motion` and the `--manifest`). Indexed-with-`tRNS` — the usual output of ImageMagick, "Export as PNG-8", GIMP's indexed mode, aseprite and pngquant — **passes**: it is transparent art. On a **shared** page the question is asked per REGION over the decoded page rather than per file, because a packed page's own file all but always declares transparency — its gutter is transparent — and the file-level question would then be answered by the packing rather than by the art. ⚠️ **That scan states its verdict over the texels it READ, and never over texels that are not on the page**: a rectangle partly on its page is judged over the part that is on it, and the message carries both counts — `opaque in every one of the 77 texels of its 12x8 rectangle at -1,-1 … the other 19 of the 96 it declares are not on the page and are not measured here`. A rectangle with **no** texel on the page is reported **not measured** by name — the region, its rectangle, the page image's size, and the pointer to `A06`, which is the rule that judges a region's rectangle — and no verdict about opacity is printed at all. ⚠️ **A page whose IMAGE is not the size the atlas declares for it is the same non-measurement for every region on it**, and the clause above does not cover that case: a page rescaled after packing leaves most rectangles partly on it, at coordinates that address a different part of the picture, so a scan would come back with a confident verdict over texels nobody had located — on a two-region pack at a uniform 0.5 an opaque part's failure **disappears**, the scan finding a transparent texel 32 texels away from it. The row names the page's two sizes and points at `A06`, which judges the page grid and prints the header that repairs it (§0.2). It stays a failure rather than becoming a SKIP because a SKIP is per ASSERTION: it would delete the verdicts on every other part of the same page, and an assertion cannot be skipped and failed at once without the report counting it twice. ⚠️ **A page file that cannot be read as PNG at all is the same non-measurement for every part on it**: one row per page naming its parts and pointing at `A06`, which names what the file is. **SKIP** when the atlas declares no page — and, rather than a PASS, when a page carrying a part has no file on disk and nothing else here failed: that page's parts were not read, so the reason names the pages not read and how many of the pages carrying a part were (or says none was) and points at `A17`, which fails naming each missing file. A missing page holding only the base plate moves nothing here: this rule had no part on it to read |
|
|
5864
5864
|
| `A20_MESH_WEIGHTS_COHERENT` | both ◑ | a weighted vertex with no bone, a negative weight, a bone index out of range, or weights that do not sum to 1. On a rig spec's `"boneIndexing": "raw"` mesh an index out of range or a run that does not decode is refused at compile first (§5.1, issue #917), so here it names a skeleton rigc did not compile. Under `spine-html` also: an unweighted mesh, a binding at weight 0, or **a bone the mesh declares that no vertex binds** — `mesh "x" declares bone "grip_b" and none of its 25 vertices binds it; the weights reference "box", "grip_a"`. Those three are one sentence about rigc's own generators: the bone set a generated mesh declares is the bone set its weights reference, so a `controls` or `chain` name that moves nothing is a defect where a foreign mesh's is not. Fix the rig spec's `controls`/`chain`, a `segments` generator's `bones` (its `influence` line names a bone no vertex binds), or the manifest's `control_bones`. **SKIP** when the skeleton carries no mesh attachment |
|
|
5865
5865
|
| `A21_MESH_RIM_PINNED` | archetype | a generated ring's rim, a ribbon's entry row, or a contour's outline (which is all of it) is not pinned to its anchor bone at weight 1. **SKIPs** by name on authored or linked geometry and on a `segments` mesh, whose outline is weighted by distance like the rest of it — none of them claims a pinned rim |
|
|
5866
5866
|
| `A22_MESH_UVS_IN_UNIT_RANGE` | both | a mesh UV outside its region, or a UV array that disagrees with the vertex count. **SKIP** when the skeleton carries no mesh attachment |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spine-rigc",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.4",
|
|
4
4
|
"description": "AI-authored Spine 2D rigging and animation, verified before it is written. rigc compiles a rig spec into Spine 4.3 skeleton data, round-trips it through spine-core and named assertions, and emits nothing that fails. Output imports into the Spine editor. Ships as an agent skill.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -18,12 +18,61 @@ import { SKIP_NO_ATLAS, SKIP_NO_ATLAS_PAGE } from '../reasons.ts';
|
|
|
18
18
|
import { pageFootprint, pageGridSentence } from '../../atlas.ts';
|
|
19
19
|
import { readPngHeader } from '../../png.ts';
|
|
20
20
|
|
|
21
|
-
export function a06AtlasPageSizeMatchesPng({ fail, skip }: Verdicts, { atlas }: AtlasRegionFacts, input: { atlasDir: string }, policy: boolean): void {
|
|
21
|
+
export function a06AtlasPageSizeMatchesPng({ fail: failed, skip }: Verdicts, { atlas }: AtlasRegionFacts, input: { atlasDir: string }, policy: boolean): void {
|
|
22
22
|
if (!atlas) return skip('A06_ATLAS_PAGE_SIZE_MATCHES_PNG', SKIP_NO_ATLAS);
|
|
23
23
|
if (atlas.pages.length === 0) return skip('A06_ATLAS_PAGE_SIZE_MATCHES_PNG', SKIP_NO_ATLAS_PAGE);
|
|
24
|
+
// Every sentence this body prints goes through here, so the end of the body
|
|
25
|
+
// can tell "nothing failed" from "something failed" (issue #1055, below).
|
|
26
|
+
let failures = 0;
|
|
27
|
+
const fail = (assertion: string, detail: string): void => {
|
|
28
|
+
failures++;
|
|
29
|
+
failed(assertion, detail);
|
|
30
|
+
};
|
|
31
|
+
// 🔒 **A page whose file is not on disk is a page whose size was not
|
|
32
|
+
// measured, and the body says so rather than passing** (issue #1055). Until
|
|
33
|
+
// this the loop below walked past such a page and the assertion came out
|
|
34
|
+
// PASS — on a build with every page file deleted, a PASS over a size clause
|
|
35
|
+
// that had opened nothing, measured on 33 of the 38 recipe-and-profile
|
|
36
|
+
// pairs of the tree's 19 recipes (the other five failed clauses that read
|
|
37
|
+
// only the atlas's numbers: overlap and rotation, under `spine-html`). What the body does instead is decided by what `A17` prints on
|
|
38
|
+
// the same input, so that one missing file is named once, by the rule whose
|
|
39
|
+
// subject it is: A17 FAILs naming every such file and its path, which keeps
|
|
40
|
+
// the report red; this body adds no FAIL of its own about the file (a
|
|
41
|
+
// second naming), and it does not PASS (a certificate over a size nobody
|
|
42
|
+
// read). It SKIPs with a reason that names the pages it did not read and
|
|
43
|
+
// points at A17 — `unreadSizes` below, at both of the body's exits.
|
|
44
|
+
//
|
|
45
|
+
// ⚠️ Only when nothing else here failed. `skip()` is per assertion, and a
|
|
46
|
+
// skip beside failures puts A06 in two of the report's buckets (the #705
|
|
47
|
+
// argument in `a19.ts`); and a FAIL certifies nothing, so the unread page
|
|
48
|
+
// is A17's alone there. ⚠️ Not the tree's other multi-clause rule either
|
|
49
|
+
// (`../reasons.ts`, #580: a multi-clause assertion SKIPs only when EVERY
|
|
50
|
+
// clause had nothing to measure). That rule is about a clause whose subject
|
|
51
|
+
// list is EMPTY — zero is a count, and a count was measured. A page the
|
|
52
|
+
// atlas declares is a member of the size clause's subject that is present
|
|
53
|
+
// and was not read, and the PASS this replaces claimed it was.
|
|
54
|
+
const unread: string[] = [];
|
|
55
|
+
const unreadSizes = (): void => {
|
|
56
|
+
if (failures > 0 || unread.length === 0) return;
|
|
57
|
+
const total = atlas.pages.length;
|
|
58
|
+
skip(
|
|
59
|
+
'A06_ATLAS_PAGE_SIZE_MATCHES_PNG',
|
|
60
|
+
unread.length === total
|
|
61
|
+
? `no page's size was measured: none of the ${total} page file(s) the atlas declares is on disk, which ` +
|
|
62
|
+
"A17_ATLAS_PAGE_FILES_EXIST names file by file. The clauses that read only the atlas's own numbers found " +
|
|
63
|
+
"nothing to fail, and that is not a pass while every page's size is unread"
|
|
64
|
+
: `the size of ${unread.length} of the ${total} page(s) the atlas declares was not measured — ` +
|
|
65
|
+
`${unread.map((name) => JSON.stringify(name)).join(', ')} — because the file is not on disk, which ` +
|
|
66
|
+
`A17_ATLAS_PAGE_FILES_EXIST names. The ${total - unread.length} page(s) that were read, and the clauses ` +
|
|
67
|
+
"that read only the atlas's own numbers, found nothing to fail, and that is not a pass while a page's size is unread",
|
|
68
|
+
);
|
|
69
|
+
};
|
|
24
70
|
for (const page of atlas.pages) {
|
|
25
71
|
const abs = resolve(input.atlasDir, page.name);
|
|
26
|
-
if (!existsSync(abs))
|
|
72
|
+
if (!existsSync(abs)) {
|
|
73
|
+
unread.push(page.name); // A17 names the file; this body says only that it did not read it
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
27
76
|
// 🔒 **A page that is not a PNG is a named failure, not a throw** (issue
|
|
28
77
|
// #732). The reader's throw used to reach this rule's catch and print as
|
|
29
78
|
// `threw: not a PNG (bad signature)`: the verdict right, the sentence a
|
|
@@ -118,7 +167,7 @@ export function a06AtlasPageSizeMatchesPng({ fail, skip }: Verdicts, { atlas }:
|
|
|
118
167
|
);
|
|
119
168
|
}
|
|
120
169
|
}
|
|
121
|
-
if (!policy) return;
|
|
170
|
+
if (!policy) return unreadSizes();
|
|
122
171
|
// ⭐ **One part per page OR a tiling page** (issue #266, follow-up 2). This
|
|
123
172
|
// clause used to be the first alternative alone — every region's UVs
|
|
124
173
|
// `(0,0)-(1,1)` — which is rigc's *unpacked* convention and exactly what
|
|
@@ -192,4 +241,5 @@ export function a06AtlasPageSizeMatchesPng({ fail, skip }: Verdicts, { atlas }:
|
|
|
192
241
|
);
|
|
193
242
|
}
|
|
194
243
|
}
|
|
244
|
+
unreadSizes();
|
|
195
245
|
}
|
|
@@ -21,13 +21,20 @@ import { colourTypeName, readPngHeader } from '../../png.ts';
|
|
|
21
21
|
import { readPlate } from '../../../tools/plate.ts';
|
|
22
22
|
import type { RigInfo } from '../../types.ts';
|
|
23
23
|
|
|
24
|
-
export function a19OverlayPngsHaveAlpha({ fail, skip }: Verdicts, { atlas }: AtlasRegionFacts, stage: StageFacts, { regionAttachments }: Pick<SkinEntryFacts, 'regionAttachments'>, input: { atlasDir: string; rig?: RigInfo }): void {
|
|
24
|
+
export function a19OverlayPngsHaveAlpha({ fail: failed, skip }: Verdicts, { atlas }: AtlasRegionFacts, stage: StageFacts, { regionAttachments }: Pick<SkinEntryFacts, 'regionAttachments'>, input: { atlasDir: string; rig?: RigInfo }): void {
|
|
25
25
|
// A SKIP for the same reason A06's is (#568). This one is invisible under
|
|
26
26
|
// `spine`, where the profile excludes the rule before its body runs — and
|
|
27
27
|
// that is exactly why it was worth finding: `--profile spine-html` reported
|
|
28
28
|
// it, and A27 below, green on an atlas nothing had read.
|
|
29
29
|
if (!atlas) return skip('A19_OVERLAY_PNGS_HAVE_ALPHA', SKIP_NO_ATLAS);
|
|
30
30
|
if (atlas.pages.length === 0) return skip('A19_OVERLAY_PNGS_HAVE_ALPHA', SKIP_NO_ATLAS_PAGE);
|
|
31
|
+
// Every sentence this body prints goes through here, so its end can tell
|
|
32
|
+
// "nothing failed" from "something failed" (issue #1055, at the page loop).
|
|
33
|
+
let failures = 0;
|
|
34
|
+
const fail = (assertion: string, detail: string): void => {
|
|
35
|
+
failures++;
|
|
36
|
+
failed(assertion, detail);
|
|
37
|
+
};
|
|
31
38
|
const stageW = stage.width ?? 0;
|
|
32
39
|
const stageH = stage.height ?? 0;
|
|
33
40
|
// 🔒 **Which image is the base plate is decided ONCE, and the rig's own
|
|
@@ -96,10 +103,34 @@ export function a19OverlayPngsHaveAlpha({ fail, skip }: Verdicts, { atlas }: Atl
|
|
|
96
103
|
if (on) on.push(region);
|
|
97
104
|
else sharedPages.set(region.page.name, [region]);
|
|
98
105
|
}
|
|
106
|
+
// 🔒 **A page whose file is not on disk is a page whose parts were not
|
|
107
|
+
// read, and the body says so rather than passing** (issue #1055). Until
|
|
108
|
+
// this the loop walked past such a page, and on a build with every page
|
|
109
|
+
// file deleted the assertion printed PASS on all 19 of the tree's recipes
|
|
110
|
+
// under `spine-html` having opened nothing. The rule for what it prints
|
|
111
|
+
// instead is `a06.ts`'s, read off what `A17` prints on the same input: A17
|
|
112
|
+
// FAILs naming each missing file, so the report is already red and the file
|
|
113
|
+
// already named; a FAIL here would be the second naming and a PASS a
|
|
114
|
+
// certificate over alpha nobody read. So the body SKIPs, naming the pages it
|
|
115
|
+
// did not read and pointing at A17 — only when it failed nothing else,
|
|
116
|
+
// because `skip()` is per assertion (#705's argument, below) and a FAIL
|
|
117
|
+
// certifies nothing.
|
|
118
|
+
//
|
|
119
|
+
// ⚠️ A page counts only when it carries a part this rule judges, by the
|
|
120
|
+
// predicate the non-PNG branch below uses: a missing page holding nothing
|
|
121
|
+
// but the base plate had nothing for this rule to read either way, so it
|
|
122
|
+
// moves nothing here (the size it was not measured at is `A06`'s to say).
|
|
123
|
+
let pagesWithParts = 0;
|
|
124
|
+
const unread: string[] = [];
|
|
99
125
|
for (const page of atlas.pages) {
|
|
100
126
|
const abs = resolve(input.atlasDir, page.name);
|
|
101
|
-
if (!existsSync(abs)) continue;
|
|
102
127
|
const on = sharedPages.get(page.name) ?? [];
|
|
128
|
+
const carriesPart = on.length > 1 ? on.some((region) => !baseRegions.has(region.name)) : !basePages.has(page.name);
|
|
129
|
+
if (carriesPart) pagesWithParts++;
|
|
130
|
+
if (!existsSync(abs)) {
|
|
131
|
+
if (carriesPart) unread.push(page.name); // A17 names the file; this body says only that it did not read it
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
103
134
|
// 🔒 **A page that is not a PNG is a non-measurement for every part on
|
|
104
135
|
// it** (issue #732), stated the way #705's and #715's are: a FAIL naming
|
|
105
136
|
// what was not read, because `skip()` is per assertion and would delete
|
|
@@ -292,4 +323,15 @@ export function a19OverlayPngsHaveAlpha({ fail, skip }: Verdicts, { atlas }: Atl
|
|
|
292
323
|
'spine does not run this check.',
|
|
293
324
|
);
|
|
294
325
|
}
|
|
326
|
+
if (failures > 0 || unread.length === 0) return;
|
|
327
|
+
skip(
|
|
328
|
+
'A19_OVERLAY_PNGS_HAVE_ALPHA',
|
|
329
|
+
unread.length === pagesWithParts
|
|
330
|
+
? `no part's alpha was read: none of the ${pagesWithParts} page file(s) carrying a part is on disk, which ` +
|
|
331
|
+
'A17_ATLAS_PAGE_FILES_EXIST names file by file, and that is not a pass while every part is unread'
|
|
332
|
+
: `${unread.length} of the ${pagesWithParts} page(s) carrying a part were not read — ` +
|
|
333
|
+
`${unread.map((name) => JSON.stringify(name)).join(', ')} — because the file is not on disk, which ` +
|
|
334
|
+
`A17_ATLAS_PAGE_FILES_EXIST names. Every part on the ${pagesWithParts - unread.length} page(s) that were ` +
|
|
335
|
+
"read can draw a transparent pixel, and that is not a pass while a part's alpha is unread",
|
|
336
|
+
);
|
|
295
337
|
}
|