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
Give Cast & sets supporting cast their own photographic sheets
Claude94dac998605d
diff --git a/server/lib/README.md b/server/lib/README.mdindex b8abc30c35..93d4e1e33c 100644--- a/server/lib/README.md+++ b/server/lib/README.md@@ -847,7 +847,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub| `musicVideoAspect.js` | `musicVideoAspect(project)` (treatment brief aspect, default 16:9), `MUSIC_VIDEO_FRAME_GEN_SIZES` and `musicVideoFrameGenSize(project)`: the size every Music Video reference frame is requested at, so a backend never picks portrait for a 16:9 video. `musicVideoAtAspect(project, aspect)` re-frames the project for one render (a vertical social cut) without touching the record. Shared by `productionDispatch.js`, `documentRender.js` and the client board. || `musicVideoMotion.js` | `MOTION_CONTINUITY_CLAUSE`: the clause every Music Video motion (i2v) prompt ends with, pinning the reference frame's lighting, time of day and palette. Shared by `handoff.js` and the client board. |-| `musicVideoConditioning.js` | `musicVideoStyleImages`, `musicVideoStylePrompt`, `musicVideoStyleBasis`, and `musicVideoStyleReferenceCapacity` supply bounded moodboard conditioning and text fallback; `musicVideoConditioningReferences(project, scene)` selects the approved character sheet and scene's mapped set plate, with capped project-wide fallback; shared by board and production. |+| `musicVideoConditioning.js` | `musicVideoStyleImages`, `musicVideoStylePrompt`, `musicVideoStyleBasis`, and `musicVideoStyleReferenceCapacity` supply bounded moodboard conditioning and text fallback; `musicVideoConditioningReferences(project, scene)` selects the approved character sheet, the scene's mapped set plate and the sheets of supporting cast the scene's prompt names (capped at 4), with capped project-wide fallback; shared by board and production. || `musicVideoMediumPlan.js` | `normalizeMusicVideoProductionPolicy`, `planMusicVideoMedia`, `summarizeMusicVideoMediumPlan`, and `codeFirstProductionAssets`: pinned shot media, union-of-intervals video allowance, and selected-asset preflight shared by planning and Board review. `musicVideoBriefTools`, `musicVideoBriefAllowsVideo` and `musicVideoToolPolicyConflict` read the brief's selected tools against the policy (the setup warning and the video-dispatch refusal). || `imageLimits.js` | MAX_IMAGE_EDGE, MAX_IMAGE_PIXELS — browser-safe image generation caps shared with validation. |diff --git a/server/lib/musicVideoConditioning.js b/server/lib/musicVideoConditioning.jsindex f53b8154c8..4305c8fdfd 100644--- a/server/lib/musicVideoConditioning.js+++ b/server/lib/musicVideoConditioning.js@@ -1,5 +1,6 @@import { isEditCapableMode, maxInputImages } from './imageGenCapabilities.js';import { RUNNER_FAMILIES } from './runners.js';+import { escapeRegExp } from './textUtils.js';/** Browser-safe reference selection shared by the board and production lanes. */export const MUSIC_VIDEO_MAX_CONDITIONING_REFERENCES = 4;@@ -12,6 +13,30 @@ export const MUSIC_VIDEO_MAX_CONDITIONING_REFERENCES = 4;export const isOutsideMusicVideoReference = (ref) => String(ref?.id || '').startsWith('mvr-board-')|| String(ref?.imageId || '').startsWith('pinterest-');+const namesIn = (text, phrase) => {+ const p = String(phrase || '').trim();+ return p.length >= 3 && new RegExp(`\\b${escapeRegExp(p)}\\b`, 'i').test(text);+};++/** The supporting cast members a scene's frame or shot prompt names, by name or role. */+function featuredCast(direction, scene) {+ const text = [scene?.framePrompt, scene?.prompt].filter(Boolean).join(' ');+ if (!text) return [];+ return (direction?.cast || []).filter((c) => namesIn(text, c.name) || namesIn(text, c.role));+}++/**+ * The director's own character references (an upload or a PortOS render, not+ * Cast & Sets output or outside inspiration) whose label's name, the part+ * before any " — ", " - ", ":" or "(", the scene's prompt names.+ */+function featuredAuthoredCharacters(references, scene) {+ const text = [scene?.framePrompt, scene?.prompt].filter(Boolean).join(' ');+ if (!text) return [];+ return references.filter((ref) => ref?.role === 'character' && ref.imageId && !String(ref.id || '').startsWith('mvr-cs-')+ && !isOutsideMusicVideoReference(ref) && namesIn(text, String(ref.label || '').split(/\s[—-]\s|[:(]/)[0]));+}+export function musicVideoConditioningReferences(project, scene) {const references = project?.visualSpec?.references || [];const stage = project?.castAndSets;@@ -19,9 +44,19 @@ export function musicVideoConditioningReferences(project, scene) {const setId = stage.direction?.songMap?.find((entry) => entry.section === scene.sectionIndex)?.setId;const character = references.find((ref) => ref?.id === 'mvr-cs-character' && ref.imageId);const plate = setId && references.find((ref) => ref?.id === `mvr-cs-set-${setId}` && ref.imageId);- // Check-in plates beyond the project-wide cap are still available for their- // own scenes. Their condition flag reflects that cap, not scene relevance.- if (character && plate) return [character, plate];+ // Check-in plates and cast sheets beyond the project-wide cap are still+ // available for their own scenes. Their condition flag reflects that cap,+ // not scene relevance. A supporting cast member's sheet joins the shots+ // that name them, and so does a director's own character reference whose+ // label names someone the shot names.+ if (character && plate) {+ const cast = featuredCast(stage.direction, scene)+ .map((c) => references.find((ref) => ref?.id === `mvr-cs-cast-${c.id}`.slice(0, 64) && ref.imageId))+ .filter(Boolean);+ const chosen = [character, plate, ...cast, ...featuredAuthoredCharacters(references, scene)];+ return chosen.filter((ref, i) => chosen.findIndex((r) => r.imageId === ref.imageId) === i)+ .slice(0, MUSIC_VIDEO_MAX_CONDITIONING_REFERENCES);+ }}// Legacy projects and incomplete check-ins retain the authored reference set.return references.filter((ref) => ref?.condition && ref.imageId && !isOutsideMusicVideoReference(ref))diff --git a/server/lib/musicVideoCreativeContext.js b/server/lib/musicVideoCreativeContext.jsindex d38aaa7d38..dbc7f4eb0d 100644--- a/server/lib/musicVideoCreativeContext.js+++ b/server/lib/musicVideoCreativeContext.js@@ -131,6 +131,8 @@ export function musicVideoDirectionContext(direction) {...(procedural ? lines('World rules:', [['layout', w.layout], ['depth', w.depth], ['lighting', w.lighting], ['camera', w.camera], ['transitions', w.transitions],]) : []),+ // Name a supporting cast member (or their role) in a shot that features them: that shot is conditioned on their sheet.+ ...((direction.cast || []).slice(0, 4).map((c) => `Cast ${trimTo(c.name, 80)}${c.role ? ` (${trimTo(c.role, 60)})` : ''}: ${[c.description, c.face, c.hair, c.wardrobe].filter(Boolean).map((v) => trimTo(v, 200)).join('; ')}`)),...((direction.looks || []).slice(0, 8).map((l) => `Look ${trimTo(l.name, 80)}: ${trimTo(l.description, 300)}; chapters: ${trimTo(l.chapters, 120)}`)),...((direction.sets || []).slice(0, 8).map((s) => `Set ${trimTo(s.name, 80)}: ${trimTo(s.description, 300)}; lighting: ${trimTo(s.lighting, 120)}${procedural ? `; image role: ${s.imageRole || 'background'}` : ''}`)),].join('\n').slice(0, 6000);diff --git a/server/lib/musicVideoValidation.js b/server/lib/musicVideoValidation.jsindex 725cc45856..92f0584bd9 100644--- a/server/lib/musicVideoValidation.js+++ b/server/lib/musicVideoValidation.js@@ -1171,7 +1171,7 @@ export const musicVideoCastAndSetsStartSchema = z.object({}).strict();// Regenerate with notes. Omitted notes = the open notes on the sheet. A-// `target` names an image (`character`, `expressions`, `looks`, `set:<id>`,+// `target` names an image (`character`, `expressions`, `looks`, `cast:<id>`, `set:<id>`,// `test:<n>`); any other note revises the direction.export const musicVideoCastAndSetsRegenerateSchema = z.object({notes: z.array(z.object({diff --git a/server/services/musicVideo/castAndSetsDirection.js b/server/services/musicVideo/castAndSetsDirection.jsindex da30e8f436..0daebd8ef1 100644--- a/server/services/musicVideo/castAndSetsDirection.js+++ b/server/services/musicVideo/castAndSetsDirection.js@@ -6,7 +6,8 @@ import { musicVideoAllowsMedia } from '../../lib/musicVideoMediaPolicy.js';* Before any image is made, one provider call reads the song as a story and* returns the production's cast and world: a logline, one protagonist (face,* hair, signature prop, a recurring gesture tied to a lyric hook, continuity- * rules), 1–4 wardrobe looks mapped to chapters, 3–8 sets (one dominant light+ * rules), 1–4 wardrobe looks mapped to chapters, up to 4 recurring supporting+ * cast members (photographic only), 3–8 sets (one dominant light* each) mapped to song sections, 2–4 in-set test frames, an overlay concept,* and the 2–4 mood-board images that best show the look. The prompt is told* explicitly that the mood board is look/lighting/texture reference only —@@ -57,6 +58,7 @@ export const CAST_SETS_LIMITS = Object.freeze({expressions: 8,questions: 4,overlayElements: 4,+ cast: 4,});export const CAST_SETS_IMAGE_ROLES = Object.freeze(['background', 'texture', 'decoration', 'cutout']);const TEXT = 1000;@@ -155,6 +157,7 @@ const OUTPUT_SHAPE = `{"rules": ["<continuity or safety rule>"]},"looks": [{ "name": "<SHORT NAME>", "description": "<the complete outfit>", "chapters": "<which parts of the song>" }],+ "cast": [{ "id": "<short-slug>", "name": "<a name>", "role": "<what they are in the video: drummer, shopkeeper, ...>", "description": "<who they are: age, vibe, attitude>", "face": "<face: skin, eyes, brows, distinguishing features>", "hair": "<hair>", "wardrobe": "<their one outfit>" }],"sets": [{ "id": "<short-slug>", "name": "<set name>", "description": "<the empty location, concrete and visual, with nobody in it>", "lighting": "<its one dominant light>", "sections": ["<section label it serves>"] }],"songMap": [{ "section": 0, "setId": "<short-slug>" }],"tests": [{ "setId": "<short-slug>", "look": "<SHORT NAME>", "action": "<what the protagonist does in this frame>", "caption": "<the lyric or beat it serves>" }],@@ -280,6 +283,7 @@ export function buildCastAndSetsPrompt(project, { moodImages = [], board = null,LOOK_AND_SET_RULES,'- songMap: one entry per song section index listed above, naming the set that section plays in.','- tests: in-set frames of the protagonist that prove the cast works in the world; each names a set id and a look name.',+ `- cast: the RECURRING supporting characters besides the protagonist that the song, concept or guidance calls for (band members, someone who returns across scenes), at most ${CAST_SETS_LIMITS.cast}; [] when the protagonist is alone. Each gets their own photographic character sheet. Shots that name a cast member by name or role are conditioned on that sheet, so give each a distinct name and a plain role word.`,'- Wet or revealing looks use opaque fabric so the video stays safe to post.','- questions: up to three things you need the director to decide.',].join('\n');@@ -388,6 +392,15 @@ const setSchema = z.object({sections: z.union([z.array(z.union([z.string(), z.number()])), z.string()]).optional(),}).passthrough();const songMapSchema = z.object({ section: z.union([z.number(), z.string()]), setId: z.string() }).passthrough();+const castSchema = z.preprocess(withoutNulls, z.object({+ id: z.string().optional(),+ name: prose(SHORT),+ role: prose(SHORT).optional(),+ description: prose(TEXT).optional(),+ face: prose(TEXT).optional(),+ hair: prose(TEXT).optional(),+ wardrobe: prose(TEXT).optional(),+}).passthrough());const testSchema = z.object({ setId: z.string(), look: text(SHORT).optional(), action: text(TEXT), caption: text(300).optional() }).passthrough();const overlaySchema = z.union([text(TEXT).transform((summary) => ({ summary, elements: [] })),@@ -407,6 +420,7 @@ const FIELD_PARSERS = {world: worldSchema,definitions: definitionsSchema,looks: z.array(lookSchema),+ cast: z.array(castSchema),sets: z.array(setSchema),songMap: z.array(songMapSchema),tests: z.array(testSchema),@@ -480,6 +494,20 @@ function normalizeSongMap(entries, sets, sections) {return [...out.values()].sort((a, b) => a.section - b.section);}+// Supporting cast: a named person with something to draw (face or description),+// unique slug ids, never the protagonist again.+function normalizeCast(cast, protagonist) {+ const seen = new Set();+ const lead = String(protagonist?.name || '').trim().toLowerCase();+ return cast.filter((c) => c.name && (c.face || c.description) && c.name.trim().toLowerCase() !== lead)+ .slice(0, CAST_SETS_LIMITS.cast).map((c, i) => {+ let id = slug(c.id) || slug(c.name) || `cast-${i + 1}`;+ while (seen.has(id)) id = `${id}-${i + 1}`;+ seen.add(id);+ return { id, name: c.name, role: c.role || '', description: c.description || '', face: c.face || '', hair: c.hair || '', wardrobe: c.wardrobe || '' };+ });+}+function normalizeTests(tests, sets, looks) {const setIds = new Set(sets.map((s) => s.id));return tests@@ -548,6 +576,8 @@ export function mergeCastAndSetsDirection(previous, parsed, { sections = [], medlook: pick('look', ''),protagonist,looks,+ // Photographic only: a procedural cast lives in `definitions`.+ ...(procedural ? {} : { cast: normalizeCast(pick('cast', []), protagonist) }),sets,songMap,tests,@@ -639,6 +669,7 @@ export function describeDirectionChanges(previous, next) {const protagonistFields = Object.keys({ ...p0, ...p1 }).filter((k) => !same(p0[k], p1[k]));if (protagonistFields.length) out.push(`Protagonist: ${nameList(protagonistFields)}`);if (!same(previous.looks, next.looks)) out.push('Wardrobe looks revised');+ if (!same(previous.cast || [], next.cast || [])) out.push('Supporting cast revised');if (!same(previous.world?.lighting, next.world?.lighting)) out.push('World lighting revised');const before = new Map((previous.sets || []).map((s) => [s.id, s]));const lit = [];diff --git a/server/services/musicVideo/castAndSetsPlan.js b/server/services/musicVideo/castAndSetsPlan.jsindex 929f98c935..970458bad6 100644--- a/server/services/musicVideo/castAndSetsPlan.js+++ b/server/services/musicVideo/castAndSetsPlan.js@@ -212,6 +212,30 @@ export function buildCastAndSetsImagePlan(project, direction, { revisionNotes =),};+ // Supporting cast: each recurring person gets their own photographic sheet,+ // the same five views as the protagonist's, so shots naming them keep them.+ for (const c of direction.cast || []) {+ const key = `cast:${c.id}`;+ plan[key] = {+ key,+ kind: 'cast',+ label: c.name,+ castId: c.id,+ deps: [],+ refKeys: [],+ prompt: join(+ `Photographic character reference sheet of ONE consistent person, ${c.name}${c.role ? `, the ${c.role}` : ''}: ${c.description || ''}`,+ identity(c),+ c.wardrobe && `Wearing ${c.wardrobe}`,+ p.name && `A different person from ${p.name}`,+ 'Five views on a seamless dark grey backdrop: FRONT, 3/4, PROFILE, BACK full-body, plus a FACE close-up, with small typewriter captions',+ style && `Look: ${style}`,+ `${PHOTO}, even studio light, lookbook realism`,+ note(key),+ ),+ };+ }+const plateStyle = withoutPeople(style, p.name);for (const set of direction.sets || []) {const key = `set:${set.id}`;@@ -291,8 +315,8 @@ export function noteImageKeys(target, plan) {if (t === 'protagonist' || t === 'cast') return ['character'];if (t === 'wardrobe') return ['looks'];if (t === 'expression') return ['expressions'];- const bySetName = Object.values(plan).find((item) => item.kind === 'plate' && item.label.toLowerCase() === t);- return bySetName ? [bySetName.key] : null;+ const byName = Object.values(plan).find((item) => ['plate', 'cast'].includes(item.kind) && item.label.toLowerCase() === t);+ return byName ? [byName.key] : null;}// ---- applying an approved result ---------------------------------------------@@ -301,7 +325,8 @@ export function noteImageKeys(target, plan) {* The visual-spec references the approved check-in contributes: the character* sheet (conditioning) first, then set plates by song coverage (conditioning* while the backend's reference cap allows, after any the director flagged- * themselves), then the looks and expression sheets as unconditioned+ * themselves), then the supporting cast sheets (conditioning only the shots+ * that feature them), then the looks and expression sheets as unconditioned* reference. Replaces any earlier Cast & Sets references; keeps the director's.*/export function castAndSetsReferences(project, stage) {@@ -327,15 +352,19 @@ export function castAndSetsReferences(project, stage) {const conditions = direction.medium !== 'procedural' || (set.imageRole || 'background') === 'background';push({ id: `${CAST_SETS_REF_PREFIX}set-${set.id}`.slice(0, 64), imageId: images[`set:${set.id}`]?.imageId, role: 'set', label: trimTo(set.name, 120), note: trimTo([set.description, set.lighting].filter(Boolean).join(' — '), 1000) }, conditions);}+ // Cast sheets condition only the shots that feature them (musicVideoConditioningReferences).+ for (const c of direction.cast || []) {+ push({ id: `${CAST_SETS_REF_PREFIX}cast-${c.id}`.slice(0, 64), imageId: images[`cast:${c.id}`]?.imageId, role: 'character', label: `${trimTo(c.name, 80)} — cast sheet`, note: trimTo([c.role, c.face, c.hair, c.wardrobe].filter(Boolean).join('; '), 1000) }, false);+ }push({ id: `${CAST_SETS_REF_PREFIX}looks`, imageId: images.looks?.imageId, role: 'wardrobe', label: 'Looks', note: trimTo((direction.looks || []).map((l) => l.name).join(', '), 1000) }, false);push({ id: `${CAST_SETS_REF_PREFIX}expressions`, imageId: images.expressions?.imageId, role: 'character', label: 'Expression sheet', note: trimTo(p.gesture, 1000) }, false);return [...existing, ...out];}/**- * The concept subjects the check-in seeds: the protagonist and one place per- * set. A subject the director authored (any id outside the `cs-` namespace)- * is never replaced, and a Cast & Sets subject whose name matches one of the+ * The concept subjects the check-in seeds: the protagonist, each supporting+ * cast member and one place per set. A subject the director authored (any id+ * outside the `cs-` namespace) is never replaced, and a Cast & Sets subject whose name matches one of the* director's is left out rather than duplicated.*/export function castAndSetsSubjects(project, stage) {@@ -353,6 +382,15 @@ export function castAndSetsSubjects(project, stage) {role: 'protagonist',});}+ for (const c of direction.cast || []) {+ ours.push({+ id: `${CAST_SETS_SUBJECT_PREFIX}cast-${c.id}`.slice(0, 64),+ kind: 'character',+ name: trimTo(c.name, 120),+ description: trimTo([c.role, c.description, c.face, c.hair, c.wardrobe].filter(Boolean).join('; '), 1000),+ role: 'supporting',+ });+ }for (const set of direction.sets || []) {ours.push({id: `${CAST_SETS_SUBJECT_PREFIX}set-${set.id}`.slice(0, 64),diff --git a/server/services/musicVideo/castAndSetsService.test.js b/server/services/musicVideo/castAndSetsService.test.jsindex 31cae5233c..2896aeffd1 100644--- a/server/services/musicVideo/castAndSetsService.test.js+++ b/server/services/musicVideo/castAndSetsService.test.js@@ -525,6 +525,37 @@ describe('Cast & Sets check-in', () => {expect([unknown.status, unknown.body.code]).toEqual([422, 'CAST_SETS_UNKNOWN_IMAGE']);});+ it('gives each supporting cast member a photographic sheet, shows it on the sheet, and publishes it as a reference on approval', async () => {+ const cast = [+ { id: 'rico', name: 'Rico', role: 'drummer', description: 'sweaty, grinning', face: 'stubble, brown eyes', hair: 'wet curls', wardrobe: 'black tank top' },+ // The protagonist is never listed again as supporting cast.+ { name: 'Keeper', role: 'lead', face: 'weathered' },+ ];+ runPrompt.mockResolvedValue({ text: JSON.stringify({ ...DIRECTION, cast }) });+ const project = await seed();+ await request(app).post(`/api/music-video/${project.id}/cast-and-sets`).send({});+ await runTo(project.id, 'review');+ expect(runPrompt.mock.calls[0][0].prompt).toMatch(/- cast: the RECURRING supporting characters/);+ const sheet = jobs.find((j) => keyOf(j) === 'cast:rico');+ expect(sheet.params.prompt).toMatch(/character reference sheet of ONE consistent person, Rico, the drummer/);+ expect(sheet.params.prompt).toMatch(/A different person from Keeper/);+ expect(sheet.params.referenceImagePaths).toBeUndefined();+ expect(jobs.map(keyOf)).not.toContain('cast:keeper');+ const reviewing = await current(project.id);+ const html = readFileSync(join(ROOT(), reviewing.devArtifacts.find((a) => a.id === reviewing.castAndSets.artifactId).file), 'utf8');+ expect(html).toContain('Supporting cast');+ expect(html).toContain('Rico · drummer');++ expect((await request(app).post(`/api/music-video/${project.id}/cast-and-sets/approve`).send({})).status).toBe(200);+ const done = await current(project.id);+ expect(done.visualSpec.references.find((r) => r.id === 'mvr-cs-cast-rico'))+ .toMatchObject({ imageId: `${sheet.id}.png`, role: 'character', condition: false });+ expect(done.concept.subjects.find((s) => s.id === 'cs-cast-rico')).toMatchObject({ kind: 'character', name: 'Rico', role: 'supporting' });+ // The planner reads the cast by name and role, so the shots it writes name who they feature.+ const { musicVideoDirectionContext } = await import('../../lib/musicVideoCreativeContext.js');+ expect(musicVideoDirectionContext(done.castAndSets.direction)).toContain('Cast Rico (drummer): sweaty, grinning; stubble, brown eyes');+ });+it('approves itself in auto mode, and fails with a reason when no provider can direct', async () => {const auto = await seed({ automation: { tools: ['image:codex'], checkins: { castAndSets: 'auto' } } });await request(app).post(`/api/music-video/${auto.id}/cast-and-sets`).send({});diff --git a/server/services/musicVideo/castAndSetsSheet.js b/server/services/musicVideo/castAndSetsSheet.jsindex 2433eece72..bf387e09d6 100644--- a/server/services/musicVideo/castAndSetsSheet.js+++ b/server/services/musicVideo/castAndSetsSheet.js@@ -3,9 +3,9 @@** One self-contained page the director reviews before the storyboard: the* logline, the protagonist's facts beside the canonical character sheet, the- * looks, the expression sheet, the in-set tests, every set plate with the song- * sections it serves, a song-map bar colored by set, the overlay concept and- * the questions that need an answer.+ * looks, the expression sheet, the in-set tests, the supporting cast sheets,+ * every set plate with the song sections it serves, a song-map bar colored by+ * set, the overlay concept and the questions that need an answer.** Self-contained means no network: every image arrives as a `data:` URI from* the caller, the type uses system font stacks (no web fonts), and there is no@@ -162,6 +162,12 @@ export function renderCastAndSetsSheet({return figure(images[`set:${s.id}`], s.name, caption, 'set', procedural ? 'No raster image: drawn in code' : undefined);}).join('');+ const cast = procedural ? [] : (d.cast || []);+ const castFigures = cast.map((c) => {+ const caption = `<b>${e(c.name)}${c.role ? ` · ${e(c.role)}` : ''}</b><span>${e([c.description, c.face, c.hair, c.wardrobe && `Wearing ${c.wardrobe}`].filter(Boolean).join(' '))}</span>`;+ return figure(images[`cast:${c.id}`], `${c.name} character reference sheet`, caption, 'set');+ }).join('');+const bar = sections.map((s) => {const setId = setOfSection.get(s.index);const color = colorOf.get(setId) || NEUTRAL;@@ -203,7 +209,8 @@ ${worldFacts ? `<section><h2><small>World</small>How the environments behave</h2${figure(images.looks, 'Wardrobe looks', looksCaption ? `Wardrobe by chapter: ${looksCaption}` : 'Wardrobe', 'wide')}<div class="grid2">${figure(images.expressions, 'Expression sheet', `Expression range for lip-sync keyframes.${p.gesture ? ` Includes the gesture: ${e(p.gesture)}` : ''}`)}${tests[0] ? figure(images['test:1'], 'First in-set test', e(tests[0].caption || tests[0].action)) : ''}</div></section>-<section><h2><small>In-set tests</small>The protagonist, in the world</h2><div class="row">${testFigures}</div></section>`}+<section><h2><small>In-set tests</small>The protagonist, in the world</h2><div class="row">${testFigures}</div></section>+${castFigures ? `<section><h2><small>Supporting cast</small>${cast.length} recurring ${cast.length === 1 ? 'character' : 'characters'}</h2><p class="sub">Each shot that names one of them uses their sheet as a reference.</p><div class="sets">${castFigures}</div></section>` : ''}`}<section><h2><small>Sets</small>${sets.length} sets</h2><p class="sub">Each set has its own light, so a cut says where we are before anything else.</p><div class="sets">${setFigures}</div></section><section><h2><small>Song map</small>Where each set lives in the track</h2>${sections.length ? `<div class="bar">${bar}</div><div class="ticks"><span>0:00</span><span>${fmtTime(total)}</span></div><div class="tablewrap"><table>${rows}</table></div>` : '<p class="sub">The song has not been sectioned yet.</p>'}diff --git a/server/services/musicVideo/productionDispatch.test.js b/server/services/musicVideo/productionDispatch.test.jsindex 1da73a104e..93c5b90f78 100644--- a/server/services/musicVideo/productionDispatch.test.js+++ b/server/services/musicVideo/productionDispatch.test.js@@ -77,6 +77,32 @@ describe('production scene dispatch (#9066)', () => {}});+ it("adds the sheets of the supporting cast a shot names, within the cap", async () => {+ const checkedIn = { ...project,+ castAndSets: { status: 'approved', direction: {+ songMap: [{ section: 0, setId: 'harbor' }],+ cast: [{ id: 'rico', name: 'Rico', role: 'drummer' }, { id: 'mara', name: 'Mara', role: 'tattoo artist' }],+ } },+ visualSpec: { references: [+ { id: 'mvr-cs-character', imageId: 'character.png', condition: true },+ { id: 'mvr-cs-set-harbor', imageId: 'harbor.png', condition: true },+ { id: 'mvr-cs-cast-rico', imageId: 'rico.png', condition: false },+ { id: 'mvr-cs-cast-mara', imageId: 'mara.png', condition: false },+ // The director's own hand-made sheet, named by its label.+ { id: 'own-bassist', imageId: 'bassist.png', role: 'character', label: 'Lou — bassist sheet', condition: false },+ { id: 'mvr-board-2', imageId: 'board-face.png', role: 'character', label: 'Lou', condition: false },+ ] },+ };+ const paths = async (framePrompt) => {+ await dispatchProductionStep({ stepKind: 'frame', project: checkedIn, scene: { ...scene, sectionIndex: 0, framePrompt },+ route: { kind: 'image', mode: 'codex', model: null }, tag, settings });+ return enqueueJob.mock.calls.at(-1)[0].params.referenceImagePaths.map((path) => basename(path));+ };+ expect(await paths('The drummer counts in while Lou tunes')).toEqual(['character.png', 'harbor.png', 'rico.png', 'bassist.png']);+ expect(await paths('Rico, Mara and Lou crowd the booth')).toEqual(['character.png', 'harbor.png', 'rico.png', 'mara.png']);+ expect(await paths('She watches the harbor alone')).toEqual(['character.png', 'harbor.png']);+ });+it('appends capped style images after identities and carries a text look', async () => {await dispatchProductionStep({ stepKind: 'frame', project: { ...project,styleReferences: Array.from({ length: 8 }, (_, i) => ({ imageId: `style-${i}.png`, caption: 'teal shadows, fine grain' })),