<?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: sky</title>
    <description>The latest articles on DEV Community by sky (@metrix187).</description>
    <link>https://dev.to/metrix187</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%2F4103165%2F6e1b115f-a516-4485-a948-4d8251aadf6a.png</url>
      <title>DEV Community: sky</title>
      <link>https://dev.to/metrix187</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/metrix187"/>
    <language>en</language>
    <item>
      <title>Desk Puppy, a pixel dog that wags to my heartbeat</title>
      <dc:creator>sky</dc:creator>
      <pubDate>Sun, 22 Nov 2026 00:02:07 +0000</pubDate>
      <link>https://dev.to/metrix187/desk-puppy-a-pixel-dog-that-wags-to-my-heartbeat-49d5</link>
      <guid>https://dev.to/metrix187/desk-puppy-a-pixel-dog-that-wags-to-my-heartbeat-49d5</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/presage-2026-11-04"&gt;Presage SmartSpectra SDK Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;Desk Puppy is a small pixel dog that lives on an ESP32 "Cheap Yellow Display" next to my monitor and reacts to my pulse and breathing.&lt;/p&gt;

&lt;p&gt;My PC's built-in webcam is the only sensor. The Presage SmartSpectra SDK reads my pulse rate, breathing rate and a chest movement trace from the video, and a small Node program sends four numbers over USB to the display about ten times a second. The puppy turns them into behavior:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Its tail wags once per heartbeat.&lt;/li&gt;
&lt;li&gt;Its chest rises and falls with my actual breathing trace, not a canned animation.&lt;/li&gt;
&lt;li&gt;When my breathing slows down and my pulse is at its usual level, it closes its eyes and dozes.&lt;/li&gt;
&lt;li&gt;When my pulse is well above my usual level, it gets the zoomies.&lt;/li&gt;
&lt;li&gt;When I hold my breath, after about ten seconds it starts pawing at the glass and tells me to breathe.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wanted to see how these signals feel off a dashboard. Reading &lt;code&gt;72 bpm&lt;/code&gt; on a screen is pretty dry, whereas having a little pixel dog match its tail wag to your actual heartbeat feels surprisingly alive.&lt;/p&gt;

&lt;p&gt;It is a toy. It does not diagnose, treat or monitor anything, and I would not trust it with a health decision.&lt;/p&gt;

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

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fio2mn1xe9u68b8t1b2ac.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fio2mn1xe9u68b8t1b2ac.gif" alt="the puppy lifts a paw toward the glass" width="480" height="330"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The video is one take in real time. The left side is a recording of the terminal window running the bridge; the right side is my phone pointed at the display. The webcam is pointed at me and is not shown. Approximate times:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;0:00 The consent prompt. Nothing has opened the camera yet and the puppy says "waiting for PC".&lt;/li&gt;
&lt;li&gt;0:08 I type &lt;code&gt;yes&lt;/code&gt;. The terminal prints the SmartSpectra SDK version and finds the board.&lt;/li&gt;
&lt;li&gt;0:20 The puppy wakes up. Its chest starts following my breathing, then pulse and breathing rate appear.&lt;/li&gt;
&lt;li&gt;1:24 I have been holding my breath for about ten seconds. The terminal says "breath held" and the puppy paws at the glass until I breathe again.&lt;/li&gt;
&lt;li&gt;2:03 I have been breathing slowly. The puppy falls asleep.&lt;/li&gt;
&lt;li&gt;2:22 I stop the bridge with Ctrl+C, and a few seconds later the puppy goes back to "waiting for PC".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The excited mood (zoomies) is not in this take.&lt;/p&gt;

&lt;p&gt;If you want to try it without a camera or an API key, &lt;code&gt;npm run fake&lt;/code&gt; replays a scripted sequence (calm, held breath, excited, sleepy) through the same logic, and &lt;code&gt;npm run fake -- --dry-run&lt;/code&gt; does it without the board.&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/Metrix187" rel="noopener noreferrer"&gt;
        Metrix187
      &lt;/a&gt; / &lt;a href="https://github.com/Metrix187/desk-puppy" rel="noopener noreferrer"&gt;
        desk-puppy
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A pixel puppy on an ESP32 display that reacts to your live pulse and breathing, read from a webcam with the Presage SmartSpectra SDK
    &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;Desk Puppy&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;A pixel puppy on a small ESP32 display that reacts to your live pulse and breathing.&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/Metrix187/desk-puppy/docs/img/cover.jpg"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FMetrix187%2Fdesk-puppy%2FHEAD%2Fdocs%2Fimg%2Fcover.jpg" alt="Three photos of the Desk Puppy display: awake, pawing at the glass during a held breath, and asleep"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Demo video (2:26, one take): &lt;a href="https://www.youtube.com/watch?v=zhyjDfrWGgY" rel="nofollow noopener noreferrer"&gt;https://www.youtube.com/watch?v=zhyjDfrWGgY&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Your PC's webcam watches you (after you say yes). The &lt;a href="https://smartspectra.presagetech.com/docs/nodejs" rel="nofollow noopener noreferrer"&gt;Presage SmartSpectra SDK&lt;/a&gt; estimates your pulse and breathing from the video, and a small Node program passes four numbers over USB to the display. The puppy does the rest:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;its tail wags once per heartbeat&lt;/li&gt;
&lt;li&gt;its chest rises and falls with your real breathing trace&lt;/li&gt;
&lt;li&gt;it dozes off when your breathing is slow and your pulse is at its usual level&lt;/li&gt;
&lt;li&gt;it gets the zoomies when your pulse is well above your usual level&lt;/li&gt;
&lt;li&gt;it paws at the glass when you hold your breath&lt;/li&gt;
&lt;li&gt;it looks around for you when you leave&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Built for the &lt;a href="https://dev.to/challenges/presage-2026-11-04" rel="nofollow"&gt;DEV Presage SmartSpectra SDK Challenge&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Desk Puppy is a toy.&lt;/strong&gt; It is not a medical device. It does not diagnose…&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Metrix187/desk-puppy" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Two small programs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;firmware/&lt;/code&gt; is a PlatformIO project for the display. It draws the puppy into a sprite with &lt;a href="https://github.com/Bodmer/TFT_eSPI" rel="noopener noreferrer"&gt;TFT_eSPI&lt;/a&gt; and parses one line of text per update.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bridge/&lt;/code&gt; is a Node 24 program for the PC. It runs the SmartSpectra SDK, detects breath holds, decides the puppy's mood and writes to the serial port.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Setup instructions, the parts list and the flashing steps are in the README.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Responds to Human Signals
&lt;/h2&gt;

&lt;p&gt;The system has three pieces:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Camera to bridge.&lt;/strong&gt; The Presage SmartSpectra SDK processes video frames locally on my PC and outputs metrics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bridge to display.&lt;/strong&gt; A Node script turns those metrics into one line of plain text and writes it to the board's serial port (COM5 on my PC) at 115200 baud, about ten times a second.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Display to puppy.&lt;/strong&gt; An Arduino sketch on the ESP32 parses each line and updates the puppy's mood and animation.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The line is the whole interface between the PC and the puppy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;V,&amp;lt;pulse bpm&amp;gt;,&amp;lt;breaths per min&amp;gt;,&amp;lt;state&amp;gt;,&amp;lt;chest -100..100&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The bridge asks the SDK for breathing and cardio metrics and uses three of them: &lt;code&gt;cardio.pulseRate&lt;/code&gt;, &lt;code&gt;breathing.rate&lt;/code&gt; and &lt;code&gt;breathing.upperTrace&lt;/code&gt; (the chest trace).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;sdk&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SmartSpectraSDK&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;requestedMetrics&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="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;breathingMetrics&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="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cardioMetrics&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;enableTelemetry&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&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="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;sdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'metrics'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;decodeMetrics&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;pulse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cardio&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pulseRate&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;at&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&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="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;breathing&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;breathing&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rate&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;at&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&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="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;chest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;breathing&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;upperTrace&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;at&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&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="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&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;sdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;useCamera&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;CameraSelection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;byId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;camera&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&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;sdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Pulse to tail.&lt;/strong&gt; The firmware advances the wag by one full swing per beat, so the tail is a metronome for my heart rate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chest trace to chest.&lt;/strong&gt; The trace arrives in arbitrary units. The bridge centers it, scales it by the size of my recent breaths, and uses it to set how far the puppy's chest rises.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Breath holds.&lt;/strong&gt; The SDK lists an apnea metric but marks it unavailable, so I wrote a detector. My first version looked for a flat trace and never fired, because a held breath does not flatten the trace: the breathing wave goes away, but a ripple at about heartbeat rate stays, roughly a third the size of a breath. The version that works smooths the trace over one second to remove that ripple, learns how far the result normally swings over eight seconds while I breathe, and reports a hold when the swing stays under four tenths of that while the SDK still says it can see me. It lets go within a few seconds of the next breath. I found the right measure with a small calibration mode that tells me when to breathe and when to hold and prints how the trace behaved in each phase.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Moods.&lt;/strong&gt; The rules are short:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mood&lt;/th&gt;
&lt;th&gt;When&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;searching&lt;/td&gt;
&lt;td&gt;no valid signal&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;breath held&lt;/td&gt;
&lt;td&gt;the detector above&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;excited&lt;/td&gt;
&lt;td&gt;pulse more than 20 bpm above my session baseline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sleepy&lt;/td&gt;
&lt;td&gt;breathing under 10 a minute and pulse not raised&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;awake&lt;/td&gt;
&lt;td&gt;otherwise&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The baseline is the median of my pulse over the last three minutes of calm. A webcam pulse wanders by ten beats or so while I sit still, so a baseline fixed at the start went stale within minutes. To keep the puppy from flickering between moods at a threshold, each mood is harder to leave than to enter and has to persist for a couple of seconds before it shows.&lt;/p&gt;

&lt;p&gt;The SDK also reports why it is unhappy with the view (too dark, face not centered, chest not visible). "No face" sends the puppy looking for me. The other complaints are shown in the terminal as advice while the puppy carries on, but a breath hold is only looked for while the status is OK.&lt;/p&gt;

&lt;p&gt;A few things I only learned by using it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Light matters.&lt;/strong&gt; The SDK will not start measuring in a dim room. It reports "Increase light on face" and waits, so the bridge shows that message instead of looking frozen.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Numbers take a moment.&lt;/strong&gt; The chest trace arrives within a few seconds, pulse after about fifteen, and a stable breathing rate can take up to a minute.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Filtering the pulse.&lt;/strong&gt; Single pulse readings can be well off their neighbors, so the puppy follows the median of the last six seconds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Breathing rate comes and goes.&lt;/strong&gt; Most breathing-rate readings arrive marked as not stable. The last stable one stays on screen for up to 45 seconds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The breath-hold detector took three attempts.&lt;/strong&gt; The first was too jumpy, the second never fired, and the third came out of measuring a real held breath.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Most Creative or Delightful Use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Consent and Data Handling
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Consent.&lt;/strong&gt; Before the camera opens, the bridge prints what the camera is for, what leaves the machine and what is kept, and waits for me to type &lt;code&gt;yes&lt;/code&gt;. Anything else exits with the camera untouched, and there is no flag to skip it. It is meant for the person sitting in front of it. It is not for watching someone who does not know.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Video.&lt;/strong&gt; Frames go from the camera straight into the SDK inside the bridge process. The bridge never shows, saves or uploads video. Presage's documentation says all metric computation happens on-device.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What leaves the machine.&lt;/strong&gt; The SDK contacts Presage's servers to authenticate the API key and validate the subscription. That is required, and those requests can be associated with my Presage account. I set &lt;code&gt;enableTelemetry: false&lt;/code&gt;; Presage's &lt;a href="https://smartspectra.presagetech.com/docs/telemetry-and-privacy" rel="noopener noreferrer"&gt;telemetry page&lt;/a&gt; says that with telemetry disabled the SDK starts no telemetry session and transmits nothing for it. I do not use LLM Insights or device readiness reports. The bridge has no network code of its own. The SDK runtime is closed source, so this paragraph is what Presage documents rather than something I verified on the wire.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Storage, retention, deletion.&lt;/strong&gt; Nothing is written to disk: no video, no measurements, no logs. The numbers exist in memory and on screen until I press Ctrl+C. The display board receives pulse, breathing rate, a mood number and a chest position over USB and keeps none of it. Nothing gets saved anywhere, so there is nothing to clear out afterward.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sharing and AI services.&lt;/strong&gt; None. No third-party services, no analytics, no AI service at runtime.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Not medical.&lt;/strong&gt; Desk Puppy makes no diagnosis or treatment claims. "Sleepy" and "excited" are a cartoon dog's moods, driven by simple thresholds. Presage describes SDK metrics as being for general wellness and informational purposes only, not cleared by the FDA, and not for medical diagnosis or treatment.&lt;/p&gt;

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

