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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
Shots step reads Done once every shot is, even with a parked production run (#11644)
[._.]/d17a3e0aee95
diff --git a/client/src/lib/musicVideoStages.js b/client/src/lib/musicVideoStages.jsindex a8b36989fa..1b814a4072 100644--- a/client/src/lib/musicVideoStages.js+++ b/client/src/lib/musicVideoStages.js@@ -293,7 +293,7 @@ const autonomousChipLabel = (auto, { phase, step }) => {* state, else a live or parked production run, else just "Autopilot". Tones are* `ok`, `warn` or `muted`; `short` is the phone label.*/-export function autopilotStatus(project) {+export function autopilotStatus(project, readiness = project?.productionReadiness) {const auto = project?.autonomousRun;const { phase, step } = autonomousRunPhase(auto);if (phase !== 'inactive') {@@ -301,7 +301,8 @@ export function autopilotStatus(project) {return { label: autonomousChipLabel(auto, { phase, step }), short: running ? 'Autopilot running' : 'Autopilot needs you', tone: running ? 'muted' : 'warn' };}const run = currentProductionRun(project);- if (run && RESUMABLE_RUN_STATUSES.has(run.status)) {+ // A parked run whose shots are all done since needs nothing from the director.+ if (run && RESUMABLE_RUN_STATUSES.has(run.status) && deriveStages(project, readiness).liveRun) {const running = run.status === 'running';return { label: PRODUCTION_RUN_LABELS[run.status] || 'Production paused', short: running ? 'Autopilot running' : 'Autopilot needs you', tone: running ? 'muted' : 'warn' };}@@ -426,7 +427,6 @@ export function deriveStages(project, readiness = project?.productionReadiness,const mode = project?.composition?.mode || 'concat';const cast = project?.castAndSets || null;const run = currentProductionRun(project);- const liveRun = !!run && RESUMABLE_RUN_STATUSES.has(run.status);const planned = !!readiness?.storyboard.approved;const shotsPlanned = (project?.scenes || []).length > 0 && !!readiness && !readiness.storyboard.problems?.length;const castStopped = castSetsPhase(cast) === 'stopped';@@ -434,11 +434,15 @@ export function deriveStages(project, readiness = project?.productionReadiness,// Code and document renders draw the picture themselves; scene footage is optional there.const produceDone = planned && clipsLockedDone(readiness) && footageReady(project);+ const shotsDone = produceDone && composeDone(project || {}, mode);+ // A run parked short of running (stopped, awaiting video) whose shots are all done since is+ // finished in fact: it no longer holds Shots open or owns the header.+ const liveRun = !!run && RESUMABLE_RUN_STATUSES.has(run.status) && (run.status === 'running' || !shotsDone);const done = {setup: projectHasAudio(project) && !!project?.audioAnalysis && lyricSetupState(project, readiness).ok,'cast-sets': castDone,board: planned || shotsPlanned,- produce: produceDone && composeDone(project || {}, mode),+ produce: shotsDone,// 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.@@ -466,7 +470,7 @@ export function deriveStages(project, readiness = project?.productionReadiness,else if (stage.id === current) state = blocked[stage.id] ? 'blocked' : 'active';return { ...stage, state, stale: !!stale[stage.id] };});- return { stages, current };+ return { stages, current, liveRun };}// The approval panel the header sends the director to: unwritten art direction is written on the step, not approved.@@ -529,8 +533,9 @@ export function deriveNextAction(project, {planning = false, analyzing = false, readiness = project?.productionReadiness, publish = {},} = {}) {if (!project) return null;- const { current } = deriveStages(project, readiness, publish);- const run = currentProductionRun(project);+ const { current, liveRun } = deriveStages(project, readiness, publish);+ const latestRun = currentProductionRun(project);+ const run = latestRun && RESUMABLE_RUN_STATUSES.has(latestRun.status) && !liveRun ? null : latestRun;const cast = project.castAndSets || null;const scenes = project.scenes || [];@@ -1112,6 +1117,14 @@ export function stepNotes(project, readiness = project?.productionReadiness, pubconst ready = scenes.filter((scene) => sceneRenderReady(scene, { layered })).length;make = `${formatCount(ready)} of ${formatCount(scenes.length)} shots have their picture`;} else if (scenes.length) make = 'Picture drawn by the composition';+ // Once the picture is in, an unfinished Shots step names what is left instead.+ if (scenes.length && readiness && deriveStages(project, readiness, publish).stages.find((stage) => stage.id === 'produce')?.state !== 'done') {+ const open = stageChecklist('produce', project, readiness, publish).filter((item) => !item.done && !item.optional);+ const { stills, videos } = unlockedShots(readiness);+ const unlocked = [stills.length && `${formatCount(stills.length)} ${stills.length === 1 ? 'still' : 'stills'}`,+ videos.length && `${formatCount(videos.length)} ${videos.length === 1 ? 'video' : 'videos'}`].filter(Boolean).join(' and ');+ if (open.length && !open.some((item) => item.id === 'footage')) make = unlocked ? `${unlocked} not locked` : `To do: ${open[0].label}`;+ }// Before a final render, the drafts and proofs to watch are what Final render holds.const drafts = (project.excerpts || []).filter((e) => e.status === 'complete' && e.filename).length;const review = isFinalRenderStale(project) ? 'Out of date' : project.renderHistoryId ? 'Rendered'diff --git a/client/src/lib/musicVideoStages.test.js b/client/src/lib/musicVideoStages.test.jsindex 941f0671b9..7b031b415e 100644--- a/client/src/lib/musicVideoStages.test.js+++ b/client/src/lib/musicVideoStages.test.js@@ -89,6 +89,19 @@ describe('deriveStages / deriveNextAction', () => {expect(deriveNextAction(interrupted)).toMatchObject({ id: 'resume-production' });});+ it('a parked run no longer holds Shots open once every shot is done', () => {+ const finished = { productionReadiness: APPROVED, id: 'p', trackId: 't1', audioAnalysis: ANALYSIS, ...LYRICS, scenes: [scene()], renderHistoryId: 'rh-1' };+ const parked = { ...finished, productionRuns: [run({ status: 'awaiting-video' })] };+ expect(stateOf(parked).produce).toBe('done');+ expect(stateOf(parked).review).toBe('done');+ expect(deriveNextAction(parked).id).not.toBe('resume-production');+ expect(autopilotStatus(parked)).toMatchObject({ short: 'Autopilot', tone: 'muted' });+ // A run still working keeps Shots open, and a parked run with shots left still owns the header.+ expect(stateOf({ ...finished, productionRuns: [run()] }).produce).toBe('active');+ const unfinished = { ...parked, scenes: [scene({ videoHistoryId: null, referenceImageId: null })] };+ expect(deriveNextAction(unfinished)).toMatchObject({ id: 'resume-production' });+ });+it('walks Storyboard → Make → Final render, then reports a finished project', () => {const planned = { productionReadiness: APPROVED, id: 'p', trackId: 't1', audioAnalysis: ANALYSIS, scenes: [scene({ referenceImageId: null, videoHistoryId: null })] };expect(deriveStages(planned).current).toBe('produce');@@ -665,6 +678,17 @@ describe('stepNotes', () => {// Before the final render, Final render says how many drafts and proofs there are to watch.expect(stepNotes({ ...project, excerpts: [{ id: 'a', status: 'complete', filename: 'a.mp4' }, { id: 'b', status: 'complete', filename: 'b.mp4' }, { id: 'c', status: 'error' }] }).review).toBe('2 drafts to watch');});++ it('names what keeps a pictured Shots step from done instead of the picture count', () => {+ const project = { id: 'p', scenes: [scene(), scene({ sceneId: 's2' }), scene({ sceneId: 's3' })] };+ const clipLocks = { s1: 'locked', s2: 'changed', s3: 'open' };+ const locked = { ...APPROVED, storyboard: { approved: true, problems: [], unlocked: [], clipLocks, clipsUnlocked: ['s2', 's3'] } };+ expect(stepNotes(project, locked).produce).toBe('2 videos not locked');+ const stills = { ...locked, storyboard: { approved: false, problems: [], unlocked: ['s3'], clipLocks, clipsUnlocked: ['s2', 's3'] } };+ expect(stepNotes(project, stills).produce).toBe('1 still and 2 videos not locked');+ const done = { ...locked, storyboard: { ...locked.storyboard, clipLocks: { s1: 'locked', s2: 'locked', s3: 'locked' }, clipsUnlocked: [] } };+ expect(stepNotes(project, done).produce).toBe('3 of 3 shots have their picture');+ });});describe('preview source order on Storyboard', () => {diff --git a/client/src/pages/MusicVideo.jsx b/client/src/pages/MusicVideo.jsxindex 5a4f89887d..852370112d 100644--- a/client/src/pages/MusicVideo.jsx+++ b/client/src/pages/MusicVideo.jsx@@ -1658,7 +1658,7 @@ export default function MusicVideo() {spend={projectSpend(selected)}status={projectStatus}notes={stepNotes(selected, productionReview.readiness, publish)}- autopilot={autopilotStatus(selected)}+ autopilot={autopilotStatus(selected, productionReview.readiness)}onOpenSettings={openHeaderSettings}playerFirst={playerFirst}previewExpanded={dockExpanded}