<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: daniel gotlib</title>
    <description>The latest articles on DEV Community by daniel gotlib (@dgotlieb).</description>
    <link>https://dev.to/dgotlieb</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4093253%2Fcfa38a7b-8b6c-46f2-b89c-018e09eaea74.jpg</url>
      <title>DEV Community: daniel gotlib</title>
      <link>https://dev.to/dgotlieb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dgotlieb"/>
    <language>en</language>
    <item>
      <title>Your coding agent shouldn't run pytest</title>
      <dc:creator>daniel gotlib</dc:creator>
      <pubDate>Tue, 25 Aug 2026 03:14:13 +0000</pubDate>
      <link>https://dev.to/dgotlieb/your-coding-agent-shouldnt-run-pytest-4ak1</link>
      <guid>https://dev.to/dgotlieb/your-coding-agent-shouldnt-run-pytest-4ak1</guid>
      <description>&lt;p&gt;&lt;em&gt;First post in a build-in-public series about &lt;a href="https://github.com/Dgotlieb/verdict-mcp" rel="noopener noreferrer"&gt;verdict&lt;/a&gt;, an MCP server that gives coding agents structured, sandboxed test feedback.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Watch a coding agent work and you'll see it run &lt;code&gt;pytest&lt;/code&gt; in your shell, unsandboxed, and then push 40,000 tokens of raw output through its context window to answer one question: &lt;em&gt;did my change break anything?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That's three problems in one command:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Token waste.&lt;/strong&gt; The agent needs ~10 lines of signal and pays for a wall of dots, warnings, and tracebacks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No sandbox.&lt;/strong&gt; The tests run on your machine, in your environment, with your files writable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No memory.&lt;/strong&gt; When a test fails, the agent can't tell whether &lt;em&gt;it&lt;/em&gt; broke it or whether it was broken before it arrived - so it either "fixes" pre-existing failures nobody asked about, or ships regressions it assumes were already there.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;verdict is an MCP server that replaces the pytest shell-out with four tools:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;tool&lt;/th&gt;
&lt;th&gt;what it returns&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;verify(scope?)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;impact-selected tests, run in an ephemeral container, as a ~400-token typed verdict&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;explain_failure(check_id)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;the full traceback - only on demand&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;history(fingerprint)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;first seen / last seen / times seen for a failure&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;run_checks(["ruff","mypy"])&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;lint &amp;amp; type checks, same verdict shape&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;▶️ &lt;a href="https://github.com/Dgotlieb/verdict-mcp#readme" rel="noopener noreferrer"&gt;Watch the 30-second demo&lt;/a&gt; - Claude Code fixing a bug with verdict verifying in a container.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three ideas
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Verdicts, not output.&lt;/strong&gt; &lt;code&gt;verify&lt;/code&gt; returns typed JSON: counts, per-failure message + location, and nothing else. Full tracebacks live behind &lt;code&gt;explain_failure&lt;/code&gt;. The whole verdict for a real failing run is ~400 tokens - the raw pytest output it replaces was ~40k. The design rule in the repo is blunt: &lt;em&gt;nothing bulky rides in the summary, ever.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Fingerprints give failures identity.&lt;/strong&gt; Every failure is hashed from its &lt;em&gt;normalized&lt;/em&gt; signature - volatile tokens (addresses, tmp paths, ids, durations) collapsed first. Same logical failure ⇒ same fingerprint, across runs and refactors. Fingerprints are what make the third idea possible:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. History answers "was it me?"&lt;/strong&gt; verdict keeps a small SQLite db per project. Every failure in a verdict carries &lt;code&gt;preexisting: true|false&lt;/code&gt; - &lt;em&gt;this exact failure was known before your change&lt;/em&gt; vs. &lt;em&gt;never seen it, it's yours&lt;/em&gt;. In the demo session that flag is the difference between an agent politely ignoring long-standing breakage and an agent burning a session "fixing" it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sandboxing posture (v0.1, honest version)
&lt;/h2&gt;

&lt;p&gt;Checks run in an ephemeral container (podman preferred, docker fallback, auto-detected - with liveness checks, because a podman binary with a stopped VM is worse than no podman at all). The worktree is mounted &lt;strong&gt;read-only&lt;/strong&gt; at &lt;code&gt;/src&lt;/code&gt;, copied to a writable &lt;code&gt;/work&lt;/code&gt; inside, and the check run gets &lt;code&gt;--network=none&lt;/code&gt;. Configured &lt;code&gt;setup_cmd&lt;/code&gt; runs &lt;em&gt;with&lt;/em&gt; network before the check; a prebuilt image is the tighter posture. No engine? An explicit &lt;code&gt;prefer = "local"&lt;/code&gt; fallback still runs against a temp copy - and if verdict ever runs somewhere other than where you configured, it says so in the verdict (&lt;code&gt;runner_note&lt;/code&gt;). No silent degradation is a design rule.&lt;/p&gt;

&lt;p&gt;Known gaps are written down in SECURITY.md rather than hand-waved: no resource limits yet, &lt;code&gt;setup_cmd&lt;/code&gt; is network-open by design.&lt;/p&gt;

&lt;h2&gt;
  
  
  What dogfooding found (the embarrassing part)
&lt;/h2&gt;

&lt;p&gt;I wired verdict into Claude Code and asked it to fix a bug. Two things surfaced in the first hour that the 26-test suite had missed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Impact selection had never actually run.&lt;/strong&gt; The server ships as a console script, so the target project was never importable from its venv - grimp couldn't build the import graph, and selection silently(-ish) fell back to the full suite every time. My own test had papered over this with a &lt;code&gt;sys.path&lt;/code&gt; hack and an "honest fallback is acceptable" escape hatch. Deleted both, fixed for real.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every scoped run executed the whole suite.&lt;/strong&gt; &lt;code&gt;pytest --json-report-omit&lt;/code&gt; takes &lt;code&gt;nargs='+'&lt;/code&gt;… and the test paths came right after it. pytest swallowed them as omit values. Ten characters of argument reordering.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both bugs made the headline feature a no-op while all tests were green. The suite now has the tests that would have caught them - written by breaking the real thing first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Numbers from a real repo
&lt;/h2&gt;

&lt;p&gt;Cloned &lt;a href="https://github.com/theskumar/python-dotenv" rel="noopener noreferrer"&gt;python-dotenv&lt;/a&gt; (255 tests), dropped in a two-line &lt;code&gt;verdict.toml&lt;/code&gt;, no other changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;full suite in a container, deps installed on the fly: 255 tests, green, ~146s (dominated by &lt;code&gt;pip install&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;touch one hub module (&lt;code&gt;variables.py&lt;/code&gt;) → impact selection runs 184 tests, skips ~70, and says exactly how approximate the selection is in &lt;code&gt;selection_note&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That 146s is the next mountain: env setup needs caching (image reuse keyed on deps, result cache keyed on tree hash) before verify feels instant. That's v0.2, and it's written down as v0.2 - scope discipline is also a feature.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"verdict"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"uvx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"verdict-mcp"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"VERDICT_PROJECT"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"."&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;pip install verdict-mcp&lt;/code&gt; / &lt;code&gt;uvx verdict-mcp&lt;/code&gt;. Apache-2.0. Demo video and the full threat model in the &lt;a href="https://github.com/Dgotlieb/verdict-mcp" rel="noopener noreferrer"&gt;repo&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>mcp</category>
      <category>python</category>
      <category>testing</category>
    </item>
  </channel>
</rss>
