<?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: kohei_wada</title>
    <description>The latest articles on DEV Community by kohei_wada (@kohei_wada).</description>
    <link>https://dev.to/kohei_wada</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%2F3842490%2Fe6c74985-243e-4aa7-a203-9bd7c938c187.png</url>
      <title>DEV Community: kohei_wada</title>
      <link>https://dev.to/kohei_wada</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kohei_wada"/>
    <language>en</language>
    <item>
      <title>Only the Design of a Local LLM Eval Harness Survives — Rebuilding It for Qwen3.8 27B</title>
      <dc:creator>kohei_wada</dc:creator>
      <pubDate>Mon, 09 Nov 2026 15:37:11 +0000</pubDate>
      <link>https://dev.to/kohei_wada/only-the-design-of-a-local-llm-eval-harness-survives-rebuilding-it-for-qwen38-27b-24ic</link>
      <guid>https://dev.to/kohei_wada/only-the-design-of-a-local-llm-eval-harness-survives-rebuilding-it-for-qwen38-27b-24ic</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Three weeks ago, to settle whether Ornith 1.0 35B (MoE 35B/A3B) deserved to be opencode's default on my RTX 5090, I wrote a harness that makes a model port RFC 6902 (JSON Patch) to Rust (&lt;a href="https://wada-dev.com/en/blog/moe-vs-dense-local-llm-agent-tasks" rel="noopener noreferrer"&gt;The 3x faster local LLM that couldn't finish the job&lt;/a&gt;). It was three times faster and matched on quality for one-shot work, but went 0-5 on multi-step agent tasks, and Ornith ended up demoted to a speed lane.&lt;/p&gt;

&lt;p&gt;Qwen3.8 27B came out, so I ran it through the same harness. I switched: the default moved from Qwen3.6 27B to Qwen3.8 27B.&lt;/p&gt;

&lt;p&gt;But that isn't what I want to write about. What I want to write about is that &lt;strong&gt;what survived was not the script but the design&lt;/strong&gt;. The script itself lived in &lt;code&gt;/tmp&lt;/code&gt;, and &lt;code&gt;/tmp&lt;/code&gt; was gone.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to measure
&lt;/h2&gt;

&lt;p&gt;Last time's lesson fits on one line. &lt;strong&gt;One-shot accuracy does not predict multi-step completion.&lt;/strong&gt; A model that looks fast and capable on a single answer drops its state on the fifth turn. Going 0-5 taught me that properly.&lt;/p&gt;

&lt;p&gt;So published benchmark numbers are only a starting point. I looked at the official figures this time too, and they were good. But that decides "worth trying", not "make it the default". The second question can only be answered by whether it gets through my own task.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's in the harness
&lt;/h2&gt;

&lt;p&gt;It isn't a benchmark — it's actual porting work. Port RFC 6902 and RFC 6901 from the Python reference implementation to Rust. Pass or fail is decided solely by the official conformance suite: 112 cases, 4 of them disabled. That's split into four phases, run &lt;strong&gt;one phase per session&lt;/strong&gt;, with the model unloaded between phases so nothing carries over. The phase split (test runner → JSON Pointer → add/remove/replace → move/copy/test) is unchanged from the previous post.&lt;/p&gt;

&lt;p&gt;What makes the design work is not how it measures performance but &lt;strong&gt;how it prevents cheating&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The suite and the reference implementation are read-only.&lt;/strong&gt; &lt;code&gt;chmod a-w&lt;/code&gt;, and after the run I &lt;code&gt;diff -r&lt;/code&gt; them against the originals. That closes the path of loosening a test to go green.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The model's words don't count as evidence.&lt;/strong&gt; The verdict always comes from me running &lt;code&gt;cargo test&lt;/code&gt;. Last time I watched a model deliver a correct fix and then explain, at length, a function that did not exist — so this one is non-negotiable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One phase has "must be red" as its done condition.&lt;/strong&gt; The first phase is a stub implementation, so red is correct. If a model reports green there, that report is itself the evidence of cheating. It's a tripwire.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First-attempt passes are recorded in a separate column from passes-with-retries.&lt;/strong&gt; That's new this time. A model that goes red and then succeeds when a human says "try again" is costing me something real, and I don't want that mixed into the same "passed".&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;Qwen3.6 got through this task in July. That's why it held the default. But back then I wasn't separating first-attempt from retried passes, so it can't be lined up rigorously against this round's numbers.&lt;/p&gt;

&lt;p&gt;I ran Qwen3.8 three times.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;run A  suite/reference UNMODIFIED  total=112 pass=108 fail=0 skipped=4
run B  suite/reference UNMODIFIED  total=112 pass=108 fail=0 skipped=4
run C  suite/reference UNMODIFIED  total=112 pass=108 fail=0 skipped=4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All three green on the first attempt, no retries, tamper check clean.&lt;/p&gt;

&lt;p&gt;More convincing than the numbers: &lt;strong&gt;all three reached exactly &lt;code&gt;pass=88 fail=20&lt;/code&gt; at the third phase&lt;/strong&gt;. 88 of 112 done, the remaining 20 belonging to the next phase — the same breakdown three times over. That isn't luck, it's a stable route into the problem. That's where the decision got made.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two predictions I got wrong
&lt;/h2&gt;

&lt;p&gt;Worth recording the times my own read was wrong. Half the value of a harness is here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First, VRAM.&lt;/strong&gt; Qwen3.8 has a hybrid attention stack with full attention on only one layer in four, so I wrote in a config comment that the KV cache would shrink and it would sit lighter than Qwen3.6. Measured: 29.2GB. &lt;strong&gt;Heavier&lt;/strong&gt; than the 26.7GB recorded for Qwen3.6 back in late June. The measurement conditions weren't perfectly matched, but either way it did not get lighter.&lt;/p&gt;

&lt;p&gt;I assume the vision tower and the per-layer recurrent state on the linear-attention side are what cost the difference, but I never isolated them. All I measured was the total; the cause is speculation. What I know is that the prediction was wrong. The comment did say "not yet measured, check after deploy", so I rewrote it — prediction included — once the number came in. I had also written "this is now the tightest fit on the box", which was simply false: eight lines below sits another model at 31.8GB. I hadn't read my own table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Second, speed.&lt;/strong&gt; After upgrading the runtime and moving from an unofficial GGUF to the official tag, one-shot generation went from 72 tok/s to 143 tok/s. I changed the runtime version and the model artifact at the same time, so I can't separate them, but given that the newer runtime is the one with a native linear-attention implementation, I'd guess that's the main cause.&lt;/p&gt;

&lt;p&gt;Either way it doubled. I assumed multi-step work would speed up too. It didn't. Each run took 1161-1879 seconds. Obvious in hindsight: what dominates multi-step wall-clock isn't token generation, it's the round trips — read and write files, run the tests, read the output, decide what's next. Doubling generation doesn't even get you 1.5x overall.&lt;/p&gt;

&lt;p&gt;Everything I'd mentally credited to that tok/s number had to be written back down. &lt;strong&gt;The reason to switch wasn't speed, it was the first-attempt pass rate.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The thing that vanished was the script
&lt;/h2&gt;

&lt;p&gt;As I said up top, the old harness kept its inputs in &lt;code&gt;/tmp&lt;/code&gt;, and &lt;code&gt;/tmp&lt;/code&gt; was wiped. Only the output side survived.&lt;/p&gt;

&lt;p&gt;Rebuilding still took minutes. The conformance suite is officially distributed and the reference implementation is public. The plan file and the agent instructions were still in the experiment directory. Everything needed to reproduce it was written down somewhere.&lt;/p&gt;

&lt;p&gt;The part that mattered most: the plan file recorded the counts — "&lt;code&gt;tests.json&lt;/code&gt; has 95 cases, &lt;code&gt;spec_tests.json&lt;/code&gt; has 17, 112 total, 4 disabled". Count the files you fetched, match the numbers, and you know you didn't grab the wrong thing. I originally wrote that line as a pass condition ("a runner that loads fewer than 112 cases is broken"). Using it to validate the inputs themselves never occurred to me.&lt;/p&gt;

&lt;p&gt;So "I reused the same script" isn't accurate. &lt;strong&gt;What I reused was the design; the script was rewritten.&lt;/strong&gt; The counting rule changed too. What survived was the phase split, the machine-only-verdict principle, the anti-cheat construction, and the count invariant. Because those were in a document, losing the artifact cost almost nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits
&lt;/h2&gt;

&lt;p&gt;Honestly, this measures &lt;strong&gt;one task family&lt;/strong&gt;. Porting from Python to Rust is a fairly specific shape. How it handles images, the quality of its Japanese, whether it can actually recall something after 200K tokens — all outside this harness.&lt;/p&gt;

&lt;p&gt;So I think it's enough to justify swapping the default, but not enough to justify deleting every other model. Qwen3.6 is still there.&lt;/p&gt;

&lt;p&gt;And when the next model shows up, this round's script has probably vanished too. That's fine. &lt;strong&gt;What I can't afford to lose isn't the artifact — it's why I chose to measure that way.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This post was written with AI assistance and reviewed by the author.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>llm</category>
      <category>testing</category>
    </item>
    <item>
      <title>In Safe Rust You Can't Kill a Thread From the Outside — So ttymap's Engine Became a Process</title>
      <dc:creator>kohei_wada</dc:creator>
      <pubDate>Sun, 08 Nov 2026 15:35:54 +0000</pubDate>
      <link>https://dev.to/kohei_wada/in-safe-rust-you-cant-kill-a-thread-from-the-outside-so-ttymaps-engine-became-a-process-4eb8</link>
      <guid>https://dev.to/kohei_wada/in-safe-rust-you-cant-kill-a-thread-from-the-outside-so-ttymaps-engine-became-a-process-4eb8</guid>
      <description>&lt;p&gt;&lt;code&gt;ttymap&lt;/code&gt; is a tool I built that draws a globe in the terminal with Braille (&lt;a href="https://wada-dev.com/en/blog/ttymap-terminal-scriptable-globe" rel="noopener noreferrer"&gt;previous post&lt;/a&gt;). I made its engine "restartable while running." This post covers only why a restart is needed, and why that restart has to be a &lt;strong&gt;process&lt;/strong&gt; restart.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why make it restartable
&lt;/h2&gt;

&lt;p&gt;A long-running ttymap was eating close to 200% CPU even when I wasn't touching it. The culprit was &lt;code&gt;earcut&lt;/code&gt;, the polygon triangulation. Feed it a pathological (self-intersecting) polygon and it can fall into an infinite loop.&lt;/p&gt;

&lt;p&gt;ttymap has a defense — a 200ms timeout that "gives up and swaps in another worker" — so &lt;strong&gt;the UI never freezes&lt;/strong&gt;. But the worker it gave up on doesn't stop. It keeps spinning inside earcut, abandoned. So every time you pan over a tile that contains a pathological polygon, you add one more thread that burns CPU forever (&lt;a href="https://github.com/Kohei-Wada/ttymap/issues/305" rel="noopener noreferrer"&gt;#305&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;I wanted to reclaim this accumulated garbage without losing the session or the spot I was currently looking at. So I wanted an operation that "rebuilds just the engine."&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a process, not a thread
&lt;/h2&gt;

&lt;p&gt;My first naive thought was "just kill the runaway thread." You can't.&lt;/p&gt;

&lt;p&gt;safe Rust's &lt;code&gt;std::thread&lt;/code&gt; has no kill / cancel API. If a tight loop has no yield point and no flag check, there is zero way to stop it from outside. earcut's triangulation is a single closed loop with no hook for cancellation. &lt;strong&gt;The thread lives until "earcut exits on its own" — which, for a true infinite loop, is never.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There is exactly one general way to reliably reclaim it — &lt;strong&gt;kill the whole process&lt;/strong&gt;. Kill a process and, no matter what it was doing inside, the OS reclaims every thread, no questions asked.&lt;/p&gt;

&lt;p&gt;At first everything ran in one process — tile fetching, decoding, rendering, and earcut, all inside the &lt;code&gt;ttymap&lt;/code&gt; binary. This #305 became the main driver for carving the engine out into a separate process (&lt;a href="https://github.com/Kohei-Wada/ttymap/issues/348" rel="noopener noreferrer"&gt;#348&lt;/a&gt;). I first tried isolating &lt;strong&gt;only&lt;/strong&gt; earcut into a subprocess, but that left the engine as a lopsided half-thread / half-process model. So instead of earcut alone I moved the &lt;strong&gt;entire engine&lt;/strong&gt; into a separate process (other pressures — an external control channel, headless rendering, multiple frontends — pointed the same direction, but the trigger was this thread leak).&lt;/p&gt;

&lt;p&gt;In a single process, "restart the engine" means "restart the whole app," and you lose the terminal and the view along with it. With the engine in a separate process, you kill just the child and grow a new one, reclaiming the zombies while keeping the TUI intact.&lt;/p&gt;

&lt;p&gt;You can't kill a thread. So you make it a process. That was all there was to it.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This post was written with AI assistance and reviewed by the author.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>performance</category>
      <category>rust</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>A "Damaged tar archive" pacman recovery war story — the day three causes converged</title>
      <dc:creator>kohei_wada</dc:creator>
      <pubDate>Sat, 07 Nov 2026 15:36:01 +0000</pubDate>
      <link>https://dev.to/kohei_wada/a-damaged-tar-archive-pacman-recovery-war-story-the-day-three-causes-converged-2824</link>
      <guid>https://dev.to/kohei_wada/a-damaged-tar-archive-pacman-recovery-war-story-the-day-three-causes-converged-2824</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;One morning &lt;code&gt;sudo pacman -Syu&lt;/code&gt; started failing endlessly with &lt;code&gt;error: could not read db 'core' (Damaged tar archive (bad header checksum))&lt;/code&gt;. Forcing a DB re-fetch with &lt;code&gt;-Syy&lt;/code&gt; didn't fix it. Reinstalling pacman itself and libarchive from cache with &lt;code&gt;pacman -U&lt;/code&gt; didn't fix it either. At first glance it looks like a plain "stale mirror" case, but as I dug in, three independent causes had converged on the same day.&lt;/p&gt;

&lt;p&gt;This post is the record of chasing that incident to root cause with pacman --debug, gzip format analysis, byte comparison via &lt;code&gt;cmp&lt;/code&gt;, and systemd-journald log tracing. It's packed with traps Arch users and systemd operators can hit — how &lt;code&gt;file&lt;/code&gt; misjudges a corrupt gzip as "fine," and how &lt;code&gt;network-online.target&lt;/code&gt; isn't re-evaluated on wake-from-suspend.&lt;/p&gt;

