<?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: Abhimanyu R B</title>
    <description>The latest articles on DEV Community by Abhimanyu R B (@abhimanyu_rb_b56e9e0a67f).</description>
    <link>https://dev.to/abhimanyu_rb_b56e9e0a67f</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%2F3714586%2F0e75aaa1-448e-4355-8456-50875f72e414.jpg</url>
      <title>DEV Community: Abhimanyu R B</title>
      <link>https://dev.to/abhimanyu_rb_b56e9e0a67f</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abhimanyu_rb_b56e9e0a67f"/>
    <language>en</language>
    <item>
      <title>Raising dead npm packages with Kiro, and refusing to trust what came back</title>
      <dc:creator>Abhimanyu R B</dc:creator>
      <pubDate>Wed, 02 Dec 2026 16:17:12 +0000</pubDate>
      <link>https://dev.to/abhimanyu_rb_b56e9e0a67f/raising-dead-npm-packages-with-kiro-and-refusing-to-trust-what-came-back-22h</link>
      <guid>https://dev.to/abhimanyu_rb_b56e9e0a67f/raising-dead-npm-packages-with-kiro-and-refusing-to-trust-what-came-back-22h</guid>
      <description>&lt;p&gt;&lt;em&gt;This post is written as part of the Kiroween 2026 hackathon (Resurrection category).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Every JavaScript project carries dead packages. &lt;code&gt;querystring@0.2.1&lt;/code&gt; has not had a release since 2021 and is still downloaded around 16 million times a week. Old versions of &lt;code&gt;minimist&lt;/code&gt;, 0.0.8 among them, carry two prototype-pollution advisories that will never be patched in place, because nobody is left to patch them.&lt;/p&gt;

&lt;p&gt;Tools tell you a dependency is dead. The usual advice is "migrate to something else", which means rewriting code that works. For the Resurrection category I wanted to take the theme literally: raise the package itself, and prove that the thing that came back behaves like the thing that died.&lt;/p&gt;

&lt;p&gt;That project is &lt;strong&gt;Revenant&lt;/strong&gt;: &lt;a href="https://revenant-fawn.vercel.app" rel="noopener noreferrer"&gt;https://revenant-fawn.vercel.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/PA4CWBnIcz4" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;Paste a &lt;code&gt;package.json&lt;/code&gt; or a GitHub URL. Revenant checks every dependency against the npm registry, OSV, deps.dev and GitHub and draws a graveyard: one stone per package, where every mark on the stone is a real fact with a source.&lt;/p&gt;

&lt;p&gt;Then it raises the dead ones in five acts: &lt;strong&gt;Exhume, Autopsy, Modernize, Trial, Rise&lt;/strong&gt;. Kiro does the two steps that need judgement:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a &lt;strong&gt;coroner&lt;/strong&gt; agent (file tools only) reads the dead package and writes its autopsy: the public API and its observable behaviour;&lt;/li&gt;
&lt;li&gt;a &lt;strong&gt;necromancer&lt;/strong&gt; agent (file and shell tools) modernizes it for Node.js 22 and ports the minimal fix for each known advisory.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Neither agent is trusted. The &lt;strong&gt;trial&lt;/strong&gt; loads the original and the risen package in separate processes, runs both on hundreds of generated inputs, and compares return values, thrown errors and changes to built-in prototypes. Any undeclared difference is a &lt;em&gt;possession&lt;/em&gt; and the resurrection fails. A declared difference is only accepted where an advisory proves the original was vulnerable on that input, and each claimed fix is checked against the first upstream version that fixed it.&lt;/p&gt;

&lt;p&gt;Five packages have risen so far. Three are on npm and usable today through &lt;code&gt;overrides&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"overrides"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"querystringify"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"npm:@abhimanyurb/querystringify@0.0.4"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How Kiro built it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Specs first.&lt;/strong&gt; Two specs hold 30 requirements in EARS form and 41 correctness properties. Every property is exactly one fast-check test, tagged with its number, so you can go from a sentence in &lt;code&gt;design.md&lt;/code&gt; to the test that enforces it. The second spec was written by Kiro itself, from four weaknesses I saw in the first real resurrection.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Headless CLI, one task per run.&lt;/strong&gt; A small driver ran &lt;code&gt;kiro-cli&lt;/code&gt; on a single spec task, then gated the result: clean tree, &lt;code&gt;tsc&lt;/code&gt;, the full test suite, &lt;code&gt;next build&lt;/code&gt;. Only then did the branch become a pull request. Sessions ran unattended for 6 to 32 minutes. Because the acceptance criteria and properties were already on disk, the task prompt could be four lines long.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Steering.&lt;/strong&gt; Five files that every session reads: vocabulary, the stack with verified API field names, file layout, property-test rules and git rules. The git file had the biggest effect. Once it existed, Kiro committed in small, reviewable commits on its own.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hooks.&lt;/strong&gt; Tests on save, a spec-traceability check after each task, a contract for new data sources, and a guard that blocks &lt;code&gt;npm publish&lt;/code&gt;, force pushes and pull requests against repositories I do not own.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MCP, both ways.&lt;/strong&gt; Kiro used context7 and fetch to write the API clients against live responses instead of remembered ones. Revenant also ships its own MCP server, so inside Kiro you can ask whether a dependency is dead before you add it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The agents were confidently wrong, three times
&lt;/h2&gt;

&lt;p&gt;This is the part I learned the most from.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The first record said no advisory applied to &lt;code&gt;querystringify@0.0.4&lt;/code&gt;. One did. The agent had never been given advisory data and filled the gap with a guess. Fix: the worker fetches advisories itself, and the record has to account for every one.&lt;/li&gt;
&lt;li&gt;The next record said "fixed" while &lt;code&gt;parse('toString=pwned').toString&lt;/code&gt; still returned &lt;code&gt;'pwned'&lt;/code&gt;. Fix: every claimed fix is now checked against the first upstream version that fixed it.&lt;/li&gt;
&lt;li&gt;Raising &lt;code&gt;minimist&lt;/code&gt; and &lt;code&gt;deep-extend&lt;/code&gt;, the fixes were correct and the trial still failed them. Prototype pollution does not change the return value. It quietly changes &lt;code&gt;Object.prototype&lt;/code&gt;, and the trial only compared return values. Fix: every call now records side effects on built-in prototypes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each of these started as a new requirement and a new property in the spec, never as a looser test. And a property test caught a bug the examples missed: fast-check generated an invalid date as the scan time, which broke the severity rule about once in fourteen runs.&lt;/p&gt;

&lt;p&gt;You can check the minimist fix by hand. With the original package, &lt;code&gt;Object.prototype.polluted&lt;/code&gt; ends up as &lt;code&gt;yes&lt;/code&gt; after parsing a crafted argument. With the risen one it stays &lt;code&gt;undefined&lt;/code&gt;, and normal parsing gives identical output.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I took away
&lt;/h2&gt;

&lt;p&gt;An agent's claim about its own work is a hypothesis. The useful part of the product is the part that tests it. Spec-driven development with property tests is what made that practical: when something fails, it points at a sentence in the design, not at a vague feeling that the code is off.&lt;/p&gt;

&lt;p&gt;Kiro's monthly allowance ran out mid-task on 15 November. A small part was finished by hand from the same spec, and the pull request says exactly which part. When the allowance came back on 1 December, Kiro raised the two waiting packages and wrote the next fix, spec first.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Live app: &lt;a href="https://revenant-fawn.vercel.app" rel="noopener noreferrer"&gt;https://revenant-fawn.vercel.app&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Code: &lt;a href="https://github.com/Abm32/revenant" rel="noopener noreferrer"&gt;https://github.com/Abm32/revenant&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Demo: &lt;a href="https://youtu.be/PA4CWBnIcz4" rel="noopener noreferrer"&gt;https://youtu.be/PA4CWBnIcz4&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>kiro</category>
      <category>javascript</category>
      <category>npm</category>
      <category>testing</category>
    </item>
    <item>
      <title>CPIC publishes 11 standardised phenotype terms. Its own API emits 33.</title>
      <dc:creator>Abhimanyu R B</dc:creator>
      <pubDate>Sun, 25 Oct 2026 16:38:49 +0000</pubDate>
      <link>https://dev.to/abhimanyu_rb_b56e9e0a67f/cpic-publishes-11-standardised-phenotype-terms-its-own-api-emits-33-4ho</link>
      <guid>https://dev.to/abhimanyu_rb_b56e9e0a67f/cpic-publishes-11-standardised-phenotype-terms-its-own-api-emits-33-4ho</guid>
      <description>&lt;p&gt;If you build anything that turns a pharmacogenomic lab result into advice, somewhere in your code is a set of phenotype strings — &lt;code&gt;Normal Metabolizer&lt;/code&gt;, &lt;code&gt;Poor Metabolizer&lt;/code&gt;, and so on. Mine was one flat frozenset, validated at import time. It was wrong in four ways, and I could measure every one of them against CPIC's own API.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The standardised list is not the emitted list
&lt;/h2&gt;

&lt;p&gt;CPIC's &lt;code&gt;term&lt;/code&gt; table defines &lt;strong&gt;11&lt;/strong&gt; standardised phenotype terms. Its &lt;code&gt;diplotype&lt;/code&gt; table emits &lt;strong&gt;33&lt;/strong&gt; distinct values across the 19 genes that have diplotype tables. &lt;strong&gt;24&lt;/strong&gt; of those 33 are absent from the standardised list entirely — &lt;code&gt;Deficient with CNSHA&lt;/code&gt;, &lt;code&gt;Likely Poor Metabolizer&lt;/code&gt;, &lt;code&gt;Malignant Hyperthermia Susceptibility&lt;/code&gt;, &lt;code&gt;ivacaftor responsive in CF patients&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. There is not one exact-case match
&lt;/h2&gt;

&lt;p&gt;Zero. The term table writes &lt;code&gt;Normal metabolizer&lt;/code&gt;. The diplotype table writes &lt;code&gt;Normal Metabolizer&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Match literally on CPIC's own published spelling and you reject every real CPIC result. Everything casefolds now.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The vocabulary is per gene, and genes do not answer the same question
&lt;/h2&gt;

&lt;p&gt;DPYD has 3 terms. TPMT and NUDT15 have 5 each. CYP2C19 has 8. SLCO1B1 answers in &lt;em&gt;Function&lt;/em&gt; terms, G6PD in &lt;code&gt;Deficient&lt;/code&gt; / &lt;code&gt;Normal&lt;/code&gt; / &lt;code&gt;Variable&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A global set is correct for exactly one gene — in my case DPYD, the gene I happened to write it against. Adding a second drug class broke it immediately.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. "No Result" exists at only one layer
&lt;/h2&gt;

&lt;p&gt;A gene that was not assayed has the CPIC phenotype &lt;code&gt;No Result&lt;/code&gt;. It appears &lt;strong&gt;251 times&lt;/strong&gt; as a &lt;code&gt;recommendation.phenotypes&lt;/code&gt; key and &lt;strong&gt;never once&lt;/strong&gt; as a &lt;code&gt;diplotype.generesult&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;CPIC models it at the recommendation layer alone. So a gene has &lt;em&gt;two&lt;/em&gt; vocabularies, and the recommendation one is strictly larger.&lt;/p&gt;

&lt;p&gt;This is the one that turned out to matter most. Thiopurine dosing is keyed on TPMT and NUDT15 &lt;strong&gt;jointly&lt;/strong&gt;. A panel that types one of them has not half-answered the question — and CPIC has published an actual row for the other gene being unestablished. The honest output is to render CPIC's row, not to write my own sentence about the gap.&lt;/p&gt;

&lt;h2&gt;
  
  
  The consequence
&lt;/h2&gt;

&lt;p&gt;A term can be one CPIC &lt;em&gt;uses&lt;/em&gt; without being one CPIC has &lt;em&gt;defined&lt;/em&gt;. &lt;code&gt;Possible Intermediate Metabolizer&lt;/code&gt;, emitted by both TPMT and NUDT15, is exactly that.&lt;/p&gt;

&lt;p&gt;So the code no longer invents a gloss. It returns CPIC's own &lt;code&gt;functionaldef&lt;/code&gt; or nothing at all, and the report says "CPIC publishes no standardised definition for this term" instead of printing the phenotype bare — which reads as though nothing were missing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix
&lt;/h2&gt;

&lt;p&gt;A generator that pulls the vocabulary from the API into a committed snapshot, per gene and per layer, matched casefolded. A &lt;code&gt;--check&lt;/code&gt; mode runs in CI, so the snapshot drifting from CPIC fails the build rather than quietly answering with last year's terms.&lt;/p&gt;

&lt;p&gt;Each of the four defects is now a failing test if you revert the fix. That was the part worth the afternoon.&lt;/p&gt;




&lt;p&gt;If you want to see what it produces: &lt;a href="https://prahari.anukritiai.com" rel="noopener noreferrer"&gt;https://prahari.anukritiai.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Paste a genotyping export, or just pick the drug, and it says which positions were covered, which were not, and what CPIC publishes for that combination. It quotes CPIC verbatim and does not compute a dose. It is investigational, carries no clinician sign-off, and stores nothing you paste.&lt;/p&gt;

</description>
      <category>healthcare</category>
      <category>python</category>
      <category>api</category>
    </item>
  </channel>
</rss>
