Repository navigation
fix(#1484): sequant merge --check hard-codes origin/main in four places, so a master-default repo gets empty diffs and a clean report - #1500
Merged
admarble merged 4 commits intoOct 18, 2026
Conversation
Entire-Checkpoint: 769dada47e26
…-coding origin/main Entire-Checkpoint: 3a1ddf158716
Entire-Checkpoint: 39f4258f840e
…and cleanup restores the resolved base, not main Entire-Checkpoint: c5413bf0dd53
3 tasks
admarble
deleted the
feature/1484-fix-merge-sequant-merge-check-hard-codes-origin-ma
branch
October 18, 2026 23:49
Closed
6 tasks done
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.
Summary
sequant merge --checkno longer hardcodesorigin/main.runMergeChecksresolves the base once per run (resolveMergeBaseRef→origin/<default>viadetectDefaultBranch) and passes it to all four sites:filesModifieddiff;A
filesModifieddiff that fails is now an error finding for that branch, and the batch is BLOCKED. It used to be a silent[], which every overlap check read as "no changes".Fixes #1484
Changes (exec,
7281925aa,fa9d9945c,4237036ad)src/lib/merge-check/index.ts:resolveMergeBaseRef, called once inrunMergeChecks;resolveBranchestakes the base;branch-diffcheck result for failed diffs.combined-branch-test.ts,overlap-detection.ts,residual-pattern-scan.ts: take the base as a parameter.BASE_REFis gone.types.ts:BranchInfo.filesModifiedError.src/commands/merge.ts: passes the base through.merge-check-base.integration.test.ts(new; a bare origin whose default ismaster, with noorigin/main), the failed-diff test inmerge-check.test.ts, and the existing tests moved to the new signatures.docs/reference/merge-command.md,CHANGELOG.md.Runner fixes after QA (
dd4ca291f)QA returned AC_MET_BUT_NOT_A_PLUS, 3/3. It marked two findings "document". Both were the issue's own defect class, so I fixed them here:
[]. That path calledgetGitDiffStats, which fails open by design for run logs. AC-3 covers any failedfilesModifieddiff, so both paths now run the samegit diff --name-only <base>...<head>and report a failure the same way. Added the test "base ref does not resolve: a branch held by a worktree reports the same error".git checkout mainwhen the original branch couldn't be read. It now falls back to the resolved base branch. Added the test "restores the base branch when the original branch cannot be read, not a hardcoded main".QA's third finding (missing mutation records) is addressed below.
Verification (runner, on
dd4ca291f)Evidence commands, run verbatim:
git grep -nE "origin/main" -- 'src/lib/merge-check/*.ts' ':!*.test.ts'prints nothing.npx vitest run src/lib/merge-check/merge-check-base.integration.test.ts -t "master-default"reports 4 passed, 0 failed.npx vitest run src/lib/merge-check/merge-check.test.ts -t "base ref does not resolve"reports 2 passed, 0 failed.Other checks:
src/lib/merge-checkpasses 133/133.tsc --noEmitand eslint are clean.Mutation-verified: AC-2 — the remote
filesModifieddiff uses theorigin/mainliteral again; within-t "master-default"exactly "resolves origin/master and reports filesModified through runMergeChecks" failed (1 failed, 3 passed); restored.Mutation-verified: AC-3 — the failed diff no longer records an error (silent
[]again); both "base ref does not resolve" tests failed; restored.Mutation-verified: AC-3 (worktree path) — a failed worktree diff is treated as success; only "a branch held by a worktree reports the same error" failed; restored.
Mutation-verified: cleanup — the restore fallback is the literal
mainagain; only "restores the base branch when the original branch cannot be read, not a hardcoded main" failed; restored. With everything restored, 133/133 pass.Follow-up ledger. The spec's open question 3 was a repo-wide lint against
origin/mainliterals, recommended as a separate issue. I dropped it: after this PR, no non-test code undersrc/contains anorigin/mainliteral. The 6 remaining mentions are comments. The earlier instances were fixed in #343 and #1460, so the lint would guard nothing today.🤖 Generated with Claude Code