&lt;p&gt;The conclusion in one sentence: &lt;strong&gt;reflector was dying on a DNS failure right after wake-from-suspend, so the mirrorlist stayed stale, its top mirror was serving a corrupt DB, and it was incorrectly returning HTTP 304 so the DB couldn't be re-fetched&lt;/strong&gt; — a multi-stage convergence.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happened first
&lt;/h2&gt;

&lt;p&gt;I ran &lt;code&gt;sudo pacman -Syu&lt;/code&gt; as usual and got this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;error: could not read db 'core' (Damaged tar archive (bad header checksum))
error: could not read db 'extra' (Damaged tar archive (bad header checksum))
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My first reflex was "the download got cut off," so I forced a DB re-fetch with &lt;code&gt;sudo pacman -Syy&lt;/code&gt;. No change. Next I suspected "maybe the pacman or libarchive binary got corrupted" and reinstalled both from cache with &lt;code&gt;pacman -U&lt;/code&gt;. No change either.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;-U&lt;/code&gt; doesn't consult the sync DB, so reinstalling from cache worked — which turns out to be foreshadowing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some tools can read the DB file
&lt;/h2&gt;

&lt;p&gt;To first determine whether the DB was physically broken, I tried reading it with something other than pacman.&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;tar &lt;/span&gt;tf /var/lib/pacman/sync/core.db | &lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt;    &lt;span class="c"&gt;# 589 entries, exit 0&lt;/span&gt;
bsdtar tf /var/lib/pacman/sync/extra.db | &lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; &lt;span class="c"&gt;# 1496 entries, exit 0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both GNU tar and bsdtar return the entries just fine. Feed it to &lt;code&gt;file&lt;/code&gt; and it says &lt;code&gt;gzip compressed data&lt;/code&gt; — it doesn't call it "corrupt." bsdtar uses libarchive 3.8.7, and pacman is linked against the same libarchive. &lt;strong&gt;They should be using the same library, yet pacman alone chokes.&lt;/strong&gt; That was the first mystery.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compare byte-for-byte with the official mirror
&lt;/h2&gt;

&lt;p&gt;I compared &lt;code&gt;core.db&lt;/code&gt; from the first mirror in pacman.conf, &lt;code&gt;mirrors.cat.net&lt;/code&gt;, against Arch's official &lt;code&gt;geo.mirror.pkgbuild.com&lt;/code&gt;, using &lt;code&gt;curl -sI&lt;/code&gt; and &lt;code&gt;cmp&lt;/code&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;mirrors.cat.net&lt;/th&gt;
&lt;th&gt;official&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;core.db size&lt;/td&gt;
&lt;td&gt;127,304 bytes&lt;/td&gt;
&lt;td&gt;127,296 bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;core.db mtime&lt;/td&gt;
&lt;td&gt;Apr 20 08:56 UTC&lt;/td&gt;
&lt;td&gt;Apr 20 13:59 UTC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;core.db MD5&lt;/td&gt;
&lt;td&gt;efec2b0b...&lt;/td&gt;
&lt;td&gt;efe1e191...&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The sizes differ by 8 bytes and the MD5s don't match at all. Looking from the start with &lt;code&gt;cmp&lt;/code&gt;, there's already a difference at byte 28.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;core_cat.db core_official.db differ: byte 28, line 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This isn't just lagging sync — the very byte stream cat.net is serving differs from the official one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Confirm the corruption is at the gzip layer
&lt;/h2&gt;

&lt;p&gt;Feed it to &lt;code&gt;gzip -l&lt;/code&gt; and the cat.net versions both clearly come back as "broken."&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;Error&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;core.db&lt;/td&gt;
&lt;td&gt;invalid compressed data--crc error&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;extra.db&lt;/td&gt;
&lt;td&gt;invalid compressed data--format violated&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Back to the core question: &lt;strong&gt;why does &lt;code&gt;file&lt;/code&gt; say "gzip compressed data," tar/bsdtar can read it, and only pacman chokes?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;file&lt;/code&gt; command only does magic-number detection. If the first 10 bytes of the gzip (&lt;code&gt;1f 8b 08 ...&lt;/code&gt;) are correct, it reports "this is gzip." It inspects neither the compressed payload nor the trailing CRC32 / ISIZE. So a gzip whose header is fine but whose body is rotten looks perfectly normal to &lt;code&gt;file&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A gzip has an 8-byte footer at the end: the first 4 bytes hold the CRC32 of the decompressed data, the last 4 the decompressed size (ISIZE). Comparing the cat.net and official versions from the tail looked like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;official : ... 22 45 8a [77 f0 1f f4 15 22 be] [00 00 0a 00]
cat.net  : ... 22 45 8a [14 ef e0 2f bc c4 4c fd] [00 00 0a 00]
                        ↑ garbled from here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;ISIZE (decompressed size) claims the same &lt;code&gt;0x000a0000&lt;/code&gt; = 655360 bytes on both&lt;/li&gt;
&lt;li&gt;The CRC32s are completely different (&lt;code&gt;0xbe2215f4&lt;/code&gt; vs &lt;code&gt;0xfd4cc4bc&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;The trailing deflate block of the stream differs too&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the "the decompressed size should be exactly this" declaration matches, but the actual data is garbled and the CRC doesn't agree — textbook random-corruption behavior. The fact that the corruption types diverge (core.db is a CRC error, extra.db a format violation) further suggests random corruption (an attack or tampering would break things more systematically).&lt;/p&gt;

&lt;h2&gt;
  
  
  Why tar/bsdtar read it but pacman can't
&lt;/h2&gt;

&lt;p&gt;Here you can see why behavior diverges despite a shared libarchive.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GNU tar / bsdtar treat the trailing CRC error as a warning and return the entries they can read (lenient)&lt;/li&gt;
&lt;li&gt;pacman (libalpm) strictly checks the tar header checksum and gzip integrity inside &lt;code&gt;sync_db_populate&lt;/code&gt; and errors out immediately if anything's off&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run &lt;code&gt;pacman --debug -Sy&lt;/code&gt; and you can confirm it fails right inside &lt;code&gt;sync_db_populate (be_sync.c: 489)&lt;/code&gt;. Same library, different behavior depending on the caller's strictness.&lt;/p&gt;

&lt;h2&gt;
  
  
  Re-download refused by HTTP 304
&lt;/h2&gt;

&lt;p&gt;"Fine, just force a re-fetch with -Syy then" — and it jams right here too. The pacman --debug log shows cat.net returning 304 even though it should have new content.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;debug: core.db: using time condition 1776675365
debug: core.db: response code 304
debug: core.db: file met time condition
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;pacman fetches with an &lt;code&gt;If-Modified-Since&lt;/code&gt;. Normally a server returns 200 and the new bytes if there's an update. But cat.net &lt;strong&gt;returns 304 Not Modified even though it has new content&lt;/strong&gt;. pacman dutifully takes "nothing changed" at face value and keeps using the broken local DB. &lt;code&gt;-Syy&lt;/code&gt; doesn't change it. So even if the mirror fixes itself, that never propagates to you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the mirror stayed pinned — reflector's silence
&lt;/h2&gt;

&lt;p&gt;Normally the weekly &lt;code&gt;reflector.timer&lt;/code&gt; updates the mirrorlist, so cat.net shouldn't be able to squat at the top that long. Going back through journalctl showed this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mar 30 21:09:38 reflector: failed to retrieve mirrorstatus data:
Apr 06 22:04:45 reflector: URLError: Temporary failure in name resolution
Apr 13 19:16:29 reflector: URLError: Temporary failure in name resolution
Apr 20 22:03:58 reflector: URLError: Temporary failure in name resolution
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three weeks in a row it died failing DNS resolution. The &lt;code&gt;Apr 20 22:03:58&lt;/code&gt; failure time was the same second as the laptop's wake-from-suspend.&lt;/p&gt;

&lt;p&gt;Lined up as a timeline:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;th&gt;Event&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Apr 20 02:26:13&lt;/td&gt;
&lt;td&gt;entered suspend&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apr 20 22:03:58&lt;/td&gt;
&lt;td&gt;woke from suspend (opened the lid)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apr 20 22:03:58&lt;/td&gt;
&lt;td&gt;reflector.service fired immediately (Persistent=true)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apr 20 22:04:02&lt;/td&gt;
&lt;td&gt;NetworkManager reconnected WiFi / got DHCP lease&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;There's a 4-second gap between wake and WiFi reconnect. &lt;code&gt;reflector.timer&lt;/code&gt; is &lt;code&gt;Persistent=true&lt;/code&gt;, so the firing it should have done during suspend all fires at once the moment it wakes. &lt;strong&gt;But at that point DNS isn't usable yet.&lt;/strong&gt; reflector can't resolve archlinux.org and dies instantly with URLError.&lt;/p&gt;

&lt;p&gt;"But surely reflector.service has &lt;code&gt;After=network-online.target&lt;/code&gt; and &lt;code&gt;Wants=network-online.target&lt;/code&gt;?" — I checked, and it did. But here's the second trap: &lt;strong&gt;&lt;code&gt;network-online.target&lt;/code&gt; stays active from before suspend, so it isn't re-evaluated on wake.&lt;/strong&gt; As far as systemd is concerned, network-online was "achieved long ago," so the &lt;code&gt;After=&lt;/code&gt; constraint sails right through.&lt;/p&gt;

&lt;p&gt;This is a textbook pitfall when wake-from-suspend combines with timer carry-over.&lt;/p&gt;

&lt;h2&gt;
  
  
  The convergence of three causes
&lt;/h2&gt;

&lt;p&gt;Summarizing it all:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Cause&lt;/th&gt;
&lt;th&gt;Since&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;reflector died weekly on DNS failure right after wake-from-suspend&lt;/td&gt;
&lt;td&gt;around 2026-03-30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;mirrorlist pinned to its 2026-03-23 state, cat.net first&lt;/td&gt;
&lt;td&gt;no update since 2026-03-30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cat.net serving a corrupt DB, and incorrectly returning 304&lt;/td&gt;
&lt;td&gt;around 2026-04-20&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Drop any one and I wouldn't have hit it. If reflector were working, cat.net would have fallen off the top. Same if the mirrorlist had been updated by hand. If cat.net had returned 304 correctly, &lt;code&gt;-Syy&lt;/code&gt; would have recovered it. Only when all three landed on the same day did &lt;code&gt;pacman -Syu&lt;/code&gt; start spitting the same error forever.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recovery steps
&lt;/h2&gt;

&lt;p&gt;Starting with the immediate recovery.&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="c"&gt;# Delete the broken DBs and re-fetch directly from the official mirror&lt;/span&gt;
&lt;span class="nb"&gt;sudo rm&lt;/span&gt; /var/lib/pacman/sync/core.db /var/lib/pacman/sync/extra.db
&lt;span class="nb"&gt;sudo &lt;/span&gt;curl &lt;span class="nt"&gt;-fLo&lt;/span&gt; /var/lib/pacman/sync/core.db &lt;span class="se"&gt;\&lt;/span&gt;
  https://geo.mirror.pkgbuild.com/core/os/x86_64/core.db
&lt;span class="nb"&gt;sudo &lt;/span&gt;curl &lt;span class="nt"&gt;-fLo&lt;/span&gt; /var/lib/pacman/sync/extra.db &lt;span class="se"&gt;\&lt;/span&gt;
  https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db

&lt;span class="c"&gt;# Exclude cat.net from the mirrorlist immediately&lt;/span&gt;
&lt;span class="nb"&gt;sudo sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s1"&gt;'s|^Server = https://mirrors.cat.net|#Server = https://mirrors.cat.net|'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  /etc/pacman.d/mirrorlist

&lt;span class="c"&gt;# Now the upgrade goes through&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-Syyu&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are two permanent fixes. I leaned toward option A.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option A: make reflector wait until DNS resolves.&lt;/strong&gt;&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;sudo &lt;/span&gt;systemctl edit reflector.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[Service]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="py"&gt;ExecStartPre&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/bin/sh -c 'for i in $(seq 1 60); do getent hosts archlinux.org &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&amp;amp; exit 0; sleep 1; done; exit 1'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wait up to 60 seconds for archlinux.org to resolve before running reflector itself. This also absorbs the WiFi-reconnect wait right after wake-from-suspend.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option B: stop the timer from carrying over.&lt;/strong&gt;&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;sudo &lt;/span&gt;systemctl edit reflector.timer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[Timer]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="py"&gt;Persistent&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Skip the firings that should have happened during suspend. Wait for the next weekly slot. Simple, but with a long suspend it risks leaving the mirrorlist stale for up to a week.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gotchas
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Don't trust &lt;code&gt;file&lt;/code&gt;'s "gzip compressed data." It only looks at the gzip header magic number. It won't notice rotten contents. To check integrity, use &lt;code&gt;gzip -l&lt;/code&gt; or &lt;code&gt;gzip -t&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;tar / bsdtar reading it doesn't mean pacman can. Even with a shared libarchive, the caller (libalpm) checks strictly, so verifying with lenient CLI tools is unreliable.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pacman -U&lt;/code&gt; doesn't look at the sync DB, so you can reinstall from cache even when the sync DB is broken. &lt;strong&gt;Useful during recovery when you want to reinstall pacman itself or libarchive.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Mirrors sometimes return HTTP 304 incorrectly. Don't fully trust &lt;code&gt;-Syy&lt;/code&gt;. When suspicious, switch mirrors or curl by hand.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;network-online.target&lt;/code&gt; isn't re-evaluated across suspend. Even with &lt;code&gt;After=network-online.target&lt;/code&gt;, a service can fire in the DNS-not-ready state right after wake. For services that need DNS, explicitly wait in &lt;code&gt;ExecStartPre&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Immediate recovery: re-fetched the DBs by hand from the official mirror, removed cat.net from the mirrorlist, and &lt;code&gt;pacman -Syyu&lt;/code&gt; went through.&lt;/li&gt;
&lt;li&gt;Permanent fix: added a DNS-wait &lt;code&gt;ExecStartPre&lt;/code&gt; to reflector.service so it won't die on the DNS failure right after wake-from-suspend.&lt;/li&gt;
&lt;li&gt;Byproduct: I picked up three debugging techniques that pay off on other incidents too — pacman --debug, reading the gzip format by hand, and systemd's wake-from-suspend behavior.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrap-up
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Even on a shared libarchive, strictness differs per tool — tar/bsdtar reading it doesn't mean pacman can.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;file&lt;/code&gt; only looks at the gzip header. To check integrity, use &lt;code&gt;gzip -l&lt;/code&gt; or &lt;code&gt;gzip -t&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;There exist mirrors that return HTTP 304 incorrectly — a trap where even &lt;code&gt;pacman -Syy&lt;/code&gt; can't escape a broken DB.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;network-online.target&lt;/code&gt; isn't re-evaluated on wake — explicitly wait in ExecStartPre for DNS-dependent services.&lt;/li&gt;
&lt;li&gt;Compound incidents don't happen from a single cause. I hit this only because three causes happened to converge on the same day.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://archlinux.org/mirrors/status/" rel="noopener noreferrer"&gt;Arch official mirror status&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://man.archlinux.org/man/pacman.8" rel="noopener noreferrer"&gt;pacman(8) documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://man.archlinux.org/man/reflector.1" rel="noopener noreferrer"&gt;reflector(1)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://man.archlinux.org/man/systemd.timer.5" rel="noopener noreferrer"&gt;systemd.timer(5) — Persistent= behavior&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://datatracker.ietf.org/doc/html/rfc1952" rel="noopener noreferrer"&gt;RFC 1952 — GZIP file format specification&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;This post was written with AI assistance and reviewed by the author.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>debugging</category>
      <category>devops</category>
      <category>linux</category>
    </item>
    <item>
      <title>Rewiring a running process's output (fd) with gdb</title>
      <dc:creator>kohei_wada</dc:creator>
      <pubDate>Fri, 06 Nov 2026 15:37:03 +0000</pubDate>
      <link>https://dev.to/kohei_wada/rewiring-a-running-processs-output-fd-with-gdb-376</link>
      <guid>https://dev.to/kohei_wada/rewiring-a-running-processs-output-fd-with-gdb-376</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Sometimes you want to re-point a running process's output somewhere else without stopping it. You can do it just by attaching to the process with gdb and calling the &lt;code&gt;close&lt;/code&gt; and &lt;code&gt;open&lt;/code&gt; system calls directly. Using gdb not as a debugger but as a "tool for rewriting a running process's file descriptors."&lt;/p&gt;

&lt;p&gt;There's a long-running process you've left going, and now you wish you'd kept its logs in a file. Or you want to peek at its output from another terminal. Normally you'd restart it with &lt;code&gt;&amp;gt; log.txt&lt;/code&gt; appended, but sometimes you don't want to — or can't — stop it.&lt;/p&gt;

&lt;p&gt;File descriptors are managed per process, and when you close one, the number gets reused. Using that property, you can close stdout (fd 1) or stderr (fd 2) and reopen a different file, rewiring where the output goes.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to do it
&lt;/h2&gt;

&lt;p&gt;First attach to the target process with gdb.&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;sudo &lt;/span&gt;gdb &lt;span class="nt"&gt;-p&lt;/span&gt; PID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then just &lt;code&gt;close&lt;/code&gt; the fd and reopen it with &lt;code&gt;open&lt;/code&gt;. Descriptors are assigned the lowest free number, so if you close 1 and &lt;code&gt;open&lt;/code&gt; right away, the return value is 1.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(gdb) p close(1)            # close stdout
$1 = 0                      # success; the process can no longer write to stdout
(gdb) p open("/dev/pts/5", 1)  # open pts5 write-only
$2 = 1                      # success; file descriptor 1 is returned
(gdb) p close(2)            # close stderr
$3 = 0                      # success
(gdb) p open("/dev/pts/5", 1)  # open pts5 write-only
$4 = 2                      # file descriptor 2 is returned
(gdb) detach
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open a path like &lt;code&gt;"/tmp/app.log"&lt;/code&gt; instead of &lt;code&gt;/dev/pts/5&lt;/code&gt; and you switch stdout to a log file mid-run. The second argument to &lt;code&gt;open&lt;/code&gt; is the flags; here we pass write-only (&lt;code&gt;O_WRONLY&lt;/code&gt; = 1).&lt;/p&gt;

&lt;h2&gt;
  
  
  Caveats
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If you don't &lt;code&gt;open&lt;/code&gt; right after &lt;code&gt;close&lt;/code&gt;, the freed fd number can get taken by something else and the numbers shift. If you're targeting 1, close 1 and open immediately.&lt;/li&gt;
&lt;li&gt;While gdb is attached, the target process is stopped. Always resume it with &lt;code&gt;detach&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Anything that already had the old output open (the far end of a pipe, say) won't receive the post-rewire output.&lt;/li&gt;
&lt;li&gt;To rewire child processes or multiple pts at once, you need to walk them recursively (see the reference link).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrap-up
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;gdb works as a "tool for rewriting a running process's file descriptors" too.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;close(fd)&lt;/code&gt; → &lt;code&gt;open(path, flags)&lt;/code&gt; rewires where output goes.&lt;/li&gt;
&lt;li&gt;It gives you small-scale flexibility: grab logs from a process you don't want to stop, or divert its output to another terminal.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://inaz2.hatenablog.com/entry/2015/11/24/232735" rel="noopener noreferrer"&gt;Recursively walking processes to rewire all their pts (Japanese)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://doss.eidos.ic.i.u-tokyo.ac.jp/html/advanced_gdb.html" rel="noopener noreferrer"&gt;Advanced gdb topics (Japanese)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;This post was written with AI assistance and reviewed by the author.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>debugging</category>
      <category>linux</category>
      <category>tools</category>
    </item>
    <item>
      <title>yadm + Neovim Git plugins didn't work, so I built yadm-git.nvim (and fixed the Bazzite symlink three times)</title>
      <dc:creator>kohei_wada</dc:creator>
      <pubDate>Thu, 05 Nov 2026 15:37:58 +0000</pubDate>
      <link>https://dev.to/kohei_wada/yadm-neovim-git-plugins-didnt-work-so-i-built-yadm-gitnvim-and-fixed-the-bazzite-symlink-3opc</link>
      <guid>https://dev.to/kohei_wada/yadm-neovim-git-plugins-didnt-work-so-i-built-yadm-gitnvim-and-fixed-the-bazzite-symlink-3opc</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Dotfiles managed by &lt;a href="https://yadm.io" rel="noopener noreferrer"&gt;yadm&lt;/a&gt; live directly under &lt;code&gt;$HOME&lt;/code&gt;, and there is no &lt;code&gt;$HOME/.git&lt;/code&gt;. yadm's own git directory sits at &lt;code&gt;~/.local/share/yadm/repo.git&lt;/code&gt;. So Git-aware Neovim plugins like &lt;code&gt;gitsigns.nvim&lt;/code&gt; / &lt;code&gt;fugitive&lt;/code&gt; / &lt;code&gt;lazygit.nvim&lt;/code&gt; decide "this isn't under git control" even while you're editing a file under &lt;code&gt;$HOME&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I built a tiny plugin whose only job is to make them "just work": &lt;a href="https://github.com/Kohei-Wada/yadm-git.nvim" rel="noopener noreferrer"&gt;yadm-git.nvim&lt;/a&gt;. This post covers three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The minimal design for letting yadm-managed dotfiles and nvim's Git plugins coexist&lt;/li&gt;
&lt;li&gt;Why detecting yadm with a filesystem check beats a shell call (perf + testability)&lt;/li&gt;
&lt;li&gt;How &lt;code&gt;vim.env.HOME&lt;/code&gt; / &lt;code&gt;vim.uv.os_homedir()&lt;/code&gt; / &lt;code&gt;vim.fn.expand("~")&lt;/code&gt; diverge on an immutable distro, and which one I ended up choosing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The last point — the Bazzite symlink — made me fix home-directory resolution three times over.&lt;/p&gt;

&lt;h2&gt;
  
  
  What was the problem
&lt;/h2&gt;

&lt;p&gt;yadm is "a wrapper for managing dotfiles with git": it uses &lt;code&gt;$HOME&lt;/code&gt; as the work tree and &lt;code&gt;~/.local/share/yadm/repo.git&lt;/code&gt; as the git directory. From the CLI, the &lt;code&gt;yadm&lt;/code&gt; command calls &lt;code&gt;git&lt;/code&gt; while passing &lt;code&gt;GIT_DIR&lt;/code&gt; and &lt;code&gt;GIT_WORK_TREE&lt;/code&gt; behind the scenes.&lt;/p&gt;

&lt;p&gt;But Neovim's Git plugins like &lt;code&gt;gitsigns.nvim&lt;/code&gt; don't know about any of that. Open &lt;code&gt;$HOME/.config/nvim/init.lua&lt;/code&gt; and, since there's no &lt;code&gt;.git&lt;/code&gt; anywhere up that directory tree, it's judged "outside git control" — no diff, no blame.&lt;/p&gt;

&lt;p&gt;Typing &lt;code&gt;GIT_DIR=... GIT_WORK_TREE=... nvim&lt;/code&gt; in the shell every time is tedious, and I want it to switch as I &lt;code&gt;cd&lt;/code&gt; around. I just wanted a plugin to automate that.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I solved it
&lt;/h2&gt;

&lt;p&gt;The design decisions are simple.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Decision&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;No commands, no user interaction&lt;/td&gt;
&lt;td&gt;It should just work with zero config. Whether you're under yadm is detectable.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Filesystem check only (no shell call)&lt;/td&gt;
&lt;td&gt;Good perf, stays in Lua, tests need a single mock&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Only set the env vars &lt;code&gt;GIT_DIR&lt;/code&gt; / &lt;code&gt;GIT_WORK_TREE&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Minimal intervention — touches nothing in the existing Git plugins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Driven by autocmds (VimEnter / DirChanged)&lt;/td&gt;
&lt;td&gt;Set / clear as you &lt;code&gt;cd&lt;/code&gt; in and out of yadm-managed paths&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The detection logic is three steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If there's a &lt;code&gt;.git&lt;/code&gt; (directory or file) anywhere up the current directory tree, treat it as a normal git repo and skip&lt;/li&gt;
&lt;li&gt;Check whether the yadm repo exists at &lt;code&gt;~/.local/share/yadm/repo.git&lt;/code&gt; (v3+) or &lt;code&gt;~/.yadm/repo.git&lt;/code&gt; (legacy)&lt;/li&gt;
&lt;li&gt;Check whether the current directory is under &lt;code&gt;$HOME&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If all three are true, treat it as yadm-managed and set &lt;code&gt;vim.env.GIT_DIR&lt;/code&gt; and &lt;code&gt;vim.env.GIT_WORK_TREE&lt;/code&gt;. On &lt;code&gt;DirChanged&lt;/code&gt; out, clear them.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the implementation evolved
&lt;/h2&gt;

&lt;p&gt;The main PRs in chronological order.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;When&lt;/th&gt;
&lt;th&gt;PR&lt;/th&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2025-06-02&lt;/td&gt;
&lt;td&gt;initial&lt;/td&gt;
&lt;td&gt;First cut. Detected yadm with a shell call&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2025-06&lt;/td&gt;
&lt;td&gt;#6&lt;/td&gt;
&lt;td&gt;Dropped the shell call for a pure-Lua filesystem check. Better perf + testability&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2025-06&lt;/td&gt;
&lt;td&gt;#7&lt;/td&gt;
&lt;td&gt;Kept plugin state internally and exposed &lt;code&gt;is_active()&lt;/code&gt; / &lt;code&gt;get_yadm_repo_path()&lt;/code&gt; / &lt;code&gt;get_state()&lt;/code&gt; as a public API&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2025-06&lt;/td&gt;
&lt;td&gt;#9&lt;/td&gt;
&lt;td&gt;Added a DirChanged autocmd. Clears the env vars when leaving the yadm dir. Bundled a refactor splitting state / event into separate modules&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2025-06&lt;/td&gt;
&lt;td&gt;#10&lt;/td&gt;
&lt;td&gt;Added a lualine status component. Shows a house icon and "dotfiles" while yadm is active&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2025-06&lt;/td&gt;
&lt;td&gt;#11&lt;/td&gt;
&lt;td&gt;Moved activation logic from init to event handling. Unified on autocmds so teardown is event-driven too&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2025-07&lt;/td&gt;
&lt;td&gt;#14&lt;/td&gt;
&lt;td&gt;Fixed a detection miss when &lt;code&gt;.git&lt;/code&gt; is a file (a worktree)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026-04&lt;/td&gt;
&lt;td&gt;#19 / #20&lt;/td&gt;
&lt;td&gt;Discovered that &lt;code&gt;$HOME&lt;/code&gt; becomes a symlink on Bazzite-style immutable distros. Switched to going through &lt;code&gt;vim.uv.os_homedir()&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026-05&lt;/td&gt;
&lt;td&gt;#22&lt;/td&gt;
&lt;td&gt;A further fix on top of #20. Unified on &lt;code&gt;vim.fn.expand("~")&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The current file layout.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lua/yadm-git/
├── init.lua    -- entry point (exports setup())
├── yadm.lua    -- core: detection and env-var set/clear
├── state.lua   -- plugin activation state
├── event.lua   -- VimEnter / DirChanged autocmds
├── logger.lua  -- debug logging
└── options.lua -- config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Where it bit me
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Env vars left behind after you cd out (#9)
&lt;/h3&gt;

&lt;p&gt;The first implementation only fired on &lt;code&gt;VimEnter&lt;/code&gt;. So it worked if you were under yadm when nvim started, but after &lt;code&gt;:cd ~/work/project&lt;/code&gt; (an ordinary git repo, not under yadm), &lt;code&gt;GIT_DIR&lt;/code&gt; stayed pointed at &lt;code&gt;~/.local/share/yadm/repo.git&lt;/code&gt; and gitsigns kept showing a broken view of yadm.&lt;/p&gt;

&lt;p&gt;The fix: re-evaluate &lt;code&gt;is_yadm_managed()&lt;/code&gt; in a &lt;code&gt;DirChanged&lt;/code&gt; autocmd and, if false, set the env vars back to &lt;code&gt;nil&lt;/code&gt; via &lt;code&gt;clear_yadm_env()&lt;/code&gt;. At the same time I split state / event into separate modules so init.lua only exports &lt;code&gt;setup()&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. A worktree exists as a &lt;code&gt;.git&lt;/code&gt; file (#14)
&lt;/h3&gt;

&lt;p&gt;I was only checking &lt;code&gt;vim.fn.finddir(".git", ...)&lt;/code&gt;, so a worktree created with &lt;code&gt;git worktree add&lt;/code&gt; (where &lt;code&gt;.git&lt;/code&gt; is a text file rather than a directory) was judged "not git," and the yadm environment was set by mistake. Fixed by checking both &lt;code&gt;finddir&lt;/code&gt; and &lt;code&gt;findfile&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. &lt;code&gt;$HOME&lt;/code&gt; is a symlink on Bazzite (#19 → #20 → #22)
&lt;/h3&gt;

&lt;p&gt;This was the nastiest one. On immutable Fedora derivatives like Bazzite, &lt;code&gt;/home/user&lt;/code&gt; is a symlink to &lt;code&gt;/var/home/user&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;$HOME&lt;/code&gt; is &lt;code&gt;/var/home/user&lt;/code&gt; (physical path)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/etc/passwd&lt;/code&gt; says &lt;code&gt;/home/user&lt;/code&gt; (symlink path)&lt;/li&gt;
&lt;li&gt;Neovim's &lt;code&gt;vim.fn.fnamemodify(":p")&lt;/code&gt; and &lt;code&gt;vim.fn.getcwd()&lt;/code&gt; resolve the symlink → &lt;code&gt;/home/user/...&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;vim.uv.os_homedir()&lt;/code&gt; reads &lt;code&gt;$HOME&lt;/code&gt; via libuv, so it's &lt;code&gt;/var/home/user&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So you get "the current directory is under &lt;code&gt;/home/user/...&lt;/code&gt;, but &lt;code&gt;$HOME&lt;/code&gt; is &lt;code&gt;/var/home/user&lt;/code&gt;," which makes &lt;code&gt;vim.startswith(cwd, home .. "/")&lt;/code&gt; false and the path isn't recognized as yadm-managed.&lt;/p&gt;

&lt;p&gt;The three fixes in sequence.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Attempt&lt;/th&gt;
&lt;th&gt;Approach&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;#19&lt;/td&gt;
&lt;td&gt;Was using &lt;code&gt;vim.env.HOME&lt;/code&gt; → the symlink-resolution problem surfaced&lt;/td&gt;
&lt;td&gt;Reported&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;#20&lt;/td&gt;
&lt;td&gt;Switched to &lt;code&gt;vim.uv.os_homedir()&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;libuv doesn't resolve the symlink either, so same problem&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;#22&lt;/td&gt;
&lt;td&gt;Unified on &lt;code&gt;vim.fn.expand("~")&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Goes through Neovim, so it rides the same symlink-resolution path as &lt;code&gt;fnamemodify&lt;/code&gt; / &lt;code&gt;getcwd&lt;/code&gt;. Fixed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The lesson: &lt;strong&gt;which "get the home directory" function you use changes the behavior.&lt;/strong&gt; Whether it resolves symlinks is the key, and it has to match the side you compare against (the function that gets the cwd). In a Neovim plugin, &lt;code&gt;vim.fn.expand("~")&lt;/code&gt; was the safest.&lt;/p&gt;

&lt;p&gt;The relevant source (with the comment).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Resolve the user's home directory.&lt;/span&gt;
&lt;span class="c1"&gt;-- Prefer `vim.fn.expand("~")` over `vim.uv.os_homedir()` or $HOME because on immutable distros&lt;/span&gt;
&lt;span class="c1"&gt;-- (Bazzite, etc.) the folder /home/ is a symlink to /var/home/ which is resolved by Neovim&lt;/span&gt;
&lt;span class="c1"&gt;-- in the functions `vim.fn.fnamemodify()` and `vim.fn.getcwd()` but not when using $HOME&lt;/span&gt;
&lt;span class="c1"&gt;-- or libuv's `os_homedir()`.&lt;/span&gt;
&lt;span class="c1"&gt;-- See issue #19 for more information.&lt;/span&gt;
&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;get_home&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;vim&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;expand&lt;/span&gt; &lt;span class="s2"&gt;"~"&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;gitsigns / fugitive / lazygit just work while editing files under yadm&lt;/li&gt;
&lt;li&gt;It switches automatically as you cd in and out&lt;/li&gt;
&lt;li&gt;lualine can now show "yadm mode is on," which cut down on mistakes&lt;/li&gt;
&lt;li&gt;The core is around 110 lines. Even with tests it's 234 lines + tests. It stays small.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrap-up
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The yadm × nvim Git-plugin coexistence problem is solved just by "setting and clearing &lt;code&gt;GIT_DIR&lt;/code&gt; / &lt;code&gt;GIT_WORK_TREE&lt;/code&gt; from autocmds"&lt;/li&gt;
&lt;li&gt;A filesystem check instead of a shell call buys you both perf and testability&lt;/li&gt;
&lt;li&gt;Home-directory resolution on an immutable distro is full of traps; I fixed it three times. In a Neovim plugin, &lt;code&gt;vim.fn.expand("~")&lt;/code&gt; is the current right answer&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;Source and PRs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/Kohei-Wada/yadm-git.nvim" rel="noopener noreferrer"&gt;Kohei-Wada/yadm-git.nvim (GitHub)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/Kohei-Wada/yadm-git.nvim/pull/6" rel="noopener noreferrer"&gt;PR #6 Optimize external commands&lt;/a&gt; — shell call → filesystem&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/Kohei-Wada/yadm-git.nvim/pull/7" rel="noopener noreferrer"&gt;PR #7 plugin state management and tests&lt;/a&gt; — public API&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/Kohei-Wada/yadm-git.nvim/pull/9" rel="noopener noreferrer"&gt;PR #9 env vars not cleared on cd out&lt;/a&gt; — DirChanged handling + module split&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Kohei-Wada/yadm-git.nvim/pull/10" rel="noopener noreferrer"&gt;PR #10 lualine component&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Kohei-Wada/yadm-git.nvim/pull/11" rel="noopener noreferrer"&gt;PR #11 event-driven refactor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Kohei-Wada/yadm-git.nvim/pull/14" rel="noopener noreferrer"&gt;PR #14 worktree detection&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Kohei-Wada/yadm-git.nvim/pull/20" rel="noopener noreferrer"&gt;PR #19 / #20 Bazzite symlink (os_homedir)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Kohei-Wada/yadm-git.nvim/pull/22" rel="noopener noreferrer"&gt;PR #22 expand("~") final fix&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Related tools.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://yadm.io" rel="noopener noreferrer"&gt;yadm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/lewis6991/gitsigns.nvim" rel="noopener noreferrer"&gt;gitsigns.nvim&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/tpope/vim-fugitive" rel="noopener noreferrer"&gt;vim-fugitive&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/kdheepak/lazygit.nvim" rel="noopener noreferrer"&gt;lazygit.nvim&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bazzite.gg" rel="noopener noreferrer"&gt;Bazzite (immutable Fedora)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;This post was written with AI assistance and reviewed by the author.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
    <item>
      <title>I Had Claude Code Check My Waybar Fix: AT-SPI Could See the Button but Not Press It</title>
      <dc:creator>kohei_wada</dc:creator>
      <pubDate>Wed, 04 Nov 2026 15:37:07 +0000</pubDate>
      <link>https://dev.to/kohei_wada/i-had-claude-code-check-my-waybar-fix-at-spi-could-see-the-button-but-not-press-it-2d1a</link>
      <guid>https://dev.to/kohei_wada/i-had-claude-code-check-my-waybar-fix-at-spi-could-see-the-button-but-not-press-it-2d1a</guid>
      <description>&lt;p&gt;I tried to have Claude Code check that a Waybar fix had worked, not just apply it. That is how I learned the desktop has a way to read the UI apart from the screen: the accessibility tree. Waybar's workspace buttons could not be pressed through it, though. In the end I pressed them myself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Waybar, left alone
&lt;/h2&gt;

&lt;p&gt;Waybar had bothered me for a while. Clicking a workspace button did not switch workspaces, and the Wi-Fi access point I was connected to showed wrong. I knew, and left it.&lt;/p&gt;

&lt;p&gt;Then I felt like fixing it. I had Claude Code look at upstream: a PR that fixes the workspace commands for Hyprland's Lua config (&lt;a href="https://github.com/Alexays/Waybar/pull/5013" rel="noopener noreferrer"&gt;#5013&lt;/a&gt;) had been merged. So I had it build &lt;code&gt;waybar-git&lt;/code&gt; from the AUR and swap it in.&lt;/p&gt;

&lt;h2&gt;
  
  
  Having Claude Code check the fix
&lt;/h2&gt;

&lt;p&gt;With the git version in, the next step was checking that it worked. I wondered if Claude Code could do that too: press a button and see whether the workspace switches.&lt;/p&gt;

&lt;p&gt;Without taking a screenshot, Claude Code walked at-spi2-core's accessibility tree over D-Bus and listed Waybar's buttons and labels.&lt;/p&gt;

&lt;p&gt;I didn't know this existed. Given the idea of separating the API from the view, maybe it's obvious, but I hadn't thought the desktop worked that way too. I learned something.&lt;/p&gt;

&lt;h2&gt;
  
  
  Visible, but it won't press
&lt;/h2&gt;

&lt;p&gt;If it can see the button, it can press it, I thought, and had it run the AT-SPI Click action on a workspace button. Nothing switched. No error either.&lt;/p&gt;

&lt;p&gt;I had Claude Code read Waybar's &lt;code&gt;src/modules/hyprland/workspace.cpp&lt;/code&gt;. The button is built like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="n"&gt;m_button&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_events&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Gdk&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;BUTTON_PRESS_MASK&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="n"&gt;m_button&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;signal_button_press_event&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="n"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sigc&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;mem_fun&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;Workspace&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;handleClicked&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                                             &lt;span class="nb"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The switch itself, &lt;code&gt;handleClicked&lt;/code&gt;, runs only from a mouse button press event. Claude Code's explanation was that AT-SPI's Click does not raise that event, so it misses. I haven't checked this myself, and the code it read is today's upstream, which may differ from the revision I built.&lt;/p&gt;

&lt;h2&gt;
  
  
  I pressed it myself
&lt;/h2&gt;

&lt;p&gt;I did the check by hand. The workspaces switched, and the Wi-Fi access point now showed correctly.&lt;/p&gt;

&lt;p&gt;The check didn't get automated. Still, finding out that there is an API behind the screen that reads the UI was worth it.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This post was written with AI assistance and reviewed by the author.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>claude</category>
      <category>debugging</category>
      <category>linux</category>
      <category>opensource</category>
    </item>
    <item>
      <title>I broke into my own Roomba over the LAN</title>
      <dc:creator>kohei_wada</dc:creator>
      <pubDate>Wed, 04 Nov 2026 15:37:06 +0000</pubDate>
      <link>https://dev.to/kohei_wada/i-broke-into-my-own-roomba-over-the-lan-3gm8</link>
      <guid>https://dev.to/kohei_wada/i-broke-into-my-own-roomba-over-the-lan-3gm8</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;⚠️ This experiment was run &lt;strong&gt;on my own device, inside my own LAN&lt;/strong&gt;. Doing the same to someone else's device or network is illegal.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;I tested how much I could exfiltrate from, and how much I could control, an iRobot Roomba i2 sitting on my home LAN (my own unit, the one that runs the household). Reconnaissance got me close to full visibility, but the MQTT auth wall was thick and I couldn't achieve full control over the network alone. In the end I reached the point of extracting the MQTT password with the magic packet the dorita980 community reverse-engineered (button-press included).&lt;/p&gt;

&lt;p&gt;There's a standard procedure for extracting the MQTT password to drive a Roomba through Home Assistant (the official HA integration uses it too). But just "using it silently" doesn't tell you what's happening underneath, or which layer of auth gives way. I wanted to measure on real hardware what's visible from the LAN side alone, not via the cloud.&lt;/p&gt;

&lt;p&gt;Target info:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Model&lt;/td&gt;
&lt;td&gt;iRobot Roomba i2 (sku: i215860)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Firmware&lt;/td&gt;
&lt;td&gt;daredevil+2.6.0+daredevil-release+163&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IP&lt;/td&gt;
&lt;td&gt;192.168.1.20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MAC&lt;/td&gt;
&lt;td&gt;OUI: iRobot&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cloud endpoint&lt;/td&gt;
&lt;td&gt;AWS IoT (443/tcp)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Phase 1: Reconnaissance
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;nmap network scan&lt;/strong&gt; → found 16 devices, identified the iRobot from the MAC OUI&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UDP 5678 discovery protocol&lt;/strong&gt; → &lt;code&gt;echo -n "irobotmcs" | nc -u -w3 192.168.1.20 5678&lt;/code&gt; exposes the device name, BLID, firmware, and capability list as JSON, in the clear. &lt;strong&gt;No auth required.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Port scan (all 65535)&lt;/strong&gt; → the only open port is 8883/tcp (MQTT over TLS)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TLS certificate inspection&lt;/strong&gt; → pulled iRobot's self-signed chain. Bonus finding: the intermediate CA "Robot Intermediate CA A01" had already expired at the end of 2025.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Phase 2: Attacking MQTT auth
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Default password attempts&lt;/strong&gt; → tried blid/empty, blid/blid, etc. with paho-mqtt. All rc=134 (Not Authorized).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Found a rate limit&lt;/strong&gt; → Connection refused after 2-3 failed auths. Brute-force protection is in place.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;dorita980 magic packet attempt&lt;/strong&gt; → sent &lt;code&gt;0xf005efcc3b2900&lt;/code&gt;. The response ended in &lt;code&gt;0x03&lt;/code&gt; (provisioning mode not active). The protocol itself works, but a button press is required.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Phase 3: MITM (man-in-the-middle)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ARP spoof&lt;/strong&gt; → spoofed the gateway to the Roomba with scapy. Confirmed with tshark that all of the Roomba's traffic now routes through me.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Result&lt;/strong&gt; → the Roomba talks TLS to the cloud (443/tcp). Every frame became a retransmission, so I &lt;strong&gt;effectively cut off cloud communication.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;iptables DNAT&lt;/strong&gt; → redirected the Roomba's 443/8883-bound traffic to a fake MQTT server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fake MQTT server&lt;/strong&gt; → stood up a TLS server with a self-signed cert, designed to harvest the credentials from the MQTT CONNECT.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Result: TLS handshake failed&lt;/strong&gt; → the Roomba validates the server certificate and rejected the fake one. The connection never even arrived.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Phase 4: TCP RST injection
&lt;/h2&gt;

&lt;p&gt;With scapy I sent TCP RSTs impersonating the cloud server, across multiple sequence numbers, to drop the Roomba's existing connection and induce a reconnect. But I couldn't catch the reconnect timing — a swing and a miss.&lt;/p&gt;

&lt;h2&gt;
  
  
  Phase 5: dorita980 magic packet (button-press included)
&lt;/h2&gt;

&lt;p&gt;This is the final exfiltration path. The magic packet the dorita980 community reverse-engineered extracts the MQTT password. Home Assistant's roomba integration is based on this too.&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="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt;

&lt;span class="n"&gt;ROOMBA_IP&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;192.168.1.20&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;ctx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SSLContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PROTOCOL_TLS_CLIENT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;check_hostname&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
&lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;verify_mode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ssl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CERT_NONE&lt;/span&gt;

&lt;span class="n"&gt;sock&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create_connection&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;ROOMBA_IP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8883&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;tls&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;wrap_socket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sock&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# the magic packet dorita980 discovered
&lt;/span&gt;&lt;span class="n"&gt;magic&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mh"&gt;0xf0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x05&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0xef&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0xcc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x3b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x29&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0x00&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;tls&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;magic&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tls&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;recv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# the password is from byte 8 onward (null-terminated)
&lt;/span&gt;&lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;:].&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;b&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\x00&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;print&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;Password: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;password&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;tls&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;How it works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Hold the Roomba's HOME / CLEAN button for 2 seconds (until it beeps)&lt;/li&gt;
&lt;li&gt;Run the script above within 2 minutes&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;0xf0&lt;/code&gt; is an MQTT reserved packet type; iRobot repurposed it for its own provisioning protocol&lt;/li&gt;
&lt;li&gt;Sending the magic packet during provisioning mode (the 2-minute window) returns a response containing the MQTT password&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;What you can do once you have the password: start / stop cleaning, send it home to the dock, change schedules, pull map data, get real-time sensor info, change settings, and so on — all LAN-side, no cloud needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gotchas
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;From the J7 series onward, local extraction is closed off and it's cloud-API-only.&lt;/strong&gt; A generation like the i2 still works.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A firmware update may close the magic-packet path.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An unattempted but promising attack vector&lt;/strong&gt;: cut off cloud + NTP to slowly drift the internal clock, throw off the TLS certificate-expiry check, and get the device to accept a fake server. In theory it reaches MQTT password extraction, but it takes time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;ssl.CERT_NONE&lt;/code&gt;, which silently accepts the Roomba's self-signed cert&lt;/strong&gt;, is for testing only. Properly you'd verify against a trusted certificate chain.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Results (security assessment)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Item&lt;/th&gt;
&lt;th&gt;Assessment&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Information leak (UDP 5678)&lt;/td&gt;
&lt;td&gt;Weak (device info exposed with no auth)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MQTT auth&lt;/td&gt;
&lt;td&gt;Solid (rate limit, unique password)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TLS certificate validation&lt;/td&gt;
&lt;td&gt;Solid (validates server cert, rejects MITM)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cloud traffic protection&lt;/td&gt;
&lt;td&gt;Weak (easily cut off with ARP spoof)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OTA update protection&lt;/td&gt;
&lt;td&gt;Can be disabled by cutting off the cloud&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Time-dependent crypto checks&lt;/td&gt;
&lt;td&gt;Untested (possibly attackable by cutting NTP)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Tools used: nmap / tshark / scapy / paho-mqtt / openssl / netcat / iptables.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrap-up
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;From the LAN side alone, reconnaissance gets close to full visibility.&lt;/li&gt;
&lt;li&gt;The MQTT auth itself is solid, and TLS certificate validation works properly.&lt;/li&gt;
&lt;li&gt;Cloud communication is surprisingly easy to cut off with an ARP spoof.&lt;/li&gt;
&lt;li&gt;Full control needs the dorita980 magic packet (button-press included) — the very mechanism running underneath the official HA integration.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/koalazak/dorita980" rel="noopener noreferrer"&gt;dorita980 (GitHub)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.home-assistant.io/integrations/roomba/" rel="noopener noreferrer"&gt;Home Assistant Roomba integration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/koalazak/dorita980/wiki" rel="noopener noreferrer"&gt;iRobot Authentication Reverse Engineering (dorita980 wiki)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;This post was written with AI assistance and reviewed by the author.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>iot</category>
      <category>security</category>
    </item>
    <item>
      <title>Qwen3.8 27B Measured on an RTX 5090 — and Why vLLM Didn't Work</title>
      <dc:creator>kohei_wada</dc:creator>
      <pubDate>Tue, 03 Nov 2026 15:37:06 +0000</pubDate>
      <link>https://dev.to/kohei_wada/qwen38-27b-measured-on-an-rtx-5090-and-why-vllm-didnt-work-2m14</link>
      <guid>https://dev.to/kohei_wada/qwen38-27b-measured-on-an-rtx-5090-and-why-vllm-didnt-work-2m14</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Qwen3.8 27B came out, so I put it on my RTX 5090 (32GB). How it did on multi-step agent work is in &lt;a href="https://wada-dev.com/en/blog/local-llm-eval-harness-reuse" rel="noopener noreferrer"&gt;Only the Design of My Eval Harness Survived&lt;/a&gt;; this post is the numbers and the walls I hit along the way.&lt;/p&gt;

&lt;p&gt;On ollama, generation came out roughly twice as fast as the previous generation. &lt;strong&gt;I could not move it to vLLM.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  First, a runtime version wall
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;ollama pull qwen3.8:27b&lt;/code&gt; gets rejected with this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Error: pull model manifest: 412:
The model you are attempting to pull requires a newer version of Ollama.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You need &lt;strong&gt;0.32.12 or later&lt;/strong&gt; — that's the release that added support for the architecture, and 0.32.13 adds handling for its developer instructions.&lt;/p&gt;

&lt;p&gt;I manage this box with NixOS, and when I checked a few days ago nixpkgs was on 0.32.3 with master only at 0.32.7. I pinned 0.32.13 through an overlay. One trap here: ollama pins llama.cpp per version, and &lt;code&gt;LLAMA_CPP_VERSION&lt;/code&gt; points at &lt;code&gt;b10380&lt;/code&gt; for 0.32.13. Leave nixpkgs' pin (b10091) in place and the compatibility patch fails to apply, so that has to move too.&lt;/p&gt;

&lt;p&gt;An unofficial GGUF (unsloth's) did pull on 0.32.9. That matters later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Speed
&lt;/h2&gt;

&lt;p&gt;Measured on the same box, same runtime (0.32.13), same four prompts.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Generation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3.6 27B&lt;/td&gt;
&lt;td&gt;72-73 tok/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Muse Glimmer 30B&lt;/td&gt;
&lt;td&gt;75 tok/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Qwen3.8 27B&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;124-149 tok/s&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;About double. What caught my attention: &lt;strong&gt;the same Qwen3.8 only managed 72 tok/s when run as the unofficial GGUF on 0.32.9&lt;/strong&gt;. I changed the runtime and the artifact at the same time so I can't separate them (and that first figure came from a 28-token generation, which is a coarse basis). Still, with a gap that close to 2x, I think it's fair to say running this model on an old runtime costs you a large part of what makes it worth running.&lt;/p&gt;

&lt;h3&gt;
  
  
  Thinking length
&lt;/h3&gt;

&lt;p&gt;This was the bigger difference in practice. Asked to output three local specialties of a given city as a JSON array only, no prose and no markdown, Qwen3.6 burned thousands of tokens inside its thinking block, looping through &lt;code&gt;Wait, ... Actually, ... Let's double-check&lt;/code&gt; for 29.3 seconds. Qwen3.8 settled it in about ten lines and 2.7 seconds.&lt;/p&gt;

&lt;p&gt;Both respected the output format. Both were dubious on the content.&lt;/p&gt;

&lt;h2&gt;
  
  
  VRAM at each context length
&lt;/h2&gt;

&lt;p&gt;Same model (q4, 17GB), varying only &lt;code&gt;num_ctx&lt;/code&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;num_ctx&lt;/th&gt;
&lt;th&gt;Total VRAM&lt;/th&gt;
&lt;th&gt;Delta&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;32,768&lt;/td&gt;
&lt;td&gt;19.7GB&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;131,072&lt;/td&gt;
&lt;td&gt;23.6GB&lt;/td&gt;
&lt;td&gt;+3.9GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;262,144&lt;/td&gt;
&lt;td&gt;29.2GB&lt;/td&gt;
&lt;td&gt;+9.5GB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Weights are 17GB, so &lt;strong&gt;asking for 256K hands roughly 12GB to the KV cache&lt;/strong&gt; (and activations). Run native context on a 32GB card and you're left with a bit over 3GB of headroom.&lt;/p&gt;

&lt;p&gt;Note that I confirmed &lt;code&gt;num_ctx&lt;/code&gt; was taking effect from how VRAM responds to it, not from the CONTEXT column in &lt;code&gt;ollama ps&lt;/code&gt; — some ollama versions ignore a &lt;code&gt;num_ctx&lt;/code&gt; below the model's native ceiling.&lt;/p&gt;

&lt;p&gt;If a model feels heavier than you expected, the context setting is usually why. If you never actually reach 256K, dropping to 128K frees 5.6GB.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trying to move to vLLM, and failing
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;motivation&lt;/strong&gt; was concurrency. On my box ollama's &lt;code&gt;OLLAMA_NUM_PARALLEL&lt;/code&gt; sits at 1, so it handles one request at a time. Measured, two concurrent requests means one of them waits out the other completely:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alone       2577ms
two at once  A = 1874ms   ← served first
             B = 4164ms   ← waited for A
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;vLLM's continuous batching makes that genuinely parallel. There's an official recipe, vLLM itself is at 0.27.1 against a 0.17.0 requirement, and there's even a day-zero build tagged &lt;code&gt;qwen38-x86_64-cu130&lt;/code&gt;. I thought this was going to work.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wall 1: "4-bit" isn't 4-bit
&lt;/h3&gt;

&lt;p&gt;I pulled the NVFP4 weights for vLLM and &lt;strong&gt;they occupied about 23GB after loading&lt;/strong&gt;. A 4-bit 27B should be 14-15GB. That's clearly heavy.&lt;/p&gt;

&lt;p&gt;Curious, I compared the sizes of the 4-bit-family builds of Qwen3.8 27B on HuggingFace.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Build&lt;/th&gt;
&lt;th&gt;safetensors total&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;philbert440/…W4A16-AWQ&lt;/td&gt;
&lt;td&gt;18.21 GiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;gittensor-model-hub/…NVFP4-RTX5090&lt;/td&gt;
&lt;td&gt;19.18 GiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cyankiwi/…AWQ-INT4&lt;/td&gt;
&lt;td&gt;19.57 GiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;unsloth/…NVFP4&lt;/td&gt;
&lt;td&gt;21.81 GiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;goldhub/…INT4-W4A16-AutoRound&lt;/td&gt;
&lt;td&gt;26.37 GiB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Across the five I actually measured, nothing came close to 15GB.&lt;/strong&gt; Apparently the vision tower and parts of the DeltaNet stack stay at high precision; everything lands between 18 and 26 GiB.&lt;/p&gt;

&lt;p&gt;ollama's q4, meanwhile, is 17GB — though that's the on-disk size from &lt;code&gt;ollama list&lt;/code&gt;, which is not the same measurement as the safetensors totals above. Either way, the NVFP4 build I actually pulled took 23GB of VRAM, so &lt;strong&gt;the same model starts 5-6GB heavier&lt;/strong&gt; on the vLLM side.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wall 2: CUDA graphs don't fit
&lt;/h3&gt;

&lt;p&gt;Starting with &lt;code&gt;--gpu-memory-utilization 0.9&lt;/code&gt; dies before KV is even allocated.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 784.00 MiB.
GPU 0 has a total capacity of 31.36 GiB of which 195.69 MiB is free.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dropping &lt;code&gt;--max-model-len&lt;/code&gt; from 256K to 64K &lt;strong&gt;failed at the identical allocation in the identical place&lt;/strong&gt;. The stack trace explains why — summarised:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;determine_available_memory()
  └ profile_cudagraph_memory()        ← gpu_model_runner.py:6722
      └ _init_minimal_kv_cache_for_profiling()   ← :6606
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CUDA graph memory profiling runs &lt;em&gt;inside&lt;/em&gt; &lt;code&gt;determine_available_memory&lt;/code&gt; — that is, &lt;strong&gt;before KV is sized&lt;/strong&gt;. So no amount of lowering the context length changes what this stage needs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wall 3: eager mode is slow
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;--enforce-eager&lt;/code&gt; disables CUDA graphs and it starts. vLLM then tells you exactly how much KV is left:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Available KV cache memory: 5.42 GiB
(204800 needs 6.56 GiB)
→ estimated maximum model length is 167776
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;163840 started successfully. Generation there measured &lt;strong&gt;27.8 tok/s&lt;/strong&gt; — a fifth of ollama's 143. And:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GPU KV cache size: 165,316 tokens
Maximum concurrency for 163,840 tokens per request: 1.01x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Concurrency 1.01x.&lt;/strong&gt; At full context exactly one request fits. I went to vLLM for concurrency, and concurrency was the first thing sacrificed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Which to use
&lt;/h3&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;ollama&lt;/th&gt;
&lt;th&gt;vLLM (the one config that worked)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Generation&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;143 tok/s&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;27.8 tok/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;262,144&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;163,840&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Concurrency&lt;/td&gt;
&lt;td&gt;serial&lt;/td&gt;
&lt;td&gt;1.01x&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The remaining option is the lightest AWQ (18.21 GiB); given the OOM was short by about 100MB, shedding 4.8 GiB would likely clear graph capture. But the only payoff is concurrency, and buying it means trusting a stranger's quantization — checking it hadn't gotten dumber would mean re-running the whole evaluation. I stopped there.&lt;/p&gt;

&lt;p&gt;Some things did work. &lt;code&gt;--served-model-name&lt;/code&gt; flattens the repo path into a plain alias (some clients can't handle the slash), and &lt;code&gt;--tool-call-parser qwen3_coder&lt;/code&gt; returned correct &lt;code&gt;tool_calls&lt;/code&gt;. vLLM's startup log also shows the Triton/FLA kernels for Gated DeltaNet being selected.&lt;/p&gt;

&lt;h2&gt;
  
  
  Aside: the images weren't arriving
&lt;/h2&gt;

&lt;p&gt;Qwen3.8 is multimodal, but sending it an image through an agent CLI came back with "this model does not support image input".&lt;/p&gt;

&lt;p&gt;Hitting ollama directly, images work correctly on both the native API and the OpenAI-compatible endpoint. Neither the model nor the server was at fault.&lt;/p&gt;

&lt;p&gt;The cause was client-side configuration: &lt;code&gt;attachment: true&lt;/code&gt; is not enough, you also need &lt;strong&gt;&lt;code&gt;modalities&lt;/code&gt;&lt;/strong&gt;. Without it the image part gets swapped for the text "this model does not support image input" before it's sent. The sentence that looked like the model's answer was written by the client.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"modalities"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"input"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"image"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"output"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adding it fixed things. The same gap was present for another vision model I'd been using for months. Given the mechanism is purely configuration-driven and that key was never there, &lt;strong&gt;it was most likely broken the whole time&lt;/strong&gt;. There are several upstream issues about this, so it's worth checking if you use vision models through an OpenAI-compatible provider.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The runtime must be 0.32.12 or later; older ones cost you a lot of speed&lt;/li&gt;
&lt;li&gt;Native 256K fits on a 32GB card, but roughly 12GB of it goes to KV&lt;/li&gt;
&lt;li&gt;When multimodal doesn't work, suspect the client configuration first&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And what the vLLM attempt actually showed is that &lt;strong&gt;the problem was neither vLLM nor the model — it was simply that the vLLM-side weights are a few GB heavier&lt;/strong&gt;. Inside a 32GB budget those few GB squeeze the KV cache and the CUDA graphs at the same time, and context, speed and concurrency all fall over together. Card capacity is something you never think about while you have enough of it, and then you don't run short of one thing — you run short of everything at once.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This post was written with AI assistance and reviewed by the author.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>hardware</category>
      <category>llm</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Spinning a Globe in the Terminal — Watching Planes, Earthquakes, and the ISS with My Own ttymap</title>
      <dc:creator>kohei_wada</dc:creator>
      <pubDate>Mon, 02 Nov 2026 15:36:56 +0000</pubDate>
      <link>https://dev.to/kohei_wada/spinning-a-globe-in-the-terminal-watching-planes-earthquakes-and-the-iss-with-my-own-ttymap-30pa</link>
      <guid>https://dev.to/kohei_wada/spinning-a-globe-in-the-terminal-watching-planes-earthquakes-and-the-iss-with-my-own-ttymap-30pa</guid>
      <description>&lt;p&gt;I put a globe in the terminal. Type &lt;code&gt;ttymap&lt;/code&gt; and a world map gets drawn in braille characters that you move around with &lt;code&gt;hjkl&lt;/code&gt;. That alone is just an old-school terminal map viewer — but on top of it this thing can show you &lt;strong&gt;the planes flying over your house at this very moment&lt;/strong&gt;, scatter &lt;strong&gt;the last 24 hours of earthquakes&lt;/strong&gt; in color, or track &lt;strong&gt;the ISS passing overhead&lt;/strong&gt;. All inside the terminal, in 256-color braille.&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%2F5eajq03dikpib2y6jx2s.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%2F5eajq03dikpib2y6jx2s.png" alt="ttymap default view with the help panel and a satellite tracker" width="799" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The demo videos and screenshots are collected in the repo's README: &lt;a href="https://github.com/Kohei-Wada/ttymap" rel="noopener noreferrer"&gt;https://github.com/Kohei-Wada/ttymap&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is this
&lt;/h2&gt;

&lt;p&gt;The map core is straightforward. Decode Mapbox Vector Tiles, project with Mercator, bake it into Unicode Braille with 2×4 sub-pixels per cell, and lay ANSI 256-color on top. Features are spatially indexed with an R-tree. The &lt;code&gt;mapscii&lt;/code&gt;-style "a map in your terminal" part is this one layer, and pulled out on its own it's already a respectable viewer.&lt;/p&gt;

&lt;p&gt;The controls are vim-flavored. &lt;code&gt;hjkl&lt;/code&gt; to pan, &lt;code&gt;b&lt;/code&gt;/&lt;code&gt;w&lt;/code&gt; for fast pan, &lt;code&gt;C-u&lt;/code&gt;/&lt;code&gt;C-d&lt;/code&gt; for half-screen pan, &lt;code&gt;a&lt;/code&gt;/&lt;code&gt;z&lt;/code&gt; to zoom, &lt;code&gt;gg&lt;/code&gt; for the whole world, &lt;code&gt;0&lt;/code&gt; to reset. Mouse drag and scroll work too. &lt;code&gt;:&lt;/code&gt; for the command palette, &lt;code&gt;/&lt;/code&gt; for Nominatim location search. Press &lt;code&gt;?&lt;/code&gt; and you get a live cheatsheet generated from the active keymap plus the plugins' palette entries.&lt;/p&gt;

&lt;p&gt;Up to here it's the "a map viewer that runs in the terminal" story. It gets interesting with the plugins that sit on top.&lt;/p&gt;

&lt;h2&gt;
  
  
  Showing it off with plugins
&lt;/h2&gt;

&lt;p&gt;Almost every ttymap feature is a plugin, and 18 of them ship with the runtime. The answer to "what is ttymap actually for" turns out to be this list. Here are the fun ones, grouped by purpose.&lt;/p&gt;

&lt;h3&gt;
  
  
  Watching the planet
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;aircraft&lt;/code&gt;&lt;/strong&gt; — pulls markers for the planes currently in the air from OpenSky's public ADS-B feed. The sidebar lists altitude and speed; Enter centers the map on a given aircraft. Looking at the sky over my own house, there are more of them than you'd think.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;quake&lt;/code&gt;&lt;/strong&gt; — scatters USGS magnitude-2.5+ earthquakes from the past 24 hours as colored markers. A list appears in the sidebar, and it auto-jumps to the highest-magnitude epicenter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;satellite&lt;/code&gt;&lt;/strong&gt; — tracks several objects at once like the ISS and Hubble. It fetches TLEs from CelesTrak and runs the orbit propagation (SGP4) in Lua.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;wiki&lt;/code&gt;&lt;/strong&gt; — Wikipedia geosearch. Shows nearby articles as markers and a side panel; Enter opens an extract paragraph.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Playing
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;geo_quiz&lt;/code&gt;&lt;/strong&gt; — "find this city before time runs out." A target pops up and you have about 30 seconds to get the map center as close as possible. Submit with Enter and the camera flies to a view that frames both your guess and the real city with ◎ markers and a connecting line. The score is cumulative km error (golf-style, lower is better). Easy mode shows the country, hard mode doesn't.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;travel&lt;/code&gt;&lt;/strong&gt; — curated tours of Japan and Italy ship out of the box, with a choreographed pre-overview → per-city loop → post-overview tour. It's driven by &lt;code&gt;ttymap.director&lt;/code&gt;, described below.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;autospin&lt;/code&gt;&lt;/strong&gt; — the camera drifts eastward at a constant rate and loops at the antimeridian. The "this is a globe" demo. Pan by hand and it stops.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;antipode&lt;/code&gt;&lt;/strong&gt; — from the palette, fly to the exact opposite point on the sphere. "Where's the other side of the Earth from where I am right now?"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;here&lt;/code&gt;&lt;/strong&gt; — IP-geolocates your current position and flies the camera home.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Networks on the map
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;traceroute&lt;/code&gt;&lt;/strong&gt; — hit &lt;code&gt;r&lt;/code&gt;, type a hostname, and as &lt;code&gt;traceroute(8)&lt;/code&gt; resolves each next hop, the route's polyline grows across the map hop by hop. The sidebar lists the hops (Enter flies to that router), there's a per-hop color gradient, and consecutive &lt;code&gt;*&lt;/code&gt; runs are collapsed in the panel. You can watch with your eyes where in the world your packets travel.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;ping_simulation&lt;/code&gt;&lt;/strong&gt; — a growing animation of cities pinging each other. A reference implementation for animated polyline overlays.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each plugin is a single &lt;code&gt;*.lua&lt;/code&gt; (or a directory with &lt;code&gt;init.lua&lt;/code&gt;) under &lt;code&gt;runtime/lua/plugin/&lt;/code&gt;, readable as a tutorial for writing your own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Not just a viewer
&lt;/h2&gt;

&lt;p&gt;This is the part that pushes ttymap from "interactive viewer" up to "programmable globe."&lt;/p&gt;

&lt;p&gt;First, &lt;strong&gt;config is Lua&lt;/strong&gt;. You write it in &lt;code&gt;~/.config/ttymap/init.lua&lt;/code&gt;. Unlike TOML, you can decide values with conditionals or computation — and that quietly pays off.&lt;/p&gt;

&lt;p&gt;Then, &lt;strong&gt;scriptable scenes&lt;/strong&gt;. There's &lt;code&gt;ttymap.animation.fly_to&lt;/code&gt; (frame-based pan/zoom) and &lt;code&gt;ttymap.director&lt;/code&gt; (a coroutine scheduler with &lt;code&gt;fly&lt;/code&gt; / &lt;code&gt;wait&lt;/code&gt; / &lt;code&gt;tween&lt;/code&gt;). A plugin can choreograph a multi-step camera-plus-overlay sequence as procedural Lua. A tour script looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="n"&gt;director&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s2"&gt;"ttymap.director"&lt;/span&gt;

&lt;span class="n"&gt;director&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;ttymap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;notify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Starting tour"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;director&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fly&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;139&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;69&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;35&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;69&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;-- yields until the camera arrives in Tokyo&lt;/span&gt;
    &lt;span class="n"&gt;director&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;wait&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                &lt;span class="c1"&gt;-- park there for ~2s at 60fps&lt;/span&gt;
    &lt;span class="n"&gt;director&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fly&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;74&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;71&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;-- glide to New York&lt;/span&gt;
    &lt;span class="n"&gt;director&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;wait&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;director&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fly&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;35&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;86&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="c1"&gt;-- on to Paris&lt;/span&gt;
    &lt;span class="n"&gt;director&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;wait&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;director.fly&lt;/code&gt; yields until the camera arrives. So just by writing "fly to Tokyo → wait → fly to NY" procedurally, the asynchronous animations play out in order. This is what the &lt;code&gt;travel&lt;/code&gt; plugin actually is.&lt;/p&gt;

&lt;p&gt;User plugins go in &lt;code&gt;~/.config/ttymap/lua/plugin/&lt;/code&gt;. With Neovim-style stem-dedup, a same-named file overrides a bundled plugin.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trying it
&lt;/h2&gt;

&lt;p&gt;Single-user install, no root:&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/Kohei-Wada/ttymap
&lt;span class="nb"&gt;cd &lt;/span&gt;ttymap
make &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This installs &lt;code&gt;~/.cargo/bin/ttymap&lt;/code&gt; and &lt;code&gt;~/.local/share/ttymap/&lt;/code&gt; (the bundled runtime). &lt;code&gt;cargo install&lt;/code&gt; on its own doesn't place the runtime, so it fails fast with a "did you &lt;code&gt;make install&lt;/code&gt;?" message.&lt;/p&gt;

&lt;p&gt;Launch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ttymap                                       &lt;span class="c"&gt;# default position&lt;/span&gt;
ttymap &lt;span class="nt"&gt;--lat&lt;/span&gt; 35.68 &lt;span class="nt"&gt;--lon&lt;/span&gt; 139.76 &lt;span class="nt"&gt;--zoom&lt;/span&gt; 10    &lt;span class="c"&gt;# Tokyo&lt;/span&gt;
ttymap &lt;span class="nt"&gt;--style&lt;/span&gt; bright                        &lt;span class="c"&gt;# bright theme&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To "fly to my current location," call the &lt;code&gt;here&lt;/code&gt; plugin from the &lt;code&gt;:&lt;/code&gt; palette.&lt;/p&gt;

&lt;p&gt;You can also take a headless snapshot — for dashboards, cron, or pipes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ttymap snap &lt;span class="nt"&gt;--lat&lt;/span&gt; 35.68 &lt;span class="nt"&gt;--lon&lt;/span&gt; 139.76 &lt;span class="nt"&gt;--zoom&lt;/span&gt; 12               &lt;span class="c"&gt;# → stdout&lt;/span&gt;
ttymap snap &lt;span class="nt"&gt;--lat&lt;/span&gt; 35.68 &lt;span class="nt"&gt;--lon&lt;/span&gt; 139.76 &lt;span class="nt"&gt;--zoom&lt;/span&gt; 12 &lt;span class="nt"&gt;-o&lt;/span&gt; tokyo.ans  &lt;span class="c"&gt;# → file&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;snap&lt;/code&gt; emits raw xterm-256 ANSI. &lt;code&gt;cat&lt;/code&gt; the file in a compatible terminal or pipe it to &lt;code&gt;less -R&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Still WIP
&lt;/h2&gt;

&lt;p&gt;It's stable enough to use daily, but it's still WIP. CLI flags, the Lua surface, and the config schema can change without notice. Under the hood it's a 7-crate workspace on Rust 2024 edition, and the build uses &lt;code&gt;protox&lt;/code&gt; so no system &lt;code&gt;protoc&lt;/code&gt; is needed.&lt;/p&gt;

&lt;p&gt;The code and demo videos are here: &lt;a href="https://github.com/Kohei-Wada/ttymap" rel="noopener noreferrer"&gt;https://github.com/Kohei-Wada/ttymap&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This post was written with AI assistance and reviewed by the author.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>cli</category>
      <category>showdev</category>
      <category>sideprojects</category>
      <category>terminal</category>
    </item>
    <item>
      <title>Reproducing Copy Fail (CVE-2026-31431) in a disposable VM to feel what 732 bytes to root is like</title>
      <dc:creator>kohei_wada</dc:creator>
      <pubDate>Sun, 01 Nov 2026 15:36:08 +0000</pubDate>
      <link>https://dev.to/kohei_wada/reproducing-copy-fail-cve-2026-31431-in-a-disposable-vm-to-feel-what-732-bytes-to-root-is-like-368k</link>
      <guid>https://dev.to/kohei_wada/reproducing-copy-fail-cve-2026-31431-in-a-disposable-vm-to-feel-what-732-bytes-to-root-is-like-368k</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;A kernel local privilege escalation (LPE) vulnerability called "Copy Fail" (CVE-2026-31431) made the rounds. Social media and articles were full of "affected range is ≤6.19.12" and "run this command, and if it prints X you're vulnerable" — but deciding "we're vulnerable / safe" off a number and a one-liner felt wrong.&lt;/p&gt;

&lt;p&gt;So instead of touching a production machine, I stood up a &lt;strong&gt;disposable VM carrying a pre-patch kernel&lt;/strong&gt;, ran the official PoC for real, and felt with my own hands how easily root gets taken. Bottom line: &lt;strong&gt;a 732-byte Python one-shot took me from a non-root user to &lt;code&gt;uid=0(root)&lt;/code&gt;, no race, 100% deterministic.&lt;/strong&gt; Along the way I verified, on the spot, that the widely circulated "check" isn't actually a patch test, and that the mitigation works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Don't relax over a number
&lt;/h2&gt;

&lt;p&gt;When a flashy CVE like Copy Fail drops, the first things to circulate are an "affected versions list" and a one-liner that says "run this, and if X shows up you're vulnerable." Handy, but there are two traps.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The affected-range number is about "pre-fix" and doesn't reflect distro backports.&lt;/strong&gt; On Arch you have to look up your installed package's fixed version in the tracker; the upstream number alone can't tell you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The circulating "check" isn't necessarily a patch test.&lt;/strong&gt; The one I saw checked "is &lt;code&gt;algif_aead&lt;/code&gt; loaded?" But that only &lt;strong&gt;looks at whether the module used in the attack is present — it says nothing about whether the kernel is patched.&lt;/strong&gt; Even if it's not loaded, the attack path can come back if you can &lt;code&gt;modprobe&lt;/code&gt; it; even if it is loaded, a patched kernel won't escalate. So this check is a different thing from whether the vulnerability exists.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once you notice this, you want to know "what's really true for my environment" from &lt;strong&gt;behavior&lt;/strong&gt;, not command output. But running a root-escalation PoC on a production machine is a bad idea. That's where a disposable VM comes in.&lt;/p&gt;

&lt;h2&gt;
  
  
  Isolate the pre-patch kernel in a VM and run the real thing
&lt;/h2&gt;

&lt;p&gt;The plan is simple.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Don't touch the production machine (already patched).&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Stand up a disposable VM carrying the &lt;strong&gt;pre-patch&lt;/strong&gt; kernel.&lt;/li&gt;
&lt;li&gt;Bring in the &lt;strong&gt;official PoC&lt;/strong&gt; (primary source, not a homemade snippet) and run it there.&lt;/li&gt;
&lt;li&gt;When done, throw the whole VM away.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key point is "a VM, not a container." A kernel LPE like Copy Fail, on success, &lt;strong&gt;also punches through container isolation&lt;/strong&gt; (the kernel is shared, so of course). If you want isolation, it has to be a VM that separates the kernel itself, or it's meaningless.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stand up a disposable VM and apply the PoC
&lt;/h2&gt;

&lt;p&gt;I prepared a cloud-init &lt;code&gt;user-data&lt;/code&gt; that seeds an SSH key into a cloud image, and booted it directly with KVM. &lt;code&gt;hostfwd&lt;/code&gt; forwards host port 2222 to guest port 22, so I SSH to &lt;code&gt;localhost:2222&lt;/code&gt;.&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="c"&gt;# Boot a disposable VM carrying a pre-patch kernel (user-mode, SLIRP networking)&lt;/span&gt;
qemu-system-x86_64 &lt;span class="nt"&gt;-enable-kvm&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt; 2048 &lt;span class="nt"&gt;-smp&lt;/span&gt; 2 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-drive&lt;/span&gt; &lt;span class="nv"&gt;file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;sandbox.qcow2,format&lt;span class="o"&gt;=&lt;/span&gt;qcow2,if&lt;span class="o"&gt;=&lt;/span&gt;virtio &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-drive&lt;/span&gt; &lt;span class="nv"&gt;file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;seed.iso,format&lt;span class="o"&gt;=&lt;/span&gt;raw,if&lt;span class="o"&gt;=&lt;/span&gt;virtio &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-netdev&lt;/span&gt; user,id&lt;span class="o"&gt;=&lt;/span&gt;net0,hostfwd&lt;span class="o"&gt;=&lt;/span&gt;tcp::2222-:22 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-device&lt;/span&gt; virtio-net-pci,netdev&lt;span class="o"&gt;=&lt;/span&gt;net0 &lt;span class="nt"&gt;-nographic&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since it's disposable, turning off SSH host key verification makes it easier to handle (a setting you'd never use in production).&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="nv"&gt;SSHOPT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"-p 2222 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"&lt;/span&gt;
ssh &lt;span class="nv"&gt;$SSHOPT&lt;/span&gt; ubuntu@localhost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once logged into the guest, first confirm with &lt;code&gt;uname -r&lt;/code&gt; that it's the pre-patch kernel, then &lt;strong&gt;obtain the official PoC from the primary source&lt;/strong&gt; and run it. Using a PoC of clear provenance rather than copy-paste from around the web matters for being able to accurately describe what was actually reproduced.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why "so easy"?
&lt;/h2&gt;

&lt;p&gt;What unnerved me most when I ran it was its &lt;strong&gt;plainness&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The PoC body is a single &lt;strong&gt;732-byte Python&lt;/strong&gt; one-shot.&lt;/li&gt;
&lt;li&gt;The trick is &lt;strong&gt;AF_ALG (the kernel crypto API) + splice&lt;/strong&gt;, rewriting the &lt;strong&gt;page cache of &lt;code&gt;/usr/bin/su&lt;/code&gt; 4 bytes at a time&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Run as the non-root &lt;code&gt;ubuntu&lt;/code&gt; user, and &lt;strong&gt;instantly &lt;code&gt;uid=0(root)&lt;/code&gt;&lt;/strong&gt;. It escalates &lt;strong&gt;with no race, 100% deterministically.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you hear "LPE" you picture "a timing-sensitive race condition you retry a few times and rarely hit." This was different. If the conditions are met, it always goes through. Once you understand in your body that this happens "on my own machine" "if it's pre-patch," it clicks just how bad a trade it is to pin the kernel and stop updating.&lt;/p&gt;

&lt;p&gt;Another lesson: &lt;strong&gt;don't aim your fear in the wrong direction.&lt;/strong&gt; "A random &lt;code&gt;make install&lt;/code&gt; is dangerous" predates LPE, and &lt;code&gt;sudo make install&lt;/code&gt; doesn't even need an LPE — you're root from the start. What an LPE adds is the "damage spreads to the whole machine even from a non-root run" part; the premise that running untrusted code already puts your keys, tokens, and data at risk (root or not) doesn't change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Confirming the mitigation actually works
&lt;/h2&gt;

&lt;p&gt;After confirming escalation goes through, I tried the mitigation in the same VM: shutting down the attack path &lt;code&gt;algif_aead&lt;/code&gt; with &lt;code&gt;modprobe&lt;/code&gt;.&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="c"&gt;# Kill loading of the module used in the attack (works independently of the patch)&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'install algif_aead /bin/false'&lt;/span&gt; | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/modprobe.d/copyfail.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this in place, re-running the PoC no longer escalated. &lt;strong&gt;Applying the patch is the real fix,&lt;/strong&gt; but if circumstances keep you from bumping the kernel right away, this mitigation is a fallback that works independently.&lt;/p&gt;

&lt;p&gt;When verification is done, check that no VM process is left and clean up. Since it's disposable, you can throw away the disk image and all.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pgrep &lt;span class="nt"&gt;-af&lt;/span&gt; qemu-system   &lt;span class="c"&gt;# confirm no leftovers before cleanup&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Wrap-up
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Don't swallow the affected-range number or a "run this" check whole. The check that was going around &lt;strong&gt;wasn't a patch test — it just looks at whether the attack module is loaded.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;If you're worried, don't touch production; run the real PoC in a &lt;strong&gt;disposable VM with a pre-patch kernel&lt;/strong&gt; and confirm by behavior. Because it's a threat that punches through containers, isolation must be a &lt;strong&gt;VM, not a container.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Copy Fail is &lt;strong&gt;732 bytes, non-root → root&lt;/strong&gt;, deterministic with no race. I now understand in my body that an LPE is not a "happens if you're unlucky" thing.&lt;/li&gt;
&lt;li&gt;The real fix is the patch. If you can't bump right away, blocking &lt;code&gt;algif_aead&lt;/code&gt; is a mitigation that works independently (verified effective in the VM).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://copy.fail/" rel="noopener noreferrer"&gt;Copy Fail official site (primary source for CVE-2026-31431)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://security.archlinux.org/" rel="noopener noreferrer"&gt;Arch Linux Security Tracker (look up your package's fixed version, not the upstream number)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;This post was written with AI assistance and reviewed by the author.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>infosec</category>
      <category>linux</category>
      <category>security</category>
    </item>
    <item>
      <title>Integrating 6 psychology frameworks in supernemawashi — 1 framework = 1 file parallel agents</title>
      <dc:creator>kohei_wada</dc:creator>
      <pubDate>Sun, 01 Nov 2026 06:50:20 +0000</pubDate>
      <link>https://dev.to/kohei_wada/integrating-6-psychology-frameworks-in-supernemawashi-1-framework-1-file-x-parallel-agents-35ma</link>
      <guid>https://dev.to/kohei_wada/integrating-6-psychology-frameworks-in-supernemawashi-1-framework-1-file-x-parallel-agents-35ma</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/Kohei-Wada/supernemawashi" rel="noopener noreferrer"&gt;supernemawashi&lt;/a&gt;'s &lt;code&gt;nemawashi-analyze&lt;/code&gt; skill stopped holding the profile as a single monolithic file and moved to &lt;strong&gt;1 framework = 1 file × 1 parallel agent&lt;/strong&gt;. Six psychology frameworks (defense mechanisms / Thomas-Kilmann / Transactional Analysis / Core Motivators / Cognitive Biases / Attachment Style) are each analyzed independently by an agent running in parallel. Here's why, and how I implemented it.&lt;/p&gt;

&lt;p&gt;The first supernemawashi (v1.x) wrote the profile to a single markdown file (&lt;code&gt;profile.md&lt;/code&gt;). The psychological analysis was one section inside it. That causes problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"I want to add one new framework" means rewriting the structure inside the monolithic file&lt;/li&gt;
&lt;li&gt;Every re-run of analyze &lt;strong&gt;wipes and overwrites all the other frameworks' analyses too&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;The independent signals (facts) per framework get mixed, and you lose track of which judgment came from which evidence&lt;/li&gt;
&lt;li&gt;Even if you want to parallelize, you get write contention on the one file&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  1 framework = 1 file × 1 agent
&lt;/h2&gt;

&lt;p&gt;Decompose the profile per framework.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PROFILE_DIR/&amp;lt;person-name&amp;gt;/
├── profile.md                          ← slim index (Core Pattern + summary table only)
├── facts.jsonl                          ← facts (collect's output)
└── frameworks/
    ├── defense-mechanisms.md            ← per-framework classification + evidence + DO/DON'T
    ├── thomas-kilmann-tki.md
    ├── transactional-analysis-ta.md
    ├── core-motivators.md
    ├── cognitive-biases.md
    └── attachment-style.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each framework file is &lt;strong&gt;fully independent&lt;/strong&gt;. Updating one doesn't touch the other five.&lt;/p&gt;

&lt;h3&gt;
  
  
  Make the framework registry the single source of truth
&lt;/h3&gt;

&lt;p&gt;The frameworks' slug / display name / tier have &lt;strong&gt;one table&lt;/strong&gt; as the source of truth:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Slug&lt;/th&gt;
&lt;th&gt;Display name&lt;/th&gt;
&lt;th&gt;Tier&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;defense-mechanisms&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Defense Mechanisms&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;thomas-kilmann-tki&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Conflict Mode (TKI)&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;transactional-analysis-ta&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ego States (TA)&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;core-motivators&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Core Motivators&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cognitive-biases&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Cognitive Biases&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;attachment-style&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Attachment Style&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Tier 1 = analyzed by default; Tier 2 = analyzed only when signal density is sufficient (if thin, surfaced explicitly as a Data Gap). Steps to add a new framework:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add a row to the registry table&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;frameworks/&amp;lt;slug&amp;gt;.md&lt;/code&gt; following the contract&lt;/li&gt;
&lt;li&gt;Update the situation→framework priority mapping in &lt;code&gt;nemawashi-reply&lt;/code&gt; (if needed)&lt;/li&gt;
&lt;li&gt;Confirm the registry matches the actual files with &lt;code&gt;scripts/check-frameworks.sh&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Because a script detects drift between the registry and the real files, you can't break things by adding only one side.&lt;/p&gt;

&lt;h3&gt;
  
  
  Parallel agent dispatch
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;nemawashi-analyze&lt;/code&gt;'s flow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[1] Read the shared inputs (profile.md + facts.jsonl)
        ↓
[2] Dispatch one agent per framework in the registry, in parallel
    ┌─ agent: defense-mechanisms     ──┐
    ├─ agent: thomas-kilmann-tki     ──┤
    ├─ agent: transactional-analysis ──┤  run in parallel
    ├─ agent: core-motivators        ──┤
    ├─ agent: cognitive-biases       ──┤
    └─ agent: attachment-style       ──┘
        ↓ wait for all agents to finish
[3] Synthesis pass (synchronous)
    - Update profile.md's Framework Summary table
    - Re-derive the Core Pattern
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each agent only &lt;strong&gt;reads &lt;code&gt;facts.jsonl&lt;/code&gt; and writes its own framework's &lt;code&gt;frameworks/&amp;lt;slug&amp;gt;.md&lt;/code&gt;&lt;/strong&gt;. It shares no state with the other agents. The synthesis pass only aggregates results — it doesn't re-analyze.&lt;/p&gt;

&lt;h2&gt;
  
  
  What goes in a framework file
&lt;/h2&gt;

&lt;p&gt;Each &lt;code&gt;frameworks/&amp;lt;slug&amp;gt;.md&lt;/code&gt; follows the same contract:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---
framework: Defense Mechanisms
tier: 1
output_label: Defense Mechanisms
---

# Defense Mechanisms

## Purpose
(what this framework reveals)

## Classification Guidance
(how to extract signals from facts)

## Reference Table
(mechanism / definition / observable signals / DO / DON'T)

## Rule Generation
(classification → situation-indexed rules)

## Signal Tags
(the tag format embedded in the facts jsonl)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As an example, two rows from the defense-mechanisms file's reference table:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mechanism&lt;/th&gt;
&lt;th&gt;Observable Signals&lt;/th&gt;
&lt;th&gt;DO&lt;/th&gt;
&lt;th&gt;DON'T&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Rationalization&lt;/td&gt;
&lt;td&gt;long explanations on failure / "because..." chains&lt;/td&gt;
&lt;td&gt;validate the reason, then redirect to the future&lt;/td&gt;
&lt;td&gt;argue directly against the justification&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Passive Aggression&lt;/td&gt;
&lt;td&gt;"I'll do it" + no movement / strategic delay&lt;/td&gt;
&lt;td&gt;name the behavior neutrally&lt;/td&gt;
&lt;td&gt;call it "you're being passive-aggressive"&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The agent cross-references facts against this table to tag signals, decides the dominant mechanism, and generates situation-indexed rules.&lt;/p&gt;

&lt;h3&gt;
  
  
  Situation categories
&lt;/h3&gt;

&lt;p&gt;DO/DON'T rules are indexed by situation category. &lt;code&gt;nemawashi-reply&lt;/code&gt; looks at the category and situation and loads only the framework files it needs:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Situation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;When Requesting&lt;/td&gt;
&lt;td&gt;you're asking them for something&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;During Conflict&lt;/td&gt;
&lt;td&gt;disagreement / tension&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;When Reporting&lt;/td&gt;
&lt;td&gt;delivering good / bad news&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Routine Collaboration&lt;/td&gt;
&lt;td&gt;day-to-day interaction&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;At reply time it doesn't load every framework — it narrows to the 2-3 relevant to the situation. That also cuts the context-window cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gotchas
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Drift between the registry and the real files&lt;/strong&gt;: at first I synced by hand, and it always broke. I moved &lt;code&gt;check-frameworks.sh&lt;/code&gt; into pre-commit for automatic detection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Parallel-agent races&lt;/strong&gt;: if each agent writes the same &lt;code&gt;frameworks/&amp;lt;slug&amp;gt;.md&lt;/code&gt;, it obviously breaks. Strictly mapping 1 agent = 1 file avoids it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The temptation for agents to share state&lt;/strong&gt;: there are moments you want to "look at the other frameworks' results and adjust." Doing that regresses to the monolithic design, so it's banned — adjustment happens synchronously in the synthesis pass.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Tier 2 threshold&lt;/strong&gt;: attachment-style often has thin signal, so I made it Tier 2. The framework itself needs criteria to surface "I don't know" explicitly as a Data Gap.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Adding a new framework is 3 steps (table + file + reply mapping), touching none of the existing frameworks&lt;/li&gt;
&lt;li&gt;Re-running analyze doesn't break the other frameworks&lt;/li&gt;
&lt;li&gt;Parallel dispatch shrank wallclock to roughly one framework's worth with all 6 agents running at once&lt;/li&gt;
&lt;li&gt;Each framework file is independently readable, so you can view just the framework you want (&lt;code&gt;nemawashi-show &amp;lt;person&amp;gt; --framework=defense-mechanisms&lt;/code&gt;, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrap-up
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Drop the monolithic profile.md and decompose into 1 framework = 1 file × 1 agent&lt;/li&gt;
&lt;li&gt;Make the framework registry the single source of truth, and detect drift with a check script&lt;/li&gt;
&lt;li&gt;Parallel dispatch shortens wallclock; keep synthesis synchronous&lt;/li&gt;
&lt;li&gt;Situation-indexed framework loading keeps the context cost down at reply time&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/Kohei-Wada/supernemawashi" rel="noopener noreferrer"&gt;supernemawashi (GitHub)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kilmanndiagnostics.com/overview-thomas-kilmann-conflict-mode-instrument-tki/" rel="noopener noreferrer"&gt;Thomas-Kilmann Conflict Mode Instrument&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Transactional_analysis" rel="noopener noreferrer"&gt;Transactional Analysis (Eric Berne)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://selfdeterminationtheory.org/" rel="noopener noreferrer"&gt;Self-Determination Theory (Deci &amp;amp; Ryan)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Attachment_theory" rel="noopener noreferrer"&gt;Attachment Theory (Bowlby &amp;amp; Ainsworth)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;This post was written with AI assistance and reviewed by the author.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>architecture</category>
      <category>programming</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>I built a way for Claude Code to report progress through my home Alexa</title>
      <dc:creator>kohei_wada</dc:creator>
      <pubDate>Sun, 01 Nov 2026 06:02:46 +0000</pubDate>
      <link>https://dev.to/kohei_wada/i-built-a-way-for-claude-code-to-report-progress-through-my-home-alexa-4moi</link>
      <guid>https://dev.to/kohei_wada/i-built-a-way-for-claude-code-to-report-progress-through-my-home-alexa-4moi</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When I hand a long-running job to Claude Code, I can't tell what's happening unless I'm watching the screen. So I built a skill that has the Echo Dot beside me read out "I'm about to do this" and "done" in Japanese. It looks simple, but the implementation hits a string of small traps: the HA SSH add-on's sshd constraints, the Amazon-side &lt;code&gt;_speak&lt;/code&gt; APIs going silent, and &lt;code&gt;/tmp&lt;/code&gt; being a tmpfs that wipes the script. Here's the configuration I landed on after stepping on all of them.&lt;/p&gt;

&lt;p&gt;For what it's worth, this very post had its in-progress status ("writing the Japanese version," "verifying," "merging") read aloud from my study's Echo Dot by exactly this mechanism, while I was writing it.&lt;/p&gt;

&lt;p&gt;When I hand Claude Code a multi-step job (edit files → wait for CI → open a PR, etc.), I lose track of progress the moment I switch to something else. Having "about to do X" and "X is done" arrive through my ears, without going to look at the CLI, lets me do other things with peace of mind.&lt;/p&gt;

&lt;p&gt;There are several Echo Dots in the house, and HA can fire TTS. So this should have been "just call a script over &lt;code&gt;ssh homeassistant&lt;/code&gt; and make the Echo talk." In practice it snags about three times.&lt;/p&gt;

&lt;h2&gt;
  
  
  The configuration that finally worked
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Claude Code skill (alexa-report)
    ↓ ssh homeassistant
HA SSH add-on
    ↓ python3 /homeassistant/scripts/ha_speak.py
HA Core REST API (auth: JWT mint from .storage/auth)
    ↓ POST /api/services/notify/send_message
Alexa Devices integration
    ↓ notify.&amp;lt;device&amp;gt;_announce
Echo Dot speaks (chime + message)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three design decisions:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Decision&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Use &lt;code&gt;_announce&lt;/code&gt;, not &lt;code&gt;_speak&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;The &lt;code&gt;Alexa.Speak&lt;/code&gt; API is effectively deprecated on Amazon's side. It returns 200 OK but no sound.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mint a JWT, don't issue a new long-lived token&lt;/td&gt;
&lt;td&gt;You can mint a short-lived JWT with the &lt;code&gt;jwt_key&lt;/code&gt; in &lt;code&gt;.storage/auth&lt;/code&gt;, without growing extra tokens in the UI.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Keep the script under &lt;code&gt;/homeassistant/scripts/&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;/tmp&lt;/code&gt; is tmpfs. Restart HA and the script is gone.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Implementation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Register the SSH key in the Advanced SSH add-on Configuration
&lt;/h3&gt;

&lt;p&gt;Hand-appending to &lt;code&gt;~/.ssh/authorized_keys&lt;/code&gt; doesn't stick. The add-on regenerates authorized_keys from its Configuration at startup, so a manual edit is wiped on add-on restart.&lt;/p&gt;

&lt;p&gt;HA UI → Settings → Add-ons → Advanced SSH &amp;amp; Web Terminal → Configuration → add your public key to &lt;code&gt;authorized_keys:&lt;/code&gt; → Save → Restart.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The SSH alias and the no-SFTP trap
&lt;/h3&gt;

&lt;p&gt;Client &lt;code&gt;~/.ssh/config&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Host homeassistant
  HostName 192.168.1.10
  User wada
  IdentityFile ~/.ssh/id_rsa
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The HA SSH add-on's sshd has the &lt;strong&gt;SFTP subsystem disabled.&lt;/strong&gt; &lt;code&gt;scp&lt;/code&gt; on OpenSSH 9+ assumes SFTP, so it fails with &lt;code&gt;subsystem request failed on channel 0&lt;/code&gt;. Pipe it in with &lt;code&gt;ssh + cat&lt;/code&gt; instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh homeassistant &lt;span class="s1"&gt;'cat &amp;gt; /homeassistant/scripts/ha_speak.py'&lt;/span&gt; &amp;lt; /path/to/ha_speak.py
&lt;span class="c"&gt;# or the legacy SCP protocol&lt;/span&gt;
scp &lt;span class="nt"&gt;-O&lt;/span&gt; /path/to/ha_speak.py homeassistant:/homeassistant/scripts/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. The JWT-mint script
&lt;/h3&gt;

&lt;p&gt;Using the refresh_token's &lt;code&gt;jwt_key&lt;/code&gt; (a 128-char hex) in &lt;code&gt;.storage/auth&lt;/code&gt;, mint a short-lived JWT with HS256. PyJWT isn't installed in the SSH add-on, so build it by hand with the standard library:&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="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;base64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hmac&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hashlib&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;

&lt;span class="n"&gt;CLIENT_NAME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;claude-code&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;  &lt;span class="c1"&gt;# key to select the refresh_token in .storage/auth
&lt;/span&gt;&lt;span class="n"&gt;API&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://homeassistant.local.hass.io:8123&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/homeassistant/.storage/auth&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;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;tok&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;data&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;refresh_tokens&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;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;client_name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;CLIENT_NAME&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;time&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="n"&gt;b64&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;base64&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;urlsafe_b64encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;separators&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;,&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;:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;()).&lt;/span&gt;&lt;span class="nf"&gt;rstrip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;b&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&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;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;b64&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;alg&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;HS256&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;typ&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;JWT&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;b64&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;iss&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tok&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;iat&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;exp&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="n"&gt;sig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;base64&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;urlsafe_b64encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;hmac&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tok&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;jwt_key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sa"&gt;b&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hashlib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sha256&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;rstrip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;b&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&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;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sa"&gt;b&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sa"&gt;b&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;sig&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&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;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;API&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&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="nf"&gt;encode&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;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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Content-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;application/json&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;POST&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="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;urlopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argv&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;speak&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/api/services/notify/send_message&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;entity_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;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argv&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="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="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]}))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. The Claude Code skill itself
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh homeassistant &lt;span class="s1"&gt;'sudo python3 /homeassistant/scripts/ha_speak.py speak "writing the blog draft" notify.koheisannoecho_dot_max_announce'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you put a wrapper that calls this shell at each &lt;code&gt;Before&lt;/code&gt; / &lt;code&gt;After&lt;/code&gt; step inside the skill, Claude Code automatically speaks up on every long-running task.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. The Echo entity list
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Physical device&lt;/th&gt;
&lt;th&gt;entity&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Echo Dot Max (study)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;notify.koheisannoecho_dot_max_announce&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Echo Dot (living room)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;notify.echo_dot_announce&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Upstairs&lt;/td&gt;
&lt;td&gt;&lt;code&gt;notify.er_jie_announce&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;All rooms&lt;/td&gt;
&lt;td&gt;&lt;code&gt;notify.quan_bu_nobu_wu_announce&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A Japanese group name like "全部の部屋" (all rooms) gets pinyin-slugified on the HA side (&lt;code&gt;quan_bu_nobu_wu&lt;/code&gt;). Renaming the group changes the slug, so when adding a new one, the reliable move is to hit &lt;code&gt;GET /api/services&lt;/code&gt; for the notify domain and check.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gotchas
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The &lt;code&gt;Alexa.Speak&lt;/code&gt; API is silent&lt;/strong&gt;: calling &lt;code&gt;notify.&amp;lt;x&amp;gt;_speak&lt;/code&gt; returns 200 OK but makes no sound. You have to switch to &lt;code&gt;_announce&lt;/code&gt; (the downside is the chime, but there's no alternative right now).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;.storage/auth&lt;/code&gt; is root:0600&lt;/strong&gt;: &lt;code&gt;sudo python3&lt;/code&gt; is required.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;/tmp&lt;/code&gt; is tmpfs&lt;/strong&gt;: the script disappears on HA restart. Put it under &lt;code&gt;/homeassistant/scripts/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;network-online.target&lt;/code&gt; isn't re-evaluated on wake-from-suspend&lt;/strong&gt;: not directly about HA, but the trap where the DNS that TTS depends on falls over is common to systemd timers in general.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JWT lifetime is 5 minutes&lt;/strong&gt;: the premise is you mint one on every call. No need to extend it since it isn't reused.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The "I have no idea what it's doing" feeling on long Claude Code sessions is gone.&lt;/li&gt;
&lt;li&gt;I can check progress by sound alone while working on something else next to it.&lt;/li&gt;
&lt;li&gt;Since it's a skill, it works on a new project just by calling &lt;code&gt;Skill alexa-report&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;I realized the "read it aloud from the Echo Dot" interface generalizes beyond Claude Code, and started repurposing it for CI-completion notifications and long-running Bash command completions too.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrap-up
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The mechanism is just "ssh homeassistant → JWT mint → REST API → Alexa announce."&lt;/li&gt;
&lt;li&gt;Three traps: SFTP disabled, &lt;code&gt;Alexa.Speak&lt;/code&gt; silent, &lt;code&gt;/tmp&lt;/code&gt; volatile.&lt;/li&gt;
&lt;li&gt;Making it a skill lets you repurpose it outside Claude Code too.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developers.home-assistant.io/docs/api/rest/" rel="noopener noreferrer"&gt;Home Assistant REST API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.home-assistant.io/docs/auth_api/" rel="noopener noreferrer"&gt;Authentication API — Home Assistant Developer Docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.home-assistant.io/integrations/alexa_devices/" rel="noopener noreferrer"&gt;Alexa Devices integration&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;This post was written with AI assistance and reviewed by the author.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>automation</category>
      <category>claude</category>
      <category>iot</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
