Hmbown/CodeWhale · error · PersistenceBacklogError
baseline_observation.retained_queued_requests exceeds accept
Error message
baseline_observation.retained_queued_requests exceeds accepted_requests
What it means
Raised by validate_budget() when baseline_observation.retained_queued_requests is greater than baseline_observation.accepted_requests (validated earlier as exactly 128). A queue cannot retain more requests than were accepted, so retained > accepted signals duplicated queue entries or corrupted counters.
Source
Thrown at scripts/check-persistence-backlog-budget.py:291
if baseline_accepted != FIXTURE["requests_attempted"]:
raise PersistenceBacklogError(
"baseline_observation.accepted_requests must equal requests_attempted"
)
baseline_applied = non_negative_integer(
baseline.get("applied_version"), "baseline_observation.applied_version"
)
if baseline_applied != FIXTURE["expected_applied_version"]:
raise PersistenceBacklogError(
"baseline_observation.applied_version must be the final sent version"
)
baseline_retained = baseline["retained_queued_requests"]
baseline_payload = baseline["estimated_retained_payload_bytes"]
if baseline_retained == 0 or baseline_payload == 0:
raise PersistenceBacklogError(
"baseline_observation must retain the final request and payload"
)
if baseline_retained > baseline_accepted:
raise PersistenceBacklogError(
"baseline_observation.retained_queued_requests exceeds accepted_requests"
)
if baseline_payload < baseline_retained * FIXTURE["content_bytes_per_request"]:
raise PersistenceBacklogError(
"baseline_observation payload is smaller than frozen retained content"
)
provenance = baseline.get("provenance")
if not isinstance(provenance, dict):
raise PersistenceBacklogError("baseline_observation needs provenance")
if provenance.get("platform") != "macos":
raise PersistenceBacklogError("baseline provenance platform must be macos")
if not isinstance(provenance.get("source_sha"), str) or not SOURCE_SHA_PATTERN.fullmatch(
provenance["source_sha"]
):
raise PersistenceBacklogError("baseline provenance needs an exact source SHA")
if provenance.get("source_dirty") is not False:
raise PersistenceBacklogError("baseline provenance must identify a clean source tree")
for field, prefix in (("rustc_version", "rustc "), ("cargo_version", "cargo ")):View on GitHub (pinned to 8880682c63)
Solutions
- If the value was hand-edited, correct retained_queued_requests to the observed value <= accepted_requests
- If the real measurement shows duplication, fix the retention path so each request is retained once - do not raise accepted_requests instead
- Add a regression test asserting retained <= accepted on receipts
Example fix
// before (budget.json)
"baseline_observation": {
"accepted_requests": 128,
"retained_queued_requests": 256, ... }
// after: deduplicated retention
"baseline_observation": {
"accepted_requests": 128,
"retained_queued_requests": 128, ... } Defensive patterns
Strategy: validation
Validate before calling
def baseline_retained_bounded(budget: dict) -> bool:
b = budget.get("baseline_observation", {})
return b.get("retained_queued_requests", 0) <= b.get("accepted_requests", 0) Prevention
- 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
When it happens
Trigger: retained_queued_requests of 129+ alongside accepted_requests 128 - a hand-edit typo, or a real duplication bug where the persistence queue stores the same snapshot more than once.
Common situations: Duplication regressions like the v0.9.5 journal repair (legacy messages plus the canonical journal double-counting retained work); hand-edit typos; counting applied plus queued requests as retained.
Related errors
- baseline_observation.{field} exceeds its ceiling
- baseline_observation payload is smaller than frozen retained
- rss_during_delta_bytes is inconsistent
- rss_after_delta_bytes is inconsistent
- budget document_kind must be {BUDGET_KIND}
AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16).
Data as JSON: /api/errors/2c630e3723ef5290.
Report an issue: GitHub.