The loop that learns|INEMA.CLUB-PRO

Lesson 8 · 20 min

Assemble LOOP-R in your system

The seven lessons gave you the pieces: hypothesis, experiment, promotion, lessons, binding rule, protected meter, and trace. What's left is putting them together in your system and checking that none was left out. This lesson also closes the track: what each of the six courses puts into the loop, and the dated plan to assemble yours.

Start the lesson
Eight circuit modules fitted in sequence on a rail, forming a ring, with cables linking the last to the first.

In this lesson you will

  1. 1The eight pieces and the loop.conf file
  2. 2conferir-loop.py: from 0/8 to 8/8
  3. 3The whole track in six courses
  4. 4Your plan with dates

Goal: check the eight pieces of the loop that learns in your project, close what's missing, and close the track with the dated plan.

01The eight pieces of the loop that learns

One per lesson. Click each piece to see what conferir-loop.py requires.

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

conferir-loop.py reads loop.conf at the project root. It checks that the pieces are present and consistent, not the quality of your hypothesis.

02Rehearsal: from 0/8 to 8/8

An empty folder and a loop assembled by the kit (montar.sh repeats, without a model, what lessons 1 to 7 did). It needs the loop-r and sil-loop-r repositories in ~/projetos.

Terminal · cost-free rehearsal
K=~/projetos/loop-r-eng-aprende-v72/kit
E=${TMPDIR:-/tmp}/ensaio-aprende/a8; rm -rf $E; mkdir -p $E/vazio
echo "## uma pasta sem nada"; python3 $K/conferir-loop.py $E/vazio > $E/vazio.txt; echo "saída: $?"; tail -1 $E/vazio.txt
echo "## as oito peças montadas pelo kit (o que as aulas 1 a 7 fizeram)"
bash $K/montar.sh $E/meu-loop > /dev/null
python3 $K/conferir-loop.py $E/meu-loop; echo "saída: $?"
echo "## o loop.conf que o conferir lê"; cat $E/meu-loop/loop.conf
File · kit/loop.conf.exemplo
# loop.conf — o que o conferir-loop.py lê (KEY=valor; ~ e $HOME valem). Fica na raiz do seu projeto.
SISTEMA=~/projetos/<seu-sistema>          # repo onde o experimento roda (tem results.tsv); padrão: esta pasta
LOOP=~/loops/<seu-loop>/promocao           # versoes/ + memoria/ledger.md (aula 3); fora do repo do sistema
GUARDA=~/loops/<seu-loop>/medidor.sha256   # manifesto do medidor (aula 6); fora do repo
ESCONDIDOS=~/loops/<seu-loop>/escondidos.jsonl
RASTRO=~/loops/<seu-loop>/rastros.jsonl    # uma linha por ciclo (aula 7)
TETO_TOKENS=<tokens por ciclo, a partir da sua medição real>
APROVADOR=<quem aprova a promoção (nível L1)>
Example from the repository
## uma pasta sem nada
saída: 1
LOOP: 0/8 — FALTAM 1, 2, 3, 4, 5, 6, 7, 8
## as oito peças montadas pelo kit (o que as aulas 1 a 7 fizeram)
OK     1 hipótese com número  (hipotese.md passa no hipotese.py)
OK     2 experimento keep/discard  (results.tsv com 1 ciclo(s))
OK     3 promoção e rollback  (versoes/atual + ledger com PROMOVIDA)
OK     4 lições com decisão (SIL)  (1 regra(s) ativa(s) no SIL)
OK     5 regra vinculante no AGENTS.md  (bloco promovido e check sem pendência)
OK     6 medidor fora do alcance  (GUARDA confere e ESCONDIDOS fora da pasta)
OK     7 rastro por ciclo  (RASTRO com pelo menos um ciclo)
OK     8 teto e aprovador  (TETO_TOKENS e APROVADOR no loop.conf)
LOOP: 8/8 — PRONTO
saída: 0
## o loop.conf que o conferir lê
LOOP=/tmp/ensaio-aprende/a8/meu-loop-fora/promocao
GUARDA=/tmp/ensaio-aprende/a8/meu-loop-fora/medidor.sha256
ESCONDIDOS=/tmp/ensaio-aprende/a8/meu-loop-fora/escondidos.jsonl
RASTRO=/tmp/ensaio-aprende/a8/meu-loop-fora/rastros.jsonl
TETO_TOKENS=50000
APROVADOR=Seu Nome

What stays outside the system repo (meter, hidden cases, trace, versions) goes in a sibling folder: the agent that changes the system can't reach what judges it.

03The training in six courses

What each course adds to your loop. This one is the last.

1. Baseline

The five pieces of the loop (goal, state, action, verification, stop), the harness, today's loop engines, LOOP-R and the done criterion from 0 to 4.

04Final practice

The rehearsal, then your system.

E22 · From 0/8 to 8/8 in the rehearsal

5 min

Run the rehearsal.

Done when: LOOP: 0/8 with saída: 1, then LOOP: 8/8 — PRONTO with saída: 0.

E23 · Your loop, checked

2 h

In your project, copy loop.conf.exemplo to loop.conf, point each path to the pieces you built in the practice sections of lessons 1 to 7, and run conferir-loop.py. Close the missing pieces one at a time, in order.

Done when: python3 $K/conferir-loop.py ~/projetos/[your-project]; echo "saída: $?" → LOOP: 8/8 — PRONTO and saída: 0.

E24 · The first real cycle

1 h

With the loop at 8/8, run a real cycle with your agent, with the guardrail and hidden cases on and the trace recording (MEDIR and MEDIDOR exported as in lesson 2, if the measurer is your own). If it ends in keep, make the card and ask the person who decides for approval.

Done when: your system's results.tsv gets a new line, the trace gets a line with tokens, and there is a decisao.md with a name and date if the cycle ended in keep.

05The course map

Four deliverables, in order. Click an exercise to see its "done when".

Day 1Measure

lessons 1 and 2

3 exercises

A hypothesis with a number and the first keep/discard.

View the lesson
Days 2 and 3Decide

lessons 3, 4 and 5

3 exercises

Promotion with rollback and lessons that become rules.

View the lesson
Day 4Protect

lessons 6 and 7

3 exercises

Frozen meter, hidden cases, and trace.

View the lesson
Week 2Assemble

lesson 8

3 exercises

Your loop at 8/8 and the first real cycle.

View the lesson
At the end of the trackA loop that works for hours, checks itself, runs safely, and improves with numbers: it changes, measures, keeps what gained, goes back when it gets worse, and remembers what it learned.
24 exercises
Click an exercise to see what to do and the "done when".
  1. 1/5

    Measure

    Kit cloned, hipotese.md approved, and three cycles in the rehearsal, plus one real one.

  2. 2/5

    Decide

    Requires day 1. Verdicts redone, SIL in your project, and one binding rule.

  3. 3/5

    Protect

    Requires days 2 and 3. Both shortcuts seen and closed; the cost per keep measured.

  4. 4/5

    Assemble

    Requires everything before. loop.conf pointing to the pieces, conferir-loop.py at 8/8.

  5. 5/5

    The whole course

    Measure, decide, protect, and build. Only move on to the next deliverable when the "done when" of the previous one is true.

Mandatory order: promoting without a protected meter is promoting the shortcut.

06Generate your plan with dates

Choose the start date and how much time you have per week. The plan lists the 24 exercises in order.

07Final quiz

Question 1 of 4

conferir-loop.py returned 8/8. What does that guarantee?skill

08The track in three sentences

Work and checkThe loop runs for hours with state outside the model, a cap, and a stop, and whoever says it's done is a gate the agent can't reach.
As a team and safelySubagents and queues only when they help; no session combines private data, untrusted content, and output to the outside.
LearnChange one thing, measure, keep what won, roll back when it gets worse, and turn the error into a rule the next session reads.

Keep going here