{"record":{"id":"be9c3de22b5a4c65","repo":"affaan-m/ECC","slug":"ambiguous-duplicate-bundle-request","errorCode":null,"errorMessage":"Ambiguous duplicate bundle request","messagePattern":"Ambiguous duplicate bundle request","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/tasteforge/assets.py","lineNumber":155,"sourceCode":"\n\ndef _bundle(value: Any, base: Path, verify: bool) -> tuple[dict[str, Any], dict[tuple[str, str], Any]]:\n    from .contract import validate_bundle\n\n    if verify:\n        binding = _verify_binding(value, base)\n        root = Path(binding['path']).parent\n    else:\n        root = _path(value, base)\n        binding = _fingerprint(root / 'receipt.json')\n    validate_bundle(root)\n    requests = {}\n    for modality in sorted(MODALITIES):\n        manifest = _load(root / 'manifests' / f'{modality}.json')\n        for request in manifest['requests']:\n            key = (modality, _text(request.get('request_id'), 'request_id'))\n            if key in requests:\n                raise ValueError('Ambiguous duplicate bundle request')\n            requests[key] = request\n    if binding != _fingerprint(root / 'receipt.json'):\n        raise ValueError('Bundle changed during validation')\n    return binding, requests\n\n\ndef _taste(asset: dict[str, Any], requests: dict[Any, Any], verify: bool) -> dict[str, Any]:\n    if not requests:\n        if any(key in asset for key in (*_TASTE_FIELDS, 'request_id')):\n            raise ValueError('Taste claims require a validated bundle')\n        return {}\n    request_id = _text(asset.get('request_id'), 'bundle request_id')\n    request = requests.get((asset['modality'], request_id))\n    if request is None:\n        raise ValueError('Asset request_id/modality does not match the bundle')\n    result = dict(request_id=request_id, **{key: request[key] for key in _TASTE_FIELDS})\n    if verify:\n        if any(asset.get(key) != value for key, value in result.items()):","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/tasteforge/assets.py#L137-L173","documentation":"Within a bundle, each (modality, request_id) pair must be unique. The library builds a map from these keys while loading manifests and throws this when the same modality+request_id appears more than once, because taste-claim resolution would be ambiguous.","triggerScenarios":"A manifest file under manifests/<modality>.json listing two request entries with the same request_id; merging bundle manifests and reintroducing duplicates.","commonSituations":"Merging two export bundles that share request ids; copy-pasting a manifest entry to create a variant but forgetting to change request_id; provider retries logged under the same id with differing payloads.","solutions":["Remove or rename the duplicate request entry so each (modality, request_id) is unique within the bundle","If two entries are genuinely different, assign one a distinct request_id and update assets referencing it","If they are true duplicates, delete the redundant copy from the manifest"],"exampleFix":"// before (manifests/image.json)\n\"requests\": [{\"request_id\": \"r1\", ...}, {\"request_id\": \"r1\", ...}]\n// after\n\"requests\": [{\"request_id\": \"r1\", ...}, {\"request_id\": \"r2\", ...}]","handlingStrategy":"validation","validationCode":"seen = set()\nfor m in modality_manifests:\n    for r in m[\"requests\"]:\n        key = (m[\"modality\"], r[\"request_id\"])\n        if key in seen:\n            raise ValueError(f\"duplicate bundle request {key}\")\n        seen.add(key)","typeGuard":null,"tryCatchPattern":"try:\n    validate_assets(assets, bundle_root=root)\nexcept ValueError as e:\n    if str(e) == \"Ambiguous duplicate bundle request\":\n        dedupe_manifests(root); retry()\n    else:\n        raise","preventionTips":["Generate request_ids with UUIDs to avoid collisions when merging bundles","Add a manifest dedupe lint in CI","Never copy a manifest entry without changing its request_id"],"tags":["manifest","duplicate","bundle"],"backgroundTag":"conflicting-config-options","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"}