Skip to content

fix(reporting): name reporting_revision_id on the not-found answer for an unknown revision - #1796

Merged
bokelley merged 1 commit into
nextfrom
claude/issue-1669-revision-not-found-field
Nov 2, 2026
Merged

bokelley merged 1 commit into
nextfrom
claude/issue-1669-revision-not-found-field

Conversation

@bokelley

@bokelley bokelley commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

The last open item of #1669 that applies to 3.3.

The 3.2 to 3.3 migration guide (§Superseded reporting snapshots may be compacted) says a compacted snapshot's exact read returns the nondisclosing REFERENCE_NOT_FOUND with field: "reporting_revision_id", "exactly as for an unknown ID". The SDK's unknown-revision answer carried no field, so it didn't match the shape compaction will reuse.

Changes:

  • reporting_error: gains a keyword-only field. The store-internal REVISION_NOT_FOUND maps to REFERENCE_NOT_FOUND with field: "reporting_revision_id".
  • LedgerConflictError: gains an optional field (backward compatible). It's set at the exact-revision lookups:
    • ledger/status.py, the revision view;
    • projection/wire.py;
    • the production get_media_buy_delivery exact-revision path, three sites.
  • Wire mapping: installed_reporting_call, _subscription_grant and the handler's own exact-revision mapping carry the field to the wire error.
  • Other references: unresolved obligations and lookups keep no field. Messages stay generic and nondisclosing.

This only adds a field to an error, so nothing breaks. It changes no ledger column or anything storage reads, and nothing under packages/; the PostgreSQL store's REVISION_NOT_FOUND is mapped centrally.

Tests: tests/test_reporting_unreadable_revision_errors.py now asserts the field:

  • for both raise forms through the admission translator;
  • on reporting_error;
  • on the handler's absent-revision answer;
  • and that other unresolved references carry none.

That file, test_reporting_installed_errors.py and test_reporting_ledger.py: 171 passed. ruff and mypy are clean.

Refs #1669

🤖 Generated with Claude Code

…r an unknown revision

AdCP 3.3 makes a compacted snapshot's exact read answer the nondisclosing
REFERENCE_NOT_FOUND with field "reporting_revision_id", "exactly as for an
unknown ID". The SDK's unknown-revision answers carried no field.

reporting_error gains a field parameter, and the store's REVISION_NOT_FOUND
maps to REFERENCE_NOT_FOUND with field reporting_revision_id.
LedgerConflictError gains an optional field, set at the exact-revision
lookups in status, projection and the production get_media_buy_delivery
path, and the admission translator and the handler's own mapping carry it to
the wire. Other unresolved references keep no field. The message stays
generic and nondisclosing.

Refs #1669

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve.

Clean, backward-compatible fix. Threads a keyword-only, optional field through the reporting error path so an unknown/retired revision answers REFERENCE_NOT_FOUND with field: "reporting_revision_id", matching the 3.2→3.3 migration shape. All new params are keyword-only and optional, so public-API/wire stability is preserved and the fix(reporting): prefix is correct (no breaking change). field is initialized before the try in get_media_buy_delivery so every path to _task_error has it defined; reporting_error preserves a passed field on REFERENCE_NOT_FOUND and keeps LOOKUP_UNAVAILABLE field-less. The value is a static field name, not a resolved value, so the answer stays nondisclosing. Tests cover both raise forms, the direct call, handler absent-revision, and the negative case.

No Critical/High/Medium findings. No gated paths, no high-risk flag, no author team gate. Falls through to row 9.

@bokelley
bokelley merged commit 8cc8818 into next Nov 2, 2026
41 checks passed
@bokelley
bokelley deleted the claude/issue-1669-revision-not-found-field branch November 2, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant