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

fix: match handoff file tags for short scene ids (#8965)

[._.]/ Adam Eivyf60ea65abeb5
diff --git a/server/routes/musicVideoTakes.test.js b/server/routes/musicVideoTakes.test.js
index 5876758b1b..d96a418fd5 100644
--- a/server/routes/musicVideoTakes.test.js
+++ b/server/routes/musicVideoTakes.test.js
@@ -186,4 +186,21 @@ describe('external-asset handoff', () => {
});
expect(a.referenceImageId).toBe('upload-0001.png');
});
+
+ it('round-trips a short hand-authored scene id through its file tag', async () => {
+ const raw = await reload();
+ await projects.mergeProjectsFromSync([{
+ ...raw,
+ updatedAt: new Date(Date.now() + 1000).toISOString(),
+ scenes: [{ ...raw.scenes[0], sceneId: 'intro' }],
+ }]);
+ const { body: manifest } = await request(app).get(`${base()}/handoff`);
+ expect(manifest.scenes[0].fileTag).toBe('S01-intro');
+ seedImage('upload-short.png');
+ const imported = await request(app).post(`${base()}/handoff/import`).send({
+ provider: 'external',
+ items: [{ kind: 'image', assetId: 'upload-short.png', originalName: 'S01-intro final.png' }],
+ });
+ expect(imported.body.imported.map((i) => i.sceneId)).toEqual(['intro']);
+ });
});
diff --git a/server/services/musicVideo/handoff.js b/server/services/musicVideo/handoff.js
index 20bbd7334f..aea69699f6 100644
--- a/server/services/musicVideo/handoff.js
+++ b/server/services/musicVideo/handoff.js
@@ -30,7 +30,9 @@ function sceneFileTag(scene, index) {
return `S${String(index + 1).padStart(2, '0')}-${sceneShortId(scene.sceneId)}`;
}
-const FILE_TAG_RE = /(?:^|[^a-z0-9])s\d{1,3}[-_]([a-z0-9]{8})(?![a-z0-9])/gi;
+// Up to eight id characters: a normal `mvs-<uuid>` scene yields exactly eight,
+// but a short hand-authored id yields fewer and must still round-trip.
+const FILE_TAG_RE = /(?:^|[^a-z0-9])s\d{1,3}[-_]([a-z0-9]{1,8})(?![a-z0-9])/gi;
/**
* Resolve an imported file's original name to the scene whose tag it carries.