{"record":{"id":"fedb6500994432cd","repo":"Hmbown/CodeWhale","slug":"receipt-platform-is-unsupported","errorCode":null,"errorMessage":"receipt platform is unsupported","messagePattern":"receipt platform is unsupported","errorType":"validation","errorClass":"PersistenceBacklogError","httpStatus":null,"severity":"error","filePath":"scripts/check-persistence-backlog-budget.py","lineNumber":181,"sourceCode":"    validate_frozen_field(\"sample_count\", receipt[\"sample_count\"], 1)\n    if expected_source is not None:\n        for field in (\n            \"source_sha\",\n            \"source_dirty\",\n            \"rustc_version\",\n            \"cargo_version\",\n            \"build_profile\",\n            \"sample_count\",\n        ):\n            if receipt[field] != expected_source[field]:\n                raise PersistenceBacklogError(\n                    f\"receipt {field} does not match the checked source\"\n                )\n    if require_clean_source and receipt[\"source_dirty\"]:\n        raise PersistenceBacklogError(\"persistence measurement source tree is dirty\")\n    platform = receipt[\"platform\"]\n    if not isinstance(platform, str) or platform not in SUPPORTED_PLATFORMS:\n        raise PersistenceBacklogError(\"receipt platform is unsupported\")\n\n    attempted = non_negative_integer(receipt[\"requests_attempted\"], \"requests_attempted\")\n    accepted = non_negative_integer(receipt[\"accepted_requests\"], \"accepted_requests\")\n    if accepted != attempted:\n        raise PersistenceBacklogError(\n            \"accepted_requests must equal requests_attempted; sender rejection is not backlog improvement\"\n        )\n    retained = non_negative_integer(\n        receipt[\"retained_queued_requests\"], \"retained_queued_requests\"\n    )\n    if retained > accepted:\n        raise PersistenceBacklogError(\"retained_queued_requests exceeds accepted_requests\")\n    for field in (\"estimated_retained_payload_bytes\", \"enqueue_elapsed_ns\"):\n        non_negative_integer(receipt[field], field)\n    if retained == 0 or receipt[\"estimated_retained_payload_bytes\"] == 0:\n        raise PersistenceBacklogError(\n            \"the paused channel must retain the newest request and its payload\"\n        )","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/scripts/check-persistence-backlog-budget.py#L163-L199","documentation":"The receipt's `platform` field must be a string in `SUPPORTED_PLATFORMS = {\"linux\", \"macos\", \"windows\"}`. The persistence backlog fixture is only certified on these three lanes; any other platform name (or a non-string value) means the measurement's RSS and queueing semantics were never validated there, so the checker refuses the receipt.","triggerScenarios":"A receipt records `platform: \"freebsd\"`, `\"mac\"` (not \"macos\"), `\"darwin\"`, `\"linux-gnu\"`, or the field is missing/None; a producer derives the platform from `platform.system()` yielding `\"Darwin\"` with original casing.","commonSituations":"Generating receipts on an unsupported OS or a nonstandard platform string; hand-written receipts using informal OS names; running the measurement on a BSD or embedded target and committing the result.","solutions":["Set `platform` to exactly one of \"linux\", \"macos\", or \"windows\" (lowercase)","Normalize the producer: map `platform.system()` (\"Darwin\"→\"macos\", \"Windows\"→\"windows\", \"Linux\"→\"linux\") before writing the receipt","Regenerate the receipt on a supported platform; extend SUPPORTED_PLATFORMS in the script only if the platform is genuinely certified"],"exampleFix":"// before (producer)\n\"platform\": platform.system()          # \"Darwin\"\n// after\n\"platform\": {\"Darwin\": \"macos\", \"Linux\": \"linux\", \"Windows\": \"windows\"}[platform.system()]","handlingStrategy":"type-guard","validationCode":"SUPPORTED = {\"linux\", \"macos\", \"windows\"}\nassert isinstance(receipt.get(\"platform\"), str) and receipt[\"platform\"] in SUPPORTED, receipt.get(\"platform\")","typeGuard":"def is_supported_platform(v):\n    return isinstance(v, str) and v in {\"linux\", \"macos\", \"windows\"}","tryCatchPattern":"try:\n    validate_receipt(receipt)\nexcept PersistenceBacklogError as e:\n    if \"platform is unsupported\" in str(e):\n        normalize_platform_field(receipt)  # Darwin->macos etc. or re-measure on supported OS","preventionTips":["Normalize platform.system() output to the lowercase lane names at generation time","Use the canonical names \"linux\"/\"macos\"/\"windows\", never \"darwin\"/\"mac\"/\"linux-gnu\"","Only measure on certified platforms; gate unsupported OSes in CI"],"tags":["platform","validation","receipt","portability"],"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"}