Skip to content

About

Dependency-upgrade agent for Python: explores upgrade strategies in parallel Nebius Token Factory Sandboxes, repairs with NVIDIA Nemotron, ships one evidence-backed PR.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Upgradient

Explore breaking dependency upgrades in parallel sandboxes. Ship one tested migration with its evidence.

Upgradient is a dependency-upgrade agent for Python projects. Give it a pinned project and upgrade targets. It proves a green test baseline in Nebius Token Factory Sandboxes, then runs two or three upgrade strategies in parallel sandbox forks. Each one installs the targets, runs the full suite, and repairs what breaks with NVIDIA Nemotron. The best strategy that passes every gate is exported as a branch and a pull request, in which every claim names the sandbox operation or source behind it.

Built for the Nebius x NVIDIA Global AI Hackathon, Coding & Agentic Engineering track.

Results

Upgrade Outcome
httpbin, Python 3.6 → 3.12 with Flask/Werkzeug 3.1 (2018 lock) 67/67 tests on the rebuilt image, all 20 target advisories resolved. 24 application lines; 3 tests adapted and flagged. $0.36.
records, Python 3.6 → 3.12 with SQLAlchemy 1.2 → 2.0 39/39 tests, five chained SQLAlchemy 2.0 breakages fixed, no test changed. $0.70.
httpbin, Flask 1.0 → 2.0 on Python 3.6 Passed 4 of 5 runs, including one live on the judge site.

Running three strategies in parallel passed twice as often as one (4/5 vs 2/5) for about 2.6× the inference. The hardest target passed 1 of 2 runs on the final code; failed runs are reported as failed, with every path they tried. Run IDs and details: docs/evidence.md.

Why

  • 80% of application dependencies go un-upgraded for over a year, although 99% have newer versions (Sonatype 2026).
  • 95% of version upgrades contain at least one potentially breaking change (Endor Labs).
  • Bot PRs are accepted about half as often as human ones (37% vs 73%).

Bots bump versions and stop. The hard part is making the code work on the new version and proving it. More: docs/01-problem.md.

How it works

flowchart LR
    A[Pinned repo and runtime] --> B[Scan and plan]
    B --> C{Distinct strategies}
    C --> D1[Fork A]
    C --> D2[Fork B]
    C --> D3[Fork C]
    D1 & D2 & D3 --> E[Full suite · Nemotron triage]
    E --> F[Nemotron patch + review, bounded]
    F -->|re-test| E
    E --> V[Resolved targets · full suite · test integrity]
    V --> H[Branch · PR body · evidence tree]
    T[Tavily guidance] --> B
    T --> F
Loading
  1. Scan: inventory the lock, query OSV advisories, build the project in a sandbox, and run the full suite twice. No green, identical baseline means no exploration.
  2. Explore: strategies (a minimal fix, an API migration, a co-upgrade) fork the same saved image. For a new Python, the runtime is rebuilt first.
  3. Repair: Nemotron 3 Super triages failures and writes patches that cite migration guides found by Tavily. Nemotron 3 Ultra reviews every edit before it is tested and rejects fabricated output. Attempts, time, tokens and spend are bounded.
  4. Gate: rebuild the image from the exported lock and patch only, then check that the targets are installed, the full suite passes, the test inventory and assertions are unchanged, and the claimed advisories are gone.
  5. Export: rank eligible strategies (fewest test adaptations, then fewest changed lines) and write the branch, a PR body and an exploration tree of every path tried.

Test integrity is enforced in code. Patches cannot touch test files. A test may change only when a new test tool broke it, not the application. Ultra must confirm that, and a deterministic check overrules it when the failure is application output. The edit must come from a small catalogue (such as adding content_length=0 to a test-client call), keep every assertion identical, and pass on the old environment. Every such edit is flagged for the reviewer. Details: docs/02-product.md.

Nebius and NVIDIA

Service Role
Token Factory Sandboxes Every build, install and test run; parallel forks of saved images; operation IDs recorded before waiting, so a crashed run re-attaches
Nemotron 3 Super Failure triage, migration patches, test-harness adaptations
Nemotron 3 Ultra Confirms each "the test tool changed" claim; reviews every patch edit before it is tested (fails closed)
Nemotron 3 Nano / 3.5 Lightning Setup self-check; measured and rejected for triage (1/14 and 0/9 vs Super 5/6)
Tavily Migration guidance per failure, cached and cited with fetch times

The demo run used 36 model calls (690,981 tokens, an estimated $0.36) and 31 sandbox operations. Design: docs/03-architecture.md.

Try it

Judge site (URL and access code in the Devpost testing instructions). Every published run opens to its exploration tree, pull request and evidence JSON.

  • Replay (free): re-runs a recorded run on the current code from its recorded sandbox results and model replies, then plays it back at 5× speed.
  • Live run: the Flask 1.0 → 2.0 case in real sandboxes with real models, about 5–10 minutes. Capped at $0.50 a run, $1.00 a day and $5.50 in total.

Your own key (needs Sandboxes beta access for your Token Factory project; uv, and Docker for the Docker targets):

make setup         # .venv + dependencies; copies .env.example → .env
$EDITOR .env       # NEBIUS_API_KEY, NEBIUS_AI_PROJECT + NEBIUS_PROJECT_ID, TAVILY_API_KEY
make check         # keys, models, Sandboxes access, Tavily (make check-nospend: no paid calls)
make dev-wave      # scan, plan and run the Flask 1.0 → 2.0 case end to end
Command Does
upgradient scan --target dev Lock inventory, OSV advisories, baseline ×2 → plan.json
upgradient plan --target dev Candidate strategies for the wave
upgradient run --target dev Strategies in parallel → gates → branch, PR.md, tree.html
upgradient run --resume runs/<id> Restart a crashed run from its recorded operations and model calls
upgradient watch --run runs/<id> A run's progress, live or after the fact
upgradient report --run runs/<id> Re-render the PR and tree from recorded evidence
upgradient eval --target dev One strategy vs several, same inputs and budgets
upgradient usage Estimated inference spend and sandbox usage

--target demo (or make demo-wave) runs the Python 3.12 migration. make site serves the judge site (docs/deploy.md). Cases are pinned in examples/cases/.

Limitations

  • Two projects demonstrated, both from Pipfile.lock. Pinned requirements.txt files are supported but tested offline only.
  • Repair is probabilistic. Parallel strategies absorb some of the variance; the pass rates above hold for these cases only.
  • Review is a model judgement. In one failed run Ultra accepted an edit, covered by no test, that drops the host from client-supplied redirect URLs. The tree and PR show every reviewed edit.
  • Some test changes are out of scope: test-module import moves, fixture or conftest.py changes, and runner configuration. Such a strategy stops with its evidence.
  • Costs are estimates from logged tokens at list prices; sandbox figures come from operation records, not billing.
  • Not built: bisect, Ultra arbitration, a CRA report, later waves, --open-pr (ROADMAP.md).

Docs

Doc Content
01-problem.md Problem, evidence, landscape
02-product.md Commands, validation rules, PR evidence
03-architecture.md Components, repair loop, runtime migration, models, Sandboxes
evidence.md Runs, pass rates, evaluations, reviews
deploy.md Hosting the judge site
ROADMAP.md Built and planned
AGENTS.md Instructions for coding agents

License

Apache-2.0.

About

Dependency-upgrade agent for Python: explores upgrade strategies in parallel Nebius Token Factory Sandboxes, repairs with NVIDIA Nemotron, ships one evidence-backed PR.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages