<?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: Nersissiian</title>
    <description>The latest articles on DEV Community by Nersissiian (@nersisiian).</description>
    <link>https://dev.to/nersisiian</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3901439%2F1e8634c5-6422-4b3f-b7f4-bb2c0a6dd4d3.png</url>
      <title>DEV Community: Nersissiian</title>
      <link>https://dev.to/nersisiian</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nersisiian"/>
    <language>en</language>
    <item>
      <title>How I built a self‑healing package manager</title>
      <dc:creator>Nersissiian</dc:creator>
      <pubDate>Tue, 28 Apr 2026 02:45:30 +0000</pubDate>
      <link>https://dev.to/nersisiian/how-i-built-a-self-healing-package-manager-3nl4</link>
      <guid>https://dev.to/nersisiian/how-i-built-a-self-healing-package-manager-3nl4</guid>
      <description>&lt;h1&gt;
  
  
  How I Built a Self-Healing Package Manager from Scratch (Rust + AI)
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;The first tool that automatically resolves dependency conflicts by generating adapter code — and retries with AI until the build passes.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcg1wjwohox4mvlkl7yaa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcg1wjwohox4mvlkl7yaa.png" alt="HealDep banner" width="800" height="212"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem: Dependency Hell is Real
&lt;/h2&gt;

&lt;p&gt;Every developer has been there. You're building a Rust project, and suddenly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Crate A requires &lt;code&gt;tokio 0.2&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Crate B requires &lt;code&gt;tokio 1.0&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cargo throws an error, and your build fails. The same happens in Python (&lt;code&gt;click==7.0&lt;/code&gt; vs &lt;code&gt;click==8.0&lt;/code&gt;) and in npm (&lt;code&gt;lodash&lt;/code&gt; version mismatches). The only "solutions" are to fork one of the libraries, pin an old version forever, or manually write glue code.&lt;/p&gt;

&lt;p&gt;I wanted to see if this could be &lt;strong&gt;automated away completely&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Idea: A Package Manager That Heals Itself
&lt;/h2&gt;

&lt;p&gt;What if a tool could:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Detect the conflict automatically&lt;/li&gt;
&lt;li&gt;Generate an &lt;strong&gt;adapter shim&lt;/strong&gt; that bridges the two versions&lt;/li&gt;
&lt;li&gt;Test the adapter in a sandbox&lt;/li&gt;
&lt;li&gt;If it fails, retry with AI-powered code generation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's how &lt;strong&gt;HealDep&lt;/strong&gt; was born.&lt;/p&gt;




&lt;h2&gt;
  
  
  Architecture Overview
&lt;/h2&gt;

&lt;p&gt;HealDep consists of several Rust crates and a Python web dashboard:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;healdep&lt;/code&gt; (CLI)&lt;/td&gt;
&lt;td&gt;Main binary – parses manifests, controls the healing pipeline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;healdep-synthesizer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Generates shim crates/packages&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;healdep-sandbox&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Builds and tests the generated adapter in isolation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;healdep-registry&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Caches and shares successfully generated shims&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Python server&lt;/td&gt;
&lt;td&gt;Web dashboard with healing history and REST API&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F13jbyfejxr9mjkj3t4lr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F13jbyfejxr9mjkj3t4lr.png" alt="HealDep dashboard" width="800" height="611"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  How the Healing Works (Step-by-Step)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Parsing Manifests
&lt;/h3&gt;

&lt;p&gt;HealDep reads &lt;code&gt;Cargo.toml&lt;/code&gt;, &lt;code&gt;requirements.txt&lt;/code&gt;, and &lt;code&gt;package.json&lt;/code&gt;. For Rust, it uses the &lt;code&gt;cargo_metadata&lt;/code&gt; crate to get the full resolved dependency graph. For Python and npm, it has custom parsers that extract version constraints with regular expressions.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Detecting the Conflict
&lt;/h3&gt;

&lt;p&gt;The tool iterates over all packages. If the same crate appears with &lt;strong&gt;two different required versions&lt;/strong&gt;, that's flagged as a conflict:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Simplified detection logic&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;versions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;name_to_versions&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;unique&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;HashSet&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;versions&lt;/span&gt;&lt;span class="nf"&gt;.iter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.collect&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;unique&lt;/span&gt;&lt;span class="nf"&gt;.len&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;conflicts&lt;/span&gt;&lt;span class="nf"&gt;.push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Conflict&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;crate_name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;versions&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="err"&gt;##&lt;/span&gt; &lt;span class="n"&gt;Docker&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;CI&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;CD&lt;/span&gt;

&lt;span class="n"&gt;HealDep&lt;/span&gt; &lt;span class="n"&gt;is&lt;/span&gt; &lt;span class="n"&gt;available&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;Docker&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
bash&lt;br&gt;
docker pull ghcr.io/nersisiian/healdep:v0.1.0&lt;br&gt;
docker run -p 5000:5000 ghcr.io/nersisiian/healdep:v0.1.0&lt;/p&gt;

&lt;p&gt;It also includes GitHub Actions workflows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ci.yml&lt;/code&gt; – lint, test, build, and publish the Docker image&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;healdep-action.yml&lt;/code&gt; – automatically heal dependencies on every push&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dependabot-heal.yml&lt;/code&gt; – heal PRs opened by Dependabot&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FNersisiian%2FHealDep%2Fmain%2Fdocs%2Fimages%2Fdocker-up.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FNersisiian%2FHealDep%2Fmain%2Fdocs%2Fimages%2Fdocker-up.png" alt="Docker up" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Dependency graphs are complex&lt;/strong&gt; – optional features, platform-specific deps, and lock files make this harder than it looks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI is a powerful assistant, not a silver bullet&lt;/strong&gt; – it works well for mechanical translations, but complex logic is still beyond reach.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sandboxing is essential&lt;/strong&gt; – never modify the user's project directly. Always test the shim in isolation first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-language support taught me a lot&lt;/strong&gt; about the differences (and similarities) between Cargo, pip, and npm.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Try It Yourself
&lt;/h2&gt;

&lt;p&gt;HealDep is 100% open-source (MIT licensed).&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
bash
git clone https://github.com/Nersisiian/HealDep.git
cd healdep
cargo build --release
./target/release/healdep heal examples/demo_app/Cargo.toml --ai

If you like it, give it a ⭐ on GitHub — it means the world to a solo developer.

- **GitHub**: [https://github.com/Nersisiian/HealDep](https://github.com/Nersisiian/HealDep)
- **Product Hunt**: [https://www.producthunt.com/posts/healdep](https://www.producthunt.com/posts/healdep)

---

## What's Next?

I'm planning to add support for Java (Maven/Gradle) and Go. If you have ideas or want to contribute, open an issue or join the discussion!

**Thank you for reading, and may your builds never fail again.** 🩺
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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