Hmbown/CodeWhale · error · PersistenceBacklogError

baseline receipt {field} does not match baseline_observation

Error message

baseline receipt {field} does not match baseline_observation

What it means

Thrown by validate_baseline_receipt in scripts/check-persistence-backlog-budget.py when one of accepted_requests, applied_version, or the CEILING_FIELDS (retained_queued_requests, estimated_retained_payload_bytes, enqueue_elapsed_ns, rss_during_delta_bytes, rss_after_delta_bytes) differs between scripts/persistence-backlog-baseline-receipt.json and the budget's baseline_observation. The two files must describe the same measurement so ceilings have an auditable origin. Any numeric drift — even an apparent improvement — fails the gate until both files are updated together.

Source

Thrown at scripts/check-persistence-backlog-budget.py:326

        raise PersistenceBacklogError("baseline provenance must identify a clean source tree")
    for field, prefix in (("rustc_version", "rustc "), ("cargo_version", "cargo ")):
        if not isinstance(provenance.get(field), str) or not provenance[field].startswith(prefix):
            raise PersistenceBacklogError(f"baseline provenance needs {field}")
    if provenance.get("build_profile") != "test" or not (
        type(provenance.get("sample_count")) is int
        and provenance["sample_count"] == 1
    ):
        raise PersistenceBacklogError("baseline provenance build profile/sample count changed")


def validate_baseline_receipt(
    budget: dict[str, Any], baseline_receipt: dict[str, Any]
) -> None:
    validate_receipt(baseline_receipt, require_clean_source=True)
    baseline = budget["baseline_observation"]
    for field in ("accepted_requests", "applied_version", *CEILING_FIELDS):
        if baseline_receipt[field] != baseline[field]:
            raise PersistenceBacklogError(
                f"baseline receipt {field} does not match baseline_observation"
            )
    provenance = baseline["provenance"]
    for field in (
        "platform",
        "source_sha",
        "source_dirty",
        "rustc_version",
        "cargo_version",
        "build_profile",
        "sample_count",
    ):
        if baseline_receipt[field] != provenance[field]:
            raise PersistenceBacklogError(
                f"baseline receipt {field} does not match baseline provenance"
            )

View on GitHub (pinned to 8880682c63)

Solutions

  1. Diff the seven checked fields between scripts/persistence-backlog-baseline-receipt.json and the budget's baseline_observation; the message names the first mismatching field
  2. If the baseline was legitimately re-measured, copy the receipt's values into baseline_observation (and its provenance) in the same commit
  3. If the budget was edited speculatively, revert it with `git checkout -- scripts/persistence-backlog-budget.json`

Example fix

// before — receipt: "retained_queued_requests": 4; budget baseline_observation: 5
// after — copy the measured values into scripts/persistence-backlog-budget.json
"baseline_observation": { "accepted_requests": 128, "applied_version": 127, "retained_queued_requests": 4, "estimated_retained_payload_bytes": 262144, ... }
Defensive patterns

Strategy: validation

Validate before calling

fields = ('accepted_requests', 'applied_version', 'retained_queued_requests', 'estimated_retained_payload_bytes', 'enqueue_elapsed_ns', 'rss_during_delta_bytes', 'rss_after_delta_bytes')
baseline = budget['baseline_observation']
drift = [f for f in fields if baseline[f] != receipt[f]]
assert not drift, drift

Try / catch

try:
    validate_baseline_receipt(budget, receipt)
except PersistenceBacklogError as e:
    report_field_drift(str(e))
    raise

Prevention

When it happens

Trigger: Running the checker after (a) editing baseline_observation numbers in scripts/persistence-backlog-budget.json without re-measuring, or (b) replacing the baseline receipt from a new measurement without copying the new values into the budget's baseline_observation.

Common situations: Tightening ceilings by editing only the budget; re-measuring the baseline on newer hardware or a newer toolchain and committing only the receipt; merge conflicts resolved in one file but not the other.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16). Data as JSON: /api/errors/51275028f33e4118. Report an issue: GitHub.