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

address review (claude): gate redraw synthesis on approved, quote the url() token, pin both halves of the loop contract

[._.]/ Adam Eivy6b76b6acd1ae
diff --git a/client/src/components/sprites/WalkWorkflow.jsx b/client/src/components/sprites/WalkWorkflow.jsx
index 6bcb4c2491..af60e538f6 100644
--- a/client/src/components/sprites/WalkWorkflow.jsx
+++ b/client/src/components/sprites/WalkWorkflow.jsx
@@ -55,7 +55,9 @@ function StripLoop({ recordId, stripPreview }) {
style={{
width: CELL_PX,
height,
- backgroundImage: `url(${spriteAssetUrl(recordId, stripPreview.stripPath)})`,
+ // Quoted: encodeURIComponent leaves `(`/`)` intact, and an externally
+ // authored redraw filename containing one would end the url() token early.
+ backgroundImage: `url("${spriteAssetUrl(recordId, stripPreview.stripPath)}")`,
backgroundSize: `${scrub}px ${height}px`,
imageRendering: 'pixelated',
'--sprite-walk-loop-end': `-${scrub}px`,
@@ -76,6 +78,9 @@ function TrimPanel({ recordId, run, onClose }) {
return Array.from({ length: frameCount }, (_, i) => i);
}, [run?.stripPreview]);
const [enabled, setEnabled] = useState(() => new Set(columns));
+ // Re-seed when the strip changes under a mounted panel — a stale `enabled`
+ // holding out-of-range indices 400s the trim endpoint.
+ useEffect(() => setEnabled(new Set(columns)), [columns]);
const [result, setResult] = useState(null);
const toggle = (i) => setEnabled((prev) => {
const next = new Set(prev);
diff --git a/client/src/components/sprites/WalkWorkflow.test.jsx b/client/src/components/sprites/WalkWorkflow.test.jsx
index b3b6748c2e..25d516c7e5 100644
--- a/client/src/components/sprites/WalkWorkflow.test.jsx
+++ b/client/src/components/sprites/WalkWorkflow.test.jsx
@@ -64,6 +64,10 @@ describe('WalkWorkflow loop preview', () => {
expect(loop.style.animation).toContain('1.000s');
expect(loop.style.backgroundSize).toBe(`${CELL_PX * 12}px ${CELL_PX}px`);
expect(loop.style.getPropertyValue('--sprite-walk-loop-end')).toBe(`-${CELL_PX * 12}px`);
+ // The custom property and the @keyframes rule are two halves of one
+ // mechanism — pinning only the property would let the keyframe revert to
+ // its pre-fix hardcoded -768px scrub with the suite still green.
+ expect(document.querySelector('style').textContent).toContain('var(--sprite-walk-loop-end)');
expect(loop.style.backgroundImage).toContain('/data/sprites/example-walker/imagegen/v19/strip-video-12-clean-alpha.png');
});
diff --git a/server/services/sprites/walk.js b/server/services/sprites/walk.js
index 2526d45a2d..e8780ee448 100644
--- a/server/services/sprites/walk.js
+++ b/server/services/sprites/walk.js
@@ -205,7 +205,11 @@ export async function getWalkState(recordId) {
const scannedRunIds = new Set(runs.map((run) => run.id));
const redrawRuns = (await Promise.all(
Object.entries(approvedDirections)
- .filter(([, entry]) => entry?.runId && entry?.runManifest && !scannedRunIds.has(entry.runId))
+ // Gate on `approved` because loadRedrawRun stamps that status
+ // unconditionally — a rejected/pending entry must not surface as an
+ // approved run next to live Generate/Approve buttons.
+ .filter(([, entry]) => entry?.status === 'approved' && entry.runId && entry.runManifest
+ && !scannedRunIds.has(entry.runId))
.map(([direction, entry]) => loadRedrawRun(recordId, direction, entry)),
)).filter(Boolean);
diff --git a/server/services/sprites/walk.test.js b/server/services/sprites/walk.test.js
index f33bc92144..b4608d2e04 100644
--- a/server/services/sprites/walk.test.js
+++ b/server/services/sprites/walk.test.js
@@ -482,6 +482,30 @@ describe('getWalkState', () => {
startColumn: 0,
},
});
+ // toMatchObject asserts presence, not absence: pin that the redraw
+ // manifest does NOT land on postprocessManifest, which approve/trim
+ // resolve as a packaged grok manifest (frames[] + alignment).
+ expect(runs[0].postprocessManifest).toBeUndefined();
+ });
+
+ it('ignores a traversal-shaped runManifest', async () => {
+ const id = newId();
+ await characterWithRedrawEast(id);
+ const selectionAbs = join(TEST_ROOT, 'sprites', id, 'walk', `${id}-walk-selection-v1.json`);
+ const selection = JSON.parse(await readFile(selectionAbs, 'utf8'));
+ selection.directions.east.runManifest = '../../../etc/passwd.json';
+ await writeFile(selectionAbs, JSON.stringify(selection));
+ expect((await getWalkState(id)).runs).toEqual([]);
+ });
+
+ it('ignores an entry whose direction was not approved', async () => {
+ const id = newId();
+ await characterWithRedrawEast(id);
+ const selectionAbs = join(TEST_ROOT, 'sprites', id, 'walk', `${id}-walk-selection-v1.json`);
+ const selection = JSON.parse(await readFile(selectionAbs, 'utf8'));
+ selection.directions.east.status = 'rejected';
+ await writeFile(selectionAbs, JSON.stringify(selection));
+ expect((await getWalkState(id)).runs).toEqual([]);
});
it('falls back to the keyed strip when the clean-alpha derivative is absent on disk', async () => {