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

Name every storyboard blocker when lyric timing holds the autopilot

Claudee53a233f8523
diff --git a/server/services/musicVideo/autonomousService.js b/server/services/musicVideo/autonomousService.js
index 5a27cedcaf..4834b88c8a 100644
--- a/server/services/musicVideo/autonomousService.js
+++ b/server/services/musicVideo/autonomousService.js
@@ -1,6 +1,6 @@
import { musicVideoMediaMode, musicVideoAllowsMedia } from '../../lib/musicVideoMediaPolicy.js';
import { prepareProductionReview } from './productionReviewService.js';
-import { assertProductionApproval, productionAlignmentBasis, productionReadiness, productionReviewBasis } from './productionReview.js';
+import { ALIGNMENT_UNVERIFIED_PROBLEM, assertProductionApproval, productionAlignmentBasis, productionReadiness, productionReviewBasis } from './productionReview.js';
import { CAST_SETS_WORKING } from './castAndSets.js';
/**
@@ -895,8 +895,13 @@ const STAGES = {
project = await getProject(project.id);
}
project = await settleProductionStage(project, run, 'storyboard');
- // Name why the timing was left unverified rather than only that it is provisional.
- if (timingHeld && !productionReadiness(project).storyboard.approved) throw runError(409, 'MUSIC_VIDEO_APPROVAL_REQUIRED', trimTo(timingHeld, 500));
+ // Name why the timing was left unverified rather than only that it is provisional,
+ // with the storyboard's other open problems so one resume can clear them all.
+ const storyboard = productionReadiness(project).storyboard;
+ if (timingHeld && !storyboard.approved) {
+ const others = storyboard.problems.filter((p) => p !== ALIGNMENT_UNVERIFIED_PROBLEM);
+ throw runError(409, 'MUSIC_VIDEO_APPROVAL_REQUIRED', trimTo([timingHeld, ...others].join(' '), 500));
+ }
assertProductionApproval(project, 'storyboard');
// The authoring stage's pin, else the run's code-authoring pin taken as
// given (production checks it exactly), else the direction LLM.
diff --git a/server/services/musicVideo/autonomousService.test.js b/server/services/musicVideo/autonomousService.test.js
index 2479f6dd11..01c061711f 100644
--- a/server/services/musicVideo/autonomousService.test.js
+++ b/server/services/musicVideo/autonomousService.test.js
@@ -1018,6 +1018,31 @@ describe('autopilot clears the gates it was granted on its own', () => {
expect(doubles.verifyAlignment).not.toHaveBeenCalled();
expect(doubles.startProduction).not.toHaveBeenCalled();
});
+
+ it('keeps holding on a failed alignment until the timings change, then verifies a re-alignment by hand', async () => {
+ doubles.alignLyrics = stub('align', async () => { throw new Error('aligner offline'); });
+ service.__setAutonomousDepsForTests(doubles);
+ analyzed({
+ lyricCues: [{ id: 'c1', text: 'rain on glass', startSec: null, endSec: null }, { id: 'c2', text: 'neon home', startSec: null, endSec: null }],
+ productionReview: { draft: { ...GUIDE, lyricsMode: 'vocal', timingStatus: 'provisional', storyboard: [shot] } },
+ });
+ await service.startAutonomousVideo({ prompt: 'p', tools: ['image:local'], ...GRANT[0] }, GRANT[1]);
+ await settled('needs-human');
+
+ // Unchanged timings: the stored error still describes them.
+ await service.resumeAutonomousVideo('mv-auto');
+ await settled('needs-human');
+ expect(runOf().error).toContain('Lyric alignment failed (aligner offline)');
+
+ const heard = (w, startSec) => ({ w, startSec, endSec: startSec + 1, conf: 'matched' });
+ store.get('mv-auto').lyricCues = [
+ { id: 'c1', text: 'rain on glass', startSec: 0, endSec: 12, words: [heard('rain', 0), heard('on', 1), heard('glass', 2)] },
+ { id: 'c2', text: 'neon home', startSec: 12, endSec: 20, words: [heard('neon', 12), heard('home', 13)] },
+ ];
+ await service.resumeAutonomousVideo('mv-auto');
+ await vi.waitFor(() => expect(doubles.startProduction).toHaveBeenCalledOnce());
+ expect(doubles.verifyAlignment).toHaveBeenCalledOnce();
+ });
});
describe('orchestrated mode (brief.orchestrator)', () => {
diff --git a/server/services/musicVideo/productionReview.js b/server/services/musicVideo/productionReview.js
index 98a61f7457..5167a4cfec 100644
--- a/server/services/musicVideo/productionReview.js
+++ b/server/services/musicVideo/productionReview.js
@@ -19,6 +19,9 @@ const source = p => {
};
export const productionAlignmentBasis = project => hash(source(project));
+/** The storyboard problem raised while the lyric timing is unverified for the current master. */
+export const ALIGNMENT_UNVERIFIED_PROBLEM = 'Lyric alignment is provisional or changed. Listen and verify the current word timings.';
+
/** A shot manifest belongs to one immutable authored document and one master timeline. */
export const documentStoryboardBasis = project => hash({
document: project.composition?.document?.directory, source: source(project),
@@ -229,7 +232,7 @@ export function productionReadiness(project) {
if (cues.length) boardProblems.push('This song has lyrics. Remove the instrumental exception or correct the song data.');
} else {
if (!cues.length) boardProblems.push('Import lyrics and align them to the current vocal; missing lyrics are not an instrumental.');
- if (draft.timingStatus !== 'verified' || review.alignmentBasis !== alignmentBasis) boardProblems.push('Lyric alignment is provisional or changed. Listen and verify the current word timings.');
+ if (draft.timingStatus !== 'verified' || review.alignmentBasis !== alignmentBasis) boardProblems.push(ALIGNMENT_UNVERIFIED_PROBLEM);
if (cues.some(c => !(Number.isFinite(c.startSec) && c.endSec > c.startSec && c.endSec <= duration)
|| !c.words?.length || c.words.some(w => !(Number.isFinite(w.startSec) && w.endSec > w.startSec)
|| w.startSec < c.startSec || w.endSec > c.endSec))) {