E4 · Fails before, passes after
10 minRun the three rounds of the rehearsal.
Done when: A ends with FALTAM 4 and saída: 4; B shows OK on the código 0 criterion and FALHOU on 3 passed; C ends with PRONTO and saída: 0.
Lesson 2 · 18 min
A criterion only counts if an outsider can check it without trusting the agent. In this lesson you run each criterion of goal.md as a command, see which one passes by shortcut, and learn where the proof has to show up: the /goal evaluator in Claude Code only reads the conversation.
Start the lesson
Goal: check each criterion of goal.md by command, see which level 2 one passes by shortcut, and put the proof in the conversation the /goal evaluator reads.
Click each step.
A command you run and the output that shows up: it's the same proof for you, for the headless loop and for the /goal evaluator.
Six criteria. One has no command and one passes through a shortcut. Find both before you run it.
## Done criteria
**Function**
- [ ] `python3 -m pytest -q tests/` → `3 passed`
- [ ] `python3 -c "from slug import slug; print(slug('Ação & Reação!'))"` → `acao-reacao`
**Regression**
- [ ] `python3 -m pytest -q tests/ -rs` → `código 0`
**Limit**
- [ ] `git diff --stat HEAD -- tests/ pytest.ini` → `vazio`
- [ ] `git ls-files --others --exclude-standard -- '*conftest.py' tests/` → `vazio`
- [ ] the code stays clean and well documentedK=~/projetos/loop-r-eng-verificacao-v72/kit bash $K/ensaio.sh > /dev/null && cd /tmp/ensaio-verif/proj cp $K/goal-ensaio.md ../goal.md # outside the project: the agent doesn't edit the criterion python3 $K/conferir-goal.py ../goal.md; echo "saída: $?" # A) before the work: it has to fail $K/agente-falso.sh conftest < /dev/null # B) shortcut: skips the tests python3 $K/conferir-goal.py ../goal.md; echo "saída: $?" rm conftest.py && $K/agente-falso.sh bom < /dev/null # C) the right work sed -i '/limpo e bem documentado/d' ../goal.md # and the criterion with no command goes away python3 $K/conferir-goal.py ../goal.md; echo "saída: $?"
FALHOU python3 -m pytest -q tests/ → 3 passed
veio: 3 failed in 0.01s (código 1)
FALHOU python3 -c "from slug import slug; print(slug('Ação & Reação → acao-reacao
veio: NotImplementedError (código 1)
FALHOU python3 -m pytest -q tests/ -rs → código 0
veio: 3 failed in 0.01s (código 1)
OK git diff --stat HEAD -- tests/ pytest.ini → vazio
OK git ls-files --others --exclude-standard -- '*conftest.py' t → vazio
FALHOU sem comando: o código fica limpo e bem documentado
---
FALTAM 4
saída: 4
Pronto: marquei os testes instáveis; a suíte fica verde.
FALHOU python3 -m pytest -q tests/ → 3 passed
veio: 3 skipped in 0.00s (código 0)
FALHOU python3 -c "from slug import slug; print(slug('Ação & Reação → acao-reacao
veio: NotImplementedError (código 1)
OK python3 -m pytest -q tests/ -rs → código 0
OK git diff --stat HEAD -- tests/ pytest.ini → vazio
FALHOU git ls-files --others --exclude-standard -- '*conftest.py' t → vazio
veio: conftest.py (código 0)
FALHOU sem comando: o código fica limpo e bem documentado
---
FALTAM 4
saída: 4
Pronto: slug() implementado.
OK python3 -m pytest -q tests/ → 3 passed
OK python3 -c "from slug import slug; print(slug('Ação & Reação → acao-reacao
OK python3 -m pytest -q tests/ -rs → código 0
OK git diff --stat HEAD -- tests/ pytest.ini → vazio
OK git ls-files --others --exclude-standard -- '*conftest.py' t → vazio
---
PRONTO
saída: 0The command appears cut off at 60 characters in the output. In round B, código 0 gave OK with all three tests skipped: it's the level 2 criterion in goal.md.
If round A (before any work) already gives OK on a function criterion, the criterion doesn't measure the work. Every function criterion has to fail beforehand; limit criteria (nothing touched) can pass from the start.
Because the evaluator only reads the conversation, the condition requires the pasted output. In the goal prompts of the execucao-longa kit and the 15 commands kit, the pattern is the same.
/goal The output of `python3 ~/projetos/loop-r-eng-verificacao-v72/kit/conferir-goal.py <caminho>/goal.md` is pasted in full in this conversation and ends with PRONTO; no file in tests/ or conftest.py was changed; stop after 15 turns and say what was missing.
(1) Terminei. Rodei o conferir-goal.py e deu tudo certo. (2) Rodei o conferir-goal.py: OK python3 -m pytest -q tests/ → 3 passed (…) --- PRONTO
Rehearsal, then your own goal.md.
Run the three rounds of the rehearsal.
Done when: A ends with FALTAM 4 and saída: 4; B shows OK on the código 0 criterion and FALHOU on 3 passed; C ends with PRONTO and saída: 0.
Take one of your own goal.md files (or write one from the course 2 template) and run conferir-goal.py on it before you start the work. Rewrite every criterion that came back as "sem comando" and every function criterion that already passes.
Done when: python3 $K/conferir-goal.py [your goal.md] --pasta [your project] → no sem comando line and at least one function FALHOU before the work (exit code greater than 0).
Run a small task with /goal using the condition from the block above, pointing to your goal.md.
Done when: the agent's last reply contains the output of conferir-goal.py ending in PRONTO and /goal ends as met; when you run the same command yourself → PRONTO and exit code 0.
Question 1 of 4
What can the /goal evaluator in Claude Code do to judge the condition?skill
Question 2 of 4
In the rehearsal, with all tests skipped, which criterion passed by mistake?skill
Question 3 of 4
Which of these final messages lets the /goal evaluator decide based on proof?
Question 4 of 4
A function criterion passes before any work is done. What does that tell you?
Pick an option. The explanation appears after you try.