Skip to content

Align request-validation error codes with AdCP storyboard semantics #1604

Description

@jstar0

Align request-validation error codes with AdCP storyboard semantics

Problem

Request-schema failures are currently normalized to VALIDATION_ERROR at the MCP TypeAdapter boundary. AdCP 3.1.0-beta.3 grades structural request failures as INVALID_REQUEST, including BR-UC-002-create-media-buy.feature scenario @T-UC-002-inv-015-6 for a package missing product_id.

PR #1534 preserves the current error code while adding a strict xfail tripwire for this mismatch. A separate change is needed because the classification must remain consistent across MCP, A2A, and REST rather than special-casing one test or transport.

Expected behavior

  • Structural failures such as missing, malformed, or unknown request fields emit INVALID_REQUEST.
  • Value-constraint failures on structurally valid fields emit VALIDATION_ERROR.
  • MCP, A2A, and REST expose the same classification for equivalent failures.
  • Buyer-visible messages remain sanitized and do not include raw Pydantic input values or documentation URLs.

Acceptance criteria

  • Add table-driven coverage for representative structural and value-constraint failures across the relevant transport boundaries.
  • Implement a shared classification rule instead of transport-specific branches.
  • Remove the strict xfail added in PR fix: wrap MCP TypeAdapter validation errors #1534 by making its storyboard case pass.
  • Preserve the existing two-layer AdCP error envelope and structured field/details metadata.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Ready for Dev

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions