@rig-c/core 2.86.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/AUTHORING.md CHANGED
@@ -367,7 +367,7 @@ What the flags mean:
367
367
  | `--manifest` | a cut manifest. Only for a rig with **measured art** behind it; a foreign skeleton has none |
368
368
  | `--cut` | `build`, `explain` and `validate`: look up a named cut in `--cuts <cuts.json>`, **instead of** `--rig`/`--motion`/`--out` — the two spellings are one build stated two ways and are refused together. A `cuts.json` is `{ "<name>": { "rig": …, "motion": …, "out": …, "manifest"?: … } }`, every path in it relative to the table's own file, so the table lives with the project that owns the art |
369
369
  | `--cuts` | the `cuts.json` `--cut` names. Required beside it — `--cut` alone is refused, with no guess at where the table lives |
370
- | `--profile` | `spine` = the 36 validity rules (**the default**) · `rig-play` = all 50, opt-in. `spine-html`, the profile's former name, is read as `rig-play` until the next major release and prints `rigc: --profile spine-html is deprecated and reads as --profile rig-play, the same rules; it is accepted until the next major release — pass --profile rig-play` on stderr |
370
+ | `--profile` | `spine` = the 36 validity rules (**the default**) · `rig-play` = all 50, opt-in. Since 3.0, `spine-html` is refused with `--profile "spine-html"; known profiles: spine, rig-play` (usage error, exit 2); replace it with `--profile rig-play`, which runs the same rules |
371
371
  | `--report` | `build` and `repack`: also write the gate's report as a JSON document (`build-report/1`) to this file — every gate's `PASS`, `SKIP` and `FAIL` rows, its summary figures and stats line, which supplier judged it, and every `pack:` line's figures. Written when the command writes `--out` and when a gate is red, before the exit; a file already at the path is removed first, so a compile error or a refused repack leaves none. Never inside `--out`, refused by name. The printed lines are byte-identical with it and without it — **§5.3** |
372
372
  | `--candidate` | `check`, `bench`, `render`, `inspect`, `preview`, `chainfit` and `vote` only: a **compiled** artifact — the directory `build --out` wrote, or a `skeleton.json` path. A directory holding no `skeleton.json`, or a path with nothing at it, is refused `nothing at <path>`, exit 2, nothing written, by every command that takes a build — `validate <dir>` and a directory given to `diff` included (`RC27`). `--atlas <path>` names the atlas when it does not sit beside the skeleton. On `render` and `check` a rigc build whose `skeleton.model.json` is `rigc-compiled/3` or `/2` needs no atlas at all: with no `--atlas` and no atlas beside it, it is drawn from the document's `pages`, the same frames, geometry and figures as with it, and the `atlas` line says `— not there`. An atlas that is there is still read, and held to `pages`: one that differs (edited after the build) is drawn through spine-core, and the `poser` line names the first difference. A build drawn through an atlas that is not there — a `rigc-compiled/1` document, or a build the core refuses — is refused `nothing at <the atlas>: … is drawn through its atlas (<why>)`, exit 2, nothing written; a Spine export without its atlas is refused `nothing at <the atlas>` as it always was. A directory whose files are not one build — a `skeleton.json` or a `skeleton.atlas` from another build beside this one's `skeleton.model.json` — is drawn through spine-core where the runtime can load the pair, the `poser` line naming the two digests or the atlas's first difference; where it cannot, it is refused `<skeleton> does not load against <the atlas>: spine-core draws this pair (<the poser line's why>) and could not resolve it — "<the runtime's own words>". <dir> is not one build: …`, exit 2, nothing written (`RC18`) — another build's skeleton beside this build's atlas typically ends `"Region not found in atlas: <region> (attachment: <name>)"`. Rebuild, or put the build's own three files back beside each other. A Spine export beside an atlas it was not exported with is refused in the same words, ending `The skeleton and the atlas are not one pair`. An atlas copied from another build's directory usually stops earlier, at its pages — their paths are relative to the directory it was written in — and is refused naming the first one: `nothing at <the page>: <the atlas> names it as a page, and spine-core draws this pair through that atlas (<why>). … <dir> is not one build: …`, exit 2, nothing written (`RC18`); an export whose atlas names a page that is not there is refused the same way, ending `and the page has to be there`. A build moved or copied whole away from the directory it was built in stops at the same place, on either poser, and is refused naming the page and the file that names it: `nothing at <the page>: <the skeleton.model.json> names it as a page, and the core draws this build from it. A page path is relative to the build's directory, so a build moved or copied away from the directory it was built in names pages that are not here — build it again where it is, or build it with --copy-images, which writes its pages beside it` (under `--poser spine`, `<the atlas> names it as a page, and spine-core draws this pair through that atlas (--poser spine)` with the same ending), exit 2, nothing written (`RC21`); only where the core refused the files does a page refusal say the directory is not one build. `bench --bones` and `rigc bonedist` — on its `--candidate` and on its `--reference` — refuse a pair the runtime cannot load in the words above with `spine-core poses this pair (bonedist's candidate: …)` or `(bonedist's reference: …)`, exit 2, nothing written (`RC20`); they read no page image, so a build whose pages are elsewhere is measured as it is in place. A `skeleton.json` that is not JSON is refused `rigc: cannot read <the file>: <the parser's words> (line N, column N)`, exit 2, by `render`, `check`, `bench` and `bonedist` as by every other command that reads one (`RC22`). With the atlas gone, `check` on a `rigc-compiled/3` build reads its pages' `scale:` lines off the document, so its texture note and `check.json`'s `textureFrom.candidateScales` are what they are with the atlas; on a `/2` build its texture note says whether the atlas declares a `scale:` line is not read (that document does not state one), and `candidateScales` is `null` (`RC13`). **`vote` and `preview` take it more than once**: `vote` 2–4 times, one per pane, labelled A, B, C, D in the order given; `preview` any number of times, one pane per candidate in the order given, each headed by its path and its gate line, and the same skeleton twice (a directory and its `skeleton.json` are one) is refused by name. `--atlas` goes with one candidate only. Everywhere else a repeat is a typo and is refused |
373
373
  | `--animation` | `render`, `preview` and `vote` only: which animation to show. The default is **every** one for `render`, the **first** for `preview` (each candidate's own first, with several), and for `vote` the first of candidate A. A name the skeleton does not have is refused, with the ones it does have listed — and for `vote` and a several-candidate `preview`, so is a name that only *some* candidates have, naming the one that lacks it |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rig-c/core",
3
- "version": "2.86.0",
3
+ "version": "3.0.0",
4
4
  "description": "AI-authored 2D rigging and animation, verified before it is written. rigc compiles a rig spec into skeleton data in the Spine 4.3 format, gates it with named assertions held to a spine-core round trip's verdicts, and emits nothing that fails. Ships as an agent skill.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -22,15 +22,18 @@
22
22
  "./runtime": "./src/runtime/index.ts",
23
23
  "./cli": "./cli.ts",
24
24
  "./package.json": "./package.json",
25
- "./*.ts": "./*.ts",
26
- "./*.mjs": "./*.mjs",
27
- "./*.cjs": "./*.cjs",
28
- "./*.json": "./*.json",
29
- "./*.md": "./*.md",
30
25
  "./LICENSE": "./LICENSE",
31
26
  "./bin/rigc": "./bin/rigc.cjs",
32
27
  "./tools/png_probe": "./tools/png_probe.mjs",
33
- "./*": "./*.ts"
28
+ "./deformgen": "./src/deformgen.ts",
29
+ "./environment": "./src/environment.ts",
30
+ "./motion": "./src/motion.ts",
31
+ "./passthrough": "./src/passthrough.ts",
32
+ "./stop": "./src/stop.ts",
33
+ "./meshrasters": "./src/meshrasters.ts",
34
+ "./seam": "./src/seam.ts",
35
+ "./folds": "./src/folds.ts",
36
+ "./model": "./src/model.ts"
34
37
  },
35
38
  "engines": {
36
39
  "bun": ">=1.4.0"
@@ -129,7 +129,7 @@ export function roundTripOnlyCodes(): string[] {
129
129
 
130
130
  /** The restated rules over one build's emitted texts, in `validate()`'s report shape. */
131
131
  export function validateEmittedText(given: EmittedTextInput): VerdictLists & { profile: AssertionProfile } {
132
- // A former profile name reads as its profile (issue #1277), for the rules and the report alike.
132
+ // Refuse unknown and removed profiles before choosing policy or writing a report (issue #1668).
133
133
  const input: EmittedTextInput = { ...given, profile: resolveProfile(given.profile, 'the emitted text') };
134
134
  const known = new Set(EMITTED_TEXT_RULES.map((r) => r.code));
135
135
  const unrun = roundTripOnlyCodes().filter((code) => !known.has(code));
@@ -75,9 +75,8 @@ export interface VerdictHarness extends VerdictLists {
75
75
  * the table lacks — `validate` for the gate, so its message is the one it was.
76
76
  */
77
77
  export function verdictHarness(profile: AssertionProfile, kinds: Readonly<Record<string, AssertionKind>>, who: string): VerdictHarness {
78
- // A former name resolves to its profile and anything outside the pair is
79
- // refused by name — `resolveProfile` says why. The entries resolve before
80
- // they get here, so this is the floor for a caller of the harness itself.
78
+ // Anything outside the two profiles is refused by name. Entries check before
79
+ // they get here too; this is the floor for a caller of the harness itself.
81
80
  profile = resolveProfile(profile, who);
82
81
  const failures: Failure[] = [];
83
82
  const passed: string[] = [];
@@ -14,28 +14,9 @@
14
14
  /** The two rulebooks — `ValidateProfile` in `src/validate.ts`, where the choice between them is argued. */
15
15
  export type AssertionProfile = 'spine' | 'rig-play';
16
16
 
17
- /**
18
- * A profile's former name, which the CLI's `--profile` still reads for one
19
- * minor and resolves at parse time, printing the deprecation line that names
20
- * the profile it reads as (issue #1277). Nothing past the flag parser sees an
21
- * alias: the rule set is keyed on the profile it resolves to, so the alias and
22
- * its target cannot come to run different rules.
23
- */
24
- export const PROFILE_ALIASES: Readonly<Record<string, AssertionProfile>> = { 'spine-html': 'rig-play' };
25
-
26
- /**
27
- * The profile a gate entry runs under: a profile as given, a former name as the
28
- * profile it became — silently, because the CLI prints the deprecation line and
29
- * a library caller of `validate()` through a courtesy key passed the former
30
- * name on the release before this one and must get the same rules — and
31
- * anything else refused by name. `kindRunsUnder` reads every name but
32
- * `rig-play` as validity-only, so an unresolved name would run a weaker gate in
33
- * silence, under a name nobody chose (issue #1277).
34
- */
17
+ /** Refuse an unknown profile before the kind rule can silently select validity alone. */
35
18
  export function resolveProfile(profile: string, who: string): AssertionProfile {
36
19
  if (profile === 'spine' || profile === 'rig-play') return profile;
37
- const target = Object.hasOwn(PROFILE_ALIASES, profile) ? PROFILE_ALIASES[profile] : undefined;
38
- if (target !== undefined) return target;
39
20
  throw new Error(`${who}: profile ${JSON.stringify(profile)} is not a profile; the profiles are "spine" and "rig-play"`);
40
21
  }
41
22
 
@@ -386,7 +386,7 @@ function rigFigures(stats: Record<string, number | string>, read: ReadDocument |
386
386
  * pass one.
387
387
  */
388
388
  export function validateModel(given: ModelValidateInput, plant: Partial<ModelSupply> = {}): ModelReport {
389
- // A former profile name reads as its profile (issue #1277), for the policy switches and the report alike.
389
+ // Refuse unknown and removed profiles before choosing policy or writing a report (issue #1668).
390
390
  const input: ModelValidateInput = { ...given, profile: resolveProfile(given.profile, 'the model side') };
391
391
  const supply: ModelSupply = { ...MODEL_SUPPLY, ...plant };
392
392
  const h = verdictHarness(input.profile, { ...ASSERTION_KIND, ...MODEL_PARSE_KIND }, 'the model side');
@@ -12,17 +12,6 @@ import { failLine } from '../guide.ts';
12
12
 
13
13
  export const VALIDATE_PROFILES: readonly AssertionProfile[] = ['spine', 'rig-play'];
14
14
 
15
- /**
16
- * The line `--profile <alias>` prints on stderr before the command runs: the
17
- * old name, the profile it reads as, and the flag to pass instead (issue
18
- * #1277). Stderr so a report on stdout reads the same whichever name the
19
- * caller typed; the report itself names the profile that judged it, which is
20
- * the target and never the alias.
21
- */
22
- export function profileAliasLine(alias: string, target: AssertionProfile): string {
23
- return `rigc: --profile ${alias} is deprecated and reads as --profile ${target}, the same rules; it is accepted until the next major release — pass --profile ${target}`;
24
- }
25
-
26
15
  /**
27
16
  * What the CLI uses when `--profile` is absent — and ONLY the CLI. This is not
28
17
  * `validate()`'s default; that function has none (`ValidateProfile` in
package/src/cli/shared.ts CHANGED
@@ -26,11 +26,10 @@ import {
26
26
  CLI_DEFAULT_PROFILE,
27
27
  type GateHere,
28
28
  type PackPageFigures,
29
- profileAliasLine,
30
29
  VALIDATE_PROFILES,
31
30
  } from '../assertions/report.ts';
32
31
  import type { VerdictLists } from '../assertions/harness.ts';
33
- import { PROFILE_ALIASES, type AssertionProfile } from '../assertions/kinds.ts';
32
+ import type { AssertionProfile } from '../assertions/kinds.ts';
34
33
  import { MAX_CANDIDATES, MIN_CANDIDATES } from '../ballot.ts';
35
34
  import { BONEDIST_SPEC, IDENTITY_CORRESPONDENCE } from '../correspondence.ts';
36
35
  import { ANCHOR_MAX_RESIDUAL, ANCHOR_MAX_UNEXPLAINED, DEFAULT_HINGE_MAX, DEFAULT_HINGE_MIN, DEFAULT_MIN_LEVER_PX, DEFAULT_MIN_VISIBLE, DEFAULT_PASSES } from '../chainfit.ts';
@@ -2245,13 +2244,6 @@ export function usageText(docs: readonly CommandDoc[], checkout: string, rules:
2245
2244
  export function readProfile(flags: Record<string, string>): AssertionProfile {
2246
2245
  const raw = flags.profile;
2247
2246
  if (raw === undefined) return CLI_DEFAULT_PROFILE;
2248
- // A former name resolves here and nowhere else (issue #1277): past this line
2249
- // the alias does not exist, so it cannot select a rule set of its own.
2250
- const aliased = Object.hasOwn(PROFILE_ALIASES, raw) ? PROFILE_ALIASES[raw] : undefined;
2251
- if (aliased !== undefined) {
2252
- console.error(profileAliasLine(raw, aliased));
2253
- return aliased;
2254
- }
2255
2247
  const found = VALIDATE_PROFILES.find((p) => p === raw);
2256
2248
  if (!found) throw new UsageError(`--profile ${JSON.stringify(raw)}; known profiles: ${VALIDATE_PROFILES.join(', ')}`);
2257
2249
  return found;
package/src/core/entry.ts CHANGED
@@ -47,5 +47,6 @@ export type { DrawnRegion, UvPage, UvRegion, UvSource } from './uvs.ts';
47
47
  export { clipThrough, clipShapeOf, convexWhy, REGION_UVS, REGION_TRIANGLES } from './clipping.ts';
48
48
  export type { ClipShape, ClipResult } from './clipping.ts';
49
49
  export { eventsFired } from './events.ts';
50
- export { bezierPolyline, BEZIER_PIECES } from './animation.ts';
50
+ export { bezierPolyline, BEZIER_PIECES, IRR_OFFSET } from './animation.ts';
51
51
  export type { ModelPage, ModelPageRegion } from '../model.ts';
52
+ export { RUNTIME_PI } from './world.ts';
package/src/motion.ts CHANGED
@@ -819,3 +819,6 @@ function parseMotionSpecInto(raw: unknown, where: string, visits: readonly Shape
819
819
 
820
820
  return raw as unknown as MotionSpec;
821
821
  }
822
+
823
+ /** Named type used by consumer motion readers (issue #1668). */
824
+ export type { MotionSpec } from './types.ts';
@@ -41,6 +41,7 @@ export type {
41
41
  BoneSnapshot,
42
42
  AttachmentPose,
43
43
  AttachmentRest,
44
+ GeometryFile,
44
45
  Piece,
45
46
  PieceCommon,
46
47
  PieceTexture,
package/src/validate.ts CHANGED
@@ -2009,7 +2009,7 @@ function once<T>(supply: () => T): () => T {
2009
2009
  }
2010
2010
 
2011
2011
  export function validate(input: ValidateInput): ValidateReport {
2012
- // A former name reads as its profile (issue #1277): the policy switch below and the report both use the resolved one.
2012
+ // Refuse unknown and removed profiles before choosing policy or writing a report (issue #1668).
2013
2013
  const profile = resolveProfile(input.profile, 'validate');
2014
2014
  /** True when this profile's rulebook includes the policy layer. */
2015
2015
  const policy = profile === 'rig-play';