Long Run|INEMA.CLUB-PRO

Lesson 8 · 20 min

A run of hours, from start to finish

Now put it all together in a real run: folder, level 3 goal, frozen tests, how to run it, watching without interrupting, knowing when to stop, and closing with measurement. The kit's pilot, from 10/01/2026, is a step-by-step reference. At the end, the course map and your plan with dates.

Start the lesson
A dark office with the sky brightening in the window, a closed laptop, and a lit server LED.

In this lesson you will

  1. 1The six steps of a run, in order
  2. 2The kit's pilot, minute by minute
  3. 3When to stop and call you
  4. 4The course map and your plan with dates

Goal: carry out a real run from goal.md to a measured close, with human gates and stop rules, and leave with a dated plan.

01Six steps, end to end

Each step uses a lesson from the course. Click to see what to do.

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

Most of the work is in steps 1 and 2. In the pilot, with them done well, the run finished in the first cycle.

02The kit's pilot, minute by minute (10/01/2026)

longrun/2026-10-01-medir-sessao/: build the medir-sessao.py from lesson 7 with a headless loop.

1. Before

Goal with a complete specification of the output format, 12 fast tests and 2 with real sessions of up to 1.8 GB, frozen (hash 3ae1ba7975508cba).

loop.env: 6 cycles of 20 min, 8G of memory, stagnation 3; protected files tests/, pytest.ini, and tools/medicao/.

03Rehearsal: the agent wants to keep going

A run at cycle 4. You decide whether it continues. The stop rules are the kit's.

Run agentheadless loop, cycle 4

Choose your answer. The feedback appears right after, and the conversation continues based on your choice.

    04The cycle prompt and the close

    The prompt.md is what the loop sends to the agent in each cycle. Generalized from the pilot.

    longrun/[folder]/prompt.md (headless mode)
    You are in one cycle of a long run in the repo <project path>.
    
    RESULT: <the goal.md result in one sentence>.
    
    BEFORE ACTING: read goal.md → state.md → plan.md → the last lines of progress.md and failures.md (all in longrun/<folder>/).
    
    IN THIS CYCLE: pick the next useful action, implement it, run <quick test>. If the quick ones pass, run <full test>.
    
    AT THE END OF THE CYCLE (required):
    - rewrite state.md (Funciona / Falta / Como retomar) and plan.md (next 3 steps);
    - append 1 line to progress.md: date-time, what changed, test result (N passed / N failed);
    - if something went wrong, 1 line in failures.md: error → attempt → result;
    - design decisions in decisions.md.
    - When the full test passes completely, write "concluído" on the first line of "## Funciona" in state.md.
    
    CONSTRAINTS: do not change <protected files>. No API, no network. Do not commit (the outer loop does that).
    Terminal · close with independent verification
    cd ~/projetos/<seu-projeto>
    head -5 longrun/<pasta>/state.md                       # says concluído?
    <teste completo>                                        # run it yourself, don't read the log
    git diff --exit-code <commit-base> -- tests/ pytest.ini; echo "protegidos: $?"
    git diff --stat <commit-base>                           # only what the goal allowed?
    grep -rn "<valor esperado de um teste>" <pasta do código>  # hardcoded value in the code?
    python3 ~/projetos/execucao-longa/tools/medir-sessao.py <sessão.jsonl>

    05Final practice

    A real run of your own. Start small: 1 to 3 hours.

    E19 · One run from start to finish

    1–3 h

    In the folder from lessons 1 and 2, freeze the tests, pick the mode (/goal or loop-longrun.sh rehearsed with a fake agent) and let it run with the hook and the vigia on. Step in only for the stop rules.

    Done when: the first line of "## Funciona" in state.md says concluído and the loop.log (in headless) ends in CONCLUÍDO no ciclo N, or the run stopped on one of the kit's rules with the reason in failures.md.

    E20 · Close and measure

    30 min

    Close with the independent verification block and measure the session. Write the final line in progress.md and, if there was a failure, the smallest fix in the project's FALHAS.md.

    Done when: the full test, run by you, passes; git diff --exit-code [base-commit] -- tests/ → protegidos: 0; progress.md has the final line with tokens and compactions from medir-sessao.py.

    06The course map

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

    Day 1Folder and goal

    lessons 1 and 2

    2 exercises

    A level 3 goal.md that fails before the work and resists the cheat.

    View the lesson
    Day 2Context and handoff

    lessons 3, 4 and 5

    3 exercises

    Hook enabled, a year of transcripts, and a handoff you can verify.

    View the lesson
    Day 3Headless loop

    lesson 6

    3 exercises

    loop.env rehearsed with a fake agent and vigia enabled.

    View the lesson
    Days 4 and 5Real run

    lessons 7 and 8

    2 exercises

    A run closed by you and measured in progress.md.

    View the lesson
    At the end of the courseA long run of your own completed by the test, closed by you and measured, with the kit ready for the next one.
    20 exercises
    Click an exercise to see what to do and the "done when".
    1. 1/5

      Folder and goal

      Kit installed, folder created, method in the global rules and the goal.md attacked with the cheapest cheat.

    2. 2/5

      Context and handoff

      Requires day 1. Bands, pause and handoff rehearsed without spending quota; then a real handoff resumed with /prime.

    3. 3/5

      Headless loop

      Requires days 1 and 2. Done, cheat reverted and second-copy lock, before you release a real agent.

    4. 4/5

      Real run

      Requires everything before. The run happens in one day; the independent close and the measurement, the next.

    5. 5/5

      The whole course

      Folder and goal, context and handoff, headless loop and a real run. Only move on to the next deliverable when the "done when" of the previous one is true.

    Mandatory order: a headless loop without a level 3 goal is just a faster way to burn quota.

    07Generate your plan with dates

    Pick a start date and how much time you have per week. The plan lists the 20 exercises in order.

    08Final test

    Five questions about the whole course.

    Question 1 of 5

    According to the pilot, where is most of the work in a long run?skill

    09The course in three sentences

    Criterion firstA level 3 goal.md with frozen tests: it's what lets the agent finish and stops it from cheating.
    State outside the modelSeven files, context bands, a verified handoff: the session can compact, crash, or switch models.
    You close itThe test decides in the loop; you check, measure, and record before calling it done.

    Keep going from here

    Previous lessonBack to course start