Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat: render sprite contracts from track registry (#3154)

[._.]/ Adam Eivy7b3fdb851b62
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 079816d15c..d83a388614 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -19,6 +19,7 @@
## Sprites
+- **[issue-3154] Runtime contracts now follow every animation type automatically.** The publish form reads each applicable animation's label, frame-count range, and required/optional role from the track registry, so custom animation types appear, validate, fill from the compiled atlas, and publish without another client update.
- **[issue-3136] Every animation type beyond the walk cycle now runs through one shared workflow.** The Scanner action and Ambient loop used to be two separate, hardcoded surfaces with their own buttons, endpoints, and copy; they are now the same generate/review/approve flow, each reading its own label, frame count, playback speed, and facing count from a single description of that animation type. Nothing changes about the sprites, atlases, or approvals you already have — but a future release can add a new animation sequence (a chest opening, a flower blossoming, a jetpack burst) as a definition rather than as new code, and it will appear with its own workflow automatically. Places and objects now show their identity reference and their animation loop as two clear steps rather than one panel that swapped contents.
- Locked main references can now be explicitly reopened from Sprite Manager while keeping the turnaround and the other directional anchors intact. Reopening the main preserves versioned evidence, clears only the south identity, and reopens its dependent walk/scanner approvals so a better turnaround-derived main can be reviewed and locked as the next version.
- Sprite turnaround and directional-reference candidates now request a square canvas from image generation and explicitly treat the locked turnaround as the source of truth for accessory side and occlusion. This prevents arbitrary Codex ImageGen candidate aspect ratios and reduces mirrored hip-bag drift before an anchor is locked.
diff --git a/client/src/components/sprites/PublishWorkflow.jsx b/client/src/components/sprites/PublishWorkflow.jsx
index 37fac2d864..0042e259ec 100644
--- a/client/src/components/sprites/PublishWorkflow.jsx
+++ b/client/src/components/sprites/PublishWorkflow.jsx
@@ -1,4 +1,4 @@
-import { useEffect, useState } from 'react';
+import { useEffect, useMemo, useState } from 'react';
import { Package, Rocket, RefreshCw } from 'lucide-react';
import toast from '../ui/Toast';
import {
@@ -12,67 +12,50 @@ import { FormField } from '../ui/FormField.jsx';
import SpritePreview from './SpritePreview.jsx';
import { timeAgo } from '../../utils/formatters.js';
-// Publish workflow (issue #2898): compile the immutable runtime atlas from
-// the finalized walk set, bind a managed app + repo-relative destination,
-// and publish (atomic replace, divergence-refusing) into the game repo.
-// Appears only once the walk set is finalized — the compile input.
+// Publish workflow (issue #2898): compile the immutable runtime atlas from the
+// record kind's finalized primary animation set, bind a managed app +
+// repo-relative destination, and publish (atomic replace,
+// divergence-refusing) into the game repo.
+// Appears only once that primary set is finalized — the compile input.
const inputClass = 'w-full px-2 py-1 text-xs bg-port-bg border border-port-border rounded text-gray-200 focus:border-port-accent focus:outline-none';
const fieldLabelClass = 'block text-xs text-gray-400 mb-1';
+const EMPTY_TRACK_DEFINITIONS = Object.freeze([]);
-// Mirrors of the server contract (server/services/sprites/walkBounds.js is the
-// single source of truth; kept as literals here rather than importing a server
-// module into the client bundle). WALK_MIN/MAX bound the walk-frame-count
-// input; IDLE/SCANNER name the legacy non-walk columns so the "Match current
-// atlas" fallback can count walk columns the same way resolveWalkFrameCount does.
-const WALK_MIN_FRAME_COUNT = 6;
-const WALK_MAX_FRAME_COUNT = 16;
-const SCANNER_MIN_FRAME_COUNT = 2;
-const SCANNER_MAX_FRAME_COUNT = 8;
-const AMBIENT_MIN_FRAME_COUNT = 2;
-const AMBIENT_MAX_FRAME_COUNT = 6;
-const ATLAS_IDLE_COLUMN = 'idle';
-const ATLAS_SCANNER_COLUMN = 'scanner';
-
-// The compiled atlas stamps geometry.walkFrameCount, but imported/legacy
-// pointers may omit it — fall back to counting the walk columns, matching the
-// server's resolveWalkFrameCount so the compare and the fill button agree.
-function walkFrameCountOf(geometry) {
- if (Number.isInteger(geometry?.walkFrameCount)) return geometry.walkFrameCount;
- if (geometry?.tracks && typeof geometry.tracks === 'object' && !Array.isArray(geometry.tracks)) {
- return Number.isInteger(geometry.tracks.walk?.count) ? geometry.tracks.walk.count : null;
- }
- if (!Array.isArray(geometry?.columns)) return null;
- return geometry.columns.filter(
- (c) => c !== ATLAS_IDLE_COLUMN && c !== ATLAS_SCANNER_COLUMN,
- ).length;
-}
-
-function scannerFrameCountOf(geometry) {
- if (Number.isInteger(geometry?.scannerFrameCount)) return geometry.scannerFrameCount;
- return Number.isInteger(geometry?.tracks?.scanner?.count) ? geometry.tracks.scanner.count : null;
+function contractSeedOf(definitions, contract) {
+ return Object.fromEntries(definitions.map((definition) => {
+ const value = contract?.[definition.contractFrameCountField];
+ return [definition.contractFrameCountField, value == null ? '' : String(value)];
+ }));
}
-function ambientFrameCountOf(geometry) {
- if (Number.isInteger(geometry?.ambientFrameCount)) return geometry.ambientFrameCount;
- return Number.isInteger(geometry?.tracks?.ambient?.count) ? geometry.tracks.ambient.count : null;
+function trackFrameCountOf(geometry, definition) {
+ const direct = geometry?.[definition.contractFrameCountField];
+ if (Number.isInteger(direct)) return direct;
+ const spanCount = geometry?.tracks?.[definition.id]?.count;
+ return Number.isInteger(spanCount) ? spanCount : null;
}
-export default function PublishWorkflow({ record, walk, ambient, atlas, onChanged }) {
- // `ambient` is the generic track state since #3136, whose finalized set is
- // `set` for every track (the per-track `ambientSet` key went away with the
- // clone, and the client ships with the server that produces it).
- const finalized = Boolean(walk?.walkSet || ambient?.set);
+export default function PublishWorkflow({
+ record, walk, tracks = {}, trackDefinitions = EMPTY_TRACK_DEFINITIONS, atlas, onChanged,
+}) {
+ const primaryTrack = trackDefinitions.find((definition) => definition.standaloneContract) || null;
+ const finalized = Boolean(
+ walk?.walkSet
+ || Object.values(tracks).some((state) => state?.definition?.standaloneContract && state?.set),
+ );
const current = atlas?.current || null;
const publications = atlas?.publications || [];
const saved = record.publishBinding || null;
const savedContract = saved?.runtimeContract || null;
// Contract fields are strings so an empty input is distinguishable from a 0.
- // The stored contract seeds them; a walk or ambient frame count anchors it.
- const seedFrames = savedContract?.walkFrameCount != null ? String(savedContract.walkFrameCount) : '';
- const seedScanner = savedContract?.scannerFrameCount != null ? String(savedContract.scannerFrameCount) : '';
- const seedAmbient = savedContract?.ambientFrameCount != null ? String(savedContract.ambientFrameCount) : '';
+ // The served registry slice owns every track field, bound, label and primary
+ // marker — adding a track needs no corresponding client branch.
+ const seedTrackCounts = useMemo(
+ () => contractSeedOf(trackDefinitions, savedContract),
+ [trackDefinitions, savedContract],
+ );
const seedCell = savedContract?.cellSize != null ? String(savedContract.cellSize) : '';
const seedCols = savedContract?.columnCount != null ? String(savedContract.columnCount) : '';
@@ -81,9 +64,7 @@ export default function PublishWorkflow({ record, walk, ambient, atlas, onChange
const [destPath, setDestPath] = useState(saved?.atlasDestPath || '');
const [codePath, setCodePath] = useState(saved?.codeBinding?.path || '');
const [resourcePath, setResourcePath] = useState(saved?.codeBinding?.resourcePath || '');
- const [contractFrames, setContractFrames] = useState(seedFrames);
- const [contractScanner, setContractScanner] = useState(seedScanner);
- const [contractAmbient, setContractAmbient] = useState(seedAmbient);
+ const [contractTrackCounts, setContractTrackCounts] = useState(seedTrackCounts);
const [contractCell, setContractCell] = useState(seedCell);
const [contractCols, setContractCols] = useState(seedCols);
// null → idle; 'publish' → normal confirm; 'overwrite' → the server
@@ -101,55 +82,57 @@ export default function PublishWorkflow({ record, walk, ambient, atlas, onChange
setDestPath(saved?.atlasDestPath || '');
setCodePath(saved?.codeBinding?.path || '');
setResourcePath(saved?.codeBinding?.resourcePath || '');
- setContractFrames(seedFrames);
- setContractScanner(seedScanner);
- setContractAmbient(seedAmbient);
+ setContractTrackCounts(seedTrackCounts);
setContractCell(seedCell);
setContractCols(seedCols);
setConfirmStage(null);
}, [saved?.appId, saved?.atlasDestPath, saved?.codeBinding?.path, saved?.codeBinding?.resourcePath,
- savedContract?.walkFrameCount, savedContract?.scannerFrameCount, savedContract?.ambientFrameCount, savedContract?.cellSize, savedContract?.columnCount,
- seedFrames, seedScanner, seedAmbient, seedCell, seedCols]);
+ seedTrackCounts, seedCell, seedCols]);
- // Parse the five contract inputs. A walk or ambient frame count anchors the
- // contract; cellSize/columnCount are optional (empty → null).
- const framesRaw = contractFrames.trim();
- const scannerRaw = contractScanner.trim();
- const ambientRaw = contractAmbient.trim();
+ const trackInputs = trackDefinitions.map((definition) => {
+ const raw = (contractTrackCounts[definition.contractFrameCountField] || '').trim();
+ return {
+ definition,
+ raw,
+ value: raw === '' ? null : Number(raw),
+ };
+ });
const cellRaw = contractCell.trim();
const colsRaw = contractCols.trim();
- const framesNum = framesRaw === '' ? null : Number(framesRaw);
- const scannerNum = scannerRaw === '' ? null : Number(scannerRaw);
- const ambientNum = ambientRaw === '' ? null : Number(ambientRaw);
const cellNum = cellRaw === '' ? null : Number(cellRaw);
const colsNum = colsRaw === '' ? null : Number(colsRaw);
- const hasContract = framesNum !== null || ambientNum !== null;
+ const primaryInput = trackInputs.find(({ definition }) => definition.standaloneContract);
+ const hasContract = primaryInput?.value !== null && primaryInput?.value !== undefined;
// Whether the contract INPUTS were edited (vs. merely seeded from the saved
// binding). Used both for the dirty check and to scope the no-binding error
// to a user who actually typed a contract — an untouched seeded contract must
// not block an unbind (sending `binding: null` clears it server-side anyway).
- const contractFieldsDirty = seedFrames !== framesRaw || seedScanner !== scannerRaw || seedAmbient !== ambientRaw
- || seedCell !== cellRaw || seedCols !== colsRaw;
+ const contractFieldsDirty = trackInputs.some(
+ ({ definition, raw }) => seedTrackCounts[definition.contractFrameCountField] !== raw,
+ ) || seedCell !== cellRaw || seedCols !== colsRaw;
const intInRange = (n, lo, hi) => Number.isInteger(n) && n >= lo && n <= hi;
// Validate only what's populated; a freshly typed contract is meaningless
// without an app + destination — the
// binding it would ride on is null, so the value would be silently discarded.
let contractError = null;
- if (!hasContract && (scannerRaw !== '' || cellRaw !== '' || colsRaw !== '')) {
- contractError = 'Walk or ambient frame count is required for a runtime contract.';
- } else if (framesNum !== null && !intInRange(framesNum, WALK_MIN_FRAME_COUNT, WALK_MAX_FRAME_COUNT)) {
- contractError = `Walk frame count must be a whole number ${WALK_MIN_FRAME_COUNT}–${WALK_MAX_FRAME_COUNT}.`;
- } else if (scannerNum !== null && !intInRange(scannerNum, SCANNER_MIN_FRAME_COUNT, SCANNER_MAX_FRAME_COUNT)) {
- contractError = `Scanner frame count must be a whole number ${SCANNER_MIN_FRAME_COUNT}–${SCANNER_MAX_FRAME_COUNT}.`;
- } else if (ambientNum !== null && !intInRange(ambientNum, AMBIENT_MIN_FRAME_COUNT, AMBIENT_MAX_FRAME_COUNT)) {
- contractError = `Ambient frame count must be a whole number ${AMBIENT_MIN_FRAME_COUNT}–${AMBIENT_MAX_FRAME_COUNT}.`;
- } else if (cellNum !== null && !intInRange(cellNum, 16, 1024)) {
+ if (!hasContract && (trackInputs.some(({ raw }) => raw !== '') || cellRaw !== '' || colsRaw !== '')) {
+ contractError = `${primaryTrack?.label || 'Primary track'} frame count is required for a runtime contract.`;
+ } else {
+ const invalidTrack = trackInputs.find(({ definition, value }) => (
+ value !== null && !intInRange(value, definition.minFrameCount, definition.maxFrameCount)
+ ));
+ if (invalidTrack) {
+ const { definition } = invalidTrack;
+ contractError = `${definition.label} frame count must be a whole number ${definition.minFrameCount}–${definition.maxFrameCount}.`;
+ }
+ }
+ if (!contractError && cellNum !== null && !intInRange(cellNum, 16, 1024)) {
contractError = 'Cell size must be a whole number 16–1024.';
- } else if (colsNum !== null && !intInRange(colsNum, 1, 256)) {
+ } else if (!contractError && colsNum !== null && !intInRange(colsNum, 1, 256)) {
contractError = 'Column count must be a whole number 1–256.';
- } else if (hasContract && contractFieldsDirty && !(appId && destPath.trim())) {
+ } else if (!contractError && hasContract && contractFieldsDirty && !(appId && destPath.trim())) {
contractError = 'Bind an app and destination, or clear the contract.';
}
@@ -162,20 +145,16 @@ export default function PublishWorkflow({ record, walk, ambient, atlas, onChange
const fillFromAtlas = () => {
const geometry = current?.geometry;
if (!geometry) return;
- const frames = walkFrameCountOf(geometry);
- const scannerFrames = scannerFrameCountOf(geometry);
- const ambientFrames = ambientFrameCountOf(geometry);
- setContractFrames(frames != null ? String(frames) : '');
- setContractScanner(scannerFrames != null ? String(scannerFrames) : '');
- setContractAmbient(ambientFrames != null ? String(ambientFrames) : '');
+ setContractTrackCounts(Object.fromEntries(trackDefinitions.map((definition) => {
+ const frames = trackFrameCountOf(geometry, definition);
+ return [definition.contractFrameCountField, frames == null ? '' : String(frames)];
+ })));
setContractCell(Number.isInteger(geometry.cellSize) ? String(geometry.cellSize) : '');
setContractCols(Array.isArray(geometry.columns) ? String(geometry.columns.length) : '');
};
const clearContract = () => {
- setContractFrames('');
- setContractScanner('');
- setContractAmbient('');
+ setContractTrackCounts(contractSeedOf(trackDefinitions, null));
setContractCell('');
setContractCols('');
};
@@ -203,9 +182,9 @@ export default function PublishWorkflow({ record, walk, ambient, atlas, onChange
if (binding && contractDirty) {
binding.runtimeContract = hasContract
? {
- ...(framesNum === null ? {} : { walkFrameCount: framesNum }),
- ...(scannerNum === null ? {} : { scannerFrameCount: scannerNum }),
- ...(ambientNum === null ? {} : { ambientFrameCount: ambientNum }),
+ ...Object.fromEntries(trackInputs
+ .filter(({ value }) => value !== null)
+ .map(({ definition, value }) => [definition.contractFrameCountField, value])),
cellSize: cellNum,
columnCount: colsNum,
}
@@ -290,24 +269,30 @@ export default function PublishWorkflow({ record, walk, ambient, atlas, onChange
// mismatch is visible here, not only in the publish-time 409. Mirrors the
// fields runtimeContractMismatch compares server-side.
const atlasGeom = current?.geometry || null;
- const atlasFrames = walkFrameCountOf(atlasGeom);
- const atlasScannerFrames = scannerFrameCountOf(atlasGeom);
- const atlasAmbientFrames = ambientFrameCountOf(atlasGeom);
+ const atlasTrackCounts = trackDefinitions.map((definition) => ({
+ definition,
+ count: trackFrameCountOf(atlasGeom, definition),
+ }));
const atlasCols = Array.isArray(atlasGeom?.columns) ? atlasGeom.columns.length : null;
const atlasCell = Number.isInteger(atlasGeom?.cellSize) ? atlasGeom.cellSize : null;
const atlasSummary = atlasGeom
- ? `${atlasFrames ?? 'no'} walk frames${atlasScannerFrames != null ? ` · ${atlasScannerFrames} scanner frames` : ''}${atlasAmbientFrames != null ? ` · ${atlasAmbientFrames} ambient frames` : ''} · ${atlasCols ?? '?'} cols${atlasCell != null ? ` · ${atlasCell}px` : ''}`
+ ? [
+ ...atlasTrackCounts
+ .filter(({ count }) => count !== null)
+ .map(({ definition, count }) => `${count} ${definition.label.toLowerCase()} frames`),
+ `${atlasCols ?? '?'} cols`,
+ ...(atlasCell == null ? [] : [`${atlasCell}px`]),
+ ].join(' · ')
: null;
const savedContractMismatch = (() => {
if (!savedContract || !atlasGeom) return null;
- if (Number.isInteger(savedContract.walkFrameCount) && savedContract.walkFrameCount !== atlasFrames) {
- return `contract expects ${savedContract.walkFrameCount} walk frames, atlas has ${atlasFrames ?? '?'}`;
- }
- if (Number.isInteger(savedContract.scannerFrameCount) && savedContract.scannerFrameCount !== atlasScannerFrames) {
- return `contract expects ${savedContract.scannerFrameCount} scanner frames, atlas has ${atlasScannerFrames ?? 'none'}`;
- }
- if (Number.isInteger(savedContract.ambientFrameCount) && savedContract.ambientFrameCount !== atlasAmbientFrames) {
- return `contract expects ${savedContract.ambientFrameCount} ambient frames, atlas has ${atlasAmbientFrames ?? 'none'}`;
+ const trackMismatch = atlasTrackCounts.find(({ definition, count }) => {
+ const expected = savedContract[definition.contractFrameCountField];
+ return Number.isInteger(expected) && expected !== count;
+ });
+ if (trackMismatch) {
+ const { definition, count } = trackMismatch;
+ return `contract expects ${savedContract[definition.contractFrameCountField]} ${definition.label.toLowerCase()} frames, atlas has ${count ?? 'none'}`;
}
if (Number.isInteger(savedContract.columnCount) && savedContract.columnCount !== atlasCols) {
return `contract expects ${savedContract.columnCount} cols, atlas has ${atlasCols ?? '?'}`;
@@ -388,7 +373,7 @@ export default function PublishWorkflow({ record, walk, ambient, atlas, onChange
<button
type="button"
onClick={clearContract}
- disabled={framesRaw === '' && scannerRaw === '' && ambientRaw === '' && cellRaw === '' && colsRaw === ''}
+ disabled={trackInputs.every(({ raw }) => raw === '') && cellRaw === '' && colsRaw === ''}
className="px-2 py-0.5 text-[11px] bg-port-bg border border-port-border rounded text-gray-300 hover:border-port-accent disabled:opacity-50"
>
Clear
@@ -400,39 +385,26 @@ export default function PublishWorkflow({ record, walk, ambient, atlas, onChange
refused. Leave blank to publish unchecked; clearing removes a stored contract.
</p>
<div className="grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-5 gap-2">
- <FormField label={`Walk frames (${WALK_MIN_FRAME_COUNT}–${WALK_MAX_FRAME_COUNT})`} labelClassName={fieldLabelClass}>
- <input
- type="number"
- min={WALK_MIN_FRAME_COUNT}
- max={WALK_MAX_FRAME_COUNT}
- value={contractFrames}
- onChange={(e) => setContractFrames(e.target.value)}
- placeholder="12"
- className={inputClass}
- />
- </FormField>
- <FormField label={`Scanner frames (${SCANNER_MIN_FRAME_COUNT}–${SCANNER_MAX_FRAME_COUNT}, optional)`} labelClassName={fieldLabelClass}>
- <input
- type="number"
- min={SCANNER_MIN_FRAME_COUNT}
- max={SCANNER_MAX_FRAME_COUNT}
- value={contractScanner}
- onChange={(e) => setContractScanner(e.target.value)}
- placeholder="4"
- className={inputClass}
- />
- </FormField>
- <FormField label={`Ambient frames (${AMBIENT_MIN_FRAME_COUNT}–${AMBIENT_MAX_FRAME_COUNT}, optional)`} labelClassName={fieldLabelClass}>
- <input
- type="number"
- min={AMBIENT_MIN_FRAME_COUNT}
- max={AMBIENT_MAX_FRAME_COUNT}
- value={contractAmbient}
- onChange={(e) => setContractAmbient(e.target.value)}
- placeholder="3"
- className={inputClass}
- />
- </FormField>
+ {trackInputs.map(({ definition, raw }) => (
+ <FormField
+ key={definition.contractFrameCountField}
+ label={`${definition.label} frames (${definition.minFrameCount}–${definition.maxFrameCount}${definition.standaloneContract ? '' : ', optional'})`}
+ labelClassName={fieldLabelClass}
+ >
+ <input
+ type="number"
+ min={definition.minFrameCount}
+ max={definition.maxFrameCount}
+ value={raw}
+ onChange={(e) => setContractTrackCounts((counts) => ({
+ ...counts,
+ [definition.contractFrameCountField]: e.target.value,
+ }))}
+ placeholder={String(definition.defaultFrameCount)}
+ className={inputClass}
+ />
+ </FormField>
+ ))}
<FormField label="Cell size px (optional)" labelClassName={fieldLabelClass}>
<input
type="number"
diff --git a/client/src/components/sprites/PublishWorkflow.test.jsx b/client/src/components/sprites/PublishWorkflow.test.jsx
index f3240f0330..49300f205f 100644
--- a/client/src/components/sprites/PublishWorkflow.test.jsx
+++ b/client/src/components/sprites/PublishWorkflow.test.jsx
@@ -29,19 +29,63 @@ const GEOMETRY = {
walkFrameCount: 12,
};
+const WALK_DEFINITION = {
+ id: 'walk',
+ label: 'Walk cycle',
+ minFrameCount: 6,
+ maxFrameCount: 16,
+ defaultFrameCount: 12,
+ contractFrameCountField: 'walkFrameCount',
+ standaloneContract: true,
+};
+const SCANNER_DEFINITION = {
+ id: 'scanner',
+ label: 'Scanner action',
+ minFrameCount: 2,
+ maxFrameCount: 8,
+ defaultFrameCount: 4,
+ contractFrameCountField: 'scannerFrameCount',
+ standaloneContract: false,
+};
+const AMBIENT_DEFINITION = {
+ id: 'ambient',
+ label: 'Ambient loop',
+ minFrameCount: 2,
+ maxFrameCount: 6,
+ defaultFrameCount: 3,
+ contractFrameCountField: 'ambientFrameCount',
+ standaloneContract: true,
+};
+const JETPACK_DEFINITION = {
+ id: 'jetpack',
+ label: 'Jetpack burst',
+ minFrameCount: 3,
+ maxFrameCount: 7,
+ defaultFrameCount: 5,
+ contractFrameCountField: 'jetpackFrameCount',
+ standaloneContract: false,
+};
+
const atlasWith = (extra = {}) => ({
current: { version: 3, compiledAt: '2026-07-01T00:00:00.000Z', atlasPath: 'runtime/v3/a.png', geometry: GEOMETRY },
publications: [],
...extra,
});
-const renderWorkflow = (publishBinding, atlas = atlasWith()) => render(
+const renderWorkflow = (
+ publishBinding,
+ atlas = atlasWith(),
+ props = {},
+) => render(
<MemoryRouter>
<PublishWorkflow
record={{ id: 'example-walker', publishBinding }}
walk={{ walkSet: { imported: false } }}
+ tracks={{}}
+ trackDefinitions={[WALK_DEFINITION, SCANNER_DEFINITION]}
atlas={atlas}
onChanged={vi.fn()}
+ {...props}
/>
</MemoryRouter>,
);
@@ -61,7 +105,7 @@ describe('PublishWorkflow runtime contract', () => {
it('SETS the contract from a populated field group', async () => {
renderWorkflow({ appId: 'app-1', atlasDestPath: 'assets/hero.png', codeBinding: null });
- fireEvent.change(screen.getByLabelText(/Walk frames/), { target: { value: '12' } });
+ fireEvent.change(screen.getByLabelText(/Walk cycle frames/), { target: { value: '12' } });
fireEvent.change(screen.getByLabelText(/Cell size/), { target: { value: '96' } });
fireEvent.change(screen.getByLabelText(/Column count/), { target: { value: '13' } });
@@ -122,7 +166,7 @@ describe('PublishWorkflow runtime contract', () => {
it('blocks a contract with no app/destination and explains why', () => {
renderWorkflow(null, atlasWith());
- fireEvent.change(screen.getByLabelText(/Walk frames/), { target: { value: '12' } });
+ fireEvent.change(screen.getByLabelText(/Walk cycle frames/), { target: { value: '12' } });
expect(screen.getByText(/Bind an app and destination/)).toBeInTheDocument();
expect(screen.getByText('Save binding')).toBeDisabled();
@@ -131,9 +175,9 @@ describe('PublishWorkflow runtime contract', () => {
it('requires a track frame count when a scanner contract is entered on its own', () => {
renderWorkflow({ appId: 'app-1', atlasDestPath: 'assets/hero.png', codeBinding: null });
- fireEvent.change(screen.getByLabelText(/Scanner frames/), { target: { value: '4' } });
+ fireEvent.change(screen.getByLabelText(/Scanner action frames/), { target: { value: '4' } });
- expect(screen.getByText(/Walk or ambient frame count is required/)).toBeInTheDocument();
+ expect(screen.getByText(/Walk cycle frame count is required/)).toBeInTheDocument();
expect(screen.getByText('Save binding')).toBeDisabled();
});
@@ -142,7 +186,7 @@ describe('PublishWorkflow runtime contract', () => {
fireEvent.click(screen.getByText('Match current atlas'));
- expect(screen.getByLabelText(/Walk frames/).value).toBe('12');
+ expect(screen.getByLabelText(/Walk cycle frames/).value).toBe('12');
expect(screen.getByLabelText(/Cell size/).value).toBe('96');
expect(screen.getByLabelText(/Column count/).value).toBe('13');
});
@@ -163,7 +207,7 @@ describe('PublishWorkflow runtime contract', () => {
renderWorkflow({ appId: 'app-1', atlasDestPath: 'assets/hero.png', codeBinding: null }, scannerAtlas);
fireEvent.click(screen.getByText('Match current atlas'));
- expect(screen.getByLabelText(/Scanner frames/).value).toBe('4');
+ expect(screen.getByLabelText(/Scanner action frames/).value).toBe('4');
await act(async () => { fireEvent.click(screen.getByText('Save binding')); });
expect(lastBindingArg().runtimeContract).toEqual({
@@ -190,7 +234,8 @@ describe('PublishWorkflow runtime contract', () => {
<MemoryRouter>
<PublishWorkflow
record={{ id: 'example-tree', publishBinding: { appId: 'app-1', atlasDestPath: 'assets/tree.png', codeBinding: null } }}
- ambient={{ set: {} }}
+ tracks={{ ambient: { definition: AMBIENT_DEFINITION, set: {} } }}
+ trackDefinitions={[AMBIENT_DEFINITION]}
atlas={ambientAtlas}
onChanged={vi.fn()}
/>
@@ -198,8 +243,8 @@ describe('PublishWorkflow runtime contract', () => {
);
fireEvent.click(screen.getByText('Match current atlas'));
- expect(screen.getByLabelText(/Walk frames/).value).toBe('');
- expect(screen.getByLabelText(/Ambient frames/).value).toBe('3');
+ expect(screen.queryByLabelText(/Walk cycle frames/)).not.toBeInTheDocument();
+ expect(screen.getByLabelText(/Ambient loop frames/).value).toBe('3');
await act(async () => { fireEvent.click(screen.getByText('Save binding')); });
expect(lastBindingArg().runtimeContract).toEqual({ ambientFrameCount: 3, cellSize: 96, columnCount: 4 });
});
@@ -207,9 +252,98 @@ describe('PublishWorkflow runtime contract', () => {
it('rejects an out-of-range walk frame count and blocks the save', () => {
renderWorkflow({ appId: 'app-1', atlasDestPath: 'assets/hero.png', codeBinding: null });
- fireEvent.change(screen.getByLabelText(/Walk frames/), { target: { value: '99' } });
+ fireEvent.change(screen.getByLabelText(/Walk cycle frames/), { target: { value: '99' } });
- expect(screen.getByText(/Walk frame count must be/)).toBeInTheDocument();
+ expect(screen.getByText(/Walk cycle frame count must be/)).toBeInTheDocument();
expect(screen.getByText('Save binding')).toBeDisabled();
});
+
+ it('renders, range-checks, fills, and saves a user-defined track from its definition', async () => {
+ const jetpackAtlas = atlasWith({
+ current: {
+ version: 3,
+ compiledAt: '2026-07-01T00:00:00.000Z',
+ atlasPath: 'runtime/v3/a.png',
+ geometry: {
+ ...GEOMETRY,
+ tracks: {
+ walk: { start: 1, count: 12, rows: 8 },
+ jetpack: { start: 13, count: 5, rows: 8 },
+ },
+ },
+ },
+ });
+ renderWorkflow(
+ { appId: 'app-1', atlasDestPath: 'assets/hero.png', codeBinding: null },
+ jetpackAtlas,
+ { trackDefinitions: [WALK_DEFINITION, JETPACK_DEFINITION] },
+ );
+
+ expect(screen.getByLabelText(/Jetpack burst frames/)).toHaveAttribute('min', '3');
+ expect(screen.getByLabelText(/Jetpack burst frames/)).toHaveAttribute('max', '7');
+ fireEvent.change(screen.getByLabelText(/Walk cycle frames/), { target: { value: '12' } });
+ fireEvent.change(screen.getByLabelText(/Jetpack burst frames/), { target: { value: '8' } });
+ expect(screen.getByText(/Jetpack burst frame count must be a whole number 3–7/)).toBeInTheDocument();
+
+ fireEvent.click(screen.getByText('Match current atlas'));
+ expect(screen.getByLabelText(/Jetpack burst frames/).value).toBe('5');
+ await act(async () => { fireEvent.click(screen.getByText('Save binding')); });
+ expect(lastBindingArg().runtimeContract).toEqual({
+ walkFrameCount: 12,
+ jetpackFrameCount: 5,
+ cellSize: 96,
+ columnCount: 13,
+ });
+ });
+
+ it('derives the required primary-track gate and mismatch summary from definitions', () => {
+ const glimmer = {
+ ...JETPACK_DEFINITION,
+ id: 'glimmer',
+ label: 'Glimmer loop',
+ contractFrameCountField: 'glimmerFrameCount',
+ standaloneContract: true,
+ };
+ const pulse = {
+ ...JETPACK_DEFINITION,
+ id: 'pulse',
+ label: 'Pulse action',
+ contractFrameCountField: 'pulseFrameCount',
+ };
+ renderWorkflow(
+ {
+ appId: 'app-1',
+ atlasDestPath: 'assets/glimmer.png',
+ codeBinding: null,
+ runtimeContract: { glimmerFrameCount: 5, pulseFrameCount: 4 },
+ },
+ atlasWith({
+ current: {
+ version: 3,
+ compiledAt: '2026-07-01T00:00:00.000Z',
+ atlasPath: 'runtime/v3/a.png',
+ geometry: {
+ columns: ['idle', 'glimmer-00', 'glimmer-01', 'glimmer-02', 'glimmer-03', 'glimmer-04'],
+ tracks: {
+ glimmer: { start: 1, count: 5, rows: 1 },
+ pulse: { start: 6, count: 3, rows: 1 },
+ },
+ cellSize: 96,
+ },
+ },
+ }),
+ {
+ walk: null,
+ tracks: {
+ glimmer: { definition: glimmer, set: {} },
+ pulse: { definition: pulse, set: {} },
+ },
+ trackDefinitions: [glimmer, pulse],
+ },
+ );
+
+ expect(screen.getByText(/contract expects 4 pulse action frames, atlas has 3/)).toBeInTheDocument();
+ fireEvent.change(screen.getByLabelText(/Glimmer loop frames/), { target: { value: '' } });
+ expect(screen.getByText(/Glimmer loop frame count is required/)).toBeInTheDocument();
+ });
});
diff --git a/client/src/pages/Sprites.jsx b/client/src/pages/Sprites.jsx
index 77ba31d182..f8b5de531d 100644
--- a/client/src/pages/Sprites.jsx
+++ b/client/src/pages/Sprites.jsx
@@ -801,6 +801,8 @@ export default function Sprites() {
key={detail.record.id}
record={detail.record}
walk={detail.walk}
+ tracks={detail.tracks}
+ trackDefinitions={detail.trackDefinitions}
atlas={detail.atlas}
onChanged={onWorkflowChanged}
/>
@@ -824,7 +826,8 @@ export default function Sprites() {
key={detail.record.id}
record={detail.record}
walk={detail.walk}
- ambient={detail.tracks?.ambient}
+ tracks={detail.tracks}
+ trackDefinitions={detail.trackDefinitions}
atlas={detail.atlas}
onChanged={onWorkflowChanged}
/>
diff --git a/server/routes/sprites.js b/server/routes/sprites.js
index f00552f003..211ac5fc3a 100644
--- a/server/routes/sprites.js
+++ b/server/routes/sprites.js
@@ -185,7 +185,12 @@ router.get('/:id', asyncHandler(async (req, res) => {
...genericTracks.map((row) => getTrackState(row.id, req.params.id)),
]);
const tracks = Object.fromEntries(genericTracks.map((row, index) => [row.id, trackStates[index]]));
- res.json({ ...detail, reference, walk, tracks, atlas });
+ // PublishWorkflow needs the COMPLETE applicable registry slice, including
+ // walk (whose bespoke state does not carry `definition`). Keep it separate
+ // from `tracks`, which remains the generic non-walk authoring-state map.
+ res.json({
+ ...detail, reference, walk, tracks, trackDefinitions: kindTracks, atlas,
+ });
}));
// The generation prompt behind one on-disk asset (record-relative `path`) —
diff --git a/server/routes/sprites.test.js b/server/routes/sprites.test.js
index 715f434401..49214b8c3f 100644
--- a/server/routes/sprites.test.js
+++ b/server/routes/sprites.test.js
@@ -457,6 +457,12 @@ describe('sprites routes', () => {
const r = await request(app).get('/api/sprites/pioneer');
expect(r.body.walk).toEqual({ runs: [], selection: null, walkSet: null });
expect(walk.getWalkState).toHaveBeenCalledWith('pioneer');
+ expect(r.body.trackDefinitions.map(({ id }) => id)).toEqual(['walk', 'scanner']);
+ expect(r.body.trackDefinitions[0]).toMatchObject({
+ id: 'walk',
+ contractFrameCountField: 'walkFrameCount',
+ standaloneContract: true,
+ });
// A character carries scanner but NOT ambient, so only scanner is keyed —
// and each state passes through with the `definition` (registry row) the
// service resolved, so the client renders the track's label/bounds from data
@@ -475,6 +481,7 @@ describe('sprites routes', () => {
// A props family has no gait, so no walk — and ambient, not scanner. The
// whole point of keying by id: neither kind needs a route-level branch.
expect(props.body.walk).toBeNull();
+ expect(props.body.trackDefinitions.map(({ id }) => id)).toEqual(['ambient']);
expect(Object.keys(props.body.tracks)).toEqual(['ambient']);
expect(props.body.tracks.ambient).toMatchObject({
track: 'ambient', definition: { id: 'ambient', directional: false },
diff --git a/server/services/sprites/atlasGrid.js b/server/services/sprites/atlasGrid.js
index fc60b08233..25b41dcfee 100644
--- a/server/services/sprites/atlasGrid.js
+++ b/server/services/sprites/atlasGrid.js
@@ -64,6 +64,8 @@
import {
ANIMATION_TRACKS, WALK_TRACK, getAnimationTrack, trackRowCount,
} from './animationTracks.js';
+// These two names describe columns found in imported/legacy compiled grids;
+// neither declares an animation track in the registry.
import { ATLAS_IDLE_COLUMN, ATLAS_SCANNER_COLUMN, walkPhaseLabels } from './walkBounds.js';
import { SPRITE_DIRECTIONS } from './prompts.js';
import { canonicalStringify } from '../../lib/objects.js';
diff --git a/server/services/sprites/atlasLayout.js b/server/services/sprites/atlasLayout.js
index d8d3a55595..0e342d55bb 100644
--- a/server/services/sprites/atlasLayout.js
+++ b/server/services/sprites/atlasLayout.js
@@ -46,6 +46,7 @@
import { basename } from 'path';
import { deriveTracks, resolveWalkFrameCount, ATLAS_DEFAULT_ROWS } from './atlasGrid.js';
+import { ANIMATION_TRACKS, WALK_TRACK } from './animationTracks.js';
// Bump only on a breaking shape change. Adding a field (or a new track) is
// additive — consumers read `tracks`/`columns` by name, not by position.
@@ -128,46 +129,35 @@ export function buildAtlasLayout({
* Callers pass describable geometry (a column list); publish.js asserts that
* once, up front, for both this and `buildAtlasLayout`.
*/
-export function runtimeContractMismatch(geometry, contract, appLabel = 'the bound app') {
+export function runtimeContractMismatch(
+ geometry,
+ contract,
+ appLabel = 'the bound app',
+ tracks = ANIMATION_TRACKS,
+) {
if (!contract) return null;
const actualColumns = geometry.columns.length;
- const actualFrames = resolveWalkFrameCount(geometry);
- const {
- walkFrameCount: expectedFrames, scannerFrameCount: expectedScannerFrames, ambientFrameCount: expectedAmbientFrames,
- columnCount: expectedColumns, cellSize: expectedCellSize,
- } = contract;
- const actualDesc = `Atlas has ${actualColumns} columns (${actualFrames} walk frames)`;
- const expectedDesc = Number.isInteger(expectedColumns)
- ? `${expectedColumns} (${expectedFrames} walk frames)`
- : `${expectedFrames} walk frames`;
- const countMismatch = (resolution) => `${actualDesc} but ${appLabel} expects ${expectedDesc}. ${resolution}`;
+ const { columnCount: expectedColumns, cellSize: expectedCellSize } = contract;
- if (Number.isInteger(expectedFrames) && expectedFrames !== actualFrames) {
- return countMismatch(
- `Update the game's walk-frame constant and its cycle distance, or reprocess this walk set to ${expectedFrames} frames before publishing.`,
- );
+ for (const definition of Object.values(tracks)) {
+ const expected = contract[definition.contractFrameCountField];
+ if (!Number.isInteger(expected)) continue;
+ const direct = geometry[definition.contractFrameCountField];
+ const spanCount = geometry.tracks?.[definition.id]?.count;
+ // Walk alone predates the per-track descriptor; preserve its imported-grid
+ // column fallback while every current/new track uses the generic two-rung
+ // field/span lookup.
+ const actual = definition.id === WALK_TRACK
+ ? resolveWalkFrameCount(geometry)
+ : (Number.isInteger(direct) ? direct : (Number.isInteger(spanCount) ? spanCount : null));
+ if (expected === actual) continue;
+ return `Atlas has ${actual ?? 'no'} ${definition.label.toLowerCase()} frame${actual === 1 ? '' : 's'} but ${appLabel} expects ${expected}. `
+ + `Approve the ${definition.label.toLowerCase()} set at that frame count, or update the app runtime contract before publishing.`;
}
if (Number.isInteger(expectedColumns) && expectedColumns !== actualColumns) {
- return countMismatch(
- `The grid shape changed — update the app's expected column layout, or re-bind its runtime contract to ${actualColumns} columns before publishing.`,
- );
- }
- const actualScannerFrames = Number.isInteger(geometry.scannerFrameCount)
- ? geometry.scannerFrameCount
- : geometry.tracks?.scanner?.count ?? null;
- if (Number.isInteger(expectedScannerFrames) && expectedScannerFrames !== actualScannerFrames) {
- const actual = Number.isInteger(actualScannerFrames) ? actualScannerFrames : 'no';
- return `Atlas has ${actual} scanner frame${actual === 1 ? '' : 's'} but ${appLabel} expects ${expectedScannerFrames}. `
- + 'Approve a scanner set at that frame count, or update the app runtime contract before publishing.';
- }
- const actualAmbientFrames = Number.isInteger(geometry.ambientFrameCount)
- ? geometry.ambientFrameCount
- : geometry.tracks?.ambient?.count ?? null;
- if (Number.isInteger(expectedAmbientFrames) && expectedAmbientFrames !== actualAmbientFrames) {
- const actual = Number.isInteger(actualAmbientFrames) ? actualAmbientFrames : 'no';
- return `Atlas has ${actual} ambient frame${actual === 1 ? '' : 's'} but ${appLabel} expects ${expectedAmbientFrames}. `
- + 'Approve an ambient loop at that frame count, or update the app runtime contract before publishing.';
+ return `Atlas has ${actualColumns} columns but ${appLabel} expects ${expectedColumns}. `
+ + `The grid shape changed — update the app's expected column layout, or re-bind its runtime contract to ${actualColumns} columns before publishing.`;
}
if (Number.isInteger(expectedCellSize) && expectedCellSize !== geometry.cellSize) {
return `Atlas cells are ${geometry.cellSize}px but ${appLabel} expects ${expectedCellSize}px. `
diff --git a/server/services/sprites/atlasLayout.test.js b/server/services/sprites/atlasLayout.test.js
index 5d671098c6..cb681848c7 100644
--- a/server/services/sprites/atlasLayout.test.js
+++ b/server/services/sprites/atlasLayout.test.js
@@ -148,19 +148,18 @@ describe('runtimeContractMismatch', () => {
expect(runtimeContractMismatch(geometryFor(8), contract)).toBeNull();
});
- it('names both counts and both resolutions on a frame-count mismatch', () => {
+ it('names the registry track and both counts on a frame-count mismatch', () => {
const message = runtimeContractMismatch(geometryFor(12), contract, 'Example App');
- expect(message).toContain('Atlas has 13 columns (12 walk frames)');
- expect(message).toContain('Example App expects 9 (8 walk frames)');
- expect(message).toMatch(/walk-frame constant/);
- expect(message).toMatch(/reprocess this walk set to 8 frames/);
+ expect(message).toContain('Atlas has 12 walk cycle frames');
+ expect(message).toContain('Example App expects 8');
+ expect(message).toMatch(/Approve the walk cycle set at that frame count/);
});
it('flags a column-count-only mismatch as a grid-shape change', () => {
// A pre-#2986 atlas (still carrying the scanner column) against a contract
// re-bound to the current 9-column grid: same walk frames, wrong shape.
const message = runtimeContractMismatch(legacyGeometryFor(8), contract, 'Example App');
- expect(message).toContain('Atlas has 10 columns (8 walk frames)');
+ expect(message).toContain('Atlas has 10 columns but Example App expects 9');
expect(message).toMatch(/grid shape changed/);
});
@@ -188,6 +187,32 @@ describe('runtimeContractMismatch', () => {
expect(layout.ambientFrameCount).toBe(3);
expect(layout.tracks.ambient).toEqual(span(1, 3, 1));
expect(runtimeContractMismatch(geometry, { ambientFrameCount: 3 })).toBeNull();
- expect(runtimeContractMismatch(geometry, { ambientFrameCount: 4 })).toMatch(/3 ambient frames.*expects 4/);
+ expect(runtimeContractMismatch(geometry, { ambientFrameCount: 4 })).toMatch(/3 ambient loop frames.*expects 4/);
+ });
+
+ it('validates a user-defined track contract through the same registry loop', () => {
+ const jetpack = {
+ jetpack: {
+ id: 'jetpack',
+ label: 'Jetpack burst',
+ contractFrameCountField: 'jetpackFrameCount',
+ },
+ };
+ const geometry = {
+ ...geometryFor(8),
+ tracks: { jetpack: span(9, 5, DIRECTIONS.length) },
+ };
+ expect(runtimeContractMismatch(
+ geometry,
+ { jetpackFrameCount: 5 },
+ 'Example App',
+ jetpack,
+ )).toBeNull();
+ expect(runtimeContractMismatch(
+ geometry,
+ { jetpackFrameCount: 7 },
+ 'Example App',
+ jetpack,
+ )).toMatch(/5 jetpack burst frames.*expects 7/);
});
});
diff --git a/server/services/sprites/publish.js b/server/services/sprites/publish.js
index 515e9bf1cd..1669b3f9e9 100644
--- a/server/services/sprites/publish.js
+++ b/server/services/sprites/publish.js
@@ -94,8 +94,8 @@ async function requireAppRepo(appId, status) {
* parses, so a non-route caller (importer, peer sync, a test) can't persist a
* contract the route would have rejected.
*
- * A walk or ambient frame count is required once a contract is present;
- * `cellSize` and `columnCount` are optional extra
+ * A registry-declared standalone track count is required once a contract is
+ * present; `cellSize` and `columnCount` are optional extra
* assertions. The fields are NOT cross-checked against each other: what counts
* as a consistent column layout is the compiler's business and changes with the
* grid (#2986 drops the scanner column), so a stale count surfaces at publish
@@ -109,13 +109,12 @@ function validateRuntimeContract(runtimeContract) {
const field = issue?.path?.length ? `runtimeContract.${issue.path.join('.')}` : 'runtimeContract';
throw bindingError(`${field}: ${issue?.message || 'invalid'}`, 'INVALID_RUNTIME_CONTRACT');
}
- const {
- walkFrameCount, scannerFrameCount, ambientFrameCount, cellSize, columnCount,
- } = parsed.data;
+ const { cellSize, columnCount, ...trackFrameCounts } = parsed.data;
return {
- ...(walkFrameCount === undefined ? {} : { walkFrameCount }),
- ...(scannerFrameCount === undefined ? {} : { scannerFrameCount }),
- ...(ambientFrameCount === undefined ? {} : { ambientFrameCount }),
+ // The schema builds these keys from the track registry. Preserve the
+ // parsed sparse map wholesale so a newly registered track round-trips
+ // without another publish-service branch.
+ ...trackFrameCounts,
cellSize: cellSize ?? null,
columnCount: columnCount ?? null,
};
diff --git a/server/services/sprites/publish.test.js b/server/services/sprites/publish.test.js
index c2117177f2..0cc7bc8ecc 100644
--- a/server/services/sprites/publish.test.js
+++ b/server/services/sprites/publish.test.js
@@ -151,10 +151,12 @@ describe('validatePublishBinding / setPublishBinding', () => {
const { id } = await characterWithAtlas();
const saved = await setPublishBinding(id, {
...BINDING,
- runtimeContract: { walkFrameCount: 8, cellSize: 96, columnCount: 9 },
+ runtimeContract: {
+ walkFrameCount: 8, scannerFrameCount: 4, cellSize: 96, columnCount: 9,
+ },
});
expect(saved.publishBinding.runtimeContract).toEqual({
- walkFrameCount: 8, cellSize: 96, columnCount: 9,
+ walkFrameCount: 8, scannerFrameCount: 4, cellSize: 96, columnCount: 9,
});
const ambient = await setPublishBinding(id, {
@@ -475,8 +477,8 @@ describe('runtime contract guard (#2982)', () => {
runtimeContract: { walkFrameCount: 8, cellSize: 96, columnCount: 9 },
});
await expect(publishAtlas(id)).rejects.toMatchObject({ status: 409, code: 'PUBLISH_CONTRACT_MISMATCH' });
- await expect(publishAtlas(id)).rejects.toThrow(/13 columns \(12 walk frames\).*expects 9 \(8 walk frames\)/s);
- await expect(publishAtlas(id)).rejects.toThrow(/reprocess this walk set to 8 frames/);
+ await expect(publishAtlas(id)).rejects.toThrow(/12 walk cycle frames.*expects 8/s);
+ await expect(publishAtlas(id)).rejects.toThrow(/Approve the walk cycle set at that frame count/);
// Nothing landed in the game repo — not the atlas, not the sidecar.
expect(await readFile(join(APP_REPO, BINDING.atlasDestPath)).catch(() => null)).toBeNull();
expect(await readFile(join(APP_REPO, sidecarPath(BINDING.atlasDestPath))).catch(() => null)).toBeNull();
diff --git a/server/services/sprites/walkBounds.js b/server/services/sprites/walkBounds.js
index 07f7c37580..2406373232 100644
--- a/server/services/sprites/walkBounds.js
+++ b/server/services/sprites/walkBounds.js
@@ -35,7 +35,12 @@ export const WALK_PHASES = [
// Legacy default / fallback frame count for manifests (or clients) that omit it.
export const WALK_FRAME_COUNT = 8;
-// The non-walk columns of the runtime atlas grid, named once so the compiler
+// Legacy compiled-grid column names, kept so readers can describe imported and
+// pre-#2986 atlases. They are grid vocabulary, not animation-track definitions:
+// the current compiler emits neither an idle track row nor a scanner track from
+// these constants.
+//
+// Named once so the compiler
// that WRITES them (atlas.js `atlasColumns`) and the layout sidecar that
// DESCRIBES them (atlasLayout.js) can never disagree on a column's identity —
// the same reason walkPhaseLabels lives here. `scanner` is READ-ONLY now: the