Problem
Iron Rule 1 mandates that every Python block ends with open("/app/answer.txt","w").write(str(result)). In multi-step questions (retrieve year 1 → retrieve year 2 → compute), intermediate blocks overwrite each other. If the agent errors in a later block, answer.txt contains a wrong intermediate value that gets scored as the final answer.
The "stop after writing final answer" rule partially mitigates this, but it is a race condition in practice.
Fix
Use a staging pattern for intermediate blocks:
# Intermediate blocks — write to staging file
open("/app/answer_tmp.txt","w").write(str(partial_result))
# Final block only — promote to answer.txt
open("/app/answer.txt","w").write(str(final_result))
Or add an explicit instruction: "Only write to answer.txt in the final computation block. Use answer_tmp.txt for intermediate results."
Impact
Medium — affects multi-step numerical questions where partial results are meaningful numbers that would pass tolerance checks.
Problem
Iron Rule 1 mandates that every Python block ends with
open("/app/answer.txt","w").write(str(result)). In multi-step questions (retrieve year 1 → retrieve year 2 → compute), intermediate blocks overwrite each other. If the agent errors in a later block,answer.txtcontains a wrong intermediate value that gets scored as the final answer.The "stop after writing final answer" rule partially mitigates this, but it is a race condition in practice.
Fix
Use a staging pattern for intermediate blocks:
Or add an explicit instruction: "Only write to answer.txt in the final computation block. Use answer_tmp.txt for intermediate results."
Impact
Medium — affects multi-step numerical questions where partial results are meaningful numbers that would pass tolerance checks.