Base: anatomy of the loop|INEMA.CLUB-PRO

Lesson 6 · 16 min

Done criterion on the 0–4 scale

A loop ends when the done criterion says it ended. If the criterion is vague, the loop never ends or ends too early; if it can be met by a shortcut, the agent finds the shortcut: it deletes the test that was failing, generates an empty page. The 0-to-4 scale of the execucao-longa kit names each step and shows the minimum accepted: level 3, a command with a lock.

Start the lesson
A dial indicator resting on a machined part, next to five metal steps of increasing height.

In this lesson you will

  1. 1The five steps, from vague to independent
  2. 2The 5 questions that drop a level
  3. 3Locks that close the shortcut: count, frozen file, validator
  4. 4Function, regression and limit in one criterion

Goal: classify done criteria from 0 to 4 with the 5 questions and rewrite a vague criterion up to level 3, with a command and a lock.

01The done criterion ladder

Click each step: how it sounds, how the agent games it and what to do.

Scroll the page: each step below lights up its part of the diagram.

  1. 1/6

    0 · vague

    There is no end you can check. The loop stops when the quota runs out or when the agent decides it's good enough. Example: "improve performance".

  2. 2/6

    1 · subjective

    It looks like a criterion, but the agent's opinion decides: it approves itself. Example: "code reviewed and free of problems".

  3. 3/6

    2 · gameable

    It already has a command, but you can meet it without doing the work: deleting the failing test gives "0 failures"; twenty empty pages give "20 pages". It's the most dangerous step because it looks done.

  4. 4/6

    3 · protected

    A command plus a lock that closes the shortcut: a minimum count ("≥ 48 tests"), a frozen file or checked hash, a content validator. Example from the kit: "0 failures and ≥ 48 tests and tests/ untouched", not just "0 failures".

  5. 5/6

    4 · independent

    Level 3 plus someone or something outside checking: a real end-to-end test, a separate evaluator, a sample checked by a person. Use it when a mistake is costly. How to set up the separate evaluator is course 1.

  6. 6/6

    Always climb to 3

    Vague and subjective get rewritten; gameable gets a lock; protected is the minimum for leaving an agent alone; independent is for when a mistake is costly.

Scale from the goal.md template in the execucao-longa kit. Minimum accepted: level 3.

02The scale and the 5 questions, as they are in the template

Excerpt from execucao-longa/templates/goal.md. Paste it into your goal.md or the agent's rules.

templates/goal.md · scale and questions
SCALE (delete when filling in)
  0 vague ......... "make it good", "improve"                    → rewrite
  1 subjective .... "reviewed and clean" (the agent approves itself)  → rewrite
  2 gameable ..... "0 failures", "20 pages" (deletes a test, empty page) → add a lock
  3 protected .... command + lock (minimum count, frozen file/hash, content validator) → minimum accepted
  4 independent . level 3 + external check (real e2e, separate evaluator, human sample) → when a mistake is costly

5 QUESTIONS — each "no" drops the level
  1. Can you check it with a command?
  2. Is the answer yes/no (no "it improved")?
  3. Is it impossible to meet without doing the work?
  4. Does the proof show up in the output? (the /goal evaluator in Claude only reads the conversation)
  5. Are function + regression + limit covered?

SIGNS OF A BAD CRITERION: "good/clean/adequate/complete"; depends on the agent saying it finished;
count only without checking content; doesn't say what must NOT change; verification takes hours.
Level 3 criterion · the three layers
**Function** — does what it should
- [ ] python3 -m pytest -q tests/ | tail -1 → 6 passed (and never fewer than 6)

**Regression** — didn't break what already worked
- [ ] python3 -m pytest -q | tail -1 → no "failed"

**Limit** — didn't touch where it shouldn't
- [ ] git diff --exit-code -- tests/; echo $? → 0
- [ ] sha256sum -c tests.sha256 → tests/test_conta.py: OK

03From 0 to 3, one step at a time

The same request rewritten until it's shortcut-proof.

1. 0 → 1

"Improve the word-counting function" becomes "the function counts words correctly".

It's still opinion: who says "correctly"?

04Practice

On your machine. Exercise 2 uses a project of yours that has tests.

E1 · Classify and rewrite

15 min

In criterios.md, write three criteria you have already used (or seen) to say that a task was finished. Next to each one, put the level from 0 to 4 and, on a line that starts with nível 3, the rewritten version. Write the marker nível 3 exactly like this, in Portuguese: it is what the grep counts.

Done when: grep -c 'nível 3' criterios.md → 3, and grep -ciE '\b(good|clean|adequate|complete|proper)\b' criterios.md only finds words in the lines of the original criteria, never in the rewritten ones.

E2 · A level 3 criterion that runs

15 min

In a project of yours that has tests, run the full criterion: the suite with a minimum count and the lock that the tests did not change.

Done when: python3 -m pytest -q | tail -1 (or your project's test command) shows the number of tests, with no failed, and git diff --exit-code -- tests/; echo $? → 0.

E3 · Prove the lock catches it

10 min

In the same folder, simulate the shortcut: replace the content of a test with an empty test, run the locks, and then undo it with git checkout.

Done when: With the test replaced, git diff --exit-code -- tests/; echo $? → 1; after git checkout -- tests/, the same command → 0.

05Lesson quiz

Question 1 of 4

"python3 -m pytest -q prints 0 failed". What level is it?competency

06In three sentences

Five stepsVague, subjective, gameable, protected, independent. Minimum to leave the agent on its own: 3.
A lock closes the shortcutMinimum count, frozen file or hash, content validator: what keeps it from being met without doing the work.
Three layersFunction, regression and limit, with the proof printed in the output.

Going further

Previous lessonNext lesson