fix: compare the param guard against the merge base - #187
Merged
Conversation
The guard diffed the checked-out tree against the tip of the base branch. On a pull request that tree is GitHub's refs/pull/N/merge commit, which is only recomputed when the PR or its base is pushed to — so a re-run, or a `labeled` event, compares a merge built on an older base against a base tip that has moved on. Every parameter the base gained in between reads as a removal. That is how run 26753498917 blocked PR #37: re-run four days after it was queued, it reported mistral/magistral-* losing `prompt_mode`, a file the PR never touched. Diffing against the merge base puts both sides of the comparison on the same snapshot. Removals the PR really does make are still caught: PR #132 still reports dropping `reasoning_effort` from z-ai/glm-5.2.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
CI clones shallow, so `git rev-parse HEAD^` fails there. The remaining cases cover the contract that matters — a resolvable ref narrows to a shared commit, an unresolvable one yields null and the guard falls back.
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.
💭 Why
The param guard diffs the checked-out tree against the tip of the base branch. On a pull request that tree is GitHub's
refs/pull/N/mergecommit, which is only recomputed when the PR or its base is pushed to. A re-run — or alabeledevent, which is exactly how theallow-param-removaloverride is applied — therefore compares a merge built on an older base against a base tip that has moved on. Every parameter the base gained in between reads as a removal.That is how run 26753498917 blocked #37. Re-run four days after it was queued, it reported
mistral/magistral-medium-latestand-small-latestlosingprompt_mode— a provider that PR never touched.prompt_modehad landed onmainin #42 in the meantime.✨ What changed
resolveBaseline()narrows the resolved base ref togit merge-base <ref> HEAD, so both sides of the comparison come from the same snapshot. AddedmergeBase()togit-baseline.ts, plus tests. Output now names the commit it actually compared:No workflow change:
BASE_REFstaysorigin/<base_ref>.🔧 For operators
Verified against the two runs that motivated this, replaying each PR's merge tree through
findRemovedParams:mistral/magistral-*→prompt_modez-ai/glm-5.2→reasoning_effortz-ai/glm-5.2→reasoning_effortThe false positive clears; the true positive stays caught. #132 really would drop
reasoning_effort, because #136 landed the same model onmainwith a fuller param set — that PR needs a rebase, not a label.📝 Notes
Local runs get the same treatment, which also makes
npm run guard:paramson a branch behindmainstop reporting other people's additions.