Group shot timings inside chunk blocks
tests / test (push) Canceled after 0s
tests / windows-storage (push) Canceled after 0s

This commit is contained in:
2026-10-15 09:13:03 +00:00
parent dd52dd4b27
commit 5612719c4f
3 changed files with 22 additions and 10 deletions
+13 -5
View File
@@ -99,7 +99,12 @@ def format_sequence_prompt(
soundscape: str = "",
music: str = "",
) -> str:
"""Flatten clip-local slots into the absolute H3 Timeline prompt format."""
"""Format uniform clips as chunk blocks with relative shot timings.
Continuum treats square-bracket ranges as physical/logical chunk markers.
Shot timings belong inside each chunk and must therefore use plain
``start-end s:`` lines rather than creating additional Timeline sections.
"""
sections: list[str] = []
directive = str(shared_directive or "").strip()
@@ -107,11 +112,14 @@ def format_sequence_prompt(
sections.append(directive)
cursor = 0.0
for clip in sequence["clips"]:
duration = float(clip["duration"])
chunk_lines = [f"[{cursor:g}-{cursor + duration:g}s]"]
for slot in clip["slots"]:
start = cursor + float(slot["start"])
end = cursor + float(slot["end"])
sections.append(f"[{start:g}-{end:g}s]\n{slot['text']}")
cursor += float(clip["duration"])
start = float(slot["start"])
end = float(slot["end"])
chunk_lines.append(f"{start:g}-{end:g}s: {slot['text']}")
sections.append("\n".join(chunk_lines))
cursor += duration
sections.append(f"overall_soundscape: {str(soundscape or '').strip() or 'N/A'}")
sections.append(f"non_diegetic_music: {str(music or '').strip() or 'N/A'}")
return "\n\n".join(sections).strip()