{"record":{"id":"8580f4316c760faf","repo":"Hmbown/CodeWhale","slug":"budget-baseline-receipt-path-changed","errorCode":null,"errorMessage":"budget baseline_receipt path changed","messagePattern":"budget baseline_receipt path changed","errorType":"exception","errorClass":"PersistenceBacklogError","httpStatus":null,"severity":"error","filePath":"scripts/check-persistence-backlog-budget.py","lineNumber":256,"sourceCode":"    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(\n        baseline.get(\"accepted_requests\"), \"baseline_observation.accepted_requests\"\n    )\n    if baseline_accepted != FIXTURE[\"requests_attempted\"]:\n        raise PersistenceBacklogError(","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/scripts/check-persistence-backlog-budget.py#L238-L274","documentation":"Raised by validate_budget() when budget['baseline_receipt'] is not exactly 'scripts/persistence-backlog-baseline-receipt.json' (BASELINE_RECEIPT_REFERENCE). The budget must point at the repo-canonical baseline receipt that main() also loads and cross-checks field-by-field in validate_baseline_receipt(), so a moved, renamed, or repointed file breaks the provenance chain.","triggerScenarios":"A budget whose baseline_receipt is an absolute path, '../scripts/...', a differently named file, contains a backslash separator, or is missing.","commonSituations":"Duplicating the budget for an experiment and repointing the baseline; moving receipt files during a directory reorg; Windows path separators sneaking into the JSON.","solutions":["Set baseline_receipt to the exact relative path 'scripts/persistence-backlog-baseline-receipt.json'","Keep the baseline receipt at that path; move neither file without updating BASELINE_RECEIPT_REFERENCE in the checker","Use forward slashes - the comparison is byte-exact"],"exampleFix":"// before (budget.json)\n\"baseline_receipt\": \"/abs/path/persistence-backlog-baseline-receipt.json\"\n\n// after\n\"baseline_receipt\": \"scripts/persistence-backlog-baseline-receipt.json\"","handlingStrategy":"validation","validationCode":"BASELINE_RECEIPT_REFERENCE = \"scripts/persistence-backlog-baseline-receipt.json\"\n\ndef baseline_ref_ok(budget: dict) -> bool:\n    return budget.get(\"baseline_receipt\") == BASELINE_RECEIPT_REFERENCE","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","path","python","ci-gate","configuration"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}