Skip to content

feat(v3-ref-seller): implement sync_accounts + list_accounts with billing_entity write-only projection guard wired #377

Closed

Description

@bokelley

Context

The v3 reference seller has the Account.billing_entity JSON column but does not implement sync_accounts or list_accounts. Because of this, adcp.types.project_account_for_response (the 3.1 bank-details write-only guard) is never called — the protection is purely architectural, not enforced.

Refs:

  • examples/v3_reference_seller/src/platform.py
  • examples/v3_reference_seller/src/models.py (Account.billing_entity)
  • adcp.types.project_account_for_response

Acceptance Criteria

  • sync_accounts implemented — persists incoming accounts (including billing_entity with bank details), then returns response via project_account_for_response
  • list_accounts implemented — returns accounts projected through project_account_for_response so bank details are stripped
  • Smoke test asserts bank_details (or any write-only field) never appears in either response
  • Smoke test asserts non-write-only fields (display name, address, tax id format) DO appear

Activity

  1. added
    enhancement
    claude-triaging
    on May 3, 2026
  2. added and removed
    claude-triaging
    on May 3, 2026
  3. bokelley commented on May 3, 2026

    @bokelley
    ContributorAuthor

    Triage

    Classification: Feature request
    Bucket(s): examples
    Status: drafting-pr
    Milestone: (omitted — no milestone on file)

    What the experts said:

    • dx-expert: Non-blocking feature; natural key derivation needs adopter-customization notice (fixed); dry_run comment needs SQLAlchemy rollback sketch (fixed); blocker on bank-stripping helper choice explanation (fixed)
    • docs-expert: Mock-based tests consistent with existing no-PG philosophy; assert on model_dump(mode="json") not raw Pydantic attr; module docstring should list new methods (done)
    • code-reviewer (pre-PR): Three blockers fixed — missing name in sync response dict; sandbox None→False inconsistency between DB and wire; dry_run=True echoed back when session committed (lie on wire, fixed to always return False)

    My take: Straightforward non-breaking addition to the examples bucket: two methods + two smoke tests, all wired to the already-merged write-only guard. Draft PR #403 covers all four acceptance criteria.

    PR: #403 — feat(examples): sync_accounts + list_accounts with billing_entity write-only guard wired


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


    Generated by Claude Code

  4. bokelley commented on May 12, 2026

    @bokelley
    ContributorAuthor

    Closed by PR #693.

    The v3 reference seller now exposes sync_accounts and list_accounts via the AccountStore surface the framework actually dispatches through (platform.accounts.upsert and platform.accounts.list). Both methods on the platform class were dead code — they were never called because the dispatch path runs through the AccountStore. The fix:

    • upsert(refs, ctx) persists each buyer-supplied :class:`AccountReference` (full billing_entity including bank coordinates) and returns list[SyncAccountsResultRow]. The framework projects through to_wire_sync_accounts_row, stripping billing_entity.bank on emit.
    • list(filter, ctx) returns list[Account[TMeta]] with billing_entity populated from Postgres. The framework's to_wire_account strips bank on emit. Per-principal scoping by buyer-agent agent_url is enforced — unauthenticated callers see an empty list.

    End-to-end tests assert bank details persist on write but never appear on the wire-projected response (both sync_accounts and list_accounts paths).

    The storyboard's __spec_conformance__/account_discovery/list_or_sync_accounts probe now passes — the seller advertises both tools and the AdCP 3.0.9 §accounts/overview contract is satisfied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claude-triagedenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions