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
test: drive the music-video browser tests through per-step approval panels (#10307)
[._.]/ Adam Eivyfa4ee53fb8c1
diff --git a/server/routes/musicVideoProductionReview.browser.test.js b/server/routes/musicVideoProductionReview.browser.test.jsindex 10ebacc4c8..e57e1422a1 100644--- a/server/routes/musicVideoProductionReview.browser.test.js+++ b/server/routes/musicVideoProductionReview.browser.test.js@@ -80,7 +80,7 @@ describe.skipIf(!canRun)('production review in a real browser (Chrome, ffmpeg anawait saveProductionDraft(p.id, draft);const ui = join(PATHS.data, 'review-ui'); await mkdir(ui, { recursive: true });- const entry = `import React,{useEffect,useState} from 'react';import{createRoot}from'react-dom/client';import Panel from './src/components/musicVideo/ProductionReviewPanel.jsx';import useReview from './src/hooks/useMusicVideoProductionReview.js';function App(){const[p,setP]=useState(null);useEffect(()=>{fetch('/api/music-video/${p.id}/production-review').then(r=>r.json()).then(r=>setP(r.project))},[]);const review=useReview({project:p,replaceProject:setP});return p?<main style={{maxWidth:1100,margin:'auto',padding:24}}><h1>Music video production review</h1><Panel project={p} review={review} onOpenArtifact={id=>window.open('/api/music-video/${p.id}/dev-artifacts/'+id+'/file')}/></main>:null}createRoot(document.getElementById('root')).render(<App/>);`;+ const entry = `import React,{useEffect,useState} from 'react';import{createRoot}from'react-dom/client';import Panel from './src/components/musicVideo/ProductionReviewPanel.jsx';import useReview from './src/hooks/useMusicVideoProductionReview.js';const STEPS=[['art','Look step'],['storyboard','Storyboard step'],['proof','Make step']];function App(){const[p,setP]=useState(null);const[stage,setStage]=useState('art');const planning=useState(null);useEffect(()=>{fetch('/api/music-video/${p.id}/production-review').then(r=>r.json()).then(r=>setP(r.project))},[]);const review=useReview({project:p,replaceProject:setP});return p?<main style={{maxWidth:1100,margin:'auto',padding:24}}><h1>Music video production review</h1><nav>{STEPS.map(([id,name])=><button key={id} type="button" aria-pressed={stage===id} onClick={()=>setStage(id)}>{name}</button>)}</nav><Panel key={stage} project={p} review={review} stage={stage} planning={planning} onOpenArtifact={id=>window.open('/api/music-video/${p.id}/dev-artifacts/'+id+'/file')}/></main>:null}createRoot(document.getElementById('root')).render(<App/>);`;const { build } = await import(clientBundler[0]);const { default: react } = await import(clientBundler[1]);const { default: tailwind } = await import(clientBundler[2]);@@ -108,8 +108,9 @@ describe.skipIf(!canRun)('production review in a real browser (Chrome, ffmpeg anawait page.setViewportSize({ width: 1280, height: 1000 });}await page.getByRole('button', { name: 'Approve art direction', exact: true }).click();+ // Each step's panel records feedback against its own approval.+ await page.getByRole('button', { name: 'Storyboard step', exact: true }).click();await page.getByText('Review feedback and revision history', { exact: true }).click();- await page.getByLabel('Feedback stage').selectOption('storyboard');await page.getByLabel('Feedback target').fill('shot: chorus / operator');await page.getByLabel('Requested change').fill('Move the operator behind the threshold at the exit.');await page.getByRole('button', { name: 'Save revision feedback' }).click();@@ -121,6 +122,8 @@ describe.skipIf(!canRun)('production review in a real browser (Chrome, ffmpeg anconst beforeBoard = await page.evaluate(async id => (await fetch('/api/music-video/' + id + '/production-review')).json(), p.id);expect(beforeBoard.readiness.storyboard.problems).toEqual([]);await page.getByRole('button', { name: 'Approve lyric-timed storyboard' }).click();+ await page.getByRole('heading', { name: 'Lyric-timed storyboard approved', exact: true }).waitFor();+ await page.getByRole('button', { name: 'Make step', exact: true }).click();await page.getByRole('button', { name: 'Render animated proof' }).click();await page.locator('video').waitFor({ timeout: 120000 });await page.locator('video').evaluate(async video => { await video.play(); await new Promise(r => setTimeout(r, 400)); video.pause(); });@@ -129,8 +132,9 @@ describe.skipIf(!canRun)('production review in a real browser (Chrome, ffmpeg anawait page.getByLabel('Timecoded playback notes').fill('0:02 — subject enters the frame; 0:07 — pose and camera position differ and readable type remains clear. This is a synthetic workflow test, not artistic approval of a production video.');expect(await page.getByRole('checkbox', { name: /I watched this revision/ }).count()).toBe(0);await page.getByRole('button', { name: 'Approve — I reviewed this proof with audio' }).click();- await page.waitForFunction(() => [...document.querySelectorAll('[role=status]')].filter(el => el.textContent === 'Approved for this revision').length === 3);+ await page.getByRole('heading', { name: 'Animated proof approved', exact: true }).waitFor();const result = await store.getProject(p.id);+ expect(Object.keys(result.productionReview.approvals).sort()).toEqual(['art', 'proof', 'storyboard']);expect(result.productionReview.feedback[0].resolvedAt).toBeTruthy();expect(result.productionReview.approvals.proof.proofReview).toMatchObject({ watchedWithAudio: true, excerptId: result.productionReview.proof.excerptId, timecodedNotes: expect.stringContaining('0:02') });expect(errors).toEqual([]);diff --git a/server/routes/musicVideoRichAuthoring.browser.test.js b/server/routes/musicVideoRichAuthoring.browser.test.jsindex 964074f25a..874e00419f 100644--- a/server/routes/musicVideoRichAuthoring.browser.test.js+++ b/server/routes/musicVideoRichAuthoring.browser.test.js@@ -74,7 +74,7 @@ describe.skipIf(!canRun)('rich document authoring in a real browser (Chrome, ffmawait saveProductionDraft(p.id, draft);const ui = join(PATHS.data, 'review-ui'); await mkdir(ui, { recursive: true });- const entry = `import React,{useEffect,useState} from 'react';import{createRoot}from'react-dom/client';import Panel from './src/components/musicVideo/ProductionReviewPanel.jsx';import DocumentPanel from './src/components/musicVideo/DocumentCompositionPanel.jsx';import useReview from './src/hooks/useMusicVideoProductionReview.js';function App(){const[p,setP]=useState(null);useEffect(()=>{fetch('/api/music-video/${p.id}/production-review').then(r=>r.json()).then(r=>setP(r.project))},[]);const review=useReview({project:p,replaceProject:setP});return p?<main style={{maxWidth:1100,margin:'auto',padding:24}}><h1>Music video production review</h1><DocumentPanel project={p} onProject={setP} onSave={async patch=>{const r=await fetch('/api/music-video/${p.id}',{method:'PUT',headers:{'Content-Type':'application/json'},body:JSON.stringify(patch)});setP(await r.json())}}/><Panel project={p} review={review} onOpenArtifact={id=>window.open('/api/music-video/${p.id}/dev-artifacts/'+id+'/file')}/></main>:null}createRoot(document.getElementById('root')).render(<App/>);`;+ const entry = `import React,{useEffect,useState} from 'react';import{createRoot}from'react-dom/client';import Panel from './src/components/musicVideo/ProductionReviewPanel.jsx';import DocumentPanel from './src/components/musicVideo/DocumentCompositionPanel.jsx';import useReview from './src/hooks/useMusicVideoProductionReview.js';const STEPS=[['art','Look step'],['storyboard','Storyboard step'],['proof','Make step']];function App(){const[p,setP]=useState(null);const[stage,setStage]=useState('art');const planning=useState(null);useEffect(()=>{fetch('/api/music-video/${p.id}/production-review').then(r=>r.json()).then(r=>setP(r.project))},[]);const review=useReview({project:p,replaceProject:setP});return p?<main style={{maxWidth:1100,margin:'auto',padding:24}}><h1>Music video production review</h1><DocumentPanel project={p} onProject={setP} onSave={async patch=>{const r=await fetch('/api/music-video/${p.id}',{method:'PUT',headers:{'Content-Type':'application/json'},body:JSON.stringify(patch)});setP(await r.json())}}/><nav>{STEPS.map(([id,name])=><button key={id} type="button" aria-pressed={stage===id} onClick={()=>setStage(id)}>{name}</button>)}</nav><Panel key={stage} project={p} review={review} stage={stage} planning={planning} onOpenArtifact={id=>window.open('/api/music-video/${p.id}/dev-artifacts/'+id+'/file')}/></main>:null}createRoot(document.getElementById('root')).render(<App/>);`;const { build } = await import(clientBundler[0]);const { default: react } = await import(clientBundler[1]);const { default: tailwind } = await import(clientBundler[2]);@@ -127,7 +127,7 @@ describe.skipIf(!canRun)('rich document authoring in a real browser (Chrome, ffmawait page.getByLabel('Authoring renderer').selectOption('three');expect((await store.getProject(p.id)).mediaMode).toBe('code-only');const choreography = 'Energy target: driving chorus with an expansive exit.\n0:00–0:04 / opening downbeats: operator steps toward the door and raises the key; camera pushes in; title lands on the first vocal.\n0:04–0:10 / chorus accent: key turns, door swings outward, operator crosses the threshold; camera arcs around the prop; type clears before the exit.\nRepeat chorus: widen the doorway and increase the operator travel while retaining the copper motif.';- await page.getByText('Edit visual guide and storyboard', { exact: true }).click();+ await page.getByText('Edit art direction and visual guide', { exact: true }).click();await page.getByLabel('Timed choreography and energy plan', { exact: true }).fill(choreography);const [savedPlan] = await Promise.all([page.waitForResponse(response => response.url().endsWith('/production-review') && response.request().method() === 'PUT'),@@ -153,8 +153,9 @@ describe.skipIf(!canRun)('rich document authoring in a real browser (Chrome, ffmexpect(planned.status()).toBe(200);expect((await store.getProject(p.id)).treatment.shotDirections[0].medium).toBe('procedural');author.sectionId = buildCodeTimeline(await store.getProject(p.id)).sections[0].id;+ // Each step's panel records feedback against its own approval.+ await page.getByRole('button', { name: 'Storyboard step', exact: true }).click();await page.getByText('Review feedback and revision history', { exact: true }).click();- await page.getByLabel('Feedback stage').selectOption('storyboard');await page.getByLabel('Feedback target').fill('shot: chorus / operator');await page.getByLabel('Requested change').fill('Move the operator behind the threshold at the exit.');await page.getByRole('button', { name: 'Save revision feedback' }).click();@@ -166,6 +167,7 @@ describe.skipIf(!canRun)('rich document authoring in a real browser (Chrome, ffmconst beforeBoard = await page.evaluate(async id => (await fetch('/api/music-video/' + id + '/production-review')).json(), p.id);expect(beforeBoard.readiness.storyboard.problems).toEqual([]);await approve('Approve lyric-timed storyboard');+ await page.getByRole('button', { name: 'Make step', exact: true }).click();// Generation response, then the candidate the panel fetches in response to the updated project.// Observing both names the failing hop, and they also assert the candidate pointer is the one just staged.// A load-sensitive timeout here (#9806) was seen once with the server event loop stalled ~12s while@@ -200,8 +202,9 @@ describe.skipIf(!canRun)('rich document authoring in a real browser (Chrome, ffmawait page.getByLabel('Timecoded playback notes').fill('0:02 — subject enters the frame; 0:07 — pose and camera position differ and readable type remains clear. This is a synthetic workflow test, not artistic approval of a production video.');expect(await page.getByRole('checkbox', { name: /I watched this revision/ }).count()).toBe(0);await page.getByRole('button', { name: 'Approve — I reviewed this proof with audio' }).click();- await page.waitForFunction(() => [...document.querySelectorAll('[role=status]')].filter(el => el.textContent === 'Approved for this revision').length === 3);+ await page.getByRole('heading', { name: 'Animated proof approved', exact: true }).waitFor();const result = await store.getProject(p.id);+ expect(Object.keys(result.productionReview.approvals).sort()).toEqual(['art', 'proof', 'storyboard']);expect(result.productionReview.feedback[0].resolvedAt).toBeTruthy();expect(result.productionReview.approvals.proof.proofReview).toMatchObject({ watchedWithAudio: true, excerptId: result.productionReview.proof.excerptId, timecodedNotes: expect.stringContaining('0:02') });expect(errors).toEqual([]);diff --git a/server/routes/musicVideoSongRevision.browser.test.js b/server/routes/musicVideoSongRevision.browser.test.jsindex 1526299208..7efc1158b7 100644--- a/server/routes/musicVideoSongRevision.browser.test.js+++ b/server/routes/musicVideoSongRevision.browser.test.js@@ -69,7 +69,7 @@ describe.skipIf(!canRun)('song revision in Chrome (client dependencies required)} });const ui = join(PATHS.data, 'ui'); await mkdir(ui, { recursive: true });await symlink(join(client, 'node_modules'), join(ui, 'node_modules'), 'dir');- const entry = `import React,{useState} from 'react';import{createRoot}from'react-dom/client';import{BrowserRouter,useNavigate}from'react-router';import Panel from '${client}/src/components/musicVideo/SongRevisionPanel.jsx';import ReviewPanel from '${client}/src/components/musicVideo/ProductionReviewPanel.jsx';import useReview from '${client}/src/hooks/useMusicVideoProductionReview.js';import{cloneMusicVideoProject}from'${client}/src/services/apiMusicVideo.js';function App(){const[p,setP]=useState(${JSON.stringify(before)});const nav=useNavigate();const review=useReview({project:p,replaceProject:setP});return <main style={{maxWidth:1000,margin:'auto',padding:20}}><Panel key={p.id} project={p} onUpdated={setP} onFork={()=>cloneMusicVideoProject(p.id).then(next=>{setP(next);nav('/music-video/'+next.id+'/setup')})}/><ReviewPanel key={'review-'+p.id} project={p} review={review} onOpenArtifact={()=>{}}/></main>}createRoot(document.getElementById('root')).render(<BrowserRouter><App/></BrowserRouter>);`;+ const entry = `import React,{useState} from 'react';import{createRoot}from'react-dom/client';import{BrowserRouter,useNavigate}from'react-router';import Panel from '${client}/src/components/musicVideo/SongRevisionPanel.jsx';import ReviewPanel from '${client}/src/components/musicVideo/ProductionReviewPanel.jsx';import useReview from '${client}/src/hooks/useMusicVideoProductionReview.js';import{cloneMusicVideoProject}from'${client}/src/services/apiMusicVideo.js';const STEPS=[['art','Look step'],['storyboard','Storyboard step'],['proof','Make step']];function App(){const[p,setP]=useState(${JSON.stringify(before)});const[stage,setStage]=useState('art');const planning=useState(null);const nav=useNavigate();const review=useReview({project:p,replaceProject:setP});return <main style={{maxWidth:1000,margin:'auto',padding:20}}><Panel key={p.id} project={p} onUpdated={setP} onFork={()=>cloneMusicVideoProject(p.id).then(next=>{setP(next);nav('/music-video/'+next.id+'/setup')})}/><nav>{STEPS.map(([id,name])=><button key={id} type="button" aria-pressed={stage===id} onClick={()=>setStage(id)}>{name}</button>)}</nav><ReviewPanel key={'review-'+p.id+'-'+stage} project={p} review={review} stage={stage} planning={planning} onOpenArtifact={()=>{}}/></main>}createRoot(document.getElementById('root')).render(<BrowserRouter><App/></BrowserRouter>);`;await writeFile(join(ui, 'entry.jsx'), `import ${JSON.stringify(join(client, 'src/index.css'))};\n` + entry);await writeFile(join(ui, 'index.html'), '<html><head><meta name="viewport" content="width=device-width,initial-scale=1"></head><body><div id="root"></div><script type="module" src="/entry.jsx"></script></body></html>');const { build } = await import(bundler[0]); const { default: react } = await import(bundler[1]); const { default: tailwind } = await import(bundler[2]);@@ -100,13 +100,18 @@ describe.skipIf(!canRun)('song revision in Chrome (client dependencies required)const { productionAlignmentBasis } = await import('../services/musicVideo/productionReview.js');const doc = await importDocumentTemplate(selected.id, 'layered');musicVideoEvents.emit('song-revision', { projectId: selected.id, project: doc.project });- await page.getByText('Edit visual guide and storyboard', { exact: true }).click();+ await page.getByRole('button', { name: 'Storyboard step', exact: true }).click();+ await page.getByText('Edit storyboard shots', { exact: true }).click();const manifest = { documentDirectory: doc.document.directory, audioBasis: productionAlignmentBasis(doc.project), sourceFile: 'engine.js',shots: [{ id: 'authored-shot', sceneId: null, startSec: 0, endSec: 1, lyricCueIds: [], action: 'Open door', staging: 'Figure left', camera: 'Track', transition: 'Cut' }] };const upload = () => page.getByLabel('Import document shot manifest', { exact: true }).setInputFiles({ name: 'shots.json', mimeType: 'application/json', buffer: Buffer.from(JSON.stringify(manifest)) });await upload();await page.getByText('authored-shot — document source shot', { exact: true }).waitFor();+ // A bound document shot manifest blocks drafting on the Look step.+ await page.getByRole('button', { name: 'Look step', exact: true }).click();+ await page.getByText('Edit art direction and visual guide', { exact: true }).click();expect(await page.getByRole('button', { name: 'Draft art direction and shots' }).isDisabled()).toBe(true);+ await page.getByRole('button', { name: 'Storyboard step', exact: true }).click();const replacement = await importDocumentTemplate(selected.id, 'layered');musicVideoEvents.emit('song-revision', { projectId: selected.id, project: replacement.project });await page.waitForFunction(directory => document.body.textContent.includes(directory), replacement.document.directory);