{"record":{"id":"11edfe07c17b67e4","repo":"Hmbown/CodeWhale","slug":"budget-fixture-field-must-remain-expected-r","errorCode":null,"errorMessage":"budget fixture.{field} must remain {expected!r}","messagePattern":"budget fixture\\.(.+?) must remain (.+?)","errorType":"console","errorClass":"PersistenceBacklogError","httpStatus":null,"severity":"error","filePath":"scripts/check-persistence-backlog-budget.py","lineNumber":252,"sourceCode":"        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(\n                f\"baseline_observation.{field} exceeds its ceiling\"\n            )\n    baseline_accepted = non_negative_integer(","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/scripts/check-persistence-backlog-budget.py#L234-L270","documentation":"After the key-set check, validate_budget compares each fixture field's type and value against the script's frozen FIXTURE constants. If any fixture field was changed (e.g. requests_attempted bumped from 128 to 256), the budget describes a different workload than the one the ceilings were calibrated for, so the check fails with this field-specific message naming the expected value.","triggerScenarios":"compare calls validate_budget and any fixture field differs in type (strict type() check, so true vs 1 fails) or value from FIXTURE, e.g. content_bytes_per_request changed or expected_applied_version edited.","commonSituations":"Tuning the workload numbers by hand in the budget JSON to make a failing ceiling pass; editing fixture values with a different numeric type (float 128.0 instead of int 128); stale budget from a pre-existing fixture revision.","solutions":["Revert the edited fixture field to the exact frozen value reported in the error message","Regenerate the budget from the current measurement pipeline","If the workload must change, update FIXTURE in the script first and recalibrate ceilings and baseline_observation in the same commit"],"exampleFix":"// before\n\"requests_attempted\": 256\n// after\n\"requests_attempted\": 128","handlingStrategy":"validation","validationCode":"from check_persistence_backlog_budget import FIXTURE\nfixture = budget.get(\"fixture\", {})\nfor field, expected in FIXTURE.items():\n    assert type(fixture.get(field)) is type(expected) and fixture.get(field) == expected, f\"fixture.{field} must remain {expected!r}\"","typeGuard":"def fixture_matches(doc):\n    f = doc.get(\"fixture\") if isinstance(doc, dict) else None\n    return isinstance(f, dict) and all(type(f.get(k)) is type(v) and f.get(k) == v for k, v in FIXTURE.items())","tryCatchPattern":"try:\n    validate_budget(budget)\nexcept PersistenceBacklogError as e:\n    if \".must remain\" in str(e) and \"fixture\" in str(e):\n        print(\"restore the frozen fixture value named in the message\")\n    raise","preventionTips":["Treat FIXTURE values as immutable constants; change workload size only via a script + budget regeneration commit","Beware JSON round-trips that turn ints into floats — the check is strict on type()","Never hand-edit fixture numbers to make a ceiling check pass"],"tags":["validation","budget","fixture","frozen-values"],"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"}