affaan-m/ECC · error · ValueError

protected interval has no original video stack

Error message

protected interval has no original video stack

What it means

TasteForge's build_application_bundle validates that every user-marked 'protected' interval in the compiled edit actually overlaps at least one clip on a video track in the original timeline (checked in _preserved_stack). If a protected range exists but no original video clip covers any part of it, the bundle cannot guarantee the original footage is preserved there, so it refuses to build. This is a consistency check between the protected-interval list and the actual video stack.

Solutions

  1. Inspect each protected interval's [start, end] against the video-track clip ranges in the compiled project and fix ranges that no longer cover any clip
  2. Remove the stale protected interval, or re-derive protected ranges from the current video stack before calling build_application_bundle
  3. Verify the tracks dict passed in still contains the video tracks (keys starting with 'video') that used to cover the interval — the check ignores audio/overlay tracks

Example fix

// before
protected_intervals: [{range: [5000, 6000], reason: "hero shot"}]  // video clips end at 4800
// after
protected_intervals: [{range: [4000, 4800], reason: "hero shot"}]  // overlaps existing clip
Defensive patterns

Strategy: validation

Validate before calling

function ensureProtectedRangesCoverVideo(protected, tracks) {
  const videoClips = Object.entries(tracks)
    .filter(([k]) => k.startsWith("video"))
    .flatMap(([, clips]) => clips);
  for (const p of protected) {
    const covered = videoClips.some(c => p.range[0] < c.end && c.start < p.range[1]);
    if (!covered) throw new Error(`protected range ${JSON.stringify(p.range)} covers no video clip`);
  }
}

Try / catch

try {
  const bundle = buildApplicationBundle(config);
} catch (e) {
  if (e.message.includes("protected interval has no original video stack")) {
    config.protected_intervals = recomputeProtectedFromVideoStack(config);
    // retry build
  } else throw e;
}

Prevention

When it happens

Trigger: Calling build_application_bundle with a config whose protected_intervals contain a range (item['range'] within bounds, with a 'reason') that does not overlap any clip on any track whose key starts with 'video'. This happens when the protected interval refers to a deleted clip, a typo'd frame range, or clips on non-video tracks only (e.g. audio).

Common situations: Editing a compiled project where the user marked a region as protected but the corresponding video clip was removed or trimmed earlier in the pipeline; copy-pasting protected ranges between projects with different clip layouts; timebase drift after re-compilation so ranges no longer align.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/572a66efec1c9c33. Report an issue: GitHub.

Appendix: source

Thrown at skills/taste-application/scripts/tasteforge/integration.py:274

        raise ValueError("source capacity does not match native offsets")
    source = _range(item["source_range"], [clip["left_offset"], clip["left_offset"] + duration])
    target = _range(item["timeline_range"], [clip["start"], clip["end"]])
    mapped = [clip["start"] + f - clip["left_offset"] for f in source]
    if mapped != target or (audio and target != [clip["start"], clip["end"]]):
        raise ValueError("source/audio placement must preserve native timing")
    return track, index


def _preserved_stack(protected: Any, tracks: dict, bounds: list[int]) -> list[dict]:
    if not isinstance(protected, list) or not protected:
        raise ValueError("protected intervals must be explicit and nonempty")
    for item in protected:
        _object(item, {"range", "reason"})
        _range(item["range"], bounds)
        _text(item["reason"])
        if not any(_overlap(item["range"], [c["start"], c["end"]])
                   for key, clips in tracks.items() if key.startswith("video") for c in clips):
            raise ValueError("protected interval has no original video stack")
    return [{"track": track, "clip_index": index, "clip": copy.deepcopy(clip),
             "clip_sha256": _digest(clip)}
            for track, clips in sorted(tracks.items()) for index, clip in enumerate(clips)
            if any(_overlap(p["range"], [clip["start"], clip["end"]]) for p in protected)]


def _candidates(items: list, source_hash: str, input_hash: str, source_url: str) -> dict:
    result = {}
    for item in items:
        _object(item, {"id", "media", "media_frames", "fps", "origin", "relationship",
                       "source_sha256", "compiled_input_sha256", "review_status", "generation_receipt"})
        name = _text(item["id"])
        if name in result:
            raise ValueError("candidate ids must be unique")
        _artifact(item["media"])
        _integer(item["media_frames"], 1)
        _rate(item["fps"])
        if item["origin"] != "provider_generated" or item["relationship"] != "generated_variation":

View on GitHub (pinned to 8321021c54)