Skip to content

fix(seller): spec-aligned recovery defaults and account_id-only refs (#530, #547) - #610

Open
KshitijKaushik123 wants to merge 1 commit into
adcontextprotocol:mainfrom
KshitijKaushik123:fix/seller-recovery-and-account-id-refs
Open

KshitijKaushik123 wants to merge 1 commit into
adcontextprotocol:mainfrom
KshitijKaushik123:fix/seller-recovery-and-account-id-refs

Conversation

@KshitijKaushik123

Copy link
Copy Markdown

Summary

Addresses #530 and part of #547.

  • Recovery values (v3): map legacy explicit values (retry, revise, contact_support) onto the core/error.json enum (transient, correctable, terminal). ACCOUNT_NOT_FOUND is now terminal and ACCOUNT_SETUP_REQUIRED is correctable (also added to v1).
  • Account references: resolveAccount (v1 and v3) now passes account_id-only references to the resolver instead of treating them as no account, so a miss returns ACCOUNT_NOT_FOUND rather than silently running with public pricing.
  • Reference seller: ResolveAccount no longer provisions accounts on discovery. Only accounts registered via sync_accounts resolve; unknown references return nil.

Test plan

  • go test in adcp, adcp/v3 and reference/seller-agent
  • New tests for v3 recovery defaults and normalization
  • New tests that an account_id-only reference reaches the resolver and yields an error result on a miss (v1 and v3)
  • Confirm ACCOUNT_NOT_FOUND and ACCOUNT_SETUP_REQUIRED classifications against the pinned enums/error-code.json

…dcontextprotocol#530, adcontextprotocol#547)

- v3: map legacy recovery values (retry/revise/contact_support) onto the
  core/error.json enum and classify ACCOUNT_NOT_FOUND as terminal and
  ACCOUNT_SETUP_REQUIRED as correctable; add the latter to v1 as well.
- resolveAccount: pass account_id-only references to the resolver instead
  of treating them as no account, so a miss returns ACCOUNT_NOT_FOUND.
- reference seller: stop provisioning accounts on discovery; unknown
  references now resolve to nil.
@github-actions

Copy link
Copy Markdown
Contributor

IPR Policy Agreement Required

@KshitijKaushik123 — thanks for the contribution. Before this PR can be merged, the AgenticAdvertising.Org IPR Policy requires your agreement.

To agree, post a new comment on this PR with the exact phrase:

I have read the IPR Policy

Your signature is recorded once and covers all contributions to AAO repositories. See signatures/README.md for what gets recorded and why.

Comment thread adcp/v3/errors.go
"INVALID_FIELD": // SDK-internal, unpublished
return "correctable"
default:
default: // includes ACCOUNT_NOT_FOUND and INTERNAL_ERROR

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium: This flips v3 ACCOUNT_NOT_FOUND from correctable to terminal (and classifies ACCOUNT_SETUP_REQUIRED as correctable) on the wire — a real recovery-hint change for v3 callers. The test plan's "confirm classifications against the pinned enums/error-code.json" box is unchecked, so the load-bearing claim ships unvalidated. Two things to reconcile: no enums/error-code.json is vendored in this repo to check against, and seller.go:416 still hands an ACCOUNT_NOT_FOUND caller a sync_accounts correction path while recovery now says terminal. Confirm against the pinned enum before merge.

@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.

Core change is sound: the resolveAccount guard fix (adcp/seller.go:407, adcp/v3/seller.go:610) now routes account_id-only references to the resolver instead of silently running with public pricing — fail-closed, the correct direction, with new tests in both v1 and v3 modules. v3 mirrors v1's normalizeRecovery enum mapping, and the seller-agent de-provisioning-on-discovery branch returns ACCOUNT_NOT_FOUND as intended. No types_gen.go hand-edits, no schema changes needing regen, no TMP/TEE/skills touches.

Medium findings

  • adcp/v3/errors.go:150 — v3 recovery reclassification ships unvalidated against pinned enum (test-plan box unchecked; no enum vendored in-repo to verify).

Single medium finding, not in data-loss/schema/infra category; high_risk is false; gated_paths is false; no no-auto-approve team match. One medium with no blocking trigger falls through to row 9 (approve). Worth a human eye on confirming the ACCOUNT_NOT_FOUND terminal reclassification against the pinned error-code enum before relying on it, and on adding a direct test for the new seller-agent main.go branches.

Medium findings

  • adcp/v3/errors.go:150 — v3 recovery reclassification ships unvalidated against pinned enum

@torbenbrodt

Copy link
Copy Markdown
Collaborator

@KshitijKaushik123, heads-up on overlap: #554 by @sujanchalla0510 already covers the account_id-only fix in resolveAccount (v1 and v3), ACCOUNT_NOT_FOUND as terminal in v3, and a lookup-only reference seller. It's approved and waits on @bokelley's security hold, whose decisions it implements: schema-invalid references (for example operator-only) are rejected as INVALID_REQUEST before the resolver. Here they still reach the resolver, as on main.

The part #554 doesn't touch is the mapping of legacy retry/revise/contact_support onto the core/error.json enum (#530), and ACCOUNT_SETUP_REQUIRED as correctable. @sujanchalla0510's #549 also changes the v3 recovery values, so it may be worth agreeing which PR carries those before both need rebasing.

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.

2 participants