{"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":"console","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/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/scripts/check-persistence-backlog-budget.py#L284-L320","documentation":"Baseline provenance must record platform == \"macos\" because the persisted backlog budget was calibrated on macOS; comparing measurements from another platform would be apples-to-oranges. The checker raises when the recorded platform differs.","triggerScenarios":"`compare` with a baseline generated on linux or windows, or with a typo'd/missing platform string in provenance.","commonSituations":"Regenerating the baseline on a CI Linux runner or a different developer machine, then committing it over the macos baseline.","solutions":["Regenerate the baseline on a macOS machine.","If the platform policy intentionally changes, update the checker's expectation and the budget together — don't just edit the JSON.","Verify provenance.platform is exactly \"macos\" (lowercase) after generation."],"exampleFix":"// before\n\"provenance\": { \"platform\": \"linux\", ... }\n// after\n\"provenance\": { \"platform\": \"macos\", ... }","handlingStrategy":"validation","validationCode":"if budget.get(\"baseline_observation\", {}).get(\"provenance\", {}).get(\"platform\") != \"macos\":\n    raise ValueError(\"baseline must be generated on macOS\")","typeGuard":null,"tryCatchPattern":"try:\n    compare(budget, baseline_receipt)\nexcept PersistenceBacklogError as e:\n    if \"platform must be macos\" in str(e): regenerate on macOS host","preventionTips":["Document that baselines must come from a macOS machine.","Guard CI jobs so Linux runners never overwrite the baseline."],"tags":["python","validation","provenance","platform"],"backgroundTag":"unsupported-platform","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"}