Long Run|INEMA.CLUB-PRO

Lesson 2 · 18 min

Write a level 3+ goal.md with no possible shortcut

In the kit's pilot, with a level 3 criterion and 14 frozen tests, the run finished in the first cycle, in 3 minutes. Most of the work in a long run is writing the criterion. Here you write your own goal.md so that the only way to meet it is to do the work.

Start the lesson
Digital caliper measuring a machined metal part on a dark workbench.

In this lesson you will

  1. 1Cover function, regression and limit
  2. 2Add a lock: minimum count, frozen test, validator
  3. 3Make the proof show up in the /goal output
  4. 4Test the criterion against the cheapest cheat

Goal: write a goal.md with command → output criteria that cover function, regression and limit and that can't be met by a shortcut.

01From result to proof on screen

A good goal.md has these five parts. Tap each one.

Click each block in the diagram to see what it does.

Function + regression + limit, each with a lock, and the proof visible. The full 0–4 scale is in course 0; how to build the verifier, in course 1.

02The five questions from templates/goal.md

Each "no" lowers the criterion's level.

1. Can you check it with a command?

"Make it good" and "reviewed and clean" have no command. Rewrite until you have one.

Rewrittenpython3 validar.py && echo OK → OK

03The goal.md and the two /goal prompts

Filled-in example for a small task (counting words). Swap in your own.

longrun/[date]-contador-palavras/goal.md
# Goal — contador-palavras

- **Início:** 2026-10-19 09:00 · **Agente:** Claude /goal
- **Tetos:** tempo 2 h · memória 2G

## Resultado
`conta.py` tem conta_palavras(texto) que conta palavras separadas por qualquer espaço.

## Critérios de pronto (verificáveis)

**Função**
- [ ] `python3 -m pytest -q` → `3 passed`, 0 failed (e nunca menos de 3 testes)

**Regressão**
- [ ] `python3 -c "import conta"` → sem erro (o módulo continua importável)

**Limite**
- [ ] `git diff --exit-code -- tests/ pytest.ini` → código 0 (testes congelados)
- [ ] `git diff --stat` → só `conta.py` e a pasta longrun/

**Teste rápido por ciclo**: `python3 -m pytest -q`
**Teste completo no final**: `python3 -m pytest -q`

## Restrições
- só pela assinatura; nenhuma API
- não mexer em: tests/, pytest.ini

## Portões humanos (parar e perguntar)
- qualquer mudança fora de conta.py e da pasta longrun/
Claude Code · /goal (templates/prompt-goal-claude.md)
/goal The terminal output shows <comando de verificação> passing with <resultado esperado>, and longrun/<pasta>/state.md says "concluído".
Codex · /goal (templates/prompt-goal-codex.md)
/goal
RESULT: <final result in one sentence>

VERIFICATION (it only ends when all of these pass):
- <comando> → <saída esperada>

CONSTRAINTS: <what is off limits>. Subscription use only; no API without authorization.

STATE: use longrun/<pasta>/ (goal.md, plan.md, state.md, progress.md, failures.md, decisions.md, canal.md).
After any compaction or resume, reread goal.md, state.md, plan.md and canal.md before acting. Record in canal.md (append only) facts, lessons, glossary and traps as soon as they appear.

CYCLE: analyze → pick the next useful action → execute → test → observe → fix → update state/progress → commit at the checkpoint → continue.
As long as there is a next action that is objective, safe and aligned with the goal, execute it without waiting for new instructions.
3 cycles without measurable progress = stop, record it in failures.md and call me.

STOP AND CALL ME ONLY IF: credit/API spending, irreversible or external action (push to production, email, delete), missing credential, business decision, real conflict between requirements.
Example from the repository

From the kit's longrun/2026-10-01-medir-sessao/goal.md, the run that built medir-sessao.py:

Função
- pytest -q → todos passam (12 rápidos + 2 com sessões reais), 0 falhas, 0 skips

Regressão
- python3 tools/medicao/cx.py | head -1 e cc.py continuam rodando

Limite
- git diff --exit-code -- tests/ pytest.ini → vazio
  (testes congelados; hash inicial 3ae1ba7975508cba)
- só criar/alterar tools/medir-sessao.py e a pasta longrun/

Teste rápido por ciclo: pytest -q -m "not real"
Teste completo no final: pytest -q

Result: done in the 1st cycle (3 min). Independent check afterward: test hash intact, no hardcoded values in the code, 14 passed reproduced, and a never-before-seen session checked.

04Practice

Use the folder you created in lesson 1.

E4 · The goal.md for your long run

30 min

Fill in goal.md with the result, function, regression, limit, the two tests, constraints and human gates. Before any work, run each criterion in the terminal.

Done when: every criterion has a command that runs now; the function ones fail before the work (if they already pass, the criterion doesn't measure the task) and the limit one already passes: git diff --exit-code -- tests/; echo $? → 0.

E5 · Attack your own criterion

20 min

On a throwaway branch (git switch -c ataque), pull the cheapest cheat: delete a failing test, or swap the function for a fixed value. Run the criteria again and go back with git switch -.

Done when: for each cheat, at least one criterion fails; when you delete a test, git diff --exit-code -- tests/; echo $? → 1.

05Lesson quiz

Question 1 of 4

The criterion is "pytest -q → 0 falhas". Which cheat does it let through?skill

06In three sentences

Three layersFunction, regression and limit, each with a command and the expected output.
Locks on each oneMinimum count, tests frozen by git diff or hash, content validator: the shortcut has to fail.
Proof in plain sightClaude's /goal evaluator only reads the conversation; the headless loop runs the test itself (lesson 6).

Going further

Previous lessonNext lesson