squash-merge-history: scope to the work, not the repo history - #142
Merged
Conversation
The check audited main's entire first-parent history on every run, so it re-flagged every legacy merge commit each session — nine of them had to be individually silenced in .claudinite-checks.json. That is "test the world," out of step with every other delta-scoped check here. Scope it to the work: flag only the merge commits the current change introduces (HEAD's first-parent chain since the merge-base). Pre-existing merges already on the base are out of range, so the nine legacy acceptances are deleted as dead config. Context gains introducedMergeCommits() replacing the whole-history mergeCommitsOn(); docs and the test track the new semantics. Closes #141 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019mW2ZDXbTgZxwsyrPcUrwy
The work-scoped squash-merge-history check evaluates HEAD's branch commits. actions/checkout defaults to refs/pull/N/merge on pull_request events, making HEAD an ephemeral merge of the branch into main — which the check correctly flags as an introduced merge commit. Check out the PR head SHA instead so CI evaluates exactly what the local Stop hook does (the branch tip); fall back to github.sha on push to main. Refs #141 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019mW2ZDXbTgZxwsyrPcUrwy
missingbulb
marked this pull request as ready for review
July 7, 2026 08:43
This was referenced Jul 7, 2026
missingbulb
pushed a commit
that referenced
this pull request
Jul 7, 2026
On pull_request, actions/checkout defaults to the synthetic refs/pull/N/merge commit — an ephemeral merge of the head into the base — so HEAD is a merge commit, not the branch tip. Any CI job that inspects commit shape/history misfires on it; e.g. a "no merge commits" check false-positives on a linear branch. Land the gotcha next to the sibling actions/checkout-default trap in the git-github-advanced skill (GitHub Actions gotchas are its scope), framed portably rather than tied to this repo's own checks. Captured from the #141/#142 session, where this cost a CI round-trip. Closes #145 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019mW2ZDXbTgZxwsyrPcUrwy
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.
Problem
The
squash-merge-historycheck audited the entire first-parent history of the default branch on every run (ctx.mergeCommitsOn(ctx.baseRef)), emitting one finding per merge commit found anywhere in that history. It "tested the world" — the repo's whole past — rather than "testing the work," out of step with every other delta-scoped check in the system (warning-suppression ignores pre-existing markers; task-lifecycle scopes to commits since the merge-base).The tax this imposed was concrete:
.claudinite-checks.jsonhad grown ninesquash-merge-historyacceptance entries — one hand-written reason per legacy merge commit — purely to keep the whole-history audit from re-flagging ancient merges every session.Change
Scope the check to the merge commits the current change introduces — those on HEAD's first-parent chain since the merge-base — so it fires only when a merge is happening in the work, never re-auditing legacy merges already on
mainthat the work never touched.checks/lib/context.mjs:mergeCommitsOn(ref)(whole-history) →introducedMergeCommits()(rangemergeBase..HEAD, empty when no base resolves).packs/universal/squash-merge-history.mjs: fires per introduced merge; message,description, andwhyupdated to the work-scoped framing..claudinite-checks.json: the nine legacysquash-merge-historyacceptances deleted as dead config.checks/DESIGN.md(effect-check bullet),checks/README.md(delta-rule note),checks/conversion-inventory.md,packs/universal/README.md.checks/test/rules.test.mjs: rewritten to assert a merge the branch introduces fires, while a pre-existing merge already onmain(before the branch's work) stays silent.Decision confirmed with the owner: drop the retrospective whole-history audit entirely; do not keep a CI-only history backstop.
Verification
node --test checks/test/*.test.mjs— 64/64 pass.node checks/run.mjs(full-repo sweep) — exits 0 clean, including no orphaned/reasonless acceptances after removing the nine legacy entries.Closes #141
🤖 Generated with Claude Code
Generated by Claude Code