Join the conversation

Join the community of Machine Learners and AI enthusiasts.

Sign Up
vineeth98 
posted an update 4 days ago
Post
87
A coding agent in 5 files, plus a skeptic that catches fake fixes.

Coding agents are everywhere now, but almost nobody checks whether they actually fixed the bug — or just gamed the test. Tell one "make the failing test pass" and sometimes it fixes it; sometimes it edits the test, hardcodes the value, or stubs the function, then reports done . As people wire agents into CI and auto-merge, "tests are green" and "code is correct" quietly stop being the same claim.

So I built two things: a small coding agent from scratch (5 readable files — the loop, real tools, context compaction, a permission gate), and — the point — an independent **skeptic** that catches the fake fix.

The core idea will feel familiar if you do ML: you can't evaluate on the data you trained on. The skeptic runs a *hidden contract oracle* — it checks the code's behavior on inputs the agent never saw. A fix that games the visible test fails the held-out one, deterministically, no LLM needed. (A model judge reads the full diff on top as a second opinion, not the guarantee.)

Works with anything OpenAI-compatible — a HF Inference Endpoint / TGI (point OPENAI_BASE_URL at it), OpenRouter, or local Ollama/vLLM. Honest about limits: on your own repo you supply the held-out check, and the judge layer is model-sensitive (small models miss cheats AND false-reject real fixes — the README says so plainly).

Tests + a reproducible cheat-catch eval run in CI with no key. Feedback welcome — especially new cheats it should catch.

https://github.com/Saivineeth147/skeptic

Held-out is necessary, but the axis you vary matters more than the hiding.

We built a 26 operator kernel corpus for exactly this question (16 correct controls, 10 LLM-style buggy variants). The nastiest one was a matmul that assigns instead of accumulates inside the K loop. It is correct if and only if K == 1. A hidden test with fresh values but the same shape passes it just as happily as the visible test does.

What caught it was generating shapes, dtypes and seeds from the operator's schema, and computing the reference in float64 outside the thing under test. Coverage of the degenerate axis, not secrecy.

https://huggingface.co/datasets/dipankarsarkar/gpuemu-corpus

So the question for skeptic: is the contract oracle's input generator derived from the function's contract, or is it hand-written held-out cases? The first catches cheats nobody listed. The second only catches the ones you already imagined.

Which cheat took you longest to catch?