{"record":{"id":"12fe4231c61330a8","repo":"affaan-m/ECC","slug":"local-ingestion-cannot-claim-provider-execution","errorCode":null,"errorMessage":"Local ingestion cannot claim provider execution","messagePattern":"Local ingestion cannot claim provider execution","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/tasteforge/assets.py","lineNumber":227,"sourceCode":"    try:\n        with output.open('x', encoding='utf-8') as stream:\n            json.dump(receipt, stream, indent=2, sort_keys=True)\n            stream.write('\\n')\n    except OSError as exc:\n        raise ValueError(f'Cannot create exclusive receipt: {output}') from exc\n    return receipt\n\n\ndef validate_assets(receipt_path: str | Path) -> dict[str, Any]:\n    \"\"\"Re-hash every bound file and validate receipt semantics; no remote calls.\"\"\"\n    path = _path(receipt_path, Path.cwd())\n    receipt = _load(path)\n    if receipt.get('schema') != SCHEMA:\n        raise ValueError('Unsupported asset receipt schema')\n    if type(receipt.get('provider_calls')) is not int or receipt['provider_calls'] != 0:\n        raise ValueError('Local ingestion must have zero provider calls')\n    if receipt.get('provider_execution') is not False:\n        raise ValueError('Local ingestion cannot claim provider execution')\n    _, requests = (_bundle(receipt['bundle_receipt'], path.parent, True)\n                   if 'bundle_receipt' in receipt else (None, {}))\n    for asset in _assets(receipt.get('assets')):\n        _taste(asset, requests, True)\n        _verify_binding(asset, path.parent, asset['modality'])\n        provenance = _provenance(asset, path.parent, True)\n        if provenance is not None and provenance != asset['provider_provenance']:\n            raise ValueError('Invalid supplied provenance declaration')\n    inputs = receipt.get('input_artifacts')\n    if not isinstance(inputs, list):\n        raise ValueError('input_artifacts must be a list')\n    for artifact in inputs:\n        _verify_binding(artifact, path.parent)\n    if 'genre_spec' in receipt:\n        _verify_binding(receipt['genre_spec'], path.parent)\n    return receipt\n","sourceCodeStart":209,"sourceCodeEnd":244,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/tasteforge/assets.py#L209-L244","documentation":"validate_assets requires the receipt field provider_execution to be exactly the boolean False (checked with 'is not False', which also rejects strings like \"false\" and truthy values). Since this module never executes providers, a receipt claiming provider execution is inconsistent with the local-only contract and is rejected.","triggerScenarios":"Calling validate_assets on a receipt where provider_execution is missing, true, \"false\", null, or 0; hand-edited receipts; receipts produced by external tooling with a different convention (e.g. string flags).","commonSituations":"Custom pipelines serializing booleans as strings; hand-written receipts; combining records from a provider-backed system into a local receipt template.","solutions":["Regenerate the receipt with ingest_assets, which writes provider_execution: false.","If editing JSON, set the field to the JSON boolean false (not \"false\" or 0).","Validate receipt shape before calling: receipt.get('provider_execution') is False.","Separate provider-executing artifacts from this local-only validation flow entirely."],"exampleFix":"# before\n{\"provider_execution\": \"false\"}\n# after\n{\"provider_execution\": false}","handlingStrategy":"type-guard","validationCode":"r = json.load(open(p))\nassert r.get('provider_execution') is False, 'provider_execution must be boolean false'","typeGuard":"def no_provider_execution(obj) -> bool:\n    return obj.get('provider_execution') is False","tryCatchPattern":null,"preventionTips":["Serialize booleans as JSON booleans, never strings.","Use ingest_assets output verbatim; do not re-serialize through string-typed templates.","Keep provider-backed artifacts in a separate validation path."],"tags":["validation","receipt","provider-policy","json"],"backgroundTag":"schema-validation-failed","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"}