Skip to content

Commit 65e4368

Browse files
bokelleyclaude
andauthored
feat(protocol): support AdCP 3.1.0-rc.10 (#944)
* feat(protocol): support AdCP 3.1.0-rc.10 Bump the spec pin from 3.1.0-rc.9 to 3.1.0-rc.10 and regenerate types from the rc.10 bundle. rc.9 -> rc.10 schema delta: - Postal-area targeting restructured: geo_postal_areas items move from the inline {system, values} form (GeoPostalArea) to the standalone core/postal-area.json (PostalArea: native country + system + values, plus a deprecated LegacyPostalArea arm). New supporting schemas postal-country-system.json and postal-area-support.json. The postal-system enum now holds native tokens; legacy country-fused tokens (us_zip, gb_outward, ...) move to the new legacy-postal-system.json enum. - TaskType gains build_creative (and the creative task domain). - BuildCreativeRequest gains push_notification_config. - CreateMediaBuyRequest gains paused. - recipe_hash added to BuildCreativeResponse / Variant. - country added across geo dimensions, delivery metrics, forecast, and required geo targeting. - Capabilities: the GeoPostalAreas block is replaced by the country-keyed PostalAreaSupport map; the build_creative evaluator gains a CREDENTIAL_IN_ARGS rejection clause. Type-layer fixes for the delta: - adcp.types: PostalArea (the public RootModel union over the rc.10 postal-area.json) is the spec-current export. GeoPostalArea is retained as a deprecated alias to the PostalArea legacy arm (PostalArea5), which is shape-compatible with the removed inline {system, values} type and accepts the same country-fused tokens, so old import and construction code keeps working and the value still validates against the PostalArea union. - collision_allowlist.json: +System (two identical postal-system enums in core.postal_area / core.postal_country_system; first-seen resolution is safe), -PostalArea (now single-source via core/postal-area.json). - post_generate_fixes.fix_allof_merge_field_override_conflicts: collapse the allOf-merge classes the rc.10 postal schema makes datamodel-codegen emit with two incompatible bases (a narrow per-country arm and a loose own-props arm). Inherit only the narrow arm and keep the loose arm's unique fields locally — the correct allOf intersection — clearing strict mypy's base-incompatibility and field-override errors without weakening validation. Tests bumped to the current pin (test_schema_validation start-timing cases, test_upstream_recorder compliance-schema cache path). Historical back-compat version-routing tests left unchanged. Pure variant-renumber churn discarded per CLAUDE.md. Closes #943 Deprecated: AdCP 3.1.0-rc.10 restructures postal-area targeting. GeoPostalArea is deprecated in favor of PostalArea (an anyOf of a native per-country arm and a legacy arm). GeoPostalArea is retained as a deprecated alias to the PostalArea legacy arm — old `from adcp.types import GeoPostalArea` imports and `{system, values}` construction keep working (with a DeprecationWarning) and still validate against the PostalArea union. The legacy alias is removed in a future major. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(protocol): align rc.10 codegen artifacts and the build_creative task type Follow-ups surfaced by the full test gate after the rc.10 regen: - post_generate_fixes.restore_format_asset_numbered_aliases: detect the repeatable asset group by its Literal['repeatable_group'] annotation, not only by an already-injected default. The fix runs before inject_literal_discriminator_defaults, and rc.10's codegen emits the discriminator without a default — so the prior Constant-value check missed the class and the Assets94 back-compat alias was dropped, breaking tests/test_forward_compat_assets.py. - decisioning.webhook_emit.SPEC_WEBHOOK_TASK_TYPES: add build_creative. The rc.10 task-type enum widened to include it and BuildCreativeRequest now carries push_notification_config, so it is an async webhook-emitting task. The constant is pinned to the on-disk enum by a CI test. - tests/fixtures/public_api_snapshot.json: regenerate for the intended GeoPostalArea -> PostalArea public rename. Note for the TS SDK: bump its SPEC_WEBHOOK_TASK_TYPES for build_creative in lockstep (cross-repo, out of scope here). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat(types): retain GeoPostalArea as deprecated alias to PostalArea legacy arm AdCP 3.1.0-rc.10 removed the inline {system, values} GeoPostalArea type in favor of the PostalArea union (native per-country arm + legacy arm). The legacy arm (PostalArea5) is shape-compatible with the removed GeoPostalArea and accepts the same country-fused tokens (us_zip, gb_outward, ...), so the removal can be a graceful deprecation rather than a hard break. Add a PEP 562 module-level __getattr__ to adcp.types that resolves the removed GeoPostalArea name to the PostalArea legacy arm, emitting a DeprecationWarning that names the PostalArea migration target. Old import and construction code keeps working, and the constructed value validates against the PostalArea union via the legacy arm with no spurious country injection. The alias stays out of __all__, so the public-API snapshot is unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5ca5758 commit 65e4368

808 files changed

Lines changed: 965549 additions & 639 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

SCHEMA_DELTAS.md

Lines changed: 105 additions & 124 deletions
Large diffs are not rendered by default.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "A2UI Bound Value",
4+
"description": "A value that can be a literal or bound to a path in the data model",
5+
"oneOf": [
6+
{
7+
"type": "object",
8+
"description": "Literal string value",
9+
"properties": {
10+
"literalString": {
11+
"type": "string",
12+
"description": "Static string value"
13+
}
14+
},
15+
"required": [
16+
"literalString"
17+
],
18+
"additionalProperties": false
19+
},
20+
{
21+
"type": "object",
22+
"description": "Literal number value",
23+
"properties": {
24+
"literalNumber": {
25+
"type": "number",
26+
"description": "Static number value"
27+
}
28+
},
29+
"required": [
30+
"literalNumber"
31+
],
32+
"additionalProperties": false
33+
},
34+
{
35+
"type": "object",
36+
"description": "Literal boolean value",
37+
"properties": {
38+
"literalBoolean": {
39+
"type": "boolean",
40+
"description": "Static boolean value"
41+
}
42+
},
43+
"required": [
44+
"literalBoolean"
45+
],
46+
"additionalProperties": false
47+
},
48+
{
49+
"type": "object",
50+
"description": "Path to data model value",
51+
"properties": {
52+
"path": {
53+
"type": "string",
54+
"description": "JSON pointer path to value in data model (e.g., '/products/0/title')"
55+
}
56+
},
57+
"required": [
58+
"path"
59+
],
60+
"additionalProperties": false
61+
},
62+
{
63+
"type": "object",
64+
"description": "Literal with path binding (sets default and binds)",
65+
"properties": {
66+
"literalString": {
67+
"type": "string"
68+
},
69+
"path": {
70+
"type": "string"
71+
}
72+
},
73+
"required": [
74+
"literalString",
75+
"path"
76+
],
77+
"additionalProperties": false
78+
}
79+
]
80+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "A2UI Component",
4+
"description": "A component in an A2UI surface",
5+
"type": "object",
6+
"properties": {
7+
"id": {
8+
"type": "string",
9+
"description": "Unique identifier for this component within the surface"
10+
},
11+
"parentId": {
12+
"type": "string",
13+
"description": "ID of the parent component (null for root)"
14+
},
15+
"component": {
16+
"type": "object",
17+
"description": "Component definition (keyed by component type)",
18+
"minProperties": 1,
19+
"maxProperties": 1,
20+
"additionalProperties": {
21+
"type": "object",
22+
"description": "Component properties"
23+
}
24+
}
25+
},
26+
"required": [
27+
"id",
28+
"component"
29+
],
30+
"additionalProperties": true
31+
}

0 commit comments

Comments
 (0)