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

Support independent footage forks of editable music videos (#9616)

[._.]/83904a061b5b
diff --git a/.claude/skills/portos-music-video-code/SKILL.md b/.claude/skills/portos-music-video-code/SKILL.md
index bc2e66f7fb..ab13998f6f 100644
--- a/.claude/skills/portos-music-video-code/SKILL.md
+++ b/.claude/skills/portos-music-video-code/SKILL.md
@@ -14,3 +14,12 @@ Author each `function render(ctx, env)` as a deterministic drawing function of s
The host draws selected stills and clips according to each scene's explicit visual layer, then invokes the section function. Add restrained graphics over those assets; for a card scene, draw the entire background. The host resolves only selected project assets and seeks video asynchronously using the chosen performance in/out edit. Do not use network requests, remote URLs, arbitrary paths, dynamic imports, clocks, entropy, or DOM loading in section code. PortOS stages local assets through `window.PORTOS_MV`, owns the sandbox, and renders previews, excerpts and final output from the same song clock.
Manual ZIP/folder documents and code-only videos have separate controls. The mixed-media action does not alter them until the generated candidate is accepted.
+
+
+## Revisions and footage variants
+
+Use **Fork vN** before revising a finished code video when the original must stay independently editable. For manual composition documents, **Export ZIP**, edit the HTML/JS locally, then import the revised ZIP/folder into the fork. Imports write immutable versions; unreferenced versions may be pruned, so fork before replacing a document you want to keep. Code-only sections also remain editable through the composition API and the section regeneration action.
+
+Use **Fork for video generation** to adapt a code or document video into footage. It preserves song, analysis, timed lyrics, storyboard, parent/root lineage and immutable document/development artifact references. It starts in Composed mode with footage scenes, a fresh Cast & Sets stage and no selected mood board, reference images or video takes. Source publishing outputs and active runs are not carried into the fork. The source project is unchanged and forking calls no providers.
+
+In the new project, choose the new mood board, prepare its photographic cast and set sheets, review the retained storyboard and prompts for the new medium, and select the image/video services and generation budget before starting production. Old sheets remain development references, not approval of the new cast. The original code document stays available for export or switching back to Document mode; retain the source project as the code version.
diff --git a/client/src/pages/MusicVideo.jsx b/client/src/pages/MusicVideo.jsx
index f82f37b874..4da14dc84f 100644
--- a/client/src/pages/MusicVideo.jsx
+++ b/client/src/pages/MusicVideo.jsx
@@ -337,10 +337,10 @@ export default function MusicVideo() {
.catch((err) => toast.error(err?.message || 'Failed to delete project'));
};
- const handleClone = () => {
+ const handleClone = (options = {}) => {
if (!selected || cloning) return;
setCloning(true);
- cloneMusicVideoProject(selected.id, {}, { silent: true })
+ cloneMusicVideoProject(selected.id, options, { silent: true })
.then((project) => {
setProjects((prev) => [...prev, project]);
navigate(`/music-video/${project.id}`);
@@ -949,16 +949,25 @@ export default function MusicVideo() {
</span>
)}
{selected && (
- <span className="flex items-center gap-1">
+ <span className="flex flex-wrap items-center gap-1">
<button
type="button"
- onClick={handleClone}
+ onClick={() => handleClone()}
disabled={cloning}
title={`Create an editable v${(selected.version || 1) + 1}; keep scene media attached and clear the final render`}
className="flex min-h-[44px] min-w-[44px] items-center justify-center gap-1 rounded border border-port-border bg-port-bg px-2 py-1.5 text-sm disabled:opacity-50 sm:min-h-0 sm:min-w-0"
>
<Copy size={15} aria-hidden="true" /> <span className="max-sm:sr-only">{cloning ? 'Forking…' : `Fork v${(selected.version || 1) + 1}`}</span>
</button>
+ <button
+ type="button"
+ onClick={() => handleClone({ variant: 'video-generation' })}
+ disabled={cloning}
+ title="Keep the song and storyboard; start fresh cast, sets and mood board with footage rendering. No generation starts."
+ className="min-h-[44px] rounded border border-port-border bg-port-bg px-2 py-1.5 text-sm disabled:opacity-50 sm:min-h-0"
+ >
+ Fork for video generation
+ </button>
{isConfirmingDelete(selected.id) ? (
<ConfirmButtonPair
prompt="Delete?"
diff --git a/client/src/pages/MusicVideo.test.jsx b/client/src/pages/MusicVideo.test.jsx
index 559e520b89..2234bc1b89 100644
--- a/client/src/pages/MusicVideo.test.jsx
+++ b/client/src/pages/MusicVideo.test.jsx
@@ -993,6 +993,16 @@ describe('MusicVideo restricted-model license gate', () => {
});
describe('MusicVideo project versions', () => {
+ it('forks for video generation without rendering or modifying the source', async () => {
+ cloneMusicVideoProject.mockResolvedValue({ ...PROJECT_WITH_CLIP, id: 'mv-footage', name: 'Footage Variant', version: 2, composition: { mode: 'composed' } });
+ await openProject({ ...PROJECT_WITH_CLIP, composition: { mode: 'document' } });
+ fireEvent.click(await screen.findByRole('button', { name: 'Fork for video generation' }));
+ await waitFor(() => expect(cloneMusicVideoProject).toHaveBeenCalledWith('mv-1', { variant: 'video-generation' }, { silent: true }));
+ await screen.findByRole('heading', { level: 2, name: 'Footage Variant' });
+ expect(renderMusicVideoProject).not.toHaveBeenCalled();
+ expect(updateMusicVideoProject).not.toHaveBeenCalled();
+ });
+
it('forks the open project and navigates to the editable next version', async () => {
cloneMusicVideoProject.mockResolvedValue({
...PROJECT_WITH_CLIP,
diff --git a/server/lib/musicVideoValidation.js b/server/lib/musicVideoValidation.js
index 87b9affa35..0fe935ba78 100644
--- a/server/lib/musicVideoValidation.js
+++ b/server/lib/musicVideoValidation.js
@@ -960,10 +960,12 @@ export const musicVideoProjectUpdateSchema = z.object({
// Fork a project into its next editable version. The server derives lineage and
// version numbers from the source; callers may only override the display name
-// and choose whether generated scene media should remain attached.
+// and choose whether generated scene media should remain attached. A video
+// variant always clears selected media and starts independent creative setup.
export const musicVideoProjectCloneSchema = z.object({
name: z.string().min(1).max(200).optional(),
includeGeneratedMedia: z.boolean().optional(),
+ variant: z.enum(['revision', 'video-generation']).optional(),
}).strict();
// A scene on the director board. `startSec`/`endSec` place it on the timeline;
diff --git a/server/routes/musicVideo.test.js b/server/routes/musicVideo.test.js
index e0c5468492..27760e9026 100644
--- a/server/routes/musicVideo.test.js
+++ b/server/routes/musicVideo.test.js
@@ -13,8 +13,8 @@ vi.mock('../services/musicVideo/projects.js', () => ({
updateProject: vi.fn(async (id, p) => ({ id, ...p })),
deleteProject: vi.fn(async () => ({ ok: true })),
setProjectAnalysis: vi.fn(async (id, analysis) => ({ id, audioAnalysis: analysis, status: 'analyzed' })),
- addProjectScene: vi.fn(async (id, s) => ({ sceneId: 'mvs-1', order: 0, ...s })),
- updateScene: vi.fn(async (id, sceneId, p) => ({ sceneId, ...p })),
+ addProjectScene: vi.fn(async (_id, s) => ({ sceneId: 'mvs-1', order: 0, ...s })),
+ updateScene: vi.fn(async (_id, sceneId, p) => ({ sceneId, ...p })),
deleteScene: vi.fn(async (id) => ({ id, scenes: [] })),
reorderProjectScenes: vi.fn(async (id, ids) => ({ id, scenes: ids.map((sceneId, order) => ({ sceneId, order })) })),
// Scene split (#8977) — exercised against the real store in musicVideoSceneSplit.test.js.
@@ -58,8 +58,8 @@ vi.mock('../services/musicVideo/excerptRender.js', () => ({
}));
vi.mock('../services/musicVideo/excerptService.js', () => ({
deleteExcerpt: vi.fn(async (id) => ({ id })),
- addReviewNote: vi.fn(async (id, excerptId, input) => ({ project: { id }, note: { id: 'mvn-1', ...input } })),
- editReviewNote: vi.fn(async (id, excerptId, noteId, patch) => ({ project: { id }, note: { id: noteId, ...patch } })),
+ addReviewNote: vi.fn(async (id, _excerptId, input) => ({ project: { id }, note: { id: 'mvn-1', ...input } })),
+ editReviewNote: vi.fn(async (id, _excerptId, noteId, patch) => ({ project: { id }, note: { id: noteId, ...patch } })),
deleteReviewNote: vi.fn(async (id) => ({ id })),
}));
@@ -158,6 +158,12 @@ describe('musicVideo routes', () => {
});
});
+ it('POST /:id/clone accepts an explicit video-generation variant', async () => {
+ const r = await request(app).post('/api/music-video/mv-1/clone').send({ variant: 'video-generation' });
+ expect(r.status).toBe(201);
+ expect(svc.cloneProject).toHaveBeenCalledWith('mv-1', { variant: 'video-generation' });
+ });
+
it('POST /:id/clone rejects unsupported options', async () => {
const r = await request(app).post('/api/music-video/mv-1/clone').send({ copyFinalRender: true });
expect(r.status).toBe(400);
diff --git a/server/routes/musicVideoCompositionDocument.test.js b/server/routes/musicVideoCompositionDocument.test.js
index 9449afd486..eb5c53ed34 100644
--- a/server/routes/musicVideoCompositionDocument.test.js
+++ b/server/routes/musicVideoCompositionDocument.test.js
@@ -7,9 +7,9 @@
import { describe, it, expect, vi, beforeEach, afterAll } from 'vitest';
import express from 'express';
-import { existsSync, readdirSync, rmSync } from 'fs';
-import { mkdir, symlink, writeFile } from 'fs/promises';
-import { join } from 'path';
+import { existsSync, readdirSync, rmSync } from 'node:fs';
+import { mkdir, symlink, writeFile } from 'node:fs/promises';
+import { join } from 'node:path';
import { request } from '../lib/testHelper.js';
import { errorMiddleware } from '../lib/errorHandler.js';
import { createZip } from '../lib/zipWriter.js';
@@ -76,6 +76,27 @@ beforeEach(async () => {
afterAll(cleanupTempDataRoots);
describe('music-video composition documents', () => {
+ it('preserves source document bytes when a fork imports revised code, including after source removal', async () => {
+ const zip = (files) => createZip(Object.entries(files).map(([name, data]) => ({ name, data })));
+ const imported = await uploadZip(project.id, zip(FILES));
+ expect(imported.status).toBe(201);
+ const fork = await request(app).post(`/api/music-video/${project.id}/clone`).send({});
+ expect(fork.status).toBe(201);
+ const footage = await request(app).post(`/api/music-video/${project.id}/clone`).send({ variant: 'video-generation' });
+ expect(footage.status).toBe(201);
+ const revised = await uploadZip(fork.body.id, zip({ ...FILES, 'app.js': `${FILES['app.js']}\n// revised drawing` }));
+ expect(revised.status).toBe(201);
+ expect(revised.body.document.directory).not.toBe(imported.body.document.directory);
+ const sourceFile = await request(app).get(`/api/music-video/${project.id}/composition/document/file?path=app.js`);
+ expect(sourceFile.text).toBe(FILES['app.js']);
+ await request(app).delete(`/api/music-video/${project.id}/composition/document`);
+ // The footage variant still owns the immutable original pointer, so GC
+ // must retain its bytes even though it currently renders in composed mode.
+ const retained = await request(app).get(`/api/music-video/${footage.body.id}/composition/document/file?path=app.js`);
+ expect(retained.status).toBe(200);
+ expect(retained.text).toBe(FILES['app.js']);
+ });
+
it('persists validated narrative events and gain caps through the project route, and clears anchors on a song replacement', async () => {
const event = { id: 'counter', name: 'Count rises', kind: 'counter-change', anchor: { kind: 'time', atSec: 0.51 }, durationSec: 1,
narrativeFunction: 'Show progress', mediumRationale: 'Exact code counter', fromValue: 3, toValue: 8 };
@@ -131,8 +152,8 @@ describe('music-video composition documents', () => {
expect(file.text).toBe(FILES['app.js']);
expect(file.headers['content-security-policy']).toMatch(/^sandbox;/);
expect(file.headers['x-content-type-options']).toBe('nosniff');
- const escape = await request(app).get(`/api/music-video/${project.id}/composition/document/file?path=${encodeURIComponent('../../../music-video-projects.json')}`);
- expect(escape.status).toBe(400);
+ const traversal = await request(app).get(`/api/music-video/${project.id}/composition/document/file?path=${encodeURIComponent('../../../music-video-projects.json')}`);
+ expect(traversal.status).toBe(400);
});
it('refuses a zip member that climbs out of the document and writes nothing', async () => {
diff --git a/server/services/musicVideo/projectsFile.test.js b/server/services/musicVideo/projectsFile.test.js
index 43dfde9a6a..51d907a8dd 100644
--- a/server/services/musicVideo/projectsFile.test.js
+++ b/server/services/musicVideo/projectsFile.test.js
@@ -9,9 +9,9 @@ import { plateRequirements, selectedPlatePasses } from '../../lib/musicVideoPlat
*/
import { describe, it, expect, vi, beforeEach, afterAll } from 'vitest';
-import { mkdtempSync, rmSync } from 'fs';
-import { tmpdir } from 'os';
-import { join } from 'path';
+import { mkdtempSync, rmSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { join } from 'node:path';
const TEST_DATA_ROOT = mkdtempSync(join(tmpdir(), 'mv-projects-file-test-'));
const writeCounter = vi.hoisted(() => ({ project: 0, baseHash: 0 }));
@@ -342,3 +342,71 @@ it('roundtrips asset-bound plate evidence through the real serialized project st
expect(selectedPlatePasses(changed.scenes[0], 'run-example')).toBe(false);
expect(changed.scenes[0].takes.find((take) => take.assetId === 'example.png').plateEvidence.verdict).toBe('pass');
});
+
+describe('editable code revisions and footage variants', () => {
+ it('keeps scene-based code addressable in a revision and isolates subsequent edits', async () => {
+ const { prepareCodeRender } = await import('./codeRender.js');
+ const source = await file.createProject({ name: 'Example Animation', trackId: 'example-track' });
+ const scene = await file.addProjectScene(source.id, { startSec: 0, endSec: 4 });
+ const originalSource = 'function render(ctx) { ctx.fillRect(0, 0, 10, 10); }';
+ await file.updateProject(source.id, { composition: { mode: 'code',
+ codeVideo: { sections: [{ id: scene.sceneId, source: originalSource }] },
+ reactiveSections: [{ sectionId: scene.sceneId, gain: 0.2, maxGain: 0.3 }],
+ } });
+ const original = await file.getProject(source.id);
+ const revision = await file.cloneProject(source.id);
+ const sectionId = revision.scenes[0].sceneId;
+ expect(sectionId).not.toBe(scene.sceneId);
+ expect(prepareCodeRender(revision).song.sections[0].id).toBe(sectionId);
+ expect(revision.composition.codeVideo.sections).toEqual([{ id: sectionId, source: originalSource }]);
+ expect(revision.composition.reactiveSections[0].sectionId).toBe(sectionId);
+ await file.updateProject(revision.id, { composition: { ...revision.composition,
+ codeVideo: { sections: [{ id: sectionId, source: 'function render(ctx) { ctx.fillRect(0, 0, 20, 20); }' }] },
+ } });
+ expect((await file.getProject(revision.id)).composition.codeVideo).not.toEqual(original.composition.codeVideo);
+ expect(await file.getProject(source.id)).toEqual(original);
+ });
+
+ it('forks a document into independent photographic production with song, storyboard and immutable assets', async () => {
+ const { castAndSetsMedium } = await import('./castAndSetsDirection.js');
+ const { startProductionOnProject, nextProductionStep } = await import('./production.js');
+ const source = await file.createProject({ name: 'Example Film', trackId: 'example-track',
+ concept: { prompt: 'A journey home', subjects: [{ kind: 'character', name: 'Paper protagonist' }], moodBoardStyle: 'Paper world' },
+ visualSpec: { moodBoardId: 'board-original', references: [{ imageId: 'original.png', role: 'character' }] },
+ composition: { mode: 'document' }, productionPolicy: { strategy: 'code-first' },
+ automation: { tools: ['code:render'], moodBoardId: 'board-original' },
+ lyricCues: [{ text: 'Example lyric', startSec: 0, endSec: 4 }],
+ });
+ await file.setProjectAnalysis(source.id, { durationSec: 4, bpm: 120, beats: [0, 0.5], downbeats: [0], sections: [{ label: 'Verse', startSec: 0, endSec: 4 }] });
+ const scene = await file.addProjectScene(source.id, { startSec: 0, endSec: 4, visualLayer: 'card', prompt: 'Journey home' });
+ await file.updateScene(source.id, scene.sceneId, { referenceImageId: 'source.png', videoHistoryId: 'source-video' });
+ await file.mutateProjectRecord(source.id, (project) => ({ project: { ...project,
+ composition: { ...project.composition, document: { directory: `music-video/${source.id}/composition/example-version`, entry: 'index.html' } },
+ castAndSets: { status: 'approved', direction: { medium: 'procedural' } },
+ publishKit: { master: { filename: 'source-final.mp4' }, posts: { youtube: { url: 'https://example.com/source' } } },
+ devArtifacts: [{ id: 'sheet-original', kind: 'cast-sets', file: 'music-video/example/dev/sheet/v1.html', versions: [{ version: 1 }] }],
+ treatment: { revision: 1, appliedRevision: 1, shotDirections: [{ sceneId: scene.sceneId, route: 'code-2d', medium: 'procedural', focalSubject: 'Traveler' }], proofs: [] },
+ } }));
+ const original = await file.getProject(source.id);
+ const fork = await file.cloneProject(source.id, { variant: 'video-generation', includeGeneratedMedia: true });
+ expect(fork).toMatchObject({ parentProjectId: source.id, rootProjectId: source.id,
+ trackId: original.trackId, audioAnalysis: original.audioAnalysis, lyricCues: original.lyricCues,
+ composition: { mode: 'composed', document: original.composition.document },
+ devArtifacts: original.devArtifacts, castAndSets: null, publishKit: null,
+ productionPolicy: { strategy: 'legacy', maxGeneratedVideoPercent: 100 },
+ visualSpec: { references: [], moodBoardId: null },
+ concept: { prompt: 'A journey home', subjects: [], moodBoardStyle: '' },
+ });
+ expect(fork.scenes[0]).toMatchObject({ startSec: 0, endSec: 4, visualLayer: 'footage', referenceImageId: null, videoHistoryId: null, takes: [] });
+ expect(fork.treatment.shotDirections[0]).toMatchObject({ sceneId: fork.scenes[0].sceneId, route: 'generated', medium: 'generated-footage', focalSubject: 'Traveler' });
+ expect(fork.treatment.appliedRevision).toBeNull();
+ expect(castAndSetsMedium(fork)).toBe('photographic');
+ // Planning is pure: no queue or provider is used by this test.
+ const started = startProductionOnProject(fork, { pool: [{ kind: 'image', mode: 'local' }, { kind: 'video', mode: 'local' }], processId: 'test-process', limits: { maxGenerations: 10, maxReviewAttempts: 1 } });
+ expect(nextProductionStep(started.project, started.run, { processId: 'test-process' }).type).toBe('plan-pilots');
+ await file.updateProject(fork.id, { visualSpec: { moodBoardId: 'board-variant' } });
+ await file.mutateProjectRecord(fork.id, (project) => ({ project: { ...project, castAndSets: { status: 'review', direction: { protagonist: { name: 'New cast' } } } } }));
+ expect((await file.getProject(fork.id)).visualSpec.moodBoardId).toBe('board-variant');
+ expect(await file.getProject(source.id)).toEqual(original);
+ });
+});
diff --git a/server/services/musicVideo/projectsLogic.js b/server/services/musicVideo/projectsLogic.js
index 18e553c4a1..ecd6a4f4eb 100644
--- a/server/services/musicVideo/projectsLogic.js
+++ b/server/services/musicVideo/projectsLogic.js
@@ -15,7 +15,7 @@
*/
import { remapMusicVideoDependencies, retainMusicVideoDependencies } from '../../lib/musicVideoDependencies.js';
-import { randomUUID } from 'crypto';
+import { randomUUID } from 'node:crypto';
import { normalizeMusicVideoProductionPolicy } from '../../lib/musicVideoMediumPlan.js';
import { ServerError } from '../../lib/errorHandler.js';
import {
@@ -30,7 +30,6 @@ import { compareNewerWins } from '../../lib/lwwTimestamp.js';
import { stripMusicVideoLocalRenderPins } from '../../lib/syncWire.js';
import { persistedRenderPinFields } from '../../lib/renderTargets.js';
import { sanitizeProjectForSync } from '../../lib/projectStoreKit.js';
-import { isStr } from '../../lib/textUtils.js';
import { isPerformanceScene, planShotSplit, shotSplitLimit } from '../../lib/musicVideoShotTiming.js';
import { normalizeLyricCues, normalizePhrases, invalidateTimedText } from './timedText.js';
import { normalizeLyricMarkers } from './lyricMarkers.js';
@@ -183,7 +182,12 @@ export function cloneProjectRecord(source, {
now,
name,
includeGeneratedMedia = true,
+ variant = 'revision',
}) {
+ // Record metadata is independently editable; only immutable asset bytes are shared.
+ source = structuredClone(source);
+ const videoVariant = variant === 'video-generation';
+ if (videoVariant) includeGeneratedMedia = false;
const nameMatch = typeof source.name === 'string' ? source.name.match(/^(.*?)(?:\s+v(\d+))?$/i) : null;
const inferredVersion = Number(nameMatch?.[2]) || 1;
const sourceVersion = Number.isInteger(source.version) && source.version > 0
@@ -209,7 +213,7 @@ export function cloneProjectRecord(source, {
&& scenes.length > 0
&& scenes.every((scene) => scene.referenceImageId && scene.videoHistoryId);
- return {
+ const clone = {
...source,
id,
name: name?.trim() || `${baseName} v${version}`,
@@ -220,11 +224,17 @@ export function cloneProjectRecord(source, {
createdAt: now,
updatedAt: now,
scenes,
- ...(source.composition?.grade ? { composition: {
+ ...(source.composition ? { composition: {
...source.composition,
- grade: { ...source.composition.grade, sections: (source.composition.grade.sections || []).map((section) => ({
+ ...(source.composition.codeVideo ? { codeVideo: { ...source.composition.codeVideo,
+ sections: source.composition.codeVideo.sections.map((section) => ({ ...section, id: sceneIdMap.get(section.id) ?? section.id })),
+ } } : {}),
+ ...(source.composition.reactiveSections ? { reactiveSections: source.composition.reactiveSections.map((section) => ({
+ ...section, sectionId: sceneIdMap.get(section.sectionId) ?? section.sectionId,
+ })) } : {}),
+ ...(source.composition.grade ? { grade: { ...source.composition.grade, sections: (source.composition.grade.sections || []).map((section) => ({
...section, sceneId: sceneIdMap.get(section.sceneId) ?? section.sceneId,
- })) },
+ })) } } : {}),
} } : {}),
// #8980 — the treatment's shot directions and proofs follow the scenes to
// their new ids; proof evidence the clone can't back is dropped.
@@ -262,12 +272,36 @@ export function cloneProjectRecord(source, {
...(source.castAndSets ? { castAndSets: { ...source.castAndSets, processId: null, productionRunId: null } } : {}),
renderHistoryId: null,
renderDependencies: null,
+ // Publishing outputs and posted URLs belong to the source final render.
+ ...(source.publishKit ? { publishKit: null } : {}),
// #9010: the source's in-flight render mark is not the clone's.
renderingOn: null,
renderPartialFilename: null,
deleted: false,
deletedAt: null,
};
+ if (!videoVariant) return clone;
+ // A footage adaptation starts with the same song and storyboard, but no
+ // procedural approvals, selected takes or running work. Nothing is dispatched.
+ const footageDirection = (direction) => ({ ...direction, route: 'generated',
+ medium: 'generated-footage', mediumPinned: false, mediumRationale: '' });
+ return {
+ ...clone,
+ composition: { ...clone.composition, mode: 'composed' },
+ productionPolicy: normalizeMusicVideoProductionPolicy({ strategy: 'legacy' }),
+ castAndSets: null,
+ visualSpec: clone.visualSpec ? { ...clone.visualSpec, references: [], moodBoardId: null } : null,
+ concept: clone.concept ? { ...clone.concept, subjects: [], moodBoardStyle: '' } : null,
+ styleReferences: [],
+ ...(clone.automation ? { automation: { ...clone.automation, tools: [], moodBoardId: null } } : {}),
+ scenes: clone.scenes.map((scene) => ({ ...scene, visualLayer: 'footage',
+ ...(scene.direction ? { direction: footageDirection(scene.direction) } : {}),
+ })),
+ treatment: clone.treatment ? { ...clone.treatment, appliedRevision: null, basis: null,
+ shotDirections: clone.treatment.shotDirections.map(footageDirection),
+ } : null,
+ excerpts: [],
+ };
}
/** Merge a project metadata patch, validating status. Returns the next record. */