<?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: Shailesh Vats</title>
    <description>The latest articles on DEV Community by Shailesh Vats (@shaileshvats2004).</description>
    <link>https://dev.to/shaileshvats2004</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%2F4206258%2F56b04103-93cb-431f-a539-97634f4866a9.png</url>
      <title>DEV Community: Shailesh Vats</title>
      <link>https://dev.to/shaileshvats2004</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shaileshvats2004"/>
    <language>en</language>
    <item>
      <title>Writing your own Switch agents from scratch: six Python agents that take a startup idea to a launch decision</title>
      <dc:creator>Shailesh Vats</dc:creator>
      <pubDate>Sat, 07 Nov 2026 15:36:24 +0000</pubDate>
      <link>https://dev.to/shaileshvats2004/writing-your-own-switch-agents-from-scratch-six-python-agents-that-take-a-startup-idea-to-a-launch-22de</link>
      <guid>https://dev.to/shaileshvats2004/writing-your-own-switch-agents-from-scratch-six-python-agents-that-take-a-startup-idea-to-a-launch-22de</guid>
      <description>&lt;p&gt;Most Switch projects I've seen connect an existing coding agent, like Claude Code or Codex, through Switch Console. For &lt;a href="https://github.com/shaileshvats/launchos" rel="noopener noreferrer"&gt;LaunchOS&lt;/a&gt; I went the other way. I wrote six agents directly against Switch's agent protocol in Python (the protocol client itself is about 210 lines), and let them run a startup launch through Mattermost rooms, with a person making the final call.&lt;/p&gt;

&lt;p&gt;This post is the guide I wanted when I started. It covers self-hosting Switch, registering a custom agent, the event stream and heartbeat, using rooms as shared memory, and the problems I hit. All code is from the repo (MIT).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Demo (2:25, real footage):&lt;/strong&gt; &lt;a href="https://youtu.be/EBvnL8ABzIs" rel="noopener noreferrer"&gt;https://youtu.be/EBvnL8ABzIs&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;A founder types an idea. A conductor agent opens a set of Switch rooms and hands work to five specialists in turn:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Agent&lt;/th&gt;
&lt;th&gt;Produces&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;research-analyst&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Segments, a competitor table, sizing assumptions, risks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;product-strategist&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A spec and a prioritised backlog with estimates and acceptance criteria&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;prototype-builder&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A working landing page&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;growth-marketer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Positioning, a channel plan, a 4-week calendar, launch copy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;launch-auditor&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A readiness score from 8 deterministic checks, plus a request for human approval&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Going public is a consequential decision, so the launch waits until a named person approves or rejects it. They can do that in the LaunchOS UI, or by typing &lt;code&gt;approve &amp;lt;reason&amp;gt;&lt;/code&gt; in the Mattermost room.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyqv3tk8jcl0z93kafq6a.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyqv3tk8jcl0z93kafq6a.png" alt="LaunchOS pipeline: five stages done, each with its Switch room" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The models are local: Qwen3-4B-Instruct-2507 in LM Studio, through its OpenAI-compatible API. That's a small model, so every live deliverable is labelled as an unverified AI draft.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Switch is the workflow, not a chat window
&lt;/h2&gt;

&lt;p&gt;The rule I set myself was that &lt;strong&gt;the agents may only coordinate through Switch&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every handoff, deliverable, completion report, failure and approval is a message in a Switch room.&lt;/li&gt;
&lt;li&gt;A specialist's only input is what it reads back from the HQ room with &lt;code&gt;read_context&lt;/code&gt;: the founder brief plus every earlier deliverable. It never reads LaunchOS's database.&lt;/li&gt;
&lt;li&gt;The conductor starts the next stage only when the previous specialist's "done" message arrives on its event stream.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you removed Switch, nothing would move. That also means a person in Mattermost sees exactly what the agents see.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: self-host Switch with Mattermost
&lt;/h2&gt;

&lt;p&gt;You don't need Switch Console or a Slack workspace for this. The repo publishes a standalone Docker Compose stack that includes Postgres, Mattermost, the Switch server and the Gateway. Pin a real version (I used &lt;code&gt;0.31.0&lt;/code&gt;, read from the GHCR tags) and generate fresh secrets:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cp&lt;/span&gt; .env.example .env        &lt;span class="c"&gt;# from the switch repo at tag switch-v0.31.0&lt;/span&gt;
&lt;span class="k"&gt;for &lt;/span&gt;k &lt;span class="k"&gt;in &lt;/span&gt;DB_PASSWORD DB_OWNER_PASSWORD AGENT_REGISTRATION_TOKEN GATEWAY_ADMIN_PASSWORD &lt;span class="se"&gt;\&lt;/span&gt;
         MATTERMOST_ADMIN_PASSWORD MATTERMOST_USER_PASSWORD JWT_SECRET_KEY CONTROLLER_TOKEN_SECRET&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
  &lt;/span&gt;&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt;.bak &lt;span class="s2"&gt;"s|^&lt;/span&gt;&lt;span class="nv"&gt;$k&lt;/span&gt;&lt;span class="s2"&gt;=.*|&lt;/span&gt;&lt;span class="nv"&gt;$k&lt;/span&gt;&lt;span class="s2"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;openssl rand &lt;span class="nt"&gt;-hex&lt;/span&gt; 24&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;|"&lt;/span&gt; .env
&lt;span class="k"&gt;done
&lt;/span&gt;&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt;.bak &lt;span class="s2"&gt;"s|^SECRET_KEYS=.*|SECRET_KEYS=local:&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;openssl rand &lt;span class="nt"&gt;-hex&lt;/span&gt; 32&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;|; s|^SWITCH_VERSION=.*|SWITCH_VERSION=0.31.0|"&lt;/span&gt; .env
docker compose &lt;span class="nt"&gt;-f&lt;/span&gt; standalone-docker-compose.yml &lt;span class="nt"&gt;--env-file&lt;/span&gt; .env &lt;span class="nt"&gt;--profile&lt;/span&gt; collab &lt;span class="nt"&gt;--profile&lt;/span&gt; gateway up &lt;span class="nt"&gt;-d&lt;/span&gt;
curl http://127.0.0.1:8000/health      &lt;span class="c"&gt;# {"status":"ok"}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything binds to 127.0.0.1. A &lt;code&gt;setup&lt;/code&gt; container creates a Mattermost team and a user called &lt;code&gt;user&lt;/code&gt;, and registers the Mattermost bridge. &lt;code&gt;AGENT_REGISTRATION_TOKEN&lt;/code&gt; is the token your agents register with.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: register an agent
&lt;/h2&gt;

&lt;p&gt;Custom agents register with &lt;code&gt;POST /agents&lt;/code&gt;, using the registration token as the bearer credential. The API key in the response is shown only once, so store it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;INTEGRATION_PROFILE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;connection_model&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;always_on&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;message_exchange&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pre_invocation_mediation&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;post_invocation_mediation&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;event_reporting&lt;/span&gt;&lt;span class="sh"&gt;"&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="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;httpx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/agents&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
               &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Authorization&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bearer &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;registration_token&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
               &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;research-analyst&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;description&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Market research&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                     &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;display_name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Research Analyst&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;connector_type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;LaunchOS&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                     &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;integration_profile&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;INTEGRATION_PROFILE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;overwrite&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="n"&gt;agent_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;api_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;api_key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything else is an &lt;strong&gt;operation&lt;/strong&gt;: &lt;code&gt;POST /agents/{id}/ops/{name}&lt;/code&gt; with the agent's own key. &lt;code&gt;GET /agents/{id}/ops&lt;/code&gt; lists them all; 0.31.0 has 53. The ones LaunchOS uses are &lt;code&gt;create_room&lt;/code&gt;, &lt;code&gt;link_rooms&lt;/code&gt;, &lt;code&gt;read_context&lt;/code&gt; and &lt;code&gt;get_my_context&lt;/code&gt;. Posting a message doesn't even need an operation: &lt;code&gt;POST /agents/{id}/message&lt;/code&gt; with &lt;code&gt;{room_id, content}&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: the event stream and heartbeat
&lt;/h2&gt;

&lt;p&gt;Each agent keeps one server-sent event stream open and sends a heartbeat every 2 seconds. The details that matter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You generate the connection id&lt;/strong&gt; and reuse it on every reconnect. That's what lets a connection survive a dropped socket.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Beat every 2 s; the TTL is 6 s.&lt;/strong&gt; A beat is refused if no stream is attached.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The first frame is &lt;code&gt;connection_state&lt;/code&gt;.&lt;/strong&gt; Take the cursor from it, and resume with &lt;code&gt;Last-Event-ID&lt;/code&gt; after a drop.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;params&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;connection_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connection_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;scope&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;all&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;filter&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;all&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;start_from&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;head&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;GET&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;base&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/agents/&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;agent_id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/events&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                   &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Accept&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;text/event-stream&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seq&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;parse_sse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;iter_lines&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;kind&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;connection_state&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;attached&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;          &lt;span class="c1"&gt;# only now start beating
&lt;/span&gt;        &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;kind&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="nf"&gt;on_event&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# data["payload"]: body, sender_name, addressed, message_id ...
# beat loop: POST /agents/{agent_id}/connection/beat {"connection_id": ..., "cursor": seq}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every message in the agent's rooms arrives here, including its own. So filter on &lt;code&gt;sender_name&lt;/code&gt; and de-duplicate by &lt;code&gt;message_id&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: rooms are the shared memory
&lt;/h2&gt;

&lt;p&gt;For each launch, the conductor creates six rooms: an HQ room for everyone, plus one work room per specialist. Passing &lt;code&gt;user_names&lt;/code&gt; makes each room a Mattermost channel with the human already in it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;hq&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;conductor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;op&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;create_room&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;slug&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;-hq&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;description&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;LaunchOS HQ for &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;agent_names&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;all_agents&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user_names&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;instructions&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;The conductor posts the founder brief here; every specialist posts its deliverable here.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A handoff is just a message in the specialist's room, with a small marker so it's machine-readable and still readable by people:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[handoff:lch_40868d:research] @research-analyst please produce: Market research.
Read the founder brief in #lch-40868d-hq, post your deliverable there, then report back here.
&lt;/code&gt;&lt;/pre&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcluz5a4a13zgg7qt1s4u.jpg" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcluz5a4a13zgg7qt1s4u.jpg" alt="The conductor's handoff and the analyst's reply in Mattermost" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The specialist then calls &lt;code&gt;read_context&lt;/code&gt; on the HQ room and builds its prompt from that history alone. That's the part I like most about Switch. &lt;strong&gt;The room history is the context&lt;/strong&gt;, so nothing has to be passed around out of band, and a person reading the channel sees exactly what the agent read.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;msgs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;messages_from_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hq_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;   &lt;span class="c1"&gt;# {"threads": [{"root":…, "replies":[…]}]}
&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;msgs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;mm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MARK&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;body&lt;/span&gt;&lt;span class="sh"&gt;"&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;mm&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;mm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;brief&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;brief&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;strip_markers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;body&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;mm&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;mm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;deliverable&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;upstream&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;mm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;strip_markers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;body&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The specialist then posts &lt;code&gt;[deliverable:…]&lt;/code&gt; to HQ and &lt;code&gt;[done:…] @launchos-conductor&lt;/code&gt; in its own room. The conductor's stream receives the done report and starts the next stage.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvxzm3bpp2vrrzl6gzept.jpg" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvxzm3bpp2vrrzl6gzept.jpg" alt="The HQ room holding the deliverables" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: a human makes the final call, in the room
&lt;/h2&gt;

&lt;p&gt;The launch auditor's readiness score is &lt;strong&gt;not&lt;/strong&gt; the model's opinion. It comes from eight deterministic checks over what the team actually delivered: is there a competitor table, how many P0 items, is the pricing proposed, and so on. Legal and compliance is always a warning that says "needs human review".&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb4lyuklfe13vqvllqxsk.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb4lyuklfe13vqvllqxsk.png" alt="Readiness: 94/100 from deterministic checks, approved by a person" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The auditor then asks for approval in HQ. The conductor treats a human reply that starts with &lt;code&gt;approve&lt;/code&gt; or &lt;code&gt;reject&lt;/code&gt; as the decision. It records who decided and why, posts that back into the room, and marks the launch launched or rejected.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fooi82nq0ihxrew358xat.jpg" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fooi82nq0ihxrew358xat.jpg" alt="Approval in Mattermost: request, human reply, recorded decision" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What broke, and how I fixed it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. The task protocol isn't ready yet.&lt;/strong&gt; Switch 0.31.0 has &lt;code&gt;delegate_task&lt;/code&gt;, &lt;code&gt;accept_task&lt;/code&gt; and related operations, but its docs say they're "present but not ready for use". I didn't build on them. Handoffs are ordinary messages with &lt;code&gt;[handoff]&lt;/code&gt;, &lt;code&gt;[done]&lt;/code&gt; and &lt;code&gt;[failed]&lt;/code&gt; markers, which also makes them visible to people.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. A fresh server can fail stream opens with HTTP 500.&lt;/strong&gt; I only found this by testing from a fresh clone against a brand-new stack. In its first minutes, the server sometimes answered the event-stream request with a 500 (&lt;code&gt;No incarnation drawn&lt;/code&gt;, from its connection registry). My client reconnected, but a first connection only gets events from "head". A handoff posted during that gap was lost, and that stage would have hung until the watchdog failed it. Two changes fixed it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;LaunchOS doesn't accept launches until &lt;strong&gt;every&lt;/strong&gt; agent has received &lt;code&gt;connection_state&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The conductor &lt;strong&gt;re-sends&lt;/strong&gt; any handoff that hasn't been acknowledged within 30 seconds, up to 3 times. Specialists ignore duplicates for work they've already claimed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Every agent says hello.&lt;/strong&gt; When an agent joins a room, Switch posts an automatic "Tag @me to loop me in" greeting. With six agents across six rooms, that's a lot of noise. I filter those messages out of the LaunchOS activity feed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Small-model output needs guard rails.&lt;/strong&gt; Early research drafts stated invented statistics as facts. The prompts now forbid unlabelled numbers. Every live deliverable carries an "unverified AI draft" note, and the landing page is rendered from escaped JSON into a fixed template rather than trusting model HTML.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing against the real thing
&lt;/h2&gt;

&lt;p&gt;The suite has 12 tests. The 9 unit tests cover parsing, the SSE reader, readiness scoring and landing-page escaping. The 3 integration tests run against a real Switch server:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The full journey.&lt;/strong&gt; It checks, by reading the HQ room back from Switch, that all five deliverables, the approval request and the decision were posted there.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The failure path.&lt;/strong&gt; An unreachable model fails the research stage, the failure is reported in Switch, and a retry completes the pipeline.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Validation and 404s.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The integration tests run under a different agent-name prefix (&lt;code&gt;itest-&lt;/code&gt;), so they can run beside a live instance. Before publishing, I cloned the repo fresh, started a second Switch stack on other ports and ran everything again: 12/12.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you're starting with Switch
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You don't need Console to start.&lt;/strong&gt; The standalone Compose stack plus Mattermost is enough for a fully local setup.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Read the &lt;a href="https://docs.switchagents.ai/flintai/switch/internals/agent-protocol" rel="noopener noreferrer"&gt;agent protocol doc&lt;/a&gt; first.&lt;/strong&gt; It's precise, and a client really is just HTTP plus SSE.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use the room history as your shared state.&lt;/strong&gt; It keeps agents and people looking at the same thing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test on a freshly started server&lt;/strong&gt;, not just the one you've been developing against.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;LaunchOS is MIT-licensed and runs locally: &lt;a href="https://github.com/shaileshvats/launchos" rel="noopener noreferrer"&gt;https://github.com/shaileshvats/launchos&lt;/a&gt;. The README has a three-command quick start, and the demo is at &lt;a href="https://youtu.be/EBvnL8ABzIs" rel="noopener noreferrer"&gt;https://youtu.be/EBvnL8ABzIs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Built for the WeMakeDevs × DevTools Academy × Switch "Flip the Switch" hackathon. I built LaunchOS and wrote this post with help from an AI coding assistant; every result above comes from the repo's tests and the recorded run.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>python</category>
      <category>hackathon</category>
    </item>
    <item>
      <title>Inheritance Engine: resurrecting abandoned code with a local Gemma team, where the original gets a vote</title>
      <dc:creator>Shailesh Vats</dc:creator>
      <pubDate>Sat, 31 Oct 2026 16:40:00 +0000</pubDate>
      <link>https://dev.to/shaileshvats2004/inheritance-engine-resurrecting-abandoned-code-with-a-local-gemma-team-where-the-original-gets-a-4i0n</link>
      <guid>https://dev.to/shaileshvats2004/inheritance-engine-resurrecting-abandoned-code-with-a-local-gemma-team-where-the-original-gets-a-4i0n</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week4-2026-10-26"&gt;Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;On October 31, a Gemma model running on my laptop proposed a fix for a Python library last touched in 2014. A second Gemma agent, the Reviewer, approved it. All 126 of the project's existing tests passed.&lt;/p&gt;

&lt;p&gt;The fix was still wrong. Behaviour probes compared the original author's code under Python 3.9 with the patched code under 3.12 and reported changed behaviour. The engine reverted the patch.&lt;/p&gt;

&lt;p&gt;Abandoned code isn't necessarily dead code. Its author has moved on, but their intent survives in how the software behaves: the ghost that still gets a vote on what "restored" means. The Inheritance Record keeps the project's history, decisions, evidence and lineage, a little like an ofrenda.&lt;/p&gt;

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

&lt;p&gt;Inheritance Engine is a local workbench for inheriting software whose creator has moved on. The &lt;a href="https://github.com/shaileshvats/inheritance-engine" rel="noopener noreferrer"&gt;code is on GitHub&lt;/a&gt;, source-available under PolyForm Noncommercial 1.0.0, not an OSI-approved open-source licence.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hunt:&lt;/strong&gt; find candidates on GitHub, and optionally the web, with evidence instead of a score.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inherit:&lt;/strong&gt; the original stays a read-only clone at a recorded commit; work happens in a separate successor with pushing disabled.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Investigate:&lt;/strong&gt; the Rust engine maps the code deterministically, then a team of Gemma agents (Lead, Historian, Restorer, Reviewer, Tester) works out what it was for. Every line they cite is re-read from disk.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Restore and verify:&lt;/strong&gt; the agents propose and review patches; the engine tests and probes them in a restricted Docker sandbox and reverts what doesn't hold up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preserve:&lt;/strong&gt; commit an &lt;code&gt;INHERITANCE.md&lt;/code&gt; to the successor and export a versioned Inheritance Record: who wrote the code, what changed, and how each change was proven.&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%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjpoz0dsyq9xmaxpsdu3v.jpg" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjpoz0dsyq9xmaxpsdu3v.jpg" alt="fn.py under investigation by the local Gemma agents, original preserved read-only" width="800" height="544"&gt;&lt;/a&gt;&lt;/p&gt;

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

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

&lt;p&gt;&lt;a href="https://cdn.jsdelivr.net/gh/shaileshvats/inheritance-engine@85a4f7c60e17a643c662ae0e2d36a485954a8d46/docs/demo/video/inheritance-engine-demo-v3.mp4" rel="noopener noreferrer"&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foagtvnjb2hl03nb3bqwg.jpg" alt="Demo video: real app footage" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://cdn.jsdelivr.net/gh/shaileshvats/inheritance-engine@85a4f7c60e17a643c662ae0e2d36a485954a8d46/docs/demo/video/inheritance-engine-demo-v3.mp4" rel="noopener noreferrer"&gt;▶ Watch the 5-minute demo&lt;/a&gt;&lt;/strong&gt; (MP4, with a synthetic-voice narration). Real app footage, driven by a script in headless Chrome. Corner badges label live, recorded, replayed, screenshot and fast-forwarded footage. Recorded October 31, with the Temporal, memory and CI part added November 1. &lt;a href="https://github.com/shaileshvats/inheritance-engine/blob/main/docs/demo/video/README.md" rel="noopener noreferrer"&gt;How it was recorded&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Catch
&lt;/h2&gt;

&lt;p&gt;The demo inherits &lt;a href="https://github.com/kachayev/fn.py" rel="noopener noreferrer"&gt;kachayev/fn.py&lt;/a&gt;, "Functional programming in Python" (Apache-2.0, about 3.4k stars, last commit October 2014). On Python 3.12 its tests can't even start: &lt;code&gt;ImportError: cannot import name 'Iterable' from 'collections'&lt;/code&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Gemma got the tests running.&lt;/strong&gt; On October 28, two kept repairs took the suite from "can't start" to 126 passed. The second, commit cd83239, also passed three behaviour probes, but all three used plain positional functions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Neither covered variadic &lt;code&gt;@curried&lt;/code&gt;.&lt;/strong&gt; A manual check comparing the original on 3.9 with the successor on 3.12 showed different behaviour for functions with &lt;code&gt;*args&lt;/code&gt; and &lt;code&gt;**kwargs&lt;/code&gt;. Reading the diff, the likely cause was cd83239 counting &lt;code&gt;signature(f).parameters&lt;/code&gt;, which includes them. I reopened the issue with that finding.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The reference was already set.&lt;/strong&gt; During investigation, the decay scan picked Python 3.9, the newest runtime fn.py's own code still works on, for running the original.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemma proposed a fix, and Gemma approved it.&lt;/strong&gt; After the reopening, two attempts were rejected on October 28 and three more on October 31. In a sixth attempt, also on October 31, the Restorer replaced cd83239's &lt;code&gt;signature(f)&lt;/code&gt; with &lt;code&gt;getfullargspec(f)&lt;/code&gt;, without importing it, and counted arguments with &lt;code&gt;f.prflags&lt;/code&gt;. That attribute doesn't exist. The Reviewer approved: "root cause addressed: yes, regression risk: low".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The tests passed anyway.&lt;/strong&gt; All 126 passed before the patch and all 126 after, both on Python 3.12. None of them exercises variadic &lt;code&gt;@curried&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The probes raised a warning, not a controlled diagnosis.&lt;/strong&gt; The Tester wrote three: the first reproduces my note; the others test plain and default arguments, and a &lt;code&gt;*args&lt;/code&gt;/&lt;code&gt;**kwargs&lt;/code&gt; signature. Run on the original under 3.9 and the successor under 3.12, all three reported "changed". On the first, the original printed &lt;code&gt;(1, 2)&lt;/code&gt;, then raised &lt;code&gt;TypeError&lt;/code&gt;; the successor raised &lt;code&gt;NameError&lt;/code&gt; on all three. Reading the diff, that &lt;code&gt;NameError&lt;/code&gt; comes from the missing import. There was no same-runtime control.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The engine reverted it&lt;/strong&gt; and kept the attempt, the approving review and the probe result in the record. fn.py stays &lt;em&gt;restoring&lt;/em&gt;, not &lt;em&gt;verified&lt;/em&gt;.&lt;/li&gt;
&lt;/ol&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9dpfd79itdhorrakx61l.jpg" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9dpfd79itdhorrakx61l.jpg" alt="Replay: Reviewer approval, 126 tests passing before and after, and the probe result that reverted the patch" width="800" height="656"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;During development, a different fix used &lt;code&gt;inspect.signature(f).parameters&lt;/code&gt; but left &lt;code&gt;spec.args&lt;/code&gt; below it. All 126 tests passed, yet calling the decorator by hand raised &lt;code&gt;AttributeError&lt;/code&gt;. That is why behaviour probes exist. The cd83239 case is why a person's finding can reopen an issue and outrank green tests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You can reproduce the catch without a model.&lt;/strong&gt; A replay reuses the recorded patch, Reviewer verdict and probe code; it regenerates no model decision. Everything else runs live: clone, Docker tests, probes, decision, revert and a fresh Inheritance Record. You need Rust, Git and Docker, and no GPU:&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/shaileshvats/inheritance-engine &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;inheritance-engine
cargo run &lt;span class="nt"&gt;--release&lt;/span&gt;
&lt;span class="c"&gt;# then open http://127.0.0.1:7878 → "Replay a recorded catch" → Run this replay&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first build compiles from source in about 13 minutes on my 16 GB laptop. Subsequent laptop replay jobs took 9–80 seconds across five runs; a fresh-clone check took 61 seconds end to end. The GitHub Actions replay step took about 8 seconds on its runner. It runs on every push, after earlier steps build the engine and pull images, with no model or secrets, and fails unless the probe still catches the patch.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;The model proposes; the engine verifies.&lt;/strong&gt; The trusted part is one Rust binary (axum, SQLite, tokio). It never executes inherited code itself. Docker is the UI's default and recommended mode; the API requires an explicit choice. There, tests and probes run with a read-only root filesystem, all capabilities dropped, memory, CPU and process limits, and no network; installing dependencies is the one networked step. No model ever chooses a shell command, edits are exact and atomic inside the successor, and a "verified" claim without a real citation is downgraded. In the recorded investigation, 21 of 22 citations checked out. 61 Rust tests cover these rules; the Mastra and Temporal companions have 26 and 11.&lt;/p&gt;

&lt;h3&gt;
  
  
  Gemma 4 E4B: every agent, on my laptop
&lt;/h3&gt;

&lt;p&gt;Every agent role, the Hunter included, runs on Gemma 4 E4B in LM Studio, with JSON-schema constrained output. Inheriting someone's code shouldn't mean uploading it: in the default &lt;code&gt;local_only&lt;/code&gt; mode the engine refuses to send repository content to non-loopback model endpoints. With open weights, the model named in each record stays on my disk even if an API is retired. Inheritance Engine uses no paid API, subscription or hosting. Gemma wrote correct fixes and caught a real bug as Reviewer. It also wrote plausible wrong ones, which is why it never has the last word.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mastra: issue triage and the Lead
&lt;/h3&gt;

&lt;p&gt;A Mastra workflow, &lt;code&gt;triage-upstream-issues&lt;/code&gt;, reads the original's open issues (24 for fn.py) and has Gemma compare each with the successor's changes. "Addressed" only survives if it cites a repair or commit that exists. In the first run it marked #91, the &lt;code&gt;Iterable&lt;/code&gt; ImportError, as addressed and cited the exact repair and commit. On a re-run Gemma made the same claim without a citation, and the engine downgraded it to &lt;em&gt;needs a human&lt;/em&gt;. The Lead Engineer chat also runs through Mastra with read-only tools; Mastra doesn't drive the Rust restoration pipeline.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sentry: traces without the code
&lt;/h3&gt;

&lt;p&gt;Both processes trace to Sentry: jobs as agent runs, Gemma calls with role, tokens and latency, sandbox runs as tool calls. One 8.78-minute investigation broke down into a 17.85 s plan step and a 3.39-minute Historian call. I checked the metadata-only rule three ways: auditing payloads before they were sent, querying Sentry's stored spans for content attributes (zero), and scanning all 26 audited payloads for lines of inherited source (none). That work exposed a real gap, Mastra's exporter bypassing the usual scrubbing hook, so the check now sits in the transport. It's evidence for those payloads, not a blanket guarantee.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsdzlfkszkpwksnutgco8.jpg" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsdzlfkszkpwksnutgco8.jpg" alt="Sentry: one Gemma call with tokens, latency and &amp;quot;No input for this span&amp;quot;" width="800" height="673"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Temporal: surviving a worker crash
&lt;/h3&gt;

&lt;p&gt;The optional Temporal companion chains a full run's engine jobs, 15–25 minutes of local Gemma work, into one durable workflow, &lt;code&gt;inheritAndRestore&lt;/code&gt;. It waits out a model or Docker that is down, follows each job with heartbeats and gives a failed job one more run. I tested it on smokesignal, a second inherited library, by killing the worker with &lt;code&gt;SIGKILL&lt;/code&gt; mid-restore. A new worker picked up the same engine job, and the workflow went on through web research, triage and the record: 19 minutes, 86 history events, no job started twice. The new worker also hit two heartbeat timeouts I haven't explained, so I doubled the timeout. It runs on a local dev server.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3sn8xc09ajv8k8zkmi2u.jpg" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3sn8xc09ajv8k8zkmi2u.jpg" alt="Temporal UI: the workflow completed after a worker kill" width="799" height="529"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  SerpApi: when GitHub search isn't enough
&lt;/h3&gt;

&lt;p&gt;For &lt;em&gt;"python event signal dispatch library"&lt;/em&gt;, GitHub's search returned a JavaScript essay, a Flask template, a system-design primer and a PHP daemon. SerpApi added &lt;code&gt;pallets-eco/blinker&lt;/code&gt; and &lt;code&gt;nitely/python-signals&lt;/code&gt;, which actually do that, each re-fetched from the GitHub API so its evidence is real. Per-inheritance web research must cite real results, and for fn.py it found the documentation site. It isn't always relevant: on smokesignal, Gemma called Python's built-in &lt;code&gt;signal&lt;/code&gt; module a "successor"; no cited source named the project, so the engine downgraded it to a mention. Only search text and public repository names are sent, on the free plan.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tiger Data: a memory of every repair
&lt;/h3&gt;

&lt;p&gt;The restoration memory stores every repair attempt (outcome, the engine's reason, review and probe verdict) in self-hosted Postgres on Tiger Data's open-source &lt;code&gt;timescaledb-ha&lt;/code&gt; image, with pgvector, pgvectorscale's DiskANN index and a local &lt;code&gt;nomic-embed-text&lt;/code&gt; model. It stays local because repair text can quote inherited source. The Lead searches it with hybrid keyword and vector ranking. Asked from smokesignal whether another project had fixed an import broken by modern Python, the Lead cited four real fn.py repairs, including the patch from the catch; re-running its memory query returns exactly those four. It also said none of fn.py's fixes for that issue were kept. That is wrong: one was (cd83239), and it ranked 15th.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3bgib1no21up8ml42liw.jpg" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3bgib1no21up8ml42liw.jpg" alt="The Lead citing another project's repairs from the memory: real ids, some wrong reasons" width="800" height="506"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The PRD and code were AI-assisted: I worked with Claude throughout, and the runtime agents are Gemma.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Because preservation can't depend on a service that might disappear.&lt;/strong&gt; Gemma's weights live on my disk, so the record of which model wrote each patch outlives any API.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Because inheriting code shouldn't mean uploading it.&lt;/strong&gt; In &lt;code&gt;local_only&lt;/code&gt; mode the engine never sends repository code to a non-loopback model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Because I could change the parts.&lt;/strong&gt; When Ollama's registry wouldn't serve models to my old client, I pointed the same adapter at LM Studio. One environment variable can give the Reviewer a bigger Gemma. Running it costs ₹0: no paid API, subscription or hosting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The probes crossed Python versions.&lt;/strong&gt; The original ran on 3.9 and the patched code on 3.12, so the probes could not isolate the patch as the cause.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Neither inherited repository is restored.&lt;/strong&gt; fn.py's reopened &lt;code&gt;*args&lt;/code&gt; issue is still open after six further Gemma attempts. smokesignal went from tests that couldn't start to 7 passing; its 28 remaining failures, from Python 3 changes to bound methods, are unsolved.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The decisive invariant came from me, not the probes.&lt;/strong&gt; Probes only cover what the Tester thinks to check, and they have no same-runtime control.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Search relevance is uneven.&lt;/strong&gt; The engine can check that a source exists, not that it's relevant.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory answers are leads, not evidence.&lt;/strong&gt; The memory holds 26 attempts from two projects. Retrieval is checkable, but Gemma sometimes misstates what a precedent shows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Narrow and not perfectly isolated.&lt;/strong&gt; Verification covers public Python and Node.js repositories only. Docker is not a perfect security boundary, and optional native mode has little isolation.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gemma:&lt;/strong&gt; every agent role runs locally on Gemma 4 E4B.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mastra:&lt;/strong&gt; upstream-issue triage that must cite real repairs or commits.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sentry Agent Tracing:&lt;/strong&gt; metadata-only agent traces, audited for leaked source code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SerpApi:&lt;/strong&gt; web search found libraries GitHub's own search missed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Temporal:&lt;/strong&gt; a durable inheritance workflow that survived a killed worker.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tiger Data:&lt;/strong&gt; self-hosted pgvectorscale memory of every repair attempt.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Software doesn't have to die with its creator. It can be inherited, understood, repaired, and given a future.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>ai</category>
      <category>gemma</category>
    </item>
    <item>
      <title>Vendorwake: the upstream changed, Gemma caught it, and a test proved it</title>
      <dc:creator>Shailesh Vats</dc:creator>
      <pubDate>Sun, 25 Oct 2026 12:03:30 +0000</pubDate>
      <link>https://dev.to/shaileshvats2004/vendorwake-the-upstream-changed-gemma-caught-it-and-a-test-proved-it-3o3f</link>
      <guid>https://dev.to/shaileshvats2004/vendorwake-the-upstream-changed-gemma-caught-it-and-a-test-proved-it-3o3f</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;DEV Hacktoberfest 2026 Week 3 Challenge: Slow and Steady&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;Every app I've shipped depends on a dozen vendors I don't control. They deprecate parameters, rename&lt;br&gt;
classes and cut major versions, and I usually find out when production does.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vendorwake&lt;/strong&gt; is the lazy fix: an open-source engineer that reads my vendors' changelogs so I don't have&lt;br&gt;
to, and only bothers me when a change actually reaches my code. It doesn't just say "Stripe shipped&lt;br&gt;
16.0.0." It says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;billing/invoices.py:10&lt;/code&gt; calls &lt;code&gt;invoice.request(...)&lt;/code&gt;, which 16.0.0 removed.&lt;br&gt;
&lt;strong&gt;Confirmed:&lt;/strong&gt; the fixture's tests pass on 15.6.1 and fail on 16.0.0&lt;br&gt;
(&lt;code&gt;AttributeError: request. Did you mean: '_request'?&lt;/code&gt;). Here are the proposed patches, and here is what&lt;br&gt;
happened when I ran them.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Every finding carries one of three labels, and the label means something:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Confirmed&lt;/strong&gt;: deterministic proof. An exact symbol reference in my code &lt;em&gt;and&lt;/em&gt; a removed or renamed API,
or a test that fails under the new version.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Potential&lt;/strong&gt;: a plausible connection the model found, waiting for proof.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unaffected&lt;/strong&gt;: the vendor or symbol isn't used.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The model can explain and downgrade a finding, but &lt;strong&gt;it cannot upgrade one&lt;/strong&gt;. That rule is enforced in code,&lt;br&gt;
not in the prompt.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live app:&lt;/strong&gt; &lt;a href="https://vendorwake-web.onrender.com" rel="noopener noreferrer"&gt;https://vendorwake-web.onrender.com&lt;/a&gt; (free Render tier: the first request after a quiet
period takes about a minute while the service wakes up)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API docs:&lt;/strong&gt; &lt;a href="https://vendorwake-api.onrender.com/api/docs" rel="noopener noreferrer"&gt;https://vendorwake-api.onrender.com/api/docs&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The demo investigation is a real upstream change: &lt;strong&gt;stripe-python 16.0.0&lt;/strong&gt; (released 2026-09-30) against a&lt;br&gt;
small billing fixture pinned to 15.6.1. All three breaking changes reproduce offline:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Changelog item&lt;/th&gt;
&lt;th&gt;15.6.1&lt;/th&gt;
&lt;th&gt;16.0.0&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;stripe.Reversal&lt;/code&gt; → &lt;code&gt;stripe.TransferReversal&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;exists&lt;/td&gt;
&lt;td&gt;&lt;code&gt;AttributeError&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;StripeObject.request()&lt;/code&gt; removed&lt;/td&gt;
&lt;td&gt;exists&lt;/td&gt;
&lt;td&gt;&lt;code&gt;AttributeError&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Path params positional-only&lt;/td&gt;
&lt;td&gt;keyword accepted&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TypeError: ... positional-only arguments passed as keyword&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;What the hosted run actually produced&lt;/strong&gt; (one investigation, end to end, on free tiers):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Repository analysis&lt;/strong&gt; found &lt;code&gt;stripe==15.6.1&lt;/code&gt; in &lt;code&gt;requirements.txt&lt;/code&gt; (95% detection confidence) and
every reference by file and line: &lt;code&gt;stripe.Reversal&lt;/code&gt; in &lt;code&gt;payouts.py&lt;/code&gt;, &lt;code&gt;invoice.request(...)&lt;/code&gt; in
&lt;code&gt;invoices.py&lt;/code&gt;, &lt;code&gt;customers.retrieve(customer=...)&lt;/code&gt; in &lt;code&gt;customers.py&lt;/code&gt;, plus &lt;code&gt;catalog.py&lt;/code&gt;, which uses
Stripe but none of the affected APIs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Discovery&lt;/strong&gt; ran two SerpApi searches, fetched the official changelog, hashed it into a TimescaleDB
snapshot, and had Gemma 4 extract &lt;strong&gt;41 changes&lt;/strong&gt; from the 16.0.0 release. The grounding check accepted
the important ones with verbatim quotes, and flagged &lt;strong&gt;4 quotes and 10 symbols&lt;/strong&gt; that Gemma had reworded
(for example, it glued a class path onto a field name). So the change is marked &lt;em&gt;needs human review&lt;/em&gt;
instead of pretending to be clean.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Version comparison:&lt;/strong&gt; in a fresh virtualenv, the fixture's tests &lt;strong&gt;passed on 15.6.1 and failed on
16.0.0&lt;/strong&gt;. That failing test is the deterministic evidence behind &lt;strong&gt;Confirmed&lt;/strong&gt; (5 deterministic
evidence items and 1 model inference on the &lt;code&gt;invoices.py&lt;/code&gt; finding).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Patches:&lt;/strong&gt; Gemma proposed one diff per affected file. The &lt;code&gt;stripe.Reversal&lt;/code&gt; →
&lt;code&gt;stripe.TransferReversal&lt;/code&gt; diff is exactly right. Then the sandbox ran the tests with every patch applied
on 16.0.0: &lt;strong&gt;3 passed, 1 failed&lt;/strong&gt;. Gemma had replaced &lt;code&gt;invoice.request(...)&lt;/code&gt; with &lt;code&gt;raw_request(...)&lt;/code&gt;,
which returns a raw &lt;code&gt;StripeResponse&lt;/code&gt;, so &lt;code&gt;sent.id&lt;/code&gt; blew up. The recommendation is labelled
&lt;strong&gt;"Verified: failed"&lt;/strong&gt;, and nothing is applied: approving a patch only records the decision.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Follow-up:&lt;/strong&gt; I asked "Which file breaks first if we upgrade without any patch?" Backboard retrieved
the investigation's memory, and Gemma answered that the context doesn't say. It declined to make up an
ordering, and the UI shows the one memory it used.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Provenance:&lt;/strong&gt; a Sentry trace with &lt;strong&gt;315 spans&lt;/strong&gt; (version comparison 2.8 min, assessment 1.3 min,
patch proposal 7.4 min on Google's free tier), an Entire checkpoint linked to the migration agent's
commit, and the Temporal workflow and run IDs. All are linked from the investigation page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Permissions:&lt;/strong&gt; on Settings → Security, the migration agent asking to &lt;code&gt;push_branch&lt;/code&gt; is &lt;strong&gt;denied&lt;/strong&gt;
(&lt;code&gt;repo:write&lt;/code&gt; missing), and &lt;code&gt;propose_patch&lt;/code&gt; is &lt;strong&gt;allowed&lt;/strong&gt;. Both use real Auth0 tokens.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One flaw I'm leaving visible: the model-written &lt;em&gt;summary&lt;/em&gt; mentions a &lt;code&gt;KeyError&lt;/code&gt; that no test produced. The&lt;br&gt;
verdicts come from deterministic evidence, but the narrative is still model text, so the page labels it as&lt;br&gt;
such.&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/shaileshvats" rel="noopener noreferrer"&gt;
        shaileshvats
      &lt;/a&gt; / &lt;a href="https://github.com/shaileshvats/vendorwake" rel="noopener noreferrer"&gt;
        vendorwake
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Open-source, open-weight AI dependency intelligence: detects upstream vendor changes and maps them to your code with evidence.
    &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;Vendorwake&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;The upstream changed. We caught it.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Vendorwake is an open-source, open-weight-AI dependency intelligence platform. It watches the vendors
APIs and SDKs your software depends on, detects meaningful upstream changes, and maps each one to the code
in your repository that it could affect. Every finding is labelled &lt;strong&gt;confirmed&lt;/strong&gt;, &lt;strong&gt;potential&lt;/strong&gt; or
&lt;strong&gt;unaffected&lt;/strong&gt;, and backed by evidence you can inspect.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Live demo:&lt;/strong&gt; &lt;a href="https://vendorwake-web.onrender.com" rel="nofollow noopener noreferrer"&gt;https://vendorwake-web.onrender.com&lt;/a&gt; (free Render tier; the first request after a quiet
period takes about a minute) · &lt;strong&gt;API docs:&lt;/strong&gt; &lt;a href="https://vendorwake-api.onrender.com/api/docs" rel="nofollow noopener noreferrer"&gt;https://vendorwake-api.onrender.com/api/docs&lt;/a&gt; ·
&lt;strong&gt;Write-up:&lt;/strong&gt; &lt;a href="https://dev.to/shaileshvats2004/vendorwake-the-upstream-changed-gemma-caught-it-and-a-test-proved-it-3o3f" rel="nofollow"&gt;the DEV post&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Status: working end to end on free tiers. The hosted demo investigates a real upstream change
stripe-python 15.6.1 → 16.0.0, against &lt;a href="https://github.com/shaileshvats/vendorwake/fixtures/stripe-billing-demo" rel="noopener noreferrer"&gt;a small billing fixture&lt;/a&gt;: three
files confirmed by a test that passes on 15.6.1 and fails on 16.0.0, one file unaffected, and proposed
patches that are re-tested in a sandbox (one of Gemma's patches fails, and the page says so).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;How&lt;/h2&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/shaileshvats/vendorwake" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Apache-2.0. FastAPI + Temporal + PostgreSQL/TimescaleDB/pgvector + Next.js, with an adapter per sponsor so&lt;br&gt;
the business logic never imports a vendor SDK.&lt;/p&gt;

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

&lt;p&gt;I'm entering ten categories. Each sponsor does a real job in the hosted run above, and this is where to&lt;br&gt;
check it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Gemma:&lt;/strong&gt; Gemma 4 (&lt;code&gt;gemma-4-31b-it&lt;/code&gt;, falling back to &lt;code&gt;gemma-4-26b-a4b-it&lt;/code&gt;) does every
model step: extraction, impact rationale, the evidence graph, patches and follow-up answers. It runs on
Google AI Studio's free tier through an OpenAI-compatible adapter, so pointing it at vLLM or Ollama is a
config change.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Render:&lt;/strong&gt; the whole app runs on Render's free tier. One service is the Next.js front end;
the other is the API container that runs the agents, the Temporal worker and the test sandbox.
&lt;code&gt;scripts/deploy_render.py&lt;/code&gt; creates both services and their settings through Render's API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Auth0 for AI Agents:&lt;/strong&gt; users sign in with Auth0, and each agent (discovery, repository,
impact, verification, migration) has its own machine identity with only the scopes its steps need.
Every tool call is checked against that agent's real token, so the migration agent's &lt;code&gt;push_branch&lt;/code&gt; is
denied and &lt;code&gt;propose_patch&lt;/code&gt; is allowed. Approving a patch is a human step, done in-app because Auth0's
async approval isn't on the free plan.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Backboard:&lt;/strong&gt; memory and retrieval for an open-source assistant. Backboard stores each
investigation's findings and retrieves the relevant ones for a follow-up question; Gemma answers only
from what came back, and the UI lists the memories it used.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Browserbase:&lt;/strong&gt; when a vendor's docs page is a JavaScript shell, a real Browserbase session
renders it. The session ID is kept as evidence next to the text Gemma reasons over.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Entire:&lt;/strong&gt; the migration agent's work on each investigation is recorded as an Entire
session (each model turn with its token counts, then a commit of the proposed patches), and the
checkpoint is linked from the investigation page, so you can see why a patch exists.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Sentry Agent Tracing:&lt;/strong&gt; each investigation is one trace, with a &lt;code&gt;gen_ai.invoke_agent&lt;/code&gt; span
per agent and &lt;code&gt;chat&lt;/code&gt; / &lt;code&gt;execute_tool&lt;/code&gt; spans under it carrying the model, provider and token counts.
The demo run's trace has 315 spans. Patch proposal took longest (7.4 min) because the adapter paces
Gemma calls to the free tier's 16K tokens per minute; version comparison (2.8 min) is installing two
Stripe versions and running the tests. Model cost: $0. Prompt text is never attached. Debugging it
taught me something too (below): my first trace check found zero spans.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of SerpApi:&lt;/strong&gt; live search for each vendor's release announcements. A result only points
Vendorwake at a page; it then fetches the text itself from the vendor's official domains, so a search
hit is never treated as proof.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Temporal:&lt;/strong&gt; analysis, discovery, investigation and verification are Temporal workflows.
Each step saves its output before returning, so a restarted worker carries on without calling the model
again. When Google's free tier answers 429, the activity retries after the delay Google asks for
instead of failing the investigation, as my first runs did.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Tiger Data:&lt;/strong&gt; Postgres on Tiger Cloud. Every fetched vendor page is a row in a
TimescaleDB hypertable, hashed so unchanged pages are skipped. Row-level security is forced on every
tenant table and keyed to the signed-in user. pgvector stores open-weight &lt;code&gt;bge-small&lt;/code&gt; embeddings for
"related past changes" (switched off on the hosted demo; see below).&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;strong&gt;Deterministic code builds the evidence; the open-weight model interprets it.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Discovery.&lt;/strong&gt; SerpApi finds candidate announcements. A search hit is &lt;em&gt;never&lt;/em&gt; proof: Vendorwake only
trusts text it fetched itself from the vendor's official domains. It uses plain HTTP first and a
Browserbase browser when the page is a JavaScript shell. Each fetch is hashed and stored in a
TimescaleDB hypertable, so unchanged pages are skipped and every finding points at the exact bytes
it came from.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extraction.&lt;/strong&gt; Gemma 4 turns a release section into structured changes: type, severity, affected
symbols, replacement and a verbatim evidence quote. Then a &lt;strong&gt;grounding check&lt;/strong&gt; throws out any quote that
isn't literally in the source. Vendor text is wrapped as untrusted data, and a planted "ignore previous
instructions" line in the tests gets flagged instead of obeyed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Repository analysis.&lt;/strong&gt; Manifest parsers plus a Python AST scanner find imports, attribute chains like
&lt;code&gt;stripe.Reversal&lt;/code&gt;, and keyword calls like &lt;code&gt;.retrieve(customer=...)&lt;/code&gt;, each with a file and line.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Impact.&lt;/strong&gt; Rules match extracted symbols to code references and version ranges. Gemma writes the
rationale and builds an &lt;strong&gt;evidence graph&lt;/strong&gt; (vendor source → change → symbol → file → test) where every
edge points at a piece of evidence.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Migration and verification.&lt;/strong&gt; Gemma proposes a unified diff per affected file. Vendorwake checks that
the diff applies, then runs the fixture's tests in a fresh virtualenv before the upgrade, after it, and
after the patch. Patches are never pushed: no agent identity holds &lt;code&gt;repo:write&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Things that surprised me while building on free plans only:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OpenRouter's free Gemma pool was rate-limited upstream, so I moved to Google AI Studio's free tier.
Gemma 4 there always thinks before answering and rejects a thinking budget, so the adapter strips the
&lt;code&gt;&amp;lt;thought&amp;gt;&lt;/code&gt; block before validating.&lt;/li&gt;
&lt;li&gt;Backboard's free credit covers memory and retrieval but not chat. So Backboard stores and retrieves,
and Gemma writes the answer from exactly what was retrieved. Honestly, I like that split better.&lt;/li&gt;
&lt;li&gt;sentry-sdk 2.73 sends gen_ai spans as a separate span-streaming envelope, not inside
&lt;code&gt;transaction.spans&lt;/code&gt;. My first trace assertion found zero spans.&lt;/li&gt;
&lt;li&gt;Entire 0.12 stores checkpoints as git refs (&lt;code&gt;refs/entire/checkpoints/...&lt;/code&gt;) with 26-character IDs, which
differs from the docs I started from.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What isn't done yet (said plainly):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub access uses a read-only token, not Auth0 Token Vault. Auth0's async approval (CIBA) isn't on the
free plan, so approvals are in-app.&lt;/li&gt;
&lt;li&gt;Verification runs only for allow-listed repos, and on free hosting the sandbox can't fully cut network
access. The environment string on every result says so.&lt;/li&gt;
&lt;li&gt;On free Render, Temporal runs embedded and loses its history when the service sleeps or redeploys.
Reports and timelines live in Postgres, but an investigation that was mid-flight during a redeploy stays
stuck at "running".&lt;/li&gt;
&lt;li&gt;The 512 MB free instance can't also hold the ONNX embedding model, which got the container OOM-killed
once. So "related past changes" (pgvector) runs locally, and is switched off on the hosted demo.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Related reading on DEV:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://dev.to/getversyka/breaking-api-changes-turned-into-tested-pull-requests-4o80"&gt;Breaking API changes, turned into tested pull requests&lt;/a&gt;
by getversyka tackles the same pain from the pull-request side. Vendorwake's angle is the evidence
labels and an open-weight model.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/hexisteme/how-to-make-an-ai-research-agent-label-facts-vs-inferences-a-deterministic-provenance-pipeline-5dfn"&gt;How to make an AI research agent label facts vs inferences — a deterministic provenance pipeline&lt;/a&gt;
by hexisteme argues for the same split: the LLM extracts, deterministic code decides what counts as a fact.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/vivantejani/connected-is-not-proven-building-an-evidence-graph-that-admits-what-it-doesnt-know-4de5"&gt;Connected Is Not Proven: Building an Evidence Graph That Admits What It Doesn't Know&lt;/a&gt;
by vivantejani is the right instinct for evidence graphs: an edge needs a quote behind it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Open Innovation Matters
&lt;/h2&gt;

&lt;p&gt;A tool that reads untrusted vendor text and makes claims about my code has to be inspectable end to end:&lt;br&gt;
the model weights, the prompts, the rules that decide "confirmed", and the evidence behind each claim. With&lt;br&gt;
an open-weight model behind a plain adapter, nobody's API decides what my dependency watcher can see, and&lt;br&gt;
anyone can rerun the same investigation and get the same evidence.&lt;/p&gt;

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

&lt;p&gt;I stopped reading changelogs. Vendorwake reads them, ignores the ones that don't touch my code, and opens&lt;br&gt;
the ones that do with the file, the line, the failing test and a proposed patch that has already been tested.&lt;/p&gt;

&lt;p&gt;For the Stripe upgrade, that work by hand would mean reading a 41-change release, grepping four files,&lt;br&gt;
setting up two virtualenvs, running the tests on both versions, writing patches and testing them again.&lt;br&gt;
Vendorwake did it in about 13 minutes while I wasn't watching, on free tiers. My part was reading one&lt;br&gt;
page and deciding whether to approve.&lt;/p&gt;

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