{"record":{"id":"505ad04fda5c528c","repo":"Hmbown/CodeWhale","slug":"budget-fixture-no-longer-matches-the-frozen-worklo","errorCode":null,"errorMessage":"budget fixture no longer matches the frozen workload","messagePattern":"budget fixture no longer matches the frozen workload","errorType":"exception","errorClass":"PersistenceBacklogError","httpStatus":null,"severity":"error","filePath":"scripts/check-persistence-backlog-budget.py","lineNumber":249,"sourceCode":"            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\")\n    baseline = budget.get(\"baseline_observation\")\n    if not isinstance(ceilings, dict) or not isinstance(baseline, dict):\n        raise PersistenceBacklogError(\"budget needs ceilings and baseline_observation objects\")\n    for field in CEILING_FIELDS:\n        ceiling = non_negative_integer(ceilings.get(field), f\"ceilings.{field}\")\n        observed = non_negative_integer(\n            baseline.get(field), f\"baseline_observation.{field}\"\n        )\n        if observed > ceiling:\n            raise PersistenceBacklogError(","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/scripts/check-persistence-backlog-budget.py#L231-L267","documentation":"Raised by validate_budget() when budget['fixture'] is not a dict whose key set exactly equals the frozen FIXTURE keys: fixture_id, request_variant, payload_estimator, paused_consumer, requests_attempted, content_bytes_per_request, single_session_id, expected_applied_version. The fixture is the frozen measurement workload; adding, removing, or renaming keys means the budget no longer describes the contract the checker enforces.","triggerScenarios":"A fixture object carrying an extra key (e.g. a stray _comment), a missing key, or renamed keys like 'requests' instead of 'requests_attempted' - set(fixture) != set(FIXTURE).","commonSituations":"Someone 'documenting' the fixture by adding a comment key inside it; merging budgets across branches that changed the fixture shape; renaming a fixture field in the measure script without updating the budget.","solutions":["Restore the fixture object to exactly the eight frozen keys","Run scripts/test_check_persistence_backlog_budget.py to confirm the shape matches the checker","If the workload intentionally changed, update FIXTURE in check-persistence-backlog-budget.py and regenerate budget plus baseline receipt in the same commit"],"exampleFix":"// before (budget.json)\n\"fixture\": {\n  \"fixture_id\": \"paused-production-channel-session-snapshot-v1\",\n  \"_comment\": \"128 sends of 64KiB\",\n  \"requests_attempted\": 128\n}\n\n// after: exactly the eight frozen keys, no extras\n\"fixture\": {\n  \"fixture_id\": \"paused-production-channel-session-snapshot-v1\",\n  \"request_variant\": \"session_snapshot\",\n  \"payload_estimator\": \"retained-saved-session-json-bytes-v1\",\n  \"paused_consumer\": true,\n  \"requests_attempted\": 128,\n  \"content_bytes_per_request\": 65536,\n  \"single_session_id\": true,\n  \"expected_applied_version\": 127\n}","handlingStrategy":"validation","validationCode":"FIXTURE_KEYS = {\n    \"fixture_id\", \"request_variant\", \"payload_estimator\", \"paused_consumer\",\n    \"requests_attempted\", \"content_bytes_per_request\", \"single_session_id\",\n    \"expected_applied_version\",\n}\n\ndef fixture_shape_ok(budget: dict) -> bool:\n    fixture = budget.get(\"fixture\")\n    return isinstance(fixture, dict) and set(fixture) == FIXTURE_KEYS","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","frozen-workload","python","ci-gate","configuration"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}