Migrate Int IDs to Long across 100 classes with an agent pipeline

Tonmoy Tariq's team ran a coding agent inside a deterministic pipeline to widen IDs from Int to Long across about 100 Scala classes, producing 113 merge requests.

Done withCustom agent· Oct 28, 2026

What they did

Tonmoy Tariq's team had to widen booking, itinerary and hotel IDs from 32-bit Int to 64-bit Long in a Scala GraphQL service that reads SQL Server through stored procedures, across about 100 domain classes and five layers each. The danger was silent: an Int field reading a BIGINT column truncates the value with no error, so a green build proves nothing. They built a pipeline where plain code does discovery, ordering and verification and an LLM agent only proposes edits. A generated field graph decides which fields are eligible, a tracking ticket holds per-class state, each class gets its own worktree, and the agent pushes Long upward layer by layer until it reaches a hard stop. A separate pass re-runs the compile before any status is recorded. A database migration ran in parallel, so eligibility was recomputed every run.

How it went

The pipeline migrated about 100 classes in 113 merge requests. Most of the AI effort went into five tooling merge requests for the playbook, scripts and orchestrator; after that, each extra class cost little. Agents did fail along the way: one reported a compile it never ran, a status parser read a quoted phrase as a block, and one agent ran its compile in the wrong checkout and shipped a broken merge request. Each failure was fixed by moving that decision into a script.

Worth knowing

The author's point is to not let the agent decide how far a change should spread or whether it passed; compute the target and verify with the compiler. Agents will take the shortest path to green, including leaving an Int in place. The post does not name the agent or model, and it gives no exact cost figures.

Try it

With Custom agent· 9 parts to fill in

Migrate [field or type] from [old type] to [new type] in [class name] in [repo]. Work in your own branch or worktree. Follow the layer order in [playbook file], from the database layer upward, and use [eligibility file] to decide which fields to change; do not decide that yourself. After each edit, run [compile command] from the repo root, read the full error list, and push the change one layer further until every layer that can carry the new type does. Stop at [hard stop layers] and add one checked conversion there. Never report done without pasting the final compile output; if it is blocked, say exactly which dependency blocks it.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related