import { type LaneCoordinatorPort } from './lane-coordinator.js'; import { ensureProjectWorkspace } from './workspace.js'; import type { AssetManifestArtifact } from './artifacts.js'; import type { SceneCandidateOutput, VideoExecutionPollResult, VideoExecutionReport, VideoProductionMode } from './types.js'; /** * Candidate-mode `execute-status` re-derives the asset-manifest from the * SELECTED candidate outputs. Before any winner is selected the derived * manifest is empty, so a naive overwrite DELETES the per-scene INPUT image * keyframes that `buildExecutionPayload` needs to keep pending scenes on the * image-to-video path (no keyframe → text-to-video → fresh character every * scene). This preserves the existing manifest's INPUT assets (operator * image keyframe / audio / video reference assets whose ids are NOT candidate * outputs) and merges them under the freshly-derived outputs — the same * merge-preserve shape the non-candidate branch already uses via `mergeAssets`. * * THE RATCHET IT CLOSES: reconstructing inputs ONLY from the current manifest * meant that once the manifest was video-only even ONCE * (`inputs.length === 0` → the old code `return derived`), the per-scene image * keyframes could NEVER be recovered — every subsequent poll re-derived a * video-only manifest, so later `produce` runs submitted `referencePaths: []` * → text-to-video → a fresh generic character each scene (the #1 identity-loss * defect). The fix additionally re-reads the per-scene image keyframe from its * on-disk SOURCE OF TRUTH — `references/scene-keyframe.png` — so a manifest * that was ratcheted to video-only SELF-HEALS on the next poll, without the * operator manually rebuilding an all-image manifest. * * Merge order (last wins on id collision): * 1. disk keyframes (base, so genuinely-missing scenes are restored) * 2. manifest INPUT assets (win over disk keyframes → operator-registered * metadata such as `backend`/`role` is preserved verbatim) * 3. freshly-derived candidate OUTPUTS (the video/image the poll produced) * The three id namespaces never collide by scene, so a scene keeps BOTH its * image keyframe AND any derived video output. When no keyframe exists on disk * and the manifest already carries the inputs, the result is byte-identical to * the prior behavior. */ export declare function preserveInputKeyframes(workspace: Awaited>, derived: AssetManifestArtifact): Promise; /** * Per-scene candidate poll — the auto-chain / per-scene-submit safety net. * * The single `execution-report` records only the LAST submission's job, but in * candidate mode each scene carries its OWN adapter job id on * `candidate.source.externalJobId`. When the latest report is blocked / job-less * (e.g. a later scene failed to submit and overwrote the report), the legacy * single-job poll bails with `execution-already-blocked` and strands earlier * scenes' in-flight jobs. This polls every still-`pending` candidate that has its * own job id, promotes each independently, and re-derives the asset-manifest — so * one blocked scene never hides the rest of the chain's progress. * * Returns the full refresh result, or `null` when there is no candidate artifact * or no pending candidate carries a job id (the caller then keeps the legacy * blocked-report behavior — preserving today's output for non-candidate runs). */ /** * Pure: the outputs of one poll that belong to `sceneIndex` — those tagged for * it, plus untagged ones (adapters that do not tag attach to every scene of the * run). A completed poll that carries outputs for OTHER scenes only says * nothing about this one; the caller must not mark it completed (#361: two * pool scenes shared one execution report, the poll carried scene 0's clip, * and scene 1 was written `completed` with zero outputs — a state * `waitForSceneVideo` can only time out against). */ export declare function pollOutputsForScene(outputs: VideoExecutionPollResult['outputs'], sceneIndex: number): SceneCandidateOutput[]; /** The issue text for a completion that carried nothing for a scene (#361). */ export declare function completedWithoutSceneOutputIssue(sceneIndex: number, outputs: VideoExecutionPollResult['outputs']): string; export declare function refreshExecutionStatus(projectSlug: string, options?: { root?: string; productionMode?: VideoProductionMode; env?: NodeJS.ProcessEnv; /** Injectable render-queue coordinator (tests). Default: chosen from the environment. */ laneCoordinator?: LaneCoordinatorPort; }): Promise<{ reportPath: string; report: VideoExecutionReport; poll: VideoExecutionPollResult; assetManifestPath?: string; }>; //# sourceMappingURL=execution-status.d.ts.map