specagentcodetestsThe same loop as in Kubernetes
Kubernetes is a system that runs services and keeps them working on many servers. Its main idea is simple: a person describes how things should be (“keep three copies of the service”), and a supervisor program, the controller, keeps comparing the description with what really exists and fixes the differences. That is the reconcile loop. For specs the same scheme works: a person sets the desired state, and an agent can bring the code to it.
The desired state here is the aggregate dictionary: one entry per concept, requirements marked MUST and SHOULD.
How to read the picture. The four columns are the four roles of the loop, the two rows are two systems, and the third row puts the terms into plain words. The desired state (filled in) is what a person changes. In Kubernetes that is the chart and the manifest: files that say which parts of a service must run and how many. In specs it is the aggregate dictionary with the words MUST (“required”) and SHOULD (“recommended”). The actor brings the actual state to the desired one: in Kubernetes the controller, in specs the agent. The actual state is what exists now: nodes (servers) and pods (the parts of a service running on them), or the code. The measure shows whether they match: probes (short automatic “are you working?” checks) and metrics, or tests and quality checks. The arrow down at the top means a person changes only the desired state. The loop arrow at the bottom means the measurement goes back to the actor, and so on until they match. Example: a person writes in the dictionary “a booking closes after 15 minutes”, the agent changes the code, tests check it, and a red test sends the agent back to the code.
The reconcile loop follows the Kubernetes docs on controllers.
A check sees only what was put into it
A check shows only what was put into it. In Kubernetes a probe is a short automatic request to a service: “are you responding?”. If the service answers “200” (the success code), the probe is green even though the service may not be doing the main thing: say, the order queue is stuck. In specs it is the same with tests. If a requirement has no test, all the tests stay green and nobody notices the requirement is not met.
The example is the meeting room booking from Specs by aggregate: three MUST requirements and one SHOULD.
the service answered “200: working”probeorders are not being processednot checkedMUST · bookings of one room do not overlaphas a testMUST · booking status moves only forwardhas a testMUST · without confirmation a booking closes after 15 minutesno checkSHOULD · confirmation arrives in the same channela person looksHow to read the picture. On the left is Kubernetes: the probe got the answer “200: working” and is green, but orders are not being processed, so the probe did not check the main thing. On the right are specs, using a meeting-room booking: three MUST requirements and one SHOULD. Two MUSTs are covered by tests (bookings do not overlap, status moves only forward). The third, “without confirmation a booking closes after 15 minutes”, is checked by nobody. A person reviews the SHOULD about the channel. 2 of 3 MUSTs are covered, that is 67%. The three rules under the diagram: every MUST has its own check; a MUST without a check counts as a gap to close; a green result does not yet mean everything is correct.
Which probes exist and what they check: Kubernetes: probes.
The environment decides whether the loop closes
The loop closes only if the actor has everything needed for comparing. A Kubernetes controller works because the cluster gives it access to all it needs. For an agent this environment is called the harness: the surroundings it works in, with programs, permissions and checks.
The six capabilities in the picture are what an agent needs to close the loop, and what happens without each. Without code execution the agent guesses how the program works. Without tests a MUST cannot be checked. Without logs it is not visible what exactly broke. Without test data the check runs on an empty database and shows nothing. Without services through MCP, integrations are checked blind. Without a sandbox (an isolated place where it is safe to try and break things) it is scary to let the agent act. If some capability is missing, the loop is open at that point.