affaan-m/ECC · error · ValueError

a generated candidate cannot claim original-source identity

Error message

a generated candidate cannot claim original-source identity

What it means

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.

Solutions

  1. Set candidate origin to "provider_generated" and relationship to "generated_variation" if it genuinely is a generated variation
  2. Remove entries that are not actually generated variations — original media belongs in the source stack, not the candidate list
  3. Fix the exporter/normalizer that writes candidate metadata so provenance fields match TasteForge's vocabulary

Example fix

// before
{"id": "cand-3", "origin": "source_derived", "relationship": "derived", ...}
// after
{"id": "cand-3", "origin": "provider_generated", "relationship": "generated_variation", ...}
Defensive patterns

Strategy: validation

Validate before calling

function assertGeneratedProvenance(c) {
  if (c.origin !== "provider_generated" || c.relationship !== "generated_variation")
    throw new Error(`candidate ${c.id} is not a generated variation`);
}

Type guard

function isGeneratedVariation(c) {
  return c != null && c.origin === "provider_generated" && c.relationship === "generated_variation";
}

Try / catch

try {
  buildApplicationBundle(cfg);
} catch (e) {
  if (e.message.includes("cannot claim original-source identity")) {
    cfg.candidates = cfg.candidates.filter(isGeneratedVariation);
    return buildApplicationBundle(cfg);
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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'.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

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

    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":
            raise ValueError("a generated candidate cannot claim original-source identity")
        if item["source_sha256"] != source_hash or item["compiled_input_sha256"] != input_hash:
            raise ValueError("candidate is bound to a different source or input")
        if item["review_status"] not in ("pending", "rejected", "approved"):
            raise ValueError("explicit candidate review state required")
        evidence = _artifact(item["generation_receipt"], parse_json=True)
        if not isinstance(evidence, dict) or not isinstance(evidence.get("request_id"), str):
            raise ValueError("historical request evidence required")
        _text(evidence["request_id"])
        expected = {"source_sha256": source_hash, "compiled_input_sha256": input_hash,
                    "candidate_sha256": item["media"]["sha256"], "source_url": source_url}
        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 = []

View on GitHub (pinned to 8321021c54)