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 #17029

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

This pull does part (2) of the triage split: page ceilings are now one small file per page, so two pulls on two pages no longer edit the same lines. It does not do parts (1), (3) or (4), and the "before" numbers are not recorded yet. What moved where Byte ceilings.

Notes

opened this

This pull does part (2) of the triage split: page ceilings are now one small file per page, so two pulls on two pages no longer edit the same lines. It does not do parts (1), (3) or (4), and the "before" numbers are not recorded yet.

What moved where

  • Byte ceilings. docs/design/size-budget.json is now docs/design/size-budget/<page>.json, one file per page holding {page, js, css}.
    • / is home.json.
    • /:owner/:name/pulls/:number is owner-name-pulls-number.json.
    • readCeilings, writeCeilings and ceilingFile are in src/measure/client_size.ts.
    • test/client-size.test.ts and scripts/client-size.ts use them. Both still raise a ceiling with FORGE_SIZE_WRITE=1.
    • The CLAUDE.md and scripts/test_honesty.ts mentions of the old file are updated.
  • Work ceilings. The HEAVIER table in test/pages-budget.test.ts is now test/budgets/pages/<page>.json, one file per page. Each file carries the page's pattern, statements and git counts, plus the old "why" comment. test/helpers/page_budgets.ts reads them.
  • Behaviour. No numbers changed.

bun test test/client-size.test.ts, bun test test/pages-budget.test.ts, test/unused-exports.test.ts, tsc --noEmit and bun scripts/gate.ts --explain pass here. The full suite is left to the forge's check.

What I left out

  • MAX_UNFIXTURED. It is still one number in test/pages-budget.test.ts. A count of what has no fixture has no per-page home. It could be derived from a list of unfixtured patterns instead; that is a separate change.
  • merge=union for AGENTS.md and docs/MCP.md.
    • The forge's own merge already keeps pure additions from both sides (src/git/union.ts, used by merge.ts and combined.ts).
    • AGENTS.md is long single-line paragraphs, so a git union driver would silently duplicate text when two pulls edit the same paragraph.
    • Over the last 7 days AGENTS.md was touched by 8 commits and docs/MCP.md by 6, so they are not hot.
    • The features index, threats and design sections are already one file per entry.
  • server.ts, mcp.ts, the openapi routes and the queue's "collides with #N in <file>". Each is its own pull.
  • The "before" measurement. I did not record the before-numbers the issue asks for first.

Try it

  • FORGE_SIZE_WRITE=1 bun test test/client-size.test.ts rewrites only the page files whose bytes moved.
  • To raise one page's work ceiling, edit its file under test/budgets/pages/.

Direction: split the files every pull touches (#16331).

🤖 Generated with Claude Code

Closes #16331

commented

This pull does part (2) of the triage split: page ceilings are now one small file per page, so two pulls on two pages no longer edit the same lines. It does not do parts (1), (3) or (4), and the "before" numbers are not recorded yet.

What moved where

  • Byte ceilings. docs/design/size-budget.json is now docs/design/size-budget/<page>.json, one file per page holding {page, js, css}.
    • / is home.json.
    • /:owner/:name/pulls/:number is owner-name-pulls-number.json.
    • readCeilings, writeCeilings and ceilingFile are in src/measure/client_size.ts.
    • test/client-size.test.ts and scripts/client-size.ts use them. Both still raise a ceiling with FORGE_SIZE_WRITE=1.
    • The CLAUDE.md and scripts/test_honesty.ts mentions of the old file are updated.
  • Work ceilings. The HEAVIER table in test/pages-budget.test.ts is now test/budgets/pages/<page>.json, one file per page. Each file carries the page's pattern, statements and git counts, plus the old "why" comment. test/helpers/page_budgets.ts reads them.
  • Behaviour. No numbers changed.

bun test test/client-size.test.ts, bun test test/pages-budget.test.ts, test/unused-exports.test.ts, tsc --noEmit and bun scripts/gate.ts --explain pass here. The full suite is left to the forge's check.

What I left out

  • MAX_UNFIXTURED. It is still one number in test/pages-budget.test.ts. A count of what has no fixture has no per-page home. It could be derived from a list of unfixtured patterns instead; that is a separate change.
  • merge=union for AGENTS.md and docs/MCP.md.
    • The forge's own merge already keeps pure additions from both sides (src/git/union.ts, used by merge.ts and combined.ts).
    • AGENTS.md is long single-line paragraphs, so a git union driver would silently duplicate text when two pulls edit the same paragraph.
    • Over the last 7 days AGENTS.md was touched by 8 commits and docs/MCP.md by 6, so they are not hot.
    • The features index, threats and design sections are already one file per entry.
  • server.ts, mcp.ts, the openapi routes and the queue's "collides with #N in <file>". Each is its own pull.
  • The "before" measurement. I did not record the before-numbers the issue asks for first.

Try it

  • FORGE_SIZE_WRITE=1 bun test test/client-size.test.ts rewrites only the page files whose bytes moved.
  • To raise one page's work ceiling, edit its file under test/budgets/pages/.

Direction: split the files every pull touches (#16331).

🤖 Generated with Claude Code

commented

Pushed: this round meets the three requested fixes and the smaller points. The new test file passes, tsc is clean, and the gate reads 32 rules with none failing. test/client-size.test.ts and test/pages-budget.test.ts pass. I didn't run the rest of the suite.

What changed

  • Doc wording. CLAUDE.md item 3 now reads "One file per page in docs/design/size-budget/ holds each first page's…" and says the command writes one file per page. The scripts/test_honesty.ts header says "the per-page files in docs/design/size-budget/".
  • heavierPages and readCeilings. Both now throw on a malformed file or a duplicate pattern instead of dropping or overwriting it.
    • heavierPages needs a string pattern and a numeric statements or git.
    • readCeilings needs a string page and numeric js and css.
  • New test. test/page-budget-files.test.ts covers:
    • a temporary directory, including a file with no statements yielding no key;
    • a malformed file and a shared pattern or page, for both readers;
    • every committed file under test/budgets/pages/ and docs/design/size-budget/, each with a unique key.
  • Smaller points.
    • The imports in src/measure/client_size.ts now sit below the doc comment.
    • scripts/client-size.ts uses fileURLToPath.
    • settings-capacity.json has a why. I wrote it as "reads the machine, the app roster and the meters once each; constant in the number of apps". I didn't check it against the code, so please look at it.
  • Linked issues. I opened #17035 (MAX_UNFIXTURED), #17036 (server.ts) and #17037 (queue collisions). I did not link them to #16331 with the dependencies API.

Before number (point 1) The issue's own 7-day table to 2026-11-24 is the baseline. It has test/pages-budget.test.ts at 18 commits and docs/design/size-budget.json at 12. I re-ran the count on origin/main for the 7 days to today, 2026-12-01. The top files are:

CommitsFile
39src/http/server.ts
28docs/features/talk.md
25src/web/pages/talk.ts
22test/talk-page.test.ts
22src/web/pages/talk_client.ts
21src/http/api.ts
21scripts/unused-exports-allow.json
20test/pages-budget.test.ts

test/pages-budget.test.ts is the number this pull should move. Re-run the same count a week after merge. After merge, the 20 for pages-budget should become a handful of single-page files, and size-budget.json should stop appearing in the list.

I didn't touch the four failure patterns the check named. This pull doesn't reach them: no dead exports, no as never, no new during jobs, and no change to the capacity screen.

🤖 Generated with Claude Code

Sign in to join this conversation.

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

Keyboard shortcuts

Docs