{"record":{"id":"5df0d6d3d727e376","repo":"Hmbown/CodeWhale","slug":"baseline-provenance-platform-must-be-macos","errorCode":null,"errorMessage":"baseline provenance platform must be macos","messagePattern":"baseline provenance platform must be macos","errorType":"exception","errorClass":"PersistenceBacklogError","httpStatus":null,"severity":"error","filePath":"scripts/check-persistence-backlog-budget.py","lineNumber":302,"sourceCode":"    baseline_retained = baseline[\"retained_queued_requests\"]\n    baseline_payload = baseline[\"estimated_retained_payload_bytes\"]\n    if baseline_retained == 0 or baseline_payload == 0:\n        raise PersistenceBacklogError(\n            \"baseline_observation must retain the final request and payload\"\n        )\n    if baseline_retained > baseline_accepted:\n        raise PersistenceBacklogError(\n            \"baseline_observation.retained_queued_requests exceeds accepted_requests\"\n        )\n    if baseline_payload < baseline_retained * FIXTURE[\"content_bytes_per_request\"]:\n        raise PersistenceBacklogError(\n            \"baseline_observation payload is smaller than frozen retained content\"\n        )\n    provenance = baseline.get(\"provenance\")\n    if not isinstance(provenance, dict):\n        raise PersistenceBacklogError(\"baseline_observation needs provenance\")\n    if provenance.get(\"platform\") != \"macos\":\n        raise PersistenceBacklogError(\"baseline provenance platform must be macos\")\n    if not isinstance(provenance.get(\"source_sha\"), str) or not SOURCE_SHA_PATTERN.fullmatch(\n        provenance[\"source_sha\"]\n    ):\n        raise PersistenceBacklogError(\"baseline provenance needs an exact source SHA\")\n    if provenance.get(\"source_dirty\") is not False:\n        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]","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/scripts/check-persistence-backlog-budget.py#L284-L320","documentation":"Raised by validate_budget() when baseline_observation.provenance.platform is not exactly 'macos'. The budget's RSS ceilings (rss_during_delta_bytes, rss_after_delta_bytes) are only meaningful on the macOS measurement lane where rss_supported=true, so a baseline produced on Linux or Windows cannot anchor them. The comparison is exact - 'MacOS' or 'darwin' also fail.","triggerScenarios":"provenance.platform set to 'linux', 'windows', 'darwin', 'MacOS', or missing - typically when a Linux run is used to (re)baseline the budget.","commonSituations":"Re-baselining on a Linux CI box for convenience; capitalizing or localizing the platform string; renaming platform identifiers during a refactor.","solutions":["Re-baseline on macOS from a clean tree whenever baseline numbers change","Keep provenance.platform exactly the lowercase string 'macos'","Leave the RSS ceilings untouched when iterating on non-macOS lanes"],"exampleFix":"// before (budget.json)\n\"provenance\": { \"platform\": \"linux\", ... }\n\n// after\n\"provenance\": { \"platform\": \"macos\", ... }","handlingStrategy":"validation","validationCode":"def provenance_platform_ok(budget: dict) -> bool:\n    provenance = budget.get(\"baseline_observation\", {}).get(\"provenance\", {})\n    return provenance.get(\"platform\") == \"macos\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Regenerate baselines via the measure script so provenance is captured verbatim from git/rustc/cargo","Re-baseline only on macOS with a clean tree (git status --porcelain empty)","Never hand-write provenance fields; copy them from scripts/persistence-backlog-baseline-receipt.json"],"tags":["json","provenance","platform","python","ci-gate"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}