Skip to content
Merged
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
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,19 +404,8 @@ The SDK also accepts and advertises `"3.2-rc.7"` as an explicit compatibility
alias for buyers shipped with `adcp==8.0.0rc3`. These requests use the stable
3.2 validators and responses retain the `"3.2-rc.7"` alias so strict rc3
clients can select their bundled response validator.
Constructor pins to that alias resolve to `"3.2"`.

`"3.3-rc.0"` is likewise an explicit alias for `"3.3-rc.3"`, so a seller can
serve buyers still pinned to the first 3.3 release candidate while both sides
move to rc.3. rc.0 requests are validated against rc.3 and responses echo
`"3.3-rc.0"`. rc.3 withdrew performance-standard `metric_id`: a `buy_products`
purchase that sends it fails validation, and package standards and
`get_products` filters accept it but no longer act on it. Responses are
rc.3-shaped, which rc.0 buyers read except for values rc.3 added to closed
enums, such as the `postal_area` reporting dimension; a seller bridging rc.0
buyers must not emit those. A client pinned to `"3.3-rc.0"` also resolves to
rc.3. The alias is advertised only while rc.3 is the packaged release. Other
prereleases are not automatically aliased.
Constructor pins to that alias resolve to `"3.2"`. Other prereleases are
not automatically aliased.

