{"record":{"id":"9a4e3740c18d05b8","repo":"affaan-m/ECC","slug":"record-for-provider-record-get-provider-r-claims-saved","errorCode":null,"errorMessage":"record for provider {record.get('provider')!r} claims saved workflow state; a local reference is never a saved provider workflow","messagePattern":"record for provider (.+?) claims saved workflow state; a local reference is never a saved provider workflow","errorType":"exception","errorClass":"SavedWorkflowClaimError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/tasteforge/provenance.py","lineNumber":145,"sourceCode":"\n    Constructed so that no field can be misread as \\\"a Fal workflow was\n    saved\\\": the record is explicitly ``reference_only`` and denies both\n    persisted provider state and execution authority.\n    \"\"\"\n    return {\n        \"kind\": \"provider-workflow-reference\",\n        \"provider\": provider,\n        \"reference_only\": True,\n        \"persisted_workflow_state\": False,\n        \"authorizes_execution\": False,\n    }\n\n\ndef assert_no_saved_provider_workflow(records: list[dict[str, Any]]) -> None:\n    \"\"\"Raise if any record claims persisted provider workflow state.\"\"\"\n    for record in records:\n        if record.get(\"persisted_workflow_state\"):\n            raise SavedWorkflowClaimError(\n                f\"record for provider {record.get('provider')!r} claims saved \"\n                \"workflow state; a local reference is never a saved provider \"\n                \"workflow\"\n            )\n","sourceCodeStart":127,"sourceCodeEnd":150,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/tasteforge/provenance.py#L127-L150","documentation":"assert_no_saved_provider_workflow enforces TasteForge's provenance guarantee that records describe only local references, never persisted provider workflow state. If any record's 'persisted_workflow_state' key is truthy it raises SavedWorkflowClaimError naming the offending provider, since a local reference can never constitute a saved provider workflow.","triggerScenarios":"Calling assert_no_saved_provider_workflow(records) where at least one dict contains persisted_workflow_state set to a truthy value (True, a non-empty dict/string) — typically records produced by an external tool or hand-edited provenance file.","commonSituations":"Importing provenance exported by another (networked) tool; hand-editing records.json and adding workflow state; a third-party integration writing extra fields; schema drift after upgrading from a different pipeline.","solutions":["Remove the persisted_workflow_state field from the offending record and re-run validation","Regenerate the records through TasteForge's offline workflow so they contain only local references","Investigate the producer of the record — the claim indicates a non-offline provenance chain that must not be trusted"],"exampleFix":"// before\nrecords[0][\"persisted_workflow_state\"] = {\"run_id\": \"abc\"}\nassert_no_saved_provider_workflow(records)  # raises\n// after\nrecords[0].pop(\"persisted_workflow_state\", None)\nassert_no_saved_provider_workflow(records)  # passes","handlingStrategy":"try-catch","validationCode":"bad = [r.get('provider') for r in records if r.get('persisted_workflow_state')]\nassert not bad, f\"records claim saved provider state: {bad}\"","typeGuard":null,"tryCatchPattern":"try:\n    assert_no_saved_provider_workflow(records)\nexcept SavedWorkflowClaimError as e:\n    log.error(\"Untrusted provenance record: %s\", e)\n    records = [r for r in records if not r.get(\"persisted_workflow_state\")]","preventionTips":["Never hand-edit provenance records to add workflow state","Validate records produced by external tools before importing","Treat persisted_workflow_state as a tamper signal, not data"],"tags":["provenance","validation","security","provider"],"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"}