{"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":"console","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/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/scripts/check-persistence-backlog-budget.py#L238-L274","documentation":"validate_budget requires budget.baseline_receipt to equal the exact relative path \"scripts/persistence-backlog-baseline-receipt.json\" (BASELINE_RECEIPT_REFERENCE). The budget must always cite the committed baseline receipt at its canonical location so the checker can load and cross-validate it. Any move, rename, or rewrite of the reference path is rejected.","triggerScenarios":"compare calls validate_budget on a budget whose baseline_receipt field is missing, null, an absolute path, or a relocated relative path (e.g. after moving the file to another directory).","commonSituations":"Restructuring the scripts/ directory and updating the reference; replacing the field with the absolute path of a local checkout; deleting the field during a budget edit.","solutions":["Set \"baseline_receipt\": \"scripts/persistence-backlog-baseline-receipt.json\" in the budget","Keep the baseline receipt at its canonical path and reference it relatively","Restore the budget file from version control if the reference was lost"],"exampleFix":"// before\n\"baseline_receipt\": \"/home/me/repo/scripts/persistence-backlog-baseline-receipt.json\"\n// after\n\"baseline_receipt\": \"scripts/persistence-backlog-baseline-receipt.json\"","handlingStrategy":"validation","validationCode":"assert budget.get(\"baseline_receipt\") == \"scripts/persistence-backlog-baseline-receipt.json\", \"baseline_receipt must reference the canonical relative path\"","typeGuard":"def references_canonical_baseline(doc):\n    return isinstance(doc, dict) and doc.get(\"baseline_receipt\") == \"scripts/persistence-backlog-baseline-receipt.json\"","tryCatchPattern":"try:\n    validate_budget(budget)\nexcept PersistenceBacklogError as e:\n    if \"baseline_receipt path changed\" in str(e):\n        budget[\"baseline_receipt\"] = \"scripts/persistence-backlog-baseline-receipt.json\"\n    raise","preventionTips":["Always reference the baseline receipt with the exact repo-relative path string","Do not move persistence-backlog-baseline-receipt.json out of scripts/","Avoid absolute paths in committed budget files"],"tags":["validation","budget","path","baseline"],"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"}