<?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: Jelly Tu</title>
    <description>The latest articles on DEV Community by Jelly Tu (@ztu29).</description>
    <link>https://dev.to/ztu29</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F99mvlsfu5tfj9m7ku25d.png</url>
      <title>DEV Community: Jelly Tu</title>
      <link>https://dev.to/ztu29</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ztu29"/>
    <language>en</language>
    <item>
      <title>I let a small local model write the refactor tests I was too lazy to write</title>
      <dc:creator>Jelly Tu</dc:creator>
      <pubDate>Sun, 25 Oct 2026 22:15:18 +0000</pubDate>
      <link>https://dev.to/ztu29/i-let-a-small-local-model-write-the-refactor-tests-i-was-too-lazy-to-write-482i</link>
      <guid>https://dev.to/ztu29/i-let-a-small-local-model-write-the-refactor-tests-i-was-too-lazy-to-write-482i</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week3-2026-10-19"&gt;Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Here is a refactor that passes every test and turns order &lt;code&gt;00123&lt;/code&gt; into &lt;code&gt;123&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The old code kept order IDs as strings. The new code is a cleanup: parse the ID as a number, give it back as a string. Every numeric ID still round-trips. &lt;code&gt;"00123"&lt;/code&gt; doesn't throw; it just comes back as &lt;code&gt;"123"&lt;/code&gt;. The only symptom would be a support ticket about an order nobody can find.&lt;/p&gt;

&lt;p&gt;That one is the demo example in the repo. The real one happened to me while building this tool. I added type checking to DiffWitness, which is about as innocent as a change gets. One benchmark case quietly went from 3/3 to 0/3. No error, no failing test. It went to 0/3 because the new filter threw away every input the small model proposed for that case. My tool for catching silent behavior changes had just shipped one.&lt;/p&gt;

&lt;p&gt;This is the kind of bug laziness creates. I don't write a test for &lt;code&gt;"00123"&lt;/code&gt; because I don't think of it. I don't think of it because the refactor felt safe.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DiffWitness&lt;/strong&gt; rewards the lazy move. I skip writing the edge-case test, and it writes one for me, but only after running both versions and seeing them disagree. You give it the old and new version of a function, or just say &lt;code&gt;--git HEAD~1&lt;/code&gt;. A small open-weight model (Gemma 4, running locally through Ollama) reads both versions and guesses inputs where they might disagree. Then DiffWitness &lt;strong&gt;runs both versions on every guess&lt;/strong&gt;. A difference counts only if execution shows it. Each real difference is shrunk to a minimal input, I label it &lt;em&gt;bug&lt;/em&gt; or &lt;em&gt;intended&lt;/em&gt;, and DiffWitness writes the vitest regression test for me.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The model proposes; execution decides.&lt;/strong&gt; Because every guess is checked by running it, a small, fast, local model is enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Ftuzhechen2005%2FDiffWitness%2Fmain%2Fdemo%2Fdemo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Ftuzhechen2005%2FDiffWitness%2Fmain%2Fdemo%2Fdemo.gif" alt="DiffWitness finds the leading-zero bug, exports failing regression tests, then checks a rounding refactor" width="800" height="667"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The model's guess was &lt;code&gt;"00123"&lt;/code&gt;. DiffWitness shrank it to the smallest input that still shows the bug (excerpt from the replay run):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  #2  normalizeOrderId("00")
      old → "00"
      new → "0"
      model args: ("00123")
      shrunk in 6 steps; why: SILENT DIVERGENCE: OLD preserves leading zeros, but NEW (via parseInt) strips them.
  …

Random fuzzing: 477 of 2000 runs diverged, 32 silent (both returned); sample shrank to 18 distinct repros
Model:          7 of 8 hypotheses diverged, 2 silent, 5 distinct repros
Coverage:       old 2/2, new 2/2 branches reached by model inputs
  random repros: ("N") ("9/") ("-") ("6=") ("T") ("e") ("X") ("W") ("1T") ("5:") …
  model repros:  ("A") ("O") ("00") ("1A") ("1.")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The bottom two lines are the honest comparison. Random fuzzing also finds &lt;em&gt;a lot&lt;/em&gt; of differences here, but they're noise like &lt;code&gt;"9/"&lt;/code&gt; and &lt;code&gt;"6="&lt;/code&gt;. The model's repros each point at a behavior you can name: letters rejected, leading zeros dropped, trailing letters truncated.&lt;/p&gt;

