feat(pricing): per_unit + custom vendor pricing variants (3.0 GA)#65
Merged
Conversation
… GA) AdCP 3.0 GA (upstream adcontextprotocol/adcp#2422) adds `per_unit` and `custom` variants to the vendor-pricing oneOf. Extends VendorPricingOption with MaxCPM, Unit, UnitPrice, Description, Metadata, and Ext so all five variants (cpm, percent_of_media, flat_fee, per_unit, custom) round-trip. Collapses SignalPricing to a type alias for VendorPricingOption — upstream already treats signal-pricing-option.json as a deprecated $ref to vendor-pricing-option.json, so carrying two byte-identical structs invited drift. Makes Currency omitempty; the custom variant treats it as optional per the upstream schema. Per-variant required-field enforcement stays in the schema validator layer, not the SDK. Skill: one-line note in build-signals-agent flags custom as operator-review-gated per the issue's guidance. Closes #63. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Closes the three parser-differential gaps surfaced by the upstream PR proposing new conformance vectors (adcontextprotocol/adcp#2489): - Reject comma-smuggled Content-Type (`application/json, text/plain` in one field value). RFC 9110 §8.3 — Content-Type has no list form. - Reject duplicate-algorithm Content-Digest entries. RFC 9530 §2 — Dictionary-Structured-Field with duplicate keys is ambiguous for signature coverage. - Reject bare-token sig-param string values (`keyid=foo` instead of `keyid="foo"`). RFC 8941 §3.3 — strings and tokens are distinct; keyid/nonce/alg/tag are string-typed per RFC 9421 §2.3. Parser now tracks token-vs-string as paramValue.isToken and setParam rejects tokens where strings are required. All 10 new conformance vectors (4 positive + 6 negative) committed to testdata/request-signing/. Existing canonicalization already handled the positive edge cases (IPv6 authority, %2F preserved, %7E/%2D/%5F/%2E unreserved-decode) and three of the negative cases (duplicate Signature-Input label, JWK alg/crv mismatch, non-ASCII host). This commit closes the remaining three. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Upstream adcp#2489 merge bumped the bundle; regen picks up the new REQUOTE_REQUIRED ErrorCode added in the same window. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VendorPricingOptionwithMaxCPM,Unit,UnitPrice,Description,Metadata,Extso all five AdCP 3.0 vendor-pricing variants (cpm, percent_of_media, flat_fee, per_unit, custom) round-trip.SignalPricingtotype SignalPricing = VendorPricingOption— upstream consolidatedsignal-pricing-option.jsonas a deprecated$reftovendor-pricing-option.json, so two byte-identical structs invited drift.Currencyomitempty (custom variant makes it optional per schema); per-variant required-field enforcement stays in the schema validator, not the SDK..bundle-sha256to match the fresh upstream bundle.build-signals-agentSKILL.md: one-line note flaggingcustomas operator-review-gated per the issue's guidance.Upstream: adcontextprotocol/adcp#2422. Closes #63.
experimental_featuresonget_adcp_capabilitieswas already picked up by a prior regen.Review feedback addressed
Both code-reviewer and ad-tech-protocol-expert ran before commit:
flat_feetest used"month"; schema enum ismonthly|quarterly|annual|campaign. Changed to"monthly".PricingOptionIDis the wrapper field, not part of the oneOf; Go can't express oneOf at the type level, so omitempty on numerics drops legitimate zeros. Left documented rather than patched — matches how every other discriminated union intypes.gois handled.Test plan
adcp/pricing_test.goround-trips all 5 variants includingcustomwithout currencygo test ./adcp/...— greengo test ./...(root module) — greenTestSkillSkeletonsCompile— all 7 skills still compile🤖 Generated with Claude Code