cd /news/developer-tools/how-i-caught-an-ai-generated-python-… · home topics developer-tools article
[ARTICLE · art-93554] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=· neutral

How I caught an AI-generated Python regression that the tests missed -hackathon project

A developer built Cross-Examine, a verification harness for Python changes that replays observed behavior from a base Git revision against a proposed revision to catch regressions that existing tests miss. The tool, developed during OpenAI Build Week with Codex and GPT-5.6, uses deterministic execution for verdicts and preserves receipts with reproducing inputs and outputs. It is Python-only and runs only on trusted repositories, with an offline demo available on GitHub.

read2 min views3 publishedAug 12, 2026

The change was small, the diff looked sensible, and the existing tests passed.

Then I tried an empty list.

The original function returned []. The revised version returned None. Nothing immediately crashed, but code expecting a list had quietly received a different contract.

That gap is why I built Cross‑Examine.

Cross‑Examine is a verification harness for Python changes. Given a base Git revision and a proposed revision, it captures observed behavior from the base, then replays the same inputs against the changed code.

When behavior differs, it preserves a receipt:

Input: []

Base output: []

Head output: None

Verdict: BROKEN

The receipt includes the reproducing input, the exact command, and captured output from both revisions. It is meant to be something a developer can inspect and rerun, rather than a confidence score from a model.

The model has a deliberately limited role. GPT‑5.6 proposes behavior worth checking through a constrained schema, but it cannot produce a verdict. Deterministic execution runs the comparison, and a pure aggregation step decides the result. Cross‑Examine also runs bounded, derandomized Hypothesis examples to look for counterexamples beyond the initial proposal.

The idea is not that a tool can prove a PR correct. It is narrower: when an AI-generated change looks plausible and the tests are green, replay behavior that already existed and see whether the change still keeps its promises.

Cross‑Examine is currently Python-only, supports a bounded set of call shapes, and should run only on repositories you trust. It executes target code, so it is not a sandbox. Those limits are intentional. An honest UNVERIFIABLE result is better than an unearned “safe.”

I built it during OpenAI Build Week with Codex and GPT‑5.6. Codex helped implement the system. At runtime, GPT‑5.6 proposes checks, while deterministic code owns the verdict.

The repository includes an offline demo that recreates the empty-list regression without an API key:

https://github.com/stefbuilds/cross-examine I’d be interested in where behavior replay would help in your workflow, and where you would be cautious about relying on it.

── more in #developer-tools 4 stories · sorted by recency
── more on @cross-examine 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-i-caught-an-ai-g…] indexed:0 read:2min 2026-08-12 ·