How to Catch Silent Regressions Before Upgrading Your Coding Agent (A/B Sandbox Harness in Stdlib Python)
When we switched an autonomous Python coding scaffold between prompt variants and model fallbacks, overall unit test pass rates looked fine on the surface. Inside the diffs, however, subtle regressions crept in:
- Swallowed exceptions (
except Exception: passor returning0.0on division by zero) - Unbounded
Path(root) / user_reljoins that allowed../traversal - Hidden SSRF holes accepting
http://169.254.169.254/latestor127.0.0.1 - Module-level regex compilation breaking import-time instrumentation fences
None of those are tested by standard algorithmic coding puzzles. Every one of them passes naive happy-path tests while silently degrading production safety.
Why Candidate Patches Need Disposable Sandboxes
Never evaluate candidate coding-agent edits directly inside your live working tree:
- An accepted patch mutates the repository for every subsequent task, making task 5 depend on task 2.
- Failed or partial writes leave orphan modules or corrupt syntax behind.
- Without clean A/B comparison against a baseline arm, you cannot measure regressions separately from net pass rate.
In zmb_eval_suite, every single sample executes inside a fresh tempfile.TemporaryDirectory:
- Pre-screen the generated source with
ast.parse()and an AST handler check that rejects silentexcept: passblocks before running anything. - Write the candidate module and its verification unit test into the isolated temp directory.
- Run the isolated test subprocess with a strict 10-second timeout.
- Compute unbiased
pass@k, wall-clock latency, net delta (Arm B vs Arm A), improvements, and exact regressions.
15 Real Agent Failure-Mode Tasks
Instead of synthetic toy puzzles, EVAL_TASKS pins concrete engineering invariants observed across autonomous coding loops:
-
AST & Dead-Code Safety: rejecting silent
except: pass, spotting unreferenced orphan modules, detecting top-levelcompile()calls, rejecting syntax-empty stubs -
Security & Secret Hygiene: path containment (
relative_to), public-only URL validation blocking localhost/link-local metadata IPs, secret token redaction, HTML escaping -
Operations & Governance: Windows hidden-console process flags (
0x08000200), fail-closed file-path push classification, bounded exponential backoff, schema-safe JSONL parsing, and cross-link extraction
Running --demo against the built-in buggy baseline arm vs the hardened reference arm outputs a clean Markdown table and self-contained dark-mode HTML scorecard ready for PR reviews.
If you want the turnkey zero-dependency zmb_eval_suite package (all 15 tasks, BenchmarkRunner, pass@k, and HTML/Markdown scorecards) for EUR 24:
Top comments (0)