From 9b583ded1b40bbad297a46801f1eda1007d6e3d6 Mon Sep 17 00:00:00 2001 From: Brian O'Kelley Date: Fri, 30 Oct 2026 01:15:30 +0000 Subject: [PATCH] fix(media-buy-actions): project change_term_id for AdCP 3.3 prereleases project_available_actions decided whether a protocol version carries available_actions[].change_term_id with a beta.9 floor meant for the 3.2 prereleases, but applied it to every line, so protocol_version "3.3.0-beta.1" (the SDK's own release) projected the pre-3.2 terms_ref form. The floor now applies to the 3.2 line only. Found in the #1668 version literal audit. Refs #1668 Co-Authored-By: Claude Opus 5.5 (1M context) --- src/adcp/media_buy_actions.py | 3 ++- tests/test_media_buy_actions.py | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/adcp/media_buy_actions.py b/src/adcp/media_buy_actions.py index 79ff85338..c04c87e9e 100644 --- a/src/adcp/media_buy_actions.py +++ b/src/adcp/media_buy_actions.py @@ -1305,7 +1305,8 @@ def _supports_change_term_id(version: str) -> bool: beta = int(match.group(3)) if match.group(3) is not None else None if (major, minor) < (3, 2): return False - return beta is None or beta >= 9 + # change_term_id landed in 3.2.0-beta.9; later lines carry it in every prerelease. + return (major, minor) > (3, 2) or beta is None or beta >= 9 def _supports_action_task(version: str) -> bool: diff --git a/tests/test_media_buy_actions.py b/tests/test_media_buy_actions.py index c826e3439..26b6e6b17 100644 --- a/tests/test_media_buy_actions.py +++ b/tests/test_media_buy_actions.py @@ -664,6 +664,17 @@ def test_resolved_condition_allows_seller_managed_standard_async_action() -> Non "change_term_id": "right_increase", }, ), + ( + # The 3.2 beta.9 floor does not apply to 3.3 prereleases. + "3.3.0-beta.1", + { + "action": "increase_budget", + "mode": "seller_managed", + "task": "control_media_buy", + "sla": {"response_max": "PT30M"}, + "change_term_id": "right_increase", + }, + ), ], ) def test_projection_version_matrix(version: str, expected: dict[str, Any]) -> None: