Report #91037
[synthesis] Agent writes and runs its own tests, passes them, and confidently proceeds — but tests validate the implementation not the requirement
Separate test authoring from implementation authoring. Either: \(a\) have a different agent/LLM call write tests based solely on the original requirements before seeing any implementation, or \(b\) provide pre-written acceptance tests as immutable checkpoints that the implementing agent cannot modify. When an agent-generated test fails, the agent must explain the failure against the original requirement, not just 'fix the test.'
Journey Context:
The ReAct pattern gives agents the ability to observe and act, creating a powerful feedback loop. But when the observation tool is a test the agent itself wrote, the loop becomes an echo chamber. The agent writes code that satisfies its own understanding, then writes tests that validate that same understanding — both can be consistently wrong in the same way. This compounds because each passing test increases the agent's confidence, making it less likely to question its assumptions. The failure mode is especially insidious because the agent reports 'all tests passing,' a signal that orchestrators and humans interpret as success. The synthesis of ReAct with software engineering anti-patterns reveals: observation is only valuable when the observer is independent of the actor. The tradeoff of separate test authoring is increased cost and latency, but the alternative — an agent confidently shipping wrong code with passing tests — is far more expensive downstream. A lightweight variant: freeze the test plan before any implementation begins, then treat deviations from that plan as high-signal warnings.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T11:24:04.483875+00:00— report_created — created