{"record":{"id":"de3cdb5f1d990763","repo":"Hmbown/CodeWhale","slug":"baseline-observation-accepted-requests-must-equal","errorCode":null,"errorMessage":"baseline_observation.accepted_requests must equal requests_attempted","messagePattern":"baseline_observation\\.accepted_requests must equal requests_attempted","errorType":"exception","errorClass":"PersistenceBacklogError","httpStatus":null,"severity":"error","filePath":"scripts/check-persistence-backlog-budget.py","lineNumber":274,"sourceCode":"        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(\n            \"baseline_observation.accepted_requests must equal requests_attempted\"\n        )\n    baseline_applied = non_negative_integer(\n        baseline.get(\"applied_version\"), \"baseline_observation.applied_version\"\n    )\n    if baseline_applied != FIXTURE[\"expected_applied_version\"]:\n        raise PersistenceBacklogError(\n            \"baseline_observation.applied_version must be the final sent version\"\n        )\n    baseline_retained = baseline[\"retained_queued_requests\"]\n    baseline_payload = baseline[\"estimated_retained_payload_bytes\"]\n    if baseline_retained == 0 or baseline_payload == 0:\n        raise PersistenceBacklogError(\n            \"baseline_observation must retain the final request and payload\"\n        )\n    if baseline_retained > baseline_accepted:\n        raise PersistenceBacklogError(\n            \"baseline_observation.retained_queued_requests exceeds accepted_requests\"","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/scripts/check-persistence-backlog-budget.py#L256-L292","documentation":"Raised by validate_budget() when baseline_observation.accepted_requests is not exactly 128, the FIXTURE requests_attempted. The baseline records an all-sends-accepted run: the paused persistence channel must not reject sends, because dropping requests would trivially shrink the backlog. The same accepted == attempted equality is enforced on every receipt.","triggerScenarios":"baseline_observation.accepted_requests set to 127, 0, a float, or missing - either by hand-editing or because the baseline run's channel actually rejected a send.","commonSituations":"Hand-crafting a 'smaller' baseline; a baseline captured with a fixture that sent fewer requests; confusing accepted_requests with applied_version counts.","solutions":["Set baseline_observation.accepted_requests to 128","If the real run rejected sends, fix the persistence channel's acceptance path rather than editing the baseline","Regenerate the baseline from a clean run of the frozen 128-request workload"],"exampleFix":"// before (budget.json)\n\"baseline_observation\": { \"accepted_requests\": 127, ... }\n\n// after\n\"baseline_observation\": { \"accepted_requests\": 128, ... }","handlingStrategy":"validation","validationCode":"def baseline_accepted_ok(budget: dict, attempted: int = 128) -> bool:\n    return budget.get(\"baseline_observation\", {}).get(\"accepted_requests\") == attempted","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","backpressure"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}