Skip to content

fix(release): let a storage contract bump pass the companion gate - #1948

Merged
rachitm022 merged 1 commit into
nextfrom
claude/issue-1947-storage-contract-release-gate
Nov 24, 2026
Merged

rachitm022 merged 1 commit into
nextfrom
claude/issue-1947-storage-contract-release-gate

Conversation

@rachitm022

@rachitm022 rachitm022 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1947.

The deadlock

#1945 raised the reporting storage contract from 2 to 3 (media_buy_scope, migration 0009). Release PR #1946 (adcp 10.0.0-beta.24) merged, and its publish failed at the companion gate (run 45369898960):

adcp 10.0.0b24 + adcp-reporting-storage 0.2.0b4: companion smoke failed: ... adcp reads the ledger with storage contract 3 but the storage implements contract 2; the pair would fail every reporting turn
adcp 10.0.0b24 does not work with the published adcp-reporting-storage 0.2.0b4. Publish a companion release that matches this adcp's storage contract first.

The storage release (#1884, 0.2.0b5) can't publish first either. gate_companion smokes the storage wheel against the oldest and newest published adcp that its floor accepts:

  • With the floor at >=10.0.0b4, the gate smokes against b4 and b23 (contract 2), and the smoke fails.
  • With the floor at >=10.0.0b24, no published adcp satisfies it, so the gate fails with "publish adcp first".

RELEASING.md said to publish storage first. docs/releasing.md said to publish adcp first. Neither order works. This is the first contract bump since the gate was added.

The fix

The gate's guarantee doesn't change: no pair whose contracts differ, or that fails the PostgreSQL round-trip, reaches PyPI.

  • scripts/check_companion_releases.py: when the storage floor is newer than every adcp on PyPI, gate_companion smokes the storage wheel with the adcp wheel built from the same release commit (new --adcp-dist). It refuses in these cases:

    • no --adcp-dist was passed;
    • the wheel is not an adcp wheel;
    • the wheel's version is not the floor;
    • the smoke fails.

    A yanked floor still counts as on PyPI, because it can't be published again. Once any published adcp satisfies the floor, the gate checks the oldest and newest published releases exactly as before, and the wheel is ignored. --adcp-dist is rejected for --package adcp.

  • .github/workflows/release-publish.yml: the storage job already checks out the release SHA. It now also builds that commit's adcp wheel into $RUNNER_TEMP/adcp-dist and passes it with --adcp-dist. The wheel goes outside dist/, so a storage publish never uploads adcp.

  • packages/adcp-reporting-storage/pyproject.toml: the floor goes to adcp>=10.0.0b24,<11 (contract 3). I checked that v10.0.0-beta.23 declares contract 2 and b24 declares 3.

  • RELEASING.md and docs/releasing.md now give the same release order for a contract bump. I also removed RELEASING.md's stale adcp>=9.0.0,<11 statement about next's range.

  • Tests: new unit tests in tests/test_check_companion_releases.py cover:

    • an unpublished floor with a matching same-commit wheel passes;
    • the same setup fails when the smoke fails;
    • an unpublished floor with no wheel is refused;
    • a wheel at a newer version, an older version, or from another distribution is refused;
    • a yanked floor is refused;
    • a floor below a published adcp takes the published path;
    • a published floor ignores the wheel and still refuses a failing pair;
    • --adcp-dist with --package adcp is rejected.

    tests/test_release_configuration.py asserts the new floor, the --adcp-dist argument, and the out-of-dist/ build.

Verification

  • The release and companion tests pass (35 tests). make lint and make typecheck-all pass, along with black, ruff and mypy on the changed scripts and tests.
  • End to end against live PyPI: I built the storage wheel (floor b24) and the adcp 10.0.0b24 wheel from this branch and ran the gate with a throwaway PostgreSQL 16:
    adcp_reporting_storage-0.2.0b4-py3-none-any.whl (adcp<11,>=10.0.0b24) floors at the unpublished adcp 10.0.0b24; smoking it with adcp-10.0.0b24-py3-none-any.whl, built from this release commit
    adcp 10.0.0b24 + adcp-reporting-storage 0.2.0b4: storage contract 3 on both sides
    the installed pair creates the ledger schema and round-trips its records
    
    Without --adcp-dist, the same run exits 1 with "adcp 10.0.0b24 ... is not published".

Release sequence for 10.0.0b24 and storage 0.2.0b5 after this merges

The storage gate runs scripts/check_companion_releases.py from the storage release commit. So this PR has to be in next before #1884 merges.

  1. Merge this PR into next. It touches packages/adcp-reporting-storage/, so Release Please refreshes chore(next): release adcp-reporting-storage 0.2.0-beta.5 #1884 with the new floor and this commit in its changelog. It also touches root files, so Release Please will open an adcp 10.0.0-beta.25 release PR. Don't merge the b25 PR yet.
  2. Wait for Release Please to update chore(next): release adcp-reporting-storage 0.2.0-beta.5 #1884. Check that its packages/adcp-reporting-storage/pyproject.toml has version 0.2.0b5 and "adcp>=10.0.0b24,<11", and that root pyproject.toml on next is still 10.0.0b24.
  3. Merge chore(next): release adcp-reporting-storage 0.2.0-beta.5 #1884. release-please-next.yml dispatches release-publish.yml with package=adcp-reporting-storage. The gate sees the floor 10.0.0b24 is not on PyPI, builds the adcp wheel of the same commit (10.0.0b24), and runs the contract check and the PostgreSQL round-trip. Approve the release-publish environment, and storage 0.2.0b5 publishes.
  4. Re-run the adcp publish: gh run rerun 45369898960 --failed --repo adcontextprotocol/adcp-client-python. Its gate now finds 0.2.0b5, which accepts 10.0.0b24, and smokes the pair. Approve the environment, and adcp 10.0.0b24 publishes.
  5. Merge the adcp b25 release PR whenever you like after that.

If an adcp release PR merges between steps 1 and 3, the storage commit's adcp version is no longer the floor, and the gate refuses. To recover, raise the storage floor to that adcp version, which also declares contract 3, and release storage again. The 10.0.0b24 adcp publish then stays unpublished.

🤖 Generated with Claude Code

A storage contract bump deadlocked the release gate. adcp 10.0.0b24
(contract 3) refuses to publish beside adcp-reporting-storage 0.2.0b4
(contract 2), and the storage release cannot publish first: with its
floor at 10.0.0b4 it is smoked against contract-2 adcp and fails, and
with its floor at 10.0.0b24 no published adcp satisfies it.

When the storage floor is newer than every adcp on PyPI, the storage
gate now smokes the storage wheel with the adcp wheel built from the
same release commit (--adcp-dist) and refuses unless that wheel is the
floor. The published-adcp checks run unchanged once any published adcp
satisfies the floor. release-publish.yml builds that wheel outside
dist/, so a storage publish never uploads adcp.

Raise the storage floor to adcp>=10.0.0b24,<11 (contract 3) and make
RELEASING.md and docs/releasing.md give one release order for a
contract bump.

Closes #1947

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — release-infrastructure PR with no blocking or medium findings.

This PR adds a companion-gate path for the storage-contract-bump window (#1947) where both packages change in one commit and neither companion is on PyPI yet. The unreleased_floor + _gate_unreleased_floor logic smokes the storage wheel against the same-commit adcp wheel, refusing unless that wheel's version is exactly the floor. The reviewer verified:

  • Fail-closed behavior (yanked-release and later-commit cases both refuse rather than approve).
  • The adcp wheel builds outside dist/, so the storage publish never uploads adcp.
  • Source constants (STORAGE_CONTRACT=3, _FIRST_ADCP=10.0.0b24, floor adcp>=10.0.0b24) match every claim in the diff and docs.
  • New branches are thoroughly covered by tests.

Decision table: no critical/high findings (row 1 n/a); gated_paths false (row 2 n/a); high_risk false, no deletions/modified-sensitive triggers (rows 3–5 n/a); no prior decision (row 6 n/a); no no-auto-approve team match (row 7 n/a); zero medium findings (row 8 n/a). Falls through to row 9 → approve.

@rachitm022
rachitm022 merged commit 58116d6 into next Nov 24, 2026
41 checks passed
@rachitm022
rachitm022 deleted the claude/issue-1947-storage-contract-release-gate branch November 24, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant