{"record":{"id":"b9576092b2d99a07","repo":"Hmbown/CodeWhale","slug":"rss-supported-must-be-true-exactly-on-the-macos-me","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":"exception","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/8880682c63083a91624de936797efa3ce9e498fd/scripts/check-persistence-backlog-budget.py#L204-L240","documentation":"Raised in validate_receipt (scripts/check-persistence-backlog-budget.py:221-224) when rss_supported != (platform == \"macos\"). RSS memory samples are only defined on the macOS measurement lane, so a Linux/Windows receipt claiming RSS support — or a macOS receipt disclaiming it — breaks the measurement contract.","triggerScenarios":"A Linux or Windows run emitting rss_supported=true (e.g. the flag hardcoded to true regardless of platform); a macOS run where RSS sampling failed and defaulted the flag to false; platform detection and the RSS flag computed from two different sources.","commonSituations":"Porting the measurement to a new OS while keeping the RSS branch enabled; macOS sandbox/permission issues silently disabling sampling; refactoring that decoupled the flag from the platform check.","solutions":["Derive rss_supported from the same platform constant written to the platform field: `rss_supported = platform == \"macos\"`.","On macOS, make RSS sampling failures fail the measurement loudly instead of flipping the flag to false.","On Linux/Windows, emit rss_supported=false and null RSS fields, then regenerate the receipt."],"exampleFix":"// receipt (before, linux run)\n\"platform\": \"linux\", \"rss_supported\": true\n// receipt (after)\n\"platform\": \"linux\", \"rss_supported\": false, \"rss_before_bytes\": null, /* ... */","handlingStrategy":"validation","validationCode":"if receipt[\"rss_supported\"] != (receipt[\"platform\"] == \"macos\"):\n    sys.exit(\"RSS support flag disagrees with the lane; derive it from the same platform constant\")","typeGuard":null,"tryCatchPattern":"try:\n    validate_receipt(receipt)\nexcept PersistenceBacklogError as e:\n    if \"macOS measurement lane\" in str(e):\n        raise RuntimeError(\"RSS flag/platform mismatch; set rss_supported = (platform == 'macos')\") from e\n    raise","preventionTips":["Derive rss_supported and the platform field from one platform detection in the emitter.","On macOS, fail loudly when RSS sampling errors instead of defaulting the flag to false.","On Linux/Windows lanes, emit rss_supported=false with null RSS fields."],"tags":["validation","platform","rss","measurement"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}