A short update from the series on evidence-based agentic development.

We run our own package registry for our private npm packages and Rust crates, behind a login. It's one of the pieces of the stack we chose to own rather than rent, and it's part of what my Build Stuff talk is about. This is what owning it has cost, in two incidents a day apart.

The 404 that wasn't. On 16 October the release build for one platform asked the registry for a crate and got a 404. The sibling build had downloaded the same crate 23 minutes earlier. Nothing had been deleted. The storage layer had hiccuped for a moment, and our adapters turned every storage error into "not found". Cargo treats a 404 as final, so one blip failed a whole release job.

The fix is one rule: null means definitely absent. A real "no such blob" is a 404. Anything else that looks transient is retried, and if it still fails the registry answers 503 with a Retry-After, which cargo and npm both retry. A package manager believes what your registry says, so the registry mustn't say "doesn't exist" when it means "I couldn't look".

The burst. The next day about 25 Linux and Windows builds started together, and for around 110 seconds the registry hit its database connection limit across some 40 index and download requests. We already retried, but the window was about 8 seconds, and every retry ran out. Cargo got HTTP 500.

Three changes, each with a reason attached:

  • Cache the hot reads. Tokens and crate versions are held per instance for 30 seconds, the crate index lists for 5. Not longer: a build that pins a version published seconds ago has to see it. And only found results are remembered, so a version that doesn't exist yet never gets stuck as a cached miss.
  • Give connections back sooner. Idle connections now release after 2 seconds instead of 20, so idle instances free their slots inside the burst.
  • Retry for about 27 seconds, not 8. Cargo abandons a transfer slower than 10 bytes a second for 30 seconds, so waiting longer than that can't help.

The cache has a cost, and we wrote it down: a token revoked directly in the database can keep working for up to 30 seconds on an instance that already cached it.

One more thing, because it's the honest part. Five days later we reset our main branch to a release snapshot, and the reset silently dropped these fixes, along with two others, from the live line. We found out because we were checking, and re-applied all four. If a fix only exists in history, it doesn't exist.

The lesson I'd take for anything that sits underneath other people's builds is that the meaning of your errors is part of your API. 404 is final. 503 gets retried.

Talking about this at Build Stuff 2026

This is one of the write-ups behind my talk at Build Stuff in Vilnius this December, the 15th edition, under the theme The Age of Agency.

Control Your Fate at the Metal
Wednesday 2 December, 15:00, Zeta 2. 45 minutes.

If you're coming, say hello. If you're not yet, 2026SPEAKER_20 takes 20% off a ticket.

#BuildStuff15 #buildstuffconf #AgeOfAgency @buildstuffconf https://buildstuff.events

I'm Kent Alstad. I build KandiForge, a toolchain for running software projects with AI agents under an evidence-based process. If you run your own registry, I'd like to know what it taught you.