{"record":{"id":"88b38a2020893edc","repo":"Hmbown/CodeWhale","slug":"baseline-receipt-field-does-not-match-baseline-provenance","errorCode":null,"errorMessage":"baseline receipt {field} does not match baseline provenance","messagePattern":"baseline receipt (.+?) does not match baseline provenance","errorType":"console","errorClass":"PersistenceBacklogError","httpStatus":null,"severity":"error","filePath":"scripts/check-persistence-backlog-budget.py","lineNumber":340,"sourceCode":"    validate_receipt(baseline_receipt, require_clean_source=True)\n    baseline = budget[\"baseline_observation\"]\n    for field in (\"accepted_requests\", \"applied_version\", *CEILING_FIELDS):\n        if baseline_receipt[field] != baseline[field]:\n            raise PersistenceBacklogError(\n                f\"baseline receipt {field} does not match baseline_observation\"\n            )\n    provenance = baseline[\"provenance\"]\n    for field in (\n        \"platform\",\n        \"source_sha\",\n        \"source_dirty\",\n        \"rustc_version\",\n        \"cargo_version\",\n        \"build_profile\",\n        \"sample_count\",\n    ):\n        if baseline_receipt[field] != provenance[field]:\n            raise PersistenceBacklogError(\n                f\"baseline receipt {field} does not match baseline provenance\"\n            )\n\n\ndef compare(\n    receipt: dict[str, Any],\n    budget: dict[str, Any],\n    *,\n    expected_source: dict[str, Any] | None = None,\n    require_clean_source: bool = False,\n) -> tuple[list[tuple[str, int, int]], list[tuple[str, int, int]]]:\n    validate_receipt(\n        receipt,\n        expected_source=expected_source,\n        require_clean_source=require_clean_source,\n    )\n    validate_budget(budget)\n    increases: list[tuple[str, int, int]] = []","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/scripts/check-persistence-backlog-budget.py#L322-L358","documentation":"After checking observation fields, validate_baseline_receipt compares the baseline receipt's provenance fields (platform, source_sha, rustc_version, cargo_version, build_profile, sample_count) against baseline_observation.provenance. This error means the receipt's provenance differs from the provenance recorded in the budget file, i.e. the baseline was measured in a different environment or source state. The guard refuses to validate against an environment-mismatched baseline.","triggerScenarios":"Running the budget check when baseline_receipt[field] != baseline['provenance'][field] for any provenance field — e.g. a different rustc/cargo version, OS platform, git source_sha, build profile, or sample count than recorded in the budget's baseline_observation.provenance.","commonSituations":"Toolchain upgraded since the baseline was captured; running the script on a different OS/CI runner; the baseline was regenerated on a branch with a different SHA; sample_count changed because the baseline was recaptured with different sampling settings.","solutions":["Recapture the baseline receipt and baseline_observation on the current platform/toolchain and update the budget file","Install the rustc/cargo versions recorded in the baseline provenance","Re-run on the same platform and source SHA the baseline was captured from"],"exampleFix":"// before: budget provenance from an old toolchain\n\"provenance\": {\"rustc_version\": \"1.70.0\", \"platform\": \"linux-x86_64\"}\n// after: recapture with current toolchain\n\"provenance\": {\"rustc_version\": \"1.79.0\", \"platform\": \"linux-x86_64\"}","handlingStrategy":"validation","validationCode":"prov_bad = [f for f in ('platform','source_sha','rustc_version','cargo_version','build_profile','sample_count') if receipt[f] != budget['baseline_observation']['provenance'][f]]\nif prov_bad: print(f\"provenance drift: {prov_bad}\")","typeGuard":null,"tryCatchPattern":"try:\n    validate_baseline_receipt(budget, receipt)\nexcept PersistenceBacklogError as e:\n    print(f\"environment changed since baseline: {e}\", file=sys.stderr)\n    sys.exit(1)","preventionTips":["Pin the toolchain version used for baseline capture (rust-toolchain.toml)","Recapture baselines after toolchain or OS upgrades","Record provenance next to the baseline and diff before checking"],"tags":["python","ci-guard","provenance","environment-mismatch"],"backgroundTag":"checksum-mismatch","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}