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
fix(music-video): surface immediate autonomous progress and clean up setup cards
[._.]/ Adam Eivy532632f11584
diff --git a/client/src/components/musicVideo/SongRevisionPanel.jsx b/client/src/components/musicVideo/SongRevisionPanel.jsxindex 3c5536b05b..c67f267601 100644--- a/client/src/components/musicVideo/SongRevisionPanel.jsx+++ b/client/src/components/musicVideo/SongRevisionPanel.jsx@@ -55,6 +55,13 @@ export default function SongRevisionPanel({ project, tracks = [], onUpdated, onFconst action = (name, extra = {}) => run(() => actOnMusicVideoSongRevision(project.id, name, { revisionId: revision.id, ...extra }, { silent: true }));const settled = ['review', 'failed'].includes(revision?.status);const canDraft = !revision || ['draft', 'canceled', 'failed'].includes(revision.status);+ const hasSong = !!(project.trackId || project.uploadedAudioFilename || track?.audioFilename);+ const hasLyrics = !!(track?.lyrics || (project.lyricCues || []).length > 0 || project.songRevision?.fields?.lyrics);+ const hasRevision = !!(project.songRevision || (project.songRevisionHistory || []).length > 0);+ const canFork = hasSong || hasLyrics;+ if (!project.parentProjectId && !hasRevision && !canFork) {+ return null;+ }return <section aria-label="Song revision" className="min-w-0 space-y-3 rounded-lg border border-port-border bg-port-card p-3"><div className="flex flex-wrap items-center justify-between gap-2"><h3 className="font-medium">Revise lyrics & song</h3>diff --git a/client/src/components/musicVideo/SongRevisionPanel.test.jsx b/client/src/components/musicVideo/SongRevisionPanel.test.jsxindex acfcd01221..b79ee3b3cc 100644--- a/client/src/components/musicVideo/SongRevisionPanel.test.jsx+++ b/client/src/components/musicVideo/SongRevisionPanel.test.jsx@@ -67,4 +67,22 @@ describe('song revision UI', () => {await screen.findByText('Song revision: canceled');expect(api.act).toHaveBeenCalledWith('fork', 'cancel', { revisionId: 'rev' }, { silent: true });});+ it('hides the panel when there are no lyrics or song to revise on a non-fork project', () => {+ const { container } = render(+ <MemoryRouter>+ <SongRevisionPanel project={{ id: 'p1', version: 1 }} tracks={[]} onUpdated={() => {}} onFork={() => {}} />+ </MemoryRouter>,+ );+ expect(container.firstChild).toBeNull();+ });+ it('shows the fork callout when the project has audio or lyrics attached', () => {+ render(+ <MemoryRouter>+ <SongRevisionPanel project={{ id: 'p1', trackId: 't1', version: 1 }} tracks={[{ id: 't1', title: 'Song', audioFilename: 's.mp3' }]} onUpdated={() => {}} onFork={() => {}} />+ </MemoryRouter>,+ );+ expect(screen.getByRole('heading', { name: 'Revise lyrics & song' })).toBeInTheDocument();+ expect(screen.getByRole('button', { name: 'Fork & revise song' })).toBeInTheDocument();+ });});+diff --git a/client/src/components/musicVideo/stages/SetupStage.jsx b/client/src/components/musicVideo/stages/SetupStage.jsxindex d6f708a25b..906046a945 100644--- a/client/src/components/musicVideo/stages/SetupStage.jsx+++ b/client/src/components/musicVideo/stages/SetupStage.jsx@@ -1,3 +1,4 @@+import AutonomousRunPanel from '../AutonomousRunPanel.jsx';import SongRevisionPanel from '../SongRevisionPanel.jsx';import StyleReferencesPanel from '../StyleReferencesPanel.jsx';import AutoSizeTextarea from '../../ui/AutoSizeTextarea';@@ -18,9 +19,20 @@ export default function SetupStage({ board }) {const {project, tracks, trackName, audioFilename, locked, youtube, separation, midi, midiBound, renderBound, tempo, busy,conceptDraft, styleDraft, importingLyrics, aligningLyrics, treatment,+ autopilotRun, autonomous, runStage, onSelectStage,} = board;return (<>+ {autopilotRun && (+ <AutonomousRunPanel+ key={`autonomous-${project.id}`}+ project={project}+ auto={autonomous}+ selectedStage={runStage}+ onSelectStage={onSelectStage}+ framed+ />+ )}<SongRevisionPanel key={`song-${project.id}`} project={project} tracks={tracks} onUpdated={board.replaceProject} onFork={board.onForkSong} disabled={locked || renderBound || midiBound} /><CreativeSetupPanelkey={`creative-${project.id}`}diff --git a/client/src/lib/musicVideoStages.js b/client/src/lib/musicVideoStages.jsindex 86a0d140fb..7f3a9db669 100644--- a/client/src/lib/musicVideoStages.js+++ b/client/src/lib/musicVideoStages.js@@ -5,7 +5,9 @@* strip and the tests all read the same answer.*/import { isLayeredComposition, sceneRenderReady } from './musicVideoLayers.js';-import { AUTONOMOUS_STATUS_LABELS } from './musicVideoAutonomous.js';+import {+ AUTONOMOUS_CHECKPOINT_LABELS, AUTONOMOUS_LYRICS_STEP_LABELS, AUTONOMOUS_SONG_STEP_LABELS, AUTONOMOUS_STATUS_LABELS,+} from './musicVideoAutonomous.js';import { formatCount, formatTimecode } from '../utils/formatters.js';export const MUSIC_VIDEO_STAGES = [@@ -123,16 +125,27 @@ export function describeProjectStatus(project, { progress, nextAction = null, reconst facts = [];const auto = project.autonomousRun;if (auto && nextAction?.id !== 'review-production' && !activeEvidence) {- const label = auto.interrupted ? 'interrupted' : (AUTONOMOUS_STATUS_LABELS[auto.status] || auto.status).toLowerCase();+ let label;+ if (auto.status === 'running' && !auto.interrupted) {+ const step = auto.stages?.[auto.stage]?.step;+ const stepDetail = (auto.stage === 'lyrics' && AUTONOMOUS_LYRICS_STEP_LABELS[step])+ || (auto.stage === 'song' && AUTONOMOUS_SONG_STEP_LABELS[step])+ || (AUTONOMOUS_CHECKPOINT_LABELS[auto.stage] ? AUTONOMOUS_CHECKPOINT_LABELS[auto.stage].toLowerCase() : null);+ label = stepDetail ? `Autopilot: ${stepDetail.toLowerCase()}` : 'Autopilot running';+ } else {+ const statusLabel = auto.interrupted ? 'interrupted' : (AUTONOMOUS_STATUS_LABELS[auto.status] || auto.status).toLowerCase();+ label = `Autopilot ${statusLabel}`;+ }const tone = auto.status === 'completed' ? 'ok' : auto.status === 'running' && !auto.interrupted ? 'muted' : 'warn';- facts.push({ id: 'autopilot', label: `Autopilot ${label}`, tone });+ facts.push({ id: 'autopilot', label, tone });}const run = currentProductionRun(project);if (run && RESUMABLE_RUN_STATUSES.has(run.status)) {facts.push({ id: 'production', label: PRODUCTION_RUN_LABELS[run.status] || 'Production paused', tone: run.status === 'running' ? 'muted' : 'warn' });}const approvals = approvalSummary(readiness);- if (approvals) facts.push({ id: 'approvals', label: `Approvals: ${approvals}`, tone: readiness.readyForProduction ? 'ok' : 'warn' });+ const showApprovals = progress.current !== 'setup' || (project.scenes || []).length > 0;+ if (approvals && showApprovals) facts.push({ id: 'approvals', label: `Approvals: ${approvals}`, tone: readiness.readyForProduction ? 'ok' : 'warn' });const drafts = (project.excerpts || []).filter((e) => e.status === 'complete' && e.filename).length;if (project.renderHistoryId) facts.push({ id: 'render', label: 'Final render ready', tone: 'ok' });else if (drafts) facts.push({ id: 'render', label: `${drafts} draft ${drafts === 1 ? 'excerpt' : 'excerpts'}, no final render`, tone: 'muted' });@@ -237,6 +250,27 @@ export function deriveNextAction(project, {return { id: 'busy', kind: 'run', label: kickoffStep || (planning ? 'Planning…' : 'Working…'), disabled: true };}+ const auto = project.autonomousRun;+ if (auto && auto.status !== 'completed' && auto.status !== 'canceled') {+ if (auto.status === 'running' && !auto.interrupted) {+ const step = auto.stages?.[auto.stage]?.step;+ const stepText = (auto.stage === 'lyrics' && AUTONOMOUS_LYRICS_STEP_LABELS[step])+ || (auto.stage === 'song' && AUTONOMOUS_SONG_STEP_LABELS[step])+ || (AUTONOMOUS_CHECKPOINT_LABELS[auto.stage] ? `${AUTONOMOUS_CHECKPOINT_LABELS[auto.stage]}…` : 'Autopilot running…');+ return { id: 'busy', kind: 'run', label: stepText.endsWith('…') ? stepText : `${stepText}…`, disabled: true };+ }+ if (auto.status === 'awaiting-approval') {+ const target = AUTONOMOUS_CHECKPOINT_LABELS[auto.awaiting] || auto.awaiting || 'checkpoint';+ return { id: 'review-autonomous', kind: 'goto', stage: 'setup', anchor: 'mv-auto-edit', label: `Review ${target}` };+ }+ if (auto.interrupted || auto.status === 'stopped' || auto.status === 'needs-human') {+ return { id: 'resume-autonomous', kind: 'run', label: 'Resume autopilot' };+ }+ if (auto.status === 'failed') {+ return { id: 'retry-autonomous', kind: 'run', label: 'Retry autopilot' };+ }+ }+switch (current) {case 'setup':if (!projectHasAudio(project)) return { id: 'goto-setup', kind: 'goto', stage: 'setup', anchor: 'mv-track', label: 'Attach a track' };diff --git a/client/src/lib/musicVideoStages.test.js b/client/src/lib/musicVideoStages.test.jsindex 69b46f3fa1..10dfb36f92 100644--- a/client/src/lib/musicVideoStages.test.js+++ b/client/src/lib/musicVideoStages.test.js@@ -25,6 +25,20 @@ describe('deriveStages / deriveNextAction', () => {expect(deriveNextAction({ id: 'p', trackId: 't1', scenes: [] })).toMatchObject({ id: 'analyze' });});+ it('reflects an autonomous run in the header next action instead of asking to attach a track', () => {+ const autoRunning = { id: 'p', autonomousRun: { status: 'running', stage: 'lyrics', stages: { lyrics: { step: 'draft' } } } };+ expect(deriveNextAction(autoRunning)).toMatchObject({ id: 'busy', label: 'Writing the lyric draft…', disabled: true });++ const autoAwaiting = { id: 'p', autonomousRun: { status: 'awaiting-approval', awaiting: 'lyrics' } };+ expect(deriveNextAction(autoAwaiting)).toMatchObject({ id: 'review-autonomous', kind: 'goto', stage: 'setup', anchor: 'mv-auto-edit', label: 'Review Lyrics' });++ const autoStopped = { id: 'p', autonomousRun: { status: 'stopped' } };+ expect(deriveNextAction(autoStopped)).toMatchObject({ id: 'resume-autonomous', kind: 'run', label: 'Resume autopilot' });++ const autoFailed = { id: 'p', autonomousRun: { status: 'failed' } };+ expect(deriveNextAction(autoFailed)).toMatchObject({ id: 'retry-autonomous', kind: 'run', label: 'Retry autopilot' });+ });+it('a project waiting on Cast & Sets approval offers the approval, and a stopped check-in offers to resume', () => {const waiting = { id: 'p', trackId: 't1', audioAnalysis: ANALYSIS, automation: {}, castAndSets: { status: 'review' }, scenes: [] };expect(deriveStages(waiting).current).toBe('cast-sets');@@ -183,6 +197,17 @@ describe('describeProjectStatus', () => {expect(done.headline).toBe('Published');expect(done.facts.map((fact) => fact.label)).toEqual(['Approvals: All 3 approved', 'Final render ready']);});++ it('shows detailed autopilot progress and omits approvals during setup without scenes', () => {+ const status = describeProjectStatus(+ { autonomousRun: { status: 'running', stage: 'lyrics', stages: { lyrics: { step: 'draft' } } }, excerpts: [] },+ { progress: stages('setup'), readiness: readiness(false, false, false) },+ );+ expect(status.headline).toBe('Stage 1 of 7: Setup');+ expect(status.facts.map((fact) => fact.label)).toEqual([+ 'Autopilot: writing the lyric draft', 'Nothing rendered yet',+ ]);+ });});it('links active draft and proof jobs to their own evidence controls before offering approval', () => {diff --git a/client/src/pages/MusicVideo.jsx b/client/src/pages/MusicVideo.jsxindex 9b1a6c3e21..075faf5c5b 100644--- a/client/src/pages/MusicVideo.jsx+++ b/client/src/pages/MusicVideo.jsx@@ -819,6 +819,7 @@ export default function MusicVideo() {const audioFilename = projectAudioFilename(selected);const audioUrl = audioFilename ? trackAudioUrl(audioFilename) : null;+ const autopilotRun = selected?.autonomousRun || null;const nextAction = selected ? deriveNextAction(selected, {readiness: productionReview.readiness,renderActive: renderTargetsSelected,@@ -844,6 +845,10 @@ export default function MusicVideo() {case 'resume-cast-sets': castSets.resume(); break;case 'stop-production': production.stop(nextAction.runId); break;case 'resume-production': production.resume(nextAction.runId, nextAction.acceptBasis ? { acceptBasis: true } : {}); break;+ case 'resume-autonomous':+ case 'retry-autonomous':+ autonomous.resume();+ break;case 'render-final': renderJob.start(selected.id); break;default: break;}@@ -853,6 +858,10 @@ export default function MusicVideo() {// use, so a panel moving between tabs never changes a signature here.const board = selected ? {project: selected,+ autopilotRun,+ autonomous,+ runStage,+ onSelectStage: setRunStage,productionReadiness: productionReview.readiness,locked: creativeSetupPending || styleReferencesPending || compositionSavePending > 0,busy: { analyzing, planning, arranging, cloning },@@ -939,7 +948,6 @@ export default function MusicVideo() {const StageView = STAGE_VIEWS[activeStage];const previewSources = selected ? listPreviewSources(selected, { finalVideoSrc: finalVideo.src }) : [];- const autopilotRun = selected?.autonomousRun || null;return (<div className="flex h-full flex-col">@@ -1214,12 +1222,12 @@ export default function MusicVideo() {/>) : null}projectPanels={<div className="space-y-3 min-w-0">- {autopilotRun && (+ {autopilotRun && activeStage !== 'setup' && (<StageSectionkey={`autonomous-${selected.id}`}title="Autopilot run"summary={autopilotSummary(autopilotRun)}- defaultOpen={!!runStage || (autopilotRun.status === 'running' && !autopilotRun.interrupted)}+ defaultOpen={!!runStage || autopilotRun.interrupted || ['running', 'awaiting-approval', 'needs-human', 'failed'].includes(autopilotRun.status)}><AutonomousRunPanel project={selected} auto={autonomous} selectedStage={runStage} onSelectStage={setRunStage} framed={false} /></StageSection>diff --git a/client/src/pages/MusicVideo.test.jsx b/client/src/pages/MusicVideo.test.jsxindex f89281b5dd..7bc9b94e4b 100644--- a/client/src/pages/MusicVideo.test.jsx+++ b/client/src/pages/MusicVideo.test.jsx@@ -1225,6 +1225,42 @@ describe('MusicVideo autonomous shot planner (#1855)', () => {});});+describe('MusicVideo autonomous mode setup experience', () => {+ it('renders autonomous run at top of setup, hides lyrics fork callout when no lyrics exist, and reflects progress in next action', async () => {+ const autoProject = {+ id: 'mv-auto-1',+ name: 'Autonomous MV',+ mode: 'autonomous',+ status: 'draft',+ trackId: null,+ uploadedAudioFilename: null,+ audioAnalysis: null,+ scenes: [],+ autonomousRun: {+ id: 'run-1',+ status: 'running',+ stage: 'lyrics',+ stages: { lyrics: { step: 'draft' } },+ output: {},+ brief: { prompt: 'A synthwave adventure' },+ },+ };+ await openProject(autoProject, 'setup');++ const runRegion = screen.getByRole('region', { name: 'Autonomous run' });+ expect(runRegion).toBeInTheDocument();++ expect(screen.queryByRole('heading', { name: 'Revise lyrics & song' })).toBeNull();+ expect(screen.queryByRole('button', { name: 'Fork & revise song' })).toBeNull();++ expect(screen.queryByRole('button', { name: 'Attach a track' })).toBeNull();+ expect(screen.getByRole('button', { name: 'Writing the lyric draft…' })).toBeDisabled();++ expect(screen.queryByText(/Approvals: 0 of 3 approved/)).toBeNull();+ expect(screen.getByText(/Autopilot: writing the lyric draft/i)).toBeInTheDocument();+ });+});+describe('MusicVideo lyrics and shot coverage (#8964)', () => {it('imports pasted lyrics, shows the cues, and persists an edited line on blur', async () => {const cues = [