You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(reporting): make ReliableReportingService adoptable from adcp.decisioning platforms #1240
Migrating Embedded Sales Agent onto ReliableReportingService (8.0.0b18) in Core mode, from an adcp.decisioning seller (LazyPlatformRouter + DecisioningPlatform), needed four pieces of adopter glue that the service's own design says it should own. Each is small; together they are most of what an adopter writes.
install() raises "wire service methods explicitly for other frameworks", so a seller built on the SDK's own decisioning framework hand-mounts get_reporting_status, sync_reporting_status, and the reporting_revision_id branch of get_media_buy_delivery. A decisioning-aware install() (or a mixin the platforms can inherit) would remove that.
2. The default caller resolver reads a composite key
_default_caller uses context.caller_identity. In adcp.decisioning that is the framework's composite cache-scope key (<module>.<qualname>:<account_id>), not the principal, so the default records the wrong consumer. We resolve the principal from adcp.server.auth.current_principal instead. The default should do the same for decisioning contexts.
3. capability_block() is empty until a generation is bound
ifnotself.readyornotself._bindings:
return {}
A buyer configures reporting after discovering the offering in get_adcp_capabilities. With no configuration yet, the service advertises nothing, so no buyer can discover it. We build the block from our own offering and assert it equals the service's projection once a generation exists. The block should derive from registered adapters and offerings, not from existing configurations.
4. No restart recovery for Core
Configurations are persisted, but producer bindings live in memory, and ReportingLedgerStore.list_configurations requires an account_id. After a restart nothing is bound until the adopter re-configure()s every generation, and there is no store API to enumerate them. We walk our own account-access grants and call list_configurations per account -- one query per grant on every start. initialize() could rebind persisted generations itself, or the store could expose an enumeration.
Also worth a look
The canonical JSON encoder rightly rejects floats, but the SDK's own GetMediaBuyDeliveryResponse totals are floats, so an adapter bridging an existing delivery path fails with a CanonicalJsonError deep inside a worker turn, surfaced only as "configuration failed". A clearer boundary error in InlineFetchResult validation would save the next adopter the debugging.
code-reviewer: items 2 and 5 are confirmed non-breaking bug fixes with traceable crash/corruption paths; items 1, 3, 4 are non-breaking feature additions; item 2 must duck-type RequestContext to avoid a circular import.
dx-expert: items 1–3 together constitute an adoption blocker for adcp.decisioning platforms; item 2 (silent wrong consumer_id) is most severe; all five are fixable without breaking existing callers.
My take: All five gaps are non-breaking and directly traceable in the source. Items 2 and 5 are targeted single-method fixes; items 1, 3, and 4 add new install/discovery/restart paths that are individually small but share the same adoption surface.
Implementation scope:
Item 2 — _default_caller (service.py:927): duck-type for RequestContext, resolve consumer from adcp.server.auth.current_principal in the decisioning case; add a mock-decisioning-context unit test.
Item 5 — _metrics() (inline_source.py): coerce GetMediaBuyDeliveryResponse float totals via _decimal() before entering row dicts; add a float-totals regression test.
Item 1 — install() (service.py:1098): decisioning-aware branch mounting get_reporting_status, sync_reporting_status, and the reporting_revision_id branch of get_media_buy_delivery via the platform dispatcher; carry over idempotency guard.
Items 3 & 4 — capability_block() + initialize(): derive the capability block from registered adapters/offerings independent of bindings; add list_all_configurations() to the store protocol (skip/no-op for in-memory); have initialize() auto-rebind persisted generations on startup.
Activity
bokelley commentedon Sep 28, 2026
Triage
Classification: Feature request + bug (items 2 & 5)
Bucket(s): handlers
Status: ready-to-implement
What the experts said:
RequestContextto avoid a circular import.adcp.decisioningplatforms; item 2 (silent wrongconsumer_id) is most severe; all five are fixable without breaking existing callers.My take: All five gaps are non-breaking and directly traceable in the source. Items 2 and 5 are targeted single-method fixes; items 1, 3, and 4 add new install/discovery/restart paths that are individually small but share the same adoption surface.
Implementation scope:
_default_caller(service.py:927): duck-type forRequestContext, resolve consumer fromadcp.server.auth.current_principalin the decisioning case; add a mock-decisioning-context unit test._metrics()(inline_source.py): coerceGetMediaBuyDeliveryResponsefloat totals via_decimal()before entering row dicts; add a float-totals regression test.install()(service.py:1098): decisioning-aware branch mountingget_reporting_status,sync_reporting_status, and thereporting_revision_idbranch ofget_media_buy_deliveryvia the platform dispatcher; carry over idempotency guard.capability_block()+initialize(): derive the capability block from registered adapters/offerings independent of bindings; addlist_all_configurations()to the store protocol (skip/no-op for in-memory); haveinitialize()auto-rebind persisted generations on startup.Required checks:
pytest src/adcp/reporting/,mypy src/,ruff check ..Triaged by Claude Code. Session: https://claude.ai/code/session_013jJBqhuNa1DBraGuFpxAdd
Generated by Claude Code