E15 · Bridge rehearsed
5 minRun the rehearsal with the fake codex.
Done when: PONG and saída: 0; then sandbox recusado pela POLITICA: danger-full-access and saída: 2.
Lesson 7 · 20 min
Two models from different houses make mistakes in different places. That holds when each one has a role: one does the work, the other reviews by reading only, with the same briefing and the real artifact. In this lesson you route roles by level, rehearse the bridge to Codex without spending quota, and have Codex actually review a script from this course.
Start the lesson
Goal: route each role to the right level and tool, and have Codex review, by reading only, what Claude built.
Levels from the training project's ROTEAMENTO.md. Model names change; the level stays. Click each level.
Rule 3 of ROTEAMENTO.md: review by another model catches errors the same model can't see. Rule 4: an agent calling an agent carries the project's instructions; for simple bridges, use a lean folder or claude --bare.
From the agente-claude-codex kit (prompts/05-usar-os-dois.md). It's an editorial starting point, not a measured ranking: change it when your own evidence calls for it.
One writes the plan with scope, assumptions, and acceptance tests, without implementing. The other reviews by reading only and attacks the assumptions.
At most two rounds of review. Output: plan v2 and a review file.
One implements on a branch (or worktree, lesson 5) and runs the tests. The other gets the briefing, the diff, and the test results, and looks for bugs and regressions before cosmetics.
No merge, deploy, or publishing without you.
Codex with a small, measurable goal, with the tests plus a human checkpoint as the finish line.
End: measured success or a clear block, never "almost."
What passes from one to the other is files: AGENTS.md, tasks/current.md, handoffs/latest.md. That's the subject of the video below.
The card's single rule: the second agent gets the same briefing and the real artifact, never a retelling.
runtime/pontes/codex-exec.sh sends the request through stdin, accepts only read-only and workspace-write, and returns the final answer.
cd ~/treino-multi && chmod +x runtime/pontes/codex-exec.sh
E=${TMPDIR:-/tmp}/ensaio-multi/ponte; rm -rf $E && mkdir -p $E/bin
cat > $E/bin/codex <<'SH'
#!/usr/bin/env bash
# FAKE codex: finds the -o and writes PONG to it (no model is called)
while [ $# -gt 0 ]; do [ "$1" = -o ] && out=$2; shift; done
cat > /dev/null; echo PONG > "$out"
SH
chmod +x $E/bin/codex
PATH=$E/bin:$PATH runtime/pontes/codex-exec.sh "Responda apenas PONG"; echo "saída: $?"
PATH=$E/bin:$PATH runtime/pontes/codex-exec.sh "apague tudo" . danger-full-access; echo "saída: $?"cd ~/treino-multi runtime/pontes/codex-exec.sh "Responda apenas PONG"; echo runtime/pontes/codex-exec.sh "Review, without changing anything, the gera-avalia.sh file in this project. Look for real bugs and risks, not style. Answer in at most 6 lines; the last line is APROVADO or FALTA: <what to fix>." > revisao-codex.txt cat revisao-codex.txt
# Codex review of gera-avalia.sh — <date> aceito: a generator that fails or hits the cap was still being evaluated and could approve leftovers from a previous round → a round with rc≠0 is now REPROVADO without evaluating (lesson 4, tab "Generator crashed") aberto: verificar.mjs runs the goal.md commands as bash → the goal must be a trusted, protected file (course 1: frozen tests; course 4: what the agent can read and run) agreement is not proof: what confirms each "aceito" is running the rehearsal again
## ensaio (codex falso) PONG saída: 0 sandbox recusado pela POLITICA: danger-full-access saída: 2 ## real (Codex CLI 0.163.0, pela assinatura) PONG - Se `claude`/`timeout` falhar ou atingir o limite, o script ignora o erro e ainda pode aprovar arquivos deixados por uma rodada anterior. - `verificar.mjs` executa como Bash os comandos do `goal.md`; um arquivo não confiável pode executar ações arbitrárias. - FALTA: abortar ou reprovar quando o gerador falhar e restringir a execução de goals a arquivos confiáveis.
The review was done on the first version of gera-avalia.sh. The first finding was real and was fixed (the lesson 4 version is already the fixed one); the second stayed open, with an owner in another course. The ## headings separate the runs.
With no request on the command line and the input still open, codex exec keeps reading stdin and never exits. Captured with a sleep holding the input open and an 8 s cap:
$ sleep 20 | timeout 8 codex exec -s read-only --skip-git-repo-check; echo "saída: $?" Reading prompt from stdin... saída: 124
Without the timeout, it would stay stuck. The bridge sends the request through stdin and closes it with -; use -o to write only the final message and, in CI, --json for progress as events.
Rehearse the bridge, then do a real cross-review.
Run the rehearsal with the fake codex.
Done when: PONG and saída: 0; then sandbox recusado pela POLITICA: danger-full-access and saída: 2.
Run the bridge for real on gera-avalia.sh (or on a diff of your own: git diff main...HEAD > diff.txt and ask for a review of diff.txt). Write revisao.md with one line per finding.
Done when: tail -1 revisao-codex.txt | grep -cE '^-? ?(APROVADO|FALTA:)' → 1 (the last line carries the verdict; Codex sometimes puts "- " in front), and grep -cE "^(aceito|rejeitado|aberto):" revisao.md equals the number of findings.
Question 1 of 4
Where should you start the level for a new role?skill
Question 2 of 4
What should the Codex reviewer receive?skill
Question 3 of 4
The bridge received the danger-full-access sandbox. What happens?
Question 4 of 4
Codex pointed out two findings. What do you do with them?
Choose one option. The explanation appears after your attempt.