import assert from "node:assert/strict"; import { existsSync, mkdirSync, mkdtempSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { spawnSync } from "node:child_process"; import test from "node:test"; const assembleScript = new URL("./assemble-index.mjs", import.meta.url).pathname; // ── bgm_pending at the assembly boundary ───────────────────────────────────── // Regression: the flag survived into audio_meta.json but assemble rebuilt its audio object // from three named keys and dropped it, so the step that actually builds the film could not // tell "not ready yet" from "silent by design" and would ship the silent one. function assembleWith({ audioMeta, extraArgs = [] }) { const dir = mkdtempSync(join(tmpdir(), "product-launch-assemble-")); writeFileSync( join(dir, "STORYBOARD.md"), "---\nformat: 1920x1080\nmessage: T\n---\n\n## Frame 1 — A\n- duration: 3s\n- src: compositions/frames/01-a.html\n", ); mkdirSync(join(dir, "compositions", "frames"), { recursive: true }); writeFileSync( join(dir, "compositions", "frames", "01-a.html"), // pr-to-video's frame contract wants one bare