fix(mage): verify a compat repair builds, and discard it if it fails - #114
Merged
Merged
Conversation
Regeneration run 34538493104 shipped a Rust client that did not compile, and the repair loop I added in #84 is why. What happened: rust's Gen produced `pub cursor` plus a with_cursor builder, which compiled and passed clippy and tests, and was committed. The gate then flagged constructible_struct_adds_field on the new public field. The repair loop asked Claude to fix it, Claude made the field private -- which satisfies that lint and breaks the build, because Rust privacy is module-scoped and client.rs cannot read a field private to types.rs -- and Claude's own invocation then failed. The loop returned an error with the half-finished edit still in the tree, and create-pull-request committed it into the PR. Two things were missing, and both are fixed here. A repair is now verified. The loop re-ran only the compatibility check after a fix, so a repair that restored compatibility while breaking the build was accepted. Each repaired language's own test target now runs after the edit, because only the language's toolchain can tell: cargo-semver-checks reads rustdoc JSON, and rustdoc does not type-check function bodies, so it reported a clean build of a crate cargo build rejects. A failed repair is now discarded. Everything generation produced is committed before the gates run, so anything uncommitted at that point is the repair and nothing else -- `git checkout -- .` plus `git clean -fd` returns the tree to HEAD. Ignored files are deliberately left alone: the gate tooling lives in some of them, and tools/japicmp.jar being deleted mid-run is a failure this pipeline has already had once. Tests cover both, including that an ignored file survives a discard. Co-Authored-By: Claude Opus 5 <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.
Regeneration run
34538493104shipped a Rust client that did not compile. The repair loop I added in #84 is why.What happened
a2af576— rust'sGenproducedpub cursor+ awith_cursorbuilder. It compiled, passed clippy and tests, and was committed.Gendid its job.constructible_struct_adds_fieldon the new public field.client.rscannot read a field private totypes.rs.exit status 1).create-pull-requestcommitted it into the PR as661ecfb:Two gaps, both fixed
A repair is now verified. The loop re-ran only the compatibility check after a fix, so a repair that restored compatibility while breaking the build was accepted. Each repaired language's own
testtarget now runs after the edit.Only the language's toolchain can catch this:
cargo-semver-checksreads rustdoc JSON, and rustdoc does not type-check function bodies — which is why it reported a clean build of a cratecargo buildrejects, and why the gate saw nothing wrong.A failed repair is now discarded. Everything generation produced is committed before the gates run, so anything uncommitted at that point is the repair and nothing else.
git checkout -- .plusgit clean -fdreturns the tree to HEAD.Ignored files are deliberately left alone — the gate tooling lives in some of them, and
tools/japicmp.jarbeing deleted mid-run is a failure this pipeline has already had once (#91). There is a test pinning that.Tests
Four: the tree is restored and added files removed; an ignored file survives; verification fails and names the language when its build breaks; verification passes when it doesn't.
go test -tags mage ./...passes.🤖 Generated with Claude Code