CanonBall

Guide / Verification and observability

Observability: letting agents see

An agent can build, verify and operate only what it can see inside, so the system is built to show every decision it makes.

What an agent can know

An agent starts each task with no memory of the system. What it knows about the running system is what it can read: the code, the canon, and whatever the system emits. When the system emits little, the agent can only form a theory from the code and change whatever the theory blames, which often removes a symptom and leaves the cause in place.

Observability is the degree to which what a system is doing inside can be told from what it emits, and it is the property that lets an agent replace a theory with a reading.

Why it needs investment

Many teams already invest in observability for operations. Where logs are thin, people have usually made up the difference with context carried from one task to the next, which an agent does not have. Agents build, verify and operate many times a day, and each task begins by looking at what the system did, so the process treats observability as part of the product and designs it with agents as its first readers.

What to build

  1. Every decision is logged. Each time the system decides something, it writes one line with the clause it applied and the inputs it used.
  2. One trace follows each request. A trace is the record of one request’s path, under one ID, through every adapter. An adapter is the code that touches the outside world.
  3. Agents have commands. The commands read logs, traces, metrics and state, and they replay a request.

Keeping the logic that decides apart from the code that acts makes the first rule cheap, because every input to a decision is already explicit.

The observe/ folder

The file observe/signals.md lists what the system emits: the decision log, the traces and the metrics. The folder observe/tools/ holds the commands agents run; in the refunds service that is one command, observe, which shows and replays the decisions for an order. The decision log is the signal they read most often; this entry is from the refunds service.

$ observe/tools/observe decisions --order 5512
REQ-012  refund window
  result        refused
  reason        day 31 of 30
  counted from  dispatch, 2 March
  delivered     4 March

The entry names the clause that was applied, the result, and the inputs the decision used, and here it shows the fault directly: the window was counted from dispatch, where REQ-012 says delivery. The on-call agent read this entry during incident INC-007, which Operate follows from the complaint to the repair.

One investment, three uses

The same tools serve three stations, and work the same way in a verification environment as in production.

  • At Build, the builder sees what its code does when it runs instead of inferring it from the source.
  • At Verify, the probes of a verification environment are these tools, and the verifier explains a failed check from the decision log and the trace.
  • At Operate, the on-call agent diagnoses an incident from them.

The same view for people

People read the same signals through the same tools. When the on-call agent reports “counted from dispatch”, it cites the log line and the trace, and the refunds owner can open both, so a person can check an agent’s evidence or diagnosis directly instead of taking it on trust.

Limits and cost

  • The tools are read-only in production. They change nothing there, and a replay runs in a verification environment.
  • No personal data is logged. Decision inputs can include names, addresses and card numbers, so signals.md lists the fields that may be logged: the order ID and the amount, never the person.
  • Signals are part of the interface. Agents and monitors depend on the field names, and a renamed field breaks them, so a change to signals.md is reviewed like a change to an interface.

Signals have to be designed and kept current, tools maintained and data stored. The expected return is that agents diagnose faster and are right more often on the first attempt; that return has not been measured, and open bets says how to test it. Under this method, a new decision that writes no log line, or a new adapter that joins no trace, is unfinished work.