Skip to content

ci: refuse committed merge-conflict markers - #3962

Merged
yannickmonney merged 2 commits into
mainfrom
ci/conflict-marker-guard
Sep 30, 2026
Merged

yannickmonney merged 2 commits into
mainfrom
ci/conflict-marker-guard

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

Why

In round 3, a conflict resolution that stopped halfway was committed with its <<<<<<<, ||||||| and >>>>>>> lines still in services/platform/tests/manual/reference/automation.md. Markdown and shell still parse with markers in them, so neither lint:manual, the format check nor the hook noticed. The squash merge happened to keep main clean.

What changes

  • scripts/check-conflict-markers.ts refuses a line that starts with <<<<<<<, ||||||| or >>>>>>>, followed by a space or the end of the line, in tracked text files (git grep -I).
    • With file arguments, it checks only those files; without, it checks the whole tree.
    • A lone ======= stays allowed, because it is also a markdown heading underline and a real conflict always has its start and end lines.
  • It is wired in three places:
    • lint-staged "*" runs it on staged files;
    • bun run lint:conflicts runs it on the whole tree;
    • bun run check and CI's Format job run it too.
  • .agents/repo.md states the rule.

Verified

  • The whole tree passes today; main has no marker lines, not even a lone =======.
  • A staged file with a diff3 conflict is refused, and every marker line is listed. When the check fails, lint-staged stops the concurrent oxfmt.
  • oxfmt leaves marker lines unchanged in markdown. Even if it rewrote the end markers, the <<<<<<< start line is plain text that a formatter keeps, so the concurrent task cannot hide a conflict.

A resolution that stopped halfway left <<<<<<<, ||||||| and >>>>>>> lines
in a manual-test register and was committed: markdown and shell still
parse with them, so no gate noticed. scripts/check-conflict-markers.ts
refuses such lines in tracked text files; lint-staged runs it on the staged
files, CI's Format job and bun run check on the whole tree. A lone =======
stays allowed, since it is also a markdown heading underline.
@yannickmonney

Copy link
Copy Markdown
Contributor Author

Independent review accepted the tracked-text conflict guard after 13 controlled cases, including real diff3 conflict output, unusual filenames, normal concurrent lint-staged/oxfmt, both partially staged directions, and preserved index/worktree bytes.

Normally reconciled current main into this PR at e4cae1dbab6e0f7f2fa2b5b1cf52289a8ebd1f2f. The sole textual conflict preserved both the validated-candidate release rule and the new conflict-marker rule. Candidate-pinned checkout/concurrency/receipt wiring remains intact. Guard bytes are unchanged from the reviewed head. Final scoped checks passed: conflict guard, formatting, manual register, lint, normal commit hooks and 16 candidate-workflow cases / 199 assertions. Local Bun was 1.3.10; exact-head hosted checks own the repository-pinned toolchain and broader gates.

This is review/reconciliation evidence, not a merge claim. Normal new-head CI and expected-head squash remain required. The immutable v0.5.64 candidate/tag is unchanged.

@yannickmonney
yannickmonney merged commit 89109e3 into main Sep 30, 2026
57 checks passed
@yannickmonney
yannickmonney deleted the ci/conflict-marker-guard branch September 30, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant