███╗   ███╗ ██╗   ██╗  ██████╗ ███████╗ ██╗
████╗ ████║ ╚██╗ ██╔╝ ██╔════╝ ██╔════╝ ██║
██╔████╔██║  ╚████╔╝  ██║      █████╗   ██║
██║╚██╔╝██║   ╚██╔╝   ██║      ██╔══╝   ██║
██║ ╚═╝ ██║    ██║    ╚██████╗ ███████╗ ███████╗
╚═╝     ╚═╝    ╚═╝     ╚═════╝ ╚══════╝ ╚══════╝
DemoAcademyPricing
Sign inBook a meeting

Building the harness · August 17, 2026 · 7 min

Coordination state belongs in the database

If a run can suspend for three days waiting on a client, every piece of state that resumes it has to survive a deploy, a crash and a second replica. The rule is uncomfortable and simple: if losing it would park a run forever, it is not allowed to live in memory.

By Islam Hachimi, Founder

A dropped call is obvious. You notice immediately and you ring back. A message you never received is not obvious at all — it just looks like nobody had anything to say.

Software has the same two kinds of failure, and the second kind is the one that hurts.

Work waiting forever while everything it was waiting for finished
Everything finished. The main job never woke up. Nothing anywhere said so.

The failure that makes no noise

Most things going wrong are loud. A server falls over, someone gets paged. A page fails to load, a customer complains.

But consider a job that split into twelve smaller jobs and went to sleep until they finish. Something has to remember that it is asleep, and what it is waiting for.

Lose that, and the twelve small jobs still run. They still succeed. They still save their results. The main job simply never wakes up.

No error. No alert. Nothing in any log.

A job that failed is red on somebody's screen. A job that is asleep looks exactly like a job being patient. That is why this kind of problem survives for months.

Two completely ordinary ways it happens

You ship an update

The old version is replaced by the new one. Anything the old version was holding in its head goes with it. This is not a rare event — it is what happens every time you improve anything.

You get busier

This one is nastier because nobody changes a single line of code.

With one machine handling everything, keeping notes in its head works perfectly. Add a second machine to cope with more customers, and now the message saying "your twelve jobs are done" arrives at a machine that has never heard of them. It shrugs and does nothing.

Growth breaks the product. Nobody touched it.

Write it down instead

The rule we ended up with is uncomfortable and short: if losing it would leave work asleep forever, it does not get to live in memory. It goes in the database, where a crash, an update and a second machine cannot touch it.

That forces two habits which are good anyway.

Two things finishing at once must only wake the job once

If the last two small jobs finish in the same instant, both of them will notice everything is done and both will try to wake the sleeper. Get it wrong and the main job runs twice — producing two reports from one week's work, and a customer wondering why they got the same thing twice.

Written down properly, only one of them can win. The other checks, sees it has already happened, and leaves it alone.

Know the difference between "not started" and "was running"

When you ship an update, the system gets a warning and then gets shut down — usually within a couple of minutes. A real piece of work takes five or ten. So the shutdown cannot finish politely, and every update interrupts something.

What you do next depends entirely on a distinction most systems never make:

  • Was waiting in the queue and never started. Nothing happened. Nothing was sent. Nobody was charged. Put it back in the queue — running it now is the same as it having waited slightly longer.
  • Was actually running. It might have sent an email. It might have taken a payment. You cannot tell from the outside. Leave it stopped, explain why, and let a human decide.

Automatically retrying the second kind is how a customer gets the same payment reminder twice from the company that was supposed to be handling it — and nothing catches it, because the second one looks exactly like a first.

The question worth asking

For anything your system is holding onto: if this vanished right now, would anyone notice?

If the answer is "some work would wait forever and nobody would ever find out" — write it down.

Everything described here is in the kernel that runs Mycel — the scheduler, the wedges, the guards, and the tests that hold them.

Read the kernel →More writing →

Read next

  • Services are data, not codeA bookkeeping service in our system is a JSON manifest, a folder of markdown, and an output schema. No module, no deploy, no engineer. The consequence that matters is not speed — it is that domain expertise stops being something only a programmer can add.
  • Output schemas are completion contractsMost agent frameworks treat a schema as validation applied after the fact. Treat it instead as the definition of done — the run ends the moment a valid result is written — and three unrelated problems disappear at once: unbounded loops, unresumable runs, and work nobody can grade.
  • One config for every task is the original sin"Build a website for this business" and "decide the next step on this overdue invoice" are not the same job, and giving them the same tools, permissions and credentials is how an agent system becomes unsafe. Three shapes, and a build run that can never hold a send token.

Take the client you turned down last month.

Describe what you deliver and the first draft exists before you have finished your coffee.

Start 7 days free

The first AI delivery firm. You sign.

All systems operational

Ask an AI about us

  • Claude
  • ChatGPT
  • Perplexity

It reads the site and answers on its own. We do not get to edit what it says.

Product

  • What you get
  • Pricing
  • Changelog
  • What it runs
  • Free reports
  • Product map
  • Team
  • Blog
  • Glossary
  • AI Visibility Index
  • Sign in
  • Docs

Compare

  • vs ChatGPT, Claude, or whichever tab is already open
  • vs Grok Bot and the AI-employee platforms
  • vs Hiring an account manager
  • vs Profound
  • vs Otterly
  • vs Building it yourself
  • vs Zapier & n8n
  • vs Temporal
  • vs LangGraph
  • vs CrewAI & AutoGen
  • All comparisons

Legal

  • Privacy
  • Sub-processors
  • Terms
  • DPA
  • Security
███╗   ███╗ ██╗   ██╗  ██████╗ ███████╗ ██╗
████╗ ████║ ╚██╗ ██╔╝ ██╔════╝ ██╔════╝ ██║
██╔████╔██║  ╚████╔╝  ██║      █████╗   ██║
██║╚██╔╝██║   ╚██╔╝   ██║      ██╔══╝   ██║
██║ ╚═╝ ██║    ██║    ╚██████╗ ███████╗ ███████╗
╚═╝     ╚═╝    ╚═╝     ╚═════╝ ╚══════╝ ╚══════╝