{"record":{"id":"587b1aa67475752c","repo":"Hmbown/CodeWhale","slug":"baseline-observation-payload-is-smaller-than-frozen-retained","errorCode":null,"errorMessage":"baseline_observation payload is smaller than frozen retained content","messagePattern":"baseline_observation payload is smaller than frozen retained content","errorType":"console","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/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/scripts/check-persistence-backlog-budget.py#L277-L313","documentation":"validate_budget checks that the baseline's estimated_retained_payload_bytes is at least retained_queued_requests * 64KiB (the frozen content_bytes_per_request). A smaller payload means the estimate understates the retained content, so the baseline cannot serve as a trustworthy floor for the memory budget.","triggerScenarios":"`compare` where baseline_payload < baseline_retained * 65536, e.g. after changing content_bytes_per_request in FIXTURE without regenerating the baseline payload estimate.","commonSituations":"Fixture byte-size constants changed, a different payload estimator version used for the baseline, or manually reduced payload numbers.","solutions":["Regenerate the baseline with the current payload_estimator (retained-saved-session-json-bytes-v1) and the frozen 64KiB per-request content.","Keep content_bytes_per_request in FIXTURE in sync with what the measurement actually produced.","Do not lower the fixture constant to satisfy the check; restore the frozen value instead."],"exampleFix":"// before\n\"content_bytes_per_request\": 1024 (baseline payload sized for 1024)\n// after\nregenerate baseline with 64 * 1024 bytes per retained request","handlingStrategy":"validation","validationCode":"CONTENT_BYTES = 64 * 1024\nif b.get(\"estimated_retained_payload_bytes\", 0) < b.get(\"retained_queued_requests\", 0) * CONTENT_BYTES:\n    raise ValueError(\"baseline payload below frozen retained content floor\")","typeGuard":null,"tryCatchPattern":"try:\n    compare(budget, baseline_receipt)\nexcept PersistenceBacklogError as e:\n    if \"smaller than frozen retained content\" in str(e): re-run measure script with current estimator","preventionTips":["Keep payload_estimator and content_bytes_per_request in sync between fixture and measurement.","Regenerate the baseline after any change to per-request payload size."],"tags":["python","validation","budget-check"],"backgroundTag":"schema-validation-failed","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"}