{"record":{"id":"50ce881425833fdf","repo":"Hmbown/CodeWhale","slug":"limitations-must-be-a-non-empty-string-array","errorCode":null,"errorMessage":"limitations must be a non-empty string array","messagePattern":"limitations must be a non-empty string array","errorType":"validation","errorClass":"PersistenceBacklogError","httpStatus":null,"severity":"error","filePath":"scripts/check-persistence-backlog-budget.py","lineNumber":217,"sourceCode":"        )\n    minimum_payload_bytes = retained * FIXTURE[\"content_bytes_per_request\"]\n    if receipt[\"estimated_retained_payload_bytes\"] < minimum_payload_bytes:\n        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","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/scripts/check-persistence-backlog-budget.py#L199-L235","documentation":"limitations must be a non-empty array of non-empty strings. Every receipt must document the known caveats of its measurement (e.g. platform-specific RSS limits); an empty, non-list, or blank-string limitations field means the receipt omits required disclosure about measurement validity.","triggerScenarios":"Raised by validate_receipt when receipt['limitations'] is not a list, is an empty list, or contains a non-string or empty-string element, from validate_baseline_receipt or compare.","commonSituations":"A regenerated receipt that drops the limitations block; tools writing None instead of a list; copying a receipt template and blanking the limitation strings.","solutions":["Re-run the measurement script so limitations is emitted with its documented caveat strings.","If editing a receipt, keep limitations as a list of non-empty strings, e.g. [\"RSS sampling unsupported on this platform\"].","Fix generator code that serializes limitations as null or joins them into a single string."],"exampleFix":"// before\n\"limitations\": []\n// after\n\"limitations\": [\"rss deltas are clamped at zero; allocator reuse can mask growth\"]","handlingStrategy":"validation","validationCode":"def limitations_valid(receipt):\n    lim = receipt.get(\"limitations\")\n    return isinstance(lim, list) and len(lim) > 0 and all(isinstance(x, str) and x for x in lim)","typeGuard":"def is_non_empty_str_array(v):\n    return isinstance(v, list) and len(v) > 0 and all(isinstance(x, str) and x for x in v)","tryCatchPattern":"try:\n    validate_receipt(receipt)\nexcept PersistenceBacklogError as e:\n    print(f\"receipt rejected: {e}\", file=sys.stderr)\n    sys.exit(2)","preventionTips":["Emit the standard limitation strings from the measuring script every run.","Keep limitations as a list of non-empty strings in any receipt template.","Fail fast in the generator if limitations would serialize as null or []."],"tags":["measurement","validation","metadata","python"],"backgroundTag":"empty-required-field","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"}