Files
ShortVideoGenerator/docs/contracts.md
T

8.0 KiB

사용자와 생성 도구의 전달 형식

사용자는 저장소 루트의 Codex에서 $short-video-workflow와 주제·언어로 새 제작을 요청한다. 개별 $short-video-<작업> 호출에는 기존 제작과 사용할 선행 결과를 지정한다. 별도 HTTP 인증·응답 코드는 없고 로컬 JSON·검토 문서가 전달 표면이다. 누락·미확인·실패는 문제 기록과 준비 상태로 반환한다.

공통 출력

진행 기록은 schema_version="1.1"(새 제작) 또는 "1.0"(기존 결과), project_id, brief={topic,language}, settings, stages, reviews다. stages의 항목은 {stage_id,status,revision,artifact_path,issues}, issues는 {code,message,blocking}다. reviews의 항목은 {review_id,decision,artifact_refs,feedback}이며 artifact_refs는 {stage_id,revision} 배열이다.

단계 출력은 {schema_version,project_id,stage_id,revision,inputs,payload}다. revision은 1부터 시작하고 inputs는 실제 사용한 선행 버전 배열이다. project_id는 유일한 소문자 영숫자·하이픈이고, 경로는 저장소 루트 기준 상대 경로다. 이전 결과는 보존하며 review.md는 같은 JSON을 사람이 읽는 요약이다. 공통·단계별 필드 타입은 진행 스키마와 단계 스키마, 시작 형태는 양식에 있다.

단계는 01-topic, 02-research, 03-script, 04-title, 05-tts-split, 06-tts, 07-cuts, 08-scenes, 09-entities, 10-references, 11-images, 12-motion, 13-compose, 14-review다. 상태는 pending/draft/awaiting_input/awaiting_review/complete/stale/failed, 검토는 topic/story/scenes/final, 결정은 pending/approved/changes_requested/stale다.

외부 결과 제출

단계 요청 결과
06 engine, conda_env, language, units engine, model, voice, files, narration, unit_ranges
10 (1.1) engine, style_reference, render_profile, items scene_file, items
11 (1.1) engine, scene_path, render_profile, frames scene_file, frames
12 (1.1) engine, scene_path, render_profile, clips clips
13 timeline, narration_path, captions, title video, captions_path

06 units는 {id,block_ids,display_text,spoken_text,pronunciation_notes}, files는 {unit_id,media}, narration은 media, unit_ranges는 {unit_id,start_ms,end_ms}다. 요청 engine은 Qwen3-TTS, conda_env는 qwen3-tts이며 model·voice는 실제 사용값을 결과에 기록한다.

1.0의 기존 이미지 모델 요청·결과 정의는 그대로 읽고 검증한다. 기존 제작·r1 미디어를 변환하거나 덮어쓰지 않는다. 새 1.1 프로젝트의 settings는 기존 aspect_ratio/max_duration_ms/max_cut_duration_ms/style_reference/tts_engine/conda_env 상수를 유지하고 image_model 대신 visual_engine="Blender"를 갖는다. 1.1 프로젝트의 inputs·포인터는 유효한 기존 1.0 결과를 참조할 수 있다.

