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: retain renders with referenced posters or proof sheets
[._.]/ Adam Eivya139ae5d150b
diff --git a/server/services/musicVideo/renderCleanup.js b/server/services/musicVideo/renderCleanup.jsindex 15b9d964b0..ffb6f9bc9a 100644--- a/server/services/musicVideo/renderCleanup.js+++ b/server/services/musicVideo/renderCleanup.js@@ -1,7 +1,7 @@/** Retire regenerable renders without touching source takes or the cutting-room floor. */import { unlink, stat } from 'node:fs/promises';import { PATHS, atomicWrite, readJSONFile } from '../../lib/fileUtils.js';-import { join } from 'node:path';+import { join, basename } from 'node:path';import { createFileWriteQueue } from '../../lib/fileWriteQueue.js';import { safeUnder } from '../../lib/ffmpeg.js';import { ServerError } from '../../lib/errorHandler.js';@@ -72,8 +72,12 @@ async function finalInventory(projectId, history, pending = []) {for (const entry of retirementEntries(history, pending)) {// Only the full-render pipeline owns this tag. Source clips use musicVideo.projectId.if (entry.musicVideoProjectId !== projectId || !['music-video', 'music-video-code', 'music-video-document', 'music-video-eidoverse'].includes(entry.modelId) || entry.id === project.renderHistoryId) continue;- const ids = new Set([entry.id, entry.filename, safeUnder(PATHS.videos, entry.filename),- `/data/videos/${entry.filename}`, `/data/videos/${encodeURIComponent(entry.filename)}`]);+ const ids = new Set([entry.id]);+ for (const path of renderFiles(entry)) {+ const name = basename(path);+ const base = path === safeUnder(PATHS.videos, entry.filename) ? '/data/videos' : '/data/video-thumbnails';+ for (const identity of [name, path, `${base}/${name}`, `${base}/${encodeURIComponent(name)}`]) ids.add(identity);+ }const referenced = owners.some(owner => references(owner, ids))|| history.some(other => other.id !== entry.id && references(other, ids));const reason = !hasCurrent ? 'No completed replacement' : referenced ? 'Referenced by saved media or production records' : null;diff --git a/server/services/musicVideo/renderCleanup.test.js b/server/services/musicVideo/renderCleanup.test.jsindex c621ebe7a2..d352f489d6 100644--- a/server/services/musicVideo/renderCleanup.test.js+++ b/server/services/musicVideo/renderCleanup.test.js@@ -75,13 +75,16 @@ describe('derived render retention', () => {});it('preserves canonical render URLs during automatic and explicit cleanup', async () => {- await seed([entry('current'), entry('path'), entry('url'), entry('unused')]);- state.others = [{ composition: { media: '/data/videos/path.mp4' } }];- state.collections = [{ items: [{ url: 'https://example.test/data/videos/url.mp4?download=1' }] }];+ await seed([entry('current'), entry('path'), entry('url'), entry('proof'), entry('poster', { thumbnail: 'poster sample.jpg' }), entry('unused')]);+ writeFileSync(join(PATHS.videoThumbnails, 'proof-proof.png'), 'proof');+ state.others = [{ composition: { media: '/data/videos/path.mp4' }, proof: '/data/video-thumbnails/proof-proof.png' }];+ state.collections = [{ items: [{ url: 'https://example.test/data/videos/url.mp4?download=1' }, { poster: 'https://example.test/data/video-thumbnails/poster%20sample.jpg' }] }];expect(await cleanupSupersededFinals('example-project', { replacementId: 'current' })).toBe(1);const result = await cleanupRenders('example-project');- expect(result.finals.map(item => [item.id, !!item.reason])).toEqual([['path', true], ['url', true]]);- for (const id of ['current', 'path', 'url']) expect(existsSync(join(PATHS.videos, `${id}.mp4`))).toBe(true);+ expect(result.finals.map(item => [item.id, !!item.reason])).toEqual([['path', true], ['url', true], ['proof', true], ['poster', true]]);+ expect(existsSync(join(PATHS.videoThumbnails, 'proof-proof.png'))).toBe(true);+ expect(existsSync(join(PATHS.videoThumbnails, 'poster sample.jpg'))).toBe(true);+ for (const id of ['current', 'path', 'url', 'proof', 'poster']) expect(existsSync(join(PATHS.videos, `${id}.mp4`))).toBe(true);expect(existsSync(join(PATHS.videos, 'unused.mp4'))).toBe(false);});