&lt;p&gt;I built this with Claude Code as a coding buddy. I brought the concept, the CYD hardware, the serial protocol, and the first draft of the firmware, along with the rules for privacy, fallbacks, and how the moods should behave. Claude Code set up an isolated PlatformIO environment, backed up and flashed the board, and wrote the Node bridge, breath-hold detector, mood logic, and tests from the SmartSpectra docs and type declarations I fed it. From there, I ran live webcam tests at my desk, caught where real signal noise broke our assumptions—like the heartbeat ripple showing up during a held breath—ran calibration captures to inspect the trace, and steered the tuning until the puppy felt responsive instead of twitchy.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>presagechallenge</category>
      <category>esp32</category>
      <category>node</category>
    </item>
    <item>
      <title>I put a diffusion model in a stylesheet. No JavaScript.</title>
      <dc:creator>sky</dc:creator>
      <pubDate>Mon, 09 Nov 2026 04:16:07 +0000</pubDate>
      <link>https://dev.to/metrix187/i-put-a-diffusion-model-in-a-stylesheet-no-javascript-12hm</link>
      <guid>https://dev.to/metrix187/i-put-a-diffusion-model-in-a-stylesheet-no-javascript-12hm</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxtltsa1ldrahfwfec58u.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxtltsa1ldrahfwfec58u.gif" alt="Static resolving into a pixel-art cat over twelve denoising steps" width="560" height="900"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try it:&lt;/strong&gt; &lt;a href="https://metrix187.github.io/diffusion.css/" rel="noopener noreferrer"&gt;metrix187.github.io/diffusion.css&lt;/a&gt; · &lt;strong&gt;Code:&lt;/strong&gt; &lt;a href="https://github.com/Metrix187/diffusion.css" rel="noopener noreferrer"&gt;github.com/Metrix187/diffusion.css&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Press the button and the stylesheet freezes a seed, turns it into noise, and denoises that into a 16×16 sprite in 12 steps. There is no &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; on the page. View source and check.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why
&lt;/h2&gt;

&lt;p&gt;People have already put a &lt;a href="https://lyra.horse/x86css/" rel="noopener noreferrer"&gt;CPU&lt;/a&gt;, &lt;a href="https://github.com/mickael-btc/css-ml" rel="noopener noreferrer"&gt;digit classifiers&lt;/a&gt; and, a few days ago, &lt;a href="https://shubhampatil.dev/blog/gpt2-css" rel="noopener noreferrer"&gt;GPT-2&lt;/a&gt; into CSS. I went looking for a diffusion model and couldn't find one, so this is my attempt.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem: CSS has no loops
&lt;/h2&gt;

&lt;p&gt;Denoising is a loop. Each step needs the previous step's output, and a custom property can't refer to itself.&lt;/p&gt;

&lt;p&gt;So the sampler is unrolled. Every step gets its own copy of the arithmetic, and every intermediate value gets its own registered custom property. A hidden unit looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@property&lt;/span&gt; &lt;span class="l"&gt;--Ba0&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;syntax&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;"&amp;lt;integer&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;inherits&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;initial-value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* first unit of the network used by step 2 */&lt;/span&gt;
&lt;span class="nt"&gt;--Ba0&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;max&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;51096&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="err"&gt;5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="err"&gt;25&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nt"&gt;var&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;--a108&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nt"&gt;-&lt;/span&gt; &lt;span class="err"&gt;26&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nt"&gt;var&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;--a123&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nt"&gt;-&lt;/span&gt; &lt;span class="err"&gt;31&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nt"&gt;var&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;--a126&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="c"&gt;/* 80 more terms */&lt;/span&gt;&lt;span class="o"&gt;)/&lt;/span&gt;&lt;span class="err"&gt;512&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Registering the property matters. An unregistered custom property is just text, so each &lt;code&gt;var()&lt;/code&gt; would paste in the whole expression behind it and the stylesheet would blow up. A registered &lt;code&gt;&amp;lt;integer&amp;gt;&lt;/code&gt; is computed once, rounded, and passed on as a number. There are 12,518 of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Seed and noise
&lt;/h2&gt;

