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
plan: expand audio-continuity item into whole-episode audio gen strategy
Adam Eivy9d96cc9f784b
diff --git a/PLAN.md b/PLAN.mdindex dd4f4ba316..88741fc6c1 100644--- a/PLAN.md+++ b/PLAN.md@@ -16,7 +16,12 @@ For project goals, see [GOALS.md](./GOALS.md). For completed work, see [DONE.md]The pipeline now has multi-frame evaluation, auto-accept watchdog, cheap smoke fixture, and per-scene `imageStrength` continuation anchoring (see DONE.md). Remaining targets surfaced by the long E2E run:-- [ ] **Audio continuity across scenes.** mlx-video-with-audio generates audio per-clip; concatenated scenes have audible cuts at scene boundaries. Either render scenes silently and add a single backing audio pass at stitch time, or apply a short crossfade in `videoTimeline/local.js#buildFfmpegArgs` (already does video crossfades — extend to audio with `acrossfade`).+- [ ] **Whole-episode audio generation strategy.** mlx-video-with-audio generates audio per-clip and the resulting scene-level mini-soundtracks are abruptly different from each other — even a perfect xfade boundary won't fix it (it's like a DJ mixing five unrelated songs). The architectural answer is to STOP relying on per-clip audio and instead drive audio generation from the *whole-episode arc*. Scope of the eventual design:+ - **Source of truth.** The episode's prose/script/storyboards (already in the pipeline data model) define the arc — beats, tone shifts, scene durations. An audio generator should consume this, not the per-clip video output.+ - **Generator candidates.** Suno API (commercial, has duration control), MusicGen-MLX (local, but bounded to ~30s without stitching), AudioLDM2, or a multi-track approach (separate music + ambient + foley layers).+ - **Stitch path change.** `server/services/creativeDirector/stitchRunner.js` after timeline render: strip per-clip audio (`-c:v copy -an`), then a second ffmpeg pass overlays the generated track. New project-level `audioMode: 'per-clip' | 'silent' | 'generated' | 'uploaded-track'`. PLAN today's `'per-clip'` stays the default so existing projects don't regress.+ - **UX.** `EpisodeVideoStage.jsx` toolbar gets an "Audio" dropdown beside aspectRatio/quality. "Generated" kicks off the audio gen as part of the stitch pipeline; "Uploaded" opens a file picker.+ - **Investigation needed first** — pick a generator. Suno has the cleanest UX (give it a vibe prompt + duration); MusicGen-MLX is local but needs sliding-window stitching to exceed 30s; AudioLDM2 is older. ~150 LOC for the stitcher change once the generator is picked; the bigger question is which model and how to prompt it from script-level arc metadata. Treat this as a new sub-brainstorm when we pick it up — not a same-PR fix.- [ ] **Duplicate evaluator spawn dedup.** During the long E2E run, server logs showed `Task already being spawned, skipping duplicate` followed seconds later by a *second* agent spawning for the exact same task id. The CoS task lane logic ends up double-acquiring. Reproduce in a unit test against `taskSchedule` / `agentLifecycle` and fix the de-dup window (`agentLifecycle.js:114`).- [ ] **Render slowness on long sessions.** Per-scene render time degraded from ~3.5 min (early) to 10–30 min (late) within one project — likely accumulated listeners + queue races. Profile after sustained use; the round-22 dedup work probably already helps; verify.