Skip to content

merge_main: merge origin/main with no model when every conflict is in a regenerated file (#6732) - #6739

Merged
squid-protocol merged 1 commit into
mainfrom
merge-main-6732
Oct 26, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
merge-main-6732

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #6732.

Why. Conflicts with main were 25% of churn fix runs from 10-18 to 10-26 (41 on 10-24 alone). Each was a model run plus a CI round, and many were in files no one writes by hand. A clean merge is already GitHub's update-branch (promoter-bot #20). This adds the next step.

What: tests/tools/merge_main.py runs a merge commit with git merge origin/main, never a rebase and never a push. Each conflicted path is handled by type:

Type Paths Resolution
regenerated golden masters, ruff/mypy baselines, docs_read_by_tests.txt, graph_coverage_chart.svg, .test_durations take main's side, then re-run the file's writer once (goldens last) in pr_gates' environment, which has the corpora beside the main checkout
region mutation_testing.md the prose merges with git merge-file, with the <!-- mutation-scores --> table blanked on all three sides; then mutation_scores.py table re-renders it. Prose that itself conflicts aborts.
record det-sweep ledger entries, evidence records, graph_comparison_ledger.json take main's side; if the branch's own change stales them, derived_check.py (#6734) prints the re-prove commands (exit 3)
anything else hand-written: git merge --abort, branch untouched, exit 2
  • --dry-run classifies via git merge-tree without changing anything.
  • --repo PATH lets churn run main's copy of the tool against a PR branch's worktree.
  • merge_main joins change_classifier.PATTERN_HOLDERS, because it names paths as patterns, not as reads. docs_read_by_tests.txt is unchanged.

Replay on churn's 37 recorded precheck conflicts (10-16..26), each rebuilt at that moment's PR head and main:

  • 14 merged clean at the reconstructed point.
  • Of the 27 that still conflict, 12 were all-resolvable.
  • 11 of 11 run live merged and committed with no conflict markers. Four of those re-blessed goldens through crucible_check --update.

Checks: test_merge_main.py has 16 tests, including scratch-repo merges: a hand-written conflict changes nothing, a regenerated file takes main's side in a real merge commit, and a region file merges prose and re-renders its table. test_source_reads, test_change_classifier, test_ground_truth_plan and pr_gates --only lint audits pass.

Follow-up: the churn side will run this before queuing a model fix for a dirty PR.

🤖 Generated with Claude Code

… a regenerated file (#6732)

Conflicted golden masters, lint baselines, docs_read_by_tests.txt, the graph coverage chart and .test_durations take
main's side and their writer re-runs (with pr_gates' corpora environment); mutation_testing.md's prose merges with its
generated score table blanked, then `mutation_scores.py table` re-renders it; proof records (det-sweep ledger entries,
evidence records, the graph comparison ledger) take main's side and derived_check (#6731) names any re-prove. Any other
conflict aborts the merge untouched (exit 2). Always a merge commit, never a rebase or a push. --repo lets churn run
main's copy on a PR branch's worktree. Replayed on churn's 37 precheck conflicts of 10-16..26: 12 of the 27 that still
conflict are all-resolvable, and 11 of 11 replayed live merged with no conflict markers (4 re-blessing goldens).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@squid-protocol
squid-protocol merged commit 534a67c into main Oct 26, 2026
47 checks passed
@squid-protocol
squid-protocol deleted the merge-main-6732 branch October 26, 2026 15:24
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.

Merge main without a model: a tool that resolves conflicts in regenerated files by regenerating them

1 participant