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

Test which lanes send a scene's end frame

Claude5c56a74d1ec3
diff --git a/server/lib/musicVideoEndFrame.test.js b/server/lib/musicVideoEndFrame.test.js
new file mode 100644
index 0000000000..1a98e287ba
--- /dev/null
+++ b/server/lib/musicVideoEndFrame.test.js
@@ -0,0 +1,30 @@
+import { describe, expect, it } from 'vitest';
+import { sceneEndFramePlan, sceneEndFrameRequestFields } from './musicVideoEndFrame.js';
+
+// The board's note and the production dispatcher both read this plan, so each
+// lane that ignores an end frame must say so, and only an end-image fal model sends it.
+describe('sceneEndFramePlan (#11173)', () => {
+ const scene = { sceneId: 's1', endImageId: 'end.png' };
+ const kling = { backend: 'fal', falModelId: 'fal-ai/kling-video/v3/pro/image-to-video' };
+
+ it.each([
+ ['a performance shot', { ...scene, shotMode: 'performance' }, kling],
+ ['a song-driven clip', scene, { ...kling, mode: 'a2v' }],
+ ['a non-fal renderer', scene, { backend: 'local' }],
+ ['a fal model with no end image', scene, { backend: 'fal', falModelId: 'fal-ai/veo3.1/fast/image-to-video' }],
+ ])('ignores the end frame for %s and says why', (_label, s, options) => {
+ const plan = sceneEndFramePlan(s, options);
+ expect(plan).toMatchObject({ endImageId: 'end.png', used: false });
+ expect(plan.reason).toEqual(expect.any(String));
+ expect(sceneEndFrameRequestFields(s, options)).toEqual({});
+ });
+
+ it('sends it to an end-image fal model, including the default when none is named', () => {
+ expect(sceneEndFrameRequestFields(scene, kling)).toEqual({ lastImageFile: 'end.png' });
+ expect(sceneEndFramePlan(scene, { backend: 'fal' })).toEqual({ endImageId: 'end.png', used: true, reason: null });
+ });
+
+ it('reports nothing for a scene without an end frame', () => {
+ expect(sceneEndFramePlan({ sceneId: 's1', endImageId: ' ' }, kling)).toEqual({ endImageId: null, used: false, reason: null });
+ });
+});