{"record":{"id":"587b1aa67475752c","repo":"Hmbown/CodeWhale","slug":"baseline-observation-payload-is-smaller-than-froze","errorCode":null,"errorMessage":"baseline_observation payload is smaller than frozen retained content","messagePattern":"baseline_observation payload is smaller than frozen retained content","errorType":"exception","errorClass":"PersistenceBacklogError","httpStatus":null,"severity":"error","filePath":"scripts/check-persistence-backlog-budget.py","lineNumber":295,"sourceCode":"    baseline_applied = non_negative_integer(\n        baseline.get(\"applied_version\"), \"baseline_observation.applied_version\"\n    )\n    if baseline_applied != FIXTURE[\"expected_applied_version\"]:\n        raise PersistenceBacklogError(\n            \"baseline_observation.applied_version must be the final sent version\"\n        )\n    baseline_retained = baseline[\"retained_queued_requests\"]\n    baseline_payload = baseline[\"estimated_retained_payload_bytes\"]\n    if baseline_retained == 0 or baseline_payload == 0:\n        raise PersistenceBacklogError(\n            \"baseline_observation must retain the final request and payload\"\n        )\n    if baseline_retained > baseline_accepted:\n        raise PersistenceBacklogError(\n            \"baseline_observation.retained_queued_requests exceeds accepted_requests\"\n        )\n    if baseline_payload < baseline_retained * FIXTURE[\"content_bytes_per_request\"]:\n        raise PersistenceBacklogError(\n            \"baseline_observation payload is smaller than frozen retained content\"\n        )\n    provenance = baseline.get(\"provenance\")\n    if not isinstance(provenance, dict):\n        raise PersistenceBacklogError(\"baseline_observation needs provenance\")\n    if provenance.get(\"platform\") != \"macos\":\n        raise PersistenceBacklogError(\"baseline provenance platform must be macos\")\n    if not isinstance(provenance.get(\"source_sha\"), str) or not SOURCE_SHA_PATTERN.fullmatch(\n        provenance[\"source_sha\"]\n    ):\n        raise PersistenceBacklogError(\"baseline provenance needs an exact source SHA\")\n    if provenance.get(\"source_dirty\") is not False:\n        raise PersistenceBacklogError(\"baseline provenance must identify a clean source tree\")\n    for field, prefix in ((\"rustc_version\", \"rustc \"), (\"cargo_version\", \"cargo \")):\n        if not isinstance(provenance.get(field), str) or not provenance[field].startswith(prefix):\n            raise PersistenceBacklogError(f\"baseline provenance needs {field}\")\n    if provenance.get(\"build_profile\") != \"test\" or not (\n        type(provenance.get(\"sample_count\")) is int","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/scripts/check-persistence-backlog-budget.py#L277-L313","documentation":"Raised by validate_budget() when baseline_observation.estimated_retained_payload_bytes is smaller than retained_queued_requests x 65536 (FIXTURE content_bytes_per_request). Every retained 64 KiB request must contribute at least its content bytes to the estimated retained payload; a smaller number means the estimator under-counts retained content or its semantics drifted from the frozen payload_estimator.","triggerScenarios":"A payload below retained x 65536, e.g. 8000000 bytes with retained=128 (minimum 8388608); an estimator that measures something other than retained saved-session JSON bytes.","commonSituations":"Changing payload_estimator semantics without updating the fixture; measuring post-compression serialized size; counting only the newest snapshot instead of all retained requests.","solutions":["Recompute estimated_retained_payload_bytes with the frozen estimator (retained saved-session JSON bytes, payload_estimator 'retained-saved-session-json-bytes-v1')","If the estimator legitimately changed, update payload_estimator in FIXTURE and re-baseline everything together","Sanity-check before saving: payload must be at least retained x 65536"],"exampleFix":"// before (budget.json)\n\"baseline_observation\": {\n  \"retained_queued_requests\": 128,\n  \"estimated_retained_payload_bytes\": 8000000, ... }\n\n// after: >= 128 * 65536 = 8388608\n\"baseline_observation\": {\n  \"retained_queued_requests\": 128,\n  \"estimated_retained_payload_bytes\": 8527994, ... }","handlingStrategy":"validation","validationCode":"def baseline_payload_floor_ok(budget: dict, per_request: int = 65536) -> bool:\n    b = budget.get(\"baseline_observation\", {})\n    return (b.get(\"estimated_retained_payload_bytes\", 0)\n            >= b.get(\"retained_queued_requests\", 0) * per_request)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Load budgets from the repo checkout (scripts/persistence-backlog-budget.json) instead of hand-maintained copies","Validate budget JSON with python -m json.tool and a key-set check before running the checker","Change FIXTURE/SCHEMA_VERSION in the checker only together with regenerating budget and baseline receipt in one commit"],"tags":["json","python","ci-gate","payload-estimator","performance-budget"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}