{"record":{"id":"39011d787d22a556","repo":"Hmbown/CodeWhale","slug":"unsupported-rss-fields-must-be-null","errorCode":null,"errorMessage":"unsupported RSS fields must be null","messagePattern":"unsupported RSS fields must be null","errorType":"exception","errorClass":"PersistenceBacklogError","httpStatus":null,"severity":"error","filePath":"scripts/check-persistence-backlog-budget.py","lineNumber":239,"sourceCode":"    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\n\ndef validate_budget(budget: dict[str, Any]) -> None:\n    if budget.get(\"document_kind\") != BUDGET_KIND:\n        raise PersistenceBacklogError(f\"budget document_kind must be {BUDGET_KIND}\")\n    if budget.get(\"schema_version\") != SCHEMA_VERSION:\n        raise PersistenceBacklogError(\"budget schema_version changed\")\n    fixture = budget.get(\"fixture\")\n    if not isinstance(fixture, dict) or set(fixture) != set(FIXTURE):\n        raise PersistenceBacklogError(\"budget fixture no longer matches the frozen workload\")\n    for field, expected in FIXTURE.items():\n        if type(fixture[field]) is not type(expected) or fixture[field] != expected:\n            raise PersistenceBacklogError(\n                f\"budget fixture.{field} must remain {expected!r}\"\n            )\n    if budget.get(\"baseline_receipt\") != BASELINE_RECEIPT_REFERENCE:\n        raise PersistenceBacklogError(\"budget baseline_receipt path changed\")\n    ceilings = budget.get(\"ceilings\")","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/scripts/check-persistence-backlog-budget.py#L221-L257","documentation":"Raised by validate_receipt() when a receipt declares rss_supported=false (the Linux/Windows measurement lanes) but any of the six RSS fields (rss_before_bytes, rss_during_bytes, rss_after_bytes, rss_during_delta_bytes, rss_after_delta_bytes) is not None. The schema keeps the RSS field shape on every platform but only the macOS lane may carry values, so non-macOS receipts must null all six. This stops cross-platform receipts from carrying numbers the RSS ceilings cannot legitimately compare (compare() skips RSS ceilings when rss_supported is false).","triggerScenarios":"Calling compare()/validate_receipt() with platform 'linux' or 'windows', rss_supported=false, and any of the six RSS fields set to a number (including 0), string, or missing-but-required value instead of null.","commonSituations":"Copy-pasting a macOS receipt onto a Linux CI lane and only flipping rss_supported; older tooling that wrote 0 instead of null for unsupported metrics; hand-porting receipts between platforms.","solutions":["Set all six RSS fields to null in the non-macOS receipt","Regenerate the receipt on the actual Linux/Windows lane via scripts/measure-persistence-backlog.py","If RSS numbers are actually needed, take the measurement on macOS where rss_supported=true"],"exampleFix":"// before (receipt.json, linux lane)\n\"platform\": \"linux\",\n\"rss_supported\": false,\n\"rss_before_bytes\": 0,\n\"rss_during_bytes\": 0,\n\"rss_after_bytes\": 0,\n\"rss_during_delta_bytes\": 0,\n\"rss_after_delta_bytes\": 0\n\n// after\n\"platform\": \"linux\",\n\"rss_supported\": false,\n\"rss_before_bytes\": null,\n\"rss_during_bytes\": null,\n\"rss_after_bytes\": null,\n\"rss_during_delta_bytes\": null,\n\"rss_after_delta_bytes\": null","handlingStrategy":"validation","validationCode":"RSS_FIELDS = (\"rss_before_bytes\", \"rss_during_bytes\", \"rss_after_bytes\",\n              \"rss_during_delta_bytes\", \"rss_after_delta_bytes\")\n\ndef rss_nullity_ok(receipt: dict) -> bool:\n    if receipt.get(\"rss_supported\"):\n        return True\n    return all(receipt.get(f) is None for f in RSS_FIELDS)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never hand-edit receipt JSON; regenerate it with scripts/measure-persistence-backlog.py","Keep the clamp formula max(0, sample - rss_before_bytes) in one shared helper used by both the sampler and the checker","Run scripts/test_check_persistence_backlog_budget.py after touching any RSS handling"],"tags":["rss","measurement-receipt","platform","python","ci-gate"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}