The framework
The CodeWheel framework
What is judged cannot touch what judges it.
That is the whole framework: one rule, the places it is kept, and the smaller rules we learned by getting numbers wrong. It is not a program. There is nothing to install called CodeWheel.
Why one rule
Give an agent a goal and a way to check it. If the agent can also edit the check, then sooner or later the cheapest way to reach the goal is to change the check. Nobody has to mean harm. The agent works on what it can reach.
We met this first in our own work. A reward function graded itself at the top of its scale, and the audit that called it ready was written by the same kind of model that wrote it. That story is here.
Then we looked at about 2,300 merged pull requests written by coding agents. We found no confirmed case of an agent gaming a test. We did find that up to 1 in 5 were merged with no human involved at all. The study is here. The gap is not a dishonest agent. It is a missing judge.
Where the rule is kept
The same rule, at three moments in an agent's work. Each has an open-source tool that keeps it.
Run time
- Who acts
- An agent calling tools
- Who judges
- The server's own policy
- What the agent must not reach
- Its own permissions, its limits and its audit log
- Kept by
- MCP Tools
Change time
- Who acts
- An agent changing code
- Who judges
- A gate that measures before and after
- What the agent must not reach
- The tests, the graders, the rules of the check, and who may say yes
- Kept by
- PromptWheel and Sawbuck
Loop time
- Who acts
- An agent that tries to improve things, again and again
- Who judges
- The loop's keep step
- What the agent must not reach
- The record of tries, the number to beat, the gate and the step, and git's own files
- Kept by
- PromptWheel's loop
The twenty rules
None of these came from a plan. Each one came from a run where a number did not fit, and we went and found out why.
-
1. Judge by the rules as they stood before the change.
A change that loosens its own check is judged by the check it found, not the one it left.
-
2. Judge one thing, and keep that same thing.
What was measured is what gets kept. Not a later edit of it.
-
3. A pass is not a win.
A change that passes and moves nothing is put back.
-
4. Hold a change against the best so far, not only the one before it.
Otherwise a row of small drops walks the work downhill.
-
5. Say how noisy the measure is, measure that noise at the start, and make more readings count.
A change must not be able to widen the band it is judged in.
-
6. Everything the agent can write is a goalpost it could move.
That includes the loop's own files, and git's.
-
7. Where a check cannot hold a rule, put a wall.
The agent works in a copy. Only its files come back.
-
8. What protects is frozen, not scored.
The judge is copied out before a run and nothing edits it until the run ends.
-
9. Fail closed, and say so.
When it cannot be measured, the answer is that it could not be measured. Never a low score.
-
10. Record every try, kept or not, where the agent cannot edit it.
The record is what the next reader trusts.
-
11. Keep a second set of tasks the agent never sees.
A check cannot tell a real fix from one fitted to the test.
-
12. Count what the judge costs.
A judge too slow or too dear to run is a judge nobody runs.
-
13. Prove each rule by attacking it.
Then break the code on purpose and see that a test notices. A list of attacks found holes that 72 passing tests had missed.
-
14. No model as the judge.
A model can say what failed and why. It does not decide what is kept.
-
15. What you checked by hand once becomes a check that runs by itself.
The same day, with a proof that it can fail.
-
16. Hold a change against what it replaces on the same runs, and never keep it on one look.
Count what turned to passed and what turned to failed. If the change does nothing, those two are a fair coin.
-
17. Only like is held against like.
The same seeds, the same day, the same machine, the same tasks. The date sat in our model's prompt, and the same test read differently the next morning.
-
18. A check asks what the task is for, the way a user would meet it.
And it asks what must not have changed. A check that read what a tool had stored passed on a block nobody could see.
-
19. Name a failure by its cause, and count the causes, before anyone works on it.
Three of sixteen tries went at a failure no fix could reach, because nobody had named it.
-
20. A thing that came just before a failure is a lead only after you count how often it happens anyway.
We blamed a program that had started a few seconds before a crash. It starts every 33 seconds, all day.
How to start
Start with one check
Pick one number that matters in your repo. Let PromptWheel measure it before and after every change.
About PromptWheelThen hold the agent to it
Sawbuck runs the check when the agent says it is done, and sends back a green that came from editing a test.
About SawbuckOr have it built in
CodeWheel is also a software studio. We design and build AI software for your team with the rule in place from the start.
See the services