converge: sync repo contract in release.sh with a post-bump re-gate#55
Merged
Conversation
…re-gate release.sh bumped VERSION, the README badge and CHANGELOG but never the repo contract, so tags shipped with the contract one version behind — v1.0.1 was tagged VERSION=1.0.1, contract=1.0.0. The stack contract gate then failed in mq-agent's CI rather than here. Two changes make release.sh produce an in-sync state or refuse: - sync_contract_version bumps .mq/repo-contract.json alongside VERSION, and the contract is added to the release commit and to rollback. - verify_contract_matches_version runs after the bump (post-bump re-gate): if the contract does not match VERSION, the release aborts instead of committing a drifted tag. Verified with ./release.sh --dry-run 1.0.2: the contract is synced and verified, the diff shows the bump, and dry-run rolls everything back. The re-gate exits 1 on an injected mismatch. bash -n clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of v1.23.0's release-path convergence.
Problem
release.shbumpedVERSION, the README badge andCHANGELOG.mdbut never.mq/repo-contract.json. So a release shipped the contract one version behind —v1.0.1was tagged withVERSION=1.0.1,contract=1.0.0. The drift then failed the stack contract gate in mq-agent's CI instead of here.Fix (correct-by-construction)
sync_contract_versionbumps.mq/repo-contract.jsonalongsideVERSION; the contract is added to the release commit, to rollback, and to the required-files and diff-preview steps.verify_contract_matches_versionruns after the bump — a post-bump re-gate. If the contract does not matchVERSION, the release aborts rather than committing a drifted tag. Silent drift becomes a hard stop.Verified
./release.sh --dry-run 1.0.2: contract synced 1.0.1 → 1.0.2, re-gate verified the match, diff shown, dry-run rolled everything back cleanly. The re-gate exits 1 on an injected mismatch.bash -nclean.🤖 Generated with Claude Code