← Back to capsules
DevOps AI TDD Git

The witness and the accused were the same

Published on October 23, 2026

𝗧𝗵𝗲 𝘄𝗶𝘁𝗻𝗲𝘀𝘀 𝗮𝗻𝗱 𝘁𝗵𝗲 𝗮𝗰𝗰𝘂𝘀𝗲𝗱 𝘄𝗲𝗿𝗲 𝘁𝗵𝗲 𝘀𝗮𝗺𝗲

My AI agent would tell me "I ran the test, it failed, I wrote the code and now it passes" ✅ … and I believed it 😅 Until it hit me: the one doing the work and the one certifying it was fine were the same.

In the harness I built, every acceptance criterion is worked with 𝗧𝗗𝗗: first the test goes 𝗿𝗲𝗱, then the code turns it 𝗴𝗿𝗲𝗲𝗻. At first, the evidence of that cycle was text written by the agent itself. That's not proof, it's 𝘁𝗲𝘀𝘁𝗶𝗺𝗼𝗻𝘆.

The fix was to pull the truth from a place that can't be dressed up: 𝗴𝗶𝘁 💻

→ The agent writes only the test and the engine runs it: if it doesn't fail, it can't move on. It saves a "snapshot" of the repo

→ It writes the code, the engine runs the test again: it has to pass. Another snapshot

→ The proof that 𝗧𝗗𝗗 happened is the diff between both snapshots, not what the AI says

→ On every PR, 𝗖𝗜 replays those snapshots and verifies everything again

And building it taught me a few lessons in humility 🔥

→ My gate accepted a green that said "1 failed": it validated the red, but never looked at the green

→ It rejected the most common red of all ("module not found"), because Jest reports it as 0 tests

→ With the code already written, touching the test was enough to fool the gate. Now the test doesn't count as new code and can't lose lines after the green

Is it unfakeable? No. But cheating stopped being an accident: now it's deliberate and it leaves a record 💪 Because a 𝗴𝗮𝘁𝗲 that depends on the agent remembering not to skip it… isn't a gate.

Part 2 of the series about my agent harness 🚀

How do you verify the AI actually did what it says it did? Tell me 👇

Keep flying, Champions! ✈️