{"record":{"id":"b9576092b2d99a07","repo":"Hmbown/CodeWhale","slug":"rss-supported-must-be-true-exactly-on-the-macos-measurement","errorCode":null,"errorMessage":"rss_supported must be true exactly on the macOS measurement lane","messagePattern":"rss_supported must be true exactly on the macOS measurement lane","errorType":"validation","errorClass":"PersistenceBacklogError","httpStatus":null,"severity":"error","filePath":"scripts/check-persistence-backlog-budget.py","lineNumber":222,"sourceCode":"        )\n    applied = non_negative_integer(\n        receipt[\"applied_version\"], \"applied_version\"\n    )\n    if applied != FIXTURE[\"expected_applied_version\"]:\n        raise PersistenceBacklogError(\"applied_version is not the final sent version\")\n    if receipt[\"final_version_applied\"] is not True:\n        raise PersistenceBacklogError(\"final_version_applied must be true\")\n\n    limitations = receipt[\"limitations\"]\n    if not isinstance(limitations, list) or not limitations or not all(\n        isinstance(item, str) and item for item in limitations\n    ):\n        raise PersistenceBacklogError(\"limitations must be a non-empty string array\")\n\n    if not isinstance(receipt[\"rss_supported\"], bool):\n        raise PersistenceBacklogError(\"rss_supported must be boolean\")\n    if receipt[\"rss_supported\"] != (platform == \"macos\"):\n        raise PersistenceBacklogError(\n            \"rss_supported must be true exactly on the macOS measurement lane\"\n        )\n    rss_fields = RSS_SAMPLE_FIELDS + RSS_DELTA_FIELDS\n    if receipt[\"rss_supported\"]:\n        for field in rss_fields:\n            non_negative_integer(receipt[field], field)\n        before = receipt[\"rss_before_bytes\"]\n        if receipt[\"rss_during_delta_bytes\"] != max(\n            0, receipt[\"rss_during_bytes\"] - before\n        ):\n            raise PersistenceBacklogError(\"rss_during_delta_bytes is inconsistent\")\n        if receipt[\"rss_after_delta_bytes\"] != max(\n            0, receipt[\"rss_after_bytes\"] - before\n        ):\n            raise PersistenceBacklogError(\"rss_after_delta_bytes is inconsistent\")\n    elif any(receipt[field] is not None for field in rss_fields):\n        raise PersistenceBacklogError(\"unsupported RSS fields must be null\")\n","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/scripts/check-persistence-backlog-budget.py#L204-L240","documentation":"rss_supported must be true exactly when platform is \"macos\" and false otherwise. RSS sampling is only implemented on the macOS measurement lane, so the flag must match the platform invariant; any other combination means the receipt claims RSS data from a platform that cannot produce it, or hides it on the one lane that can.","triggerScenarios":"Raised by validate_receipt when receipt['rss_supported'] != (receipt['platform'] == \"macos\"), from validate_baseline_receipt or compare. Examples: platform=\"linux\" with rss_supported=true, or platform=\"macos\" with rss_supported=false.","commonSituations":"Measuring on Linux/Windows with an RSS sampler ported locally; copying a macOS receipt and changing only the platform field; the measuring script's platform detection disagreeing with its RSS capability check.","solutions":["Run the measurement on the platform matching the capability: RSS receipt on macOS, null RSS fields elsewhere.","Fix the measuring script so rss_supported is derived from (platform == \"macos\"), not set independently.","If you ported RSS sampling to another platform, that requires changing this contract deliberately, not just the flag."],"exampleFix":"// before\n{\"platform\": \"linux\", \"rss_supported\": true}\n// after\n{\"platform\": \"linux\", \"rss_supported\": false, \"rss_before_bytes\": null, ...}","handlingStrategy":"validation","validationCode":"def rss_support_matches_platform(receipt):\n    return receipt.get(\"rss_supported\") == (receipt.get(\"platform\") == \"macos\")","typeGuard":"def is_supported_platform(p):\n    return isinstance(p, str) and p in {\"linux\", \"macos\", \"windows\"}","tryCatchPattern":"try:\n    validate_receipt(receipt)\nexcept PersistenceBacklogError as e:\n    print(f\"receipt rejected: {e}\", file=sys.stderr)\n    sys.exit(2)","preventionTips":["Derive rss_supported from the detected platform inside the measuring script.","Collect RSS metrics only on the macOS lane; leave the fields null elsewhere.","Don't copy receipts across platforms and tweak only the platform field."],"tags":["measurement","validation","platform","python"],"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"}