&lt;p&gt;The seed is a counter that a hidden checkbox pauses, so the moment you press is the random seed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@keyframes&lt;/span&gt; &lt;span class="n"&gt;spin&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nt"&gt;to&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="py"&gt;--seed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;15813250&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.app&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;spin&lt;/span&gt; &lt;span class="m"&gt;211s&lt;/span&gt; &lt;span class="nb"&gt;linear&lt;/span&gt; &lt;span class="nb"&gt;infinite&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.app&lt;/span&gt;&lt;span class="nd"&gt;:has&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;#go&lt;/span&gt;&lt;span class="nd"&gt;:checked&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;animation-play-state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;paused&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each of the 768 pixel channels then hashes that seed with &lt;code&gt;mod()&lt;/code&gt; four times and sums the draws, which gives roughly Gaussian noise. That is the static you see before pressing.&lt;/p&gt;

&lt;p&gt;The network rule only matches while the box is ticked, so nothing is computed until the seed is frozen. After that, one &lt;code&gt;@keyframes&lt;/code&gt; rule points the 256 pixel elements at each sampler state in turn.&lt;/p&gt;

&lt;h2&gt;
  
  
  The model
&lt;/h2&gt;

&lt;p&gt;Eleven small MLPs, one per noise level, trained in PyTorch on ten hand-drawn sprites that get recoloured to a random hue for every sample. Then they are pruned and rounded to integers: 202,863 weights, each one a literal inside a &lt;code&gt;calc()&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two things that went wrong
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Rounding.&lt;/strong&gt; CSS rounds a &lt;code&gt;calc()&lt;/code&gt; in an &lt;code&gt;&amp;lt;integer&amp;gt;&lt;/code&gt; context to the nearest integer, but browsers don't agree on exact .5 ties. The fix: every division is by a power of two with 0.5 added to the numerator, so a quotient is never a tie. With that in place, a Python sampler using the same integer arithmetic produces identical pixels for the same seed. I checked 40 seeds in Chromium 152 and another 40-odd in Chrome 157.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Blended sprites.&lt;/strong&gt; The first model produced a muddle of two sprites about a third of the time. Deterministic sampling with only 12 steps drifts between two shapes and never commits. Two changes fixed most of it: spacing the noise levels evenly in log-SNR, and training the later steps on inputs deliberately blended with a second sprite while keeping the dominant one as the target, so they learn to snap to one shape. It is down to about 1 in 20.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it isn't
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Not a loop.&lt;/strong&gt; All 12 steps are computed when the seed freezes. The animation reveals them; it does not drive the computation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not creative.&lt;/strong&gt; It learned ten shapes and a continuous range of colours. You get new shape-and-colour combinations, never a new shape.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not tested outside Chromium.&lt;/strong&gt; It only uses features Firefox and Safari also ship, but I have not run it there.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Numbers
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Weights&lt;/td&gt;
&lt;td&gt;202,863&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sampler steps&lt;/td&gt;
&lt;td&gt;12, deterministic DDIM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Registers&lt;/td&gt;
&lt;td&gt;12,518&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Possible seeds&lt;/td&gt;
&lt;td&gt;15,813,251&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;File size&lt;/td&gt;
&lt;td&gt;5.2 MB, 0.8 MB gzipped&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Time to compute a sprite&lt;/td&gt;
&lt;td&gt;about 0.13 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Related reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://dev.to/grahamthedev/pure-css-neural-network-aiits-easier-that-you-think-f02"&gt;😱 Pure CSS! Neural Network / AI...it's easier than you think! 🤯&lt;/a&gt; by GrahamTheDev, the earliest pure-CSS neural net post I found on DEV&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://shubhampatil.dev/blog/gpt2-css" rel="noopener noreferrer"&gt;Implementing GPT-2 Entirely In CSS&lt;/a&gt; by Shubham Patil&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/mickael-btc/css-ml" rel="noopener noreferrer"&gt;css-ml&lt;/a&gt; by mickael-btc, whose README describes the integer-register approach this builds on&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://lyra.horse/x86css/" rel="noopener noreferrer"&gt;x86CSS&lt;/a&gt; by Lyra Rebane&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The repo has the training code, the reference sampler and a console snippet for checking the page against it. If you get it running in Firefox or Safari, I would like to know whether the pixels match.&lt;/p&gt;

</description>
      <category>css</category>
      <category>machinelearning</category>
      <category>showdev</category>
      <category>webdev</category>
    </item>
    <item>
      <title>a new privacy tool :3</title>
      <dc:creator>sky</dc:creator>
      <pubDate>Wed, 21 Oct 2026 03:24:49 +0000</pubDate>
      <link>https://dev.to/metrix187/a-new-privacy-tool-3-2993</link>
      <guid>https://dev.to/metrix187/a-new-privacy-tool-3-2993</guid>
      <description>&lt;p&gt;I made Scrub, a browser tool that blurs the room behind you before you share a photo.&lt;/p&gt;

&lt;p&gt;Photos stay on your device. Blurring isn't anonymity.&lt;/p&gt;

&lt;p&gt;Try it: &lt;a href="https://unlisted-scrub.pages.dev" rel="noopener noreferrer"&gt;Scrub Live Demo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Code:&lt;br&gt;
&lt;/p&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/Metrix187" rel="noopener noreferrer"&gt;
        Metrix187
      &lt;/a&gt; / &lt;a href="https://github.com/Metrix187/unlisted" rel="noopener noreferrer"&gt;
        unlisted
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Reduce background clues in photos shared from home. Browser-based Scrub and manual listing-photo removal guidance.
    &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;unlisted&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Reduce the background clues in photos you share from home.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Unlisted explores one specific risk: a photo's visible room details may be matched to rental or
real-estate listing photos associated with an address. Scrub reduces those details; Footprint helps
you check listing sites manually and find removal guidance. Neither tool can tell you that you are safe
We have not tested these defenses against Raven, GeoSpy, or other proprietary systems.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scrub&lt;/strong&gt; (&lt;code&gt;apps/scrub&lt;/code&gt;) — pick a photo, see what in the room would give it away, tap once to blur the
room out from behind you, share. runs entirely in your browser. the photo never leaves your device.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Footprint&lt;/strong&gt; (&lt;code&gt;apps/footprint&lt;/code&gt; + &lt;code&gt;workers/footprint-api&lt;/code&gt;) — manual search links and per-site removal
guides. Automated lookups are largely blocked. Addresses are sent to a Cloudflare Worker for lookup
the code avoids storing the address, but Cloudflare handles the request. This…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Metrix187/unlisted" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Tell me what breaks.&lt;/p&gt;

</description>
      <category>privacy</category>
      <category>ai</category>
      <category>pwa</category>
      <category>testing</category>
    </item>
    <item>
      <title>Seven Silent Failures: building an autonomous email agent on Cloud Run</title>
      <dc:creator>sky</dc:creator>
      <pubDate>Mon, 31 Aug 2026 18:06:48 +0000</pubDate>
      <link>https://dev.to/metrix187/seven-silent-failures-building-an-autonomous-email-agent-on-cloud-run-85a</link>
      <guid>https://dev.to/metrix187/seven-silent-failures-building-an-autonomous-email-agent-on-cloud-run-85a</guid>
      <description>&lt;p&gt;&lt;em&gt;I created this piece of content for the purposes of entering the All Things Agentic Hackathon.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://quantara.cv/articles/seven-silent-failures.html" rel="noopener noreferrer"&gt;quantara.cv&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  the thing i built
&lt;/h2&gt;

&lt;p&gt;An agent with no chat box. An email arrives, and it wakes up on Cloud Run, reads the thread, checks my actual calendar, writes a proposal document, and prepares a reply — then stops and asks a human the moment it isn't sure. Nobody types anything. There is no prompt. The email &lt;em&gt;is&lt;/em&gt; the prompt.&lt;/p&gt;

&lt;p&gt;Gemini 3.5 Flash does the tool selection through function calling, Google's Agent Development Kit runs the loop, and three Cloud Run services keep ingress separate from execution. Pub/Sub carries events between them and Firestore holds the state. The &lt;a href="https://github.com/Metrix187/quantara-routing-engine" rel="noopener noreferrer"&gt;repo is here&lt;/a&gt; if you want the actual code.&lt;/p&gt;

&lt;p&gt;That's not what this piece is about. This is about the seven things that went wrong, because six of them went wrong &lt;em&gt;quietly&lt;/em&gt;, and that turned out to be the real lesson.&lt;/p&gt;

&lt;h2&gt;
  
  
  the one that shouted
&lt;/h2&gt;

&lt;p&gt;Exactly one failure announced itself. Line endings. I wrote the deploy scripts on Windows, git helpfully stored them with CRLF, and anyone cloning the repo would get &lt;code&gt;bad interpreter: no such file or directory&lt;/code&gt;. Ugly, obvious, fixed with a &lt;code&gt;.gitattributes&lt;/code&gt; in about ninety seconds.&lt;/p&gt;

&lt;p&gt;Every other failure was polite about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. the model that exists, but not here
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;gemini-3.5-flash&lt;/code&gt; returns a 404 on Vertex AI in &lt;code&gt;us-central1&lt;/code&gt;. The error says &lt;em&gt;publisher model not found&lt;/em&gt;. That sentence sends you hunting for a typo in the model name, which is the wrong place to look — the model is fine, the region isn't. It's only served from the &lt;code&gt;global&lt;/code&gt; endpoint.&lt;/p&gt;

&lt;p&gt;I found it by brute force, asking three regions in a row. Nothing in the error text points at geography.&lt;/p&gt;

&lt;h2&gt;
  
  
  2 and 6. iam, twice, the same way
&lt;/h2&gt;

&lt;p&gt;Two separate failures, identical shape. A service account gets created, the very next line binds a role to it, and the bind fails with &lt;em&gt;service account does not exist&lt;/em&gt;. It does exist. It just doesn't exist &lt;em&gt;yet&lt;/em&gt; — IAM is eventually consistent and the propagation window is tens of seconds.&lt;/p&gt;

&lt;p&gt;The first time this bit me, the failure was inside a line ending in &lt;code&gt;|| true&lt;/code&gt;. I'd written that to make the script re-runnable. What it actually did was swallow the error, skip creating the Pub/Sub subscription, and leave me with a deploy that printed three green service URLs and a completely disconnected pipeline.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Every piece of visible config was correct. The thing simply did nothing.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The second time was Cloud Scheduler, which needs its own service agent to hold &lt;code&gt;serviceAccountTokenCreator&lt;/code&gt; on the account it impersonates. Without that grant: no scheduler log, no request at the target, no error anywhere. And while the grant propagates, it fails in exactly the same silent way — so I concluded it was broken and wrote it off. It started working four retries later.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. gmail won't tell you what arrived
&lt;/h2&gt;

&lt;p&gt;A Gmail push notification contains &lt;code&gt;{emailAddress, historyId}&lt;/code&gt;. That's it. No message ID, ever. To find out what actually landed you replay &lt;code&gt;users.history.list&lt;/code&gt; from a watermark you stored yourself, and one notification can cover several messages.&lt;/p&gt;

&lt;p&gt;I'd built the obvious version, passing the &lt;code&gt;historyId&lt;/code&gt; through as though it identified something. Every real trigger 404'd.&lt;/p&gt;

&lt;p&gt;The part worth sitting with: every test I'd written before that point passed, because every test supplied the message ID by hand. I had thoroughly tested a code path that production would never take.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. a container has no idea where it is
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;datetime.now().astimezone()&lt;/code&gt; resolves to UTC on Cloud Run. So "available 9 to 5" quietly became 9–5 UTC, and my agent started offering a prospective client &lt;strong&gt;5 a.m.&lt;/strong&gt; meetings.&lt;/p&gt;

&lt;p&gt;It labelled them UTC correctly, too. The output looked right. It was just useless.&lt;/p&gt;

&lt;p&gt;This is the one I'd most likely have shipped, because it passes every test written by someone sitting in the same timezone as their server — which is to say, every test I would have thought to write.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. the guardrail worked; the output didn't
&lt;/h2&gt;

&lt;p&gt;The agent signed a draft &lt;code&gt;[Operator]&lt;/code&gt;. A literal placeholder, in an email a human was one click from sending.&lt;/p&gt;

&lt;p&gt;Nothing was broken. The escalation logic was working perfectly the entire time. The tool returned &lt;code&gt;ok=True&lt;/code&gt;, because the API call genuinely succeeded. A tool reporting success tells you the call went through, not that what came back was any good — and nobody had read the output yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. i proved it, wrote it down, and shipped it anyway
&lt;/h2&gt;

&lt;p&gt;This is the one I'd lead with.&lt;/p&gt;

&lt;p&gt;Pub/Sub delivers at least once, so every event eventually arrives twice. For an agent with side effects that's the difference between one draft and two. I handled it properly: before doing anything, the router performs an atomic Firestore &lt;code&gt;create()&lt;/code&gt; on a key derived from the event. The create fails if the key exists, and the failure is atomic, so there's no read-then-write race. I was pleased enough with this that I put the formula in the write-up.&lt;/p&gt;

&lt;p&gt;Then I sent two emails at once and the agent wrote two proposal documents for one of them.&lt;/p&gt;

&lt;p&gt;Gmail sends one notification per arriving message. Two emails, two notifications — and both replay the same history window, so both surface &lt;em&gt;both&lt;/em&gt; messages. I'd keyed the claim on &lt;code&gt;historyId + messageId&lt;/code&gt;. Two views of one message, two different keys, no collision, two drafts.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The lock worked exactly as designed. It was guarding the wrong door.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The lesson isn't "handle at-least-once delivery." I &lt;em&gt;had&lt;/em&gt; handled it, and I had a proof. It's that a deduplication key has to name &lt;strong&gt;the thing with the side effect&lt;/strong&gt;, not the thing that told you about it. I'd tested Pub/Sub redelivery, which is the easy case and the one I'd thought of. The case that broke it only appears when two messages arrive close enough together to overlap their history windows — which is exactly what a demo does, and exactly what a quiet test inbox never does.&lt;/p&gt;

&lt;h2&gt;
  
  
  the pattern
&lt;/h2&gt;

&lt;p&gt;Six of seven failures produced no error. Not a caught exception, not a warning, not a log line. Several produced output that looked &lt;em&gt;correct&lt;/em&gt;: meeting times labelled with the right timezone, a deploy printing three healthy service URLs, a cron job sitting in the console marked &lt;code&gt;ENABLED&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The common thread is that distributed systems fail by omission far more than by exception. A missing IAM grant and a still-propagating IAM grant are indistinguishable. A created cron job and a working cron job look identical until the day you need it. A tool returning &lt;code&gt;ok&lt;/code&gt; and a tool returning something useful are different claims.&lt;/p&gt;

&lt;p&gt;Which means the only thing that actually found these was running the real thing against real data and reading the output. Not tests — my tests passed throughout. Watching it work, end to end, and being suspicious of success.&lt;/p&gt;

&lt;h2&gt;
  
  
  what i'd do differently
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Never write &lt;code&gt;|| true&lt;/code&gt; without logging what it swallowed.&lt;/strong&gt; That one line cost me a disconnected pipeline that looked deployed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Assume IAM lags.&lt;/strong&gt; Poll for the resource before binding to it, instead of assuming that created means usable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test in the environment's timezone, not yours.&lt;/strong&gt; Or better: refuse to have a default. Business hours without a named zone are meaningless.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Read the agent's actual output.&lt;/strong&gt; Every run. &lt;code&gt;ok=True&lt;/code&gt; is not a quality signal, and the placeholder signature proved it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Name your idempotency key after the side effect.&lt;/strong&gt; Not after the notification, not after the request. After the thing you'd hate to do twice.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The agent works now. It reads a real inbox, does real multi-step work on real APIs, and stops to ask a human when it isn't sure. That last behaviour is the one I'm most pleased with, and it's the only one that never broke.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>backend</category>
      <category>cloud</category>
    </item>
  </channel>
</rss>
