{"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":"validation","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/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/scripts/check-persistence-backlog-budget.py#L202-L238","documentation":"rss_supported must be a strict JSON boolean. The checker branches all RSS sample/delta validation on this flag, so a string, number, or null value makes it impossible to know whether the RSS fields should be validated or null, and the receipt is rejected.","triggerScenarios":"Raised by validate_receipt when type(receipt['rss_supported']) is not bool, from validate_baseline_receipt or compare.","commonSituations":"A generator serializing the flag as \"true\"/\"false\" strings or 0/1; hand-editing the receipt with YAML-ish true; a JSON library writing None for missing values.","solutions":["Emit rss_supported as a JSON boolean (true or false) in the measurement script.","Re-generate the receipt rather than editing the field by hand.","Fix any intermediary that round-trips the receipt through a format that coerces booleans (e.g. YAML, env vars)."],"exampleFix":"// before\n\"rss_supported\": \"true\"\n// after\n\"rss_supported\": true","handlingStrategy":"type-guard","validationCode":"def rss_supported_is_bool(receipt):\n    return isinstance(receipt.get(\"rss_supported\"), bool)","typeGuard":"def is_bool(v):\n    return isinstance(v, bool)","tryCatchPattern":"try:\n    validate_receipt(receipt)\nexcept PersistenceBacklogError as e:\n    print(f\"receipt rejected: {e}\", file=sys.stderr)\n    sys.exit(2)","preventionTips":["Use a JSON serializer that preserves booleans; avoid round-tripping through YAML or env vars.","Type-check receipt fields at generation time.","Never represent true/false as strings in receipts."],"tags":["measurement","validation","types","python"],"backgroundTag":"type-mismatch","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"}