# I Wrote a Loop That Could Run Forever.

> A build loop with a 9 out of 10 quality gate and a backlog that never shrinks has no fixed point. How Offer City got built, and what bounded it.

- Canonical URL: https://justinbartak.ai/blog/i-wrote-a-loop-that-could-run-forever
- Author: Justin Bartak, Chief AI Officer (https://justinbartak.ai)
- Author entity: https://justinbartak.ai/#person
- Author profiles: https://www.wikidata.org/wiki/Q139551829, https://orcid.org/0009-0005-2615-3624, https://www.linkedin.com/in/justinbartak, https://x.com/justinbartak, https://www.crunchbase.com/person/justin-bartak, https://medium.com/@justinbartak, https://github.com/justinbartak, https://about.me/justinbartak
- Published: 2026-09-04
- Updated: 2026-09-04
- Category: Product
- Keywords: AI build loop, quality gate, agent scope control, prompt as specification, AI game development, stop condition, browser game Three.js, AI design process, autonomous coding loop
- Reading time: 6 min read

---

I gave an agent a build prompt with a stop condition in it. The stop condition did not work, and the reason is not that the agent misbehaved. I wrote a rule that cannot be satisfied.

The game is [Offer City](https://www.orbytlabs.ai/orbyt-jobs/arcade), an open-world driving game about the job market. It is 15,036 lines in one file, and it is finished, which is the only reason I get to write any of this down.

**A quality bar is not a stop condition. It becomes one only when the thing being scored stops moving.**

## What did the prompt actually say?

The instruction was a loop. Build the game. Score it against twelve quality gates. If any gate is under 9 out of 10, the lowest-scoring one becomes the next iteration's focus. Stop when they all pass.

That reads like rigor. It has a number in it. It names a rubric.

Now look at what it is scoring against. The same prompt told the agent to keep a content backlog and never delete an idea from it. So the target grew every round.

The scoring was the agent judging its own work, which is a soft number in a hard number's clothes. And the release valve, the line about shipping the smallest version that still passes, was gated on the same 9 out of 10. The escape hatch was locked with the same key as the door.

No date. No feature ceiling. A target that only grows.

I went back and wrote the diagnosis into the prompt afterward, in the prompt's own voice, so the next person to open it meets the problem before they meet the instructions: the loop "has no fixed point" and "can run forever by construction."

## Why did I not see it?

Because the loop was working. That is the uncomfortable part, and I could not see it from inside a process that reported progress every single round.

Every round produced something better than the round before. Nothing failed. No gate ever reported a regression. If you had asked me at any point whether the process was healthy, I would have shown you a diff and said yes.

Better is not a state. It is a direction, and a direction is what you get when you gate on a score and let the thing being scored keep growing. A loop like that does not look broken from inside. It looks productive, forever, which is exactly why nobody stops it.

The fix was not a stricter gate. A stricter gate makes it worse: it raises the bar the moving target has to clear and buys you more rounds, not fewer.

The fix was to bound the subject. A section called V1 SCOPE, naming three districts instead of eight, one travel mechanic, a fixed list. The gates then score against that list and nothing else.

Note what that does and does not do. The score stays. A rubric is still how you decide whether the thing is good. What changed is that the thing stopped moving while you measured it.

## Can the scope creep too?

It can, and this is the objection I would raise first, so I should answer it rather than let the ending imply it away.

A V1 list written in a file the agent edits is exactly as editable as anything else in that file. Nothing about writing the word SCOPE makes it hold. Scope creep is the most familiar failure in software precisely because scopes are made of the same soft material as everything else.

What makes it different is not visibility. The backlog grew through ordinary edits somebody could have opened. It is that a named list of three makes growth ARGUABLE. Adding a fourth is a change a person has to defend, in a specific line, on a specific day.

Chasing a 9 is nobody's decision to defend, because no single round is where the target moved. That is the real asymmetry, and it is about accountability rather than about diffs.

So the honest version of the rule is narrower than a slogan wants. The gate closes only while its subject is fixed, and the subject stays fixed only if changing it costs somebody an argument.

## What does a real stop condition look like?

Three properties, and the loop I wrote had none of them.

It names a finite thing. Not a quality, not a direction, but a list somebody could read aloud and agree is complete. It is scored by something other than the thing being graded, because an agent rating its own output is measuring its own confidence. And it can be met on a day you can point to in advance.

If a build instruction has no date and no ceiling, the honest reading is that it is not a build instruction. It is a description of a standard, and a standard never terminates, because it was never supposed to.

That is fine, as long as you know which one you wrote. I did not.

And the fix I shipped restores only the first property. The gates are still self-scored, and there is still no date on the file. A bounded subject was enough to finish this game. It is not the same as a stop condition I would trust on something I had not watched the whole way.

Go [drive around the city](https://www.orbytlabs.ai/orbyt-jobs/arcade). The final boss is still a card that says "The range depends on experience." (Final boss, someday), which is the scope holding in public.

Related reading:

- [Your Linter Was the Prototype.](https://www.orbytlabs.ai/blog/your-linter-was-the-prototype) the rule that ran before anyone called it an agent

- [Everyone Says AI-Native. Almost No One Is.](https://www.orbytlabs.ai/blog/ai-native-is-the-moat) what the loop is actually for

- [Verification Is the New Literacy](https://www.orbytlabs.ai/blog/verification-is-the-new-literacy) why proof, not production, became the constraint

- [84 Ways to Tell Me I'm Wrong.](https://www.orbytlabs.ai/blog/ai-code-audit-harness) the gates that run without me

- [I Cannot Read My Own Codebase. I Ship to It Daily.](https://www.orbytlabs.ai/blog/cannot-read-my-own-codebase) what 15,000 lines in one file actually costs

- [Nobody Pays You for the Code Anymore.](https://www.orbytlabs.ai/blog/nobody-pays-you-for-the-code) the plans page that made me check my own arithmetic

---

_Originally published on [orbytlabs.ai](https://www.orbytlabs.ai/blog/i-wrote-a-loop-that-could-run-forever) on Sep 4, 2026._

---

## Frequently Asked Questions

### Why is a 9 out of 10 gate not a stop condition?

Because it scores quality, not completeness. If the feature list grows every round, a passing score simply moves with it. The gate can only close when the thing being measured has stopped moving, so the real boundary is a named and bounded scope, never a number attached to a rubric however strict that number looks.

### What actually stopped the loop?

A bounded V1 scope, written into the same file as the gate: three districts instead of eight, one travel mechanic, one fixed list. The twelve gates then score against that list alone and nothing else. The larger vision stays in the file directly underneath it, marked plainly as not the thing being shipped.

### Why is a stricter gate the wrong fix?

Because it raises the bar a moving target has to clear, which buys more rounds rather than fewer. If the subject keeps growing, a 9 is simply further away than it was last week. Tightening the score treats the symptom; the thing that has to change is whether the list being scored can grow at all.

### How do I tell a build instruction from a standard?

A build instruction names a finite thing and can be met on a day you could circle in advance. A standard describes a direction and never terminates, because it was never meant to. Both are useful documents. The failure is writing the second one, calling it the first, and then waiting for it to finish.

---

Source: https://justinbartak.ai/blog/i-wrote-a-loop-that-could-run-forever
Cite as: Justin Bartak, "I Wrote a Loop That Could Run Forever.", https://justinbartak.ai, 2026-09-04. https://justinbartak.ai/blog/i-wrote-a-loop-that-could-run-forever
