Skip to content

Account lifecycle: ExplicitAccounts breaks account-less discovery; add provisioning registry, account policy, typed account errors #1272

Closed

Description

@bokelley

Summary

adcontextprotocol/adcp#7848 adds "Account references before provisioning" to the spec:

  • A buyer-declared natural key resolves only after the seller provisions it.
  • Only provisioning tasks (ones that commit spend or create account-owned resources) provision. Discovery and negotiation tasks (get_products, list_products, get_signals, request_proposals, refine_proposals, decline_proposals) never do.
  • An unresolved account returns ACCOUNT_NOT_FOUND, including on optional-account tasks.
  • Buyers omit account until it's provisioned.
  • Account errors are not seller-health signals.
  • "Buyer SDKs SHOULD track, per seller agent, which natural keys the seller has provisioned and apply these rules by default."

The SDK currently leaves all of this to implementers, and one seller-side default breaks public discovery. The behaviour should match the JS SDK; see adcontextprotocol/adcp-client#3093.

Seller side

At 1fa2b06b:

  • Bug: ExplicitAccounts rejects requests with no account. get_products always calls AccountStore.resolve (src/adcp/decisioning/handler.py:2307 → _resolve_account, :1543). ExplicitAccounts.resolve raises ACCOUNT_NOT_FOUND whenever account_id is missing, including when ref is None (src/adcp/decisioning/accounts.py:576-597). So a seller using it can't serve account-less public discovery when required_for_products is false. Absent account on an optional-account task should resolve to "no account" (public view). Absent account with required_for_products: true should get ACCOUNT_REQUIRED.
  • Add a bundled natural-key resolver for buyer-declared sellers. It matches the complete natural key against accounts provisioned by sync_accounts and returns ACCOUNT_NOT_FOUND on a miss.
  • Tell AccountStore.resolve whether the task is a provisioning task, and document that lazy provisioning MUST be gated on it.
  • Add tests for an unknown natural key on get_products (expect ACCOUNT_NOT_FOUND, not public products) and for no account created by a discovery task.

Buyer side

  • Account registry per seller agent. client.accounts.ensure(key, billing=..., payment_terms=...) returns status and account_id, persisted through a storage adapter. Today sync_accounts and get_products are pass-through (src/adcp/client.py:3209-3251, :2237-2315), and required_for_products and require_operator_auth are never read.
  • account_policy="auto" | "strict" on account-carrying calls. auto omits an unprovisioned account and passes brand. strict raises.
  • Typed exceptions AccountNotFoundError, AccountSetupRequiredError, and AccountPaymentRequiredError, carrying fault="buyer_setup".
  • FeedMirror fixes. A missing cache_scope is currently read as "public" (src/adcp/feed_mirror.py:77-84); this should fail closed. Add public/account layering instead of one mirror per account. Confirm that a failed refresh keeps the last good mirror (the JS SDK has this bug: WholesaleFeedSync wipes the product mirror when a refresh fails adcp-client#3092).

Activity

  1. added
    enhancementNew feature or request
    claude-triagingTriage routine is actively working on this issue (1-3 min)
    on Oct 1, 2026
  2. bokelley commented on Oct 1, 2026

    @bokelley
    ContributorAuthor

    Triage

    Classification: Bug + Feature request (mixed)
    Bucket(s): client, handlers (labels not present in repo — gap noted)
    Status: ready-for-human
    Cross-repo: refs adcontextprotocol/adcp#7848

    What the experts said:

    • code-reviewer: Epic-sized; all three primary changes (ExplicitAccounts behavior, AccountStore.resolve interface, FeedMirror default) are breaking for adopters with custom implementations — recommends an allow_absent opt-in for the bug fix and a parallel resolve_for_task method instead of changing the AccountStore.resolve signature.
    • ad-tech-protocol-expert: ExplicitAccounts is a confirmed spec conformance violation per adcp#7848; provisioning/non-provisioning task split maps correctly to the OpenRTB 2.x lifecycle; unresolved: feed_mirror.py:81 carries an inline comment stating "spec requires cache_scope: 'public' for unscoped reads," directly contradicting the fail-closed proposal — adcp#7848 text must be verified before changing _scope_str.

    My take: Experts agree on the diagnosis but disagree on fix strategy for ExplicitAccounts (spec-mandated direct change vs. breaking-change opt-in guard), and the FeedMirror item has an open spec question that blocks it. @bokelley recommend converting this to an epic with a task list; the seller-side ExplicitAccounts fix is the clearest first PR candidate once the opt-in vs. direct-change question is resolved.


    Triaged by Claude Code. Session: https://claude.ai/code/session_01Dd8edJgtPwJnPavcUAw6ND


    Generated by Claude Code

  3. added and removed
    claude-triagingTriage routine is actively working on this issue (1-3 min)
    on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions