{"record":{"id":"88b38a2020893edc","repo":"Hmbown/CodeWhale","slug":"baseline-receipt-field-does-not-match-baseline-p","errorCode":null,"errorMessage":"baseline receipt {field} does not match baseline provenance","messagePattern":"baseline receipt (.+?) does not match baseline provenance","errorType":"exception","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/8880682c63083a91624de936797efa3ce9e498fd/scripts/check-persistence-backlog-budget.py#L322-L358","documentation":"Raised by validate_baseline_receipt when any of the seven provenance fields (platform, source_sha, source_dirty, rustc_version, cargo_version, build_profile, sample_count) differs between the baseline receipt and the budget's baseline_observation.provenance. Provenance pins the exact machine state, commit, and toolchain that produced the baseline, so both records must agree on those fields. The usual cause is one file being regenerated or edited without the other.","triggerScenarios":"Re-measuring the baseline at a new commit (source_sha differs) or after a rustc upgrade (rustc_version differs) and updating only one of the two files; hand-editing provenance in the budget; committing the receipt and budget in separate changes so CI sees a half-updated pair.","commonSituations":"Toolchain upgrades between baseline regenerations; rebases or merges that touch one file; a teammate regenerating the receipt locally under a different platform or toolchain.","solutions":["Copy the provenance block from scripts/persistence-backlog-baseline-receipt.json into the budget's baseline_observation.provenance verbatim","If the baseline was re-measured, update both files (values and provenance) in one atomic commit","Verify source_sha is the exact 40-hex commit the receipt was measured at and source_dirty is false"],"exampleFix":"// before — budget provenance.rustc_version: \"rustc 1.79.0\"; receipt: \"rustc 1.80.1\"\n// after — paste all seven receipt provenance fields into baseline_observation.provenance unchanged\n\"provenance\": { \"platform\": \"macos\", \"source_sha\": \"<same 40-hex>\", \"source_dirty\": false, \"rustc_version\": \"rustc 1.80.1\", \"cargo_version\": \"cargo 1.80.1\", \"build_profile\": \"test\", \"sample_count\": 1 }","handlingStrategy":"validation","validationCode":"keys = ('platform', 'source_sha', 'source_dirty', 'rustc_version', 'cargo_version', 'build_profile', 'sample_count')\nassert all(receipt[k] == budget['baseline_observation']['provenance'][k] for k in keys)","typeGuard":null,"tryCatchPattern":"try:\n    validate_baseline_receipt(budget, receipt)\nexcept PersistenceBacklogError as e:\n    sync_provenance_from_receipt(); raise","preventionTips":["Copy provenance verbatim between the two files","Re-measure and commit both files atomically","Pin the toolchain used for baseline regeneration"],"tags":["python","json","provenance","benchmarking","ci"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}