Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/align-submitted-branches.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"adcontextprotocol": patch
---

Align the inline `submitted` branches with their published async status files (adcp#8856). Eight tasks defined their submitted response twice, and the copies disagreed: the inline branch in `<tool>-response.json` rejected fields the published `<tool>-async-response-submitted.json` accepts, so the same response validated differently depending on which schema a validator used. The inline branches for `sync_creatives` (creatives, merges, warnings), `build_creative` (creative_manifest, creative_manifests, creatives, estimate), `control_media_buy` (media_buy_id, warnings), `create_media_buy` (media_buy_id, packages, warnings), `sync_catalogs` (catalogs, item_availability_states, item_availability_updates), and `update_media_buy` (media_buy_id, warnings) — plus the shared `media-buy-commitment-response.json` submitted branch behind `accept_proposal` and `buy_products` (media_buy_id, warnings) — no longer forbid those fields. Each fix is a recorded correction under DR-0036: the published status file already states the shape, and every value the inline branch accepted before still validates. To keep each response `oneOf` exclusive after that loosening, the success branches of `create_media_buy`, `update_media_buy` and `build_creative` also exclude a `core/task-submitted.json` body, so a submitted body carrying result fields matches the submitted branch only (the other tools' success branches already exclude it, by `task_id`/`status` or a fixed `status: "completed"`). The canonical warnings test (`tests/relationship-scoped-indicators.test.cjs`) follows the published files: its submitted-arm assertions now accept warnings on the submitted envelope (warnings stay excluded from error arms and from `sync_creatives`' success arm). No restructure: the bodies-only layout and generated unions stay in #8565 for 4.0.
15 changes: 1 addition & 14 deletions static/schemas/source/creative/sync-creatives-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -361,20 +361,7 @@
"$ref": "/schemas/core/ext.json"
}
},
"additionalProperties": true,
"not": {
"anyOf": [
{
"required": ["creatives"]
},
{
"required": ["merges"]
},
{
"required": ["warnings"]
}
]
}
"additionalProperties": true
}
],
"properties": {}
Expand Down
46 changes: 17 additions & 29 deletions static/schemas/source/media-buy/build-creative-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@
"required": [
"creative_manifest"
],
"additionalProperties": true
"additionalProperties": true,
"not": {
"$ref": "/schemas/core/task-submitted.json"
}
},
{
"title": "BuildCreativeMultiSuccess",
Expand Down Expand Up @@ -308,7 +311,10 @@
"required": [
"creative_manifests"
],
"additionalProperties": true
"additionalProperties": true,
"not": {
"$ref": "/schemas/core/task-submitted.json"
}
},
{
"title": "BuildCreativeVariantSuccess",
Expand Down Expand Up @@ -547,7 +553,10 @@
}
}
},
"additionalProperties": true
"additionalProperties": true,
"not": {
"$ref": "/schemas/core/task-submitted.json"
}
},
{
"title": "BuildCreativeEstimate",
Expand Down Expand Up @@ -613,7 +622,10 @@
"mode",
"estimate"
],
"additionalProperties": true
"additionalProperties": true,
"not": {
"$ref": "/schemas/core/task-submitted.json"
}
},
{
"title": "BuildCreativeError",
Expand Down Expand Up @@ -694,31 +706,7 @@
"$ref": "/schemas/core/ext.json"
}
},
"additionalProperties": true,
"not": {
"anyOf": [
{
"required": [
"creative_manifest"
]
},
{
"required": [
"creative_manifests"
]
},
{
"required": [
"creatives"
]
},
{
"required": [
"estimate"
]
}
]
}
"additionalProperties": true
}
],
"properties": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,7 @@
"ext": { "$ref": "/schemas/core/ext.json" }
},
"required": ["status"],
"additionalProperties": true,
"not": {
"anyOf": [
{ "required": ["media_buy_id"] },
{ "required": ["warnings"] }
]
}
"additionalProperties": true
}
]
}
32 changes: 10 additions & 22 deletions static/schemas/source/media-buy/create-media-buy-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,15 @@
],
"additionalProperties": true,
"not": {
"required": [
"errors"
"anyOf": [
{
"required": [
"errors"
]
},
{
"$ref": "/schemas/core/task-submitted.json"
}
]
}
},
Expand Down Expand Up @@ -280,26 +287,7 @@
"$ref": "/schemas/core/ext.json"
}
},
"additionalProperties": true,
"not": {
"anyOf": [
{
"required": [
"media_buy_id"
]
},
{
"required": [
"packages"
]
},
{
"required": [
"warnings"
]
}
]
}
"additionalProperties": true
}
],
"properties": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,7 @@
"ext": { "$ref": "/schemas/core/ext.json" }
},
"required": ["status"],
"additionalProperties": true,
"not": {
"anyOf": [
{ "required": ["media_buy_id"] },
{ "required": ["warnings"] }
]
}
"additionalProperties": true
}
]
}
9 changes: 1 addition & 8 deletions static/schemas/source/media-buy/sync-catalogs-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,7 @@
"$ref": "/schemas/core/ext.json"
}
},
"additionalProperties": true,
"not": {
"anyOf": [
{ "required": ["catalogs"] },
{ "required": ["item_availability_updates"] },
{ "required": ["item_availability_states"] }
]
}
"additionalProperties": true
}
],
"properties": {}
Expand Down
23 changes: 10 additions & 13 deletions static/schemas/source/media-buy/update-media-buy-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,15 @@
],
"additionalProperties": true,
"not": {
"required": [
"errors"
"anyOf": [
{
"required": [
"errors"
]
},
{
"$ref": "/schemas/core/task-submitted.json"
}
]
}
},
Expand Down Expand Up @@ -225,17 +232,7 @@
"$ref": "/schemas/core/ext.json"
}
},
"additionalProperties": true,
"not": {
"anyOf": [
{
"required": ["media_buy_id"]
},
{
"required": ["warnings"]
}
]
}
"additionalProperties": true
}
],
"properties": {}
Expand Down
16 changes: 10 additions & 6 deletions tests/relationship-scoped-indicators.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ describe('relationship-scoped indicators', () => {
assert.equal(validateGetMediaBuys(payload), false);
});

