Context
While validating bokelley/salesagent#631 end-to-end, we found that legacy creative format IDs are upgraded by the SDK/schema layer, but implementations still need a reliable way to compare upgraded legacy IDs with structured canonical format refs.
Example failure mode:
- client sends legacy
display_300x250
- SDK/model validation upgrades this to canonical
display_image with width/height
- implementation code still compares exact
(agent_url, id) tuples
display_image no longer matches a product/creative format that originated as display_300x250 unless every implementation reimplements canonical matching correctly
Proposed SDK work
Expose documented helpers for common format compatibility checks, for example:
upgrade_legacy_format_id(value) -> FormatId (already effectively present in some surfaces)
canonical_format_matches(a, b) -> bool for equivalence after legacy upgrade
canonical_format_satisfies(requested, supported) -> bool for product/capability gating
The important distinction is that product gating is stricter than equivalence: if the supported/product format declares width, height, or duration_ms, the requested creative format should also declare and match that value. A broad supported format can accept a more specific request, but an under-specified request should not silently match a fixed-size/fixed-duration product.
Acceptance criteria
- SDK exposes a helper or documented pattern for legacy-to-canonical format comparison.
- Tests cover at least
display_300x250 vs structured display_image width=300 height=250.
- Tests cover the stricter product-gating case: requested
display_image with no dimensions does not satisfy supported display_image width=300 height=250.
- Docs/comments make clear which helper is for equivalence and which is for capability satisfaction.
Discovered in
Context
While validating bokelley/salesagent#631 end-to-end, we found that legacy creative format IDs are upgraded by the SDK/schema layer, but implementations still need a reliable way to compare upgraded legacy IDs with structured canonical format refs.
Example failure mode:
display_300x250display_imagewith width/height(agent_url, id)tuplesdisplay_imageno longer matches a product/creative format that originated asdisplay_300x250unless every implementation reimplements canonical matching correctlyProposed SDK work
Expose documented helpers for common format compatibility checks, for example:
upgrade_legacy_format_id(value) -> FormatId(already effectively present in some surfaces)canonical_format_matches(a, b) -> boolfor equivalence after legacy upgradecanonical_format_satisfies(requested, supported) -> boolfor product/capability gatingThe important distinction is that product gating is stricter than equivalence: if the supported/product format declares
width,height, orduration_ms, the requested creative format should also declare and match that value. A broad supported format can accept a more specific request, but an under-specified request should not silently match a fixed-size/fixed-duration product.Acceptance criteria
display_300x250vs structureddisplay_imagewidth=300 height=250.display_imagewith no dimensions does not satisfy supporteddisplay_imagewidth=300 height=250.Discovered in