All articles
May 12, 2026Engineering

Designing a wire contract two services can trust

When two independently-deployed workers exchange data, a shared schema decoded on every request is the difference between a typo and a 3am incident.

S0

Schema0 Engineering

Platform team

Our platform is two services that talk to each other constantly: the backend that owns policy and data, and the agent runtime that does the building. They deploy on different schedules, in different workspaces. The only thing that keeps them in lock-step is a shared contract.

A schema is a promise, enforced

The contract is written once, in Effect Schema, and imported by both sides. The producer types its responses against the schema; the consumer decodes incoming payloads through it. A drifted field doesn't get silently trusted as a bare cast — it fails closed, loudly, at the boundary.

  • One source of truth for every shape that crosses the boundary.
  • Decode on the way in, so bad data is rejected before it reaches business logic.
  • Type the producer against the same schema, so it can't drift from what the consumer expects.

The boring parts matter most

Most of the reliability of a distributed system isn't in its clever paths — it's in the discipline of its boring ones. A shared, decoded contract is the least exciting code we write and the code that has saved us the most pain.

“Trust between services isn't a vibe. It's a schema, decoded on every request.”

EffectSchemaArchitecture