If you talk to an agent on a newer spec than this SDK validates, the response
still parses — unknown fields are preserved on the model (but not surfaced as
Expand Down
2 changes: 1 addition & 1 deletion docs/decisioning-capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ alongside the spec; they line up.
- **`adcp.supported_versions`** — exact releases you serve. Boot validation
rejects entries outside the SDK's accepted wire set or without installed
request and response validators. The SDK includes `"3.2-rc.7"` as a
compatibility alias for `"3.2"`, and `"3.3-rc.0"` as one for `"3.3-rc.3"`. For a 3.2-only seller, declare
compatibility alias for `"3.2"`. For a 3.2-only seller, declare
`Adcp(major_versions=[3], supported_versions=["3.2"], idempotency={"supported": False})`;
the deprecated
`list_creative_formats_legacy` method is then optional even with
Expand Down
22 changes: 5 additions & 17 deletions src/adcp/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,11 @@
# definition, so making them part of the pin is a category error.
COMPATIBLE_ADCP_VERSIONS: tuple[str, ...] = ("3.0", "3.1", "3.2", "3.3")

# Explicit compatibility bridges. Other prereleases retain their own schema
# contracts; never infer aliases by pattern.
#
# - 3.2-rc.7: buyers shipped with adcp 8.0.0rc3. rc.7 requests remain valid
# under the additive 3.2.1 contract.
# - 3.3-rc.0: buyers still pinned to the first 3.3 release candidate, so a
# seller can serve rc.0 and rc.3 buyers during a lockstep preview move.
# rc.0 requests validate against rc.3 except performance-standard
# ``metric_id``, which rc.3 withdrew: the compact standard on buy_products
# purchases rejects it, and package standards and get_products filters
# accept it but no longer act on it. Responses are rc.3-shaped; rc.0 reads
# them except values rc.3 added to closed enums (reporting dimension
# ``postal_area``), so a bridging seller must not emit those.
#
# Explicit compatibility bridge for buyers shipped with adcp 8.0.0rc3.
# rc.7 requests remain valid under the additive 3.2.1 contract. Other
# prereleases retain their own schema contracts; never infer aliases by pattern.
# An alias is advertised only while its target is.
_ADCP_VERSION_ALIASES: dict[str, str] = {"3.2-rc.7": "3.2", "3.3-rc.0": "3.3-rc.3"}
_ADCP_VERSION_ALIASES: dict[str, str] = {"3.2-rc.7": "3.2"}


def resolve_adcp_version_alias(version: str) -> str:
Expand Down Expand Up @@ -216,8 +205,7 @@ def resolve_adcp_version(pin: str | None) -> str:
is advertised by this SDK.
- Cross-major pin → raises :class:`ConfigurationError`.
- Unparseable string → raises :class:`ConfigurationError`.
- The explicit compatibility aliases resolve to their targets:
``3.2-rc.7`` to ``3.2`` and ``3.3-rc.0`` to ``3.3-rc.3``.
- The explicit ``3.2-rc.7`` compatibility alias resolves to ``3.2``.

All resolved pins are normalized to release-precision before being
returned, per the spec's wire-value rule
Expand Down
4 changes: 2 additions & 2 deletions src/adcp/reporting/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2042,8 +2042,8 @@ def inject_capabilities(

# Leave out compatibility aliases that never reach
# subscriptions (3.2-rc.7), never the packaged release,
# which can itself be a candidate (3.3-rc.3), nor an alias
# of it (3.3-rc.0) that buyers still pin.
# which can itself be a candidate (3.3-rc.3), nor an
# alias of it that buyers still pin.
adcp["supported_versions"] = [
item
for item in get_supported_adcp_versions()
Expand Down
5 changes: 2 additions & 3 deletions src/adcp/validation/envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ def detect_wire_version(

1. ``payload['adcp_version']`` — string, normalized to release
precision (``"3.0.7"`` → ``"3.0"``). Must be in ``supported`` or
raises :class:`UnsupportedVersionError`. The explicit compatibility
aliases resolve to their targets (``3.2-rc.7`` to ``3.2``,
``3.3-rc.0`` to ``3.3-rc.3``).
raises :class:`UnsupportedVersionError`. The explicit ``3.2-rc.7``
compatibility alias resolves to ``3.2``.
2. ``payload['adcp_major_version']`` — int. Prefer ``MAJOR.0`` when
supported because this legacy field predates release-precision
negotiation and the 3.1 response envelope split. If ``MAJOR.0`` is
Expand Down
11 changes: 5 additions & 6 deletions tests/test_adcp_3_3_0_rc_3_adoption.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
buyers opt into the exact prerelease they validated against (DR-0024). The superseded
``3.3-beta.0`` through ``3.3-beta.6`` are no longer advertised or accepted as pins,
like the 3.2 candidates before them; their caches stay in the source tree as history
but leave the wheel. ``3.3-rc.0`` is an explicit compatibility alias for ``3.3-rc.3``
(see ``tests/test_rc0_version_bridge.py``).
but leave the wheel. ``3.3-rc.0`` served as an alias for ``3.3-rc.3`` while
agentic-api moved from rc.0 to rc.3 and is refused again now that it has.
"""

from __future__ import annotations
Expand Down Expand Up @@ -66,7 +66,6 @@ def test_current_pin_and_historical_roots():
"3.2",
WIRE_VERSION,
"3.2-rc.7",
"3.3-rc.0",
}
with pytest.raises(ConfigurationError):
resolve_adcp_version("3.3")
Expand All @@ -91,11 +90,11 @@ def test_current_pin_and_historical_roots():
"3.3.0-beta.5",
"3.3-beta.6",
"3.3.0-beta.6",
"3.3-rc.0",
"3.3.0-rc.0",
):
with pytest.raises(ConfigurationError):
resolve_adcp_version(previous)
for bridged in ("3.3-rc.0", "3.3.0-rc.0"):
assert resolve_adcp_version(bridged) == "3.3-rc.3"
for previous in (
"3.3-beta.0",
"3.3-beta.1",
Expand All @@ -104,9 +103,9 @@ def test_current_pin_and_historical_roots():
"3.3-beta.4",
"3.3-beta.5",
"3.3-beta.6",
"3.3-rc.0",
):
assert previous not in get_supported_adcp_versions()
assert "3.3-rc.0" in get_supported_adcp_versions()
assert schema_loader._resolve_schema_root("3.3.0-beta.1") is not None
assert schema_loader._resolve_schema_root("3.3.0-beta.2") is not None
assert schema_loader._resolve_schema_root("3.3.0-beta.3") is not None
Expand Down
Loading
Loading