{"record":{"id":"f4426cef5c1058c3","repo":"Hmbown/CodeWhale","slug":"rss-supported-must-be-boolean","errorCode":null,"errorMessage":"rss_supported must be boolean","messagePattern":"rss_supported must be boolean","errorType":"exception","errorClass":"PersistenceBacklogError","httpStatus":null,"severity":"error","filePath":"scripts/check-persistence-backlog-budget.py","lineNumber":220,"sourceCode":"        raise PersistenceBacklogError(\n            \"estimated_retained_payload_bytes is smaller than the frozen retained content\"\n        )\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):","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/scripts/check-persistence-backlog-budget.py#L202-L238","documentation":"Raised in validate_receipt (scripts/check-persistence-backlog-budget.py:219-220) when receipt[\"rss_supported\"] is not a bool (checked with exact type()). The flag declares whether the lane captured RSS memory samples, and it is immediately compared against the platform to enforce lane-specific expectations.","triggerScenarios":"The emitter writing \"true\"/\"false\" strings, 0/1, or null for the flag; a serializer that coerces booleans; hand-edited receipts.","commonSituations":"JSON produced via string templating instead of a serializer; older emitter that predates the boolean flag.","solutions":["Fix the Rust receipt writer to emit a real JSON boolean for rss_supported.","Regenerate the receipt.","Ensure the flag is derived from actual RSS sampling capability, not a constant."],"exampleFix":"// receipt (before)\n\"rss_supported\": \"true\"\n// receipt (after)\n\"rss_supported\": true","handlingStrategy":"type-guard","validationCode":"if type(receipt.get(\"rss_supported\")) is not bool:\n    sys.exit(\"rss_supported must be a JSON boolean; fix the emitter\")","typeGuard":"def is_strict_bool(value) -> bool:\n    return type(value) is bool","tryCatchPattern":"try:\n    validate_receipt(receipt)\nexcept PersistenceBacklogError as e:\n    if \"rss_supported must be boolean\" in str(e):\n        raise RuntimeError(\"RSS flag coerced to string/int; emit a native boolean\") from e\n    raise","preventionTips":["Emit the flag from actual RSS sampling capability, typed as bool.","Use a real JSON serializer for receipts.","Assert the flag's type in emitter unit tests."],"tags":["validation","json","types","rss"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}