Hmbown/CodeWhale · error · PersistenceBacklogError
baseline provenance platform must be macos
Error message
baseline provenance platform must be macos
What it means
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.
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.
Example fix
// before
"provenance": { "platform": "linux", ... }
// after
"provenance": { "platform": "macos", ... } Defensive patterns
Strategy: validation
Validate before calling
if budget.get("baseline_observation", {}).get("provenance", {}).get("platform") != "macos":
raise ValueError("baseline must be generated on macOS") Try / catch
try:
compare(budget, baseline_receipt)
except PersistenceBacklogError as e:
if "platform must be macos" in str(e): regenerate on macOS host Prevention
- Document that baselines must come from a macOS machine.
- Guard CI jobs so Linux runners never overwrite the baseline.
When it happens
Trigger: `compare` with a baseline generated on linux or windows, or with a typo'd/missing platform string in provenance.
Common situations: Regenerating the baseline on a CI Linux runner or a different developer machine, then committing it over the macos baseline.
Understand the failure class
Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.
Related errors
- baseline_observation needs provenance
- baseline provenance build profile/sample count changed
- baseline provenance must identify a clean source tree
- baseline provenance needs an exact source SHA
- baseline provenance needs
AI-assisted analysis of Hmbown/CodeWhale@433685b202 (2026-09-15).
Data as JSON: /api/errors/5df0d6d3d727e376.
Report an issue: GitHub.
Appendix: source
Thrown at scripts/check-persistence-backlog-budget.py:302
baseline_retained = baseline["retained_queued_requests"]
baseline_payload = baseline["estimated_retained_payload_bytes"]
if baseline_retained == 0 or baseline_payload == 0:
raise PersistenceBacklogError(
"baseline_observation must retain the final request and payload"
)
if baseline_retained > baseline_accepted:
raise PersistenceBacklogError(
"baseline_observation.retained_queued_requests exceeds accepted_requests"
)
if baseline_payload < baseline_retained * FIXTURE["content_bytes_per_request"]:
raise PersistenceBacklogError(
"baseline_observation payload is smaller than frozen retained content"
)
provenance = baseline.get("provenance")
if not isinstance(provenance, dict):
raise PersistenceBacklogError("baseline_observation needs provenance")
if provenance.get("platform") != "macos":
raise PersistenceBacklogError("baseline provenance platform must be macos")
if not isinstance(provenance.get("source_sha"), str) or not SOURCE_SHA_PATTERN.fullmatch(
provenance["source_sha"]
):
raise PersistenceBacklogError("baseline provenance needs an exact source SHA")
if provenance.get("source_dirty") is not False:
raise PersistenceBacklogError("baseline provenance must identify a clean source tree")
for field, prefix in (("rustc_version", "rustc "), ("cargo_version", "cargo ")):
if not isinstance(provenance.get(field), str) or not provenance[field].startswith(prefix):
raise PersistenceBacklogError(f"baseline provenance needs {field}")
if provenance.get("build_profile") != "test" or not (
type(provenance.get("sample_count")) is int
and provenance["sample_count"] == 1
):
raise PersistenceBacklogError("baseline provenance build profile/sample count changed")
def validate_baseline_receipt(
budget: dict[str, Any], baseline_receipt: dict[str, Any]View on GitHub (pinned to 433685b202)