Hmbown/CodeWhale · error · PersistenceBacklogError

rss_supported must be boolean

Error message

rss_supported must be boolean

What it means

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.

Source

Thrown at scripts/check-persistence-backlog-budget.py:220

        raise PersistenceBacklogError(
            "estimated_retained_payload_bytes is smaller than the frozen retained content"
        )
    applied = non_negative_integer(
        receipt["applied_version"], "applied_version"
    )
    if applied != FIXTURE["expected_applied_version"]:
        raise PersistenceBacklogError("applied_version is not the final sent version")
    if receipt["final_version_applied"] is not True:
        raise PersistenceBacklogError("final_version_applied must be true")

    limitations = receipt["limitations"]
    if not isinstance(limitations, list) or not limitations or not all(
        isinstance(item, str) and item for item in limitations
    ):
        raise PersistenceBacklogError("limitations must be a non-empty string array")

    if not isinstance(receipt["rss_supported"], bool):
        raise PersistenceBacklogError("rss_supported must be boolean")
    if receipt["rss_supported"] != (platform == "macos"):
        raise PersistenceBacklogError(
            "rss_supported must be true exactly on the macOS measurement lane"
        )
    rss_fields = RSS_SAMPLE_FIELDS + RSS_DELTA_FIELDS
    if receipt["rss_supported"]:
        for field in rss_fields:
            non_negative_integer(receipt[field], field)
        before = receipt["rss_before_bytes"]
        if receipt["rss_during_delta_bytes"] != max(
            0, receipt["rss_during_bytes"] - before
        ):
            raise PersistenceBacklogError("rss_during_delta_bytes is inconsistent")
        if receipt["rss_after_delta_bytes"] != max(
            0, receipt["rss_after_bytes"] - before
        ):
            raise PersistenceBacklogError("rss_after_delta_bytes is inconsistent")
    elif any(receipt[field] is not None for field in rss_fields):

View on GitHub (pinned to 8880682c63)

Solutions

  1. Fix the Rust receipt writer to emit a real JSON boolean for rss_supported.
  2. Regenerate the receipt.
  3. Ensure the flag is derived from actual RSS sampling capability, not a constant.

Example fix

// receipt (before)
"rss_supported": "true"
// receipt (after)
"rss_supported": true
Defensive patterns

Strategy: type-guard

Validate before calling

if type(receipt.get("rss_supported")) is not bool:
    sys.exit("rss_supported must be a JSON boolean; fix the emitter")

Type guard

def is_strict_bool(value) -> bool:
    return type(value) is bool

Try / catch

try:
    validate_receipt(receipt)
except PersistenceBacklogError as e:
    if "rss_supported must be boolean" in str(e):
        raise RuntimeError("RSS flag coerced to string/int; emit a native boolean") from e
    raise

Prevention

When it happens

Trigger: The emitter writing "true"/"false" strings, 0/1, or null for the flag; a serializer that coerces booleans; hand-edited receipts.

Common situations: JSON produced via string templating instead of a serializer; older emitter that predates the boolean flag.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16). Data as JSON: /api/errors/f4426cef5c1058c3. Report an issue: GitHub.