Skip to content

fix(release): compare the agent compatibility record against the last published release, not the last tag - #1193

Merged
antoinetoussaint-byte merged 1 commit into
mainfrom
fix/agentcontract-previous-published-release
Oct 27, 2026
Merged

antoinetoussaint-byte merged 1 commit into
mainfrom
fix/agentcontract-previous-published-release

Conversation

@antoinetoussaint-byte

Copy link
Copy Markdown
Contributor

What broke

A tag whose release workflow fails stays on origin, because published tags are never moved (runbook: "the release commit and tag are immutable and remain even if the release workflow later fails"). tools/agentcontract took the previous release to be the newest stable tag merged into HEAD, then ran gh release download <tag> agent-requirements.json, which fails closed. So one burned tag blocks every later release:

The change

previousTag now returns the newest stable tag merged into HEAD that has a published, non-draft GitHub release (gh release list --exclude-drafts). It still fails closed in three cases:

  • a release-listing error is returned (list published CLI releases: …);
  • stable tags exist but none has a release: that is an error, never a silent "first release";
  • the listing is skipped only when no stable tag precedes the current one, which is the existing first-release path.

The runbook's If it fails list gains one entry naming the burned-tag path.

Reused: the existing tag walk, the ls-tree introduction check, the asset download and the release-notes logic are unchanged. Classification: fix, in the tool that owns "which release is previous". No gate is relaxed: the asset is still required for the release that is chosen.

Verified

  • go test ./tools/agentcontract: new cases for burned tags (newest two tags unreleased → picks the last released), a prerelease never chosen, no released stable tag → error, a listing error propagates, no stable tags → listing never called.
  • Live repo at e89a8e57 (main), go run ./tools/agentcontract --tag v0.1.217:
    • on main: read previous CLI contract: exit status 1, the CI failure reproduced;
    • on this branch: exit 0, notes say Agent requirements unchanged from v0.1.215.

After merge

codefly publish cuts v0.1.218 from main. v0.1.216 and v0.1.217 remain tags without releases.

🤖 Generated with Claude Code

… published release, not the last tag

tools/agentcontract took the previous release to be the newest stable tag
merged into HEAD, then downloaded that tag's agent-requirements.json and
failed closed when the release was missing. A tag whose release workflow
failed is a state the runbook expects (published tags are never moved), so
one such tag blocked every later release: v0.1.216's workflow failed at
'Qualify the clean tag' (fixed by #1191), and v0.1.217's then failed at
'Prepare agent compatibility record' with 'release not found' for v0.1.216.

The previous release is now the newest stable tag merged into HEAD that has
a published (non-draft) GitHub release. Release listing errors still fail
closed, and stable tags with no published release among them are an error
rather than a silent first release. The listing is skipped when there is no
stable tag to compare against.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@antoinetoussaint-byte
antoinetoussaint-byte added this pull request to the merge queue Oct 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 27, 2026
@antoinetoussaint-byte
antoinetoussaint-byte added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit 968b443 Oct 27, 2026
14 checks passed
@antoinetoussaint-byte
antoinetoussaint-byte deleted the fix/agentcontract-previous-published-release branch October 27, 2026 03:55
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