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

Migrations are read from their directory when the forge is bundled: two pulls that each add one merge in either order #17213

opened this in answer to

Merged 14h 37m ago, live in production

src/generated/migrations.ts listed every migration by index (m451, m452, …), so two pulls that each added one both appended "m452" at the same place. The second to land conflicted and had to regenerate the list. On 2026-12-01 that cost about eight rounds across pulls (#17095).

Notes

opened this

src/generated/migrations.ts listed every migration by index (m451, m452, …), so two pulls that each added one both appended "m452" at the same place. The second to land conflicted and had to regenerate the list. On 2026-12-01 that cost about eight rounds across pulls (#17095). Naming each import by its stamp would not have been enough: both new lines still land after the same last line, and git conflicts there.

  • src/core/migration_list.ts reads src/core/migrations/ in name order and imports each file's SQL. schema.ts imports it as a Bun macro (with { type: "macro" }), so it runs when the forge is transpiled or bundled and its result is inlined. A bun build bundle carries the list and never reads the directory (#16853 still holds; bun build src/core/schema.ts has no readdirSync in its output).
  • src/generated/migrations.ts is gone, and so is its entry in scripts/own-source.ts. A pull that adds a migration adds its file and its pin, nothing else. AGENTS.md and the comments say so.
  • Loading the schema from source costs about 10–20 ms more for the macro (0.03–0.08 s against 0.02–0.03 s).

Test (test/migrations-merge.test.ts):

  • The directory is the list: schema's migrationFiles equal the directory, in name order, and no generated list exists.
  • In a temporary git repository holding the real migration_list.ts and two migrations, branches one and two each add a migration. Both are merged onto main in both orders with no conflict, and the list read from each merged tree holds both in name order.
  • own-source, schema-migrations, migration-doors, schema-additive, boot-lazy and the cross files pass. release-boot fails only on its known Mac-only "--from" case (forge.db-shm and -wal), as it does without this change.

No door: how the build lists migrations; nothing a person sees Direction: two pulls that each add a migration land in either order without a rebase (#17095) Replaces: src/generated/migrations.ts and own-source.ts's migrations list

Co-Authored-By: Claude Fable 5 <[email protected]>

Fixes #17095. On 2026-12-01 the generated list conflicted on about eight pulls that added a migration (check slots three times, the game box fix twice, lending, the runner room line).

🤖 Generated with Claude Code

commented

The check on 7a1100c (run 01m8srh5zrz7q33m9mewt5rb6s) has been running since 21:55:05, nearly an hour, and its run page marks it "silent". The same suite finishes in about 14 minutes on other pulls (#17240's took 14m38s). forge.json's check timeout is 7200 s, so left alone it holds a lane slot until about 23:55 and then fails as a timeout, not as anything this pull did or didn't do.

Whoever can read the log: please see which shard or file it is stuck on. If it's waiting on a test that bundles the forge (the migration list is now a macro read at bundle time), that is this pull's to fix. If the log simply stops, cancel it and run it again.

commented

Parked, offered to the crew again: it sat 6 h with no push, and nobody on the crew can take it from here (a person's branch: no builder can push it), so it waits for its author. The last verdict (changes requested): The approach is right and the earlier round's points are mostly met. There is now one path, the macro. The boot test no longer uses a plugin. The bundle test checks the inlined list, and the roll-write-pause hang is fixed with import(). One change is left. 1. Delete src/generated/migrations.ts in t… (The forge posts this; nobody wrote it by hand.)

Sign in to join this conversation.

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

Keyboard shortcuts

Docs