tech, developers, and the code underneath

issue 239· essay·

The dependency you cannot upgrade

Every codebase has one. Here is how it happens and the four ways out, in order of cost.

Somewhere in your dependency tree is a package pinned to a version from years ago, with a comment saying "do not upgrade — breaks X." Nobody remembers what X was. The person who wrote it has left.

Every mature codebase has at least one, and it is always the one with a CVE.

how it happens#

A breaking change was too expensive at the time. The upgrade required touching forty call sites during a crunch. Deferred, reasonably. Then deferred again, and by version four the delta is a project.

You depend on undocumented behaviour. A bug you worked around, an internal attribute you reached into, an ordering guarantee that was never promised. The next version fixes the bug and your workaround breaks.

A transitive conflict. Two dependencies need incompatible versions of a third. One of them is unmaintained.

It was forked and patched. Someone vendored it, fixed something, and now you are on a divergent branch nobody can rebase.

It is genuinely abandoned. No release in four years, maintainer unreachable, and it works, so nobody has looked.

the four ways out#

1. Just upgrade it.

The option nobody tries, because the comment says not to. Try it anyway — in a branch, for an hour. A surprising fraction of these are stale: the incompatibility was fixed upstream two versions later, or the code that broke was deleted in 2023.

This costs an hour and resolves maybe a third of cases. Always do it first.

2. Isolate it behind an interface.

If you cannot upgrade, contain it. Wrap it in a thin interface you own, so exactly one file imports it.

python
# adapters/legacy_parser.py — the ONLY module importing oldparse
def parse_invoice(raw: bytes) -> Invoice:
    ...

This does not fix the CVE, but it converts "we depend on this everywhere" into "we depend on this in one file," which makes every future option cheaper — and makes the eventual replacement a single-file change rather than an archaeology project.

Do this even if you plan to fix it properly. It is an afternoon and it derisks everything after.

3. Fork it.

If it is abandoned but small, fork it, apply the security patch, publish it under your own namespace. You now own a dependency, which is a real ongoing cost, and it is bounded and known.

The test: is the package small enough that you could fix a bug in it? If yes, a fork is a reasonable permanent state. If it is a hundred thousand lines of cryptography, it is not.

4. Replace it.

The expensive, correct option. Made much cheaper if you did step 2 first, because the surface to replace is one interface rather than the whole codebase.

the decision#

Two questions:

Is it exposed to untrusted input? A pinned dependency doing internal date formatting is a maintenance annoyance. One parsing user-uploaded files is a security problem with a deadline.

Is it load-bearing? If it broke tomorrow, would you ship? That tells you the budget.

Together those give you four quadrants, and only one — exposed and load-bearing — justifies dropping other work.

the prevention#

Upgrade continuously. Automated dependency updates with a cooldown, merged weekly. One version at a time is a changelog; ten is an excavation.

Never depend on internals. If you are importing from a package's private module, reaching past an underscore, or relying on behaviour not in its docs, you have opted out of its compatibility promise. Wrap it and write down why.

Record why a pin exists.

python
# PINNED: oldparse 2.4.1
# 3.x changed date parsing to reject 2-digit years; our 2019 invoice
# archive contains them. Fix = normalise on ingest (INFRA-882).
# Reviewed 2026-10-28.
oldparse==2.4.1

Four lines. The difference between a pin someone can resolve and a pin that becomes permanent because nobody dares touch it.

Review pins quarterly. Same exercise as any other stale-decision review: is this still true? Half of them are not, and each one that is not is an hour of work and a CVE closed.

get README in your inbox

One dispatch, no noise. Tech and developer news, plus the occasional long piece on the craft.

subscribe →