Skip to content

feat: sync upstream schemas from PR 1252#139

Merged
bokelley merged 6 commits intomainfrom
bokelley/sync-upstream-schema-2
Feb 28, 2026
Merged

feat: sync upstream schemas from PR 1252#139
bokelley merged 6 commits intomainfrom
bokelley/sync-upstream-schema-2

Conversation

@bokelley
Copy link
Contributor

Summary

  • Syncs 315 upstream AdCP schemas (61 updated, 10 new) from adcontextprotocol/adcp PR 1252 which fixed 17 schema gaps and 7 consistency issues
  • Adds backward compatibility aliases/stubs for all breaking changes to prevent downstream ImportErrors
  • Adds new semantic aliases for discriminated union types and exports new enums/models
  • Fixes SyncAudiencesAudience name collision bug (was pointing at wrong Audience type)

Backward compat (prevents downstream breakage)

Old import Maps to Reason
CpmAuctionPricingOption CpmPricingOption Upstream merged auction/fixed variants
CpmFixedRatePricingOption CpmPricingOption "
VcpmAuctionPricingOption VcpmPricingOption "
VcpmFixedRatePricingOption VcpmPricingOption "
PropertyIdActivationKey SegmentIdActivationKey Schema rename
PropertyTagActivationKey KeyValueActivationKey Schema rename
PreviewCreativeFormatRequest PreviewCreativeSingleRequest Discriminator change
PreviewCreativeManifestRequest PreviewCreativeBatchRequest "
PreviewCreativeStaticResponse PreviewCreativeSingleResponse "
PreviewCreativeInteractiveResponse PreviewCreativeBatchResponse "
ListAuthorizedPropertiesRequest Stub (extra="allow") Removed upstream
ListAuthorizedPropertiesResponse Stub (extra="allow") Removed upstream
PackageStatus Enum stub Removed upstream

New public API exports

  • Aliases: GetProductsBriefRequest, GetProductsWholesaleRequest, GetSignalsDiscoveryRequest, GetSignalsLookupRequest, SiSendTextMessageRequest, SiSendActionResponseRequest, SegmentIdActivationKey, KeyValueActivationKey, PreviewCreativeSingleRequest/Response, PreviewCreativeBatchRequest/Response, PreviewCreativeVariantRequest/Response
  • Enums: AudienceSource, BuyingMode, CreativeApprovalStatus, DevicePlatform, DeviceType, EventType, MediaChannel, WcagLevel
  • Models: BrandReference, ContextObject, ExtensionObject, PaginationRequest, Proposal

Breaking field-level changes (no backward compat possible)

  • optimization_goal -> optimization_goals (array)
  • catalog -> catalogs (array)
  • measurement -> outcome_measurement
  • deployments -> destinations

Test plan

  • All 619 tests passing
  • All lint checks clean (ruff check src/ scripts/)
  • adcp.__all__ (298 names) and adcp.types.__all__ (445 names) fully importable
  • All 13 backward compat imports verified from adcp package
  • Expert code review addressed all findings
  • from adcp import DeliverTo, Pricing, Measurement works (was missing)

🤖 Generated with Claude Code

bokelley and others added 6 commits February 26, 2026 21:25
- Synced 315 schemas from adcontextprotocol.org (61 updated, 10 new)
- Regenerated Pydantic models from updated schemas
- Added backward compat stubs for removed types: DeliverTo, DeliverTo1, Pricing
- Exposed new public types: GetAccountFinancialsRequest/Response,
  ReportUsageRequest/Response, SyncAudiencesRequest/Response,
  GetCreativeFeaturesRequest/Response, CpaPricingOption,
  TimeBasedPricingOption, TimeUnit, SignalPricing, SignalPricingOption,
  OptimizationGoal, CreativeVariant, ArtifactWebhookPayload
- Added aliases for new discriminated union responses
- Updated tests for schema breaking changes (account/buying_mode now required)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add AccountReference, Overlay, CatalogFieldMapping, CatalogFieldBinding,
and Transform to the public API - all were used as field types in exported
request/response types but were not directly importable.

Add AccountReferenceById / AccountReferenceByNaturalKey aliases for the
two identification methods (by seller-assigned ID vs. brand+operator
natural key).

Clarify DeliverTo/Pricing compat stub comments: the GetSignalsRequest
wire format changed (deliver_to.deployments+countries → top-level
destinations+countries), so the stubs preserve import compatibility only
and cannot restore the old request behavior.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
From code and ad tech expert reviews:

1. Add CpaPricingOption + TimeBasedPricingOption to PricingOption union
   (they were exported individually but omitted from the union alias)

2. Add SignalPricingOption variant aliases: CpmSignalPricingOption,
   PercentOfMediaSignalPricingOption, FlatFeeSignalPricingOption
   (consistent with other discriminated union pattern in aliases.py)

3. Export SyncAudiencesAudience + ConsentBasis for SyncAudiencesRequest
   construction (same pattern as SyncCreativeResult, SyncCatalogResult)

4. Expose all new/missing types from adcp top-level package:
   AccountReference, CpaPricingOption, TimeBasedPricingOption, TimeUnit,
   SignalPricing, SignalPricingOption, GetAccountFinancialsRequest/Response,
   ReportUsageRequest/Response, SyncAudiencesRequest/Response,
   GetCreativeFeaturesRequest/Response, CreativeVariant, ArtifactWebhookPayload,
   OptimizationGoal, CatalogFieldMapping, CatalogFieldBinding, Overlay,
   Transform, ConsentBasis, SyncCreativeResult

5. Fix __init__.py docstring: correct module reference (_ergonomic not
   coercion), restore "never import from generated_poc" architectural note

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eview

Sync 315 upstream schemas (61 updated, 10 new) from adcontextprotocol/adcp
PR 1252 which fixed 17 schema gaps and 7 consistency issues.

Key changes:
- Regenerate all types from updated schemas
- Add backward compat aliases for pricing renames (CpmAuction/Fixed -> Cpm)
- Add backward compat aliases for activation key renames (PropertyId -> SegmentId)
- Add backward compat aliases for preview request renames (Format -> Single)
- Add compat stubs for removed types (ListAuthorizedProperties, PackageStatus)
- Fix SyncAudiencesAudience pointing at wrong Audience type (name collision)
- Add new semantic aliases (GetProductsBriefRequest, GetSignalsDiscoveryRequest, etc.)
- Export new enums (BuyingMode, MediaChannel, DeviceType, etc.)
- Export new models (PaginationRequest, BrandReference, Proposal, etc.)
- Re-export DeliverTo, Pricing, Measurement from top-level adcp package
- Fix stale stable.py reference in consolidate_exports template
- Fix lint violations in consolidate_exports.py

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix silent Status type shadowing: override with MediaBuyDeliveryStatus
  (delivery status was silently swapped to invoice status due to
  alphabetical module sort order in _generated.py)
- Add CatalogGroupBinding semantic alias for CatalogFieldBinding1
- Add 19 missing types to adcp.__all__ (AccountScope, BuyingMode,
  AudienceSource, CreativeApprovalStatus, DevicePlatform, DeviceType,
  EventType, MediaChannel, WcagLevel, ContextObject, ExtensionObject,
  PaginationRequest, Proposal, BrandReference, DateRange, DatetimeRange,
  Duration, ErrorCode, Refine)
- Remove duplicate PercentOfMediaSignalPricingOption from adcp.__all__
- Move Measurement, DeliverTo, Pricing to backward-compat section
- Add 31 backward-compat alias tests covering all 13+ deprecated names
- Strengthen weak assertion in test_str_returns_pydantic_default

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Import Status directly from delivery response module instead of
reassigning, which mypy rejects as incompatible type assignment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bokelley bokelley merged commit 6cb2b6c into main Feb 28, 2026
8 checks passed
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.

1 participant