CanonBall

Guide / Verification and observability

Verification engineering

When agents write the code, most of the engineering effort is expected to go into verification: deciding what counts as evidence for each clause, and building the environments that produce it.

Where the effort goes

An agent produces a change quickly, but nobody can tell from the change alone whether it is right. Establishing that is expected to take more effort than writing it, and the work is called verification engineering: deciding, for each clause, what would count as evidence; building the environments that produce it; and keeping the evidence trustworthy as the system changes.

Engineered, and designed with a person

Agents produce most of the evidence, so the process gives them environments that are engineered and designed with a person, because people can trust evidence only if they understand how it is produced.

An engineered environment is part of the product: it has a design, known limits and defects of its own, and it is reviewed, versioned and repaired like the code it tests. Designing it with a person means that someone can state, for any clause, what was real in the test, what was faked, which failures were tried, and what the environment could never have shown. Agents can generate passing checks in large numbers, and those checks become evidence only when a person can give that account of them.

That person is the verification lead, who works with the verifier agent at two stations. At Shape they agree the evidence plan before any code exists: what will count as evidence for each clause, and which environment produces it. At Verify they build the environment, the checks and the injected faults. Which of the two drafts the design is the team’s choice, but in every team people decide what counts as evidence and review any change that would weaken an environment.

What a passing suite leaves open

A passing test suite establishes that the tests passed. An agent deciding whether its work is finished, and a person deciding whether to accept it, need more, and CanonBall records each answer in a fixed place.

Question Where the answer is recorded
Which promise is each test evidence for? Every check names the example it encodes.
Could this test ever fail? Every check keeps a run in which it did.
What did the test assume about the outside world? Assumptions are listed in the assurance case.
Which promises have no test at all? The Verification Record shows them as unsupported.

The assurance case: one per clause

An assurance case, or case, connects a clause to its evidence. The idea comes from safety engineering, where a claim about a system is supported by a structured argument as well as by test results.

An assurance case splits a clause into parts and argues that the parts are enough.

A case splits the clause into parts that can each be checked, names as assumptions whatever depends on the outside world, gives every part a method and an environment, and ends with an argument for why the parts, taken together, are enough.

The argument is where gaps are usually found. A verified move gate and a fast sensor do not add up to “no robot moves near a person” until braking distance and sensor blind spots are also accounted for, and writing the argument down is how someone notices that they were left out.

The weakest dependency decides the method

How a part is verified follows from one question: what must be true outside the decision logic for the claim to hold? The answer places the part at a verification level.

Level The claim depends on Method For software alone
0 Pure logic Model checking, proof Decision logic with no side effects
1 Concrete code Property-based tests Code run against fakes
2 Components interacting over time Simulation, scripted scenarios Real processes and a local database
3 Real devices, drivers, latency Tests on real hardware Real infrastructure, a staging system
4 Physics, materials, people Measurement, field data Production traffic

The levels resemble the test pyramid, except that the pyramid sorts tests by size and the levels sort claims by what they depend on. A level is not a measure of confidence: a narrow proof about an abstract controller can leave a larger gap than a well-designed physical test.

As an environment becomes more realistic, you control less of it.

Control over an environment falls as its realism rises. At level 1 a test can freeze time and hold a race condition open; on real infrastructure it can only wait for the race. Timing faults are therefore best caught at the low levels and only observed at the high ones.

Tiers: how much rigor

A full case for every clause would cost more than most clauses justify. Safety standards scale rigor to criticality, and CanonBall does the same.

Tier Which clauses The case A person reads the argument
0 Most. Logic with no side effects One part, generated No
1 Some. Clauses that cross a side effect A few parts and a short argument No
2 Safety, money, irreversible actions A full argument, assumptions with treatments Yes

In the refunds service, INV-004 (a refund is never issued twice for the same order) concerns money, so it is tier 2. Its case names one assumption, ASM-011 (the payment gateway pays at most once per request key), and the verification lead reads its argument.

The procedure for one clause

  1. Split the clause into logic, assumptions and measured outcomes.
  2. Argue why those parts establish the clause as deployed.
  3. Place each part by its weakest dependency and choose the method.
  4. Treat each assumption: how it is watched, how fast a failure shows, and what happens then.
  5. Decide whether the evidence is enough, against the policy.
  6. Move the boundary. If a part will not verify because the logic lives in the wrong place, move the logic. If it depends on the world, make that an assumption and give it a treatment.

The sixth step can be misused: moving logic to where it can be checked is progress, whereas relabeling a hard problem as an assumption hides it. The Record keeps the two apart by showing every assumption as an assumption.

What a proof does not give you

A proof shows that the logic satisfies a property for every input. It leaves four questions open: whether the property is the right one, whether the world behaves as assumed, whether the parts are enough, and whether the code matches the model that was proved. Examples, treatments, the argument, and checks against recorded behavior address those four in turn, and the Record shows “proven” only together with its property, model, bounds and assumptions.

What a case depends on

Every case lists the code its clause depends on. When that code changes, the clause shows as unknown until the case is checked again, by the mechanism described under evidence. Explaining a failed check also requires seeing inside the running system, the subject of observability.