{"record":{"id":"fe2435e842a71955","repo":"affaan-m/ECC","slug":"range-must-contain-two-frame-integers","errorCode":null,"errorMessage":"range must contain two frame integers","messagePattern":"range must contain two frame integers","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/tasteforge/integration.py","lineNumber":69,"sourceCode":"\n\ndef _integer(value: Any, minimum: int = 0) -> int:\n    if type(value) is not int or value < minimum:\n        raise ValueError(\"frame/count must be an exact integer in range\")\n    return value\n\n\ndef _rate(value: Any) -> tuple[int, int]:\n    _object(value, {\"numerator\", \"denominator\"})\n    n, d = (_integer(value[k], 1) for k in (\"numerator\", \"denominator\"))\n    if math.gcd(n, d) != 1:\n        raise ValueError(\"fps must be a reduced positive rational\")\n    return n, d\n\n\ndef _range(value: Any, bounds: list[int] | None = None) -> list[int]:\n    if not isinstance(value, list) or len(value) != 2:\n        raise ValueError(\"range must contain two frame integers\")\n    start, end = (_integer(v) for v in value)\n    if start >= end or (bounds is not None and (start < bounds[0] or end > bounds[1])):\n        raise ValueError(\"frame range is empty or outside its bounds\")\n    return value\n\n\ndef _overlap(a: list[int], b: list[int]) -> bool:\n    return a[0] < b[1] and b[0] < a[1]\n\n\ndef _sha(value: Any) -> str:\n    if not isinstance(value, str) or not re.fullmatch(r\"[a-f0-9]{64}\", value):\n        raise ValueError(\"resolved SHA-256 required\")\n    return value\n\n\ndef _identity(info: os.stat_result) -> tuple:\n    return (info.st_dev, info.st_ino, info.st_size, info.st_mtime_ns, info.st_ctime_ns)","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/tasteforge/integration.py#L51-L87","documentation":"Shape guard in _range: a value expected to be a frame range must be a list of exactly two integers (in and out points). The supplied value is not a 2-element list, so clip timing cannot be interpreted.","triggerScenarios":"Passing a tuple instead of a list, a dict, a single int, or a 3-element list (e.g. [start, end, step]) as source_range/in/out values consumed by _snapshot, _check_clip, _binding, _preserved_stack, or _inserts.","commonSituations":"Ranges stored as tuples in Python code, JSON that flattened ranges differently, or code that appends a step/stride to range triples.","solutions":["Convert to a two-element list: list(value[:2]) or [start, end]","Ensure both elements are exact ints (see _integer) — convert floats/strings first","Check upstream code for tuples and convert with list(...) before bundle construction"],"exampleFix":"// before\nclip_range = (100, 200)  # tuple\n// after\nclip_range = [100, 200]  # list of two ints","handlingStrategy":"type-guard","validationCode":"def as_range(v):\n    assert isinstance(v, list) and len(v) == 2, f\"bad range: {v!r}\"\n    return [int(v[0]), int(v[1])]","typeGuard":"def is_frame_range(v) -> bool:\n    return isinstance(v, list) and len(v) == 2 and all(type(x) is int for x in v)","tryCatchPattern":"try:\n    bundle = build_application_bundle(data)\nexcept ValueError as e:\n    if \"two frame integers\" in str(e):\n        print(\"range is not a 2-element int list; convert tuples/normalize shape\")\n    else:\n        raise","preventionTips":["Store ranges as lists [start, end], not tuples or triples","Normalize all range inputs through a single as_range() helper","Document that ranges are 2-element lists in bundle-producing code"],"tags":["type-mismatch","frames","validation"],"backgroundTag":"type-mismatch","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}