{"record":{"id":"8c7f335495929419","repo":"Hmbown/CodeWhale","slug":"baseline-observation-field-exceeds-its-ceiling","errorCode":null,"errorMessage":"baseline_observation.{field} exceeds its ceiling","messagePattern":"baseline_observation\\.(.+?) exceeds its ceiling","errorType":"console","errorClass":"PersistenceBacklogError","httpStatus":null,"severity":"error","filePath":"scripts/check-persistence-backlog-budget.py","lineNumber":267,"sourceCode":"        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(\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\"]","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/scripts/check-persistence-backlog-budget.py#L249-L285","documentation":"For each CEILING_FIELDS entry, validate_budget checks that the baseline_observation value does not exceed the corresponding ceilings value. The budget is a one-way ratchet: the recorded baseline must already be within its own ceiling. If any baseline number (retained_queued_requests, estimated_retained_payload_bytes, enqueue_elapsed_ns, rss_during_delta_bytes, or rss_after_delta_bytes) is above its ceiling, the budget is internally inconsistent and rejected.","triggerScenarios":"compare calls validate_budget and for some ceiling field baseline_observation[field] > ceilings[field] — typically after someone tightened a ceiling below the recorded baseline, or recorded a baseline from a different run than the ceilings were set from.","commonSituations":"Hand-tightening ceilings without re-measuring a new baseline; regenerating baseline_observation on a slower machine while keeping old ceilings; an earlier partial edit that moved only one of the two numbers.","solutions":["Re-run the measurement to record a fresh baseline_observation, then set each ceiling >= its observed baseline value","Raise the offending ceiling back to at least the baseline value in baseline_observation","Regenerate the whole budget (baseline + ceilings) in one pass so they stay consistent"],"exampleFix":"// before\n{ \"ceilings\": { \"enqueue_elapsed_ns\": 1000 }, \"baseline_observation\": { \"enqueue_elapsed_ns\": 2500 } }\n// after\n{ \"ceilings\": { \"enqueue_elapsed_ns\": 2500 }, \"baseline_observation\": { \"enqueue_elapsed_ns\": 2500 } }","handlingStrategy":"validation","validationCode":"from check_persistence_backlog_budget import CEILING_FIELDS\nfor f in CEILING_FIELDS:\n    assert budget[\"baseline_observation\"][f] <= budget[\"ceilings\"][f], f\"baseline {f} exceeds its ceiling\"","typeGuard":"def baseline_within_ceilings(b):\n    c, o = b.get(\"ceilings\"), b.get(\"baseline_observation\")\n    return isinstance(c, dict) and isinstance(o, dict) and all(o.get(f) is not None and o[f] <= c[f] for f in CEILING_FIELDS)","tryCatchPattern":"try:\n    validate_budget(budget)\nexcept PersistenceBacklogError as e:\n    if \"exceeds its ceiling\" in str(e):\n        print(\"re-measure a new baseline or raise the ceiling to at least the baseline\")\n    raise","preventionTips":["Always set ceilings >= the recorded baseline_observation values","Re-measure the baseline whenever hardware or the workload changes","Tighten ceilings only together with a fresh, verified baseline run"],"tags":["validation","budget","ceiling","baseline"],"backgroundTag":"value-out-of-range","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"}