it('returns structured warnings only on completed media-buy success arms', () => {
it('returns structured warnings only on completed media-buy success arms and aligned submitted arms', () => {
const warning = {
code: 'inventory_shortfall_forecast',
message: 'Forecast delivery is below the requested goal.',
Expand Down Expand Up @@ -968,11 +968,15 @@ describe('relationship-scoped indicators', () => {
assertValid(validateCreateResponse, submitted);
assertValid(validateUpdateResponse, submitted);
assertValid(validateSyncResponse, submitted);
assert.equal(validateCreateResponse({ ...submitted, warnings: [warning] }), false);
assert.equal(validateUpdateResponse({ ...submitted, warnings: [warning] }), false);
assert.equal(validateCommitmentResponse({ ...submitted, warnings: [warning] }), false);
assert.equal(validateControlResponse({ ...submitted, warnings: [warning] }), false);
assert.equal(validateSyncResponse({ ...submitted, warnings: [warning] }), false);
// #8856 (DR-0036 correction): the published *-async-response-submitted.json
// files accept warnings on the submitted envelope, so the aligned inline
// submitted branches accept them too. Warnings stay excluded from the
// error arms above and from sync_creatives' success arm.
assertValid(validateCreateResponse, { ...submitted, warnings: [warning] });
assertValid(validateUpdateResponse, { ...submitted, warnings: [warning] });
assertValid(validateCommitmentResponse, { ...submitted, warnings: [warning] });
assertValid(validateControlResponse, { ...submitted, warnings: [warning] });
assertValid(validateSyncResponse, { ...submitted, warnings: [warning] });
});

it('defines account-level invalidation webhooks for indicators and assignments', () => {
Expand Down
Loading