Hmbown/CodeWhale · error · PersistenceBacklogError

baseline_observation.retained_queued_requests exceeds…

Error message

baseline_observation.retained_queued_requests exceeds accepted_requests

What it means

The checker enforces that the baseline's retained_queued_requests never exceeds accepted_requests — you cannot retain more requests than were accepted. Exceeding it indicates an internally inconsistent baseline (acceptance counting bug or corrupted JSON), so the comparison is aborted.

Solutions

  1. Regenerate the baseline so accepted_requests >= retained_queued_requests (expected: accepted 128, retained 127).
  2. Audit the measurement script's accept/retain accounting if a real run produces this inconsistency.
  3. Correct accidental edits to the budget JSON.

Example fix

// before
"accepted_requests": 100, "retained_queued_requests": 127
// after
"accepted_requests": 128, "retained_queued_requests": 127
Defensive patterns

Strategy: validation

Validate before calling

if b.get("retained_queued_requests", 0) > b.get("accepted_requests", 0):
    raise ValueError("retained exceeds accepted; baseline inconsistent")

Try / catch

try:
    compare(budget, baseline_receipt)
except PersistenceBacklogError as e:
    if "exceeds accepted_requests" in str(e): regenerate_baseline()

Prevention

When it happens

Trigger: `compare` with a baseline_observation where retained_queued_requests > accepted_requests (fixture expected value: 127 retained vs 128 accepted).

Common situations: Hand-edited budget numbers, a measurement harness miscounting accepted requests, or merged/stale baseline data.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@433685b202 (2026-09-15). Data as JSON: /api/errors/2c630e3723ef5290. Report an issue: GitHub.

Appendix: 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 433685b202)