&lt;p&gt;I labeled them &lt;code&gt;bug&lt;/code&gt;, and DiffWitness wrote this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bug: normalizeOrderId(&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;00&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;normalizeOrderId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;00&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;00&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;It fails against the new code, which is exactly what I want. Labeling a difference &lt;code&gt;intended&lt;/code&gt; pins the new behavior instead. The tool never decides which version is right; I do.&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/tuzhechen2005" rel="noopener noreferrer"&gt;
        tuzhechen2005
      &lt;/a&gt; / &lt;a href="https://github.com/tuzhechen2005/DiffWitness" rel="noopener noreferrer"&gt;
        DiffWitness
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A local Gemma 4 model hunts for inputs where your refactor changed behavior; running both versions confirms every finding.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;DiffWitness&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Your refactor passed every test. It also turned order &lt;code&gt;00123&lt;/code&gt; into &lt;code&gt;123&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/tuzhechen2005/DiffWitness/demo/demo.gif"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Ftuzhechen2005%2FDiffWitness%2FHEAD%2Fdemo%2Fdemo.gif" alt="DiffWitness finding the leading-zero bug, exporting failing regression tests, then checking a rounding refactor"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Recorded with &lt;code&gt;--replay&lt;/code&gt;: real Gemma 4 e4b replies captured from a live run, so the GIF is reproducible. Regenerate with &lt;code&gt;vhs demo/demo.tape&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;DiffWitness checks whether two versions of a pure TypeScript function still behave the same. A local open-weight model (Gemma 4 e4b, via Ollama) reads both versions and proposes inputs where they might differ. DiffWitness then runs both versions on every proposed input. Execution decides whether a difference is real; the model's opinion does not. Each real difference is shrunk to a minimal repro, you label it &lt;em&gt;bug&lt;/em&gt; or &lt;em&gt;intended&lt;/em&gt;, and DiffWitness writes a vitest regression file.&lt;/p&gt;

&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;
&lt;pre class="notranslate"&gt;&lt;code&gt;  #2  normalizeOrderId("00")
      old → "00"
      new → "0"
      model args: ("00123")
      shrunk in 6 steps; why: SILENT DIVERGENCE: OLD preserves leading zeros, but NEW (via parseInt) strips them
Random fuzzing: 477 of 2000 runs diverged,&lt;/code&gt;&lt;/pre&gt;…&lt;/div&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/tuzhechen2005/DiffWitness" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;No GPU? Every example has recorded real Gemma replies, so this runs anywhere:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/tuzhechen2005/DiffWitness &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;DiffWitness &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm ci
npm run diffwitness &lt;span class="nt"&gt;--&lt;/span&gt; examples/order-id/old.ts examples/order-id/new.ts &lt;span class="nt"&gt;--replay&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With a model, from your own project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama pull gemma4:e4b
node /path/to/DiffWitness/bin/diffwitness.mjs old.ts new.ts      &lt;span class="c"&gt;# two files&lt;/span&gt;
node /path/to/DiffWitness/bin/diffwitness.mjs &lt;span class="nt"&gt;--git&lt;/span&gt; HEAD~1       &lt;span class="c"&gt;# changed exported functions since HEAD~1, incl. uncommitted edits&lt;/span&gt;
node /path/to/DiffWitness/bin/diffwitness.mjs hook &lt;span class="nb"&gt;install&lt;/span&gt;       &lt;span class="c"&gt;# check every commit from now on&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That last line is the laziest version. The pre-commit hook checks each staged function against &lt;code&gt;HEAD&lt;/code&gt; and prints what changed. If Ollama is down, it gets out of the way: it prints one line and lets the commit through.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;The pipeline:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Load&lt;/strong&gt; each version with the TypeScript compiler API. In git mode, esbuild bundles the function with its local imports and pure npm dependencies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instrument&lt;/strong&gt; every branch arm (&lt;code&gt;if&lt;/code&gt;/&lt;code&gt;else&lt;/code&gt;, &lt;code&gt;?:&lt;/code&gt;, &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt;/&lt;code&gt;||&lt;/code&gt;/&lt;code&gt;??&lt;/code&gt;, &lt;code&gt;switch&lt;/code&gt;, &lt;code&gt;catch&lt;/code&gt;) with a counter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask Gemma&lt;/strong&gt; for up to eight inputs. The prompt includes both sources and the parameter types from the TypeScript checker.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check the guesses before running them.&lt;/strong&gt; Malformed JSON gets one retry. Inputs that violate the declared types are dropped.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run both versions&lt;/strong&gt; in a fresh &lt;code&gt;vm&lt;/code&gt; context inside a worker thread, with a timeout. Compare outcomes: return value (with &lt;code&gt;Object.is&lt;/code&gt; semantics, so &lt;code&gt;-0&lt;/code&gt; ≠ &lt;code&gt;0&lt;/code&gt;), thrown error type, or timeout.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Round two&lt;/strong&gt;, if needed: send the model the real results &lt;em&gt;and the source lines no input has reached yet&lt;/em&gt;, and ask again.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shrink&lt;/strong&gt; each difference to a minimal input, keeping the same kind of outcome on both sides. Then label, and export vitest tests.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A small model works here because a wrong guess is cheap: it costs one paired execution and then it's gone. The model doesn't have to be right. It only has to be a better guesser than random.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does it beat random?
&lt;/h3&gt;

&lt;p&gt;I wrote 22 refactors with one planted &lt;em&gt;silent&lt;/em&gt; bug each (both versions return normally, with different values) and adapted 3 real query-string bug fixes. Each case ran 3 times per model (the real fixes on e4b only), plus 2,000 seeded random inputs generated from the declared parameter types.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;corpus&lt;/th&gt;
&lt;th&gt;Gemma 4 e4b&lt;/th&gt;
&lt;th&gt;Gemma 4 e2b&lt;/th&gt;
&lt;th&gt;random fuzzing&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;10 everyday refactors&lt;/td&gt;
&lt;td&gt;30/30&lt;/td&gt;
&lt;td&gt;29/30&lt;/td&gt;
&lt;td&gt;0 hits in 3 of 10 cases&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12 rare-edge refactors&lt;/td&gt;
&lt;td&gt;34/36&lt;/td&gt;
&lt;td&gt;29/36&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0 hits in all 12 (24,000 inputs)&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3 real query-string bug fixes&lt;/td&gt;
&lt;td&gt;9/9&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;0 hits in 1 of 3&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The e4b rows were recorded on earlier versions of the pipeline (before type filtering; the everyday row also before coverage feedback). The e2b rows use the final one. Details per run: &lt;a href="https://github.com/tuzhechen2005/DiffWitness/blob/main/bench/experiments/README.md" rel="noopener noreferrer"&gt;&lt;code&gt;bench/experiments/README.md&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The rare-edge set is where it gets interesting. Examples: &lt;code&gt;&amp;gt;=&lt;/code&gt; became &lt;code&gt;&amp;gt;&lt;/code&gt; at exactly 10,000; a shared &lt;code&gt;/g&lt;/code&gt; regex keeps &lt;code&gt;lastIndex&lt;/code&gt; between calls; &lt;code&gt;slice&lt;/code&gt; cuts an emoji in half; &lt;code&gt;|| 0&lt;/code&gt; turns &lt;code&gt;-0&lt;/code&gt; into &lt;code&gt;0&lt;/code&gt;. Random inputs essentially never land on those values. A model reading the diff sees the &lt;code&gt;&amp;gt;&lt;/code&gt; and tries &lt;code&gt;10000&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does feeding coverage back actually help?
&lt;/h3&gt;

&lt;p&gt;I ran the same pipeline with the uncovered-lines feedback switched off:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;gemma4:e2b&lt;/th&gt;
&lt;th&gt;feedback on&lt;/th&gt;
&lt;th&gt;feedback off&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;rare-edge refactors&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;29/36&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;22/36&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;everyday refactors&lt;/td&gt;
&lt;td&gt;29/30&lt;/td&gt;
&lt;td&gt;28/30&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The gains came where I'd hoped: bugs hiding behind a branch the first round never reached. &lt;code&gt;premium-boundary&lt;/code&gt; went from 0/3 to 2/3. With the larger e4b model the difference was within noise, because e4b was already near the ceiling. So coverage feedback mostly lets a &lt;em&gt;smaller, faster&lt;/em&gt; model do the job.&lt;/p&gt;

&lt;h3&gt;
  
  
  Real history
&lt;/h3&gt;

&lt;p&gt;Planted bugs are a controlled test. I also wanted to see what happens on code I didn't write, so I pointed git mode at 27 real commits from &lt;a href="https://github.com/toss/es-toolkit" rel="noopener noreferrer"&gt;es-toolkit&lt;/a&gt;, &lt;a href="https://github.com/sodiray/radash" rel="noopener noreferrer"&gt;radash&lt;/a&gt; and &lt;a href="https://github.com/date-fns/date-fns" rel="noopener noreferrer"&gt;date-fns&lt;/a&gt;, one &lt;code&gt;--git &amp;lt;sha&amp;gt;~1..&amp;lt;sha&amp;gt;&lt;/code&gt; run each:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;commit kind&lt;/th&gt;
&lt;th&gt;commits&lt;/th&gt;
&lt;th&gt;found a behavior difference&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;bug fix&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;feature&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;refactor / perf&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All 27 bundled and ran, with their real imports, in about 45 seconds each. For fixes, a difference is the point: a concrete input showing what the commit changed, which a reviewer would label &lt;code&gt;intended&lt;/code&gt;. For the three commits that weren't supposed to change behavior, DiffWitness found nothing. That isn't a proof, and I haven't yet hand-checked every difference against the fix's intent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;A refactor-checking tool has to read your source code. With a closed API, every function you change gets sent to someone else's server. With an open-weight model on local hardware (in my case, a gaming laptop's RTX 4060 on my home network), there is no API key, no per-token bill, and no question about where proprietary code goes.&lt;/p&gt;

&lt;p&gt;Open weights also let me &lt;em&gt;measure&lt;/em&gt; instead of guess. I could run two Gemma sizes on the same benchmark and see the tradeoff: e2b took about half of e4b's runtime, and with coverage feedback it found 29 of 30 everyday bugs (e4b found 30 of 30, measured on an earlier pipeline version).&lt;/p&gt;

&lt;p&gt;And because the evaluation is open, anyone can check my numbers. The benchmark cases, the raw result tables, the code version behind each run, and the recorded model replies are all in the repo. That includes the results that didn't flatter the tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Agent Session
&lt;/h2&gt;

&lt;p&gt;I built this in one Hack Day with a team of AI agents, in four steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A grilling session first.&lt;/strong&gt; An agent interviewed me until the spec had no open decisions: JSON-only inputs, worker+vm isolation, the shrinking rule, the label semantics. One plan didn't survive it: I was going to use fast-check for shrinking, but fast-check needs typed generators, and my inputs arrive from the model as plain JSON. So I wrote a 90-line JSON shrinker instead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contracts before code.&lt;/strong&gt; I committed &lt;code&gt;types.ts&lt;/code&gt; and stub signatures, so parallel work couldn't drift apart.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One issue per module, one fresh agent per issue.&lt;/strong&gt; Claude Code subagents and Codex Cloud tasks each worked in their own context and git worktree. No agent had to hold the whole project in its head.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An independent reviewer for every PR&lt;/strong&gt;, with a checklist aimed at the failure modes that matter for this tool.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The reviewers caught bugs that every happy-path test passed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A missing replay file returned zero hypotheses, so the report said "no divergence found" without testing anything.&lt;/li&gt;
&lt;li&gt;Two &lt;code&gt;async&lt;/code&gt; functions both returned a Promise, which compared as "the same outcome" no matter what they resolved to.&lt;/li&gt;
&lt;li&gt;In git mode, a function that crashed on a missing global threw the same &lt;code&gt;ReferenceError&lt;/code&gt; on both sides, which also looked like "no divergence". Now the report says &lt;em&gt;the function never ran&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;The type filter dropped valid inputs for parameters typed &lt;code&gt;T | undefined&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A fallback in the pre-commit hook would have run &lt;code&gt;npx diffwitness&lt;/code&gt;, an &lt;strong&gt;unpublished&lt;/strong&gt; package name. Anyone who registered it could have run code on every commit.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Four of the five are the same bug in different clothes: the tool reported "no divergence" when the truth was "I didn't actually test anything." For a tool like this, staying silent is the most dangerous output.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Lazy Payoff
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tests I didn't write:&lt;/strong&gt; for the order-ID refactor, five regression tests, each pinned to a minimal input, generated by one command and then labeled by me.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bugs a careful random fuzzer missed:&lt;/strong&gt; 12 out of 12 rare-edge cases at 2,000 inputs each, found by the model in 29–34 of 36 runs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Setup I have to remember:&lt;/strong&gt; none. &lt;code&gt;hook install&lt;/code&gt; once, and every commit gets checked.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Did I use it this week?&lt;/strong&gt; Yes. I pointed it at 27 real commits in three popular libraries (results above).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The fine print, in one place: Node's &lt;code&gt;vm&lt;/code&gt; is not a security sandbox, so use this on code you trust. "No divergence found" is evidence, not proof. Three runs per case is a small sample. And DiffWitness only handles pure, synchronous functions with JSON-shaped inputs, which turns out to be a lot of the code I actually refactor.&lt;/p&gt;

&lt;p&gt;Being lazy is fine. Being lazy &lt;em&gt;and&lt;/em&gt; having a witness is better.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Best Use of Gemma.&lt;/strong&gt; Gemma 4 (e4b and e2b) runs locally through Ollama and is the part that makes the project work: it generates the hypotheses that execution then confirms. The benchmark compares the two sizes directly. The smaller e2b, with coverage feedback, found 29 of 30 everyday bugs at about half e4b's runtime. Small open weights are enough when execution checks every guess.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>opensource</category>
      <category>testing</category>
    </item>
  </channel>
</rss>
