ML.ai

Upgrade a package and fix what breaks

Name the dependency. ML.ai installs the new version, fixes the code it breaks, and runs your tests.

Who uses ML.ai for upgrades

Developers with a package a major version behind and no time for the changelog.

  • Teams with deprecated packages

    A dependency npm now warns about.

  • Developers facing a breaking change

    Removed imports that fail only at runtime.

  • Reviewers who want proof

    A bump that arrives with a passing test run.

An upgrade is done when the code still runs

Changing the number is easy. Here is what makes the change safe to merge.

A chat window sees one pasted file

It does not know your installed version, your lockfile, or what else imports the package.

It finds what the bump breaks

ML.ai knew current uuid drops the deep import require('uuid/v4'), so src/ids.js changed with package.json.

It checks the new API first

Before editing, it confirmed require('uuid') exports v4 in this CommonJS project. Then it ran the tests.

It sticks to the files it named

It listed the work and asked which parts to do. Going past that list took another OK.

Upgrading by hand versus handing it off

By hand

You bump the number, read the changelog, and find the broken import one error at a time.

With ML.ai

You name the package. ML.ai installs it, fixes what breaks, and runs your tests.

Which agent actually does this

Build · Read · Install · Edit · Run tests

Bumps the package and fixes the fallout

Installs the new version, edits what breaks, runs your tests, and asks before changing undeclared files.

architect · Read · Plan · Write

Optional: plan a large change

Read-only. Returns an ordered plan before Build edits anything.

From version bump to passing tests

The bump is one line. The work is the code it breaks.

1Name the packageSay which dependency and how far to go. ML.ai may ask which parts of the work to do.
2It installs the new versionnpm updates package.json and the lockfile together.
3It fixes what brokeIt confirms the new import works in your project, edits the code, and runs your tests.
4You review the changeThe summary lists every file touched and the test result.

Where upgrades go wrong

Three common failures, and what ML.ai did about each in a real run.

The import that no longer exists

A major version removes a deep import, and nothing fails until the code runs.

How ML.ai handles it

ML.ai switched src/ids.js to a named v4 import after checking it worked in CommonJS.

Upgrading blind

The version changes and nothing runs until CI or production.

How ML.ai handles it

ML.ai ran npm test after the change: 2 passed.

A lockfile out of step

package.json says one version and the lockfile pins another.

How ML.ai handles it

npm moved both together. The diff stat showed 3 files changed.

Where this stops

What to expect, so nothing surprises you.

01
01

It asks before starting

It listed install, fix and test, and waited for your pick.

02
02

Local tests only

It runs npm test on your machine. CI and staging checks are still yours.

03
03

Plan big changes first

For more than a few broken imports, get a plan from architect, then hand it to Build.

Root cause in session.ts

The store returns null before the session write finishes, so the middleware rejects a valid token.

session.ts+2 −1
40export async function getSession(id) {
41- const s = store.get(id)
41+ const s = await store.get(id)
42+ if (!s) throw new SessionNotFound(id)
AllowAlwaysDeny

Debug

Give ML.ai a failing test or a stack trace. It finds the actual cause and proposes a fix you approve.

Plan · move off the .ini loader

  1. 1Add a shared config interface
  2. 2Read environment variables behind it
  3. 3Remove the .ini loader

Nothing edited until you hand it to general

Hand to generalRevise

Legacy modernization

explore maps the old code, architect plans the path, and each stage lands as its own diff.

FAQs

What else does it change?

The lockfile, through npm install, and any source file whose import the new version broke.

Does it run my tests?

Yes. After the change, npm test ran: 2 tests, 2 passed.

Does it pick the version?

Ask for the latest major and it picks it (uuid 14.0.3 in the run). Name a version to pin one.

How is this different from modernizing legacy code?

This page covers version bumps and what they break. Modernize legacy code covers moving old code forward in stages.

Try ML.ai today, or talk to us about what is next

Install the editor agent on your own machine, or book a call to talk through your team’s workloads