109. Loop Engineering 3 - Goals a Loop Can Actually Test

Turn a wish into a stop condition a machine can evaluate, and refuse the goals that cannot be tested.

By Jacques Botte, founder of Toptronic®. Last updated 17 October 2026.

The lesson

A goal a loop can act on is a statement that can be TRUE or FALSE at a moment in time, evaluated by something other than the model's own opinion. All tests pass. The response parses as JSON with these four keys. The file exists and its hash matches. The invoice total equals the sum of the line items. Notice that each one names an observable, a comparison and a threshold - and none of them says better or cleaner or more professional.

The temptation is to write the goal you actually want, because it is the honest description of the job: make the onboarding copy warmer. That is a fine brief for a person and a hopeless stop condition for a loop, because nothing can say when it has been reached. The engineering move is to translate it into two parts: an observable proxy you can measure, and a human review step at the end. The loop drives the proxy; the person decides whether the proxy was the right question.

Prefer goals that are cheap to check and hard to fake. A unit test is cheap and hard to fake. A rubric scored by the same model that wrote the text is expensive and easy to fake, and it will converge on whatever the scorer likes. If you must use a model as the judge, give it a fixed rubric with explicit failure examples, ask for a verdict and a reason, and spot-check its verdicts against a person's for a sample - otherwise you have built a loop that optimises for the judge, not for the job.

Write the goal with its tolerance. Exactly zero failing tests is a fine goal on a small suite and an impossible one on a legacy suite with twelve known flakes, where the real goal is no NEW failures. State which failures count, which are excluded and why, and the loop can then stop honestly instead of thrashing on a known-bad test at two in the morning.

One more discipline, learned the expensive way in this project's own history: a goal must not be satisfiable by editing the check. If the loop can modify the test, the schema or the assertion that evaluates it, the cheapest path to a green result is to weaken the check. Keep the verifier outside the loop's write scope, or the loop will eventually discover that it is allowed to grade its own homework.

Check yourself

Question 1: Which of these is a goal a loop can actually test?
  1. Make the copy warmer and more professional
  2. The response parses as JSON with the four required keys — correct
  3. Improve the architecture
  4. Reduce technical debt

Answer: The response parses as JSON with the four required keys

It names an observable (the response), a comparison (parses) and a threshold (four required keys). The others cannot be true or false at a moment in time.

Question 2: Why must a verifier stay outside the loop's write scope?
  1. Because it runs faster there
  2. Because a loop that can edit its own check will weaken the check to pass — correct
  3. Because tests must be in a separate language
  4. Because the model cannot read tests

Answer: Because a loop that can edit its own check will weaken the check to pass

If the cheapest path to green is to edit the assertion, that is the path the loop will find. The check has to be out of reach.

Question 3: What should replace a goal like 'make the onboarding copy warmer'?
  1. Nothing - the loop can work on it directly
  2. An observable proxy the loop can drive, plus a human review at the end — correct
  3. A higher temperature
  4. A longer prompt

Answer: An observable proxy the loop can drive, plus a human review at the end

A wish becomes engineering when it is split into something measurable and a person's final judgement.

← Previous lesson · All 134 lessons · Next lesson →

The full course — 134 lessons and 402 quiz questions — ships inside the app. Get TPEE to study it offline.

This lesson is the written summary of a course that ships inside the TPEE prompt editor for Windows - thirteen sections, a 0-100 score before you send anything, and it works with no network connection. The three one-time prices, and a 14-day free trial.