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

Lesson 4 · 18 min

LOOP-R: the five letters and the nine agents

An agent that evaluates its own work tends to approve itself. LOOP-R, the open INEMA framework that gives this track its name, solves this by separating roles: nine agents, each with what it reads, what it writes, what it decides and what it never does. The five letters give the order of the method. Here you see the design; promoting and rolling back versions belongs to course 5.

Start the lesson
Nine small industrial robot figures with dark visors in a circle on a dark technical table.

In this lesson you will

  1. 1Locate, Operate, Observe, Propose, Reinforce
  2. 2The nine agents and the contract of each
  3. 3Why the separation keeps the loop from convincing itself
  4. 4A real cycle from the example, read in the ledger

Goal: explain the letters L-O-O-P-R and the contract of the nine agents (reads, writes, decides, never does) and say why the one who does doesn't evaluate.

01The five letters, in cycle order

Click each letter: what it asks for and which agents come into it.

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

  1. 1/6

    L · Locate

    Pick a process that repeats a lot and write the goal with a number: take X to Y without worsening Z. The loop sheet has five answers that no system can safely infer: a goal with a number, where the evidence comes from, what never changes on its own, a cap on cost and time, and who approves. It is the goal from lesson 1, with a guardrail.

  2. 2/6

    O · Operate

    The process gets a current version, a short script followed in every run, so that two runs can be compared. The Executor produces the artifact and logs one line. It doesn't opine, doesn't suggest, doesn't change its own prompt.

  3. 3/6

    O · Observe

    One line per run, always the same columns, result as yes or no. The Observer turns the lines into evidence: counts by version and variant, no adjectives. If the data doesn't match the schema, it stops the cycle.

  4. 4/6

    P · Propose

    The Critic says what worked and what failed, with the strength of the evidence, without proposing a fix. The Optimizer writes hypotheses in the format SE, ENTÃO, PORQUE and MUDANÇA, without repeating discarded ones. The Guardian vetoes anything that touches what never changes or the cap; the veto is final and it doesn't negotiate.

  5. 5/6

    R · Reinforce

    The Experimenter designs the A versus B test, with the minimum sample calculated beforehand. The Evaluator answers one of three: B_GANHOU, A_SEGUE or AMOSTRA_INSUFICIENTE. There is no "it's winning". The Memory records everything without erasing, and the Meta-agent looks at the system (cost, vetoes) and only reports.

  6. 6/6

    Whoever builds is not whoever inspects

    Nine separate roles, each reading only what its contract says. It's the separation, not a cleverer prompt, that keeps the loop from convincing itself it improved.

Letters as presented in track 2 of the LOOP-R video; agent contracts in loop-r/docs/04-agentes.md and .claude/agents/.

02The contract of the nine, in a table

Summary of loop-r/docs/02-arquitetura.md, §4. Each agent is a markdown file in .claude/agents/.

Contracts (docs/02 §4)
| Agente         | Lê                                  | Escreve                    | Decide                  | Nunca faz                       |
|----------------|-------------------------------------|----------------------------|-------------------------|---------------------------------|
| Executor       | versoes/atual, entrada da tarefa    | artefato + linha no CSV    | nada                    | mudar o próprio prompt          |
| Observador     | CSV, esquema                        | evidencia.md               | nada                    | interpretar causa               |
| Crítico        | evidência, versão atual, memória    | critica.md                 | se há padrão com N      | propor solução                  |
| Otimizador     | crítica, memória (descartados!)     | hipoteses.md               | nada                    | repetir hipótese descartada     |
| Guardião       | hipóteses, yaml (guarda-corpos, teto)| veto/aprovação por hipótese| veto é final            | ser convencido                  |
| Experimentador | hipóteses aprovadas, amostra mínima | experimento.md             | desenho do teste        | rodar sem N calculado           |
| Avaliador      | resultados A/B, rubrica, calibração | veredito.md                | uma das 3 respostas     | "parece melhor"                 |
| Memória        | tudo do ciclo                       | ledger + 3 arquivos        | nada                    | apagar registro                 |
| Meta-agente    | manifestos de todos os ciclos       | relatorio-meta.md          | nada (v0.1/v1)          | alterar agentes                 |
Terminal · clone and check the agents
git clone https://github.com/inematds/loop-r ~/projetos/loop-r
cd ~/projetos/loop-r
ls .claude/agents/*.md | wc -l
grep -h '^description:' .claude/agents/*.md | cut -c1-110
Terminal · read the example (synthetic data)
cd ~/projetos/loop-r/exemplos/vendas-whatsapp
grep -c '^| 2026' memoria/ledger.md
grep -oE '\| (VETADA|EM TESTE|AGUARDANDO|DESCARTADA|PROMOVIDA v2) \|' memoria/ledger.md | sort | uniq -c
Example from the repository
$ ls .claude/agents/*.md | wc -l
9

$ grep -c '^| 2026' memoria/ledger.md
8

$ grep -oE '...' memoria/ledger.md | sort | uniq -c
      2 | AGUARDANDO |
      1 | DESCARTADA |
      2 | EM TESTE |
      1 | PROMOVIDA v2 |
      2 | VETADA |

Four cycles, eight decision lines: two hypotheses vetoed by the Guardian before any test, one discarded by the Evaluator, one promoted to v2.

03A discard that teaches

Cycle 0002 of the example: the metric went up and the new version still didn't make it in.

1. The hypothesis

Proposals of at most 80 words. It passed the Guardian and went to testing, A against B, 300 runs on each side.

04Video: the five letters of the method

LOOP-R track 2 on video. Made for managers, with business examples; the method is the same one an engineering loop uses.

LOOP-R, track 2: the five letters · 17 min 44 sVideo page with script →

05Practice

On your machine. Read-only on the LOOP-R repository.

E1 · The nine contracts

15 min

Clone loop-r and open three agents: executor.md, guardiao.md and avaliador.md. For each one, note in agentes.md the "nunca" line from the file.

Done when: ls ~/projetos/loop-r/.claude/agents/*.md | wc -l → 9, and grep -ci nunca agentes.md → 3 or more.

E2 · Reading a cycle through the ledger

15 min

In the vendas-whatsapp example, read the ledger and the verdict of cycle 0002. Write in one sentence why the hypothesis was discarded even though the response rate went up.

Done when: grep -c '^| 2026' memoria/ledger.md → 8, and your sentence cites the guardrail (complaints) and the tolerance.

E3 · Separating who does from who evaluates

10 min

Think of a loop of your own (code, content, support). In agentes.md, write two lines, one starting with executa: and the other with avalia:, and say what the evaluator reads that the executor doesn't write.

Done when: grep -cE '^(executa|avalia):' agentes.md → 2, and the "avalia:" line points to a source the executor doesn't control (test, spreadsheet, rubric).

06Lesson quiz

Question 1 of 4

Why does LOOP-R use nine agents instead of one agent that does and checks?competency

07In three sentences

Five lettersLocate the process and the number, Operate the same way every time, Observe in lines, Propose with critique and veto, Reinforce only with a test.
Nine contractsEach agent reads, writes, and decides only what its contract says, and has a list of what it never does.
Non-regressionLOOP-R does not guarantee the number goes up; it guarantees that a worse version does not replace the current one by the system's decision.

Going further

Previous lessonNext lesson