{"record":{"id":"505ad04fda5c528c","repo":"Hmbown/CodeWhale","slug":"budget-fixture-no-longer-matches-the-frozen-workload","errorCode":null,"errorMessage":"budget fixture no longer matches the frozen workload","messagePattern":"budget fixture no longer matches the frozen workload","errorType":"console","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/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/scripts/check-persistence-backlog-budget.py#L231-L267","documentation":"validate_budget checks that budget.fixture is a dict with exactly the same key set as the script's frozen FIXTURE workload (fixture_id, request_variant, payload_estimator, paused_consumer, requests_attempted, content_bytes_per_request, single_session_id, expected_applied_version). If the key set differs — extra or missing keys, or fixture is not an object — the budget no longer describes the same frozen benchmark and the checker aborts.","triggerScenarios":"compare calls validate_budget and the budget's fixture object has keys that do not exactly equal set(FIXTURE): someone added a key, removed one, renamed one, or fixture is missing/null.","commonSituations":"Hand-editing the fixture to change workload size (e.g. requests_attempted) without understanding it is frozen; an older budget from before a fixture field was added; copying a different project's budget file.","solutions":["Restore the fixture object to exactly the 8 frozen keys with the frozen values defined in FIXTURE in the script","Regenerate the budget from the current script version","If the workload legitimately changed, change FIXTURE in the script and regenerate the budget/ceilings together, never the budget alone"],"exampleFix":"// before\n{ \"fixture\": { \"fixture_id\": \"x\", \"requests_attempted\": 64 } }\n// after\n{ \"fixture\": { \"fixture_id\": \"paused-production-channel-session-snapshot-v1\", \"request_variant\": \"session_snapshot\", \"payload_estimator\": \"retained-saved-session-json-bytes-v1\", \"paused_consumer\": true, \"requests_attempted\": 128, \"content_bytes_per_request\": 65536, \"single_session_id\": true, \"expected_applied_version\": 127 } }","handlingStrategy":"validation","validationCode":"from check_persistence_backlog_budget import FIXTURE\nbudget = json.load(open(\"scripts/persistence-backlog-budget.json\"))\nassert isinstance(budget.get(\"fixture\"), dict) and set(budget[\"fixture\"]) == set(FIXTURE), \"fixture keys must exactly match the frozen FIXTURE\"","typeGuard":"def has_frozen_fixture_keys(doc):\n    return isinstance(doc, dict) and isinstance(doc.get(\"fixture\"), dict) and set(doc[\"fixture\"]) == set(FIXTURE)","tryCatchPattern":"try:\n    validate_budget(budget)\nexcept PersistenceBacklogError as e:\n    if \"frozen workload\" in str(e):\n        print(\"fixture key set changed; restore the exact FIXTURE keys\")\n    raise","preventionTips":["Never add, remove, or rename fixture keys in the budget JSON","Diff your budget against FIXTURE in the script before committing","Regenerate the budget programmatically rather than editing the fixture by hand"],"tags":["validation","budget","fixture","frozen-workload"],"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"}