{"record":{"id":"51275028f33e4118","repo":"Hmbown/CodeWhale","slug":"baseline-receipt-field-does-not-match-baseline-o","errorCode":null,"errorMessage":"baseline receipt {field} does not match baseline_observation","messagePattern":"baseline receipt (.+?) does not match baseline_observation","errorType":"exception","errorClass":"PersistenceBacklogError","httpStatus":null,"severity":"error","filePath":"scripts/check-persistence-backlog-budget.py","lineNumber":326,"sourceCode":"        raise PersistenceBacklogError(\"baseline provenance must identify a clean source tree\")\n    for field, prefix in ((\"rustc_version\", \"rustc \"), (\"cargo_version\", \"cargo \")):\n        if not isinstance(provenance.get(field), str) or not provenance[field].startswith(prefix):\n            raise PersistenceBacklogError(f\"baseline provenance needs {field}\")\n    if provenance.get(\"build_profile\") != \"test\" or not (\n        type(provenance.get(\"sample_count\")) is int\n        and provenance[\"sample_count\"] == 1\n    ):\n        raise PersistenceBacklogError(\"baseline provenance build profile/sample count changed\")\n\n\ndef validate_baseline_receipt(\n    budget: dict[str, Any], baseline_receipt: dict[str, Any]\n) -> None:\n    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","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/scripts/check-persistence-backlog-budget.py#L308-L344","documentation":"Thrown by validate_baseline_receipt in scripts/check-persistence-backlog-budget.py when one of accepted_requests, applied_version, or the CEILING_FIELDS (retained_queued_requests, estimated_retained_payload_bytes, enqueue_elapsed_ns, rss_during_delta_bytes, rss_after_delta_bytes) differs between scripts/persistence-backlog-baseline-receipt.json and the budget's baseline_observation. The two files must describe the same measurement so ceilings have an auditable origin. Any numeric drift — even an apparent improvement — fails the gate until both files are updated together.","triggerScenarios":"Running the checker after (a) editing baseline_observation numbers in scripts/persistence-backlog-budget.json without re-measuring, or (b) replacing the baseline receipt from a new measurement without copying the new values into the budget's baseline_observation.","commonSituations":"Tightening ceilings by editing only the budget; re-measuring the baseline on newer hardware or a newer toolchain and committing only the receipt; merge conflicts resolved in one file but not the other.","solutions":["Diff the seven checked fields between scripts/persistence-backlog-baseline-receipt.json and the budget's baseline_observation; the message names the first mismatching field","If the baseline was legitimately re-measured, copy the receipt's values into baseline_observation (and its provenance) in the same commit","If the budget was edited speculatively, revert it with `git checkout -- scripts/persistence-backlog-budget.json`"],"exampleFix":"// before — receipt: \"retained_queued_requests\": 4; budget baseline_observation: 5\n// after — copy the measured values into scripts/persistence-backlog-budget.json\n\"baseline_observation\": { \"accepted_requests\": 128, \"applied_version\": 127, \"retained_queued_requests\": 4, \"estimated_retained_payload_bytes\": 262144, ... }","handlingStrategy":"validation","validationCode":"fields = ('accepted_requests', 'applied_version', 'retained_queued_requests', 'estimated_retained_payload_bytes', 'enqueue_elapsed_ns', 'rss_during_delta_bytes', 'rss_after_delta_bytes')\nbaseline = budget['baseline_observation']\ndrift = [f for f in fields if baseline[f] != receipt[f]]\nassert not drift, drift","typeGuard":null,"tryCatchPattern":"try:\n    validate_baseline_receipt(budget, receipt)\nexcept PersistenceBacklogError as e:\n    report_field_drift(str(e))\n    raise","preventionTips":["Update the budget's baseline_observation and the baseline receipt in the same commit","Regenerate baselines with the measure script instead of editing numbers","Hook the checker into pre-commit for budget-file changes"],"tags":["python","json","benchmarking","drift","ci"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}