Skip to content

UpdateContentStandardsResponse is not a discriminated union; inconsistent with all other write operations #1234

@bokelley

Description

@bokelley

Problem

UpdateContentStandardsResponse has optional standards_id?: string and errors?: Error[] on a single flat type. An agent cannot determine success vs. failure by structural inspection — it must check whether errors is present and non-empty.

Every other write operation in the protocol uses strict discriminated unions:

  • CreateContentStandardsResponse: CreateContentStandardsSuccess | CreateContentStandardsError
  • CalibrateContentResponse: CalibrateContentSuccess | CalibrateContentError
  • CreateMediaBuyResponse: CreateMediaBuySuccess | CreateMediaBuyError
  • etc.

This inconsistency breaks agents that handle all write responses with the same structural pattern.

Proposed fix

Replace UpdateContentStandardsResponse with a discriminated union matching the established protocol pattern:

type UpdateContentStandardsResponse = UpdateContentStandardsSuccess | UpdateContentStandardsError;

interface UpdateContentStandardsSuccess {
  success: true;
  standards_id: string;
  // updated standards object
}

interface UpdateContentStandardsError {
  success: false;
  errors: Error[];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions