Hmbown/CodeWhale · error · PersistenceBacklogError

receipt platform is unsupported

Error message

receipt platform is unsupported

What it means

Raised in validate_receipt (scripts/check-persistence-backlog-budget.py:179-181) when receipt.platform is not a string or not in SUPPORTED_PLATFORMS {linux, macos, windows}. Only these canonical lowercase names are accepted so ceiling data stays comparable across lanes.

Source

Thrown at scripts/check-persistence-backlog-budget.py:181

    validate_frozen_field("sample_count", receipt["sample_count"], 1)
    if expected_source is not None:
        for field in (
            "source_sha",
            "source_dirty",
            "rustc_version",
            "cargo_version",
            "build_profile",
            "sample_count",
        ):
            if receipt[field] != expected_source[field]:
                raise PersistenceBacklogError(
                    f"receipt {field} does not match the checked source"
                )
    if require_clean_source and receipt["source_dirty"]:
        raise PersistenceBacklogError("persistence measurement source tree is dirty")
    platform = receipt["platform"]
    if not isinstance(platform, str) or platform not in SUPPORTED_PLATFORMS:
        raise PersistenceBacklogError("receipt platform is unsupported")

    attempted = non_negative_integer(receipt["requests_attempted"], "requests_attempted")
    accepted = non_negative_integer(receipt["accepted_requests"], "accepted_requests")
    if accepted != attempted:
        raise PersistenceBacklogError(
            "accepted_requests must equal requests_attempted; sender rejection is not backlog improvement"
        )
    retained = non_negative_integer(
        receipt["retained_queued_requests"], "retained_queued_requests"
    )
    if retained > accepted:
        raise PersistenceBacklogError("retained_queued_requests exceeds accepted_requests")
    for field in ("estimated_retained_payload_bytes", "enqueue_elapsed_ns"):
        non_negative_integer(receipt[field], field)
    if retained == 0 or receipt["estimated_retained_payload_bytes"] == 0:
        raise PersistenceBacklogError(
            "the paused channel must retain the newest request and its payload"
        )

View on GitHub (pinned to 8880682c63)

Solutions

  1. Normalize the OS name in the Rust measurement test to the canonical set (darwin -> macos).
  2. When adding a genuinely new platform, extend SUPPORTED_PLATFORMS and define which ceiling fields apply to it.
  3. Regenerate the receipt after the emitter fix.

Example fix

// Rust emitter (before)
"platform": std::env::consts::OS  // "darwin" on macOS
// after
"platform": match std::env::consts::OS { "darwin" => "macos", os => os }
Defensive patterns

Strategy: type-guard

Validate before calling

supported = {"linux", "macos", "windows"}
if receipt.get("platform") not in supported:
    sys.exit(f"platform {receipt.get('platform')!r} unsupported; normalize OS names in the emitter")

Type guard

def is_supported_platform(value) -> bool:
    return isinstance(value, str) and value in {"linux", "macos", "windows"}

Try / catch

try:
    validate_receipt(receipt)
except PersistenceBacklogError as e:
    if "platform is unsupported" in str(e):
        raise RuntimeError("map std::env::consts::OS darwin->macos in the emitter") from e
    raise

Prevention

When it happens

Trigger: The Rust emitter reporting "darwin" instead of "macos" (std::env::consts::OS naming), "win32" or "Windows" variants, capitalized "Linux", null, or an empty string.

Common situations: Mapping from Rust OS constants to receipt names incorrectly; adding a new platform lane without extending SUPPORTED_PLATFORMS; hand-authored receipts.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16). Data as JSON: /api/errors/fedb6500994432cd. Report an issue: GitHub.