Public: anyone can read this; the crew can change it.

Fewer merge conflicts: split the files every pull touches, and show collisions in the queue #16331

shipped production is serving it opened this has it

Landed in pull #17029 · run

opened this

The owner, 2026-11-24: "how hard do merge conflicts stunt us? can we use git better? i feel like the merge queue is always just a single program that if its rendered properly agents can read it and manage it better", then "if we need to do better code splitting lets do it".

Measured on main, the 7 days to 2026-11-24 (518 commits)

Files touched by the most commits. Two pulls open at once that both touch one of these are likely to conflict, and a conflict costs a rebase, a full check (about 11 minutes) and a fresh review.

CommitsFileWhy every change lands here
45src/http/server.tsone file wires every route and page
25docs/features/talk.mdone how-to for a feature built by many pulls
21src/web/pages/talk.tsone page module
19src/contract/openapi/routes/index.tsone list of every route
18test/pages-budget.test.tsone test holds every page's size ceiling as a number
18test/talk-page.test.tsone test file for the page
18src/http/api.tsone file for the API's routes
16src/web/pages/talk_client.tsone client script
15src/http/mcp.tsone file for the tools (60 open pulls conflicted here on 2026-10-25)
14scripts/v1-probe.ts, test/v1-probe.test.tsone list of probes
12docs/design/size-budget.jsonone file of ceilings
11src/web/render/renderers.ts, kinds.tsone registry of renderers
11AGENTS.md, docs/MCP.mdone index

What to build, in this order

  1. Ceilings stop being a shared number. Size ceilings (pages-budget, size-budget.json, the script and sheet pins) are edited by nearly every page pull. Either one small file per page or feature, or a merge rule that takes the larger number. Measure which the forge's own merge can honour.
  2. Registries are one entry per file. Routes (server.ts, openapi routes index, api.ts), tools (mcp.ts and its catalog), renderers, probes, widgets: a directory read at start, so two pulls adding two things never touch the same lines. server.ts first: 45 of 518.
  3. Append-only lists merge themselves. Indexes such as AGENTS.md, docs/MCP.md and the features index take both sides.
  4. The queue shows collisions before they happen. git merge-tree --write-tree tests two refs without a checkout, in milliseconds. For the open pulls, compute which pairs collide and in which file, and show it on the queue page and in one tool an agent can read: an order to land in, and "this pull collides with #N in <file>". Today each agent finds out by failing.
  5. Stacked pulls. A pull whose base is another pull, re-pointed at main when its parent lands, reviewed as its own diff.
  6. Check what main will be. Test the result of landing several approved pulls together, not each alone against an older main.

Done means

The same measurement a week after each step shows fewer commits per hot file, and the share of pulls that needed a rebase after approval falls. Record the before number first: it is not measured yet.

🤖 Generated with Claude Code

--- Sharpened scope (triage 2026-11-30): Split in four, one pull each: (1) src/http/server.ts (3524 lines, 45 of 518 commits) routes become one file per area read at start, (2) size ceilings (test/pages-budget.test.ts, docs/design/size-budget.json) become one small file per page, (3) append-only indexes (AGENTS.md, docs/MCP.md, features index) get a merge=union rule, (4) queue page and one MCP tool show "collides with #N in <file>" from git merge-tree --write-tree. Record the before numbers first.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs