affaan-m/ECC · error · ValueError
insert proposals overlap
Error message
insert proposals overlap
What it means
Two insert proposals may not target overlapping spans of the timeline. _inserts tracks every accepted target range in 'occupied' and rejects any new insert whose timeline_range overlaps a previously seen one, since layered inserts are ambiguous (which one wins?) and unsupported.
Solutions
- Adjust the second insert's timeline_range so it starts at or after the previous insert's end
- Merge overlapping proposals into a single insert referencing one candidate
- Add a layout/scheduling step that packs inserts into non-overlapping slots before calling build_application_bundle
Example fix
// before
inserts: [{timeline_range: [1000, 2000], ...}, {timeline_range: [1500, 2500], ...}]
// after
inserts: [{timeline_range: [1000, 2000], ...}, {timeline_range: [2000, 3000], ...}] Defensive patterns
Strategy: validation
Validate before calling
function assertNonOverlappingInserts(inserts) {
const sorted = [...inserts].sort((a, b) => a.timeline_range[0] - b.timeline_range[0]);
for (let i = 1; i < sorted.length; i++) {
if (sorted[i].timeline_range[0] < sorted[i - 1].timeline_range[1])
throw new Error(`inserts overlap at ${sorted[i].timeline_range}`);
}
} Try / catch
try {
buildApplicationBundle(cfg);
} catch (e) {
if (e.message.includes("insert proposals overlap")) {
cfg.inserts = packNonOverlapping(cfg.inserts);
return buildApplicationBundle(cfg);
}
throw e;
} Prevention
- Run a sort-and-pack layout pass over insert ranges before building the bundle
- Use half-open [start, end) ranges consistently so adjacent inserts don't collide by one frame
- Merge or drop duplicate proposals when merging insert lists from multiple sessions
When it happens
Trigger: Two or more insert items in the inserts list whose timeline_range values intersect each other — e.g. [1000, 2000] and [1500, 2500]. Common when generating insert lists in bulk without a layout pass.
Common situations: Batch scripts that allocate equal-length slots but drift after one insert is lengthened; merging insert lists from two sessions; boundary-frame arithmetic errors when placing inserts back to back (inclusive vs exclusive end frames).
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/76acc61bc8364620.
Report an issue: GitHub.
Appendix: source
Thrown at skills/taste-application/scripts/tasteforge/integration.py:322
if any(evidence.get(key) != value for key, value in expected.items()):
raise ValueError("historical evidence does not bind the candidate source/input/bytes")
result[name] = item
return result
def _inserts(items: list, candidates: dict, config: dict, input_hash: str, edit_hash: str) -> None:
occupied = []
for item in items:
_object(item, {"candidate_id", "candidate_range", "timeline_range", "retime", "approval_file"})
candidate = candidates.get(_text(item["candidate_id"]))
if candidate is None or candidate["review_status"] != "approved":
raise ValueError("insert requires an approved, resolved candidate")
target = _range(item["timeline_range"], config["baseline"]["timeline_range"])
source = _range(item["candidate_range"], [0, candidate["media_frames"]])
if any(_overlap(target, p["range"]) for p in config["protected_intervals"]):
raise ValueError("insert overlaps protected original stack")
if any(_overlap(target, span) for span in occupied):
raise ValueError("insert proposals overlap")
if (item["retime"] != "none" or target[1] - target[0] != source[1] - source[0]
or _rate(candidate["fps"]) != _rate(config["baseline"]["fps"])):
raise ValueError("candidate fps/duration/retime ambiguity")
evidence = _artifact(item["approval_file"], parse_json=True)
expected = {"status": "approved", "candidate_sha256": candidate["media"]["sha256"],
"source_sha256": config["source"]["media"]["sha256"],
"compiled_input_sha256": input_hash,
"edit_context_sha256": edit_hash,
"candidate_range": source, "timeline_range": target}
if not isinstance(evidence, dict) or any(
_canonical(evidence.get(key)) != _canonical(value) for key, value in expected.items()):
raise ValueError("approval evidence must bind exact source, candidate and placement")
occupied.append(target)
def build_application_bundle(config: dict, compiled_input: dict | None, *, local_only: bool = False) -> dict:
"""Validate resident evidence and return a new deterministic, offline bundle."""
if type(local_only) is not bool:View on GitHub (pinned to 8321021c54)