Skip to content

fix: compare the param guard against the merge base - #187

Merged
brunobuddy merged 2 commits into
mainfrom
fix/param-guard-merge-base
Aug 3, 2026
Merged

fix: compare the param guard against the merge base#187
brunobuddy merged 2 commits into
mainfrom
fix/param-guard-merge-base

Conversation

@brunobuddy

Copy link
Copy Markdown
Member

💭 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/merge commit, which is only recomputed when the PR or its base is pushed to. A re-run — or a labeled event, which is exactly how the allow-param-removal override 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-latest and -small-latest losing prompt_mode — a provider that PR never touched. prompt_mode had landed on main in #42 in the meantime.

✨ What changed

resolveBaseline() narrows the resolved base ref to git merge-base <ref> HEAD, so both sides of the comparison come from the same snapshot. Added mergeBase() to git-baseline.ts, plus tests. Output now names the commit it actually compared:

OK — no parameters removed vs origin/main (merge base 6e11d6f).

No workflow change: BASE_REF stays origin/<base_ref>.

🔧 For operators

Verified against the two runs that motivated this, replaying each PR's merge tree through findRemovedParams:

PR vs base tip (before) vs merge base (after)
#37 add ollama/qwen3.5-9b mistral/magistral-*prompt_mode clean
#132 add z-ai/glm-5.2 z-ai/glm-5.2reasoning_effort z-ai/glm-5.2reasoning_effort

The false positive clears; the true positive stays caught. #132 really would drop reasoning_effort, because #136 landed the same model on main with 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:params on a branch behind main stop reporting other people's additions.

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.
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
modelparams.dev Ready Ready Preview Aug 3, 2026 9:49am

Request Review

@github-actions github-actions Bot added site Website code or tooling meta Repo docs, CI, and config labels Aug 3, 2026
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.
@brunobuddy
brunobuddy merged commit 9a33986 into main Aug 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta Repo docs, CI, and config site Website code or tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant