<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet type="text/css" href="/css/xml.73aa13973955b7b23e9d811e0b886c246625fbeef58fa2647b6e913c7ab65718.css"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Blackfyre’s Blog</title>
    <link>https://blackfyre.ninja/blog/</link>
    <description>Notes on Go, architecture, infrastructure and tooling by Miklós Galicz.</description>
    <generator>Hugo</generator>
    <language>en-GB</language>
    <lastBuildDate>Thu, 12 Nov 2026 09:00:00 +0100</lastBuildDate>
    <atom:link href="https://blackfyre.ninja/blog/index.xml" rel="self" type="application/rss&#43;xml" />
    <item>
      <title>Driving Spooder from a TrimUI Smart Pro</title>
      <link>https://blackfyre.ninja/blog/driving-spooder-from-a-trimui-smart-pro/</link>
      <pubDate>Thu, 12 Nov 2026 09:00:00 +0100</pubDate>
      <guid>https://blackfyre.ninja/blog/driving-spooder-from-a-trimui-smart-pro/</guid>
      <description>How a TrimUI Smart Pro came to drive Spooder over WiFi: the transport, measuring the link, a splash screen that wouldn&#39;t quit and a Go pak.</description>
      <content:encoded>&lt;p&gt;On 28 October I took my daughter to the office with me and packed my TrimUI Smart Pro in case she got bored. She did, and by the time we went home she had drained its battery completely. On 5 November, going through my backpack, I found it still waiting for a charge, and Spooder, my hexapod, was waiting too: five of its six legs were built, and &lt;a href=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/&#34;&gt;the rest needed more M3×12 countersunk screws&lt;/a&gt; than I had in the house. I spent half the afternoon staring at the handheld before a what-if came. Spooder is driven by an 8BitDo gamepad through an ESP32 bridge with a 240×135 screen, and this handheld has two sticks and a 1280×720 screen. I wanted to know whether it could replace both.&lt;/p&gt;&#xA;&lt;p&gt;The robot side was mostly ready for a second controller. Spooder&amp;rsquo;s legs run on a Pimoroni Servo 2040, and the bridge, a LilyGO T-Display, talks to it over a serial line in the same framed protocol the robot also accepts on its USB port. The bridge sends the complete desired state every 20 ms, and the robot treats a command older than a second as stale, so a controller that falls silent puts the robot to sleep rather than leaving it walking. The bridge even had a precedent for a controller that isn&amp;rsquo;t a gamepad: its setup mode swaps Bluetooth for a WiFi access point, and a phone polling the setup page counts as connected until it stops.&lt;/p&gt;&#xA;&lt;h2 id=&#34;choosing-a-transport&#34;&gt;Choosing a transport&lt;/h2&gt;&#xA;&lt;p&gt;Three ways in were worth considering, and WiFi through the bridge was the only one that cut the cord without a fight with a Bluetooth stack.&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Option&lt;/th&gt;&lt;th&gt;Untethered&lt;/th&gt;&lt;th&gt;Firmware work&lt;/th&gt;&lt;th&gt;Main unknown&lt;/th&gt;&lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;WiFi via the bridge&lt;/td&gt;&lt;td&gt;yes&lt;/td&gt;&lt;td&gt;a new bridge mode, modelled on setup mode&lt;/td&gt;&lt;td&gt;WiFi latency and dropouts&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;USB tether to the robot&lt;/td&gt;&lt;td&gt;no&lt;/td&gt;&lt;td&gt;none&lt;/td&gt;&lt;td&gt;whether NextUI&amp;rsquo;s kernel can be a USB serial host&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Bluetooth LE to the bridge&lt;/td&gt;&lt;td&gt;yes&lt;/td&gt;&lt;td&gt;a custom GATT service inside Bluepad32&amp;rsquo;s BTstack&lt;/td&gt;&lt;td&gt;BlueZ on NextUI, customising BTstack&lt;/td&gt;&lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&lt;p&gt;A USB cable would suit a calibrator on the bench, but not a robot that walks away from you. Over WiFi the handheld replaces the gamepad, so the bridge doesn&amp;rsquo;t need Bluetooth at all in that mode, which keeps a rule it already follows: Bluetooth and WiFi never share the ESP32&amp;rsquo;s radio. The bridge runs an access point, relays the handheld&amp;rsquo;s UDP packets to the robot&amp;rsquo;s serial line and keeps its own 20 ms heartbeat to the robot. The bridge, not the handheld, decides whether a controller is connected, so a handheld that goes quiet always ends with the robot asleep.&lt;/p&gt;&#xA;&lt;p&gt;Both of the bridge&amp;rsquo;s buttons were taken, one for setup mode and paging, the other for the emergency stop. A latching switch between GPIO32 and ground now chooses between Bluetooth and WiFi at boot. An open contact means Bluetooth, so a broken wire or an unfitted switch falls back to the mode that already works. Flipping the switch while the bridge runs only shows &lt;code&gt;SWITCH MOVED: RESTART&lt;/code&gt; on its screen, because restarting by itself would drop the link mid-stride.&lt;/p&gt;&#xA;&lt;p&gt;The handheld&amp;rsquo;s screen also had room for more than the bridge&amp;rsquo;s had shown. The robot used to send its pose (each joint&amp;rsquo;s commanded angle, servo angle and pulse) and its diagnostics (speed budget, loop time, averaged current) only over USB, and the bridge saw telemetry alone: mode, gait, faults, voltage and current. All three at 10 Hz come to 1,870 bytes a second, about 16% of what the 115,200-baud link carries, so the robot now sends them all the time. Both frame types already existed in the protocol, so the robot and the bridge don&amp;rsquo;t have to be flashed as a pair.&lt;/p&gt;&#xA;&lt;h2 id=&#34;reading-nextuis-source&#34;&gt;Reading NextUI&amp;rsquo;s source&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/LoveRetro/NextUI&#34;&gt;NextUI&lt;/a&gt; makes room for third-party apps. A pak is a folder under &lt;code&gt;Tools/tg5040/&lt;/code&gt; with a &lt;code&gt;launch.sh&lt;/code&gt; and whatever that script starts, and while it runs, it has the screen and every button to itself. The Smart Pro&amp;rsquo;s platform code in &lt;code&gt;workspace/tg5040/&lt;/code&gt; answered most of my questions before I touched the device. Graphics go through SDL2 with GLES and no window system. That rules out Gio, the UI toolkit of Spooder&amp;rsquo;s desktop calibrator, so the calibrator couldn&amp;rsquo;t simply be cross-compiled for the handheld. Both sticks are SDL joystick axes from about −30,000 to +30,000, and L2 and R2 are analogue too.&lt;/p&gt;&#xA;&lt;p&gt;One detail suits a robot controller: NextUI&amp;rsquo;s own apps handle sleep themselves, so a standalone pak sees the power button as an ordinary button, and my app can tell the robot to sleep before the handheld does anything else. WiFi is plain &lt;code&gt;wpa_supplicant&lt;/code&gt; and &lt;code&gt;udhcpc&lt;/code&gt; on &lt;code&gt;wlan0&lt;/code&gt;, joined through NextUI&amp;rsquo;s settings menu.&lt;/p&gt;&#xA;&lt;h2 id=&#34;measuring-wifi-on-the-handheld&#34;&gt;Measuring WiFi on the handheld&lt;/h2&gt;&#xA;&lt;p&gt;Before writing an app, I wanted to know whether the WiFi was steady enough to steer with. The handheld runs Tina Linux on kernel 4.9.191 with glibc 2.33, and its WiFi chip is Allwinner&amp;rsquo;s XR829 on the &lt;code&gt;xradio_wlan&lt;/code&gt; driver, with power saving on by default.&lt;/p&gt;&#xA;&lt;p&gt;It took three attempts to get a number. The first run lost every ping because the handheld was still on my home WiFi. The remote terminal I ran the test from used that same WiFi, so the test had to run on the handheld on its own. The second run joined the bridge&amp;rsquo;s network but kept its home address, 192.168.0.84, so pings to the bridge at 192.168.4.1 had nowhere to go. The real app checks that it is on the bridge&amp;rsquo;s network after joining and renews its address once with &lt;code&gt;udhcpc&lt;/code&gt; if not. The third run measured the WiFi.&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Link&lt;/th&gt;&lt;th&gt;Power saving&lt;/th&gt;&lt;th&gt;Lost&lt;/th&gt;&lt;th&gt;Average&lt;/th&gt;&lt;th&gt;Worst&lt;/th&gt;&lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Home router&lt;/td&gt;&lt;td&gt;on&lt;/td&gt;&lt;td&gt;3 of 30&lt;/td&gt;&lt;td&gt;12.2 ms&lt;/td&gt;&lt;td&gt;107.6 ms&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Home router&lt;/td&gt;&lt;td&gt;off&lt;/td&gt;&lt;td&gt;3 of 30&lt;/td&gt;&lt;td&gt;3.9 ms&lt;/td&gt;&lt;td&gt;18.4 ms&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Bridge access point&lt;/td&gt;&lt;td&gt;off&lt;/td&gt;&lt;td&gt;0 of 1,000&lt;/td&gt;&lt;td&gt;5.1 ms&lt;/td&gt;&lt;td&gt;34.2 ms&lt;/td&gt;&lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&lt;p&gt;Turning power saving off cut the worst case on my home network by a factor of six, so the app turns it off while it runs and restores it on exit. The 10% loss belonged to the home network: talking straight to the ESP32, the handheld lost nothing. The app sends 50 commands a second, so the bridge&amp;rsquo;s 150 ms liveness timeout tolerates seven lost packets in a row. I measured at −34 dBm, at close range; range and walking are still to be tested.&lt;/p&gt;&#xA;&lt;h2 id=&#34;a-splash-screen-that-outlived-its-app&#34;&gt;A splash screen that outlived its app&lt;/h2&gt;&#xA;&lt;p&gt;The ping test became a tiny pak, started from NextUI&amp;rsquo;s Tools menu. The first version ran silently for 25 seconds, which felt like being left in the dark, so the second used &lt;code&gt;show2.elf&lt;/code&gt;, the splash tool NextUI ships in &lt;code&gt;.system&lt;/code&gt;. In daemon mode it reads text and progress lines from &lt;code&gt;/tmp/show2.fifo&lt;/code&gt;, so the pak could show each step, a progress bar and the result.&lt;/p&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/driving-spooder-from-a-trimui-smart-pro/ping-test_hu_45456a1f596ef2ec.webp&#34; alt=&#34;The TrimUI Smart Pro on a desk mat, its screen showing the NextUI logo, “Pinging: 990 replies after 20 s” and a nearly full progress bar&#34; width=&#34;1560&#34; height=&#34;720&#34;&gt;&lt;figcaption&gt;FIG. 1 · The test pak mid-run, its progress drawn by NextUI&amp;#39;s own splash tool.&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;The result was right, but &lt;code&gt;show2.elf&lt;/code&gt; outlived the pak and went on painting over NextUI&amp;rsquo;s menu: open the menu, and the test screen jumped straight back on top. The pak had stopped it with a plain &lt;code&gt;kill&lt;/code&gt;. NextUI&amp;rsquo;s own launcher uses &lt;code&gt;killall -9 show2.elf&lt;/code&gt;, and so does the pak now. The real app&amp;rsquo;s &lt;code&gt;launch.sh&lt;/code&gt; takes the same lesson further. It starts the app in a process group of its own and, on exit or when the pak is stopped, sends the whole group &lt;code&gt;TERM&lt;/code&gt;, follows it with &lt;code&gt;KILL&lt;/code&gt; after two seconds, and puts WiFi power saving back the way it found it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;go-and-gabagool&#34;&gt;Go and gabagool&lt;/h2&gt;&#xA;&lt;p&gt;Three paks already on my SD card turned out to be Go programs, which settled the language. In Go, the handheld can reuse the desktop calibrator&amp;rsquo;s protocol decoder, session logic and leg-view geometry, none of which depend on Gio. &lt;code&gt;go version -m&lt;/code&gt; on their binaries showed Go 1.26.9, &lt;a href=&#34;https://github.com/BrandonKowalski/gabagool&#34;&gt;gabagool&lt;/a&gt; v2 as the UI library and &lt;code&gt;veandco/go-sdl2&lt;/code&gt; v0.4.40.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/LoveRetro/nextui-pak-store&#34;&gt;Pak Store&lt;/a&gt; and &lt;a href=&#34;https://github.com/rommapp/grout&#34;&gt;Grout&lt;/a&gt; build in the same image, &lt;a href=&#34;https://github.com/BrandonKowalski/quasimodo&#34;&gt;quasimodo&lt;/a&gt;: 25 lines of Debian bullseye, gcc, the SDL2 development packages and Go. That makes it a native arm64 build inside an arm64 container, on an arm64 machine or under QEMU on x86, with no cross-compiler involved. Bullseye&amp;rsquo;s glibc 2.31 is older than the handheld&amp;rsquo;s 2.33, so the binaries run there and use the device&amp;rsquo;s own SDL2 2.26.5. Spooder pins every dependency, and quasimodo builds on &lt;code&gt;:latest&lt;/code&gt;, so Spooder has its own Containerfile of the same shape. It pins &lt;code&gt;debian:bullseye-slim&lt;/code&gt; by digest, takes the Debian packages from a dated snapshot and checks Go 1.27.1 against its SHA-256, and it builds under rootless Podman with QEMU. gabagool runs on desktop Linux too, so the app can be tested on a laptop against the virtual robot, the robot&amp;rsquo;s control code running on my computer.&lt;/p&gt;&#xA;&lt;p&gt;gabagool&amp;rsquo;s widgets are modal screens: lists, keyboards, messages. There is no dashboard widget, but &lt;code&gt;gabagool.GetWindow()&lt;/code&gt; hands out the SDL renderer, and the dashboard draws on it directly. Its power button needs a change. With &lt;code&gt;IsNextUI&lt;/code&gt; set, gabagool watches &lt;code&gt;/dev/input/event1&lt;/code&gt; itself: a short press runs NextUI&amp;rsquo;s suspend script and a long press runs &lt;code&gt;/sbin/poweroff&lt;/code&gt;, which freezes the handheld at once, even with the robot mid-stride. The bridge&amp;rsquo;s timeout would still put the robot to sleep, but the order I want is to send Sleep, see it confirmed, and only then suspend. The fix is small: a &lt;code&gt;PowerButtonHook&lt;/code&gt; option that, when set, is called in place of the suspend script or the power-off, so the app can request Sleep first. For now the app builds against gabagool v2.26.6 with that patch applied, and I mean to offer it upstream.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-dashboard&#34;&gt;The dashboard&lt;/h2&gt;&#xA;&lt;p&gt;The handheld now talks to the robot&amp;rsquo;s real controller board. Its dashboard shows what the robot reports, what the handheld requests and the state of the link, and the link panel counts telemetry, pose and diagnostics at 10 frames a second each. When I took the photo, the handheld had sent 179,791 commands without an error, about an hour&amp;rsquo;s worth at 50 a second, and the robot&amp;rsquo;s sequence numbers showed six of its frames lost on the way back.&lt;/p&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/driving-spooder-from-a-trimui-smart-pro/dashboard_hu_ce4d352fddb925aa.webp&#34; alt=&#34;The TrimUI Smart Pro showing the Spooder dashboard: the robot in Initialise with output off, a 0.05 V supply and 0.00 A current and an emergency-stop fault; Walk mode and the Hop gait requested; and a link panel counting 10 telemetry, pose and diagnostics frames a second&#34; width=&#34;1600&#34; height=&#34;705&#34;&gt;&lt;figcaption&gt;FIG. 2 · The dashboard talking to the real Servo 2040, with no legs attached yet.&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;The robot stays put. I requested Walk and the Hop gait, but it remains in Initialise on the Tri gait with an emergency-stop fault latched, because clearing a fault never starts it moving by itself, and with the robot half-built there is nothing to move anyway.&lt;/p&gt;&#xA;&lt;p&gt;The other states the screen handles come from the app&amp;rsquo;s screenshot test, which draws them from made-up readings so they can be checked without a robot. A latched fault lists its causes, and the button bar lights the hold that clears it. A link that goes quiet greys the robot&amp;rsquo;s panel and marks it stale. Leaving holds the app open with a banner until the robot confirms Sleep.&lt;/p&gt;&#xA;&#xA;&lt;figure&gt;&#xA;&lt;a href=&#34;https://blackfyre.ninja/blog/driving-spooder-from-a-trimui-smart-pro/screen-fault.png&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/driving-spooder-from-a-trimui-smart-pro/screen-fault_hu_50358503bd60da5d.webp&#34; alt=&#34;The Spooder dashboard in Sleep with output off, the emergency-stop and undervoltage faults latched, E-STOP ON in the header and the fault-clearing hold lit in the button bar&#34; width=&#34;480&#34; height=&#34;360&#34;&gt;&lt;/a&gt;&#xA;&lt;a href=&#34;https://blackfyre.ninja/blog/driving-spooder-from-a-trimui-smart-pro/screen-stale.png&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/driving-spooder-from-a-trimui-smart-pro/screen-stale_hu_854238f6de84dfeb.webp&#34; alt=&#34;The Spooder dashboard with the robot panel greyed and marked stale, LINK STALE in the header, the last frame 2.3 s old and the notice &amp;#34;send: network is unreachable&amp;#34;&#34; width=&#34;480&#34; height=&#34;360&#34;&gt;&lt;/a&gt;&#xA;&lt;a href=&#34;https://blackfyre.ninja/blog/driving-spooder-from-a-trimui-smart-pro/screen-leaving.png&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/driving-spooder-from-a-trimui-smart-pro/screen-leaving_hu_4134e63cefaa691.webp&#34; alt=&#34;The Spooder dashboard walking, with an orange banner across the bottom reading &amp;#34;Leaving (exit) · waiting for the robot to sleep&amp;#34;&#34; width=&#34;480&#34; height=&#34;360&#34;&gt;&lt;/a&gt;&#xA;&lt;figcaption&gt;FIG. 3 · The screen&amp;#39;s states as its screenshot test draws them, from made-up readings.&lt;/figcaption&gt;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;The robot&amp;rsquo;s controller board has since gained a bench simulation mode. A press of its USER button in the first three seconds after start-up enters it, as long as no servo supply is connected and a computer is on its USB port. The robot then runs its gait, kinematics and power protection as usual, but every servo call goes to a model, so no servo moves. Its telemetry carries a flag for it, and the handheld leads its header with a SIM chip.&lt;/p&gt;&#xA;&lt;p&gt;Select and X swap the panels for a driving view, drawn from the pose frames as the desktop calibrator draws its views. A chase camera fixed behind the robot looks forward and 45° down over a ground grid, and joints near or at their servo limits are ringed. With the board in simulation, the legs on the screen move as the robot&amp;rsquo;s own firmware moves them.&lt;/p&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/driving-spooder-from-a-trimui-smart-pro/driving-view_hu_f2f062d5825e02d4.webp&#34; alt=&#34;The TrimUI Smart Pro showing Spooder’s driving view: the robot seen from behind and above, six numbered legs mid-stride around a schematic body over a ground grid, a SIM chip in the header, and beside it Walk, the Ripple gait, output on (sim), a 6.00 V supply and no faults&#34; width=&#34;1600&#34; height=&#34;705&#34;&gt;&lt;figcaption&gt;FIG. 4 · The driving view, with the Servo 2040 in bench simulation.&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;Holding L2 past half travel opens a gesture overlay over either page. Its five tiles sit where the TrimUI&amp;rsquo;s buttons do: A, B, X and Y as a diamond, with R2 beside it. Say hi and wiggle loop an animation drawn from the joint angles in the robot&amp;rsquo;s own script. Dance, attack and ball have no script yet, so their tiles show a standing robot marked &lt;code&gt;NOT YET&lt;/code&gt;. A request lights its tile for a moment.&lt;/p&gt;&#xA;&#xA;&lt;figure&gt;&lt;a href=&#34;https://www.youtube.com/watch?v=IdqkirnXIao&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/driving-spooder-from-a-trimui-smart-pro/video_hu_78742a416035966e.webp&#34; alt=&#34;My video of the TrimUI Smart Pro driving Spooder&amp;#39;s Servo 2040 in bench simulation: the driving view and the gesture overlay&#34; width=&#34;1280&#34; height=&#34;720&#34;&gt;&lt;/a&gt;&lt;figcaption&gt;FIG. 5 · My video of the TrimUI Smart Pro driving Spooder&amp;#39;s Servo 2040 in bench simulation: the driving view and the gesture overlay (&lt;a href=&#34;https://www.youtube.com/watch?v=IdqkirnXIao&#34;&gt;watch on YouTube&lt;/a&gt;)&lt;/figcaption&gt;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;Until the screws arrive, those legs walk only in the model, and the WiFi test at range and while walking waits for them too.&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>Animated PNG in 2026: Standard at Last, and Still Heavy</title>
      <link>https://blackfyre.ninja/blog/animated-png-in-2026-standard-at-last-and-still-heavy/</link>
      <pubDate>Tue, 10 Nov 2026 09:00:00 +0100</pubDate>
      <guid>https://blackfyre.ninja/blog/animated-png-in-2026-standard-at-last-and-still-heavy/</guid>
      <description>Animating the site&#39;s sigil as an APNG, how it compares with GIF, WebP and AVIF, and the format&#39;s long road to a W3C standard.</description>
      <content:encoded>&lt;p&gt;I wanted the sigil on this site to move: a pulse climbing the circuit trunk from the roots to the canopy, with the faint grain at its edges intact. GIF drops that grain, because a GIF pixel is either fully see-through or not at all. AVIF keeps it, but an AVIF animation is really a video. Animated PNG kept every pixel exactly, and the file came out at 663 KB.&lt;/p&gt;&#xA;&lt;p&gt;Eighteen years after the PNG group rejected it, APNG became part of the W3C standard in June 2025, and every major browser already showed it. Discord and Signal both take APNG for animated stickers.&lt;/p&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/animated-png-in-2026-standard-at-last-and-still-heavy/sigil-pulse.png&#34; alt=&#34;The Blackfyre tree sigil in orange, with a pale band of light rising through its circuit trunk from the roots to the canopy&#34; width=&#34;320&#34; height=&#34;320&#34;&gt;&lt;figcaption&gt;FIG. 1 · The sigil as an animated PNG: 24 frames at 12 fps, looping every two seconds, 663 KB.&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;Each frame starts from the paper-coloured sigil this site already uses, filled with its orange. A pale band with soft top and bottom edges then slides up through the sigil&amp;rsquo;s transparency mask, so it lights only the parts of the tree it passes over. ImageMagick draws the 24 frames and ffmpeg packs them into one file. The first attempt failed with &amp;ldquo;APNG does not support multiple palettes&amp;rdquo;. ImageMagick had saved the frames with few colours as palette PNGs, each with its own palette, and an APNG&amp;rsquo;s frames have to share one. Writing every frame as full 32-bit colour fixed it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;magick base.png highlight.png -compose Over -composite png32:f07.png   # one of the 24 frames&#xA;ffmpeg -framerate 12 -i f%02d.png -pix_fmt rgba -pred mixed -plays 0 -f apng sigil-pulse.png&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;code&gt;-plays 0&lt;/code&gt; makes it loop forever, and &lt;code&gt;-pred mixed&lt;/code&gt; lets the encoder choose a PNG filter for each row. Here that saved 9 KB, about 1.4%.&lt;/p&gt;&#xA;&lt;p&gt;I sent the same 24 frames through every other image format a browser will animate. It opens on APNG against GIF, where the difference is plainest in the roots and the faint grain around the ring.&lt;/p&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/animated-png-in-2026-standard-at-last-and-still-heavy/sigil-pulse.png&#34; alt=&#34;The animated Blackfyre sigil (APNG)&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/animated-png-in-2026-standard-at-last-and-still-heavy/sigil-pulse.gif&#34; alt=&#34;The animated Blackfyre sigil (GIF)&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/animated-png-in-2026-standard-at-last-and-still-heavy/sigil-pulse-lossless.webp&#34; alt=&#34;The animated Blackfyre sigil (WebP lossless)&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/animated-png-in-2026-standard-at-last-and-still-heavy/sigil-pulse-lossy.webp&#34; alt=&#34;The animated Blackfyre sigil (WebP lossy)&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/animated-png-in-2026-standard-at-last-and-still-heavy/sigil-pulse.avif&#34; alt=&#34;The animated Blackfyre sigil (AVIF)&#34;&gt;&#xA;&lt;figcaption&gt;FIG. 2 · APNG, GIF, WebP lossless, WebP lossy, AVIF. The same 24 frames in five formats. Drag the divider, or pick any two. &lt;a href=&#34;https://blackfyre.ninja/blog/animated-png-in-2026-standard-at-last-and-still-heavy/&#34;&gt;Compare them side by side in the post&lt;/a&gt;&lt;/figcaption&gt;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;The sizes follow from what each format is allowed to throw away. APNG throws away nothing: every frame is compressed losslessly, as a still PNG is, and the encoder can only skip the parts of a frame that haven&amp;rsquo;t changed since the previous one. The band sweeps through half the sigil&amp;rsquo;s height in every frame, so there is little to skip, and each frame costs about 28 KB, two-thirds of the 43 KB a single still takes. Lossless WebP keeps the same exact pixels with a stronger compressor and comes out a third smaller. Lossy WebP and AVIF give up precision for size, and AVIF, which is built on the AV1 video codec, also predicts each frame from its neighbours. That is how it gets down to 57 KB, softening the grain only slightly.&lt;/p&gt;&#xA;&lt;h2 id=&#34;twenty-one-years-to-a-standard&#34;&gt;Twenty-one years to a standard&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/APNG&#34;&gt;APNG&lt;/a&gt; began at Mozilla. In 2003 Mozilla dropped MNG, the PNG group&amp;rsquo;s own animation format, because its decoder library added 300 KB to the browser. In 2004 Stuart Parmenter and Vladimir Vukićević wrote APNG as a lighter replacement, aimed at small interface animations such as the throbber that spins while a page loads. Their trick was to keep the first frame as ordinary PNG image data and put the animation in three extra chunks (&lt;code&gt;acTL&lt;/code&gt;, &lt;code&gt;fcTL&lt;/code&gt; and &lt;code&gt;fdAT&lt;/code&gt;). A decoder that has never heard of APNG skips chunks it doesn&amp;rsquo;t know, so it shows the first frame as a still image. The cost of that trick is that nothing outside the file says it moves: an APNG is a &lt;code&gt;.png&lt;/code&gt; like any other.&lt;/p&gt;&#xA;&lt;p&gt;Firefox 3 shipped it in 2008, after its trunk builds had carried it since March 2007. A month after those trunk builds, in April 2007, the PNG Development Group voted not to make APNG an official extension, and for years it stayed a Mozilla format that Opera also happened to support. Apple added it in Safari 8 in 2014 and made it the preferred format for animated iMessage stickers in iOS 10. Chrome followed in version 59 in 2017, and Edge in 2020, when it moved to Chromium. Internet Explorer never did.&lt;/p&gt;&#xA;&lt;p&gt;The W3C chartered a PNG Working Group in 2021, put APNG into the first public draft of the PNG Third Edition in October 2022, and published that edition as a &lt;a href=&#34;https://www.w3.org/TR/png-3/&#34;&gt;W3C Recommendation&lt;/a&gt; on 24 June 2025, with &lt;code&gt;image/apng&lt;/code&gt; registered as its media type. The same edition also brought HDR support to PNG.&lt;/p&gt;&#xA;&lt;p&gt;libpng, the reference PNG library, has been slower still. It ignored APNG for as long as the PNG group did, so Linux distributions spent years carrying an outside patch that added it, because Firefox needed it. Three days after the Recommendation, on 27 June 2025, &lt;a href=&#34;https://github.com/pnggroup/libpng/pull/706&#34;&gt;APNG support was merged&lt;/a&gt; into libpng&amp;rsquo;s development branch, which is now the 2.0 line. The current stable release, 1.6.59 from September 2026, still treats the animation chunks as unknown data. A program that reads PNGs through a released libpng sees only the first frame, unless it parses the animation chunks itself.&lt;/p&gt;&#xA;&lt;h2 id=&#34;where-it-fits&#34;&gt;Where it fits&lt;/h2&gt;&#xA;&lt;p&gt;Outside the browser, the places you&amp;rsquo;re most likely to meet APNG are sticker packs. Discord takes it for &lt;a href=&#34;https://support.discord.com/hc/articles/4402687377815&#34;&gt;server stickers&lt;/a&gt; of up to 512 KB, Signal for stickers of up to 300 KB and three seconds, and Apple&amp;rsquo;s iMessage has preferred it since iOS 10. Making one is easy enough: ffmpeg and ImageMagick both write it. Editing one is harder: GIMP can open it but not save it, and LibreOffice shows only the first frame.&lt;/p&gt;&#xA;&lt;p&gt;On a web page, it earns its bytes when the pixels have to come through exactly and the edges are soft, as with the sigil, or when the place you&amp;rsquo;re posting it asks for APNG. Everywhere else, AVIF or lossy WebP will show nearly the same animation for a fraction of the size, and every current browser plays both.&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>Spooder Gets Its Legs</title>
      <link>https://blackfyre.ninja/blog/spooder-gets-its-legs/</link>
      <pubDate>Thu, 05 Nov 2026 09:00:00 +0100</pubDate>
      <guid>https://blackfyre.ninja/blog/spooder-gets-its-legs/</guid>
      <description>My birthday present was a day to build Spooder, my hexapod: a stray screw inside a servo, horns fitted off-centre and a stop for want of screws.</description>
      <content:encoded>&lt;p&gt;For my birthday this year, my family gave me a day: all of 27 October, to build Spooder, the hexapod from &lt;a href=&#34;https://blackfyre.ninja/blog/upping-the-ante-for-next-year-s-career-day/&#34;&gt;Upping the Ante for Next Year&amp;rsquo;s Career Day&lt;/a&gt;. Its frame had stood half-built since February 2024. By the evening five of its six legs were built and a second one was on the frame, and the day ended there only because I ran out of M3×12 countersunk screws.&lt;/p&gt;&#xA;&lt;p&gt;The strangest find of the day was inside a servo. One of the MG996Rs bulged slightly where it pushes into its printed part, and I blamed the print: I reprinted that part a couple of times before I looked at the servo itself. A loose screw had got into its casing when it was put together at the factory, and quality control hadn&amp;rsquo;t caught it. I got it out, and the servo is fine after the operation. How it kept working with a screw loose among its internals without shorting anything, I still don&amp;rsquo;t know.&lt;/p&gt;&#xA;&lt;h2 id=&#34;without-a-manual&#34;&gt;Without a manual&lt;/h2&gt;&#xA;&lt;p&gt;Spooder has no assembly manual. It&amp;rsquo;s my iteration over &lt;a href=&#34;https://github.com/Ryan-Mirch/Aecerts_Hexapod_V1&#34;&gt;Aecert&amp;rsquo;s Hexapod V1&lt;/a&gt;, and what I went on was my memory of building the first leg in 2024, a design thought out well enough to show me most of the way and, after a while, repetition. The order of operations I learned by getting it wrong. Every joint is a servo turning a metal horn, the arm screwed onto its output shaft, and the horn has to go on while the servo is centred, in the middle of its travel, or the joint starts from the wrong angle. Usually I forgot to centre it first, and the horn had to come off again.&lt;/p&gt;&#xA;&#xA;&lt;figure&gt;&#xA;&lt;a href=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/assembly-01.jpg&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/assembly-01_hu_3938c03cb338016c.webp&#34; alt=&#34;Black and red 3D-printed parts in a heap on a dining table, with bags of screws and inserts, servo cables, a screwdriver set and a plate of apple slices&#34; width=&#34;480&#34; height=&#34;360&#34;&gt;&lt;/a&gt;&#xA;&lt;a href=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/assembly-02.jpg&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/assembly-02_hu_e28669aee42aef8a.webp&#34; alt=&#34;The dining table turned workshop: a soldering station on a power-tool battery, a clamp meter, a hammer on a rubber block, screw organisers, servos and a half-built leg&#34; width=&#34;480&#34; height=&#34;360&#34;&gt;&lt;/a&gt;&#xA;&lt;a href=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/assembly-03.jpg&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/assembly-03_hu_6562e03e1bf4e2a5.webp&#34; alt=&#34;The same table from the other end, with the frame and one leg, five upper leg sections with bearings, and the soldering station&#34; width=&#34;480&#34; height=&#34;360&#34;&gt;&lt;/a&gt;&#xA;&lt;a href=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/assembly-04.jpg&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/assembly-04_hu_978363d6fd1f410b.webp&#34; alt=&#34;Spooder&amp;#39;s black frame held in one hand, one complete leg fitted and servo cables hanging from every corner&#34; width=&#34;480&#34; height=&#34;360&#34;&gt;&lt;/a&gt;&#xA;&lt;a href=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/assembly-05.jpg&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/assembly-05_hu_212f940d6b784dcd.webp&#34; alt=&#34;The frame with its leg, a second leg built beside it, and four lower leg sections with bearings in front&#34; width=&#34;480&#34; height=&#34;360&#34;&gt;&lt;/a&gt;&#xA;&lt;a href=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/assembly-06.jpg&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/assembly-06_hu_edbe53bcb076b762.webp&#34; alt=&#34;A low view of the small grey career-day quadruped in front of Spooder&amp;#39;s frame and one of its legs&#34; width=&#34;480&#34; height=&#34;360&#34;&gt;&lt;/a&gt;&#xA;&lt;a href=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/assembly-07.jpg&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/assembly-07_hu_4d01b3eca4d73c52.webp&#34; alt=&#34;In the evening, the frame with one leg, and the other five legs laid out on placemats at different stages&#34; width=&#34;480&#34; height=&#34;360&#34;&gt;&lt;/a&gt;&#xA;&lt;a href=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/assembly-08.jpg&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/assembly-08_hu_efacda005a64ad4.webp&#34; alt=&#34;The same layout later, with five legs assembled and one still in parts&#34; width=&#34;480&#34; height=&#34;360&#34;&gt;&lt;/a&gt;&#xA;&lt;a href=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/assembly-09.jpg&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/spooder-gets-its-legs/assembly-09_hu_2903fdc7d79559f9.webp&#34; alt=&#34;The frame with two legs on opposite sides, stretched out flat along the dining table&#34; width=&#34;480&#34; height=&#34;360&#34;&gt;&lt;/a&gt;&#xA;&lt;figcaption&gt;FIG. 1 · 27 October, from a heap of parts to two legs on the frame.&lt;/figcaption&gt;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;The day stopped on a bag of screws: Spooder takes more M3×12 countersunk screws than I had in the house, so the remaining legs wait for the delivery, and so does finding out what the virtual robot didn&amp;rsquo;t catch. The screw in the servo was a start.&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>Upping the Ante for Next Year&#39;s Career Day</title>
      <link>https://blackfyre.ninja/blog/upping-the-ante-for-next-year-s-career-day/</link>
      <pubDate>Tue, 03 Nov 2026 09:00:00 +0100</pubDate>
      <guid>https://blackfyre.ninja/blog/upping-the-ante-for-next-year-s-career-day/</guid>
      <description>A school career day sent me back to Spooder, the hexapod I parked in 2024, and one weekend with AI agents produced the firmware it had been waiting for.</description>
      <content:encoded>&lt;p&gt;On 8 October I was at my daughter&amp;rsquo;s primary school for career day, with a robot that fits in my palm, a kit my daughter and I built together in 2024: four 3D-printed legs, eight of the cheapest servos known to man and an ESP8266 to drive them. The children loved it. It also left me with a problem, because next year I&amp;rsquo;ll have to bring something better, and the something better has been sitting half-built since February 2024.&lt;/p&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/upping-the-ante-for-next-year-s-career-day/career-day-quadruped_hu_ce4cd13dd2859add.webp&#34; alt=&#34;A small grey 3D-printed four-legged robot held in an open hand, with eight blue SG90 micro servos, a small LiPo battery and two capacitors on its body&#34; width=&#34;1518&#34; height=&#34;2047&#34;&gt;&lt;figcaption&gt;FIG. 1 · The career day robot: four legs, eight SG90 servos and a 400 mAh battery&lt;/figcaption&gt;&lt;/figure&gt;&lt;h2 id=&#34;the-robot-on-the-shelf&#34;&gt;The robot on the shelf&lt;/h2&gt;&#xA;&lt;p&gt;Spooder is a hexapod: six legs, three servos each, eighteen in all. It&amp;rsquo;s a shameless iteration over &lt;a href=&#34;https://github.com/Ryan-Mirch/Aecerts_Hexapod_V1&#34;&gt;Aecert&amp;rsquo;s Hexapod V1&lt;/a&gt;, whose mechanical design and movement code (the inverse kinematics, the Bézier foot paths and the gait table) it reuses with the author&amp;rsquo;s permission. I printed the frame and started assembling it in February 2024, on an Arduino Nano RP2040 Connect with two PCA9685 boards to drive the servos, and within a week I had a moving leg. Then it stopped. The two servo boards shared one I²C bus that didn&amp;rsquo;t have the bandwidth for eighteen servos, each needed its oscillator calibrated by hand, and the Bluetooth library I used for the gamepad has since dropped support for the Nano&amp;rsquo;s radio. The frame stayed half-built because the firmware never caught up.&lt;/p&gt;&#xA;&lt;h2 id=&#34;a-weekend-with-the-firmware&#34;&gt;A weekend with the firmware&lt;/h2&gt;&#xA;&lt;p&gt;On Friday 16 October I set up the toolchain and OpenSpec in &lt;a href=&#34;https://github.com/blackfyre/spooder&#34;&gt;the old repository&lt;/a&gt;, and by Sunday afternoon it held 101 new commits. The robot now runs on a Pimoroni Servo 2040, which drives all eighteen servos straight from the RP2040&amp;rsquo;s crystal-timed PIO, with no bus in between, and measures its own servo current and voltage. That made room for power protection: overcurrent, sustained overload, brown-out, low and high voltage and an emergency stop each latch a fault and cut the servos at once, and clearing a fault never sets the robot moving again by itself. A LilyGO T-Display with an ESP32 pairs a Bluetooth gamepad and talks to the robot over a serial link, and a desktop calibrator written in Go drives and calibrates it over USB. None of it moved a real leg that weekend. Everything ran against a virtual robot: the robot&amp;rsquo;s own control loop compiled for my computer behind a fake USB port, which the calibrator and the end-to-end tests talk to as if it were the board.&lt;/p&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/upping-the-ante-for-next-year-s-career-day/calibrator-calibrate_hu_a3738c0070358d36.webp&#34; alt=&#34;The Spooder desktop calibrator in a dark theme, in Calibrate mode: a grid of joint cards with offset and pulse controls on the left, and on the right a side view of leg 1 and a top view of all six legs&#34; width=&#34;1360&#34; height=&#34;900&#34;&gt;&lt;figcaption&gt;FIG. 2 · The calibrator against the virtual robot in Calibrate: every joint&amp;#39;s offset and pulses, and leg 1&amp;#39;s live pose&lt;/figcaption&gt;&lt;/figure&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/upping-the-ante-for-next-year-s-career-day/calibrator-estop_hu_fb6593a1d9ba51f7.webp&#34; alt=&#34;The same calibrator with an orange emergency stop banner across the top, faults showing emergency stop and output off, and the legs pane on leg 3&#34; width=&#34;1360&#34; height=&#34;900&#34;&gt;&lt;figcaption&gt;FIG. 3 · An emergency stop from the app: the fault latches and output stays off until it&amp;#39;s cleared&lt;/figcaption&gt;&lt;/figure&gt;&#xA;&lt;p&gt;FIG. 4 · Interactive diagram: &lt;a href=&#34;https://blackfyre.ninja/embeds/spooder-system.html&#34;&gt;Spooder&amp;#39;s architecture: the robot, the gamepad bridge, the desktop tools and the virtual robot. Click a node, or press ? for the guide.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I built it the way I described in &lt;a href=&#34;https://blackfyre.ninja/blog/how-i-work-with-ai-agents/&#34;&gt;How I Work with AI Agents&lt;/a&gt;, with each change planned in OpenSpec, implemented by an agent and reviewed by Codex on my machine. I could have written all of it myself, but it would have taken far more time than two days of inattentiveness, which is about what that weekend gave it. That changed what I let myself build: a calibrator and a virtual robot are the kind of tooling that waits until the main thing works, and here they arrived first.&lt;/p&gt;&#xA;&lt;p&gt;For anyone who wants to read the firmware: everything that makes a decision lives in &lt;a href=&#34;https://github.com/blackfyre/spooder/tree/6c29a106ce9dfc3dda33a504fcb765581baab739/core&#34;&gt;&lt;code&gt;core/&lt;/code&gt;&lt;/a&gt;, which is plain C++ with no SDK, no hidden globals and time passed in as an argument. The board code only moves bytes between the hardware and the core, so &lt;a href=&#34;https://github.com/blackfyre/spooder/blob/6c29a106ce9dfc3dda33a504fcb765581baab739/core/robot/robot_tick.cpp&#34;&gt;the robot&amp;rsquo;s 20 ms tick&lt;/a&gt; runs unchanged on my computer, and that is what &lt;a href=&#34;https://github.com/blackfyre/spooder/tree/6c29a106ce9dfc3dda33a504fcb765581baab739/tools/virtual-robot&#34;&gt;the virtual robot&lt;/a&gt; is. Each tick reads its input and checks the power before anything else, so an emergency stop lands within 20 ms. Protection can cut the servos but never moves the robot, and after a fault nothing moves until someone asks for a mode again. Every byte from the outside, whether a gamepad report, a USB frame or a request from the phone portal, is validated in the core and rejected or visibly clamped, never quietly fixed. Safety limits are a header the build refuses to go without. These rules live in the repository &lt;a href=&#34;https://github.com/blackfyre/spooder/blob/6c29a106ce9dfc3dda33a504fcb765581baab739/.claude/skills/spooder-firmware-shape/SKILL.md&#34;&gt;as instructions the agents follow&lt;/a&gt;, so every change is held to them.&lt;/p&gt;&#xA;&lt;h2 id=&#34;next-the-legs&#34;&gt;Next: the legs&lt;/h2&gt;&#xA;&lt;p&gt;Since that weekend all eighteen MG996R servos have come to life on the Servo 2040. Five of them wouldn&amp;rsquo;t move at first, but they were only lightly seized, and regreasing their gears got them singing with the rest. The bridge now reads the real robot&amp;rsquo;s telemetry over the serial link and shows it on pages in the same look as this site, which its left button cycles through: driving, the last minute of supply voltage and current, and the link. An emergency stop, a fault or a lost link is spelled out on every page. The firmware kept growing as well: Spooder can say hi or wiggle when I press a button on the gamepad, and it slows its own movement wherever a joint would have to turn faster than an MG996R manages under load.&lt;/p&gt;&#xA;&#xA;&lt;figure&gt;&lt;a href=&#34;https://www.youtube.com/watch?v=ui1anXekcac&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/upping-the-ante-for-next-year-s-career-day/servos-video_hu_deacd0aa10c56a6c.webp&#34; alt=&#34;My video of Spooder&amp;#39;s eighteen servos running on the bench, with the calibrator on the screen behind them&#34; width=&#34;1280&#34; height=&#34;720&#34;&gt;&lt;/a&gt;&lt;figcaption&gt;FIG. 5 · My video of Spooder&amp;#39;s eighteen servos running on the bench, with the calibrator on the screen behind them (&lt;a href=&#34;https://www.youtube.com/watch?v=ui1anXekcac&#34;&gt;watch on YouTube&lt;/a&gt;)&lt;/figcaption&gt;&lt;/figure&gt;&#xA;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/upping-the-ante-for-next-year-s-career-day/bridge-pages_hu_92b30982bcf5cbf4.webp&#34; alt=&#34;Four pages of the bridge screen: driving at 6.08 V and 1.84 A with ticks holding the recent peak and low, the last minute of voltage and current as traces, the link rates with the bridge as the source, and the drive page after a brown-out with LOW V and BROWN-OUT in an orange strip&#34; width=&#34;1472&#34; height=&#34;842&#34;&gt;&lt;figcaption&gt;FIG. 6 · The bridge&amp;#39;s screen pages, rendered on the computer from the bridge&amp;#39;s own drawing code: drive, power, link, and the drive page after a brown-out&lt;/figcaption&gt;&lt;/figure&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/upping-the-ante-for-next-year-s-career-day/first-leg_hu_bf1d133e5f9515d.webp&#34; alt=&#34;The black 3D-printed hexapod frame with red parts, one leg fitted with its servos and cables and the other leg mounts still empty, next to an 8BitDo gamepad on a clear plastic box lid&#34; width=&#34;1040&#34; height=&#34;1400&#34;&gt;&lt;figcaption&gt;FIG. 7 · The first leg on the frame, beside the gamepad that will drive it&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;The electronics needed a home on top of the frame, so on Saturday 24 October an agent designed one in code. &lt;a href=&#34;https://github.com/blackfyre/spooder/tree/4424940d44e80f23d3de0e61db35156af76ce2d7/hardware/spooder-electronics-mount&#34;&gt;A Python script&lt;/a&gt; builds the parts with build123d from named measurements: a deck screwed to the frame&amp;rsquo;s inserts, a black cover with yellow inlays on its lid, and four yellow corner guards, printed hollow so they give in a knock or a rollover. Before it writes a single print file it checks them: nothing reaches into the legs&amp;rsquo; sweep, every part prints in PETG without supports, every screw can be reached with a screwdriver, and the air has a clear path from the vents low on one side to the fan position high on the other. The cover lifts off after three screws with nothing to unplug, because calibrating and flashing happen with it open. The sizes are nominal until I measure the bought parts with calipers, so none of it has been printed yet.&lt;/p&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/upping-the-ante-for-next-year-s-career-day/mount-closed_hu_70ac2b8cb86bbdee.webp&#34; alt=&#34;A render of the electronics mount on the hexapod’s frame top: a faceted black case with SPOODER and yellow chevrons on its lid, a yellow guard on each corner and a window in the lid&#34; width=&#34;1600&#34; height=&#34;900&#34;&gt;&lt;figcaption&gt;FIG. 8 · The mount closed on the frame top: the black cover with its inlays and the four corner guards&lt;/figcaption&gt;&lt;/figure&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/upping-the-ante-for-next-year-s-career-day/mount-open_hu_cf7ca99bea5a02bf.webp&#34; alt=&#34;A render of the mount with its cover off: the boards and converters as blocks on the deck, with the cover’s three posts standing between them&#34; width=&#34;1600&#34; height=&#34;900&#34;&gt;&lt;figcaption&gt;FIG. 9 · Cover off, the way it will run while I calibrate and flash it&lt;/figcaption&gt;&lt;/figure&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/upping-the-ante-for-next-year-s-career-day/mount-exploded_hu_4d0f6d93acb7ed8d.webp&#34; alt=&#34;An exploded render: the four corner guards lifted above the cover, the cover above the deck and its electronics, and the frame top below&#34; width=&#34;1600&#34; height=&#34;900&#34;&gt;&lt;figcaption&gt;FIG. 10 · Exploded: the corner guards snap onto the cover with detents, without screws&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;What&amp;rsquo;s left is printing and assembly. The first leg is on the frame, and the other legs, the mount, the Servo 2040 and the bridge still have to go in before I find out what the virtual robot didn&amp;rsquo;t catch.&lt;/p&gt;&#xA;&lt;h2 id=&#34;try-it-without-a-robot&#34;&gt;Try it without a robot&lt;/h2&gt;&#xA;&lt;p&gt;You don&amp;rsquo;t need the hardware to poke at Spooder. On Linux, with &lt;a href=&#34;https://mise.jdx.dev&#34;&gt;mise&lt;/a&gt; installed, clone &lt;a href=&#34;https://github.com/blackfyre/spooder&#34;&gt;the repository&lt;/a&gt;, run &lt;code&gt;mise install&lt;/code&gt; and &lt;code&gt;mise run setup&lt;/code&gt;, then &lt;code&gt;mise run desktop-sim&lt;/code&gt;. That builds the virtual robot and the calibrator, runs the robot in your terminal and opens the calibrator on its port. Click Connect, then Calibrate, and you&amp;rsquo;re where the calibrator screenshots above were taken. The terminal takes commands that break things on purpose: &lt;code&gt;supply 7.5&lt;/code&gt; sets the supply voltage, &lt;code&gt;estop on&lt;/code&gt; presses the emergency stop, &lt;code&gt;load 5&lt;/code&gt; loads the servos and &lt;code&gt;unplug&lt;/code&gt; pulls the cable. &lt;a href=&#34;https://github.com/blackfyre/spooder/blob/6c29a106ce9dfc3dda33a504fcb765581baab739/Readme.md#try-it-without-hardware&#34;&gt;The readme&lt;/a&gt; lists the packages the calibrator needs.&lt;/p&gt;&#xA;&lt;p&gt;I have until next year&amp;rsquo;s career day. When Spooder walks, I&amp;rsquo;ll write about that too.&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>My Global CLAUDE.md</title>
      <link>https://blackfyre.ninja/blog/my-global-claude-md/</link>
      <pubDate>Thu, 29 Oct 2026 09:00:00 +0100</pubDate>
      <guid>https://blackfyre.ninja/blog/my-global-claude-md/</guid>
      <description>The instructions every Claude Code session of mine starts with: a glossary, hard rules and defaults, and when the agent acts alone or asks.</description>
      <content:encoded>&lt;p&gt;Claude Code reads &lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt; at the start of every session, in every repository, alongside the project&amp;rsquo;s own instructions. Mine is below, nearly in full. It holds the rules I mentioned in &lt;a href=&#34;https://blackfyre.ninja/blog/how-i-work-with-ai-agents/&#34;&gt;How I Work with AI Agents&lt;/a&gt;: don&amp;rsquo;t silently expand the task, keep each commit to one coherent change, and stop and ask when the work needs a decision outside the task.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-its-put-together&#34;&gt;How it&amp;rsquo;s put together&lt;/h2&gt;&#xA;&lt;p&gt;The file opens with a glossary, because most of the rules depend on a handful of words meaning exactly one thing. An &amp;ldquo;assigned task&amp;rdquo; is work I give with an imperative such as &amp;ldquo;implement this&amp;rdquo;, and a &amp;ldquo;discussion&amp;rdquo; is any exchange where I&amp;rsquo;m still proposing or thinking out loud. The difference decides what the agent may do: in a discussion it assesses the idea and creates nothing, and in an assigned task it owns the work end to end without asking me to confirm routine decisions. Straight after the glossary, &amp;ldquo;Rule strength&amp;rdquo; makes every imperative a hard rule, while &amp;ldquo;Prefer&amp;rdquo; and &amp;ldquo;Avoid&amp;rdquo; only set a default that the agent may leave for a concrete reason it has to state.&lt;/p&gt;&#xA;&lt;p&gt;The rest follows a task from start to finish. Before its first edit the agent defines an execution contract (goal, scope, blast radius, reach, gates and exit conditions) and doesn&amp;rsquo;t write it to a file unless the project&amp;rsquo;s workflow asks for one. Commits, pushes, deploys and anything destructive need my authorisation, and &amp;ldquo;surface&amp;rdquo; has a fixed meaning: pause, state the issue and the decision required, and wait. Three code words, Stop, Revert and Recap, override the agent&amp;rsquo;s autonomy at any point. The sections on disagreement, delegation and review cover how the agent handles pushback, when it may hand a question to another model, and which changes get an independent reviewer.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-published-copy-and-two-recommendations&#34;&gt;The published copy and two recommendations&lt;/h2&gt;&#xA;&lt;p&gt;The copy below is generated from mine by a script. It removes a few sections specific to my employer&amp;rsquo;s internal tooling, together with the references to them elsewhere in the file, and the import of a command-output tool&amp;rsquo;s instructions that I no longer need.&lt;/p&gt;&#xA;&lt;p&gt;Two sections name tools, and I recommend both. I recommend &lt;a href=&#34;https://openspec.dev/&#34;&gt;OpenSpec&lt;/a&gt; strongly: it keeps a project&amp;rsquo;s intended behaviour as Markdown specifications in the repository, and I described how I use it in &lt;a href=&#34;https://blackfyre.ninja/blog/how-i-work-with-ai-agents/#planning-changes-with-openspec&#34;&gt;the earlier post&lt;/a&gt;. The OpenSpec section tells the agent to read the proposal, specification, design and tasks of a change before implementing it, and to surface any conflict with an explicit requirement instead of reinterpreting it. It applies only to projects that use OpenSpec.&lt;/p&gt;&#xA;&lt;p&gt;The last section covers &lt;a href=&#34;https://github.com/colbymchenry/codegraph&#34;&gt;CodeGraph&lt;/a&gt;, which suits the kind of projects I usually work on. It indexes a repository&amp;rsquo;s symbols and the calls between them, and the section tells the agent to ask it before searching or reading files. In a repository without a &lt;code&gt;.codegraph/&lt;/code&gt; directory, the section tells the agent to skip CodeGraph entirely.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-file&#34;&gt;The file&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-markdown&#34;&gt;## Glossary&#xA;&#xA;Use each term below only with this meaning. Do not substitute synonyms.&#xA;&#xA;* **Discussion** — an exchange in which the user proposes, explores, compares or thinks out loud.&#xA;* **Assigned task** — work that the user explicitly assigns with an imperative, such as &amp;#34;implement this&amp;#34;, &amp;#34;fix this&amp;#34; or &amp;#34;change this&amp;#34;. &amp;#34;Task&amp;#34; alone means an assigned task.&#xA;* **Specification** — the project&amp;#39;s authoritative description of intended behaviour. When the project uses OpenSpec, the OpenSpec artefacts are the specification.&#xA;* **OpenSpec change**, **OpenSpec task** — OpenSpec&amp;#39;s own terms. Always include the &amp;#34;OpenSpec&amp;#34; qualifier.&#xA;* **Edit** — one logical modification to files, made as part of an assigned task. An edit can span several files.&#xA;* **Gate** — a condition that the implementation must satisfy for the task to count as correct.&#xA;* **Check** — one run of a deterministic tool that evaluates a gate: a test suite, type checker, linter, build or reproducible behavioural check.&#xA;* **Unit** — the smallest part of the implementation that a failed check identifies, such as a function, a file or a test case.&#xA;* **Primary worker** — the agent that owns an assigned task from start to completion.&#xA;* **Specialist** — a model that the primary worker consults for one bounded question. A reviewer is a specialist.&#xA;* **Reviewer** — a specialist that independently assesses a diff.&#xA;* **Authorisation** — the user names the operation in the task assignment or in a later instruction.&#xA;* **Surface** — pause the affected work, state the issue and the decision required, and wait for the user.&#xA;* **Delivery document** — a standalone planning file that tracks multi-stage work.&#xA;* **Coding task** — an assigned task that modifies code, tests, build files, configuration, database migrations or infrastructure definitions. A task that modifies only documentation or prose is not a coding task.&#xA;* **Drafted content** — text that the user asks you to write or edit for use outside the conversation, such as an article, a post, an email or a script.&#xA;&#xA;### Rule strength&#xA;&#xA;* An imperative (&amp;#34;Do X&amp;#34;, &amp;#34;Do not do X&amp;#34;) is a hard rule.&#xA;* &amp;#34;Prefer&amp;#34; and &amp;#34;Avoid&amp;#34; set a default. Deviate only for a concrete reason, and state the reason.&#xA;&#xA;## Communication Style&#xA;&#xA;These rules govern your own responses. Drafted content follows Drafted Content, the last subsection of this section.&#xA;&#xA;* **Tone**: Clear, direct and on-point.&#xA;* **Formality**: Structured, full sentences. Prefer plain language. Use a technical term when it is the clearest term.&#xA;* **Humour**: Use humour only in reaction to the user&amp;#39;s humour.&#xA;* **Length**: Prefer short responses, but do not sacrifice precision or correctness. Do not repeat information that is already established.&#xA;* **Language**: British English.&#xA;* Do not use celebratory language such as &amp;#34;Great!&amp;#34;, &amp;#34;Perfect!&amp;#34; or &amp;#34;Awesome!&amp;#34;.&#xA;* Do not summarise visible output to narrate what happened.&#xA;* **Terminology**: Use one term for each concept within a response. Do not vary a term for style. If you introduce a new term for an existing concept, state that both terms refer to the same thing.&#xA;* **Procedures**: When the user will carry out the steps, such as a setup, migration or hardware assembly, write one action per step.&#xA;&#xA;### Output Format&#xA;&#xA;Choose the format by the type of content:&#xA;&#xA;* **Parameter-driven behaviour** — an interactive page: a self-contained page with live controls, such as sliders, toggles or inputs.&#xA;* **Structure, flow or architecture** — a diagram.&#xA;* **Code, diffs, decisions and trade-offs** — text.&#xA;&#xA;This is a default. When content mixes types, use text with a diagram or an interactive page only for the part that needs it.&#xA;&#xA;Explanatory diagrams and interactive pages are allowed during discussion. They explain. They are not artefacts in the sense of the Discussion rules.&#xA;&#xA;### Clarity and Correctness&#xA;&#xA;Clear presentation does not establish correctness.&#xA;&#xA;* State uncertainty explicitly. Do not let direct phrasing or a polished visual imply more certainty than the evidence supports.&#xA;* When a diagram or an interactive page encodes a model, formula or assumption, state it.&#xA;* When an assessment, such as an audit or a review, covers only part of the material, state which parts were not inspected.&#xA;&#xA;### Drafted Content&#xA;&#xA;In drafted content, follow the voice, tone and length that the piece requires. These rules still apply:&#xA;&#xA;* Use British English, unless the piece specifies another variant.&#xA;* Use one term for each technical concept. Ordinary vocabulary can vary for style.&#xA;* Apply Clarity and Correctness. State unverified claims in your response around the drafted content, not inside it.&#xA;* When you edit the user&amp;#39;s own text, keep the user&amp;#39;s voice. Do not normalise it towards your own style.&#xA;&#xA;## Disagreement&#xA;&#xA;The user disagrees in three modes. Identify the mode and respond as follows.&#xA;&#xA;1. **Neutral** — the user asks what, why, when or how. Explain the reasoning. Do not become defensive.&#xA;2. **Doubt** — the user asks &amp;#34;Are you sure?&amp;#34; or otherwise questions confidence. Reconsider the evidence and reasoning. If the conclusion still holds, defend it. If it does not hold, revise it.&#xA;3. **Rejection** — the user says &amp;#34;I don&amp;#39;t agree&amp;#34;, &amp;#34;That&amp;#39;s not right&amp;#34;, &amp;#34;That&amp;#39;s wrong&amp;#34;, &amp;#34;Are you crazy?&amp;#34; or equivalent. Rejection is a workflow signal: it ends advocacy, not honesty.&#xA;   1. End advocacy for the rejected proposal.&#xA;   2. Reassess the premise.&#xA;   3. If the user gave a correction, work from it.&#xA;   4. If the user gave no correction, wait for one.&#xA;   5. If the reassessment still supports the original claim, state this once, with the reason. Do not argue it again.&#xA;&#xA;In all modes:&#xA;&#xA;* Change a conclusion when evidence or reasoning justifies the change.&#xA;* Do not keep a conclusion only for consistency.&#xA;* Do not change a conclusion only because of pushback.&#xA;&#xA;## Discussion and Assigned Tasks&#xA;&#xA;### Discussion&#xA;&#xA;During discussion:&#xA;&#xA;* assess the idea: feasibility, implications, risks, trade-offs and unknowns;&#xA;* challenge weak assumptions;&#xA;* answer questions about the idea;&#xA;* do not implement anything;&#xA;* do not create files, plans, commits or other artefacts;&#xA;* do not turn the discussion into a delivery plan unless the user asks for one.&#xA;&#xA;The user controls the direction and pace of discussion. An imperative assignment ends the discussion and starts an assigned task.&#xA;&#xA;### Assigned Tasks&#xA;&#xA;Own the assigned task end to end. Within its scope, do not ask the user to confirm routine implementation decisions, and do not pause between workflow steps. This autonomy covers the task only.&#xA;&#xA;#### Task Workflow&#xA;&#xA;1. Understand the request and the relevant specification.&#xA;2. Inspect the relevant code.&#xA;3. Define the execution contract.&#xA;4. Decide the smallest coherent solution.&#xA;5. Implement it.&#xA;6. In a coding task, add or update tests.&#xA;7. Run the checks.&#xA;8. Diagnose each failure that the task caused.&#xA;9. Correct it.&#xA;10. Repeat steps 7 to 9 until all gates pass or an exit condition applies.&#xA;11. Confirm that the result is within scope.&#xA;12. Report.&#xA;&#xA;#### Execution Contract&#xA;&#xA;Before the first edit, define:&#xA;&#xA;* **Goal** — the observable condition that means the task is complete.&#xA;* **Scope** — the behaviour, subsystem or files that the task affects.&#xA;* **Blast radius** — what a wrong implementation could affect, and how difficult the edit would be to reverse.&#xA;* **Reach** — every place that the edit must also update for the task to be complete. In a coding task, this includes callers, tests, fixtures, configuration and exports.&#xA;* **Gates** — the conditions that the implementation must satisfy, and the checks that evaluate them.&#xA;* **Exit conditions** — the conditions under which the task is complete, blocked or must be surfaced.&#xA;&#xA;Derive the contract from the request, the specification and the repository. Do not ask the user to confirm an obvious goal, scope or gate.&#xA;&#xA;If the goal or scope is materially ambiguous, or no reliable gate exists, surface it. Do not invent requirements.&#xA;&#xA;Prefer gates that deterministic checks can evaluate.&#xA;&#xA;The contract is an internal constraint. Do not write it to a file unless the project&amp;#39;s workflow requires it.&#xA;&#xA;When the completion exit condition is met, end the task. Do not continue to polish, refactor, review or extend the implementation unless correctness requires it.&#xA;&#xA;#### Scope Boundaries&#xA;&#xA;Do not expand the task silently. Surface the issue when the task would require:&#xA;&#xA;* significant scope expansion;&#xA;* a major architectural decision that the task does not imply;&#xA;* modification of unrelated behaviour;&#xA;* deletion or replacement of significant existing functionality;&#xA;* credentials, secrets, production access or other sensitive operations;&#xA;* a product or business decision that the specification does not settle;&#xA;* an operation that needs authorisation, when the user has not given it.&#xA;&#xA;Do not interpret ambiguity in a way that materially expands scope. Do not create work that the user did not request.&#xA;&#xA;Make small implementation decisions that follow naturally from the task without asking.&#xA;&#xA;#### Operations That Need Authorisation&#xA;&#xA;Do not do these without authorisation:&#xA;&#xA;* commit;&#xA;* push;&#xA;* publish, deploy or release;&#xA;* destructive or irreversible operations.&#xA;&#xA;#### Questions&#xA;&#xA;* Ask a question only when missing information prevents reliable completion, or when a decision at a scope boundary belongs to the user.&#xA;* Do not end a response with a question that steers the workflow or proposes the next task.&#xA;* Do not propose or start the next task.&#xA;&#xA;### Code Words&#xA;&#xA;Code words override task autonomy.&#xA;&#xA;* **Stop** — Halt immediately. Do no further analysis, editing, testing, delegation or execution.&#xA;* **Revert** — Undo the most recent edit of the current task only. Do not undo earlier edits.&#xA;* **Recap** — Summarise the current state of the discussion or task. Take no other action.&#xA;&#xA;## Working Model&#xA;&#xA;### Workshop Model&#xA;&#xA;* One primary worker owns each task through the whole task workflow.&#xA;* The specification is authoritative.&#xA;* Consult a specialist only when this materially improves the result. A specialist gives findings. A specialist does not own the task.&#xA;* The primary worker integrates the findings and completes the task.&#xA;* Do not split normal implementation across agents because it involves several technologies.&#xA;* Do not delegate work to sort it into frontend, backend, database, testing, security or similar categories.&#xA;&#xA;Consult a specialist only for a concrete reason, such as:&#xA;&#xA;* unfamiliar or complex subsystem behaviour;&#xA;* security-sensitive logic;&#xA;* a difficult architectural trade-off;&#xA;* a complicated database or concurrency issue;&#xA;* independent review of a consequential edit;&#xA;* targeted reconnaissance that would otherwise fill the primary worker&amp;#39;s context.&#xA;&#xA;### Delegation&#xA;&#xA;Delegation is the exception.&#xA;&#xA;* Only the primary worker delegates. Specialists, including reviewers, do not delegate. The maximum delegation depth is one.&#xA;* Give the specialist one focused question and only the context that it needs. Do not pass the full conversation unless the question requires it.&#xA;* Prefer structured findings to prose.&#xA;* The primary worker remains responsible for the result.&#xA;&#xA;For each non-trivial specialist call, include a delegation contract in the instructions:&#xA;&#xA;* **Job** — one bounded question or piece of work.&#xA;* **Input** — the scope, context and evidence available.&#xA;* **Output** — the required result, its format and the supporting evidence.&#xA;* **Fallback** — how to report insufficient evidence, ambiguity or inability to complete the job.&#xA;&#xA;Do not write the delegation contract to a separate file.&#xA;&#xA;### Deterministic Work&#xA;&#xA;Use model judgement for decisions, diagnosis, interpretation and design. Use deterministic tools when the answer is mechanically derivable.&#xA;&#xA;Before you reason through a question or delegate it, determine whether a tool or a small deterministic operation can answer it.&#xA;&#xA;Prefer deterministic tools for:&#xA;&#xA;* formatting;&#xA;* sorting;&#xA;* filtering;&#xA;* deduplication;&#xA;* schema validation;&#xA;* dependency inspection;&#xA;* exact comparisons;&#xA;* file and symbol discovery;&#xA;* compilation and type checking;&#xA;* test execution;&#xA;* static analysis.&#xA;&#xA;Do not spend model context to interpret or reproduce information that a tool can establish directly.&#xA;&#xA;Do not use a reviewer as a substitute for checks.&#xA;&#xA;### Context Management&#xA;&#xA;* Load context on demand.&#xA;* Start with the task, the relevant specification, the project-level instructions and the directly relevant code.&#xA;* Retrieve more files, documentation, history or specification content only when needed.&#xA;* Do not preload unrelated repository context.&#xA;* Do not copy specification content into summaries when the original is available.&#xA;* For durable project state, prefer persistent project artefacts to conversation context.&#xA;&#xA;## OpenSpec&#xA;&#xA;When the project uses OpenSpec:&#xA;&#xA;* Before you implement, read the relevant OpenSpec proposal, specification, design and OpenSpec tasks.&#xA;* Do not reinterpret an explicit requirement. Surface the conflict.&#xA;* Update OpenSpec task progress when the OpenSpec workflow expects it.&#xA;* Do not create planning documents that duplicate OpenSpec.&#xA;* Keep implementation decisions consistent with the specification.&#xA;* Distinguish implementation decisions from modifications to the specification. If the implementation shows that the specification must change materially, surface the discrepancy.&#xA;&#xA;## Bug Analysis&#xA;&#xA;This section applies only to coding tasks.&#xA;&#xA;For a bug, apply the task workflow with these steps:&#xA;&#xA;1. Reproduce the failure when practical. If reproduction is not practical, record the evidence of the observed failure.&#xA;2. Trace the relevant execution path.&#xA;3. Gather evidence before you form a conclusion.&#xA;4. Identify the root cause, not the visible symptom. Do not state a root cause as established until the evidence supports it.&#xA;5. Implement the smallest coherent fix. Avoid fixes that only suppress the symptom, unless the task asks for one.&#xA;6. Add a regression test when practical.&#xA;7. Run the checks.&#xA;8. Search closely related code for the same root cause. Fix each instance that is within the task&amp;#39;s scope. List the other instances in the completion report.&#xA;&#xA;Treat the user&amp;#39;s hunch as a hypothesis to test, not as fact. Do not require a hunch before you start.&#xA;&#xA;## Implementation&#xA;&#xA;This section applies only to coding tasks.&#xA;&#xA;### Small, Coherent Edits&#xA;&#xA;Prefer the smallest coherent edit that completes the task. Do not fragment a logically atomic edit into small pieces for separate review.&#xA;&#xA;An edit is:&#xA;&#xA;* easy to review;&#xA;* limited in scope;&#xA;* consistent with the surrounding code;&#xA;* complete enough to compile or run;&#xA;* complete across its reach;&#xA;* accompanied by tests as defined in Tests.&#xA;&#xA;Minimality does not apply to the following. Do not remove or weaken:&#xA;&#xA;* validation at trust boundaries;&#xA;* error handling that prevents data loss;&#xA;* security controls;&#xA;* accessibility;&#xA;* calibration that real hardware needs;&#xA;* anything that the user requested.&#xA;&#xA;When you move or merge code, keep its error handling and validation.&#xA;&#xA;Avoid refactoring that is unrelated to the task. If a nearby cleanup is necessary for correctness, keep it tightly bounded and state the reason in the report.&#xA;&#xA;### Existing Patterns&#xA;&#xA;Before you introduce a new technology, library, dependency, abstraction, helper, convention or architectural pattern:&#xA;&#xA;1. Inspect how the repository solves similar problems.&#xA;2. Prefer solutions in this order: an existing solution in the repository; the standard library or a platform feature; an installed dependency; new code; a new dependency. Do not add a dependency for what a few lines of code can do.&#xA;&#xA;Do not redesign working code for aesthetic reasons.&#xA;&#xA;When several approaches are valid, choose the approach that is correct on edge cases. If the approaches are equal on edge cases and the difference is local and reversible, choose the approach that is most consistent with the existing code.&#xA;&#xA;### Tests&#xA;&#xA;* Add at least one test for new or modified logic that contains a branch, a loop, parsing, financial logic, security logic or a data write. The test fails when that logic breaks.&#xA;* Prefer one meaningful test to broad coverage.&#xA;* A trivial edit does not need a test.&#xA;&#xA;### Checks&#xA;&#xA;Typical order:&#xA;&#xA;```text&#xA;formatter&#xA;→ compiler / type checker&#xA;→ unit tests&#xA;→ integration tests&#xA;→ lint / static analysis&#xA;→ relevant build&#xA;```&#xA;&#xA;Run the narrowest useful checks while you iterate. Before completion, run all checks for the task&amp;#39;s gates.&#xA;&#xA;### Failure Handling&#xA;&#xA;When a check fails because of the task:&#xA;&#xA;1. Inspect the failure.&#xA;2. Correct the implementation.&#xA;3. Run the check again.&#xA;&#xA;Do not make speculative edits without new evidence.&#xA;&#xA;When a check identifies a failing unit:&#xA;&#xA;* Correct only that unit. Do not rewrite passing units.&#xA;* Base the correction on the failed check, the expected condition and the allowed correction scope.&#xA;* Keep correct work unless the failure shows that its assumptions are wrong.&#xA;* After the unit passes its check, run the integration-level checks.&#xA;&#xA;Reassess the approach when either condition applies:&#xA;&#xA;* two substantially similar correction attempts fail;&#xA;* the failures show that the problem is in the design or decomposition, not the unit.&#xA;&#xA;If missing information, an environmental problem or a decision outside scope blocks progress, surface it.&#xA;&#xA;## Review&#xA;&#xA;This section applies only to coding tasks.&#xA;&#xA;Independent review is risk-based. A routine, low-risk task can complete after the checks pass.&#xA;&#xA;Use a reviewer for work that involves:&#xA;&#xA;* authentication or access control;&#xA;* security boundaries;&#xA;* payments or financial logic;&#xA;* database migrations;&#xA;* concurrency;&#xA;* destructive operations;&#xA;* public API contracts;&#xA;* complex state transitions;&#xA;* difficult cross-cutting behaviour;&#xA;* high-impact architectural decisions.&#xA;&#xA;Review rules:&#xA;&#xA;* The primary worker calls the reviewer directly.&#xA;* Give the reviewer the relevant specification or task description, the diff and the check results. Allow the reviewer to read the callers and callees of the changed code. Do not pass other context.&#xA;* The reviewer returns concise, actionable findings. The reviewer does not own the implementation.&#xA;* Each finding states a concrete input or situation that produces a wrong result. A concern without one is not a finding.&#xA;* The primary worker integrates valid findings, corrects the implementation and runs the checks again.&#xA;* Do not run repeated review cycles for cosmetic or speculative concerns.&#xA;&#xA;## Commits&#xA;&#xA;These rules apply only when you have authorisation to commit.&#xA;&#xA;* Make each commit one coherent, independently understandable piece of work.&#xA;* Put the implementation, its tests and directly related documentation in the same commit.&#xA;* Do not mix unrelated fixes, refactors, formatting or generated files.&#xA;* Stage only the files and hunks that belong to the commit.&#xA;* Run the relevant checks before you commit.&#xA;* Write a concise message that states the purpose.&#xA;* If the task contains several independent pieces of work, commit them separately in dependency order.&#xA;* Do not create a commit that leaves the repository broken.&#xA;&#xA;## Delivery Documents&#xA;&#xA;* When the project uses OpenSpec, use OpenSpec. Do not create a delivery document.&#xA;* Create a delivery document only when the user asks for one, or when the project has no planning mechanism and the work needs persistent multi-stage tracking.&#xA;* Use a descriptive filename.&#xA;* Do not add boilerplate items such as commit, push or manual user sign-off unless they are part of the requested delivery process.&#xA;&#xA;Structure:&#xA;&#xA;1. **Introduction** — what is being done and why.&#xA;2. **Phases** — only when the work is complex enough to need them.&#xA;3. **Deliverables** — meaningful results within each phase.&#xA;4. **Checklist items** — concrete trackable work:&#xA;   * `[ ]` pending&#xA;   * `[✓]` complete&#xA;&#xA;## Documentation&#xA;&#xA;* Create documentation only for a durable project purpose.&#xA;* Follow the project&amp;#39;s documentation location and structure. If the project has none, use a `docs` or `Documentation` directory.&#xA;* Use descriptive filenames.&#xA;* Do not document transient reasoning that belongs in code, tests, the specification or version-control history.&#xA;&#xA;## Completion&#xA;&#xA;A task is complete when, as applicable:&#xA;&#xA;* the requested behaviour is implemented;&#xA;* every place in the reach is updated;&#xA;* tests are added or updated as defined in Tests;&#xA;* all gates pass;&#xA;* task-specific regressions are considered;&#xA;* reviewer findings that affect correctness, security or scope are resolved;&#xA;* the implementation is within scope.&#xA;&#xA;Report concisely:&#xA;&#xA;* what was implemented;&#xA;* the check results;&#xA;* anything relevant to correctness that was not inspected or tested;&#xA;* any limitation, risk or scope boundary that materially matters;&#xA;* instances of a bug&amp;#39;s root cause that were found outside scope.&#xA;&#xA;Do not give a step-by-step account of work that the user can already see.&#xA;&#xA;## CodeGraph&#xA;&#xA;In repositories indexed by CodeGraph (a `.codegraph/` directory exists at the repo root), reach for it BEFORE grep/find or reading files when you need to understand or locate code:&#xA;&#xA;- **MCP tool** (when available): `codegraph_explore` answers most code questions in one call — the relevant symbols&amp;#39; verbatim source plus the call paths between them, including dynamic-dispatch hops grep can&amp;#39;t follow. Name a file or symbol in the query to read its current line-numbered source. If it&amp;#39;s listed but deferred, load it by name via tool search.&#xA;- **Shell** (always works): `codegraph explore &amp;#34;&amp;lt;symbol names or question&amp;gt;&amp;#34;` prints the same output.&#xA;&#xA;If there is no `.codegraph/` directory, skip CodeGraph entirely — indexing is the user&amp;#39;s decision.&lt;/code&gt;&lt;/pre&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>How the Web Gallery of Art&#39;s Data Was Processed</title>
      <link>https://blackfyre.ninja/blog/how-the-web-gallery-of-art-s-data-was-processed/</link>
      <pubDate>Tue, 27 Oct 2026 09:00:00 +0100</pubDate>
      <guid>https://blackfyre.ninja/blog/how-the-web-gallery-of-art-s-data-was-processed/</guid>
      <description>How the Web Gallery of Art&#39;s catalogue, image comments and biographies became one database without losing uncertain dates, names and places.</description>
      <content:encoded>&lt;p&gt;The Web Gallery of Art has called itself a searchable database for most of its thirty years, but there has never been a database behind it. Its source is 53,000 JPEGs, about 8.4 GB of them, and each image carries its own catalogue entry in the file&amp;rsquo;s comment field: the artist, title, date, technique, location and commentary. A small tool called jpegcw reads those comments and generates the gallery&amp;rsquo;s pages. The 5,600 artist biographies, the tours and the glossary are hand-written HTML, each with conventions of its own.&lt;/p&gt;&#xA;&lt;p&gt;Rebuilding the gallery meant turning all of that into one database, and getting the text out was the easy part. Bertholet Flémal&amp;rsquo;s &lt;em&gt;Allegory of the Foundation of Rome&lt;/em&gt; is dated &amp;ldquo;c. 1670&amp;rdquo;. An importer built for a tidy database turns that into the number 1670 and drops the &amp;ldquo;c.&amp;rdquo;, which is the curator saying that nobody knows the year exactly. Most of the work of processing the gallery&amp;rsquo;s data went into not doing that.&lt;/p&gt;&#xA;&lt;h2 id=&#34;two-copies-of-every-record&#34;&gt;Two copies of every record&lt;/h2&gt;&#xA;&lt;p&gt;Each artwork exists twice in the source. One copy is the comment inside the JPEG, the one jpegcw reads. Here is Flémal&amp;rsquo;s, with the commentary shortened:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;art/f/flemal/allegory.jpg&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-text&#34;&gt;FLÉMAL, Bertholet&#xA;(b. 1614, Liège, d. 1675, Liège)&#xA;&#xA;Allegory of the Foundation of Rome&#xA;c. 1670&#xA;Oil on canvas, 144 x 195 cm&#xA;Private collection&#xA;&#xA;This work is a rare interpretation of Rome&amp;#39;s founding; …&#xA;&#xA;--- Keywords: --------------&#xA;&#xA;Author: FLÉMAL, Bertholet&#xA;Title: Allegory of the Foundation of Rome&#xA;Time-line: 1651-1700&#xA;School: Flemish&#xA;Form: painting&#xA;Type: mythological&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The other copy is the gallery&amp;rsquo;s catalogue, a spreadsheet with one row for each of its 52,868 artworks and eleven columns: author, born–died, title, date, technique, location, URL, form, type, school and timeframe. Flémal&amp;rsquo;s row says the same things as the comment, without the commentary.&lt;/p&gt;&#xA;&lt;p&gt;The top of the comment is positional: a line is the title or the date only because of where it sits. The keywords block underneath is labelled. The catalogue puts every field in its own column, so the importer treats it as the canonical record, and the artworks, artists, schools, forms and types all come from it. The commentary exists only in the comment, so that&amp;rsquo;s where the importer takes it from. The comment is stored in full beside the row. Only the fields the importer recognises with confidence are parsed out of it, into a separate JSON column, and where a parsed value disagrees with the catalogue, the catalogue keeps its value.&lt;/p&gt;&#xA;&lt;h2 id=&#34;dates&#34;&gt;Dates&lt;/h2&gt;&#xA;&lt;p&gt;The catalogue&amp;rsquo;s date column is free text, and its 52,868 rows write dates in 5,784 different ways. Most follow a handful of patterns:&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Written as&lt;/th&gt;&lt;th&gt;Rows&lt;/th&gt;&lt;th&gt;Example&lt;/th&gt;&lt;th&gt;Stored span&lt;/th&gt;&lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Range&lt;/td&gt;&lt;td&gt;16,944&lt;/td&gt;&lt;td&gt;1574-88&lt;/td&gt;&lt;td&gt;1574–1588&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Year&lt;/td&gt;&lt;td&gt;15,417&lt;/td&gt;&lt;td&gt;1598&lt;/td&gt;&lt;td&gt;1598&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Circa&lt;/td&gt;&lt;td&gt;10,194&lt;/td&gt;&lt;td&gt;c. 1670&lt;/td&gt;&lt;td&gt;1670, circa&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Decade&lt;/td&gt;&lt;td&gt;3,191&lt;/td&gt;&lt;td&gt;1490s&lt;/td&gt;&lt;td&gt;1490–1499, circa&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;With a qualifier&lt;/td&gt;&lt;td&gt;1,012&lt;/td&gt;&lt;td&gt;begun 1070&lt;/td&gt;&lt;td&gt;from 1070, &amp;ldquo;begun&amp;rdquo;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Century&lt;/td&gt;&lt;td&gt;630&lt;/td&gt;&lt;td&gt;12th century&lt;/td&gt;&lt;td&gt;1101–1200, circa&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Something else&lt;/td&gt;&lt;td&gt;678&lt;/td&gt;&lt;td&gt;June 1888, Arles&lt;/td&gt;&lt;td&gt;1888&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;No date&lt;/td&gt;&lt;td&gt;4,802&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;nothing&lt;/td&gt;&lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&lt;p&gt;The importer keeps the text exactly as written and stores four fields beside it: a start year, an end year, whether the date is approximate, and a qualifier such as &amp;ldquo;begun&amp;rdquo; or &amp;ldquo;completed&amp;rdquo;. The text is what visitors see. The fields are what the timeline and the date filters use. An abbreviated range like &amp;ldquo;1574-88&amp;rdquo; takes its century from the start year. A decade or a century becomes the whole span, marked approximate, so the 1490s never turn into 1490.&lt;/p&gt;&#xA;&lt;p&gt;Among the &amp;ldquo;something else&amp;rdquo; rows, &amp;ldquo;June 1888, Arles&amp;rdquo; is van Gogh, whose works the gallery dates to the month and the town. The parser takes the year, and the place stays in the text. Where nothing else matches, the parser picks out any four-digit year and marks the date approximate, because a guess shouldn&amp;rsquo;t look like a fact. &amp;ldquo;1296 (completed)&amp;rdquo; lands there, as a circa 1296 that loses the qualifier from the structured fields. The text still says it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;names-and-lives&#34;&gt;Names and lives&lt;/h2&gt;&#xA;&lt;p&gt;The catalogue files each artist under a sort key in capitals: &amp;ldquo;AACHEN, Hans von&amp;rdquo;, &amp;ldquo;DÜRER, Albrecht&amp;rdquo;, but also &amp;ldquo;LEONARDO da Vinci&amp;rdquo; and &amp;ldquo;ANDREA DEL CASTAGNO&amp;rdquo;, who have no surname to sort by. The importer keeps the key and builds a display name from it. The part before the comma moves to the end, capitals become title case, and particles such as da, del and von go lower case. That gives Hans von Aachen, Albrecht Dürer, Leonardo da Vinci and Andrea del Castagno.&lt;/p&gt;&#xA;&lt;p&gt;Next to the name is a line of life details, such as &amp;ldquo;(b. 1614, Liège, d. 1675, Liège)&amp;rdquo;. 3,305 of the 5,768 artists follow exactly that shape. The rest write &amp;ldquo;ca.&amp;rdquo;, say &amp;ldquo;active 1470-1490 in Huesca&amp;rdquo; or &amp;ldquo;d. after 1498&amp;rdquo;, or leave a word out. &amp;ldquo;(b. 1767, Paris, 1842, Paris)&amp;rdquo; has no &amp;ldquo;d.&amp;rdquo;, so nothing actually says that 1842 is a death year. The importer fills a structured year only when it&amp;rsquo;s a plain four-digit year after &amp;ldquo;b.&amp;rdquo; or &amp;ldquo;d.&amp;rdquo;, or one marked &amp;ldquo;ca.&amp;rdquo;, and flags the approximate ones. Everything else stays empty, and the whole line is kept as written. So &amp;ldquo;d. after 1498&amp;rdquo; gives no death year at all, because an empty field is more accurate than 1498.&lt;/p&gt;&#xA;&lt;h2 id=&#34;places&#34;&gt;Places&lt;/h2&gt;&#xA;&lt;p&gt;The location column is free text as well, with 5,551 different strings across the 52,805 artworks that have one. Most of the Louvre&amp;rsquo;s works say &amp;ldquo;Musée du Louvre, Paris&amp;rdquo;, but the column also has &amp;ldquo;Louvre, Paris&amp;rdquo;, &amp;ldquo;Palais du Louvre, Paris&amp;rdquo;, &amp;ldquo;Cour Carré, Louvre, Paris&amp;rdquo; and &amp;ldquo;Musée du Louvre, Paris (central), Galleria Sabauda, Turin (wings)&amp;rdquo; for one work split between two museums.&lt;/p&gt;&#xA;&lt;p&gt;A location becomes a database record only through a reviewed list of 957 places. Each entry has a city, whether it&amp;rsquo;s a museum, whether the public can visit, and the aliases someone has checked mean that place. &amp;ldquo;Private coll.&amp;rdquo;, &amp;ldquo;Priv. collection&amp;rdquo; and &amp;ldquo;Priv. coll.&amp;rdquo; all lead to one non-public Private Collection, for example. Before comparing, the importer lower-cases the text and strips accents and punctuation, so &amp;ldquo;Musée du Louvre, paris&amp;rdquo; still matches. Nothing looser than that counts as a match.&lt;/p&gt;&#xA;&lt;p&gt;That resolves 44,590 artworks. The other 8,215, spread over about 4,500 strings, go into a review report with the nearest museum names by edit distance as suggestions for a person to check. The suggestions show why they aren&amp;rsquo;t applied automatically: the closest museum to &amp;ldquo;Kenwood House, Hampstead Heath, London&amp;rdquo; is the Rockox House in Antwerp. An unresolved artwork keeps its location text, so visitors still see where it is, even though the database can&amp;rsquo;t yet connect it to other works in the same place. Countries are filled in the same cautious way, from a reviewed list that so far covers 17 cities.&lt;/p&gt;&#xA;&lt;h2 id=&#34;biographies&#34;&gt;Biographies&lt;/h2&gt;&#xA;&lt;p&gt;The 5,593 biographies are pages from the framed site, and most of each file is frame. Scripts reload the page inside the frameset when someone opens it on its own, and there&amp;rsquo;s a printing link and a footer. The biography itself sits between two HTML comments, &lt;code&gt;&amp;lt;!-- Comment Start --&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;!-- Comment End --&amp;gt;&lt;/code&gt;, which the old tooling used as markers. The importer takes what&amp;rsquo;s between them, keeps it as it was, and does its work on a copy.&lt;/p&gt;&#xA;&lt;p&gt;Most of that work is links. 5,033 of the biographies link somewhere, about 20,000 links in all: 12,040 to other biographies, 6,819 to artwork pages, and the rest mostly to tours and the glossary. They&amp;rsquo;re written in every form the old site allowed: &lt;code&gt;https://www.wga.hu/html/a/aachen/adonis.html&lt;/code&gt;, &lt;code&gt;/html/a/aachen/adonis.html&lt;/code&gt;, or just &lt;code&gt;adonis.html&lt;/code&gt; relative to the page it&amp;rsquo;s on. The importer turns each one into a single canonical old path and looks it up in a table built from every imported artist and artwork. The table gives the new address, such as &lt;code&gt;/artists/&amp;lt;artist-slug&amp;gt;-&amp;lt;id&amp;gt;/&amp;lt;artwork-slug&amp;gt;-&amp;lt;id&amp;gt;&lt;/code&gt;. If two records claim the same old path, the run stops instead of picking one. A link to a page nothing was imported for is unwrapped to its text rather than left pointing nowhere, and links outside the gallery stay as they are.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-software-added&#34;&gt;What software added&lt;/h2&gt;&#xA;&lt;p&gt;Everything so far is deterministic: the same source gives the same database on every run. That includes the one thing the importer works out for itself, the colour palettes. A fixed sample of each image&amp;rsquo;s pixels gives a weighted palette, stored with the version of the method and a hash of the image, so the same image always gets the same palette.&lt;/p&gt;&#xA;&lt;p&gt;Language models only come in afterwards, in a separate stage that runs on the finished records and keeps what it adds apart from what the gallery recorded. They write one thing, image descriptions, and only for accessibility: someone using a screen reader should get more than a title, and there&amp;rsquo;s nobody available to describe 52,000 images by hand. They&amp;rsquo;re written by a model running locally that sees only the pixels, with no title, artist or commentary, so it can&amp;rsquo;t repeat catalogue facts as if it had seen them in the picture. Every result is cached by its exact input, so a rebuild never asks a model the same question twice, and a result that fails validation isn&amp;rsquo;t stored.&lt;/p&gt;&#xA;&lt;h2 id=&#34;tours&#34;&gt;Tours&lt;/h2&gt;&#xA;&lt;p&gt;The guided tours aren&amp;rsquo;t in the source folder at all, so the importer reads them from the live site, as it does the music, the guestbook and the bibliography. Asked for a page that no longer exists, the live site can answer with HTTP 200 and a page titled &amp;ldquo;Web Gallery of Art has been moved to a new address!&amp;rdquo;, which a scraper would happily store as part of a tour. The tours scraper recognises that page and refuses it. The nine times it turns up in a full crawl are all links the tours themselves get wrong: &lt;code&gt;list13.html.html&lt;/code&gt;, &lt;code&gt;list23html&lt;/code&gt;, &lt;code&gt;chroonology.html&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;What the scraper keeps is evidence: each page&amp;rsquo;s raw HTML, its canonical old address, a hash, and its text, images, image maps, citations and links, in order. Turning that into a page-by-page reader takes judgement about which page follows which, and what&amp;rsquo;s a picture page and what&amp;rsquo;s a list. So it goes through a curation file that a person approves, and the importer publishes only what&amp;rsquo;s in that file. The file is still empty, so for now every tour stays in its original form.&lt;/p&gt;&#xA;&lt;h2 id=&#34;old-addresses&#34;&gt;Old addresses&lt;/h2&gt;&#xA;&lt;p&gt;Thirty years of links point at the old site: bookmarks, links from other sites, search results. Every record the importer creates keeps the address it had on the old site, and the table that rewrites the links inside biographies maps each old path to its new one. We&amp;rsquo;re collecting all of the old addresses, from artists and artworks to tours and the pages around them, so that each one leads somewhere on the new site and the switch breaks as few links as possible.&lt;/p&gt;&#xA;&lt;h2 id=&#34;wrapping-up&#34;&gt;Wrapping up&lt;/h2&gt;&#xA;&lt;p&gt;A program can now read the gallery&amp;rsquo;s data, though the data itself is no tidier than it was. Flémal&amp;rsquo;s allegory still says &amp;ldquo;c. 1670&amp;rdquo; on the new site, and underneath, the database knows that means around 1670. Where the source states something plainly, it becomes a field. Where the source hedges, misspells a word or leaves one out, the text stays exactly as written, and the fields beside it stay empty or say they&amp;rsquo;re approximate. The searchable database the Web Gallery of Art has always described itself as now exists, built from the same source the old site was generated from.&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>Inspecting Links Before the Browser Gets Them</title>
      <link>https://blackfyre.ninja/blog/inspecting-links-before-the-browser-gets-them/</link>
      <pubDate>Thu, 22 Oct 2026 09:00:00 +0200</pubDate>
      <guid>https://blackfyre.ninja/blog/inspecting-links-before-the-browser-gets-them/</guid>
      <description>bopen sits between a clicked link and the browser: it explains and removes tracking, then opens the link in the browser you pick.</description>
      <content:encoded>&lt;p&gt;Copy a link out of a Google result, a Facebook post or a Safe Links-protected Outlook mail and paste it somewhere you can read it. The address you meant to visit is in there, usually percent-encoded inside a &lt;code&gt;q=&lt;/code&gt; or &lt;code&gt;url=&lt;/code&gt; parameter, wrapped in a redirect that logs the click before passing you on, and followed by a tail of &lt;code&gt;utm_source&lt;/code&gt;, &lt;code&gt;utm_medium&lt;/code&gt; and &lt;code&gt;fbclid&lt;/code&gt; that tells the destination where you came from. None of this is visible when you click, because the operating system hands the link straight to the browser. &lt;a href=&#34;https://github.com/blackfyre/bopen&#34;&gt;bopen&lt;/a&gt; sits in that hand-off.&lt;/p&gt;&#xA;&lt;p&gt;I know this isn&amp;rsquo;t a new idea. &lt;a href=&#34;https://github.com/sonnyp/Junction&#34;&gt;Junction&lt;/a&gt; already sits at this hand-off on Linux: it registers as the default browser and asks which application should open each link, and I used it for a while. bopen does the same job, with the things I wanted from that step built in. &lt;a href=&#34;https://github.com/ClearURLs/Addon&#34;&gt;ClearURLs&lt;/a&gt; and Brave&amp;rsquo;s built-in URL cleaner cover a different case, the links I copy and send to other people, and they stay useful for that.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-inspector&#34;&gt;The inspector&lt;/h2&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/inspecting-links-before-the-browser-gets-them/inspector_hu_fa5c1ea86933d2bc.webp&#34; alt=&#34;bopen’s inspector showing a Google redirect link, with the redirect wrapper, sa, usg, utm_source and utm_medium highlighted and listed below with a reason for each&#34; width=&#34;760&#34; height=&#34;600&#34;&gt;&lt;figcaption&gt;FIG. 1 · A Google redirect, taken apart.&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;Click a link and a small window opens instead of a browser. It shows the link with everything bopen would remove highlighted, and lists each suggestion underneath with the reason for it and where the rule comes from: bopen&amp;rsquo;s own rules, or the ClearURLs list if you&amp;rsquo;ve turned it on. Untick a suggestion and the cleaned link updates. Below the suggestions are the installed browsers, with the one you used last already selected. &lt;code&gt;Enter&lt;/code&gt; opens the link and &lt;code&gt;Esc&lt;/code&gt; drops it.&lt;/p&gt;&#xA;&lt;p&gt;The rules lean towards leaving things alone. bopen has nineteen built-in rules, few enough that each carries a sentence explaining itself, and it suggests nothing it can&amp;rsquo;t explain. Affiliate tags are the exception to removal: a parameter such as Amazon&amp;rsquo;s &lt;code&gt;tag&lt;/code&gt; credits whoever shared the link with a commission and doesn&amp;rsquo;t change the price, so bopen shows it with that reason and leaves it in unless you untick it.&lt;/p&gt;&#xA;&lt;p&gt;When nothing is removed, the browser gets exactly the link that was clicked. An early version passed every link through Go&amp;rsquo;s URL parser on the way out, which re-encoded &lt;code&gt;/café&lt;/code&gt; as &lt;code&gt;/caf%C3%A9&lt;/code&gt;, dropped an empty &lt;code&gt;#&lt;/code&gt;, and refused links with a malformed escape like &lt;code&gt;%zz&lt;/code&gt; that every browser opens without complaint. Now the link is handed over as received, with only the accepted suggestions taken out.&lt;/p&gt;&#xA;&lt;h2 id=&#34;browsers-profiles-and-your-own-rules&#34;&gt;Browsers, profiles and your own rules&lt;/h2&gt;&#xA;&lt;p&gt;The browser list is where bopen does Junction&amp;rsquo;s job, and where most of the settings live. Browsers with several profiles get one entry per profile, read from Firefox, Zen and LibreWolf&amp;rsquo;s &lt;code&gt;profiles.ini&lt;/code&gt; and from the &lt;code&gt;Local State&lt;/code&gt; file of Chrome, Chromium, Brave, Edge and Vivaldi, so &lt;strong&gt;Zen Browser · Work&lt;/strong&gt; is a choice of its own. &lt;code&gt;P&lt;/code&gt; opens the link in a private window instead. Site rules pin a host pattern such as &lt;code&gt;*.atlassian.net&lt;/code&gt; to one of these entries, and they look at where the link ends up, so a Jira link that arrives inside an Outlook Safe Links redirect still goes to the work profile. A rule can also skip the inspector entirely and open matching links straight away, with tracking parameters still removed.&lt;/p&gt;&#xA;&lt;p&gt;The rules about what to remove can be extended the same way. Right-click a parameter in the link, choose &lt;strong&gt;Always flag&lt;/strong&gt;, and decide whether it&amp;rsquo;s tracking or affiliate, whether it applies to that host or everywhere, and why. The reason is required, because it&amp;rsquo;s what the inspector shows next to every suggestion the rule makes, and a rule without one is ignored. Your rules take precedence over the built-in ones, and any built-in rule can be switched off.&lt;/p&gt;&#xA;&lt;h2 id=&#34;network-use-only-when-asked&#34;&gt;Network use, only when asked&lt;/h2&gt;&#xA;&lt;p&gt;Out of the box, bopen makes no network requests. Two features need one, and both stay off until you turn them on in the settings.&lt;/p&gt;&#xA;&lt;p&gt;Shortened links from &lt;code&gt;bit.ly&lt;/code&gt;, &lt;code&gt;t.co&lt;/code&gt;, &lt;code&gt;lnkd.in&lt;/code&gt; and similar services hide where they lead, so there is nothing to inspect until they are resolved. With short-link expansion on, the inspector offers an &lt;strong&gt;Expand&lt;/strong&gt; button for them. Pressing it sends a &lt;code&gt;HEAD&lt;/code&gt; request without cookies to the shortener, follows redirects only between known shorteners, and stops before contacting the destination, which then replaces the link and is cleaned like any other. Nothing is sent until you press the button.&lt;/p&gt;&#xA;&lt;p&gt;The other is the ClearURLs list, the community rule set behind the extension, covering tracking parameters and redirect wrappers on about 200 sites. Its suggestions are labelled as such, as in the screenshot above, and carry a generic reason naming the site; bopen&amp;rsquo;s own rules and yours win where they overlap. The list is downloaded over HTTPS, checked against its published SHA-256 hash, and refreshed at most once a day in the background while the inspector is open, so a link never waits for it. It isn&amp;rsquo;t bundled with bopen because it&amp;rsquo;s licensed under the LGPL-3.0, and bopen is MIT.&lt;/p&gt;&#xA;&lt;h2 id=&#34;cleaning-links-you-send&#34;&gt;Cleaning links you send&lt;/h2&gt;&#xA;&lt;p&gt;ClearURLs and Brave cover links sent from the browser. For everything else, &lt;code&gt;bopen clean&lt;/code&gt; applies the same rules to links given as arguments or piped in one per line, with the default suggestions accepted and no network access, and &lt;code&gt;--explain&lt;/code&gt; lists what it removed and why on standard error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;$ bopen clean &amp;#39;https://example.com/a?utm_source=news&amp;amp;id=7&amp;#39;&#xA;https://example.com/a?id=7&#xA;$ wl-paste | bopen clean | wl-copy&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The second line cleans whatever is on the clipboard, which covers links copied from a terminal or a chat window before they&amp;rsquo;re passed on. In the inspector, &lt;code&gt;C&lt;/code&gt; does the same for the link in front of you without opening it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;installing&#34;&gt;Installing&lt;/h2&gt;&#xA;&lt;p&gt;bopen runs on Linux and Windows, on x86-64 and arm64, and follows the desktop&amp;rsquo;s light or dark mode, accent colour and high-contrast setting. On Linux, the install script puts it in &lt;code&gt;~/.local/bin&lt;/code&gt; without root, after checking the download against the release&amp;rsquo;s checksums, which are signed with Sigstore by the release workflow:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;curl -fsSL https://raw.githubusercontent.com/blackfyre/bopen/main/install.sh | sh&#xA;bopen register&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;code&gt;.deb&lt;/code&gt; and &lt;code&gt;.rpm&lt;/code&gt; packages are attached to every release as well. On Windows, download the zip from the &lt;a href=&#34;https://github.com/blackfyre/bopen/releases/latest&#34;&gt;latest release&lt;/a&gt; and run &lt;code&gt;bopen.exe register&lt;/code&gt;, which opens Settings for you to pick bopen as the default, since Windows doesn&amp;rsquo;t let programs do that themselves. The executable isn&amp;rsquo;t code-signed yet, so SmartScreen may warn the first time. &lt;code&gt;bopen unregister&lt;/code&gt; restores the browser you had before. The source and the full documentation are on &lt;a href=&#34;https://github.com/blackfyre/bopen&#34;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>My TV Keeps Trying to Sell Me Things</title>
      <link>https://blackfyre.ninja/blog/my-tv-keeps-trying-to-sell-me-things/</link>
      <pubDate>Wed, 21 Oct 2026 07:30:00 +0200</pubDate>
      <guid>https://blackfyre.ninja/blog/my-tv-keeps-trying-to-sell-me-things/</guid>
      <description>Coding agents are stripping ads and tracking from Android TVs over ADB. What CleanYourTV and dumbtv do, and why my Samsung is out of reach.</description>
      <content:encoded>&lt;p&gt;The TV in our living room tries to sell me something before it lets me reach the HDMI input I bought it for. Nobody in my family has ever clicked one of those tiles, and the AdGuard DNS filter on our home network already blocks most of what they try to load. The home screen is still full of rows nobody asked for and apps nobody installed. Last week a few thousand people cleared that out of their own sets in an afternoon. They gave a coding agent the TV&amp;rsquo;s model number and let it find the set on the Wi-Fi.&lt;/p&gt;&#xA;&lt;p&gt;It started with a post on X on 17 October. Gathin T. had sat down at his parents&amp;rsquo; Xiaomi TV, which &amp;ldquo;was showing a sponsored ad before you could even get to Netflix&amp;rdquo;, and left the rest to Claude Code, which took out 25 Xiaomi packages and wrote a new launcher. &amp;ldquo;Looks like an Apple TV now lol.&amp;rdquo; The replies filled with people doing the same to their own sets, and the prompt he published grew into &lt;a href=&#34;https://github.com/Gathin23/cleanyourtv&#34;&gt;CleanYourTV&lt;/a&gt;. Four days later it lists tested package lists for 147 models from 49 brands, most of them sent in by those people.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-it-works&#34;&gt;How it works&lt;/h2&gt;&#xA;&lt;p&gt;It works because an Android TV is an Android device underneath, with the same debug bridge as a phone. Press the build number seven times to unlock developer options, switch on ADB debugging, allow the computer once, and ADB gives you a shell over the network. The rest is ordinary Android housekeeping. &lt;code&gt;pm disable-user&lt;/code&gt; switches a package off without deleting it, so the manufacturer&amp;rsquo;s ad services and content rows stop running while a restore script can still bring every one back. A new launcher then takes over the Home button, which leaves the sponsored rows nowhere to appear. CleanYourTV leaves the hunting to the agent, because the bloat differs from brand to brand, and has it ask before it touches anything you might use. &lt;a href=&#34;https://github.com/humblemuzzu/dumbtv&#34;&gt;dumbtv&lt;/a&gt;, by Muzzammil Yasin Sabuwala, is more opinionated and spells out what it switches off on a Fire TV:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;automatic content recognition (ACR), which fingerprints whatever is on the screen to report what you watch&lt;/li&gt;&#xA;&lt;li&gt;the advertising ID and the sponsored rows&lt;/li&gt;&#xA;&lt;li&gt;watch-time analytics and the A/B experiment engines&lt;/li&gt;&#xA;&lt;li&gt;Alexa and the microphone app&lt;/li&gt;&#xA;&lt;li&gt;the promotional screensaver and the update helpers&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;It snapshots the TV&amp;rsquo;s settings before the first pass, so a restore puts back the values that set actually had. It also replaces Amazon&amp;rsquo;s home screen with a 45 KB launcher of its own that has no internet permission at all.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-a-dns-filter-cant-reach&#34;&gt;What a DNS filter can&amp;rsquo;t reach&lt;/h2&gt;&#xA;&lt;p&gt;A DNS filter only reaches the network side of this. AdGuard answers a blocked domain with an empty address, so a sponsored tile has no picture to load and a tracking call goes nowhere. The launcher that wants to show the tile is still the home screen, the apps nobody installed are still there, and the ACR service still fingerprints the screen, even if it can&amp;rsquo;t report what it saw. Filtering has side effects too. CleanYourTV&amp;rsquo;s notes on the Freebox Player POP, an Android TV box from the French operator Free, record AdGuard DNS blocking &lt;code&gt;pixel.spotify.com&lt;/code&gt;. The Spotify app then decides the network is down, and it stays broken after the filter is lifted until its data is cleared.&lt;/p&gt;&#xA;&lt;h2 id=&#34;my-samsung-and-the-box-plugged-into-it&#34;&gt;My Samsung, and the box plugged into it&lt;/h2&gt;&#xA;&lt;p&gt;None of this helps my TV. It&amp;rsquo;s a Samsung, and dumbtv&amp;rsquo;s table puts Samsung, LG, Roku and the rest on a single line: &amp;ldquo;no shell, no path&amp;rdquo;. Tizen and webOS give an owner nothing like ADB, so the advice that&amp;rsquo;s left is to &amp;ldquo;block it at the router, or boot the TV straight into HDMI&amp;rdquo;. AdGuard already covers the first. The second turned out more interesting than it sounds, because the box at the other end of our HDMI cable is Magyar Telekom&amp;rsquo;s IPTV receiver, the Telekom TV SmartBox. It&amp;rsquo;s an SEI800DT built by SEI Robotics, and it runs Android TV 12 on firmware Telekom last updated in April 2026. Its home screen is Telekom&amp;rsquo;s own, with rows of film premieres, so it&amp;rsquo;s the same kind of device as the Freebox: an operator box whose launcher probably lives in the same packages as the live TV. It&amp;rsquo;s also rented, which means the one device in the room that could be cleaned up belongs to the company that fills its home screen. Nobody has added it to CleanYourTV&amp;rsquo;s catalogue yet.&lt;/p&gt;&#xA;&lt;p&gt;This is territory the EFF has been on for years. Back in 2015 it argued that &lt;a href=&#34;https://www.eff.org/deeplinks/2015/02/big-brother-listening-users-need-ability-teach-smart-tvs-new-lessons&#34;&gt;users need the ability to teach smart TVs new lessons&lt;/a&gt;, and its &lt;a href=&#34;https://www.eff.org/deeplinks/2025/09/opt-out-october-daily-tips-protect-your-privacy-and-security&#34;&gt;Opt Out October&lt;/a&gt; tips still come down to switching off ACR and the advertising ID in the settings, the one fix that works on a Samsung too. It matters more than it sounds: a &lt;a href=&#34;https://arxiv.org/abs/2409.06203&#34;&gt;2024 study&lt;/a&gt; of Samsung and LG sets found ACR fingerprinting the picture even when the TV was only a display for an HDMI source, which in our living room means the Telekom box&amp;rsquo;s output, and that opting out stopped the traffic to the ACR servers.&lt;/p&gt;&#xA;&lt;h2 id=&#34;where-it-goes-wrong&#34;&gt;Where it goes wrong&lt;/h2&gt;&#xA;&lt;p&gt;The tools appeared on 17 and 18 October, and the people using them have already found the edges. TechCrunch &lt;a href=&#34;https://techcrunch.com/2026/10/19/people-are-using-ai-to-make-their-smart-tvs-dumb-again/&#34;&gt;reports&lt;/a&gt; that Claude sometimes refused a request as bare as &amp;ldquo;hack my TV&amp;rdquo;, so people learnt to describe what they wanted instead. One user bricked an Android TV with Claude&amp;rsquo;s help, and another got stuck halfway through a Fire TV. An agent with a shell can switch off a package the TV needs as easily as one it doesn&amp;rsquo;t, so the careful projects build their restraint into the repository. dumbtv takes its snapshot before it changes anything, disables packages rather than uninstalling them, and won&amp;rsquo;t replace the operating system at all, because every current TV has a signed boot chain and &amp;ldquo;pretending otherwise is how people brick their TVs&amp;rdquo;. It also notes that a factory reset undoes everything it did, which on a rented box is the way out I&amp;rsquo;d check first.&lt;/p&gt;&#xA;&lt;h2 id=&#34;wrapping-up&#34;&gt;Wrapping up&lt;/h2&gt;&#xA;&lt;p&gt;We&amp;rsquo;ve put up with this visual pollution for as long as TVs have had home screens, looking past the rows of things to buy on the way to the input we wanted. Switching packages off over ADB has been possible for years. What stopped most owners was the evening it takes to work out which of the dozens of packages on a given model are safe to touch, and that&amp;rsquo;s the part an agent now does in about fifteen minutes. The catalogue in CleanYourTV keeps what a few thousand people learnt doing it, so the next owner of the same set starts from their list. My Samsung stays out of reach. The Telekom box plugged into it may not, and in November I&amp;rsquo;ll find out what&amp;rsquo;s on it.&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>How I Work with AI Agents</title>
      <link>https://blackfyre.ninja/blog/how-i-work-with-ai-agents/</link>
      <pubDate>Tue, 20 Oct 2026 09:00:00 +0200</pubDate>
      <guid>https://blackfyre.ninja/blog/how-i-work-with-ai-agents/</guid>
      <description>How much process I put around AI agents, from OpenSpec to cross-family code review, and why it depends on team size, business needs and code complexity.</description>
      <content:encoded>&lt;p&gt;One morning in October I noticed that the Starship prompt on this site&amp;rsquo;s &lt;a href=&#34;https://blackfyre.ninja/themes/?t=starship&#34;&gt;Themes page&lt;/a&gt; was missing its icons. I told the agent I was working with that the font was probably to blame, and within the hour the fix was live. It came with a cut-down copy of a Nerd Font holding the 75 icons the file uses, a browser test that checks every one of them, and two corrections found by a reviewing model from a different company. One was a CSS rule elsewhere on the site that undid the fix in a hidden mode. The other was the font&amp;rsquo;s licence notice, which only linked to the Apache 2.0 licence where the licence asks for its full text. I didn&amp;rsquo;t read the diff at any point. On this site that is the intended way of working, and on my other projects it isn&amp;rsquo;t.&lt;/p&gt;&#xA;&lt;p&gt;How much process I put around AI agents depends on how many people work on a project, what the business needs from it, and how complex its code really is. On this site I am the only one a mistake affects, so an agent can take a bug report all the way to production while I look at the result on the live site. On the &lt;a href=&#34;https://blackfyre.ninja/blog/the-web-gallery-of-art-is-taking-its-next-shape/&#34;&gt;Web Gallery of Art&lt;/a&gt; and on my work projects, a change is written up as an OpenSpec change before any code exists, and on the bigger ones I read the pull request myself. The rest of this post applies the same rule to smaller questions: where a lesson gets written down, who is allowed to write it, and what I still check.&lt;/p&gt;&#xA;&lt;h2 id=&#34;planning-changes-with-openspec&#34;&gt;Planning changes with OpenSpec&lt;/h2&gt;&#xA;&lt;p&gt;OpenSpec is a small tool that keeps a project&amp;rsquo;s intended behaviour as Markdown files in the repository. Before an agent works on a change, the change gets a proposal saying why it&amp;rsquo;s needed and what it alters, the updates it makes to the specifications, and a list of tasks. The agent works through one task at a time, and the reviewer judges the pull request against those files. On the Web Gallery of Art the instruction to the reviewer is explicit: &amp;ldquo;A preference that no specification supports is not a finding.&amp;rdquo; Review is most of why I use it. An agent can make unrelated changes elsewhere in the codebase while it&amp;rsquo;s at it, and when someone has to inspect the result, every such change is something they didn&amp;rsquo;t ask to review and someone will later have to maintain. With the change written up first, anything outside it stands out.&lt;/p&gt;&#xA;&lt;p&gt;The second reason shows up months later. Every proposal starts with its reason, and when the change merges, archiving it folds the outcome into the project&amp;rsquo;s specifications. The Web Gallery of Art has 45 archived changes since August, so the reason the feedback button no longer jumps up when the cookie notice appears on a desktop screen is still in the repository, written by whoever made the change.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-this-site-uses-instead&#34;&gt;What this site uses instead&lt;/h2&gt;&#xA;&lt;p&gt;This site doesn&amp;rsquo;t use OpenSpec. Its interface is designed in Claude Design, and the design project keeps a changelog in which every entry names the design file it touches. The repository&amp;rsquo;s instructions for agents record the last entry that has been implemented, so the next piece of work is whatever comes after it, and the agent may read the design but never change it. That covers the planning. What keeps a change from spreading is a short set of rules in my own agent instructions, which apply to every project: don&amp;rsquo;t silently expand the task, keep each commit to one coherent change, and stop and ask when the work would need a decision outside the task. On a site with many parts that only I work on, those rules are enough.&lt;/p&gt;&#xA;&lt;h2 id=&#34;where-a-lesson-gets-written-down&#34;&gt;Where a lesson gets written down&lt;/h2&gt;&#xA;&lt;p&gt;A lesson from that work can end up in five places, and each has its own rule for who may write to it.&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Where&lt;/th&gt;&lt;th&gt;What it holds&lt;/th&gt;&lt;th&gt;Who writes it&lt;/th&gt;&lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Architecture decision records (ADRs)&lt;/td&gt;&lt;td&gt;The company&amp;rsquo;s default choices for building software&lt;/td&gt;&lt;td&gt;An agent can propose one; a person confirms it, and a board reviews it before it counts&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;OpenSpec&lt;/td&gt;&lt;td&gt;What a project should do, and why each change was made&lt;/td&gt;&lt;td&gt;Agents draft changes, which are reviewed in the pull request&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Agent instructions (&lt;code&gt;CLAUDE.md&lt;/code&gt;, &lt;code&gt;AGENTS.md&lt;/code&gt;)&lt;/td&gt;&lt;td&gt;How agents work in one repository&lt;/td&gt;&lt;td&gt;Changed when I ask for it&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Memory servers&lt;/td&gt;&lt;td&gt;Lessons and preferences that carry across sessions and tools&lt;/td&gt;&lt;td&gt;Agents, whenever they learn something&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Git history&lt;/td&gt;&lt;td&gt;What happened&lt;/td&gt;&lt;td&gt;Every commit&lt;/td&gt;&lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&lt;p&gt;Which one a lesson goes into is a judgement call that depends on what the lesson is. The line I watch most is the one between the company&amp;rsquo;s decisions and a project&amp;rsquo;s. If a project follows the company&amp;rsquo;s stack and needs a feature the ADRs say nothing about, the decision goes into the ADRs. If the project departs from an existing ADR for business reasons, the departure stays in the project, unless it turns out to be a better default than the one the ADR states, and then it goes back to the ADR. The tiers in the last column are deliberate. A memory is a note for later sessions, so agents write there freely, while an ADR becomes standard practice for the whole company, which is why a board accepts it first. So far I haven&amp;rsquo;t had to delete a memory an agent wrote, and the board hasn&amp;rsquo;t rejected a proposal. That record is still short, so it doesn&amp;rsquo;t prove much yet.&lt;/p&gt;&#xA;&lt;h2 id=&#34;a-reviewer-from-another-model-family&#34;&gt;A reviewer from another model family&lt;/h2&gt;&#xA;&lt;p&gt;Every pull request on this site goes to Codex, OpenAI&amp;rsquo;s coding agent, while the code itself comes from Claude. A comment of &lt;code&gt;@codex review&lt;/code&gt; starts a review, and Codex either leaves findings on the diff or reacts with a thumbs up. The agent fixes each valid finding and asks again until the thumbs up arrives. On the Web Gallery of Art the same principle is in the agent instructions for material or high-risk changes: implementation and final review come from different model families. I have two reasons for it. The plain one is usage, since splitting the work across two services keeps me under each one&amp;rsquo;s limits. The other is that models from the same family learn from much of the same data, so I expect them to share blind spots and to miss the same problem twice, while a model from another family looks at the change differently. I haven&amp;rsquo;t measured that. The Starship fix is the kind of case it&amp;rsquo;s meant for: neither of Codex&amp;rsquo;s findings was a failing test, and one of them wasn&amp;rsquo;t code at all.&lt;/p&gt;&#xA;&lt;p&gt;The loop has a cost. The pull request that made this site tell IndexNow, the protocol Bing and some other search engines use to hear about changed pages, which pages each deploy changed went through about nine review rounds and ten findings, each fixed in its own commit. Better instructions for the reviewer would have cut that down. The Web Gallery of Art gives Codex a section of review guidelines, such as judging only against the specifications and skipping generated output and anything the linters already enforce. This site gives it none.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-i-still-do&#34;&gt;What I still do&lt;/h2&gt;&#xA;&lt;p&gt;What I check follows the same rule as everything else. Where a pull request merges as soon as Codex approves it, as on this site, I check the release, and on the bigger projects without that I read the pull request too. Checking the release only shows what&amp;rsquo;s visible. I found the missing icons by looking at the live page, but I would never have spotted the incomplete licence notice that way, or the problem in IndexNow&amp;rsquo;s run queue that the same review loop caught in a GitHub Actions job nobody watches.&lt;/p&gt;&#xA;&lt;p&gt;Some work doesn&amp;rsquo;t go to an agent at all: the direction of a design, the writing on this blog, conversations with clients, estimates, the decision to start a project, and setting a new one up. I keep the last because I enjoy that part. So far I haven&amp;rsquo;t had to take anything back from an agent.&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>An Inkjet Printer I Can Finally Recommend</title>
      <link>https://blackfyre.ninja/blog/an-inkjet-printer-i-can-finally-recommend/</link>
      <pubDate>Mon, 19 Oct 2026 09:00:00 +0200</pubDate>
      <guid>https://blackfyre.ninja/blog/an-inkjet-printer-i-can-finally-recommend/</guid>
      <description>OpenPrinter, an open hardware inkjet with refillable, DRM-free cartridges and roll paper, is the first inkjet I&#39;d recommend after 25 years of laser printers.</description>
      <content:encoded>&lt;p&gt;Every printer I&amp;rsquo;ve owned for the past twenty-five years has been a laser. Each time I shopped for a new one I also looked at inkjets, at what their cartridges cost and whether they could be refilled, and each time the answer sent me back to toner. &lt;a href=&#34;https://www.crowdsupply.com/open-tools/openprinter&#34;&gt;OpenPrinter&lt;/a&gt;, an open hardware inkjet from Open Tools in Paris that is about to launch on Crowd Supply, is the first one I&amp;rsquo;d recommend to someone who prints in colour. I don&amp;rsquo;t know the team and get nothing from this post; I just want it to exist.&lt;/p&gt;&#xA;&lt;p&gt;Cartridge prices weren&amp;rsquo;t my only reason. I print when I have to and rarely more, and an inkjet cartridge left alone for a couple of months tends to clog, while a toner cartridge sits in my printer for years and still prints. OpenPrinter doesn&amp;rsquo;t change that, so I&amp;rsquo;ll stay with laser for my own documents, but when someone tells me they need an inkjet, this is the one I&amp;rsquo;ll point them to.&lt;/p&gt;&#xA;&#xA;&lt;figure&gt;&lt;a href=&#34;https://www.youtube.com/watch?v=wSV5XT4sl2A&#34;&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/an-inkjet-printer-i-can-finally-recommend/teaser_hu_a07488d65eb11aab.webp&#34; alt=&#34;The OpenPrinter teaser from Open Tools&#34; width=&#34;1280&#34; height=&#34;720&#34;&gt;&lt;/a&gt;&lt;figcaption&gt;FIG. 1 · The OpenPrinter teaser from Open Tools (&lt;a href=&#34;https://www.youtube.com/watch?v=wSV5XT4sl2A&#34;&gt;watch on YouTube&lt;/a&gt;)&lt;/figcaption&gt;&lt;/figure&gt;&#xA;&#xA;&lt;h2 id=&#34;what-it-does-differently&#34;&gt;What it does differently&lt;/h2&gt;&#xA;&lt;p&gt;OpenPrinter takes the standard HP 63 cartridge in the US and the HP 302 in Europe, black, colour or both, and you can refill them; nothing in the printer checks whose ink is inside. It prints through CUPS, the printing system macOS and most Linux distributions use, and the campaign lists Windows, Android and iPhone alongside them, so there&amp;rsquo;s no proprietary driver that can stop being updated. Inside are a Raspberry Pi Zero W and an STM32 board for the cartridges, with a small screen and a jog wheel on the outside, and at 50 by 10 by 11 centimetres it&amp;rsquo;s small enough to keep on a shelf. Open Tools says it &amp;ldquo;can be assembled, customized, and repaired to extend its life&amp;rdquo;, and publishes the electronics, the mechanical design, the firmware and the bill of materials, so a broken part is something you can look up and replace.&lt;/p&gt;&#xA;&lt;h2 id=&#34;sheets-and-rolls&#34;&gt;Sheets and rolls&lt;/h2&gt;&#xA;&lt;p&gt;It prints on ordinary sheets up to A3 in Europe or tabloid in the US, and on roll paper 297 mm or 11 inches wide, which a built-in cutter cuts to length. The campaign mentions banners and strips. My own use would be smaller: my kids like a colouring roll now and then, a colouring page printed on one long sheet, and I&amp;rsquo;d happily build an OpenPrinter for that alone. Long prints also open up small creative and business work, since what you print on it is yours to sell.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-licence-and-the-launch&#34;&gt;The licence and the launch&lt;/h2&gt;&#xA;&lt;p&gt;Everything Open Tools publishes is under Creative Commons BY-NC-SA 4.0. You may study, modify and share the design as long as you credit Open Tools, share your changes under the same licence and don&amp;rsquo;t use it commercially. The non-commercial condition is why it isn&amp;rsquo;t open source in the strict sense, and it means building OpenPrinters from the published files to sell needs Open Tools&amp;rsquo; permission. For anyone who wants one printer they can own, repair and refill, it changes nothing.&lt;/p&gt;&#xA;&lt;p&gt;The campaign hasn&amp;rsquo;t launched yet, and there&amp;rsquo;s no price or shipping date so far. The &lt;a href=&#34;https://www.crowdsupply.com/open-tools/openprinter&#34;&gt;campaign page&lt;/a&gt; lets you sign up to hear when it goes live. If you print in colour, that&amp;rsquo;s where I&amp;rsquo;d start.&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>How the Web Gallery of Art Serves Markdown to LLMs</title>
      <link>https://blackfyre.ninja/blog/how-the-web-gallery-of-art-serves-markdown-to-llms/</link>
      <pubDate>Fri, 09 Oct 2026 15:52:57 +0200</pubDate>
      <guid>https://blackfyre.ninja/blog/how-the-web-gallery-of-art-serves-markdown-to-llms/</guid>
      <description>How the Web Gallery of Art gives language models a plain Markdown version of every record: llms.txt, Accept negotiation, strict limits and edge caching.</description>
      <content:encoded>&lt;p&gt;A fair share of the traffic on the &lt;a href=&#34;https://blackfyre.ninja/blog/why-the-web-gallery-of-art-runs-on-pocketbase-htmx-and-vanilla-javascript/&#34;&gt;Web Gallery of Art&lt;/a&gt; (WGA) isn&amp;rsquo;t people. Some of it is crawlers, and a growing part is language models fetching pages on someone&amp;rsquo;s behalf. They get the same HTML a visitor gets, navigation, scripts and a session cookie they&amp;rsquo;ll never use included, and every one of those requests costs the server the same work as a real visit. So I gave them a door of their own: a plain Markdown version of every artist and artwork, generated once a night and cheap enough to serve from a cache.&lt;/p&gt;&#xA;&lt;h2 id=&#34;why-not-let-them-read-the-page&#34;&gt;Why not let them read the page&lt;/h2&gt;&#xA;&lt;p&gt;For an agent, most of a page is packaging. What it wants from an artwork is a title, a few facts and a paragraph of commentary, wrapped in everything a browser needs to show them. The packaging also costs the most to hand out. Every artist and artwork page is built on request, and because public pages take part in a visitor&amp;rsquo;s itinerary session (the route a visitor can plan through the collection), the response can carry a cookie, so it can&amp;rsquo;t safely be served to someone else from a cache.&lt;/p&gt;&#xA;&lt;p&gt;WGA sits behind Cloudflare, and Cloudflare offers to solve exactly this: its Markdown for Agents feature converts HTML to Markdown at the edge. It&amp;rsquo;s only on the paid plans, though, and I wasn&amp;rsquo;t going to upgrade for one feature. Converting at request time would still start from the page it converts. Publishing the Markdown myself, from the catalogue data instead of the HTML, means the free plan can cache it like any other file.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-an-agent-gets&#34;&gt;What an agent gets&lt;/h2&gt;&#xA;&lt;p&gt;Here&amp;rsquo;s the document for Jean-Joseph-Xavier Bidauld&amp;rsquo;s &lt;em&gt;View of the Waterfalls at Tivoli&lt;/em&gt;, as the beta site serves it, with the list of related works shortened:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;/agents/artworks/r1a269997dadeec.md&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-markdown&#34;&gt;# View of the Waterfalls at Tivoli&#xA;&#xA;[View the canonical artwork record](&amp;lt;https://beta.wga.hu/artists/bidauld-jean-joseph-xavier-r46d21a0de50786/view-of-the-waterfalls-at-tivoli-r1a269997dadeec&amp;gt;)&#xA;&#xA;## Artwork&#xA;&#xA;- Artist: [BIDAULD, Jean-Joseph-Xavier](&amp;lt;https://beta.wga.hu/artists/bidauld-jean-joseph-xavier-r46d21a0de50786&amp;gt;)&#xA;- Date: 1751-1800&#xA;- Technique: Oil on paper on canvas, 51 x 38 cm&#xA;&#xA;## Commentary&#xA;&#xA;This painting is a typical example of the many studies, painted in oils on paper, that Bidauld executed in the open air on his extensive trips through the countryside during his Italian sojourn from 1785 through 1790. They are not sketches but pictures finished in the studio.&#xA;&#xA;## Related artworks&#xA;&#xA;- [Italianate Landscape](&amp;lt;https://beta.wga.hu/artists/bidauld-jean-joseph-xavier-r46d21a0de50786/italianate-landscape-rff080d33475a9a&amp;gt;)&#xA;- [View of the Ponte Rocco, Tivoli \(detail\)](&amp;lt;https://beta.wga.hu/artists/bidauld-jean-joseph-xavier-r46d21a0de50786/view-of-the-ponte-rocco-tivoli-detail-r466bcf04593f13&amp;gt;)&#xA;- …&#xA;&#xA;## Attribution&#xA;&#xA;[Web Gallery of Art](&amp;lt;https://beta.wga.hu/pages/about&amp;gt;)&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;It has the record and nothing else: a link back to the canonical page, the facts as a list, the commentary as prose, up to twelve related works by the same artist, and an attribution line. Every link is an absolute canonical URL. The angle brackets around each URL keep parentheses in it from ending the link early, and the backslashes in &lt;code&gt;\(detail\)&lt;/code&gt; do the same job for titles.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-agents-find-it&#34;&gt;How agents find it&lt;/h2&gt;&#xA;&lt;p&gt;Agents that read instructions get &lt;code&gt;/llms.txt&lt;/code&gt;, a short Markdown file at the root of the site. It says what the collection is, that the canonical site is authoritative, and how to turn a page URL into a Markdown one: take the ID after the last hyphen and put it into &lt;code&gt;/agents/artworks/{id}.md&lt;/code&gt; or &lt;code&gt;/agents/artists/{id}.md&lt;/code&gt;. It links the sitemap for discovering records and the about page for terms of use. Every HTML page points to it, with &lt;code&gt;rel=&amp;quot;describedby&amp;quot;&lt;/code&gt; both in the response headers and in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;, and the footer links to it as well.&lt;/p&gt;&#xA;&lt;p&gt;Each artist and artwork page also names its own Markdown version, in a &lt;code&gt;Link&lt;/code&gt; header and in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-http&#34;&gt;Link: &amp;lt;/llms.txt&amp;gt;; rel=&amp;#34;describedby&amp;#34;; type=&amp;#34;text/markdown&amp;#34;&#xA;Link: &amp;lt;https://beta.wga.hu/agents/artworks/r1a269997dadeec.md&amp;gt;; rel=&amp;#34;alternate&amp;#34;; type=&amp;#34;text/markdown&amp;#34;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;asking-for-markdown&#34;&gt;Asking for Markdown&lt;/h2&gt;&#xA;&lt;p&gt;An agent that reads nothing can still ask. HTTP has let a client say which formats it prefers for much longer than anyone has wanted a page for a language model: the &lt;code&gt;Accept&lt;/code&gt; header, with optional quality values. When a request for an artist or artwork page prefers &lt;code&gt;text/markdown&lt;/code&gt;, WGA answers with a temporary redirect to the generated file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-http&#34;&gt;GET /artists/bidauld-jean-joseph-xavier-r46d21a0de50786/view-of-the-waterfalls-at-tivoli-r1a269997dadeec&#xA;Accept: text/markdown&#xA;&#xA;HTTP/2 307&#xA;Location: /agents/artworks/r1a269997dadeec.md&#xA;Vary: Accept&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&amp;ldquo;Prefers&amp;rdquo; matters there. Browsers send something like &lt;code&gt;text/html,…,*/*;q=0.8&lt;/code&gt;, and that wildcard matches Markdown as well, at a lower quality, so a naive check would send every visitor to a text file. WGA takes the best match for each type and lets Markdown win only when its quality is higher, or equal and Markdown was named explicitly:&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;code&gt;Accept&lt;/code&gt;&lt;/th&gt;&lt;th&gt;Result&lt;/th&gt;&lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;text/html,application/xhtml+xml,…,*/*;q=0.8&lt;/code&gt; (a browser)&lt;/td&gt;&lt;td&gt;the page&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;*/*&lt;/code&gt;&lt;/td&gt;&lt;td&gt;the page&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;text/markdown&lt;/code&gt;&lt;/td&gt;&lt;td&gt;307 to the Markdown&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;text/markdown, text/html&lt;/code&gt;&lt;/td&gt;&lt;td&gt;307 to the Markdown&lt;/td&gt;&lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&lt;p&gt;&lt;code&gt;Vary: Accept&lt;/code&gt; tells Cloudflare, and any other cache, that the same URL has two answers.&lt;/p&gt;&#xA;&lt;p&gt;The check runs before the session and page middleware. It reads the generated files, not the database, and redirects only when there&amp;rsquo;s a file for the record and the requested URL is one of that record&amp;rsquo;s published addresses. Anything else, such as an old alias or an unpublished record, falls through to the normal handler and gets its usual answer. A successful redirect costs only a file lookup, and the page is never built.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-it-deliberately-leaves-out&#34;&gt;What it deliberately leaves out&lt;/h2&gt;&#xA;&lt;p&gt;Making a catalogue easy for a model to read also makes it easy to copy, so the Markdown is limited on purpose. There&amp;rsquo;s no &lt;code&gt;llms-full.txt&lt;/code&gt; with the whole collection in one file. It would be the most convenient thing to give an agent, an even more convenient thing to give a scraper, and a large file to regenerate every night. &lt;code&gt;llms.txt&lt;/code&gt; says as much, and adds that the reproductions may carry rights belonging to the institutions holding the works, so their availability shouldn&amp;rsquo;t be read as a licence to reuse them.&lt;/p&gt;&#xA;&lt;p&gt;Each document is built from a projection of the public record. The Go types the renderer accepts have fields for a title, the facts, the commentary, the links and the attribution, and nothing else: no session or itinerary state, no administrative fields, nothing from the database&amp;rsquo;s own bookkeeping. Private data can&amp;rsquo;t reach a file even by mistake, because there&amp;rsquo;s nowhere to put it.&lt;/p&gt;&#xA;&lt;p&gt;Everything in a document is bounded. Titles are cut at 300 characters, each fact at 500, the commentary at 4,000 and URLs at 2,048, and the related works stop at twelve. Every link has to be an absolute URL with no query string, fragment or credentials. Links to other records have to stay on the site&amp;rsquo;s own host, and anything pointing at the admin interface or the API is refused. Markdown&amp;rsquo;s own punctuation in the catalogue text is escaped, so a title with brackets in it stays a title. Records without a name or title, and artworks without a published artist, are skipped; anything else that breaks a rule stops the whole run, and the previous set of files stays live.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-it-stays-cheap&#34;&gt;How it stays cheap&lt;/h2&gt;&#xA;&lt;p&gt;The files come from the same job that builds the sitemap, every night and once when the application starts. The job writes a complete set into a staging directory and checks it: exactly the files it expected, none of them empty, no symlinks. Only then does it switch the single marker that says which set is current, and remove the old ones. Readers always go through that marker, so an agent sees last night&amp;rsquo;s files or tonight&amp;rsquo;s, never a mixture, and a run that fails part-way leaves the previous set in place.&lt;/p&gt;&#xA;&lt;p&gt;Serving a file means reading it from disk, with no database query on the way, so a request for a record that doesn&amp;rsquo;t exist gets a 404 without the database noticing. A successful response looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-http&#34;&gt;HTTP/2 200&#xA;Content-Type: text/markdown; charset=utf-8&#xA;Cache-Control: public, no-cache, must-revalidate&#xA;Link: &amp;lt;https://beta.wga.hu/artists/bidauld-jean-joseph-xavier-r46d21a0de50786/view-of-the-waterfalls-at-tivoli-r1a269997dadeec&amp;gt;; rel=&amp;#34;canonical&amp;#34;&#xA;ETag: &amp;#34;e05a91ebfa132ab782fd5f2848654271667c1d1f1186718d15ca86155e128fe7&amp;#34;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;There&amp;rsquo;s no cookie, and the canonical &lt;code&gt;Link&lt;/code&gt; points back to the HTML page. &lt;code&gt;no-cache&lt;/code&gt; lets Cloudflare keep a copy, as long as it checks with WGA before using it. The ETag is a SHA-256 of the file, so that check gets an empty &lt;code&gt;304 Not Modified&lt;/code&gt; until a night&amp;rsquo;s run actually changes the content.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Diagram, drawn in the post: &lt;a href=&#34;https://blackfyre.ninja/blog/how-the-web-gallery-of-art-serves-markdown-to-llms/&#34;&gt;request path&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Requests under &lt;code&gt;/agents/&lt;/code&gt; go through the same per-client rate limits as the artist and artwork pages, at Cloudflare and again in the application, so cache misses on the Markdown files don&amp;rsquo;t get around them.&lt;/p&gt;&#xA;&lt;h2 id=&#34;wrapping-up&#34;&gt;Wrapping up&lt;/h2&gt;&#xA;&lt;p&gt;Nothing changes for people. A browser never prefers Markdown, so it gets the page as before, plus two headers it ignores. An agent that reads &lt;code&gt;llms.txt&lt;/code&gt; or sends the right &lt;code&gt;Accept&lt;/code&gt; header gets the same record in about 2 KB instead of 72 KB of HTML (before scripts and images), usually from Cloudflare&amp;rsquo;s copy. Agents that do neither still get the page, through the same rate limits as everyone else.&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>Why the Web Gallery of Art Runs on PocketBase, HTMX and Vanilla JavaScript</title>
      <link>https://blackfyre.ninja/blog/why-the-web-gallery-of-art-runs-on-pocketbase-htmx-and-vanilla-javascript/</link>
      <pubDate>Thu, 08 Oct 2026 11:32:13 +0200</pubDate>
      <guid>https://blackfyre.ninja/blog/why-the-web-gallery-of-art-runs-on-pocketbase-htmx-and-vanilla-javascript/</guid>
      <description>What the rebuilt Web Gallery of Art runs on (Go, PocketBase, SQLite, templ and htmx), and how a read-heavy catalogue ended up with such a small stack.</description>
      <content:encoded>&lt;p&gt;When you modernise a thirty-year-old website, you&amp;rsquo;re allowed to replace almost everything. That&amp;rsquo;s also the quickest way to turn a working cultural resource into an expensive technology demo, so when I started &lt;a href=&#34;https://blackfyre.ninja/blog/the-web-gallery-of-art-is-taking-its-next-shape/&#34;&gt;rebuilding the Web Gallery of Art&lt;/a&gt;, I began with what the site actually does and let that decide what it runs on. It ended up on Go, &lt;a href=&#34;https://pocketbase.io/&#34;&gt;PocketBase&lt;/a&gt; with &lt;a href=&#34;https://www.sqlite.org/&#34;&gt;SQLite&lt;/a&gt;, &lt;a href=&#34;https://templ.guide/&#34;&gt;templ&lt;/a&gt;, &lt;a href=&#34;https://htmx.org/&#34;&gt;htmx&lt;/a&gt; and a modest amount of plain JavaScript.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-the-site-actually-does&#34;&gt;What the site actually does&lt;/h2&gt;&#xA;&lt;p&gt;The Web Gallery of Art (WGA) is a catalogue, and almost all of its traffic is reading. There are roughly 60,000 artwork images, each with three thumbnail sizes; the archive was about 12 GB when I started and has grown a little as I&amp;rsquo;ve added optimised variants. The site gets around 723,000 requests a day, which is a fair amount, but the requests are simple: people browse, search, open artist and artwork pages, and move between collections. Nobody is doing thousands of concurrent writes. The study board and the itinerary creator are properly interactive, but they&amp;rsquo;re a small corner of the site.&lt;/p&gt;&#xA;&lt;p&gt;So there&amp;rsquo;s no need for high write throughput, real-time collaboration, state spread across regions, heavy client-side state, or horizontal scaling from day one. What the site does need is to be cheap to run, readable by search engines and screen readers, understandable to a future maintainer, and free of more infrastructure and dependencies than it uses. None of that calls for React or Next.js, a separate frontend talking to a separate backend, or a Kubernetes cluster quietly contemplating its own importance. I left them out because they didn&amp;rsquo;t fit what the gallery does.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-the-pieces-fit&#34;&gt;How the pieces fit&lt;/h2&gt;&#xA;&lt;p&gt;The browser talks to one application. PocketBase is the foundation and the database layer, on SQLite; Go code built on top of it serves the public site, runs the background jobs and holds everything specific to WGA; the image files sit in object storage. There&amp;rsquo;s nothing else the application needs in order to run. A request goes from the browser to Go and PocketBase, and from there to SQLite or the images, which means a new maintainer can follow it without drawing seven coloured boxes and a message queue first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Diagram, drawn in the post: &lt;a href=&#34;https://blackfyre.ninja/blog/why-the-web-gallery-of-art-runs-on-pocketbase-htmx-and-vanilla-javascript/&#34;&gt;the whole stack&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;why-theres-no-spa&#34;&gt;Why there&amp;rsquo;s no SPA&lt;/h2&gt;&#xA;&lt;p&gt;Most of what visitors do is follow links. The server returns a page and the browser shows it, and browsers have had a few decades to get good at exactly that. Turning WGA into a single-page application would move page building and routing into the browser without fixing anything for most of the site. The study board and dual-pane browsing, which shows two parts of the collection side by side, do behave more like applications, but plain JavaScript handles them, so the rest of the site can stay server-rendered.&lt;/p&gt;&#xA;&lt;p&gt;And because the server returns HTML, rather than JSON for a client app to turn back into HTML, a lot of the usual frontend work simply isn&amp;rsquo;t there. Bots can read the pages, screen readers can navigate them, people can bookmark them and links behave like links. Deep links work because every page is a real URL; there&amp;rsquo;s no client-side router recreating them.&lt;/p&gt;&#xA;&lt;h2 id=&#34;server-rendered-html-with-templ&#34;&gt;Server-rendered HTML with templ&lt;/h2&gt;&#xA;&lt;p&gt;Pages are rendered with templ, which gives Go typed HTML templates (whoever named a templating system &lt;code&gt;templ&lt;/code&gt; was presumably amused). Layouts, pages, fragments and components are reused throughout, and a full page and the fragment that updates part of one come from the same components. That covers most of what people like about frontend component frameworks, such as reuse, composition and consistent structure, except the components run on the server. There&amp;rsquo;s no hydration step and no virtual DOM rebuilding a page the server already rendered. The browser gets a document and does its ancient, apparently unfashionable job of displaying it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;htmx-and-plain-javascript&#34;&gt;htmx and plain JavaScript&lt;/h2&gt;&#xA;&lt;p&gt;Server rendering doesn&amp;rsquo;t mean a full reload for every click. htmx is a small library that lets an ordinary link or form fetch one of those fragments and swap it into the page, and WGA uses it where that&amp;rsquo;s noticeably nicer: pagination, search, filters, forms, detail views and navigation. That&amp;rsquo;s enough for the site to feel current without the browser becoming a second runtime that re-implements the server.&lt;/p&gt;&#xA;&lt;p&gt;It also means WGA mostly works without JavaScript. Switch it off and nearly everything still works. The exceptions are the genuinely client-side features, the study board and image magnification. JavaScript adds theme switching, bionic reading and smoother transitions on top, but the catalogue is still a website underneath, which is progressive enhancement in a (sadly) unusually literal sense.&lt;/p&gt;&#xA;&lt;p&gt;With htmx doing the talking to the server, very little client-side logic is left, which makes a frontend framework hard to justify. Frameworks come with dependencies, conventions, build tooling and upgrades, and you start paying for those straight away, whether or not you use what they offer. WGA uses TypeScript for type safety and ships ordinary browser JavaScript. TypeScript is about 9.9% of the repository, test suite included. The browser receives roughly 655 KB of JavaScript in total, and more than half of that is dependencies like htmx, &lt;a href=&#34;https://fengyuanchen.github.io/viewerjs/&#34;&gt;Viewer.js&lt;/a&gt; and &lt;a href=&#34;https://trix-editor.org/&#34;&gt;Trix&lt;/a&gt;. For a site with this many features I can live with that, and it&amp;rsquo;s less than a lot of frameworks weigh before you&amp;rsquo;ve written a line of your own.&lt;/p&gt;&#xA;&lt;p&gt;Will the plain JavaScript turn into a framework of its own eventually? Probably, at least a little. Write reusable code for long enough and someone will accuse you of inventing a framework. I try to keep the helpers small, obvious and documented. Web Components aren&amp;rsquo;t used much yet, but they&amp;rsquo;re available if something needs a firmer boundary. Dual-pane browsing is a likely candidate, since it&amp;rsquo;s desktop-only, outside the main SEO path, and interactive enough to deserve its own custom element, which the browser provides without installing anything.&lt;/p&gt;&#xA;&lt;h2 id=&#34;html-that-means-something&#34;&gt;HTML that means something&lt;/h2&gt;&#xA;&lt;p&gt;Being readable by search engines and screen readers was as much a reason for server rendering as anything above. The old WGA comes from a time when markup mostly described what things looked like. The rebuild uses elements for what they are (navigation, articles, figures, headings, forms) and adds Schema.org metadata for machine-readable context. Screen readers and search engines benefit, and so do the automated systems that increasingly read the web. Whatever those systems become, clearly labelled content beats making them guess what a pile of anonymous &lt;code&gt;div&lt;/code&gt;s was supposed to mean.&lt;/p&gt;&#xA;&lt;h2 id=&#34;pocketbase&#34;&gt;PocketBase&lt;/h2&gt;&#xA;&lt;p&gt;I&amp;rsquo;ll admit I like PocketBase. Its minimalism appeals to me, and I&amp;rsquo;d been waiting for a serious project to use it on. That isn&amp;rsquo;t a reason to put it into production, so it&amp;rsquo;s just as well there were practical ones.&lt;/p&gt;&#xA;&lt;p&gt;It gives a self-contained deployment most of what I&amp;rsquo;d otherwise have assembled myself: database access and SQLite management, migrations, an admin interface, APIs, file handling, authentication if WGA ever needs it, and the web server and runtime. The admin interface mattered most. Go still has nothing like the admin panels Django, Laravel or Rails developers take for granted, and I&amp;rsquo;d rather not spend part of my life writing yet another CRUD interface.&lt;/p&gt;&#xA;&lt;p&gt;In WGA, PocketBase is the application framework itself, with nothing in front of it. Nearly all of the public pages and interactions are PocketBase extensions written in Go, and so are the scheduled jobs: generating the sitemap, sending &lt;a href=&#34;https://blackfyre.ninja/blog/using-the-native-dialog-with-htmx/&#34;&gt;postcards&lt;/a&gt;, cleaning up the database and other maintenance. PocketBase provides the base, and the application owns its own routes and behaviour.&lt;/p&gt;&#xA;&lt;h2 id=&#34;sqlite-and-what-it-costs&#34;&gt;SQLite, and what it costs&lt;/h2&gt;&#xA;&lt;p&gt;Developers get oddly emotional about SQLite. For WGA the reasoning is dull: reads dominate, and nothing needs distributed writes, sharding, or several nodes writing to the same relational state. PocketBase makes strong performance claims for its SQLite setup, and WGA is a good real-world, read-heavy test of them. That&amp;rsquo;s also why &lt;a href=&#34;https://opentelemetry.io/&#34;&gt;OpenTelemetry&lt;/a&gt; tracing went in early. If the database turns out to be the problem, I want to see it in the traces, and I want to have ruled out the application&amp;rsquo;s own inefficiencies before blaming SQLite. If it does come to that, there are PostgreSQL-compatible PocketBase forks to look at.&lt;/p&gt;&#xA;&lt;p&gt;There are real trade-offs: no sharding, no conventional redundancy, and scaling out isn&amp;rsquo;t an easy fix for slow code. I don&amp;rsquo;t mind that last one. If the application wastes work, it should stop wasting it instead of spreading the waste across more machines. When a visitor gives up on a request, for example, the work for it should stop, rather than carry on because another instance could, in theory, soak up the cost. Whether all this holds up as traffic grows is something the measurements will show.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-data-was-the-hard-part&#34;&gt;The data was the hard part&lt;/h2&gt;&#xA;&lt;p&gt;Choosing the stack was easy compared with migrating the content. The dataset grew over three decades with very few enforced conventions, and normalising it took several attempts, a lot of manual work and an impressive collection of exceptions. Before LLM-assisted development was practical, a lot of it looked like it would need costly manual processing. LLMs did change that, mostly without touching the data: they helped me write the deterministic parser that does the processing. The migration is still plain, reproducible code, and the same source material always gives the same output, which is what you want with cultural and historical data. Models touch the dataset in one place only, to fill accessibility gaps. A screen reader needs a description of every image, and with more than 52,000 artworks and nobody available to write them all by hand, a model writes those descriptions in a separate step that keeps its output apart from the curators&amp;rsquo; text.&lt;/p&gt;&#xA;&lt;p&gt;Some things shouldn&amp;rsquo;t be normalised away. Modern software assumes people have a first and a last name; history never got that schema. Albrecht Dürer fits it reasonably well, Leonardo da Vinci doesn&amp;rsquo;t, because &amp;ldquo;da Vinci&amp;rdquo; isn&amp;rsquo;t a surname, it says he was from &lt;a href=&#34;https://en.wikipedia.org/wiki/Vinci,_Tuscany&#34;&gt;Vinci&lt;/a&gt;. Squeezing historical names into modern structures makes the data tidier and less correct. So WGA normalises where it can and keeps room for the irregular cases, and uncertain dates keep their &lt;code&gt;ca.&lt;/code&gt; or &lt;code&gt;~&lt;/code&gt; instead of pretending the database removed the uncertainty.&lt;/p&gt;&#xA;&lt;p&gt;Very little is machine-derived so far. Colour palettes are extracted from the images and kept out of the normal editorial admin, and anything expensive to compute is done ahead of time, never during a request. I&amp;rsquo;ve thought about tonal or semantic analysis with language or vision models, but I&amp;rsquo;m wary. WGA has paintings, sculpture, architecture and more, and a model trained around ordinary images won&amp;rsquo;t necessarily say anything useful about all of them.&lt;/p&gt;&#xA;&lt;h2 id=&#34;running-it&#34;&gt;Running it&lt;/h2&gt;&#xA;&lt;p&gt;The images aren&amp;rsquo;t in SQLite. That shouldn&amp;rsquo;t need saying, but put enough developers near a keyboard and anything becomes a debate. Sixty thousand originals plus thumbnails would make the database enormous, and bundling them with the application would make every deploy heavy and tie storage to it. PocketBase keeps them in the S3-compatible object storage of &lt;a href=&#34;https://railway.com/&#34;&gt;Railway&lt;/a&gt;, the platform the application is hosted on: the application holds the catalogue and which file belongs to which record, and the storage holds the files.&lt;/p&gt;&#xA;&lt;p&gt;Deploying used to be a batch job a few times a year, partly because pushing large amounts of material over SSH took a long time, and copying gigabytes is still copying gigabytes even with &lt;a href=&#34;https://rclone.org/&#34;&gt;rclone&lt;/a&gt;. The new application deploys on Railway whenever something lands on &lt;code&gt;main&lt;/code&gt;. That&amp;rsquo;ll get more controlled before the first production release, but deployments are already reproducible, which is the part that matters. The original site still runs on &lt;a href=&#34;https://www.lighttpd.net/&#34;&gt;Lighttpd&lt;/a&gt;, on servers run by the KFKI Research Institute for Particle and Nuclear Physics. Railway fits the project now with a reasonable amount of effort, but I don&amp;rsquo;t expect it to host WGA for decades, so the application shouldn&amp;rsquo;t depend on it more than it has to. PocketBase backs up daily to S3-compatible storage, and schema changes go through its migrations. I only move the schema forward and don&amp;rsquo;t maintain reversible migration chains; if data ever needs restoring, that&amp;rsquo;s what the backups are for.&lt;/p&gt;&#xA;&lt;p&gt;Predicting the running cost is difficult, because the architecture is so different from the old one and so much of the current traffic is bots. My rough target is about €10 per 5,000 daily active users under realistic conditions; at today&amp;rsquo;s traffic, bots included, I expect €50 to €100 a month. Cost matters because WGA isn&amp;rsquo;t a commercial product and I&amp;rsquo;d rather not put ads in front of visitors. A small stack saves more than money, too. Every extra service is another thing that can fail, another upgrade, another account and credential, more documentation and more to understand, and in my experience the expensive parts and the fragile parts tend to be the same ones.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://sentry.io/for/open-source/&#34;&gt;Sentry&lt;/a&gt; sponsors the project through its open-source programme, and it has already caught bugs during development that would have been hard to reproduce and might have gone unnoticed for a long time. OpenTelemetry covers the application side. That&amp;rsquo;s enough to see where time goes, which requests are expensive, and whether a failure came from my code, the storage, rendering or something else, without building an observability department for an art gallery.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-alternatives-i-didnt-pick&#34;&gt;The alternatives I didn&amp;rsquo;t pick&lt;/h2&gt;&#xA;&lt;p&gt;React or Next.js would have meant two applications to serve one website: a backend that fetches and prepares data, and a frontend that asks for it across a boundary and builds the pages again, each with its own build system, dependencies and upgrades. Even in one container, that boundary would still be there. It&amp;rsquo;s a good design for plenty of systems, just not this one.&lt;/p&gt;&#xA;&lt;p&gt;SvelteKit was the tempting one, because I actually like Svelte. But a framework I enjoy would still move the complexity around without making WGA any simpler. What mattered was whether the project needed a frontend framework at all, and so far it hasn&amp;rsquo;t.&lt;/p&gt;&#xA;&lt;p&gt;PostgreSQL would replace something that works with something that has a better reputation for scaling, which isn&amp;rsquo;t a good enough reason.&lt;/p&gt;&#xA;&lt;p&gt;A traditional CMS would duplicate most of what PocketBase already does, with another big system to maintain.&lt;/p&gt;&#xA;&lt;p&gt;Static HTML was genuinely attractive. The original WGA proved for thirty years how long static content can last, and it&amp;rsquo;s very cheap to serve. The problem is the study boards, itineraries and dual-pane browsing: doing those properly on top of generated pages would take a lot of client-side code and rewriting, until you had a static site with an application bolted awkwardly on top. Server-rendered HTML keeps most of the advantages of static pages and still has a runtime where it&amp;rsquo;s useful, and with some caching most of the cost goes away, without rebuilding the whole site to fix a comma.&lt;/p&gt;&#xA;&lt;p&gt;Microservices aren&amp;rsquo;t justified by anything in WGA&amp;rsquo;s current size. PocketBase already separates the admin side from the public side, and the code is organised by area, so pieces could be split out later if they ever need to be. I&amp;rsquo;d be delighted if the gallery outgrew PocketBase one day, but I doubt it will.&lt;/p&gt;&#xA;&lt;h2 id=&#34;keeping-it-maintainable&#34;&gt;Keeping it maintainable&lt;/h2&gt;&#xA;&lt;p&gt;For me, &amp;ldquo;boring technology&amp;rdquo; means proven, stable and capable; age has nothing to do with it. htmx is young next to the web itself, and PocketBase is still changing. What I care about is whether a tool reduces what you need to understand or just moves the complexity somewhere more fashionable. Dependencies cost more than hosting does: upgrades, breaking changes, tooling, specialist knowledge, abandoned packages, build systems, friction for contributors, and the bus factor. WGA is mostly a one-person project on the technical side, so that matters even more. Contributions are always welcome, and Go is already enough of a hurdle for some people; there&amp;rsquo;s no need to add five more ecosystems before anyone can change a button.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve always written code on the assumption that the next developer is a crazy person with a hatchet who knows my address. It does wonders for readability: ordinary solutions over clever ones, established conventions, visible boundaries, documentation and predictable behaviour.&lt;/p&gt;&#xA;&lt;p&gt;Nobody knows whether anyone will want to rebuild WGA in 2056. The way people find and read information is changing enough right now that betting on another thirty years of ordinary web browsing would be brave. What I want is to keep WGA useful for as long as possible and make sure its software isn&amp;rsquo;t what eventually kills it, without freezing today&amp;rsquo;s web until 2056. If a Go compiler still exists in twenty years and the dependencies can still be found, it should still build. And I plan to keep maintaining it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-its-going&#34;&gt;How it&amp;rsquo;s going&lt;/h2&gt;&#xA;&lt;p&gt;The choice I&amp;rsquo;m most sure about is htmx plus plain JavaScript. Frontend bloat had become the part of modern web development I found hardest to defend, and dropping most of it has been a relief, without the site losing its interactive features.&lt;/p&gt;&#xA;&lt;p&gt;The main friction came from PocketBase itself. A big architectural change around version 0.20 meant extra work. That wasn&amp;rsquo;t a surprise, since PocketBase has always been clear that it&amp;rsquo;s pre-1.0 and may break things, and if you choose younger infrastructure you don&amp;rsquo;t get to be indignant when the warning turns out to be true. So far it&amp;rsquo;s been worth it.&lt;/p&gt;&#xA;&lt;p&gt;Would I pick the same stack again? For WGA, yes; there&amp;rsquo;s nothing I&amp;rsquo;d swap out just to swap it. I wouldn&amp;rsquo;t recommend it everywhere, though. For heavily administrative applications, big write workloads, multi-region deployments, anything that needs to scale out, or real-time collaborative software, I&amp;rsquo;d think again, because those are different problems.&lt;/p&gt;&#xA;&lt;p&gt;WGA runs on PocketBase, htmx and plain JavaScript because they suit this particular site. It&amp;rsquo;s still common to pick the technology first and find the reasons afterwards. With WGA I tried to start from the problem, leave out what it didn&amp;rsquo;t need, and make the rest work properly.&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>The Web Gallery of Art Is Taking Its Next Shape</title>
      <link>https://blackfyre.ninja/blog/the-web-gallery-of-art-is-taking-its-next-shape/</link>
      <pubDate>Fri, 21 Aug 2026 11:12:41 +0200</pubDate>
      <guid>https://blackfyre.ninja/blog/the-web-gallery-of-art-is-taking-its-next-shape/</guid>
      <description>The rebuilt Web Gallery of Art is now public as a pre-alpha at beta.wga.hu. Here&#39;s what has been rebuilt, what was kept, and how you can help.</description>
      <content:encoded>&lt;p&gt;The Web Gallery of Art has been online since 1996, and for most of that time it has looked much the same.&lt;/p&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/the-web-gallery-of-art-is-taking-its-next-shape/1_rUFwm3GBq8PvtAMIxNh-Vw_hu_26ee3d03b2993920.webp&#34; alt=&#34;The original Web Gallery of Art homepage with its blue frames and menu bar, dissolving into the new, light, responsive WGA homepage&#34; width=&#34;1600&#34; height=&#34;533&#34;&gt;&lt;figcaption&gt;FIG. 1 · From the original gallery to the new one.&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;Emil Krén and Daniel Marx started &lt;a href=&#34;https://www.wga.hu/&#34;&gt;the gallery&lt;/a&gt; on the early web, and over the years it grew into a large virtual museum of European art: more than 52,000 reproductions by more than 5,800 artists, with biographies, commentaries, guided tours, period music and a glossary alongside them.&lt;/p&gt;&#xA;&lt;p&gt;The rebuilt version is now public at &lt;a href=&#34;https://beta.wga.hu/&#34;&gt;beta.wga.hu&lt;/a&gt;. Despite the address, I wouldn&amp;rsquo;t call it a beta yet. It&amp;rsquo;s closer to a pre-alpha: some things work, some half work, and some quite enthusiastically don&amp;rsquo;t work at all. But it&amp;rsquo;s far enough along that you can see where it&amp;rsquo;s heading, and at this point feedback from people using it is worth more to me than another few months of working on it alone.&lt;/p&gt;&#xA;&lt;h2 id=&#34;why-modernise-it&#34;&gt;Why modernise it&lt;/h2&gt;&#xA;&lt;p&gt;Thirty years is a very long time for a website. In that time phones and tablets took over from desktops, HTML changed, accessibility became a basic requirement, search engines became how most people find things, and browsers picked up features nobody building a site in 1996 would have imagined. Plenty of sites built a decade or two later are already gone, while the original WGA is still here.&lt;/p&gt;&#xA;&lt;p&gt;Staying alive that long had a price, though. The site was still built the way sites were built when it started: frames, table layouts, images as navigation, static HTML and CGI scripts. Underneath, the content, the presentation and the machinery behind them had grown into each other. Some sections could be regenerated from the metadata stored with the images, while the biographies, tours, glossary, music pages and the rest each followed their own structure and conventions. Keeping it running depended less on having the files than on knowing, from decades of experience, how they fitted together. A fresh coat of paint wouldn&amp;rsquo;t fix that; the job was to keep the gallery itself while replacing everything it runs on.&lt;/p&gt;&#xA;&lt;h2 id=&#34;digging-the-data-out-first&#34;&gt;Digging the data out first&lt;/h2&gt;&#xA;&lt;p&gt;So the work started with getting the data out, before any new homepage. The existing site had to be treated as a website and as a historical dataset at the same time: recovering the artwork metadata, parsing the old HTML, finding the character-encoding problems, normalising locations, and turning thirty years of organically grown information into something an application can query. It was a lot more interesting than feeding the HTML into a converter and hoping it would sort itself out.&lt;/p&gt;&#xA;&lt;p&gt;The data is messy in the way historical data usually is. Dates are uncertain or approximate, the same museum turns up under several names, city names can be ambiguous, some artists have incomplete dates, and the conventions changed over the years the gallery was maintained. Those irregularities can&amp;rsquo;t just be tidied away to make the database look neat, because often the uncertainty is the accurate answer. So the source material is kept as it is, separated from the code that used to display it. The aim is to give the gallery&amp;rsquo;s scholarship a structured, maintainable home and leave the scholarship itself as it is.&lt;/p&gt;&#xA;&lt;h2 id=&#34;keeping-whats-there&#34;&gt;Keeping what&amp;rsquo;s there&lt;/h2&gt;&#xA;&lt;p&gt;There was an easier way to do this: take the artwork database, drop everything awkward to migrate, put the images in a fashionable gallery template and call it WGA 2.0. It would also have thrown away a good part of what makes the gallery worth keeping.&lt;/p&gt;&#xA;&lt;p&gt;WGA is a lot more than a set of images. The &lt;a href=&#34;https://www.wga.hu/bio/b/bosch/biograph.html&#34;&gt;artist biographies&lt;/a&gt;, the commentaries, the &lt;a href=&#34;https://www.wga.hu/tours/index.html&#34;&gt;guided tours&lt;/a&gt;, &lt;a href=&#34;https://www.wga.hu/database/glossary/glossary.html&#34;&gt;the glossary&lt;/a&gt; and the period music all matter, and so do the smaller things like the postcard service. They&amp;rsquo;re part of the character the site picked up over its lifetime. So the rule I&amp;rsquo;m sticking to is fairly stubborn: nothing disappears just because it&amp;rsquo;s inconvenient to migrate.&lt;/p&gt;&#xA;&lt;p&gt;That goes for the design as well as the data. The new WGA shouldn&amp;rsquo;t turn into yet another endless grid of image cards; it should still feel like the Web Gallery of Art, even though almost everything underneath is being rebuilt. Old links should keep working wherever possible, you shouldn&amp;rsquo;t need an account to look at art, the existing editorial material shouldn&amp;rsquo;t be quietly rewritten, and new features should add to the collection rather than bury it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;whats-already-there&#34;&gt;What&amp;rsquo;s already there&lt;/h2&gt;&#xA;&lt;p&gt;The new interface works on today&amp;rsquo;s screens instead of a fixed desktop window. &lt;a href=&#34;https://beta.wga.hu/artists&#34;&gt;Artists&lt;/a&gt; and artworks have their own proper records that you can browse and filter, and &lt;a href=&#34;https://beta.wga.hu/search&#34;&gt;search&lt;/a&gt; is becoming the main way around the site rather than a separate tool. &lt;a href=&#34;https://beta.wga.hu/dual-mode&#34;&gt;Dual Mode&lt;/a&gt; opens two artworks side by side, so comparing two works by the same artist, or two treatments of the same subject, no longer means juggling browser windows. The &lt;a href=&#34;https://beta.wga.hu/inspire&#34;&gt;Inspiration&lt;/a&gt; section is for when you don&amp;rsquo;t arrive with a name in mind and just want to wander through a collection that can feel overwhelming. There&amp;rsquo;s keyboard navigation throughout for people who&amp;rsquo;d rather not reach for the mouse, a light and a dark theme, and the artist and artwork indexes are being rebuilt around filtering instead of long static lists.&lt;/p&gt;&#xA;&lt;p&gt;The existing features are coming across too: the &lt;a href=&#34;https://blackfyre.ninja/blog/using-the-native-dialog-with-htmx/&#34;&gt;postcard service&lt;/a&gt;, the &lt;a href=&#34;https://beta.wga.hu/glossary&#34;&gt;glossary&lt;/a&gt;, the &lt;a href=&#34;https://beta.wga.hu/guestbook&#34;&gt;guestbook&lt;/a&gt;, the &lt;a href=&#34;https://beta.wga.hu/statistics&#34;&gt;statistics&lt;/a&gt; and the rest are finding their place in the new structure. Some are much further along than others, which is exactly why this is a pre-alpha.&lt;/p&gt;&#xA;&lt;h2 id=&#34;new-ways-into-the-collection&#34;&gt;New ways into the collection&lt;/h2&gt;&#xA;&lt;p&gt;Rebuilding the old gallery is only the first half. Once the collection is structured data, there are new ways to explore it that don&amp;rsquo;t touch the scholarship at all. The &lt;a href=&#34;https://beta.wga.hu/timeline&#34;&gt;timeline&lt;/a&gt; places artists and artworks in time, so you don&amp;rsquo;t have to go in through names and schools. A geographical view can connect works with cities, museums and collections. Analysing the images themselves allows searching by colour and tone, which is a completely different way into the gallery.&lt;/p&gt;&#xA;&lt;p&gt;These features keep a clear line between what the curators recorded and what software worked out. A computer can reliably tell you things about the digital image of a painting, like its dominant colours, dimensions or contrast. It can&amp;rsquo;t decide that two works belong to the same historical series because their descriptions sound alike. Some relationships in the collection exist only in the free-text commentaries, and some were never written down at all. Language models can suggest possible connections, but &amp;ldquo;the computer thinks this is probably true&amp;rdquo; doesn&amp;rsquo;t replace scholarship. So where the gallery knows something, it says so; where software derived it, it says that; and where nobody knows, the interface has to be able to say that too.&lt;/p&gt;&#xA;&lt;h2 id=&#34;built-in-the-open&#34;&gt;Built in the open&lt;/h2&gt;&#xA;&lt;p&gt;The other big change is underneath. The new application is developed in the open: the &lt;a href=&#34;https://github.com/blackfyre/wga&#34;&gt;source code is public&lt;/a&gt;, changes can be reviewed, &lt;a href=&#34;https://github.com/blackfyre/wga/issues&#34;&gt;problems can be reported&lt;/a&gt; and anyone can contribute.&lt;/p&gt;&#xA;&lt;p&gt;A cultural resource that&amp;rsquo;s meant to last decades shouldn&amp;rsquo;t depend on one person&amp;rsquo;s computer, an undocumented deployment process, or one maintainer remembering why an odd set of files behaves the way it does. I want to leave behind something another developer can understand, rebuild and keep running.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s personal for me as well. Emil Krén, the gallery&amp;rsquo;s curator and one of its creators, is my grandfather, and WGA was always somewhere in the background while I grew up, long before I understood what it takes to keep something like this alive for decades. My part is to make sure the technology carrying that work isn&amp;rsquo;t the reason it eventually disappears.&lt;/p&gt;&#xA;&lt;h2 id=&#34;why-open-it-this-early&#34;&gt;Why open it this early&lt;/h2&gt;&#xA;&lt;p&gt;Developers usually go to great lengths to avoid showing unfinished software to the public. There&amp;rsquo;s always another bug, another page to finish, another suspicious mobile breakpoint waiting to ruin someone&amp;rsquo;s afternoon. But at some point working on it privately starts doing more harm than good, and we&amp;rsquo;re there now.&lt;/p&gt;&#xA;&lt;p&gt;The direction is settled, enough of the collection has been rebuilt for the site to be usable, and enough of the interface exists for people to have real opinions about it. What I can&amp;rsquo;t work out on my own is how thousands of different people will actually use it. Someone researching a particular painter uses WGA very differently from someone who&amp;rsquo;s just discovered &lt;a href=&#34;https://beta.wga.hu/artists/bosch-hieronymus-r0d0cb96519d18e&#34;&gt;Hieronymus Bosch&lt;/a&gt; and wants to see how deep the rabbit hole goes. Someone on a phone needs different things from someone comparing works on a big monitor. And long-time WGA users know habits, shortcuts and corners of the old site that a rebuild can easily underestimate. That&amp;rsquo;s why feedback is useful now, and not only once it&amp;rsquo;s nearly finished.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-you-can-help&#34;&gt;How you can help&lt;/h2&gt;&#xA;&lt;p&gt;If you try the new gallery, please don&amp;rsquo;t treat it as finished. Explore it: search for something obscure, follow links, compare artworks, try it on your phone, try the things you used on &lt;a href=&#34;https://www.wga.hu/&#34;&gt;the original WGA&lt;/a&gt;, and look for something you know should be there. Then tell us when something feels off.&lt;/p&gt;&#xA;&lt;p&gt;Anything that doesn&amp;rsquo;t work is useful to hear about, and so is content that seems to be missing or wrong, confusing navigation, information that&amp;rsquo;s harder to find than on the original site, accessibility or usability problems, and odd behaviour on particular devices. It also helps to know which features of the original WGA you rely on, and which new ways of exploring the collection would genuinely help you.&lt;/p&gt;&#xA;&lt;p&gt;You don&amp;rsquo;t need to be a developer or an art historian to send it. Hearing from both, and from everyone in between, is part of the reason for opening it now. A technically perfect museum that nobody enjoys visiting would be quite an impressive engineering failure.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-comes-next&#34;&gt;What comes next&lt;/h2&gt;&#xA;&lt;p&gt;It isn&amp;rsquo;t finished. There are incomplete pages, missing features, bugs and data that still needs checking. Parts of the original gallery haven&amp;rsquo;t reached their final form yet, and several of the more ambitious exploration features are still being built.&lt;/p&gt;&#xA;&lt;p&gt;What has changed is that the new Web Gallery of Art now exists outside my development environment. It has a home, you can explore it, and for the first time the people who use it can help decide what it becomes. The original showed that a carefully looked-after cultural resource can last almost the whole history of the public web; this project is meant to give it a foundation for the next stretch.&lt;/p&gt;&#xA;&lt;p&gt;That starts at &lt;a href=&#34;https://beta.wga.hu/&#34;&gt;beta.wga.hu&lt;/a&gt;. Just remember that pre-alpha means pre-alpha: if you find something broken, you may have found a bug, and if you find several things broken, you&amp;rsquo;re probably getting the intended experience. Either way, we&amp;rsquo;d like to hear about it.&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>Building a Complete Self-Hosted Media Automation Suite with Podman Quadlets</title>
      <link>https://blackfyre.ninja/blog/building-a-complete-self-hosted-media-automation-suite-with-podman-quadlets/</link>
      <pubDate>Tue, 21 Oct 2025 10:47:50 +0200</pubDate>
      <guid>https://blackfyre.ninja/blog/building-a-complete-self-hosted-media-automation-suite-with-podman-quadlets/</guid>
      <description>A guide to a containerised media automation setup using the Arr stack, Podman Quadlets and systemd on Fedora Server.</description>
      <content:encoded>&lt;p&gt;With streaming services and digital media everywhere, managing a personal media library has become more complicated. This article documents a self-hosted media automation suite that discovers, downloads, organises and serves your media collection, with security and reliability in mind throughout.&lt;/p&gt;&#xA;&lt;p&gt;It is built on the &amp;ldquo;Arr&amp;rdquo; ecosystem, a collection of applications designed to work together, and deployed with Podman Quadlets, which run containers as native systemd services. The result is reliable while staying lightweight and maintainable enough for a home lab.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Diagram, drawn in the post: &lt;a href=&#34;https://blackfyre.ninja/blog/building-a-complete-self-hosted-media-automation-suite-with-podman-quadlets/&#34;&gt;request path&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;architecture-overview&#34;&gt;Architecture overview&lt;/h2&gt;&#xA;&lt;h3 id=&#34;the-arr-ecosystem&#34;&gt;The Arr ecosystem&lt;/h3&gt;&#xA;&lt;p&gt;The setup implements the complete Arr workflow. Prowlarr manages the indexers, Sonarr, Radarr, Lidarr and Readarr manage the media, qBittorrent downloads it, Bazarr adds subtitles and Jellyfin serves the result.&lt;/p&gt;&#xA;&lt;p&gt;Core components:&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Service&lt;/th&gt;&lt;th style=&#34;text-align:right&#34;&gt;Port&lt;/th&gt;&lt;th&gt;Role&lt;/th&gt;&lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&#34;https://prowlarr.com/&#34;&gt;Prowlarr&lt;/a&gt;&lt;/td&gt;&lt;td style=&#34;text-align:right&#34;&gt;9696&lt;/td&gt;&lt;td&gt;The central indexer manager with 200+ preconfigured torrent trackers&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&#34;https://sonarr.tv/&#34;&gt;Sonarr&lt;/a&gt;&lt;/td&gt;&lt;td style=&#34;text-align:right&#34;&gt;8989&lt;/td&gt;&lt;td&gt;TV show automation and library management&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&#34;https://radarr.video/&#34;&gt;Radarr&lt;/a&gt;&lt;/td&gt;&lt;td style=&#34;text-align:right&#34;&gt;7878&lt;/td&gt;&lt;td&gt;Film discovery, download and organisation&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&#34;https://lidarr.audio/&#34;&gt;Lidarr&lt;/a&gt;&lt;/td&gt;&lt;td style=&#34;text-align:right&#34;&gt;8686&lt;/td&gt;&lt;td&gt;Music library automation&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&#34;https://readarr.com/&#34;&gt;Readarr&lt;/a&gt;&lt;/td&gt;&lt;td style=&#34;text-align:right&#34;&gt;8787&lt;/td&gt;&lt;td&gt;Ebook and audiobook management&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&#34;https://www.qbittorrent.org/&#34;&gt;qBittorrent&lt;/a&gt;&lt;/td&gt;&lt;td style=&#34;text-align:right&#34;&gt;8080&lt;/td&gt;&lt;td&gt;Primary BitTorrent client for media downloads&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&#34;https://www.bazarr.media/&#34;&gt;Bazarr&lt;/a&gt;&lt;/td&gt;&lt;td style=&#34;text-align:right&#34;&gt;6767&lt;/td&gt;&lt;td&gt;Subtitle automation for films and TV shows&lt;/td&gt;&lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&lt;p&gt;Media servers and services:&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Service&lt;/th&gt;&lt;th style=&#34;text-align:right&#34;&gt;Port&lt;/th&gt;&lt;th&gt;Role&lt;/th&gt;&lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&#34;https://jellyfin.org/&#34;&gt;Jellyfin&lt;/a&gt;&lt;/td&gt;&lt;td style=&#34;text-align:right&#34;&gt;8096&lt;/td&gt;&lt;td&gt;Open-source media streaming server&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&#34;https://www.audiobookshelf.org/&#34;&gt;Audiobookshelf&lt;/a&gt;&lt;/td&gt;&lt;td style=&#34;text-align:right&#34;&gt;13378&lt;/td&gt;&lt;td&gt;Specialised audiobook and podcast server&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&#34;https://github.com/C4illin/ConvertX&#34;&gt;ConvertX&lt;/a&gt;&lt;/td&gt;&lt;td style=&#34;text-align:right&#34;&gt;3000&lt;/td&gt;&lt;td&gt;Self-hosted file format converter supporting 1000+ formats&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ThinkDashboard&lt;/td&gt;&lt;td style=&#34;text-align:right&#34;&gt;8082&lt;/td&gt;&lt;td&gt;Lightweight bookmark dashboard with keyboard shortcuts&lt;/td&gt;&lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&lt;p&gt;Infrastructure services:&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Service&lt;/th&gt;&lt;th style=&#34;text-align:right&#34;&gt;Port&lt;/th&gt;&lt;th&gt;Role&lt;/th&gt;&lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&#34;https://traefik.io/traefik/&#34;&gt;Traefik&lt;/a&gt;&lt;/td&gt;&lt;td style=&#34;text-align:right&#34;&gt;80/443&lt;/td&gt;&lt;td&gt;Reverse proxy with automatic SSL via Let&amp;rsquo;s Encrypt&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&#34;https://n8n.io/&#34;&gt;n8n&lt;/a&gt;&lt;/td&gt;&lt;td style=&#34;text-align:right&#34;&gt;5678&lt;/td&gt;&lt;td&gt;Workflow automation platform for custom integrations&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&#34;https://www.postgresql.org/&#34;&gt;PostgreSQL&lt;/a&gt;&lt;/td&gt;&lt;td style=&#34;text-align:right&#34;&gt;5432&lt;/td&gt;&lt;td&gt;Database backend for n8n and other services&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&#34;https://www.jaegertracing.io/&#34;&gt;Jaeger&lt;/a&gt;&lt;/td&gt;&lt;td style=&#34;text-align:right&#34;&gt;16686&lt;/td&gt;&lt;td&gt;Distributed tracing for performance monitoring&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&#34;https://rustdesk.com/&#34;&gt;RustDesk&lt;/a&gt;&lt;/td&gt;&lt;td style=&#34;text-align:right&#34;&gt;21115–21119&lt;/td&gt;&lt;td&gt;Self-hosted remote desktop solution&lt;/td&gt;&lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&lt;h3 id=&#34;why-podman-quadlets&#34;&gt;Why Podman Quadlets?&lt;/h3&gt;&#xA;&lt;p&gt;Container orchestration often involves complex YAML files and an external orchestrator. Podman Quadlets integrate directly with systemd instead, so the containers behave like any other system service: systemd directives set the startup order, and systemd&amp;rsquo;s resource controls and monitoring apply to them. The containers run rootless with SELinux integration, and there is no orchestrator to run alongside them.&lt;/p&gt;&#xA;&lt;h2 id=&#34;deployment-architecture&#34;&gt;Deployment architecture&lt;/h2&gt;&#xA;&lt;p&gt;The entire suite runs within a single Podman network (&lt;code&gt;arr-suite&lt;/code&gt;) using the subnet &lt;code&gt;10.89.0.0/16&lt;/code&gt;. Services communicate internally and reach each other by container name, so no unnecessary ports are exposed. External access goes through the Traefik reverse proxy, and traffic analysis and logging are centralised.&lt;/p&gt;&#xA;&lt;p&gt;Storage comes in three tiers. Persistent service configuration lives in &lt;code&gt;/home/user/arr-suite/config/&lt;/code&gt;, the organised media library in &lt;code&gt;/mnt/nas/media/&lt;/code&gt;, and downloads are staged temporarily in &lt;code&gt;/mnt/nas/downloads/&lt;/code&gt; while they are processed. Keeping them apart protects the data that matters and lets downloads be processed without touching the library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Diagram, drawn in the post: &lt;a href=&#34;https://blackfyre.ninja/blog/building-a-complete-self-hosted-media-automation-suite-with-podman-quadlets/&#34;&gt;storage tiers&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;implementation-details&#34;&gt;Implementation details&lt;/h2&gt;&#xA;&lt;p&gt;Each service is defined in a &lt;code&gt;.container&lt;/code&gt; file that follows systemd unit file syntax:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;quadlets/sonarr.container&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-ini&#34;&gt;[Unit]&#xA;Description=sonarr container&#xA;Wants=network-online.target&#xA;After=network-online.target arr-suite-network.service qbittorrent.service prowlarr.service&#xA;Requires=arr-suite-network.service qbittorrent.service prowlarr.service&#xA;&#xA;[Container]&#xA;Image=lscr.io/linuxserver/sonarr:latest&#xA;ContainerName=sonarr&#xA;PublishPort=8989:8989&#xA;Network=arr-suite.network&#xA;Volume=/home/user/arr-suite/config/sonarr:/config:z&#xA;Volume=/mnt/nas/media:/media:z&#xA;Volume=/mnt/nas/downloads:/downloads:z&#xA;Environment=PUID=1000&#xA;Environment=PGID=1000&#xA;Environment=TZ=Europe/Budapest&#xA;Label=io.containers.autoupdate=registry&#xA;Label=traefik.enable=true&#xA;Label=traefik.http.routers.sonarr.rule=Host(`sonarr.my-address.noip.me`)&#xA;Label=traefik.http.routers.sonarr.tls=true&#xA;Label=traefik.http.routers.sonarr.tls.certresolver=letsencrypt&#xA;Label=traefik.http.services.sonarr.loadbalancer.server.port=8989&#xA;Label=traefik.http.routers.sonarr.middlewares=default-headers@file&#xA;&#xA;[Service]&#xA;Restart=always&#xA;&#xA;[Install]&#xA;WantedBy=default.target&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The management script works out the startup order from the &lt;code&gt;Requires&lt;/code&gt; and &lt;code&gt;After&lt;/code&gt; directives and starts the services in that sequence.&lt;/p&gt;&#xA;&lt;p&gt;Traefik routes traffic based on container labels. Each service gets its own subdomain under &lt;code&gt;*.my-address.noip.me&lt;/code&gt; with a Let&amp;rsquo;s Encrypt certificate, middleware adds the security headers, and services register themselves when their containers start.&lt;/p&gt;&#xA;&lt;p&gt;A few more pieces are automated. A generator builds Traefik&amp;rsquo;s dynamic routing config from the container labels, a DNS updater keeps the external records pointing at the dynamic IP address, a health monitor checks service status and raises alerts, and container images update themselves through registry labels.&lt;/p&gt;&#xA;&lt;p&gt;For extra protection, Traefik&amp;rsquo;s &lt;a href=&#34;https://github.com/fail2ban/fail2ban&#34;&gt;fail2ban&lt;/a&gt; plugin can block IPs after repeated authentication failures, which guards the administrative interfaces against brute-force attacks. The ban duration and retry thresholds are configurable, the plugin works together with the system&amp;rsquo;s own fail2ban, and it detects and responds to threats in real time.&lt;/p&gt;&#xA;&lt;h2 id=&#34;other-services&#34;&gt;Other services&lt;/h2&gt;&#xA;&lt;p&gt;ConvertX converts files between more than 1000 formats, including documents, images and videos. It replaces online conversion services and fits into the media workflow when formats need standardising.&lt;/p&gt;&#xA;&lt;p&gt;n8n handles custom automation. It integrates with the APIs of all the Arr services, runs custom notification workflows and content processing rules, and keeps its workflows in PostgreSQL. Custom scripts cover maintenance and configuration: generating the dynamic Traefik configuration, managing DNS records for dynamic IPs, monitoring service health with alerts, and automating backup and restore.&lt;/p&gt;&#xA;&lt;p&gt;Jaeger traces requests across services, which helps to find performance bottlenecks, monitor and optimise API calls, and analyse performance trends over time.&lt;/p&gt;&#xA;&lt;h2 id=&#34;management-and-operations&#34;&gt;Management and operations&lt;/h2&gt;&#xA;&lt;p&gt;A management script, &lt;code&gt;setup-quadlets.sh&lt;/code&gt;, is the central control point for the whole arr-suite. It finds the services by scanning the &lt;code&gt;quadlets/&lt;/code&gt; directory for &lt;code&gt;.container&lt;/code&gt; and &lt;code&gt;.network&lt;/code&gt; files, so nothing has to be registered by hand. It parses the &lt;code&gt;Requires&lt;/code&gt; and &lt;code&gt;After&lt;/code&gt; directives into a dependency graph and starts each service only after its dependencies are ready. These are its commands:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;setup-quadlets.sh&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;# Initial setup and configuration&#xA;$ ./setup-quadlets.sh setup&#xA;# Creates systemd symlinks, reloads daemon, opens firewall ports&#xA;&#xA;# Service lifecycle management&#xA;$ ./setup-quadlets.sh start|stop|restart&#xA;# Handles services in correct dependency order&#xA;&#xA;# Health and status monitoring&#xA;$ ./setup-quadlets.sh status&#xA;# Shows systemd status, port exposure, and service descriptions&#xA;&#xA;# Network diagnostics&#xA;$ ./setup-quadlets.sh ports # List all exposed ports&#xA;$ ./setup-quadlets.sh urls # Generate service URLs for quick access&#xA;&#xA;# Individual service operations&#xA;$ ./setup-quadlets.sh logs # View service logs&#xA;$ ./setup-quadlets.sh shell # Access container shell&#xA;$ ./setup-quadlets.sh inspect # Container inspection&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The script reads the required ports from the Quadlet &lt;code&gt;PublishPort&lt;/code&gt; directives and manages the firewalld rules for them, checking that only the necessary ports are exposed. It reports status in colour: red for errors, green for success, yellow for warnings. It can operate on all services at once while still respecting the dependency order, which prevents race conditions during startup and shutdown. Before any operation, it checks that systemd can parse the Quadlet files, so configuration errors surface early.&lt;/p&gt;&#xA;&lt;p&gt;All service definitions live in the Quadlet files, and the script discovers them instead of keeping a separate list of services. Running setup more than once gives the same result, so it is safe to re-run for updates or troubleshooting. Operations stop at the first error with a clear diagnostic message, which prevents cascading failures, and every operation respects service dependencies, whether it starts services, stops them or performs maintenance.&lt;/p&gt;&#xA;&lt;p&gt;The script also detects circular dependencies and handles them gracefully, starts network services before container services, cleans up properly during shutdown to avoid resource leaks, and reloads the systemd daemon when Quadlet files change.&lt;/p&gt;&#xA;&lt;p&gt;Each service keeps its configuration in a dedicated directory:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;config/&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-text&#34;&gt;config/&#xA;├── sonarr/       # TV show management configuration&#xA;├── radarr/       # Film management configuration&#xA;├── prowlarr/     # Indexer definitions and settings&#xA;├── qbittorrent/  # Download client settings&#xA;├── traefik/      # Reverse proxy configuration&#xA;└── jellyfin/     # Media server preferences&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;scalability-and-maintenance&#34;&gt;Scalability and maintenance&lt;/h2&gt;&#xA;&lt;p&gt;The architecture is easy to extend. A new Arr application is one more Quadlet file, services can be distributed across multiple nodes, and Traefik supports multiple backend instances for load balancing.&lt;/p&gt;&#xA;&lt;p&gt;Services update automatically through the container registry label:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-ini&#34;&gt;Label=io.containers.autoupdate=registry&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Configuration data is kept separate from the container images, so the configuration directories can be backed up independently, images are pulled fresh during updates, and PostgreSQL is backed up automatically. Health is monitored through systemd, Traefik&amp;rsquo;s health checks and custom scripts for application-specific metrics.&lt;/p&gt;&#xA;&lt;h2 id=&#34;security-considerations&#34;&gt;Security considerations&lt;/h2&gt;&#xA;&lt;p&gt;All containers run without root privileges, which reduces the attack surface, limits system access and isolates user namespaces. SELinux adds fine-grained access control: the &lt;code&gt;:z&lt;/code&gt; volume labels restrict file system access, network policies are enforced, and processes are isolated and monitored.&lt;/p&gt;&#xA;&lt;p&gt;No service trusts any other by default. Communication goes through authenticated channels, container networks segment the traffic, and traffic is monitored and logged. TLS covers everything: Let&amp;rsquo;s Encrypt certificates are managed automatically, HTTPS is enforced for all services, and internal service communication is encrypted as well.&lt;/p&gt;&#xA;&lt;p&gt;The reverse proxy enforces security policy in one place, with authentication middleware for administrative interfaces, rate limiting and DDoS protection, security header injection, and the optional fail2ban plugin for blocking IPs that show suspicious activity.&lt;/p&gt;&#xA;&lt;h2 id=&#34;performance-optimisation&#34;&gt;Performance optimisation&lt;/h2&gt;&#xA;&lt;p&gt;Each service has its own memory limit, swap usage is monitored and tuned, and garbage collection is tuned for media processing. Different types of data get separate volumes, the filesystems for media storage are chosen for the job, and temporary processing files are cleaned up automatically. Between services, the container network is tuned for performance, database connections are pooled, and API endpoints use caching.&lt;/p&gt;&#xA;&lt;h2 id=&#34;troubleshooting-and-diagnostics&#34;&gt;Troubleshooting and diagnostics&lt;/h2&gt;&#xA;&lt;p&gt;Logs go to the systemd journal and to application-specific log files, with rotation and retention policies. Built-in tools visualise service dependencies, test network connectivity and profile performance.&lt;/p&gt;&#xA;&lt;p&gt;Services that fail to start usually have a dependency problem, which the automatic dependency ordering, service health checks and configuration validation tools help with. For connectivity problems between services, there is network topology visualisation, port conflict detection and resolution, and DNS resolution debugging.&lt;/p&gt;&#xA;&lt;h2 id=&#34;future-enhancements&#34;&gt;Future enhancements&lt;/h2&gt;&#xA;&lt;p&gt;Planned next are better monitoring (metrics collection and visualisation, alerting and notifications, performance trend analysis), data protection (automated configuration backups, checksumming and validation of the media library, disaster recovery procedures) and more automation (machine learning for content recommendations, more advanced content processing pipelines, integration with external media databases).&lt;/p&gt;&#xA;&lt;h2 id=&#34;resources-and-further-reading&#34;&gt;Resources and further reading&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html&#34;&gt;Podman Quadlets documentation&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://wiki.servarr.com/&#34;&gt;Arr application documentation&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://doc.traefik.io/traefik/&#34;&gt;Traefik reverse proxy guide&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html&#34;&gt;systemd service management&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve created a template repository at &lt;a href=&#34;https://codeberg.org/blackfyre/arr-suite&#34;&gt;codeberg.org/blackfyre/arr-suite&lt;/a&gt; for your scrutiny!&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>Using the native dialog with HTMX</title>
      <link>https://blackfyre.ninja/blog/using-the-native-dialog-with-htmx/</link>
      <pubDate>Sat, 14 Oct 2023 07:15:40 +0200</pubDate>
      <guid>https://blackfyre.ninja/blog/using-the-native-dialog-with-htmx/</guid>
      <description>An empty &lt;dialog&gt;, a fragment from the server and an HX-Trigger header: modal windows with htmx and no modal library.</description>
      <content:encoded>&lt;p&gt;Recently I&amp;rsquo;ve found out about &lt;a href=&#34;https://htmx.org/&#34;&gt;htmx&lt;/a&gt; and immediately fell in love with the concept of ditching frontend frameworks for ~90% of the use cases I deal with on the regular.&#xA;Alas, there are things we still need additional help with, but thankfully htmx is very helpful in that regard as it&amp;rsquo;s extensible and works well with other scripts and even with frameworks.&lt;/p&gt;&#xA;&lt;p&gt;My other fixation is using browser native features as much as possible (they are there for a reason…). While this is not something shared by UI designers, it&amp;rsquo;s more often easier to have the design adjusted than finding a library that supports both the design and business requirements when there&amp;rsquo;s a crunch.&lt;/p&gt;&#xA;&lt;p&gt;And after this long preamble, the star of the show: the browser native &lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog&#34;&gt;dialog&lt;/a&gt;, which can easily be the best solution for modal windows so far!&lt;/p&gt;&#xA;&lt;p&gt;The examples come from the &lt;a href=&#34;https://github.com/blackfyre/wga&#34;&gt;Web Gallery of Art&lt;/a&gt; rebuild I&amp;rsquo;ve just started, where visitors can send a painting to someone as a postcard.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-dialog&#34;&gt;The dialog&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;layout.html&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-html&#34;&gt;&amp;lt;html&amp;gt;&#xA;  &amp;lt;body&amp;gt;&#xA;    &amp;lt;a href=&amp;#34;#&amp;#34; hx-on=&amp;#34;click: document.getElementById(&amp;#39;d&amp;#39;).showModal();&amp;#34;&#xA;    hx-get=&amp;#34;/postcard/send?awid={{.Id}}&amp;#34; hx-target=&amp;#34;#d&amp;#34; class=&amp;#34;card-footer-item&amp;#34;&amp;gt;Send&#xA;      Postcard&amp;lt;/a&amp;gt;&#xA;    &amp;lt;dialog id=&amp;#34;d&amp;#34;&amp;gt;&amp;lt;/dialog&amp;gt;&#xA;  &amp;lt;/body&amp;gt;&#xA;&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;To get started, you only need to add a &lt;code&gt;&amp;lt;dialog&amp;gt;&lt;/code&gt; element with an ID attribute, as seen in the above code snippet. It sits empty in the layout, once, and every modal on the site reuses it.&lt;/p&gt;&#xA;&lt;p&gt;The link does two things on the same click: htmx fetches the postcard editor and swaps it into &lt;code&gt;#d&lt;/code&gt;, and the &lt;code&gt;hx-on&lt;/code&gt; handler calls &lt;code&gt;showModal()&lt;/code&gt;. That one call gives you a lot for free. The dialog is rendered in the top layer, above everything else, so there are no &lt;code&gt;z-index&lt;/code&gt; wars. The rest of the page becomes inert, which keeps clicks and tabbing inside the modal, &lt;kbd&gt;Esc&lt;/kbd&gt; closes it, and the &lt;code&gt;::backdrop&lt;/code&gt; pseudo-element is there to style.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-content&#34;&gt;The content&lt;/h2&gt;&#xA;&lt;p&gt;The server answers with a fragment, which htmx drops into the dialog:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;partials/postcard.html&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-html&#34;&gt;&amp;lt;section class=&amp;#34;postcard-editor&amp;#34;&amp;gt;&#xA;    &amp;lt;span class=&amp;#34;icon is-clickable close-dialog is-large&amp;#34; hx-on=&amp;#34;click: wga.closeDialog();&amp;#34;&amp;gt;&#xA;        &amp;lt;i class=&amp;#34;fas fa-times fa-2x&amp;#34;&amp;gt;&amp;lt;/i&amp;gt;&#xA;    &amp;lt;/span&amp;gt;&#xA;    &amp;lt;h1 class=&amp;#34;title&amp;#34;&amp;gt;Write a postcard&amp;lt;/h1&amp;gt;&#xA;    &amp;lt;div class=&amp;#34;columns&amp;#34;&amp;gt;&#xA;        &amp;lt;div class=&amp;#34;column is-half&amp;#34;&amp;gt;&#xA;            &amp;lt;!-- the painting --&amp;gt;&#xA;        &amp;lt;/div&amp;gt;&#xA;        &amp;lt;div class=&amp;#34;column&amp;#34;&amp;gt;&#xA;            &amp;lt;form hx-post=&amp;#34;/postcards&amp;#34; hx-target=&amp;#34;#d&amp;#34;&amp;gt;&#xA;                &amp;lt;input type=&amp;#34;hidden&amp;#34; name=&amp;#34;image_id&amp;#34; value=&amp;#34;{{.ImageId}}&amp;#34;&amp;gt;&#xA;                &amp;lt;div class=&amp;#34;field&amp;#34;&amp;gt;&#xA;                    &amp;lt;label class=&amp;#34;label&amp;#34;&amp;gt;Name&amp;lt;/label&amp;gt;&#xA;                    &amp;lt;div class=&amp;#34;control&amp;#34;&amp;gt;&#xA;                        &amp;lt;input class=&amp;#34;input&amp;#34; type=&amp;#34;text&amp;#34; name=&amp;#34;sender_name&amp;#34; required autocomplete=&amp;#34;name&amp;#34;&amp;gt;&#xA;                    &amp;lt;/div&amp;gt;&#xA;                &amp;lt;/div&amp;gt;&#xA;                &amp;lt;div class=&amp;#34;field&amp;#34;&amp;gt;&#xA;                    &amp;lt;label class=&amp;#34;label&amp;#34;&amp;gt;Message&amp;lt;/label&amp;gt;&#xA;                    &amp;lt;div class=&amp;#34;control&amp;#34;&amp;gt;&#xA;                        &amp;lt;trix-editor input=&amp;#34;message&amp;#34;&amp;gt;&amp;lt;/trix-editor&amp;gt;&#xA;                        &amp;lt;input type=&amp;#34;hidden&amp;#34; id=&amp;#34;message&amp;#34; name=&amp;#34;message&amp;#34;&amp;gt;&#xA;                    &amp;lt;/div&amp;gt;&#xA;                &amp;lt;/div&amp;gt;&#xA;                &amp;lt;div class=&amp;#34;field is-grouped&amp;#34;&amp;gt;&#xA;                    &amp;lt;p class=&amp;#34;control&amp;#34;&amp;gt;&#xA;                        &amp;lt;button class=&amp;#34;button is-link&amp;#34; type=&amp;#34;submit&amp;#34;&amp;gt;Send postcard&amp;lt;/button&amp;gt;&#xA;                    &amp;lt;/p&amp;gt;&#xA;                    &amp;lt;p class=&amp;#34;control&amp;#34;&amp;gt;&#xA;                        &amp;lt;button type=&amp;#34;button&amp;#34; class=&amp;#34;button&amp;#34; hx-on=&amp;#34;click: wga.closeDialog();&amp;#34;&amp;gt;Cancel&amp;lt;/button&amp;gt;&#xA;                    &amp;lt;/p&amp;gt;&#xA;                &amp;lt;/div&amp;gt;&#xA;            &amp;lt;/form&amp;gt;&#xA;        &amp;lt;/div&amp;gt;&#xA;    &amp;lt;/div&amp;gt;&#xA;&amp;lt;/section&amp;gt;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Both the ✕ in the corner and the Cancel button close the dialog. Inline &lt;code&gt;document.getElementById(&#39;d&#39;).close()&lt;/code&gt; calls get old quickly, so they live in a tiny helper instead:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;app.js&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-js&#34;&gt;const wga = {&#xA;    els: {},&#xA;};&#xA;&#xA;wga.els.dialog = document.getElementById(&amp;#34;d&amp;#34;);&#xA;&#xA;window.wga = {&#xA;    openDialog () {&#xA;        wga.els.dialog.showModal();&#xA;    },&#xA;    closeDialog () {&#xA;        wga.els.dialog.close();&#xA;    }&#xA;};&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The message field is a &lt;a href=&#34;https://trix-editor.org/&#34;&gt;Trix&lt;/a&gt; editor. It&amp;rsquo;s a custom element, so it initialises itself when htmx swaps it in, without any extra wiring.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-endpoint&#34;&gt;The endpoint&lt;/h2&gt;&#xA;&lt;p&gt;On the Go side (PocketBase, so Echo underneath) the editor is a plain handler that renders a template block rather than a full page:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;handlers/postcard.go&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-go&#34;&gt;e.Router.GET(&amp;#34;postcard/send&amp;#34;, func(c echo.Context) error {&#xA;&#x9;if !isHtmxRequest(c) {&#xA;&#x9;&#x9;return apis.NewBadRequestError(&amp;#34;Unexpected request&amp;#34;, nil)&#xA;&#x9;}&#xA;&#xA;&#x9;awid := c.QueryParam(&amp;#34;awid&amp;#34;)&#xA;&#x9;if awid == &amp;#34;&amp;#34; {&#xA;&#x9;&#x9;return apis.NewBadRequestError(&amp;#34;awid is empty&amp;#34;, nil)&#xA;&#x9;}&#xA;&#xA;&#x9;html, err := renderPostcardEditor(awid, app, c)&#xA;&#x9;if err != nil {&#xA;&#x9;&#x9;return err&#xA;&#x9;}&#xA;&#xA;&#x9;return c.HTML(http.StatusOK, html)&#xA;})&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;code&gt;handlers/main.go&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-go&#34;&gt;func isHtmxRequest(c echo.Context) bool {&#xA;&#x9;return c.Request().Header.Get(&amp;#34;HX-Request&amp;#34;) == &amp;#34;true&amp;#34;&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The fragment only makes sense inside the dialog, so anything that isn&amp;rsquo;t an htmx request is turned away.&lt;/p&gt;&#xA;&lt;h2 id=&#34;letting-the-server-close-it&#34;&gt;Letting the server close it&lt;/h2&gt;&#xA;&lt;p&gt;Submitting the form is a regular &lt;code&gt;hx-post&lt;/code&gt;. If storing the postcard fails, the server renders the editor again and it lands back in the dialog. If it works, there&amp;rsquo;s nothing left to show, and the dialog should simply go away.&lt;/p&gt;&#xA;&lt;p&gt;The server can&amp;rsquo;t call &lt;code&gt;close()&lt;/code&gt;, but it can send an &lt;code&gt;HX-Trigger&lt;/code&gt; header, which htmx turns into an event on the page:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;handlers/utils.go&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-go&#34;&gt;func sendToastMessage(message string, t string, closeDialog bool, c echo.Context) {&#xA;&#x9;payload := struct {&#xA;&#x9;&#x9;Message     string `json:&amp;#34;message&amp;#34;`&#xA;&#x9;&#x9;Type        string `json:&amp;#34;type&amp;#34;`&#xA;&#x9;&#x9;CloseDialog bool   `json:&amp;#34;closeDialog&amp;#34;`&#xA;&#x9;}{&#xA;&#x9;&#x9;Message:     message,&#xA;&#x9;&#x9;Type:        t,&#xA;&#x9;&#x9;CloseDialog: closeDialog,&#xA;&#x9;}&#xA;&#xA;&#x9;setHxTrigger(c, map[string]any{&#xA;&#x9;&#x9;&amp;#34;notification:toast&amp;#34;: payload,&#xA;&#x9;})&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;code&gt;handlers/postcard.go&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-go&#34;&gt;sendToastMessage(&amp;#34;Thank you! Your postcard has been queued for sending!&amp;#34;, &amp;#34;is-success&amp;#34;, true, c)&#xA;&#xA;return nil&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;On the page, one listener shows the toast and closes the dialog when asked to:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;app.js&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-js&#34;&gt;document.body.addEventListener(&amp;#34;notification:toast&amp;#34;, function (evt) {&#xA;    if (evt.detail.closeDialog) {&#xA;        wga.els.dialog.close();&#xA;    }&#xA;&#xA;    bulmaToast.toast({&#xA;        message: evt.detail.message,&#xA;        type: evt.detail.type,&#xA;    })&#xA;})&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The server decides whether the dialog stays open, and the same mechanism works for any form that ends up in &lt;code&gt;#d&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Diagram, drawn in the post: &lt;a href=&#34;https://blackfyre.ninja/blog/using-the-native-dialog-with-htmx/&#34;&gt;postcard flow&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;making-it-look-like-a-modal&#34;&gt;Making it look like a modal&lt;/h2&gt;&#xA;&lt;p&gt;The default dialog looks rather plain, but it&amp;rsquo;s a regular element and takes CSS like anything else. To animate both opening and closing, the dialog stays &lt;code&gt;display: block&lt;/code&gt; and is hidden with opacity instead:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;_dialog.scss&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-scss&#34;&gt;dialog {&#xA;    display: block;&#xA;    animation: scale-down 0.5s cubic-bezier(0.5, -0.5, 0.1, 1.5) forwards;&#xA;    border-radius: calc(1rem / 3);&#xA;    padding: 1.5rem;&#xA;    box-shadow: 0 0 2rem 0 rgba(0, 0, 0, 0.5);&#xA;&#xA;    &amp;amp;[open] {&#xA;        animation: slide-in-up 0.5s cubic-bezier(0.25, 0, 0.3, 1) forwards;&#xA;    }&#xA;&#xA;    &amp;amp;:not([open]) {&#xA;        pointer-events: none;&#xA;        opacity: 0;&#xA;    }&#xA;&#xA;    &amp;amp;::backdrop {&#xA;        backdrop-filter: blur(0.25rem);&#xA;    }&#xA;&#xA;    .close-dialog {&#xA;        position: absolute;&#xA;        right: 1rem;&#xA;    }&#xA;}&#xA;&#xA;@keyframes slide-in-up {&#xA;    0% { transform: translateY(100%); }&#xA;}&#xA;&#xA;@keyframes scale-down {&#xA;    to { transform: scale(0.75); }&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;One thing to keep in mind with this trick: a closed dialog that is still &lt;code&gt;display: block&lt;/code&gt; keeps its content in the accessibility tree, so screen readers can still reach the last form until something replaces it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;wrapping-up&#34;&gt;Wrapping up&lt;/h2&gt;&#xA;&lt;p&gt;That&amp;rsquo;s the whole modal: one empty &lt;code&gt;&amp;lt;dialog&amp;gt;&lt;/code&gt; in the layout, a server that returns fragments, and a few lines of JavaScript to open, close and listen for &lt;code&gt;HX-Trigger&lt;/code&gt;. No modal library, and the browser takes care of the backdrop, the focus trap and &lt;kbd&gt;Esc&lt;/kbd&gt;.&lt;/p&gt;&#xA;&lt;p&gt;There are a couple of rough edges I still want to sort out. The dialog opens on click, before the content arrives, so there&amp;rsquo;s a moment of an empty box. Closing doesn&amp;rsquo;t clear the old content, and the dialog has no accessible name yet. But for something that&amp;rsquo;s barely a week old, it already does the job.&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>Figma for Databases</title>
      <link>https://blackfyre.ninja/blog/figma-for-databases/</link>
      <pubDate>Mon, 27 Jun 2022 10:42:55 +0200</pubDate>
      <guid>https://blackfyre.ninja/blog/figma-for-databases/</guid>
      <description>Notes from refactoring a 43-table database: describing it in DBML, then diagramming, documenting and turning it into SQL from one file.</description>
      <content:encoded>&lt;p&gt;Recently I was tasked with a relatively big database refactor: 43 tables and counting, with a lot of interconnections between them, and, as usual, everyone wanted to add their two cents. Designers have had a place for that for years: everyone opens the same Figma file and argues over the same picture. For the database we had nothing of the sort, so off I went to find one.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-we-had-to-work-with&#34;&gt;What we had to work with&lt;/h2&gt;&#xA;&lt;p&gt;The company didn&amp;rsquo;t have any tools or best practices for this occasion. For my own Laravel projects I usually rely on &lt;a href=&#34;https://vemto.app/&#34;&gt;Vemto&lt;/a&gt;, which lets you draw the models and generates the migrations, or &lt;a href=&#34;https://blueprint.laravelshift.com/&#34;&gt;Laravel Blueprint&lt;/a&gt;, which does the same from a YAML file. Neither was an option here: the company doesn&amp;rsquo;t have any PHP-based apps, nor do they want any. Their stack is single-page apps hosted on &lt;a href=&#34;https://firebase.google.com/&#34;&gt;Firebase&lt;/a&gt;, with a PostgreSQL database and a GraphQL layer somewhere in the cloud… so whatever I picked had to work with plain PostgreSQL and nothing else.&lt;/p&gt;&#xA;&lt;h2 id=&#34;dbml&#34;&gt;DBML&lt;/h2&gt;&#xA;&lt;p&gt;The tool I&amp;rsquo;ve found is &lt;a href=&#34;https://dbml.dbdiagram.io/docs/&#34;&gt;DBML&lt;/a&gt;, short for Database Markup Language: a really simple and universal way of describing relational databases in plain text. It describes tables, columns, keys and the relationships between them, and nothing else, so it doesn&amp;rsquo;t matter what sits on top of the database. To give an idea of how little it takes, here are two tables and the relationship between them:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;schema.dbml&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-dbml&#34;&gt;Table users {&#xA;  id integer [pk, increment]&#xA;  email varchar [unique, not null]&#xA;  created_at timestamp [default: `now()`]&#xA;}&#xA;&#xA;Table orders {&#xA;  id integer [pk, increment]&#xA;  user_id integer [not null, ref: &amp;gt; users.id]&#xA;  status varchar [note: &amp;#39;pending, paid or shipped&amp;#39;]&#xA;  created_at timestamp&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;code&gt;ref: &amp;gt; users.id&lt;/code&gt; is the foreign key: many orders point to one user.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-tools-around-it&#34;&gt;The tools around it&lt;/h2&gt;&#xA;&lt;p&gt;The company who developed the language also offers quite a number of things around it, and they all take the same file:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://dbdiagram.io/&#34;&gt;dbdiagram.io&lt;/a&gt; draws the diagram.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://dbdocs.io/&#34;&gt;dbdocs.io&lt;/a&gt; turns it into browsable documentation.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;@dbml/cli&lt;/code&gt; converts it into SQL statements, for both MySQL and PostgreSQL:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;$ npx -p @dbml/cli dbml2sql schema.dbml --postgres -o schema.sql&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Most of these services are available for free, which is also a testament to their open-source commitment!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Diagram, drawn in the post: &lt;a href=&#34;https://blackfyre.ninja/blog/figma-for-databases/&#34;&gt;one file in&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;where-the-two-cents-went&#34;&gt;Where the two cents went&lt;/h2&gt;&#xA;&lt;p&gt;That&amp;rsquo;s what made it work for a refactor everyone had an opinion on. The schema is a text file, so a change is proposed, reviewed and diffed like any other code, and whoever wanted their say had a place to leave it. The diagram is drawn from that same file, so the picture everyone argued over was never out of date.&lt;/p&gt;&#xA;&lt;h2 id=&#34;wrapping-up&#34;&gt;Wrapping up&lt;/h2&gt;&#xA;&lt;p&gt;In short, it&amp;rsquo;s Figma, but for databases! It really propelled the planned database structure, and we had a blast using it!&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>Building my own Delta printer, stage 0</title>
      <link>https://blackfyre.ninja/blog/building-my-own-delta-printer-stage-0/</link>
      <pubDate>Fri, 29 Oct 2021 10:29:40 +0200</pubDate>
      <guid>https://blackfyre.ninja/blog/building-my-own-delta-printer-stage-0/</guid>
      <description>Why I&#39;m designing my own Kossel-style delta after a year with the FLSUN QQ-S Pro, and what goes into it: V-Slot, a Duet 2 Wifi and Klipper.</description>
      <content:encoded>&lt;p&gt;I&amp;rsquo;ve been the owner of an &lt;a href=&#34;https://blackfyre.ninja/blog/flsun-qq-s-and-duet-2-wifi/&#34;&gt;FLSUN QQ-S Pro&lt;/a&gt; printer for the last year, but as time has gone by, some of the printer&amp;rsquo;s shortcomings have come to light.&lt;/p&gt;&#xA;&lt;h2 id=&#34;why-build-one&#34;&gt;Why build one&lt;/h2&gt;&#xA;&lt;p&gt;My gripes with the factory setup:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A lack of documentation for the factory board, and A4988 stepper drivers (this has been addressed since)&lt;/li&gt;&#xA;&lt;li&gt;A lack of CAD files for designing additional components/upgrades&lt;/li&gt;&#xA;&lt;li&gt;The movement system has an inherent flex, as 2×8 mm rods aren&amp;rsquo;t stiff enough at these lengths&lt;/li&gt;&#xA;&lt;li&gt;The sheet metal construction behaves like an amplifier when the movement hits those resonant frequencies, which is always fun to listen to…&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;These and the limited space available led me to the decision to design my own printer. Since &lt;a href=&#34;https://reprap.org/wiki/Kossel&#34;&gt;Kossel&lt;/a&gt;-style printers have open-source components, I&amp;rsquo;ve decided to use that as a starting point, which resulted in &lt;a href=&#34;https://a360.co/3TRXyRd&#34;&gt;this monster&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/building-my-own-delta-printer-stage-0/1_3JMKNgUdbOW32Zvg0OKidg.webp&#34; alt=&#34;A tall triangular delta printer frame of black V-Slot extrusions, with three carriages, the arms and the effector above a round bed&#34; width=&#34;720&#34; height=&#34;540&#34;&gt;&lt;figcaption&gt;FIG. 1 · The design so far.&lt;/figcaption&gt;&lt;/figure&gt;&lt;h2 id=&#34;the-plan&#34;&gt;The plan&lt;/h2&gt;&#xA;&lt;p&gt;As you can see from the design, it uses a Duet 2 Wifi and a Duet Smart Effector, which I&amp;rsquo;m going to source from my QQ-S upgrades, and the whole thing will &lt;a href=&#34;https://blackfyre.ninja/blog/adventures-with-klipper-and-a-duet-2-wifi-on-an-flsun-qq-s-pro/&#34;&gt;run on Klipper&lt;/a&gt;. So there&amp;rsquo;s no real need for a screen, because any device on the local network with a screen and a browser can double as an interface.&lt;/p&gt;&#xA;&lt;p&gt;The frame itself is a combination of your standard 2020/2040/2060 &lt;a href=&#34;https://openbuilds.com/&#34;&gt;OpenBuilds&lt;/a&gt; V-Slot extrusions and Kossel-style corner parts printed (for the moment) from PETG with 70% infill. They feel solid enough for now (and I&amp;rsquo;m cheap and don&amp;rsquo;t want to spend on ABS).&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>Context aware table row actions for Laravel Nova</title>
      <link>https://blackfyre.ninja/blog/context-aware-table-row-actions-for-laravel-nova/</link>
      <pubDate>Wed, 07 Jul 2021 10:23:59 +0200</pubDate>
      <guid>https://blackfyre.ninja/blog/context-aware-table-row-actions-for-laravel-nova/</guid>
      <description>Nova&#39;s table row actions don&#39;t know which row they&#39;re on. Hand them the row&#39;s model with a fluent setter and shape each form to it.</description>
      <content:encoded>&lt;p&gt;During one of our dev runs, there were some fancy action requirements, and I was really happy to find that &lt;a href=&#34;https://nova.laravel.com/&#34;&gt;Laravel Nova&lt;/a&gt; supports actions on the index table rows!&lt;/p&gt;&#xA;&lt;p&gt;So imagine how bummed we were when we found out that said actions don&amp;rsquo;t really know anything about the contents of the table row they&amp;rsquo;re sitting at… even though it works just fine on the resource detail screen. But, as always, there&amp;rsquo;s a way, and you don&amp;rsquo;t even have to install a third-party library to solve this!&lt;/p&gt;&#xA;&lt;p&gt;You only need to do a couple of things. It&amp;rsquo;s so easy that you&amp;rsquo;ll be facepalming for the rest of the week!&lt;/p&gt;&#xA;&lt;p&gt;First, you&amp;rsquo;ll need to create an attribute on your action with a fluent setter for it:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;app/Nova/Actions/EmailAccountProfile.php&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-php&#34;&gt;&amp;lt;?php&#xA;&#xA;namespace App\Nova\Actions;&#xA;&#xA;use App\Models\AccountData;&#xA;use Illuminate\Bus\Queueable;&#xA;use Laravel\Nova\Actions\Action;&#xA;use Illuminate\Support\Collection;&#xA;use Laravel\Nova\Fields\ActionFields;&#xA;use Illuminate\Queue\InteractsWithQueue;&#xA;use Illuminate\Contracts\Queue\ShouldQueue;&#xA;&#xA;class EmailAccountProfile extends Action&#xA;{&#xA;    use InteractsWithQueue, Queueable;&#xA;&#xA;    public $resource;&#xA;&#xA;    /**&#xA;     * Perform the action on the given models.&#xA;     *&#xA;     * @param  \Laravel\Nova\Fields\ActionFields  $fields&#xA;     * @param  \Illuminate\Support\Collection  $models&#xA;     * @return mixed&#xA;     */&#xA;    public function handle(ActionFields $fields, Collection $models)&#xA;    {&#xA;        foreach ($models as $model) {&#xA;            (new AccountData($model))-&amp;gt;send();&#xA;        }&#xA;    }&#xA;&#xA;    /**&#xA;     * Get the fields available on the action.&#xA;     *&#xA;     * @return array&#xA;     */&#xA;    public function fields()&#xA;    {&#xA;        return [];&#xA;    }&#xA;&#xA;    public function setResource($value)&#xA;    {&#xA;        $this-&amp;gt;resource = $value;&#xA;&#xA;        return $this;&#xA;    }&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Second, when you&amp;rsquo;re adding the action to your resource, just set the resource on the action, like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;app/Nova/Account.php&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-php&#34;&gt;/**&#xA; * Get the actions available for the resource.&#xA; *&#xA; * @param  \Illuminate\Http\Request  $request&#xA; * @return array&#xA; */&#xA;public function actions(Request $request)&#xA;{&#xA;    return [&#xA;        (new EmailAccountProfile)&#xA;            -&amp;gt;onlyOnTableRow()&#xA;            -&amp;gt;setResource($this-&amp;gt;resource),&#xA;    ];&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Inside a Nova resource, &lt;code&gt;$this-&amp;gt;resource&lt;/code&gt; is the underlying Eloquent model, so for a row action it&amp;rsquo;s the model of that row.&lt;/p&gt;&#xA;&lt;p&gt;With the model on the action, &lt;code&gt;fields()&lt;/code&gt; can build the form for that particular row. For example, telling the user where the profile is going:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;app/Nova/Actions/EmailAccountProfile.php&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-php&#34;&gt;use Laravel\Nova\Fields\Text;&#xA;&#xA;public function fields()&#xA;{&#xA;    return [&#xA;        Text::make(&amp;#39;Note&amp;#39;)&#xA;            -&amp;gt;help(&amp;#39;The profile goes to &amp;#39; . optional($this-&amp;gt;resource)-&amp;gt;email . &amp;#39;.&amp;#39;),&#xA;    ];&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The &lt;code&gt;optional()&lt;/code&gt; keeps the form from breaking if the action is ever built without a row behind it.&lt;/p&gt;&#xA;&lt;p&gt;With this, you can customise each action&amp;rsquo;s form to the requirements of the actual row, much like in the detail view!&lt;/p&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>Adventures with Klipper and a Duet 2 Wifi on an FLSUN QQ-S Pro</title>
      <link>https://blackfyre.ninja/blog/adventures-with-klipper-and-a-duet-2-wifi-on-an-flsun-qq-s-pro/</link>
      <pubDate>Fri, 28 May 2021 10:04:37 +0200</pubDate>
      <guid>https://blackfyre.ninja/blog/adventures-with-klipper-and-a-duet-2-wifi-on-an-flsun-qq-s-pro/</guid>
      <description>Flashing Klipper onto a Duet 2 Wifi with bossac, and building a working printer.cfg for the FLSUN QQ-S Pro from three different configs.</description>
      <content:encoded>&lt;p&gt;While Duet Web Control is nice and RepRapFirmware is a solid workhorse with a proven track record, I&amp;rsquo;ve really wanted to get on the &lt;a href=&#34;https://www.klipper3d.org/&#34;&gt;Klipper&lt;/a&gt; bandwagon!&lt;/p&gt;&#xA;&lt;p&gt;I wanted to see what the Klipper hype is all about and what it can do for me in print quality and ease-of-life aspects.&lt;/p&gt;&#xA;&lt;p&gt;First of all: Klipper is an alternative firmware for your 3D printer which offloads the heavy lifting (calculations) to an external provider (Raspberry Pi, laptop, desktop, …). This allows for a whole lot, actually! Imagine that your printer is still rocking that old and faithful 8-bit microcontroller, you&amp;rsquo;re still stuck with early versions of Marlin because of space constraints, and you&amp;rsquo;re missing out on all the fun and new features. No more! Klipper to the rescue!&lt;/p&gt;&#xA;&lt;p&gt;Since I&amp;rsquo;ve got a solid board and &lt;a href=&#34;https://blackfyre.ninja/blog/flsun-qq-s-and-duet-2-wifi/&#34;&gt;the wiring already done&lt;/a&gt;, I didn&amp;rsquo;t really want to tinker with the hardware setup, so I went on to flash Klipper onto the Duet, and this is how it went. (This isn&amp;rsquo;t for the faint of heart!)&lt;/p&gt;&#xA;&lt;h2 id=&#34;building-the-firmware&#34;&gt;Building the firmware&lt;/h2&gt;&#xA;&lt;p&gt;The first real hurdle to cross was flashing Klipper onto the Duet board. While documentation is available, it&amp;rsquo;s all over the place… So, to make things easy for next time, here&amp;rsquo;s how the &lt;code&gt;make menuconfig&lt;/code&gt; command should be set up:&lt;/p&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/adventures-with-klipper-and-a-duet-2-wifi-on-an-flsun-qq-s-pro/1_B0B_bbL9J5m7Pd4AaEb3Rg.webp&#34; alt=&#34;Klipper’s menuconfig screen: SAM3/SAM4 (Due and Duet) architecture, SAM4e8e (Duet Wifi/Eth) processor, USB communication&#34; width=&#34;720&#34; height=&#34;405&#34;&gt;&lt;figcaption&gt;FIG. 1 · make menuconfig for a Duet 2 Wifi.&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;This was the easy part; now you can build the firmware.&lt;/p&gt;&#xA;&lt;h2 id=&#34;flashing-the-duet&#34;&gt;Flashing the Duet&lt;/h2&gt;&#xA;&lt;p&gt;The next, harder part (if you&amp;rsquo;re not a regular Duet 2 flasher) was to figure out how to flash the Duet 2 board with the new firmware. This is where the Duet wiki article about flashing comes in handy!&lt;/p&gt;&#xA;&lt;p&gt;You can follow the preparation steps to enter &amp;ldquo;flash mode&amp;rdquo; (and totally erase the previous firmware on entering said state).&lt;/p&gt;&#xA;&lt;p&gt;At this point, you&amp;rsquo;ll have to deviate from all the documentation present and go for another one, which will tell you to use &lt;a href=&#34;https://github.com/shumatech/BOSSA&#34;&gt;&lt;code&gt;bossac&lt;/code&gt;&lt;/a&gt; to flash the printer instead of the nifty little flashing tool provided by Klipper (it also uses &lt;code&gt;bossac&lt;/code&gt;, but with the wrong flags for our case).&lt;/p&gt;&#xA;&lt;p&gt;Take note of the unique port name provided by this command, as you&amp;rsquo;ll need to replace the &lt;code&gt;/dev/ttyACM0&lt;/code&gt; part with its result below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;$ ls /dev/serial/by-id/*&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;So, command line it is:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;~/klipper&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-sh&#34;&gt;$ ./lib/bossac/bin/bossac --port=/dev/ttyACM0 -b -U -e -w -v -R out/klipper.bin&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;code&gt;output&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-text&#34;&gt;Erase flash&#xA;Done in 4.079 seconds&#xA;Write 21864 bytes to flash (43 pages)&#xA;[==============================] 100% (43/43 pages)&#xA;Done in 0.335 seconds&#xA;Verify 21864 bytes of flash&#xA;[==============================] 100% (43/43 pages)&#xA;Verify successful&#xA;Done in 0.327 seconds&#xA;Set boot flash true&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If you see something like this, you&amp;rsquo;re golden! At this point, we have open communications between the printer and the Raspberry Pi (in my case at least, YMMV).&lt;/p&gt;&#xA;&lt;h2 id=&#34;configuring-the-printer&#34;&gt;Configuring the printer&lt;/h2&gt;&#xA;&lt;p&gt;This preparation part was arguably the easier one; the next one can be a bit… Google-heavy 😃 We need to configure our printer! Here are a few resources to do just that:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://docs.duet3d.com/Duet3D_hardware/Duet_2_family/Duet_2_WiFi_Ethernet_Hardware_Overview&#34;&gt;Duet 2 pinout table&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://github.com/Klipper3d/klipper/blob/master/config/generic-duet2.cfg&#34;&gt;Generic Duet 2 config&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://github.com/CobraPi/Klipper-Firmware-FLSUN-QQ-S-Pro-Delta-Printer/blob/main/configurations/printer_qqs(Stock).cfg&#34;&gt;FLSUN QQ-S Klipper config&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.klipper3d.org/Config_Reference.html&#34;&gt;Klipper config reference&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;As you&amp;rsquo;ve probably guessed, we&amp;rsquo;re going to mix and match parts of config files! Here are my results. The first one is where I started:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;printer.cfg (first version)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-ini&#34;&gt;[mcu]&#xA;serial: /dev/serial/by-id/usb-Klipper_sam4e8e_00313953325753543039303330303630-if00&#xA;&#xA;[printer]&#xA;kinematics: delta&#xA;max_velocity: 500&#xA;max_accel: 2000&#xA;max_z_velocity: 200&#xA;minimum_z_position: 0&#xA;delta_radius: 130&#xA;&#xA;[stepper_a]&#xA;step_pin: PD6&#xA;dir_pin: !PD11&#xA;enable_pin: !PC6&#xA;microsteps: 16&#xA;rotation_distance: 32&#xA;endstop_pin: ^PC14&#xA;position_endstop: 316&#xA;arm_length: 288.14&#xA;homing_speed: 60&#xA;second_homing_speed: 5&#xA;&#xA;[tmc2660 stepper_a]&#xA;cs_pin: PD14&#xA;spi_bus: usart1&#xA;run_current: 1.000&#xA;sense_resistor: 0.051&#xA;&#xA;[stepper_b]&#xA;step_pin: PD7&#xA;dir_pin: !PD12&#xA;enable_pin: !PC6&#xA;microsteps: 16&#xA;rotation_distance: 32&#xA;endstop_pin: ^PA2&#xA;&#xA;[tmc2660 stepper_b]&#xA;cs_pin: PC9&#xA;spi_bus: usart1&#xA;run_current: 1.000&#xA;sense_resistor: 0.051&#xA;&#xA;[stepper_c]&#xA;step_pin: PD8&#xA;dir_pin: !PD13&#xA;enable_pin: !PC6&#xA;microsteps: 16&#xA;rotation_distance: 32&#xA;endstop_pin: ^PD29&#xA;&#xA;[tmc2660 stepper_c]&#xA;cs_pin: PC10&#xA;spi_bus: usart1&#xA;run_current: 1.000&#xA;sense_resistor: 0.051&#xA;&#xA;[extruder]&#xA;step_pin: PD5&#xA;dir_pin: PA1&#xA;enable_pin: !PC6&#xA;microsteps: 16&#xA;rotation_distance: 9&#xA;nozzle_diameter: 0.400&#xA;filament_diameter: 1.750&#xA;heater_pin: !PA20&#xA;sensor_type: EPCOS 100K B57560G104F&#xA;sensor_pin: PC15&#xA;control: pid&#xA;pid_Kp: 14.529&#xA;pid_Ki: 0.557&#xA;pid_Kd: 94.802&#xA;min_extrude_temp: 180&#xA;min_temp: 0&#xA;max_temp: 260&#xA;&#xA;[tmc2660 extruder]&#xA;cs_pin: PC17&#xA;spi_bus: usart1&#xA;run_current: 1.000&#xA;sense_resistor: 0.051&#xA;&#xA;[heater_bed]&#xA;heater_pin: !PA19&#xA;sensor_type: EPCOS 100K B57560G104F&#xA;sensor_pin: PC13&#xA;control: pid&#xA;pid_Kp: 325.10&#xA;pid_Ki: 63.35&#xA;pid_Kd: 417.10&#xA;min_temp: 0&#xA;max_temp: 150&#xA;&#xA;[fan]&#xA;pin: PC23&#xA;&#xA;[probe]&#xA;pin: PC1&#xA;z_offset: -0.1&#xA;speed: 20&#xA;samples: 2&#xA;&#xA;[delta_calibrate]&#xA;radius: 120&#xA;&#xA;[gcode_arcs]&#xA;resolution: 1.0&#xA;&#xA;[filament_switch_sensor Filament]&#xA;pause_on_runout: True&#xA;switch_pin: !PD10&#xA;&#xA;[virtual_sdcard]&#xA;path: ~/gcode_files&#xA;&#xA;[display_status]&#xA;&#xA;[pause_resume]&#xA;&#xA;[bed_mesh]&#xA;mesh_radius: 120&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;And this is the one I&amp;rsquo;m running now:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;printer.cfg&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-ini&#34;&gt;# This file contains common pin mappings for Duet2 Eth/Wifi boards. To&#xA;# use this config, the firmware should be compiled for the SAM4E8E.&#xA;&#xA;# See docs/Config_Reference.md for a description of parameters.&#xA;&#xA;[mcu rpi]&#xA;serial: /tmp/klipper_host_mcu&#xA;&#xA;[adxl345]&#xA;cs_pin: rpi:None&#xA;&#xA;[resonance_tester]&#xA;accel_chip: adxl345&#xA;probe_points:&#xA;    0,0,20  # an example&#xA;&#xA;[mcu]&#xA;serial: /dev/serial/by-id/usb-Klipper_sam4e8e_00313953325753543039303330303630-if00&#xA;&#xA;[printer]&#xA;kinematics: delta&#xA;max_velocity: 500&#xA;max_accel: 2000&#xA;max_z_velocity: 200&#xA;minimum_z_position: -5&#xA;#delta_radius: 130&#xA;&#xA;[stepper_a]&#xA;step_pin: PD6&#xA;dir_pin: !PD11&#xA;enable_pin: !PC6&#xA;microsteps: 16&#xA;rotation_distance: 32&#xA;endstop_pin: ^PC14&#xA;#position_endstop: 316&#xA;#arm_length: 288.14&#xA;homing_speed: 60&#xA;second_homing_speed: 5&#xA;&#xA;[tmc2660 stepper_a]&#xA;cs_pin: PD14&#xA;spi_bus: usart1&#xA;run_current: 1.000&#xA;sense_resistor: 0.051&#xA;&#xA;[stepper_b]&#xA;step_pin: PD7&#xA;dir_pin: !PD12&#xA;enable_pin: !PC6&#xA;microsteps: 16&#xA;rotation_distance: 32&#xA;endstop_pin: ^PA2&#xA;&#xA;[tmc2660 stepper_b]&#xA;cs_pin: PC9&#xA;spi_bus: usart1&#xA;run_current: 1.000&#xA;sense_resistor: 0.051&#xA;&#xA;[stepper_c]&#xA;step_pin: PD8&#xA;dir_pin: !PD13&#xA;enable_pin: !PC6&#xA;microsteps: 16&#xA;rotation_distance: 32&#xA;endstop_pin: ^PD29&#xA;&#xA;[tmc2660 stepper_c]&#xA;cs_pin: PC10&#xA;spi_bus: usart1&#xA;run_current: 1.000&#xA;sense_resistor: 0.051&#xA;&#xA;[extruder]&#xA;step_pin: PD5&#xA;dir_pin: PA1&#xA;enable_pin: !PC6&#xA;microsteps: 16&#xA;rotation_distance: 7.618&#xA;nozzle_diameter: 0.400&#xA;filament_diameter: 1.750&#xA;heater_pin: !PA20&#xA;sensor_type: EPCOS 100K B57560G104F&#xA;sensor_pin: PC15&#xA;#control: pid&#xA;#pid_Kp: 14.529&#xA;#pid_Ki: 0.557&#xA;#pid_Kd: 94.802&#xA;min_extrude_temp: 180&#xA;min_temp: 0&#xA;max_temp: 260&#xA;max_extrude_cross_section: 50&#xA;pressure_advance: 0.082&#xA;&#xA;[tmc2660 extruder]&#xA;cs_pin: PC17&#xA;spi_bus: usart1&#xA;run_current: 1.000&#xA;sense_resistor: 0.051&#xA;&#xA;&#xA;#[extruder1]&#xA;#step_pin: PD4&#xA;#dir_pin: PD9&#xA;#enable_pin: !PC6&#xA;#heater_pin: !PA16&#xA;#sensor_pin: PC12&#xA;#...&#xA;#[tmc2660 extruder1]&#xA;#cs_pin: PC25&#xA;#spi_bus: usart1&#xA;#sense_resistor: 0.051&#xA;#...&#xA;&#xA;[heater_bed]&#xA;heater_pin: !PA19&#xA;sensor_type: EPCOS 100K B57560G104F&#xA;sensor_pin: PC13&#xA;#control: pid&#xA;#pid_Kp: 325.10&#xA;#pid_Ki: 63.35&#xA;#pid_Kd: 417.10&#xA;min_temp: 0&#xA;max_temp: 150&#xA;&#xA;[fan]&#xA;pin: PC23  # FAN0&#xA;&#xA;#[heater_fan nozzle_cooling_fan]&#xA;#pin: PC26  # FAN1&#xA;&#xA;#[heater_fan board_cooling_fan]&#xA;#pin: PA0  # FAN2&#xA;&#xA;[probe]&#xA;pin: PC1&#xA;z_offset: -0.340&#xA;speed: 20&#xA;samples: 2&#xA;samples_tolerance_retries: 2&#xA;&#xA;[delta_calibrate]&#xA;radius: 120&#xA;&#xA;[gcode_arcs]&#xA;resolution: 1.0&#xA;&#xA;[filament_switch_sensor Filament]&#xA;pause_on_runout: false #pause handled by macro&#xA;runout_gcode:&#xA;  M600 #calls a macro with the name M600 (so it can be called by slicers too)&#xA;switch_pin: !PD10&#xA;&#xA;[virtual_sdcard]&#xA;path: ~/gcode_files&#xA;&#xA;[display_status]&#xA;&#xA;[pause_resume]&#xA;&#xA;[bed_mesh]&#xA;mesh_radius: 120&#xA;&#xA;# This macro should be called at the &amp;#39;start g-code&amp;#39; part&#xA;# of your slicer and you would put all the start g-code here&#xA;# instead so that you don&amp;#39;t have to re-slice everytime you&#xA;# have to edit the commands&#xA;[gcode_macro START_PRINT]&#xA;gcode:&#xA;    SET_GCODE_OFFSET Z=0.0&#xA;    SET_GCODE_OFFSET Z_ADJUST=-0.1 MOVE=1 # PETG for 260mm plate&#xA;    #SET_GCODE_OFFSET Z_ADJUST=-0.340 MOVE=1 # PLA for 260mm plate&#xA;    #SET_GCODE_OFFSET Z_ADJUST=-0.560 MOVE=1 # PLA for 265mm plate&#xA;&#xA;# This macro should be called at the &amp;#39;end g-code&amp;#39; part&#xA;# of your slicer and like the macro above, you would&#xA;# also put all of your end g-code here for the same reason as above&#xA;[gcode_macro END_PRINT]&#xA;gcode:&#xA;    G91&#xA;    G1 E-7 F2100&#xA;    SET_GCODE_OFFSET Z_ADJUST=0 # resets the z-offset (otherwise, )&#xA;&#xA;# Pause print macro&#xA;[gcode_macro PAUSE]&#xA;rename_existing: BASE_PAUSE&#xA;default_parameter_X: 0    #edit to your park position&#xA;default_parameter_Y: 100    #edit to your park position&#xA;default_parameter_Z: 30     #edit to your park position&#xA;default_parameter_E: 5      #edit to your retract length&#xA;gcode:&#xA;    SAVE_GCODE_STATE NAME=PAUSE_state&#xA;    BASE_PAUSE&#xA;    G91&#xA;    G1 E-{E} F2100&#xA;    G1 Z{Z}&#xA;    G90&#xA;    G1 X{X} Y{Y} F6000&#xA;&#xA;# Resume print macro&#xA;[gcode_macro RESUME]&#xA;rename_existing: BASE_RESUME&#xA;default_parameter_E: 5      #edit to your retract length&#xA;gcode:&#xA;    G91&#xA;    G1 E{E} F2100&#xA;    G90&#xA;    RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1&#xA;    BASE_RESUME&#xA;&#xA;# Cancel print macro&#xA;[gcode_macro CANCEL_PRINT]&#xA;rename_existing: BASE_CANCEL_PRINT&#xA;gcode:&#xA;    TURN_OFF_HEATERS&#xA;    CLEAR_PAUSE&#xA;    SDCARD_RESET_FILE&#xA;    BASE_CANCEL_PRINT&#xA;    G28&#xA;    END_PRINT&#xA;&#xA;[gcode_macro SET_Z]&#xA;gcode:&#xA;    G28&#xA;    G1 X0 Y0 Z10 F5000&#xA;    PROBE&#xA;    G1 X0 Y0 Z10&#xA;    G1 X0 Y0 Z0&#xA;&#xA;[gcode_macro UNLOAD]&#xA;gcode:&#xA;    M83&#xA;    G0 E-50 F1800&#xA;    G0 E-50 F1800&#xA;    G0 E-50 F1800&#xA;    G0 E-50 F1800&#xA;    G0 E-50 F1800&#xA;    G0 E-50 F1800&#xA;    G0 E-50 F1800&#xA;    G0 E-50 F1800&#xA;    G0 E-50 F1800&#xA;    G0 E-50 F1800&#xA;    G0 E-50 F1800&#xA;    G0 E-50 F1800&#xA;    G0 E-50 F1800&#xA;&#xA;[gcode_macro LOAD]&#xA;gcode:&#xA;    M83&#xA;    G0 E50 F1800&#xA;    G0 E50 F1800&#xA;    G0 E50 F1800&#xA;    G0 E50 F1800&#xA;    G0 E50 F1800&#xA;    G0 E50 F1800&#xA;    G0 E50 F1800&#xA;    G0 E50 F1800&#xA;    G0 E50 F1800&#xA;    G0 E50 F1800&#xA;    G0 E50 F1800&#xA;    G0 E50 F1800&#xA;&#xA;[gcode_macro PARK_MACRO]&#xA;default_parameter_X: 0&#xA;default_parameter_Y: 100&#xA;default_parameter_Z: 30&#xA;gcode:&#xA;        M117 PARKING..&#xA;        G91&#xA;        G1 E-3.14 F1500&#xA;        G1 Z{Z}&#xA;&#x9;G90&#xA;&#x9;G1 X{X} Y{Y} F3000&#xA;        &#xA;[gcode_macro M600]&#xA;gcode:&#xA;&#x9;PAUSE_MACRO&#xA;&#x9;UNLOAD&#xA;&#xA;[gcode_macro PAUSE_MACRO]&#xA;gcode:&#xA;&#x9;PAUSE&#xA;&#x9;PARK_MACRO&#xA;&#x9;&#xA;[gcode_macro PURGE]&#xA;gcode:&#xA;        M117 PURGING..&#xA;        G91&#xA;        G1 E45.0 F250&#xA;        G1 E45.0 F250&#xA;        G1 E-5 F1800&#xA;        G90&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Compared to the first version, a few things moved or got added:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;delta_radius&lt;/code&gt;, &lt;code&gt;position_endstop&lt;/code&gt;, &lt;code&gt;arm_length&lt;/code&gt; and the PID values are commented out, because &lt;code&gt;DELTA_CALIBRATE&lt;/code&gt;, &lt;code&gt;PID_CALIBRATE&lt;/code&gt; and &lt;code&gt;SAVE_CONFIG&lt;/code&gt; store the calibrated values in the auto-generated block at the end of &lt;code&gt;printer.cfg&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The Raspberry Pi is a second MCU (&lt;code&gt;[mcu rpi]&lt;/code&gt;), so an ADXL345 accelerometer on it can drive &lt;code&gt;[resonance_tester]&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The extruder&amp;rsquo;s &lt;code&gt;rotation_distance&lt;/code&gt; is calibrated, and &lt;code&gt;pressure_advance&lt;/code&gt; is set.&lt;/li&gt;&#xA;&lt;li&gt;The macros: &lt;code&gt;START_PRINT&lt;/code&gt; and &lt;code&gt;END_PRINT&lt;/code&gt; keep the start and end G-code out of the slicer, and filament runout goes through an &lt;code&gt;M600&lt;/code&gt; macro that pauses, parks and unloads.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;</content:encoded>
    </item>
    <item>
      <title>FLSUN QQ-S and Duet 2 Wifi</title>
      <link>https://blackfyre.ninja/blog/flsun-qq-s-and-duet-2-wifi/</link>
      <pubDate>Fri, 16 Oct 2020 09:37:19 +0200</pubDate>
      <guid>https://blackfyre.ninja/blog/flsun-qq-s-and-duet-2-wifi/</guid>
      <description>Swapping the FLSUN QQ-S Pro&#39;s factory board for a Duet 2 Wifi: the odd factory wiring, the inverted probe on RepRapFirmware 3, and a working config.</description>
      <content:encoded>&lt;p&gt;&lt;em&gt;This is a work-in-progress project; I&amp;rsquo;m using this post to document the progress!&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;So, I&amp;rsquo;ve been into 3D printing since I got my &lt;a href=&#34;https://www.creality.com/products/ender-3-3d-printer&#34;&gt;Creality Ender 3&lt;/a&gt; last year, and I thought that things could be a bit more interesting with a delta-style printer. My choice was the FLSUN QQ-S Pro, which has a larger build volume than the Ender 3 and has a relatively small, but solid, community on Facebook behind it.&lt;/p&gt;&#xA;&lt;p&gt;During the first print, a couple of ideas formed in my head about how to make the printer quieter. I like to leave the printers running during the night, and my workspace is shared with the printers, so quieting them is a must-have for me. For my Ender 3, I&amp;rsquo;ve used the BigTreeTech E3 DIP board with TMC2208 stepper drivers, but for the QQ-S, I wanted something different. This is why my choice for the new board went to the Duet 2 Wifi, which came highly recommended even when I was debating the choice of board for the Ender 3.&lt;/p&gt;&#xA;&lt;p&gt;I won&amp;rsquo;t go into details about the differences between the FLSUN factory HiSpeed v1.0 board and the Duet; there are several articles about that already… So, here&amp;rsquo;s the process :)&lt;/p&gt;&#xA;&lt;h2 id=&#34;hardware-setup&#34;&gt;Hardware setup&lt;/h2&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/flsun-qq-s-and-duet-2-wifi/1_zGyUfnVovUSdU-3b5AoECQ.webp&#34; alt=&#34;The QQ-S Pro’s base opened up: the factory board on the left, the power supply in the middle, and the wiring between them&#34; width=&#34;720&#34; height=&#34;324&#34;&gt;&lt;figcaption&gt;FIG. 1 · The factory setup, before anything was touched.&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;It started out with the quite neatly organised factory setup. I was actually impressed, after the job Creality did on the Ender 3!&lt;/p&gt;&#xA;&lt;p&gt;Some odd things to note:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The heated bed&amp;rsquo;s positive lead comes from the PSU, while the negative is attached to the board.&lt;/li&gt;&#xA;&lt;li&gt;The Z probe&amp;rsquo;s lead was broken into two parts.&lt;/li&gt;&#xA;&lt;li&gt;The stepper motors got dampers on them (under the white covers), which was a pleasant surprise after hearing a lot about bent mounting profiles due to over-tensioning.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;wiring-the-duet&#34;&gt;Wiring the Duet&lt;/h2&gt;&#xA;&lt;p&gt;The wiring should be pretty straightforward… with a couple of caveats (as always). FLSUN made a couple of interesting design choices, which are listed below.&lt;/p&gt;&#xA;&lt;p&gt;An important thing to note is that there are three ways of approaching this:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The clean way (which involves recrimping all the connectors)&lt;/li&gt;&#xA;&lt;li&gt;The hacky way (which is the flush-cutter treatment on the JST connectors)&lt;/li&gt;&#xA;&lt;li&gt;The optional way (this one requires a considerable amount of Dupont jumper cables)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The choice is yours!&lt;/p&gt;&#xA;&lt;p&gt;A couple of things to look out for:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The wires aren&amp;rsquo;t marked, so you&amp;rsquo;ll need to mark them first!&lt;/li&gt;&#xA;&lt;li&gt;The stepper connections are good as they are!&lt;/li&gt;&#xA;&lt;li&gt;The endstops are normally closed switches, so the pins have to be adjusted accordingly (the 3V3 and STP pins must be populated).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Take these with a grain of salt, as the cables&amp;rsquo; colour coding may change depending on the unit. Be sure to double-check it!&lt;/p&gt;&#xA;&lt;p&gt;And the sketchy part (FLSUN&amp;rsquo;s design choices):&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The (−) of the bed heater was wired to the board, and the (+) to the PSU.&lt;/li&gt;&#xA;&lt;li&gt;The purple wire is the common GND for the probe and the hot-end fan.&lt;/li&gt;&#xA;&lt;li&gt;The green/turquoise wire is a common (+) for the hot-end and part-cooling fans.&lt;/li&gt;&#xA;&lt;li&gt;The single black wire is the PWM-controlled part of the part-cooling fan.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;mounting&#34;&gt;Mounting&lt;/h2&gt;&#xA;&lt;p&gt;For mounting the board, you can use &lt;a href=&#34;https://www.thingiverse.com/thing:4308438&#34;&gt;this bracket on Thingiverse&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;What I&amp;rsquo;m going to do at this point is move the PSU to the outside and get the board up and running. This way I can print a mounting plate that uses the old stand-offs, so the board can be mounted properly. After that, the PSU will get a case, for life-protection reasons…&lt;/p&gt;&#xA;&lt;p&gt;FYI, at the moment I&amp;rsquo;m thinking that just about any board replacement will be hindered by the creative ways the original wiring was done…&lt;/p&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://blackfyre.ninja/blog/flsun-qq-s-and-duet-2-wifi/1_JFipZGZucAGtzHTB-LO_JQ.webp&#34; alt=&#34;The Duet 2 Wifi in place of the factory board, with the printer’s wiring connected to it&#34; width=&#34;720&#34; height=&#34;1600&#34;&gt;&lt;figcaption&gt;FIG. 2 · The Duet 2 Wifi wired in.&lt;/figcaption&gt;&lt;/figure&gt;&lt;p&gt;This is the wiring… for now, at least… I&amp;rsquo;m planning to add another extruder with a Y splitter on the Bowden tube in the near future.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-probe&#34;&gt;The probe&lt;/h2&gt;&#xA;&lt;p&gt;As I was going around the forums, trouble with the probe came up multiple times; the reason may be the &amp;ldquo;creative&amp;rdquo; wiring mentioned above. BTW, the probe is a normally closed switch. I haven&amp;rsquo;t seen a config option for that in the online RepRap config tool… But at least I&amp;rsquo;ve managed to get the probe to react on the Duet&amp;rsquo;s dashboard!&lt;/p&gt;&#xA;&lt;p&gt;Turns out, wiring the probe is different between firmwares. As it&amp;rsquo;s highly recommended to upgrade to the latest, I&amp;rsquo;ll only cover RepRapFirmware 3.&lt;/p&gt;&#xA;&lt;p&gt;You&amp;rsquo;ll need to use the Z-probe pins (as seen on the wiring image). Don&amp;rsquo;t listen to the online configuration tool, and there will be necessary changes to the generated code as well.&lt;/p&gt;&#xA;&lt;h2 id=&#34;software&#34;&gt;Software&lt;/h2&gt;&#xA;&lt;p&gt;Having an &lt;a href=&#34;https://configtool.reprapfirmware.org/&#34;&gt;online configuration tool&lt;/a&gt; for RepRapFirmware is a huge advantage over Marlin and makes things a lot easier.&lt;/p&gt;&#xA;&lt;p&gt;Below is my working &lt;code&gt;config.json&lt;/code&gt; file, which you can feed to the configurator to base your setup on. Only one thing to note: for the Z probe to work, you&amp;rsquo;ll need one adjustment after uploading the resulting G-code files.&lt;/p&gt;&#xA;&lt;p&gt;In your uploaded &lt;code&gt;config.g&lt;/code&gt; file, the first line under Z-Probe (&lt;a href=&#34;https://docs.duet3d.com/User_manual/Reference/Gcodes#m558-set-z-probe-type&#34;&gt;&lt;code&gt;M558&lt;/code&gt;&lt;/a&gt;) has to have its logic inverted. To do that, you&amp;rsquo;ll have to add a &lt;code&gt;!&lt;/code&gt; in the &lt;code&gt;C&lt;/code&gt; attribute, like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;config.g&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-gcode&#34;&gt;M558 P8 C&amp;#34;!^zprobe.in&amp;#34; H5 F120 T6000 ; ! inverts the input (the probe is normally closed), ^ enables the pull-up&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If you&amp;rsquo;ve done this correctly, the Z probe should show a 0 value on the dashboard, instead of a red 1000.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;config.json&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-json&#34;&gt;{&#xA;  &amp;#34;board&amp;#34;: &amp;#34;duetwifi10&amp;#34;,&#xA;  &amp;#34;expansion_boards&amp;#34;: [],&#xA;  &amp;#34;firmware&amp;#34;: 3,&#xA;  &amp;#34;standalone&amp;#34;: true,&#xA;  &amp;#34;nvram&amp;#34;: false,&#xA;  &amp;#34;auto_save&amp;#34;: {&#xA;    &amp;#34;enabled&amp;#34;: true,&#xA;    &amp;#34;save_threshold&amp;#34;: 10,&#xA;    &amp;#34;resume_threshold&amp;#34;: 11,&#xA;    &amp;#34;gcodes_to_run&amp;#34;: &amp;#34;M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000&amp;#34;&#xA;  },&#xA;  &amp;#34;display&amp;#34;: {&#xA;    &amp;#34;type&amp;#34;: 0,&#xA;    &amp;#34;encoder_steps&amp;#34;: 4,&#xA;    &amp;#34;spi_frequency&amp;#34;: 2000000,&#xA;    &amp;#34;menus&amp;#34;: [{ &amp;#34;name&amp;#34;: &amp;#34;main&amp;#34;, &amp;#34;value&amp;#34;: &amp;#34;&amp;#34; }],&#xA;    &amp;#34;images&amp;#34;: []&#xA;  },&#xA;  &amp;#34;panelDue&amp;#34;: false,&#xA;  &amp;#34;geometry&amp;#34;: {&#xA;    &amp;#34;type&amp;#34;: &amp;#34;delta&amp;#34;,&#xA;    &amp;#34;mins&amp;#34;: [0, 0, 0],&#xA;    &amp;#34;maxes&amp;#34;: [230, 210, 200],&#xA;    &amp;#34;delta_radius&amp;#34;: 130,&#xA;    &amp;#34;homed_height&amp;#34;: 320,&#xA;    &amp;#34;low_dive_height&amp;#34;: false,&#xA;    &amp;#34;max_carriage_travel&amp;#34;: 450,&#xA;    &amp;#34;print_radius&amp;#34;: 130,&#xA;    &amp;#34;rod_length&amp;#34;: 280,&#xA;    &amp;#34;z_min&amp;#34;: 0&#xA;  },&#xA;  &amp;#34;drives&amp;#34;: [&#xA;    {&#xA;      &amp;#34;direction&amp;#34;: 0,&#xA;      &amp;#34;microstepping&amp;#34;: 16,&#xA;      &amp;#34;microstepping_interpolation&amp;#34;: true,&#xA;      &amp;#34;steps_per_mm&amp;#34;: 100,&#xA;      &amp;#34;instant_dv&amp;#34;: 20,&#xA;      &amp;#34;max_speed&amp;#34;: 200,&#xA;      &amp;#34;acceleration&amp;#34;: 1000,&#xA;      &amp;#34;current&amp;#34;: 1000,&#xA;      &amp;#34;driver&amp;#34;: 0,&#xA;      &amp;#34;driver_v3&amp;#34;: &amp;#34;0.0&amp;#34;,&#xA;      &amp;#34;endstop_pin&amp;#34;: &amp;#34;xstop&amp;#34;,&#xA;      &amp;#34;endstop_type&amp;#34;: 1,&#xA;      &amp;#34;endstop_location&amp;#34;: 2&#xA;    },&#xA;    {&#xA;      &amp;#34;direction&amp;#34;: 0,&#xA;      &amp;#34;microstepping&amp;#34;: 16,&#xA;      &amp;#34;microstepping_interpolation&amp;#34;: true,&#xA;      &amp;#34;steps_per_mm&amp;#34;: 100,&#xA;      &amp;#34;instant_dv&amp;#34;: 20,&#xA;      &amp;#34;max_speed&amp;#34;: 200,&#xA;      &amp;#34;acceleration&amp;#34;: 1000,&#xA;      &amp;#34;current&amp;#34;: 1000,&#xA;      &amp;#34;driver&amp;#34;: 1,&#xA;      &amp;#34;driver_v3&amp;#34;: &amp;#34;0.1&amp;#34;,&#xA;      &amp;#34;endstop_pin&amp;#34;: &amp;#34;ystop&amp;#34;,&#xA;      &amp;#34;endstop_type&amp;#34;: 1,&#xA;      &amp;#34;endstop_location&amp;#34;: 2&#xA;    },&#xA;    {&#xA;      &amp;#34;direction&amp;#34;: 0,&#xA;      &amp;#34;microstepping&amp;#34;: 16,&#xA;      &amp;#34;microstepping_interpolation&amp;#34;: true,&#xA;      &amp;#34;steps_per_mm&amp;#34;: 100,&#xA;      &amp;#34;instant_dv&amp;#34;: 20,&#xA;      &amp;#34;max_speed&amp;#34;: 200,&#xA;      &amp;#34;acceleration&amp;#34;: 1000,&#xA;      &amp;#34;current&amp;#34;: 1000,&#xA;      &amp;#34;driver&amp;#34;: 2,&#xA;      &amp;#34;driver_v3&amp;#34;: &amp;#34;0.2&amp;#34;,&#xA;      &amp;#34;endstop_pin&amp;#34;: &amp;#34;zstop&amp;#34;,&#xA;      &amp;#34;endstop&amp;#34;: null,&#xA;      &amp;#34;endstop_type&amp;#34;: 1,&#xA;      &amp;#34;endstop_location&amp;#34;: 2&#xA;    },&#xA;    {&#xA;      &amp;#34;direction&amp;#34;: 1,&#xA;      &amp;#34;microstepping&amp;#34;: 16,&#xA;      &amp;#34;microstepping_interpolation&amp;#34;: true,&#xA;      &amp;#34;steps_per_mm&amp;#34;: 417,&#xA;      &amp;#34;instant_dv&amp;#34;: 20,&#xA;      &amp;#34;max_speed&amp;#34;: 200,&#xA;      &amp;#34;acceleration&amp;#34;: 1000,&#xA;      &amp;#34;current&amp;#34;: 800,&#xA;      &amp;#34;driver&amp;#34;: 3,&#xA;      &amp;#34;driver_v3&amp;#34;: &amp;#34;0.3&amp;#34;&#xA;    }&#xA;  ],&#xA;  &amp;#34;idle&amp;#34;: { &amp;#34;used&amp;#34;: true, &amp;#34;factor&amp;#34;: 30, &amp;#34;timeout&amp;#34;: 30 },&#xA;  &amp;#34;homing_speed_fast&amp;#34;: 30,&#xA;  &amp;#34;homing_speed_slow&amp;#34;: 6,&#xA;  &amp;#34;travel_speed&amp;#34;: 100,&#xA;  &amp;#34;z_dive_height&amp;#34;: 5,&#xA;  &amp;#34;slow_homing&amp;#34;: false,&#xA;  &amp;#34;probe&amp;#34;: {&#xA;    &amp;#34;type&amp;#34;: &amp;#34;switch&amp;#34;,&#xA;    &amp;#34;recovery_time&amp;#34;: 0.4,&#xA;    &amp;#34;trigger_height&amp;#34;: 16.2,&#xA;    &amp;#34;trigger_value&amp;#34;: 500,&#xA;    &amp;#34;x_offset&amp;#34;: 0,&#xA;    &amp;#34;y_offset&amp;#34;: 0,&#xA;    &amp;#34;speed&amp;#34;: 2,&#xA;    &amp;#34;deploy&amp;#34;: false,&#xA;    &amp;#34;points&amp;#34;: [&#xA;      { &amp;#34;x&amp;#34;: 0, &amp;#34;y&amp;#34;: 84.9, &amp;#34;z&amp;#34;: 0 },&#xA;      { &amp;#34;x&amp;#34;: 73.53, &amp;#34;y&amp;#34;: -42.45, &amp;#34;z&amp;#34;: 0 },&#xA;      { &amp;#34;x&amp;#34;: -73.53, &amp;#34;y&amp;#34;: -42.45, &amp;#34;z&amp;#34;: 0 },&#xA;      { &amp;#34;x&amp;#34;: 0, &amp;#34;y&amp;#34;: 42.4, &amp;#34;z&amp;#34;: 0 },&#xA;      { &amp;#34;x&amp;#34;: 36.72, &amp;#34;y&amp;#34;: -21.2, &amp;#34;z&amp;#34;: 0 },&#xA;      { &amp;#34;x&amp;#34;: -36.72, &amp;#34;y&amp;#34;: -21.2, &amp;#34;z&amp;#34;: 0 },&#xA;      { &amp;#34;x&amp;#34;: 0, &amp;#34;y&amp;#34;: 0, &amp;#34;z&amp;#34;: 0 }&#xA;    ],&#xA;    &amp;#34;pwm_channel&amp;#34;: 3,&#xA;    &amp;#34;pwm_inverted&amp;#34;: true,&#xA;    &amp;#34;pwm_pin&amp;#34;: null,&#xA;    &amp;#34;input_pin&amp;#34;: &amp;#34;zprobe.in&amp;#34;,&#xA;    &amp;#34;modulation_pin&amp;#34;: null&#xA;  },&#xA;  &amp;#34;bed_is_nozzle&amp;#34;: false,&#xA;  &amp;#34;bed&amp;#34;: { &amp;#34;present&amp;#34;: true, &amp;#34;use_pid&amp;#34;: false, &amp;#34;heater&amp;#34;: 0 },&#xA;  &amp;#34;chamber&amp;#34;: { &amp;#34;present&amp;#34;: false, &amp;#34;use_pid&amp;#34;: false, &amp;#34;heater&amp;#34;: 2 },&#xA;  &amp;#34;heaters&amp;#34;: [&#xA;    {&#xA;      &amp;#34;temp_limit&amp;#34;: 120,&#xA;      &amp;#34;scale_factor&amp;#34;: 100,&#xA;      &amp;#34;series&amp;#34;: 4700,&#xA;      &amp;#34;thermistor&amp;#34;: 100000,&#xA;      &amp;#34;beta&amp;#34;: 4092,&#xA;      &amp;#34;c&amp;#34;: 0,&#xA;      &amp;#34;channel&amp;#34;: 0,&#xA;      &amp;#34;sensor&amp;#34;: 0,&#xA;      &amp;#34;output_pin&amp;#34;: &amp;#34;bedheat&amp;#34;,&#xA;      &amp;#34;sensor_type&amp;#34;: &amp;#34;thermistor&amp;#34;,&#xA;      &amp;#34;sensor_pin&amp;#34;: &amp;#34;bedtemp&amp;#34;&#xA;    },&#xA;    {&#xA;      &amp;#34;temp_limit&amp;#34;: 260,&#xA;      &amp;#34;scale_factor&amp;#34;: 100,&#xA;      &amp;#34;series&amp;#34;: 4700,&#xA;      &amp;#34;thermistor&amp;#34;: 100000,&#xA;      &amp;#34;beta&amp;#34;: 4092,&#xA;      &amp;#34;c&amp;#34;: 0,&#xA;      &amp;#34;channel&amp;#34;: 1,&#xA;      &amp;#34;sensor&amp;#34;: 1,&#xA;      &amp;#34;output_pin&amp;#34;: &amp;#34;e0heat&amp;#34;,&#xA;      &amp;#34;sensor_type&amp;#34;: &amp;#34;thermistor&amp;#34;,&#xA;      &amp;#34;sensor_pin&amp;#34;: &amp;#34;e0temp&amp;#34;&#xA;    }&#xA;  ],&#xA;  &amp;#34;num_nozzles&amp;#34;: 1,&#xA;  &amp;#34;toolchange_wait_for_temperatures&amp;#34;: true,&#xA;  &amp;#34;generate_t_code&amp;#34;: true,&#xA;  &amp;#34;tools&amp;#34;: [&#xA;    {&#xA;      &amp;#34;mix_ratio&amp;#34;: [],&#xA;      &amp;#34;number&amp;#34;: 0,&#xA;      &amp;#34;name&amp;#34;: &amp;#34;HotEnd&amp;#34;,&#xA;      &amp;#34;extruders&amp;#34;: [0],&#xA;      &amp;#34;heaters&amp;#34;: [1],&#xA;      &amp;#34;fans&amp;#34;: [0],&#xA;      &amp;#34;x_offset&amp;#34;: 0,&#xA;      &amp;#34;y_offset&amp;#34;: 0,&#xA;      &amp;#34;z_offset&amp;#34;: 0&#xA;    }&#xA;  ],&#xA;  &amp;#34;compensation_x_offset&amp;#34;: 15,&#xA;  &amp;#34;compensation_y_offset&amp;#34;: 15,&#xA;  &amp;#34;peripheral_points&amp;#34;: 3,&#xA;  &amp;#34;halfway_points&amp;#34;: 3,&#xA;  &amp;#34;calibration_factors&amp;#34;: 6,&#xA;  &amp;#34;probe_radius&amp;#34;: 130,&#xA;  &amp;#34;mesh&amp;#34;: {&#xA;    &amp;#34;x_min&amp;#34;: 15,&#xA;    &amp;#34;x_max&amp;#34;: 215,&#xA;    &amp;#34;y_min&amp;#34;: 15,&#xA;    &amp;#34;y_max&amp;#34;: 195,&#xA;    &amp;#34;radius&amp;#34;: 85,&#xA;    &amp;#34;spacing&amp;#34;: 20&#xA;  },&#xA;  &amp;#34;home_first&amp;#34;: false,&#xA;  &amp;#34;orthogonal&amp;#34;: {&#xA;    &amp;#34;compensation&amp;#34;: false,&#xA;    &amp;#34;height&amp;#34;: 50,&#xA;    &amp;#34;deviations&amp;#34;: [0, 0, 0]&#xA;  },&#xA;  &amp;#34;network&amp;#34;: {&#xA;    &amp;#34;enabled&amp;#34;: true,&#xA;    &amp;#34;mac_address&amp;#34;: &amp;#34;&amp;#34;,&#xA;    &amp;#34;name&amp;#34;: &amp;#34;Legionare&amp;#34;,&#xA;    &amp;#34;password&amp;#34;: &amp;#34;&amp;#34;,&#xA;    &amp;#34;ssid&amp;#34;: &amp;#34;&amp;#34;,&#xA;    &amp;#34;ssid_password&amp;#34;: &amp;#34;&amp;#34;,&#xA;    &amp;#34;dhcp&amp;#34;: true,&#xA;    &amp;#34;ip&amp;#34;: &amp;#34;192.168.1.20&amp;#34;,&#xA;    &amp;#34;netmask&amp;#34;: &amp;#34;255.255.255.0&amp;#34;,&#xA;    &amp;#34;gateway&amp;#34;: &amp;#34;192.168.1.254&amp;#34;,&#xA;    &amp;#34;protocols&amp;#34;: { &amp;#34;http&amp;#34;: true, &amp;#34;ftp&amp;#34;: false, &amp;#34;telnet&amp;#34;: false }&#xA;  },&#xA;  &amp;#34;fans&amp;#34;: [&#xA;    {&#xA;      &amp;#34;name&amp;#34;: &amp;#34;Effector&amp;#34;,&#xA;      &amp;#34;value&amp;#34;: 0,&#xA;      &amp;#34;inverted&amp;#34;: false,&#xA;      &amp;#34;frequency&amp;#34;: 500,&#xA;      &amp;#34;thermostatic&amp;#34;: false,&#xA;      &amp;#34;heaters&amp;#34;: [1],&#xA;      &amp;#34;trigger_temperature&amp;#34;: 45,&#xA;      &amp;#34;output_pin&amp;#34;: &amp;#34;fan0&amp;#34;&#xA;    }&#xA;  ],&#xA;  &amp;#34;custom_settings&amp;#34;: &amp;#34;M307 H0 A109.6 C363.9 D0.2 V23.9 B0&amp;#34;&#xA;}&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;some-troubleshooting&#34;&gt;Some troubleshooting&lt;/h2&gt;&#xA;&lt;p&gt;If you get heater errors like:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Error: Heater 0 fault: temperature rising much more slowly than the expected 1.8°C/sec&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;you can do a heater calibration. The details are in the &lt;a href=&#34;https://docs.duet3d.com/User_manual/Connecting_hardware/Temperature_connecting_thermistors_PT1000&#34;&gt;Duet documentation on connecting thermistors&lt;/a&gt;; just don&amp;rsquo;t forget to adjust the example G-code based on which heater you&amp;rsquo;re tuning.&lt;/p&gt;&#xA;</content:encoded>
    </item>
  </channel>
</rss>
