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: make the animated proof the last step of Compose so stages never go backwards (#10140)

Adam Eivy7d885dca363f
diff --git a/client/src/components/musicVideo/ProductionReviewPanel.jsx b/client/src/components/musicVideo/ProductionReviewPanel.jsx
index 7285363b93..ece9ec0eeb 100644
--- a/client/src/components/musicVideo/ProductionReviewPanel.jsx
+++ b/client/src/components/musicVideo/ProductionReviewPanel.jsx
@@ -11,7 +11,9 @@ const EMPTY_PLAYBACK = { method: 'playback', energyComparison: '', timecodedNote
/** Editable planning content and explicit operator decisions for every render mode. */
// `framed={false}` drops the card chrome and heading for a host that supplies them (the page's collapsible section).
-export default function ProductionReviewPanel({ project, review, onOpenArtifact, framed = true }) {
+// The proof is the last step of Compose (#10140): a host showing another tab passes `proofHere={false}`
+// and `onOpenProof`, so the proof's render and approval controls live on Compose only.
+export default function ProductionReviewPanel({ project, review, onOpenArtifact, framed = true, proofHere = true, onOpenProof = null }) {
const fieldId = key => `mv-review-${project.id}-${key}`;
const saved = project.productionReview?.draft || EMPTY;
const [visibleArt, setVisibleArt] = useState(null);
@@ -127,7 +129,7 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
{excerpt && <p className="text-xs text-port-text-muted break-words">{excerpt.filename || excerpt.status} · {project.productionReview?.proof?.basis === ready?.basis.proof ? 'Current source revision' : 'Source changed — render a new proof'}</p>}
{excerpt?.status === 'error' && excerpt.error && <p role="alert" className="text-sm text-port-error break-words">{excerpt.error}</p>}
- <p className="text-sm">Author the approved storyboard in Compose, then render a 10–45 second chorus with its entry and exit. Watch with sound at normal speed and compare the chosen energy target and timed choreography below against the actual subject, props, camera, typography and transitions. Check accents against beat and lyric anchors, readable holds and repeated-chorus escalation. A strong static frame does not prove the motion works.</p>
+ <p className="text-sm">Finish the composition above (typography, grade, render style), then render a 10–45 second chorus with its entry and exit. Watch with sound at normal speed and compare the chosen energy target and timed choreography below against the actual subject, props, camera, typography and transitions. Check accents against beat and lyric anchors, readable holds and repeated-chorus escalation. A strong static frame does not prove the motion works.</p>
<section aria-label="Saved choreography for proof comparison" className="rounded border border-port-border bg-port-bg p-3">
<h4 className="text-sm font-medium">Saved energy target and timed choreography</h4>
<p className="mt-1 whitespace-pre-wrap text-sm">{saved.motionLanguage || 'Save an energy target and timed choreography in the planning editor before judging the proof.'}</p>
@@ -196,7 +198,12 @@ export default function ProductionReviewPanel({ project, review, onOpenArtifact,
<p className="text-sm text-port-text-muted">Approve the visual direction, then the timed storyboard, then the reviewed animated proof. Approving a development file or rendering a draft does not approve production.</p>
{review.error && <p role="alert" className="text-port-error">{review.error}</p>}
<ol className="space-y-3">
- {Object.entries(labels).map(([key, label]) => <li key={key}><details open={window.location.hash === `#mv-review-${key}` || key === nextStage} id={`mv-review-${key}`} tabIndex={-1} style={{ scrollMarginTop: 'calc(var(--mv-header-h, 9rem) + 1rem)' }} className="rounded border border-port-border p-2 focus:outline focus:outline-2 focus:outline-port-accent">
+ {Object.entries(labels).map(([key, label]) => key === 'proof' && !proofHere ? <li key={key} className="rounded border border-port-border p-2">
+ <p className="text-sm font-medium">{label}</p>
+ <p role="status" className="text-xs">{ready?.proof.approved ? 'Approved for this revision' : 'Review required'}</p>
+ <p className="mt-1 text-xs text-port-text-muted">The proof is the last step of Compose: render, watch and approve it there, over the finished typography and grade.</p>
+ {onOpenProof && <button type="button" className={`${buttonClass} mt-2`} onClick={onOpenProof}>Open the proof in Compose</button>}
+ </li> : <li key={key}><details open={window.location.hash === `#mv-review-${key}` || key === nextStage} id={`mv-review-${key}`} tabIndex={-1} style={{ scrollMarginTop: 'calc(var(--mv-header-h, 9rem) + 1rem)' }} className="rounded border border-port-border p-2 focus:outline focus:outline-2 focus:outline-port-accent">
<summary className="cursor-pointer min-h-[44px] py-2 text-sm font-medium">{label}</summary>
<p role="status" className="text-xs">{ready?.[key].approved ? 'Approved for this revision' : 'Review required'}</p>
<div id={fieldId(`${key}-prerequisites`)}>{(ready?.[key].problems || []).map(problem => <p key={problem} className="mt-1 text-xs text-port-text-muted">{problem}</p>)}</div>
diff --git a/client/src/components/musicVideo/ProductionReviewPanel.test.jsx b/client/src/components/musicVideo/ProductionReviewPanel.test.jsx
index 7f32592dff..6314e6d03f 100644
--- a/client/src/components/musicVideo/ProductionReviewPanel.test.jsx
+++ b/client/src/components/musicVideo/ProductionReviewPanel.test.jsx
@@ -49,6 +49,18 @@ describe('Production proof playback evidence', () => {
});
});
+ it('keeps the proof render and approval on Compose; other tabs point there instead (#10140)', () => {
+ const onOpenProof = vi.fn();
+ render(<ProductionReviewPanel project={project} review={reviewFixture()} onOpenArtifact={vi.fn()} proofHere={false} onOpenProof={onOpenProof} />);
+ expect(screen.queryByRole('button', { name: 'Render animated proof' })).toBeNull();
+ expect(screen.queryByRole('button', { name: proofAction })).toBeNull();
+ expect(screen.queryByLabelText('Animated proof with master audio')).toBeNull();
+ // Art and storyboard approvals stay on every tab.
+ expect(screen.getByRole('button', { name: 'Approve art direction' })).toBeTruthy();
+ fireEvent.click(screen.getByRole('button', { name: 'Open the proof in Compose' }));
+ expect(onOpenProof).toHaveBeenCalledTimes(1);
+ });
+
it('explains why a completed prototype cannot be approved and opens the missing prerequisites', () => {
const review = reviewFixture();
review.readiness.art.approved = false;
diff --git a/client/src/lib/musicVideoStages.js b/client/src/lib/musicVideoStages.js
index 4ce0f2a01a..7206c459ec 100644
--- a/client/src/lib/musicVideoStages.js
+++ b/client/src/lib/musicVideoStages.js
@@ -256,12 +256,6 @@ const composeDone = (project, mode) => {
return true;
};
-/**
- * Each stage's state derived from the project record — `done`, `blocked`
- * (stopped and needs the director), `active` (the stage the project is in), or
- * `todo` — plus `current`, the first stage that is not done. A live production
- * run owns the project, so it pins `current` to Produce.
- */
/**
* Lyric half of Setup: storyboard approval needs lyrics imported and their word
* timings verified (or an explicit instrumental exception). `readiness.alignment`
@@ -278,6 +272,18 @@ export function lyricSetupState(project, readiness = project?.productionReadines
return { instrumental, lines, alignment, imported, verified, ok: !!readiness?.storyboard?.approved || (imported && verified) };
}
+/**
+ * Each stage's state derived from the project record — `done`, `blocked`
+ * (stopped and needs the director), `active` (the stage the project is in), or
+ * `todo` — plus `current`, the first stage that is not done. A live production
+ * run owns the project, so it pins `current` to Produce.
+ *
+ * The animated proof is the last step of Compose (#10140): its basis covers the
+ * whole composition (typography, grade), so it can only be judged once that
+ * work exists. Produce is done on footage alone; Compose needs the composition
+ * work and an approved proof over it. A later typography or grade edit makes
+ * the proof stale on Compose without reopening Produce.
+ */
export function deriveStages(project, readiness = project?.productionReadiness, publish = {}) {
const scenes = project?.scenes || [];
const mode = project?.composition?.mode || 'concat';
@@ -296,8 +302,8 @@ export function deriveStages(project, readiness = project?.productionReadiness,
setup: projectHasAudio(project) && !!project?.audioAnalysis && lyricSetupState(project, readiness).ok,
'cast-sets': castDone,
board: planned,
- produce: produceDone && !!readiness?.proof.approved,
- compose: !!readiness?.proof.approved && composeDone(project || {}, mode),
+ produce: produceDone,
+ compose: composeDone(project || {}, mode) && !!readiness?.proof.approved,
// A render made before later scene edits no longer counts as the final video.
review: !!project?.renderHistoryId && !isFinalRenderStale(project),
// #9281/#9282: published once every enabled platform has a recorded post.
@@ -338,7 +344,7 @@ export function deriveNextAction(project, {
const cast = project.castAndSets || null;
const scenes = project.scenes || [];
- if (proofActive) return { id: 'proof-progress', kind: 'goto', stage: 'review', anchor: 'mv-review-render', label: 'View review render', shortLabel: 'Review' };
+ if (proofActive) return { id: 'proof-progress', kind: 'goto', stage: 'compose', anchor: 'mv-review-render', label: 'View review render', shortLabel: 'Review' };
if (draftActive) return { id: 'draft-progress', kind: 'goto', stage: 'review', anchor: 'mv-draft-excerpts', label: 'View draft render', shortLabel: 'Draft' };
const art = !readiness?.art.approved;
const board = !readiness?.storyboard.approved;
@@ -347,9 +353,13 @@ export function deriveNextAction(project, {
// or interrupted check-in offers Approve / Resume — those come from the stage switch below.
const castNeedsOwnAction = art && ((!cast && scenes.length === 0) || (cast && (cast.status === 'review' || cast.interrupted || cast.status === 'failed')));
const boardNeedsOwnAction = !art && board && scenes.length === 0;
- if (projectHasAudio(project) && project.audioAnalysis && !CAST_WORKING.has(cast?.status) && !readiness?.readyForProduction && run?.status !== 'running' && !renderActive && !kickoffRunning
+ // The proof closes Compose, so it waits until Produce is done — unless a
+ // production run is parked on its pilot proof, which only the approval frees.
+ const proofDue = current !== 'produce' || (!!run && RESUMABLE_RUN_STATUSES.has(run.status));
+ if (projectHasAudio(project) && project.audioAnalysis && !CAST_WORKING.has(cast?.status) && !readiness?.readyForProduction && (art || board || proofDue)
+ && run?.status !== 'running' && !renderActive && !kickoffRunning
&& !castNeedsOwnAction && !boardNeedsOwnAction) {
- return { id: 'review-production', kind: 'goto', stage: art ? 'cast-sets' : board ? 'board' : 'review',
+ return { id: 'review-production', kind: 'goto', stage: art ? 'cast-sets' : board ? 'board' : 'compose',
anchor: art ? 'mv-review-art' : board ? 'mv-review-storyboard' : 'mv-review-proof',
label: art ? 'Review art direction' : board ? 'Review timed storyboard' : 'Review animated proof',
shortLabel: art ? 'Art' : board ? 'Board' : 'Proof' };
@@ -536,34 +546,34 @@ export function stageChecklist(stageId, project, readiness = project?.production
];
}
case 'produce': {
- const items = [];
- if (!FOOTAGE_OPTIONAL_MODES.has(mode)) {
- const layered = isLayeredComposition(project);
- const ready = scenes.filter((scene) => sceneRenderReady(scene, { layered })).length;
- const footageDone = scenes.length > 0 && ready === scenes.length;
- items.push({ id: 'footage', label: `Footage for every shot (${formatCount(ready)} of ${formatCount(scenes.length)})`, done: footageDone,
- action: footageDone ? null : { label: 'Set up production', anchor: 'mv-production-start' } });
+ if (FOOTAGE_OPTIONAL_MODES.has(mode)) {
+ const planned = !!readiness?.storyboard?.approved;
+ return [{ id: 'footage', label: 'No footage needed for this render style', done: planned,
+ action: planned ? null : { label: 'Review timed storyboard', anchor: APPROVAL_ANCHORS.storyboard } }];
}
- items.push(approval('proof', 'Animated proof', 'Render the proof, watch it with sound, then approve it in Production approvals.'));
- return items;
+ const layered = isLayeredComposition(project);
+ const ready = scenes.filter((scene) => sceneRenderReady(scene, { layered })).length;
+ const footageDone = scenes.length > 0 && ready === scenes.length;
+ return [{ id: 'footage', label: `Footage for every shot (${formatCount(ready)} of ${formatCount(scenes.length)})`, done: footageDone,
+ action: footageDone ? null : { label: 'Set up production', anchor: 'mv-production-start' } }];
}
case 'compose': {
- // Compose counts as done only behind an approved proof (see deriveStages).
- const proof = { id: 'proof', label: 'Animated proof approved (Produce)', done: !!readiness?.proof?.approved,
- action: readiness?.proof?.approved ? null : { label: 'Review animated proof', anchor: APPROVAL_ANCHORS.proof } };
- if (mode === 'composed') return [proof, { id: 'composition', label: 'Timed typography added', done: (project.composition?.textCues || []).length > 0, action: { label: 'Add typography', anchor: 'mv-typo-font' } }];
- if (mode === 'document') return [proof, { id: 'composition', label: 'Composition document attached', done: !!project.composition?.document, action: { label: 'Attach a document', anchor: 'mv-doc-folder' } }];
- if (mode === 'eidoverse') {
- const saved = !!project.composition?.eidoverseScene?.inlineScript;
- return [proof, { id: 'composition', label: 'Save the Eidoverse scene', done: saved, action: saved ? null : { label: 'Save the scene', anchor: 'mv-eidoverse-scene' } }];
- }
- if (mode === 'code') {
- const generated = !!project.composition?.codeVideo?.generatedAt;
- return [proof, { id: 'composition', label: generated ? 'Code video generated' : 'Code video sections ready', done: codeComposed(project),
- detail: codeComposed(project) ? null : 'Generate the code video from the Code Video panel.',
- action: codeComposed(project) ? null : { label: 'Open Code Video', anchor: 'mv-code-section' } }];
+ // The proof closes Compose: it is judged over the finished composition (see deriveStages).
+ const proof = approval('proof', 'Animated proof', 'Render the proof over this composition, watch it with sound, then approve it below.');
+ const composition = project.composition || {};
+ let work = { id: 'composition', label: 'Nothing to compose for this render style', done: true };
+ if (mode === 'composed') work = { id: 'composition', label: 'Timed typography added', done: (composition.textCues || []).length > 0, action: { label: 'Add typography', anchor: 'mv-typo-font' } };
+ else if (mode === 'document') work = { id: 'composition', label: 'Composition document attached', done: !!composition.document, action: { label: 'Attach a document', anchor: 'mv-doc-folder' } };
+ else if (mode === 'eidoverse') {
+ const saved = !!composition.eidoverseScene?.inlineScript;
+ work = { id: 'composition', label: 'Save the Eidoverse scene', done: saved, action: saved ? null : { label: 'Save the scene', anchor: 'mv-eidoverse-scene' } };
+ } else if (mode === 'code') {
+ const done = codeComposed(project);
+ work = { id: 'composition', label: composition.codeVideo?.generatedAt ? 'Code video generated' : 'Code video sections ready', done,
+ detail: done ? null : 'Generate the code video from the Code Video panel.',
+ action: done ? null : { label: 'Open Code Video', anchor: 'mv-code-section' } };
}
- return [proof, { id: 'composition', label: 'Nothing to compose for this render style', done: true }];
+ return [work, proof];
}
case 'review':
return [{
diff --git a/client/src/lib/musicVideoStages.test.js b/client/src/lib/musicVideoStages.test.js
index 095df8525f..7171e2afb1 100644
--- a/client/src/lib/musicVideoStages.test.js
+++ b/client/src/lib/musicVideoStages.test.js
@@ -140,15 +140,15 @@ describe('deriveStages / deriveNextAction', () => {
// Eidoverse: Produce done without footage; Compose waits on a saved scene.
expect(stateOf(withMode({ mode: 'eidoverse' })).produce).toBe('done');
expect(deriveStages(withMode({ mode: 'eidoverse' })).current).toBe('compose');
- expect(stageChecklist('produce', withMode({ mode: 'eidoverse' }), APPROVED).map((i) => i.id)).toEqual(['approve-proof']);
- expect(stageChecklist('compose', withMode({ mode: 'eidoverse' }), APPROVED)[1])
+ expect(stageChecklist('produce', withMode({ mode: 'eidoverse' }), APPROVED).map((i) => [i.id, i.done])).toEqual([['footage', true]]);
+ expect(stageChecklist('compose', withMode({ mode: 'eidoverse' }), APPROVED)[0])
.toMatchObject({ label: 'Save the Eidoverse scene', done: false, action: { anchor: 'mv-eidoverse-scene' } });
const saved = withMode({ mode: 'eidoverse', eidoverseScene: { inlineScript: 'scene()' } });
expect(deriveStages(saved).current).toBe('review');
- expect(stageChecklist('compose', saved, APPROVED)[1].done).toBe(true);
+ expect(stageChecklist('compose', saved, APPROVED)[0].done).toBe(true);
// Code: composed only once generated (or sections exist).
expect(deriveStages(withMode({ mode: 'code' })).current).toBe('compose');
- expect(stageChecklist('compose', withMode({ mode: 'code' }), APPROVED)[1].done).toBe(false);
+ expect(stageChecklist('compose', withMode({ mode: 'code' }), APPROVED)[0].done).toBe(false);
expect(deriveStages(withMode({ mode: 'code', codeVideo: { generatedAt: '2026-01-01T00:00:00.000Z', sections: [] } })).current).toBe('review');
// Document: composed once the document is attached.
expect(deriveStages(withMode({ mode: 'document' })).current).toBe('compose');
@@ -173,7 +173,69 @@ it('never promotes placeholder scenes or imported schematic documents to final p
expect(stateOf(project)).toMatchObject({ 'cast-sets': 'active', board: 'todo', produce: 'todo', compose: 'todo' });
expect(deriveNextAction(project)).toMatchObject({ id: 'review-production', stage: 'cast-sets' });
const planned = { ...project, productionReadiness: { ...APPROVED, proof: { approved: false }, readyForProduction: false } };
- expect(deriveNextAction(planned)).toMatchObject({ id: 'review-production', stage: 'review' });
+ expect(deriveNextAction(planned)).toMatchObject({ id: 'review-production', stage: 'compose' });
+});
+
+// #10140: the proof is the last step of Compose. Following the tabs in order
+// must never send an earlier stage back to not done.
+describe('following the tab order', () => {
+ // The server's proof basis covers the whole composition (productionReview.js),
+ // so an approval holds only while the composition it was given over is unchanged.
+ const readinessFor = (project, { art = false, storyboard = false, approvedComposition = null } = {}) => {
+ const proof = approvedComposition !== null && approvedComposition === JSON.stringify(project.composition || null);
+ return { art: { approved: art, problems: [] }, storyboard: { approved: storyboard, problems: [] }, proof: { approved: proof, problems: [] }, readyForProduction: proof };
+ };
+ const doneSet = (project, readiness) => new Set(deriveStages(project, readiness).stages.filter((s) => s.state === 'done').map((s) => s.id));
+
+ it('walks setup → cast & sets → board → produce → compose → proof → render without a stage going backwards', () => {
+ let project = { id: 'p', scenes: [], composition: { mode: 'composed', textCues: [] } };
+ let approvals = {};
+ const steps = [
+ ['setup', () => { project = { ...project, trackId: 't1', audioAnalysis: ANALYSIS, ...LYRICS }; }],
+ ['cast-sets', () => { approvals = { ...approvals, art: true }; }],
+ ['board', () => { project = { ...project, scenes: [scene({ referenceImageId: null, videoHistoryId: null })] }; approvals = { ...approvals, storyboard: true }; }],
+ ['produce', () => { project = { ...project, scenes: [scene()] }; }],
+ ['compose', () => { project = { ...project, composition: { ...project.composition, textCues: [{ id: 'c1', text: 'Hello', startSec: 0, endSec: 2 }], grade: { contrast: 1.1 } } }; }],
+ ['proof', () => { approvals = { ...approvals, approvedComposition: JSON.stringify(project.composition) }; }],
+ ['review', () => { project = { ...project, renderHistoryId: 'rh-1' }; }],
+ ];
+ let before = doneSet(project, readinessFor(project, approvals));
+ for (const [step, apply] of steps) {
+ apply();
+ const readiness = readinessFor(project, approvals);
+ const after = doneSet(project, readiness);
+ for (const id of before) expect(after.has(id), `${id} regressed after ${step}`).toBe(true);
+ // Each step finishes its own stage, except that typography alone leaves
+ // Compose open: the proof over it closes the stage.
+ if (step === 'compose') expect(after.has('compose'), 'compose done before its proof').toBe(false);
+ else expect(after.has(step === 'proof' ? 'compose' : step), `${step} not done`).toBe(true);
+ before = after;
+ }
+ expect(deriveStages(project, readinessFor(project, approvals)).current).toBe('publish');
+ });
+
+ it('a typography edit after proof approval reopens Compose only and sends the header there', () => {
+ const composition = { mode: 'composed', textCues: [{ id: 'c1', text: 'Hello', startSec: 0, endSec: 2 }] };
+ const project = { id: 'p', trackId: 't1', audioAnalysis: ANALYSIS, scenes: [scene()], composition };
+ const approvals = { art: true, storyboard: true, approvedComposition: JSON.stringify(composition) };
+ expect(deriveStages(project, readinessFor(project, approvals)).current).toBe('review');
+
+ const edited = { ...project, composition: { ...composition, textCues: [...composition.textCues, { id: 'c2', text: 'World', startSec: 2, endSec: 4 }] } };
+ const readiness = readinessFor(edited, approvals);
+ expect(Object.fromEntries(deriveStages(edited, readiness).stages.map((s) => [s.id, s.state])))
+ .toMatchObject({ board: 'done', produce: 'done', compose: 'active', review: 'todo' });
+ expect(deriveNextAction(edited, { readiness })).toMatchObject({ id: 'review-production', stage: 'compose', anchor: 'mv-review-proof' });
+ expect(stageChecklist('produce', edited, readiness).every((i) => i.done)).toBe(true);
+ expect(stageChecklist('compose', edited, readiness).map((i) => [i.id, i.done])).toEqual([['composition', true], ['approve-proof', false]]);
+ });
+
+ it('keeps the header on Produce until the footage is in, unless a run is parked on its pilot proof', () => {
+ const project = { id: 'p', trackId: 't1', audioAnalysis: ANALYSIS, scenes: [scene({ videoHistoryId: null })] };
+ const readiness = readinessFor(project, { art: true, storyboard: true });
+ expect(deriveNextAction(project, { readiness })).toMatchObject({ id: 'goto-produce', stage: 'produce' });
+ const parked = { ...project, productionRuns: [run({ status: 'blocked' })] };
+ expect(deriveNextAction(parked, { readiness })).toMatchObject({ id: 'review-production', stage: 'compose' });
+ });
});
describe('projectSpend', () => {
@@ -299,7 +361,7 @@ describe('describeProjectStatus', () => {
it('links active draft and proof jobs to their own evidence controls before offering approval', () => {
const project = { id: 'example', trackId: 'song', audioAnalysis: {}, scenes: [] };
expect(deriveNextAction(project, { draftActive: true })).toMatchObject({ id: 'draft-progress', anchor: 'mv-draft-excerpts' });
- expect(deriveNextAction(project, { proofActive: true })).toMatchObject({ id: 'proof-progress', anchor: 'mv-review-render' });
+ expect(deriveNextAction(project, { proofActive: true })).toMatchObject({ id: 'proof-progress', stage: 'compose', anchor: 'mv-review-render' });
const nextAction = deriveNextAction(project, { draftActive: true });
expect(describeProjectStatus(project, { progress: deriveStages(project), nextAction })).toMatchObject({ headline: 'Review render in progress', tone: 'muted' });
});
@@ -347,9 +409,11 @@ describe('stageChecklist', () => {
.toEqual([['shots', true], ['board-art', false], ['approve-storyboard', false]]);
expect(stageChecklist('produce', castProject({ scenes: [scene(), scene({ sceneId: 's2', videoHistoryId: null })] }), APPROVED)[0])
.toMatchObject({ id: 'footage', label: 'Footage for every shot (1 of 2)', done: false });
- // A code render draws its own picture: no footage item.
- expect(stageChecklist('produce', castProject({ composition: { mode: 'code' } }), APPROVED).map((i) => i.id)).toEqual(['approve-proof']);
- expect(stageChecklist('compose', castProject({ composition: { mode: 'composed', textCues: [] } }), APPROVED).map((i) => i.done)).toEqual([true, false]);
+ // A code render draws its own picture: no footage to wait on.
+ expect(stageChecklist('produce', castProject({ composition: { mode: 'code' } }), APPROVED).map((i) => [i.id, i.done])).toEqual([['footage', true]]);
+ // The proof closes Compose, after the composition work it is judged over.
+ expect(stageChecklist('compose', castProject({ composition: { mode: 'composed', textCues: [] } }), APPROVED).map((i) => [i.id, i.done]))
+ .toEqual([['composition', false], ['approve-proof', true]]);
});
it('keeps Setup open until lyrics are imported and their timing verified, unless the song is instrumental', () => {
const base = { id: 'p', trackId: 't1', audioAnalysis: ANALYSIS };
diff --git a/client/src/pages/MusicVideo.jsx b/client/src/pages/MusicVideo.jsx
index be8c8c0f54..5c237b9825 100644
--- a/client/src/pages/MusicVideo.jsx
+++ b/client/src/pages/MusicVideo.jsx
@@ -1438,7 +1438,8 @@ export default function MusicVideo() {
summary={approvalSummary(productionReview.readiness) || 'Visual direction, timed storyboard and a watched proof'}
defaultOpen={nextAction?.id === 'review-production' && nextAction.stage === activeStage}
>
- <ProductionReviewPanel project={selected} review={productionReview} onOpenArtifact={openArtifact} framed={false} />
+ <ProductionReviewPanel project={selected} review={productionReview} onOpenArtifact={openArtifact} framed={false}
+ proofHere={activeStage === 'compose'} onOpenProof={() => goToStage('compose', 'mv-review-proof')} />
</StageSection>
</div>}
>
diff --git a/server/lib/musicVideoSummary.js b/server/lib/musicVideoSummary.js
index baf01a166d..cdea6deba0 100644
--- a/server/lib/musicVideoSummary.js
+++ b/server/lib/musicVideoSummary.js
@@ -61,8 +61,9 @@ function currentStage(project, readiness, run) {
setup: Boolean(project.trackId || project.uploadedAudioFilename) && Boolean(project.audioAnalysis),
'cast-sets': Boolean(readiness?.art?.approved),
board: planned,
- produce: planned && footageReady && proofApproved,
- compose: proofApproved && composeDone(project, mode),
+ // The proof closes Compose, not Produce (#10140) — mirrors the client's deriveStages.
+ produce: planned && footageReady,
+ compose: composeDone(project, mode) && proofApproved,
review: Boolean(project.renderHistoryId),
publish: Object.keys(project.publishKit?.posts || {}).length > 0,
};