Skip to content
Closed
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
18 changes: 18 additions & 0 deletions .changeset/fix-compact-version-envelope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
"adcontextprotocol": patch
---

Restore `adcp_major_version` in compact MCP request schemas.

The 3.2.0-beta.0 frozen snapshots for `buy-products`, `accept-proposal`,
and `control-media-buy` request schemas were published before the source
schemas gained the deprecated `adcp_major_version` field. Combined with
`additionalProperties: false`, this caused conforming SDK buyers to fail
MCP input validation when emitting both version fields (as the spec
requires through 3.x).

Patches the 18 affected dist schema files across all beta.0 output
paths (bundled, MCP, profiles, model-context) and adds lint coverage to
prevent the same drift in future version snapshots.

Refs #6649
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@
"3.1-rc.1"
]
},
"adcp_major_version": {
"type": "integer",
"deprecated": true,
"description": "DEPRECATED in favor of adcp_version (release-precision string). Servers MUST continue to honor this field through 3.x. Removed in 4.0. Original semantics: the AdCP major version the buyer's payloads conform to. Sellers validate against their supported major_versions and return VERSION_UNSUPPORTED if unsupported. When omitted, the seller assumes its highest supported version.",
"minimum": 1,
"maximum": 99
},
"idempotency_key": {
"type": "string",
"minLength": 16,
Expand Down Expand Up @@ -669,4 +676,4 @@
"generatedAt": "2026-08-17T20:29:51.925Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
"3.1-rc.1"
]
},
"adcp_major_version": {
"type": "integer",
"deprecated": true,
"description": "DEPRECATED in favor of adcp_version (release-precision string). Servers MUST continue to honor this field through 3.x. Removed in 4.0. Original semantics: the AdCP major version the buyer's payloads conform to. Sellers validate against their supported major_versions and return VERSION_UNSUPPORTED if unsupported. When omitted, the seller assumes its highest supported version.",
"minimum": 1,
"maximum": 99
},
"idempotency_key": {
"type": "string",
"minLength": 16,
Expand Down Expand Up @@ -6899,4 +6906,4 @@
"generatedAt": "2026-08-17T20:29:52.149Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
"3.1-rc.1"
]
},
"adcp_major_version": {
"type": "integer",
"deprecated": true,
"description": "DEPRECATED in favor of adcp_version (release-precision string). Servers MUST continue to honor this field through 3.x. Removed in 4.0. Original semantics: the AdCP major version the buyer's payloads conform to. Sellers validate against their supported major_versions and return VERSION_UNSUPPORTED if unsupported. When omitted, the seller assumes its highest supported version.",
"minimum": 1,
"maximum": 99
},
"idempotency_key": {
"type": "string",
"minLength": 16,
Expand Down Expand Up @@ -5708,4 +5715,4 @@
"generatedAt": "2026-08-17T20:29:52.168Z",
"note": "This is a bundled schema with all $ref resolved inline. For the modular version with references, use the parent directory."
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"adcp_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_version"
},
"adcp_major_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_major_version"
},
"idempotency_key": {
"type": "string",
"minLength": 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"adcp_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_version"
},
"adcp_major_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_major_version"
},
"idempotency_key": {
"type": "string",
"minLength": 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"adcp_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_version"
},
"adcp_major_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_major_version"
},
"idempotency_key": {
"type": "string",
"minLength": 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"adcp_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_version"
},
"adcp_major_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_major_version"
},
"idempotency_key": {
"type": "string",
"minLength": 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"adcp_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_version"
},
"adcp_major_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_major_version"
},
"idempotency_key": {
"type": "string",
"minLength": 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"adcp_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_version"
},
"adcp_major_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_major_version"
},
"idempotency_key": {
"type": "string",
"minLength": 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"adcp_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_version"
},
"adcp_major_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_major_version"
},
"idempotency_key": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"adcp_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_version"
},
"adcp_major_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_major_version"
},
"idempotency_key": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"adcp_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_version"
},
"adcp_major_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_major_version"
},
"idempotency_key": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"adcp_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_version"
},
"adcp_major_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_major_version"
},
"idempotency_key": {
"type": "string",
"minLength": 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"adcp_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_version"
},
"adcp_major_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_major_version"
},
"idempotency_key": {
"type": "string",
"minLength": 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"adcp_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_version"
},
"adcp_major_version": {
"$ref": "#/$defs/external:core~1version-envelope.json/properties/adcp_major_version"
},
"idempotency_key": {
"type": "string",
"minLength": 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"adcp_version": {
"$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/core/version-envelope.json#/properties/adcp_version"
},
"adcp_major_version": {
"$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/core/version-envelope.json#/properties/adcp_major_version"
},
"idempotency_key": {
"type": "string",
"minLength": 16,
Expand Down
3 changes: 3 additions & 0 deletions dist/schemas/3.2.0-beta.0/media-buy/buy-products-request.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"adcp_version": {
"$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/core/version-envelope.json#/properties/adcp_version"
},
"adcp_major_version": {
"$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/core/version-envelope.json#/properties/adcp_major_version"
},
"idempotency_key": {
"type": "string",
"minLength": 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"adcp_version": {
"$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/core/version-envelope.json#/properties/adcp_version"
},
"adcp_major_version": {
"$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/core/version-envelope.json#/properties/adcp_major_version"
},
"idempotency_key": {
"type": "string",
"minLength": 16,
Expand Down
7 changes: 1 addition & 6 deletions tests/compact-version-envelope.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ const { ProtocolClient } = require('@adcp/sdk');

const SOURCE_DIR = path.resolve(__dirname, '..', 'static', 'schemas', 'source');
const ADCP_VERSION = '3.2.0-beta.0';
const COMPACT_SCHEMAS_WITHOUT_MAJOR = new Set([
'buy_products',
'accept_proposal',
'control_media_buy',
]);

function readSchema(uri) {
if (!uri.startsWith('/schemas/')) {
Expand Down Expand Up @@ -108,7 +103,7 @@ test('SDK auto version envelope passes every strict compact lifecycle request sc
for (const [tool, request] of Object.entries(compactRequests)) {
await ProtocolClient.callTool(agent, tool, request, { adcpVersion: ADCP_VERSION });
const expectedEnvelope = {
adcp_major_version: COMPACT_SCHEMAS_WITHOUT_MAJOR.has(tool) ? undefined : 3,
adcp_major_version: 3,
adcp_version: '3.2-beta.0',
};
assert.deepEqual({
Expand Down
48 changes: 48 additions & 0 deletions tests/lint-version-envelope.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,51 @@ test('release-precision version grammar stays aligned across inlined negotiation
);
assert.equal(versionPatternCheck?.pattern, canonicalPattern);
});

test('every source request schema with adcp_version also has adcp_major_version', () => {
const violations = [];
for (const file of listJsonFiles(SOURCE_DIR)) {
if (!file.endsWith('-request.json')) continue;
let schema;
try { schema = JSON.parse(fs.readFileSync(file, 'utf8')); } catch { continue; }
if (!schema.properties) continue;
const hasVersion = 'adcp_version' in schema.properties;
const hasMajor = 'adcp_major_version' in schema.properties;
if (hasVersion && !hasMajor) {
violations.push(path.relative(path.resolve(__dirname, '..'), file));
}
}
assert.deepEqual(
violations,
[],
'Request schemas that declare adcp_version MUST also declare ' +
'adcp_major_version (deprecated but required through 3.x). ' +
'Missing in:\n' + violations.map((v) => ` ${v}`).join('\n'),
);
});

const DIST_DIR = path.resolve(__dirname, '..', 'dist', 'schemas');

test('every versioned dist request schema with adcp_version also has adcp_major_version', () => {
if (!fs.existsSync(DIST_DIR)) return;
const violations = [];
for (const ver of fs.readdirSync(DIST_DIR).filter((d) => d.match(/^\d/))) {
const bundled = path.join(DIST_DIR, ver, 'bundled');
if (!fs.existsSync(bundled)) continue;
for (const file of listJsonFiles(bundled)) {
if (!file.endsWith('-request.json')) continue;
let schema;
try { schema = JSON.parse(fs.readFileSync(file, 'utf8')); } catch { continue; }
if (!schema.properties) continue;
if ('adcp_version' in schema.properties && !('adcp_major_version' in schema.properties)) {
violations.push(path.relative(path.resolve(__dirname, '..'), file));
}
}
}
assert.deepEqual(
violations,
[],
'Versioned bundled dist schemas must preserve adcp_major_version alongside ' +
'adcp_version. Missing in:\n' + violations.map((v) => ` ${v}`).join('\n'),
);
});
Loading