{"record":{"id":"16903953e02d04b9","repo":"affaan-m/ECC","slug":"a-generated-candidate-cannot-claim-original-source-identity","errorCode":null,"errorMessage":"a generated candidate cannot claim original-source identity","messagePattern":"a generated candidate cannot claim original-source identity","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/tasteforge/integration.py","lineNumber":293,"sourceCode":"    return [{\"track\": track, \"clip_index\": index, \"clip\": copy.deepcopy(clip),\n             \"clip_sha256\": _digest(clip)}\n            for track, clips in sorted(tracks.items()) for index, clip in enumerate(clips)\n            if any(_overlap(p[\"range\"], [clip[\"start\"], clip[\"end\"]]) for p in protected)]\n\n\ndef _candidates(items: list, source_hash: str, input_hash: str, source_url: str) -> dict:\n    result = {}\n    for item in items:\n        _object(item, {\"id\", \"media\", \"media_frames\", \"fps\", \"origin\", \"relationship\",\n                       \"source_sha256\", \"compiled_input_sha256\", \"review_status\", \"generation_receipt\"})\n        name = _text(item[\"id\"])\n        if name in result:\n            raise ValueError(\"candidate ids must be unique\")\n        _artifact(item[\"media\"])\n        _integer(item[\"media_frames\"], 1)\n        _rate(item[\"fps\"])\n        if item[\"origin\"] != \"provider_generated\" or item[\"relationship\"] != \"generated_variation\":\n            raise ValueError(\"a generated candidate cannot claim original-source identity\")\n        if item[\"source_sha256\"] != source_hash or item[\"compiled_input_sha256\"] != input_hash:\n            raise ValueError(\"candidate is bound to a different source or input\")\n        if item[\"review_status\"] not in (\"pending\", \"rejected\", \"approved\"):\n            raise ValueError(\"explicit candidate review state required\")\n        evidence = _artifact(item[\"generation_receipt\"], parse_json=True)\n        if not isinstance(evidence, dict) or not isinstance(evidence.get(\"request_id\"), str):\n            raise ValueError(\"historical request evidence required\")\n        _text(evidence[\"request_id\"])\n        expected = {\"source_sha256\": source_hash, \"compiled_input_sha256\": input_hash,\n                    \"candidate_sha256\": item[\"media\"][\"sha256\"], \"source_url\": source_url}\n        if any(evidence.get(key) != value for key, value in expected.items()):\n            raise ValueError(\"historical evidence does not bind the candidate source/input/bytes\")\n        result[name] = item\n    return result\n\n\ndef _inserts(items: list, candidates: dict, config: dict, input_hash: str, edit_hash: str) -> None:\n    occupied = []","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/tasteforge/integration.py#L275-L311","documentation":"Every candidate passed to _candidates must declare origin == 'provider_generated' and relationship == 'generated_variation'. A candidate that claims a different origin/relationship would masquerade as original source footage inside the edit, breaking the provenance guarantee that inserts are AI-generated variations. TasteForge rejects such entries with this error.","triggerScenarios":"Providing a candidate whose 'origin' is e.g. 'source_derived' or whose 'relationship' is 'original'/'derived' instead of the required pair. Usually a mislabeled or hand-crafted candidate entry.","commonSituations":"Manually authoring candidate entries and copying fields from the source media block; importing candidates from another tool that uses different provenance vocabulary; a provider export that marks upscale variants as 'derived' rather than 'generated_variation'.","solutions":["Set candidate origin to \"provider_generated\" and relationship to \"generated_variation\" if it genuinely is a generated variation","Remove entries that are not actually generated variations — original media belongs in the source stack, not the candidate list","Fix the exporter/normalizer that writes candidate metadata so provenance fields match TasteForge's vocabulary"],"exampleFix":"// before\n{\"id\": \"cand-3\", \"origin\": \"source_derived\", \"relationship\": \"derived\", ...}\n// after\n{\"id\": \"cand-3\", \"origin\": \"provider_generated\", \"relationship\": \"generated_variation\", ...}","handlingStrategy":"validation","validationCode":"function assertGeneratedProvenance(c) {\n  if (c.origin !== \"provider_generated\" || c.relationship !== \"generated_variation\")\n    throw new Error(`candidate ${c.id} is not a generated variation`);\n}","typeGuard":"function isGeneratedVariation(c) {\n  return c != null && c.origin === \"provider_generated\" && c.relationship === \"generated_variation\";\n}","tryCatchPattern":"try {\n  buildApplicationBundle(cfg);\n} catch (e) {\n  if (e.message.includes(\"cannot claim original-source identity\")) {\n    cfg.candidates = cfg.candidates.filter(isGeneratedVariation);\n    return buildApplicationBundle(cfg);\n  }\n  throw e;\n}","preventionTips":["Only feed provider-generated media into the candidate list; keep originals in the source stack","Normalize provenance vocabulary in your exporter to TasteForge's exact literals","Validate candidate provenance fields right after each generation run"],"tags":["provenance","validation","candidates"],"backgroundTag":"invalid-enum-value","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"}