CASE 06 / ENGINEERING IN DETAIL
AIGC Production Workflow
When a generation request times out, how can the task recover without reserving the same budget twice?
Context and constraints
This is an AI-assisted personal offline prototype. A mock provider simulates submission timeouts, interruptions, and repeated attempts to exercise recovery and budget accounting. Local media is used to check asset versions, review records, and edit assembly. Real provider calls and generated-content quality have not been evaluated.
Core workflow
This diagram is a simplified view of the technical approach.
- 01 / Shot ledgerVersions, requests, and budgets
- 02 / Simulated executionSubmission, polling, and recovery
- 03 / Quality reviewTechnical checks tied to versions
- 04 / Edit assemblySequencing, mixing, and subtitles
Design decisions and implementation
Record each attempt and handle unknown outcomes explicitly
ChallengeA request can time out after submission. Retrying immediately may execute the same task again.
ApproachStored shot versions, request hashes, attempt records, and audit events in SQLite WAL. When a submission outcome is unknown, the prototype retains the budget reservation and enters recovery or reconciliation.
ReasoningRecovery inspects existing attempts before polling, reconciling, or submitting again. An unresolved request keeps its budget reservation.
Check and reserve budgets in one transaction
ChallengePrompt changes, retries, and rejected media can leave cost reporting behind the actual number of attempts.
ApproachChecked project and episode budgets and reserved funds atomically within a transaction, using integer accounting. Retry counts span versions, and attempts rejected by quality checks retain their simulated costs.
ReasoningConcurrent tasks cannot each spend the same remaining budget. Revising a prompt does not reset the accumulated attempt count.
Recheck approvals when media changes
ChallengeValid media files can still fail content review, and replacing an asset can invalidate an earlier approval.
ApproachUsed FFmpeg / ffprobe to check dimensions, duration, audio tracks, black frames, and freezes. Content reviews are bound to the request, file, and acceptance context; changes require a new review.
ReasoningTechnical checks and content reviews have separate records. Version checks before assembly prevent a new file from inheriting an old file’s approval.
What the design addresses
Offline simulations cover unknown submissions, task recovery, budget reservations, and invalidated reviews, alongside local media checks and edit assembly.
Validation focus
- After an interruption, can recovery distinguish submitted tasks, unknown outcomes, and tasks never submitted?
- Do prompt or media changes correctly affect retry limits and review validity?
- Do the files, versions, and approvals used in an edit refer to the same valid attempt?
Research scope
Developed with AI assistance to explore generation-task scheduling and failure handling: task records, recovery logic, simulated budget accounting, technical media checks, and edit validation.
Current stage
Offline workflow and mock-provider validation are complete. Real providers and generated-content quality have not been evaluated, and the prototype has not been used for commercial delivery.