<?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: Matthew Watkins</title>
    <description>The latest articles on DEV Community by Matthew Watkins (@matmusmeows).</description>
    <link>https://dev.to/matmusmeows</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%2F4110341%2Fef717ced-43da-4e9d-8a18-c00572036073.png</url>
      <title>DEV Community: Matthew Watkins</title>
      <link>https://dev.to/matmusmeows</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/matmusmeows"/>
    <language>en</language>
    <item>
      <title>Threadmoth: a deterministic, source-preserving mutation boundary for AI coding agents</title>
      <dc:creator>Matthew Watkins</dc:creator>
      <pubDate>Fri, 04 Sep 2026 20:32:45 +0000</pubDate>
      <link>https://dev.to/matmusmeows/threadmoth-a-deterministic-source-preserving-mutation-boundary-for-ai-coding-agents-2a2g</link>
      <guid>https://dev.to/matmusmeows/threadmoth-a-deterministic-source-preserving-mutation-boundary-for-ai-coding-agents-2a2g</guid>
      <description>&lt;p&gt;I kept seeing the same failure in AI-assisted coding: the agent chose the right change, then applied it through an improvised mix of sed, regex replacement, patches, one-off scripts, direct writes, or whole-file rewrites.&lt;/p&gt;

&lt;p&gt;The problem is not that those tools are bad. The problem is that each path has different rules for ambiguity, stale state, preservation, failure, and evidence. The agent is left responsible for deciding whether the final write was safe.&lt;/p&gt;

&lt;p&gt;So I built Threadmoth, a small Rust CLI for the last mile of repository editing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The boundary
&lt;/h2&gt;

&lt;p&gt;Threadmoth turns a requested mutation into a narrow pipeline:&lt;/p&gt;

&lt;p&gt;OBSERVE → IDENTIFY → GUARD → MUTATE → VERIFY → CERTIFY&lt;/p&gt;

&lt;p&gt;It checks the bytes it read, identifies the intended target, refuses ambiguous or stale requests, applies only the authorised effect, reads the result back, and returns machine-readable evidence.&lt;/p&gt;

&lt;p&gt;The current implementation includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;exact identity and stale-file checks;&lt;/li&gt;
&lt;li&gt;cardinality refusal when a target is ambiguous;&lt;/li&gt;
&lt;li&gt;Tree-sitter structural targeting for code and web formats;&lt;/li&gt;
&lt;li&gt;explicit effect budgets;&lt;/li&gt;
&lt;li&gt;source-preserving byte edits;&lt;/li&gt;
&lt;li&gt;guarded multi-file transactions with recovery; and&lt;/li&gt;
&lt;li&gt;post-write certificates containing hashes, changed ranges, bounded diff evidence, and commit verification.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The important design constraint is that Threadmoth does not try to replace specialist tools. rustfmt, Prettier, Black, gofmt, jq, AST tooling, and similar tools can still decide the desired state. Threadmoth bounds and verifies what lands.&lt;/p&gt;

&lt;p&gt;The parser gets to point at the cloth. It doesn’t get to re-weave it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I’m testing
&lt;/h2&gt;

&lt;p&gt;Threadmoth 1.5.1 is released for Windows and Linux under the MIT license. Hosted Linux and Windows CI passed. Local correctness-checked runs reported 8/8 tough cases with zero wrong mutations, and torture reported FOOTGUN-100 safe 100/100.&lt;/p&gt;

&lt;p&gt;Those are release checks, not proof that the tool is useful in every agent workflow. I’m now running a public field test and looking for people to try one or two real repository mutations with Codex, Claude Code, Gemini CLI, Cline, OpenCode, or another coding agent.&lt;/p&gt;

&lt;p&gt;The feedback I want is specific:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Did the agent discover Threadmoth without being spoon-fed its request schema?&lt;/li&gt;
&lt;li&gt;Did it choose Threadmoth when the task fit?&lt;/li&gt;
&lt;li&gt;Did a valid edit get refused?&lt;/li&gt;
&lt;li&gt;Did an unsafe or stale edit get refused correctly?&lt;/li&gt;
&lt;li&gt;Were unrelated bytes preserved?&lt;/li&gt;
&lt;li&gt;If Threadmoth was unavailable or not selected, what did the agent use instead?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/matthewjameswatkins1978-cyber/Suture" rel="noopener noreferrer"&gt;https://github.com/matthewjameswatkins1978-cyber/Suture&lt;/a&gt;&lt;br&gt;
Release: &lt;a href="https://github.com/matthewjameswatkins1978-cyber/Suture/releases/tag/v1.5.1" rel="noopener noreferrer"&gt;https://github.com/matthewjameswatkins1978-cyber/Suture/releases/tag/v1.5.1&lt;/a&gt;&lt;br&gt;
Five-minute field test: &lt;a href="https://github.com/matthewjameswatkins1978-cyber/Suture/blob/main/FIELD_TESTING.md" rel="noopener noreferrer"&gt;https://github.com/matthewjameswatkins1978-cyber/Suture/blob/main/FIELD_TESTING.md&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’m the developer and this is my project. Parts of the implementation and testing were AI-assisted; I’m responsible for the architecture, integration, and release. Specific breakage is more useful than a star.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>showdev</category>
      <category>ai</category>
      <category>agents</category>
    </item>
  </channel>
</rss>
