sensorloop

Metamodel

We believe every change path should be designed as a set of validation loops. Some loops are short and fast, like running unit tests on a change. Others take longer, like running end-to-end tests. Inner loops run while the work is being done, before anything is pushed to git. Outer loops run later: in CI, on staging, or even after the code has reached real users, like scanning production logs.

A change path from the work to real users. Inner loops (lint, unit tests) read their sensors before git push; outer loops (end-to-end tests, staging, production logs) read theirs after it. Every loop leads back to the work. git push work lint unit tests e2e tests staging prod logs inner loops, before the push outer loops, after the push
Figure 1. A change path with its inner and outer loops. Each loop reads its sensor at one point on the path and sends a failure back to the work; the later the point, the longer the loop and the more the failure costs.

A validation loop judges the quality of a change by reading a sensor, and improves the change when the sensor spots a problem.

A successful AI-first development process is built around designing the right loops: loops that do the checking for you. The right set of loops is different for every project and depends on its needs and constraints. It is always a trade-off. A loop costs time, money and attention, so it pays off only where the failure it catches is likely or expensive.

Sensor

A sensor is anything that observes a change, or the system the change lives in, and reports a signal about its quality: pass or fail, a score, or a list of findings. A sensor only observes. It never changes the work.

Sensors come in three kinds:

Examples:

Tool

A tool is what a sensor is built with. The sensor is what is measured; the tool is how. One sensor can be built with different tools, and one tool can serve several sensors. Choosing the sensors is a design decision; finding the tools is not.

A tool is described by the role it plays, so that its description holds in any project, whatever its stack. When the program behind the role depends on the stack, it is found in the project itself (its CI, its task file, its README) and never assumed.

Examples:

Loop

A loop connects a sensor to the work. It defines three things:

The loop repeats until the sensor passes, or until it gives up and asks for help. Where a loop sits in the change path decides how early a problem is caught and how much it costs to fix.

Examples:

Metaloop

The loops themselves are improved in a loop:

  1. Do the task.
  2. Notice which sensors or loops should have caught a problem (or caught it earlier), and improve them.
  3. Repeat.

For example, a reviewer finds the same mistake in a third pull request. Instead of fixing it a third time, add a lint rule or a test that catches it before review, at the earliest phase that can see it.