{"record":{"id":"ec3e93d099178faf","repo":"affaan-m/ECC","slug":"could-not-append-event-id","errorCode":null,"errorMessage":"could not append {event['id']}","messagePattern":"could not append (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/tasteforge/resolve.py","lineNumber":294,"sourceCode":"    appended = []\n    for event in plan:\n        imported = media_pool.ImportMedia([event[\"asset\"]])\n        if not imported or len(imported) != 1:\n            raise RuntimeError(f\"could not import {event['asset']}\")\n        items = media_pool.AppendToTimeline(\n            [\n                {\n                    \"mediaPoolItem\": imported[0],\n                    \"startFrame\": 0,\n                    \"endFrame\": event[\"frames\"] - (source_end_mode == \"inclusive\"),\n                    \"mediaType\": 1,\n                    \"trackIndex\": event[\"track\"],\n                    \"recordFrame\": event[\"record_frame\"],\n                }\n            ]\n        )\n        if not items or len(items) != 1:\n            raise RuntimeError(f\"could not append {event['id']}\")\n        item = items[0]\n        for key, value in [\n            (\"Opacity\", event[\"opacity\"]),\n            (\"CompositeMode\", event[\"composite\"]),\n        ]:\n            if not item.SetProperty(key, value):\n                raise RuntimeError(f\"could not set {key} for {event['id']}\")\n        _readback(timeline, item, event)\n        appended.append((event, item))\n    receipts = []\n    for event, item in appended:\n        actual = _readback(timeline, item, event)\n        receipts.append(\n            {\n                \"id\": event[\"id\"],\n                \"asset\": event[\"asset\"],\n                \"requested\": {\n                    key: event[key]","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/tasteforge/resolve.py#L276-L312","documentation":"After importing the asset, apply_placements calls media_pool.AppendToTimeline with explicit startFrame/endFrame/trackIndex/recordFrame and requires exactly one timeline item back. If AppendToTimeline returns None, an empty list, or more than one item, the append did not land as requested and it raises this RuntimeError naming the event id.","triggerScenarios":"recordFrame beyond the timeline end (Resolve pads differently or rejects), endFrame <= startFrame (e.g. frames==1 with source_end_mode='inclusive' yields endFrame 0), trackIndex pointing at a track Resolve won't write, or Resolve silently failing the placement due to format mismatch.","commonSituations":"Very short overlays (1 frame) combined with the wrong source_end_mode convention for the host; record frames computed at the wrong fps (see the fps mismatch guard) landing past the timeline duration; Resolve version behavior differences in AppendToTimeline returns.","solutions":["Verify the host's endpoint convention and pass the correct source_end_mode ('inclusive' or 'exclusive') as documented on this Resolve install.","Ensure record_frame + frames stays within the timeline duration and trackIndex refers to an existing video track.","Compute event['frames'] at the timeline's true fps so endFrame > startFrame for every event."],"exampleFix":"// before\napply_placements(tl, pool, placements, source_end_mode=\"exclusive\", ...)\n// after\napply_placements(tl, pool, placements, source_end_mode=\"inclusive\", ...)  # convention verified on this host","handlingStrategy":"validation","validationCode":"tl_end = timeline.GetEndFrame()\nfor e in plan:\n    end = e[\"record_frame\"] + e[\"frames\"] - (mode == \"inclusive\")\n    if end <= e[\"record_frame\"] or end > tl_end:\n        raise ValueError(f\"event {e['id']} out of timeline bounds\")","typeGuard":"def placements_in_bounds(plan, timeline, mode):\n    tl_end = timeline.GetEndFrame()\n    return all(\n        e[\"frames\"] > (mode == \"inclusive\")\n        and e[\"record_frame\"] + e[\"frames\"] - (mode == \"inclusive\") <= tl_end\n        for e in plan\n    )","tryCatchPattern":"try:\n    apply_placements(tl, pool, placements, source_end_mode=mode, ...)\nexcept RuntimeError as e:\n    if \"could not append\" in str(e):\n        print(\"verify source_end_mode convention and record frames on this host\")\n    else:\n        raise","preventionTips":["Verify the host's endpoint convention (inclusive vs exclusive) once and pin it in config.","Compute record frames and durations at the timeline's real fps.","Keep at least 1 frame of duration per event; guard frames >= 1 in planning."],"tags":["resolve","timeline","append","runtime"],"backgroundTag":"unexpected-api-response-shape","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"}