Skip to main content
All articles

How we decide

AI agents make code cheap and decisions expensive. Eight decisions from one week, each with what we measured, what we chose and what would change our mind.

Cato8 min read

Most of our code is written by AI agents. That makes code cheap and decisions expensive: an agent will happily build whatever it is pointed at, quickly and well, including the wrong thing. So the part of the work that is still ours is deciding what to build, what to measure first, and what to leave alone.

This is a log of those decisions, written for people rather than for the repository. Every entry walks the same five steps:

flowchart TD
  Q["The question"] --> O["What we could<br/>have done"]
  O --> M["What we measured"]
  M --> C["What we chose"]
  C --> W["What would change<br/>our mind"]

The last step matters most. A decision without it is an opinion with a date on it.

These are the decisions from one week in November.

#The decision, in one line
1The git server gets its own small machine
2One check per change, enforced by the gate
3Seventeen shared packages in one repository
4Photos go to file storage, not the database
5Measure before you rewrite
6Each repository is labelled light or heavy
7When a check fails everywhere, look at the check
8Not paying to make a number go away

1. Where our git server lives

The question. GitHub stopped running our checks and deploys. We needed our own server to hold a copy of the code and hand out work.

What we could have done. Put it on the server that already runs our apps, which is free since it already exists, or rent a separate small one.

What we measured. The app server was already the busiest machine we have. A git server that slows down when an app is busy, or an app that slows down when someone pushes, couples two things that should fail separately.

What we chose. A separate small server in Nuremberg, running Gitea. A few euros a month for the git server to fail on its own, not together with every app.

What would change our mind. If GitHub runs our checks again, the Nuremberg server becomes a spare. We keep it either way, because a copy of the code that GitHub does not hold is worth a few euros.


2. One check per change

The question. Our automation had grown to 2,100 runs a day while the real work was 144 merges a day. How do we keep it from growing back?

What we could have done. Write the rule in a document, or put it in the gate every change has to pass.

What we measured. Every one of the timers and chains that caused the growth had been added by an agent solving a local problem. None of them read a document first.

What we chose. The rule lives in the merge check itself. A pull request that adds a timer, a merge sweep, or a second check after merging is refused, unless its description says why in one line. (The full story.)

What would change our mind. A real need the rule blocks more than twice. Then the rule is wrong, not the need.


3. Seventeen shared packages, one repository

The question. Our apps share 17 small packages: chat, payments, maps, rate limits, AI calls and more. Each lived in its own repository.

What we could have done. Leave them apart, or move them into one.

What we measured. A fix to one package often needed a change in another, as two pull requests in two repositories that had to land in the right order. Seventeen repositories also meant seventeen sets of checks.

What we chose. One repository, kits, with all 17 packages, moved with their full history.

17
packages, one repository
934
commits carried over
277
release tags, all of them
1
check across everything

A change that touches two packages is now one pull request.

What would change our mind. If one package starts releasing at a very different pace from the rest, it can move back out. Its history comes with it.


4. Photos belong in file storage, not in the database

The question. Our nightly off-site backups started failing.

What we could have done. Pay for more backup space, or find out what was filling it.

What we measured. Solon, our public statistics and law platform, stored its place photos inside its database. Every night the backup copied the whole database again, photos included, until it hit the free storage limit.

What we chose. Photos move to file storage built for exactly that, and the database backup skips them. The backup is again the size of the data that actually changes.

What would change our mind. Nothing here, really: databases are for records, file storage is for files. The only open question was why we had mixed them.


5. Measure before you rewrite

The question. An AI review of Solon suggested its law texts were full of old, superseded copies and should be rebuilt to save space.

What we could have done. Do the rewrite, which sounded reasonable and would have taken a day.

What we measured. 1.26 million provisions in 75,110 versions, 1.74 GB in total.

97%
is law in force today
50 MB
superseded text, of 1.74 GB
57
exact duplicates

What we chose. No rewrite.

The review was a guess. The measurement took minutes.

What would change our mind. If old versions start growing faster than current law, which the same query will tell us.


6. Which machine checks what

The question. Without GitHub's machines, checks run on a laptop. When the laptop is closed, nothing merges.

What we could have done. Rent a big machine, hope for a free one, or find out what the small server we already have can carry.

What we measured. The full check of 25 repositories, one at a time, with time and peak memory.

Can the small server check it?
repositories05101520FitsBorderlineToo heavy

What we chose. Each repository is labelled light or heavy. The small server takes light jobs, and the laptop takes both. Anything unlisted counts as heavy, because guessing low is how a check takes the server down. (How the cascade works.)

What would change our mind. A free machine large enough for the heavy ones. We have asked Oracle for one about 150 times so far.


7. When a check fails everywhere, look at the check

The question. For five days, every pull request to Loki failed its check, and nothing merged.

What we could have done. Skip the two failing tests to get things moving again.

What we measured. The same 2 of 639 test files failed on every pull request, whatever it changed. A failure that does not care what changed is not about the change.

What we chose. Fix the setup and the test, and skip neither. Both tests guard real failures we had in production; disabling them would have hidden the next one.

Under the hood: the two tests
  • The first compared the code against the last release tag. Our new setup downloaded the code without its tags, so there was nothing to compare against. The fix was in the setup, so the tags come along.
  • The second used a folder name as an example of "a folder that cannot exist here". On the laptop that now runs the checks, that folder existed. The fix was in the test itself.

Neither failure said anything about the pull requests it blocked. Both said something about the new machines running them.

What would change our mind. Nothing. A test that fails for the wrong reason needs fixing, not silencing.


8. Not paying to make a number go away

The question. Even after we emptied the backup storage, it still refused uploads: "storage cap exceeded".

What we could have done. Raise the cap, which costs money and takes one click.

What we measured. The storage was empty: zero files. The provider's own reports say they are updated once a day, at midnight GMT. Our best explanation is that the cap still reads yesterday's number.

What we chose. Wait for midnight.

What would change our mind. If tomorrow's backup fails anyway, we look again, still before paying.

Update, 21 November. We were right. The backup that night created a fresh store and saved 14.9 GB of database copies as 3.2 GB, well under the free limit. Nothing needed paying for.


Two decisions still open

  • A website as data. Today every customer site we build gets its own repository and its own deploy. We think a site should be a row of data, served by one shared engine, and that only real applications should get their own code. Since this log was first written, the plan has been accepted and the engine built; nothing is served from it yet. The customer path it enables.
  • A generic core and specialised edges. OrangeCat stays general: accounts, payments, reputation. Specialised apps for law or medicine plug into it through one account, shared place codes and verifiable credentials, and their sensitive data never crosses over. Written as a proposal, not built.

We will write about both once they exist, not before.


bitbaum builds OrangeCat, Loki, Solon and Heidi in public. If you would have decided any of these differently, tell us. That is what the log is for, and the door is open.

Discussion

Sign in to join the conversation.

Loading comments…