1.1의 08/10/11/12 외 payload는 1.0과 동일하다. 새 객체의 모든 명시된 키는 필수이고 추가 키를 허용하지 않는다.

  • BlendFile={path,verified,sha256,blender_version}. path는 루트 상대 문자열, verified는 불리언, sha256은 null 또는 소문자 64자리 16진수, blender_version은 null 또는 비어 있지 않은 문자열이다. verified=true이면 비어 있지 않은 경로·해시·버전이 모두 필요하다. 실제 파일 해시·재열기·버전을 확인하고 기록한다. .blend를 PNG/MP4 media로 기록하지 않는다.
  • RenderProfile={engine,device,fps,width,height,samples,seed}. engine은 BLENDER_EEVEE/CYCLES, device는 CPU/GPU, EEVEE는 GPU다. fps/width/height/samples는 양의 정수, seed는 0 이상 정수다. 의미 검사에서 9:16을 확인한다. 값은 렌더 요청이며 실제 지원·성공을 뜻하지 않는다.
  • 08 payload={scenes,connections,preview}. scenes/connections는 기존 구조다. preview는 null 또는 {scene_file:BlendFile,render_profile:RenderProfile,samples}이고 sample={id,cut_ids,media}다. id는 비어 있지 않고 유일하며 cut_ids는 비어 있지 않은 유일한 기존 컷 ID 배열, media는 실제 9:16 PNG 또는 MP4다. 대표 영상의 확인된 duration_ms는 0 초과 5000 이하이며 실제 크기·길이가 미확인/null이거나 verified=false인 미디어는 완료 근거가 아니다. 대표 샘플은 scenes 검토 근거로만 사용한다.
  • 10 request={engine:"Blender",style_reference:"references/1.png",render_profile,items}. item={id,kind,entity_id,prompt}이며 kind는 style/character/background/object, style/object는 entity_id=null, character/background는 실제 09의 해당 ID를 참조한다. result는 null 또는 {scene_file:BlendFile,items}; 결과 item={reference_id,object_name,media:image}. reference_id는 요청 ID, object_name은 비어 있지 않은 실제 .blend 오브젝트/컬렉션 이름이다. 기준 PNG와 실제 자산을 함께 대조한다.
  • 11 request={engine:"Blender",scene_path,render_profile,frames}. scene_path는 생성할 원본의 루트 상대 경로다. frame={id,cut_id,position,prompt,reference_ids,scene_name,frame_index}; position은 start/end, scene_name은 비어 있지 않은 실제 Scene 이름, frame_index는 0 이상 논리 프레임이다. 같은 컷의 start/end는 같은 Scene을 사용한다. result는 null 또는 {scene_file:BlendFile,frames}; 결과 frame={frame_id,media:image}다.
  • 12 request={engine:"Blender",scene_path,render_profile,clips}. scene_path는 11의 검증된 실제 .blend 경로이고 render_profile은 11과 동일하다. clip={cut_id,start_frame_id,end_frame_id,duration_ms,motion_prompt,scene_name,start_frame,end_frame}. scene_name과 끝점 참조는 실제 11의 같은 Scene과 일치하고 start_frame/end_frame은 0 이상이며 end_frame>start_frame이다. duration_ms는 미작성 시 null, 작성 시 0 초과 5000 이하 정수이며 실측 07 구간과 같아야 한다. result는 기존 null 또는 {clips:[{cut_id,media:video}]}다.

13/14의 구조는 바꾸지 않는다. 13 timeline={cut_id,video_path,start_ms,end_ms}, captions=[{id,start_ms,end_ms,text}], video는 media, captions_path는 실제 SRT 경로다. 합성은 기존 Remotion + FFmpeg 경로를 사용하며 실행파일의 외부 절대 경로·인증정보는 JSON에 담지 않는다.

1.1의 continuous는 동일 Scene의 앞 end와 뒤 start가 동일한 실제 PNG 파일을 반드시 공유하며 위치별 frame ID는 각각 유지한다. 기존 1.0의 선택적 공유 규칙은 소급 변경하지 않는다. cut은 서로 다른 Scene의 같은 frame_index를 구별하며 캐시 식별에는 Scene 이름이 필요하다. 프레임 구간은 [start_frame,end_frame)이다. 이번 물 영상은 50fps·5528개 프레임으로 시간 기준을 유지하고 마지막 끝점 PNG는 논리 프레임 5528을 평가한다. Blender의 실제 번호는 논리 프레임+1이다. 타 주제의 fps·길이를 이 값으로 고정하지 않는다.

media는 {path,kind,verified,duration_ms,width,height}다. kind는 audio/image/video, 미확인 값은 null, verified는 불리언이다. 검증된 음성은 WAV·길이·width/height=null, 이미지는 PNG·크기·duration_ms=null, 영상은 MP4·길이·크기가 필요하다. 시간은 ms 정수이며 완료한 길이는 양수다. 결과의 ID는 요청에 존재해야 한다.

대기와 오류

request만 있으면 result=null이고 실제 배정된 외부 단계는 awaiting_input이다. 부분 결과는 보존하되 완료가 아니다. 없는 파일·지원하지 않는 언어·시간 불일치는 issues의 원인·blocking 여부와 돌아갈 단계를 보고한다. 키·인증정보는 이 형식에 포함하지 않는다.

14 checks는 {area,verdict,evidence}, findings는 {severity,description,stage_id,cut_id}, recommendation은 pass/revise/incomplete다. area는 story/visual/audio/captions/timing/consistency, verdict는 pass/fail/not_checked, severity는 blocking/minor다. 특정 컷이 아니면 cut_id=null이다. 실제 완성본 부재는 incomplete이며 여섯 영역의 통과와 blocking 없음이 확인되어야 pass를 추천한다. 실제 final 사용자 승인과는 별개다.