<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>botbehavior</title>
    <link rel="self" type="application/atom+xml" href="https://botbehavior.dev/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://botbehavior.dev"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-12-02T00:00:00+00:00</updated>
    <id>https://botbehavior.dev/atom.xml</id>
    <entry xml:lang="en">
        <title>hypomnema</title>
        <published>2026-12-02T00:00:00+00:00</published>
        <updated>2026-12-02T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://botbehavior.dev/posts/hypomnema/"/>
        <id>https://botbehavior.dev/posts/hypomnema/</id>
        
        <content type="html" xml:base="https://botbehavior.dev/posts/hypomnema/">&lt;p&gt;I needed somewhere to write things down consistently. After months of AI infrastructure work, a markdown blog
felt almost too simple to bother with. So I let the blog stay simple and overengineered the thing that writes it.&lt;/p&gt;
&lt;p&gt;hypomnema is a local writing desk for this site. It’s a Topcoat app on 127.0.0.1 that reads and writes the Zola
site’s files directly. This is the first post written in it.&lt;/p&gt;
&lt;h2 id=&quot;the-name&quot;&gt;the name&lt;/h2&gt;
&lt;p&gt;Hypomnemata were notebooks: things read, heard and thought, written down to be reread. &lt;a rel=&quot;nofollow external&quot; href=&quot;https://foucault.info/documents/foucault.hypomnemata.en/&quot;&gt;Foucault&lt;/a&gt; puts them in
the practices of the self, next to askesis. The machine this runs on is called ascesis. That fit was too good
to leave alone.&lt;/p&gt;
&lt;h2 id=&quot;the-bargain&quot;&gt;the bargain&lt;/h2&gt;
&lt;p&gt;The site is markdown, a static generator, and no JavaScript at all. The CSP says &lt;code&gt;script-src &#39;none&#39;&lt;/code&gt;. The motion
is CSS.&lt;/p&gt;
&lt;p&gt;Everything I itch to build goes into the desk instead. Overengineering the plain-text blog anyway is the
poetic part.&lt;/p&gt;
&lt;h2 id=&quot;what-it-does&quot;&gt;what it does&lt;/h2&gt;
&lt;p&gt;Files are the truth. There’s no database. It edits the markdown in place, and if you delete hypomnema the site
still builds. Front matter edits round-trip byte for byte.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://botbehavior.dev/posts/hypomnema/desk.jpg&quot; alt=&quot;The desk: a sidebar of sections and pages, a post open in the editor, and the real site beside it with a live WebGPU glyph rain running inside the post&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The desk.&lt;/strong&gt; Sidebar, editor, live preview. The preview is a real &lt;code&gt;zola build --drafts&lt;/code&gt;, reloaded in place
without losing scroll. Clicking a link in the preview opens that page in the editor.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;New.&lt;/strong&gt; Pick a section, name it, and see the URL as you type.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Design.&lt;/strong&gt; Sliders and colour pickers over the site’s CSS tokens, shown in the preview before they’re saved.
The front page layout is a list of blocks to reorder, hide and edit.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tags.&lt;/strong&gt; Fuzzy completion inside the field. Right arrow accepts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Publish.&lt;/strong&gt; Changed files with diffs, then the site’s own leak check: IPs, keys, emails, local paths and a
private blocklist that lives outside the repo. Then a commit under this site’s identity, and a deploy with
&lt;a rel=&quot;nofollow external&quot; href=&quot;https://github.com/botBehavior/edgepub&quot;&gt;edgepub&lt;/a&gt;, a small Rust tool (no wrangler, no Node): every deploy is a
new Cloudflare Workers version, checked live against the build, and rolled back if anything doesn’t match.
Drafts are never committed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;About 3,100 lines of Rust, 170 lines of JS, 36 tests. edgepub is another 620 lines.&lt;/p&gt;
&lt;h2 id=&quot;why-topcoat&quot;&gt;why topcoat&lt;/h2&gt;
&lt;p&gt;I’d wanted an excuse to use it. Rust on the server, pages and small reactive pieces in one codebase, and almost
no hand-written JavaScript. The desk’s own JS is keyboard shortcuts, tag completion, live reload and the preview frame.&lt;/p&gt;
&lt;p&gt;Where it pushed back:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;$(...)&lt;/code&gt; expression language is small. No &lt;code&gt;String::new()&lt;/code&gt;, no &lt;code&gt;vec!&lt;/code&gt;, no multi-segment paths. You end up
writing &lt;code&gt;&quot;&quot;.to_owned()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cargo build&lt;/code&gt; doesn’t rebundle the JS and CSS. &lt;code&gt;topcoat asset bundle&lt;/code&gt; is a separate step, and skipping it
serves the old files with no warning.&lt;/li&gt;
&lt;li&gt;CSRF protection is on by default. DNS rebinding isn’t covered, so the desk checks the &lt;code&gt;Host&lt;/code&gt; header on every
request. More on that in another post.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It’s 0.12. For a local tool like this it already carries the weight.&lt;/p&gt;
&lt;p&gt;Both are public: &lt;a rel=&quot;nofollow external&quot; href=&quot;https://github.com/botBehavior/hypomnema&quot;&gt;hypomnema&lt;/a&gt; and
&lt;a rel=&quot;nofollow external&quot; href=&quot;https://github.com/botBehavior/edgepub&quot;&gt;edgepub&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;for-lukas&quot;&gt;for lukas&lt;/h2&gt;
&lt;p&gt;This one’s for &lt;a rel=&quot;nofollow external&quot; href=&quot;https://github.com/lukasolson&quot;&gt;Lukas Olson&lt;/a&gt;, for his mentorship, and for nudging me to start
getting my music out there.&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>using wasm islands as rich media</title>
        <published>2026-12-02T00:00:00+00:00</published>
        <updated>2026-12-02T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://botbehavior.dev/posts/islands/"/>
        <id>https://botbehavior.dev/posts/islands/</id>
        
        <content type="html" xml:base="https://botbehavior.dev/posts/islands/">&lt;figure class=&quot;island&quot; data-island=&quot;sigil_rain&quot;&gt;
&lt;div class=&quot;stage&quot;&gt;&lt;img src=&quot;sigil_rain.webp&quot; alt=&quot;Pink glyphs falling in columns on a violet-black background, brightest at the head of each column.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
&lt;canvas data-island=&quot;sigil_rain&quot; aria-hidden=&quot;true&quot;&gt;&lt;/canvas&gt;&lt;/div&gt;
&lt;script type=&quot;module&quot; src=&quot;sigil_rain.boot.js&quot;&gt;&lt;/script&gt;
&lt;figcaption&gt;The glyph rain from my z-layer: the same bare-metal rust-gpu shader, running here in WebGPU. Without it you see a still frame rendered by that same shader.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;This is the glyph rain on my z-layer, a bare-metal Rust GPU shader under everything on my desktop. Here it’s
not a recording or a port of the idea: it’s the same Rust shader, compiled to SPIR-V by
&lt;a rel=&quot;nofollow external&quot; href=&quot;https://github.com/Rust-GPU/rust-gpu&quot;&gt;rust-gpu&lt;/a&gt;, translated to WGSL, and running in your browser. If your
browser can’t run WebGPU, or you asked it for less motion, you’re looking at a still frame the native renderer
drew.&lt;/p&gt;
&lt;p&gt;I wanted the blog to show pieces of projects where I’m writing about them, not link out to a demo.&lt;/p&gt;
&lt;h2 id=&quot;the-plain-part-stays&quot;&gt;the plain part stays&lt;/h2&gt;
&lt;p&gt;The site is static HTML, written in &lt;a href=&quot;https://botbehavior.dev/posts/hypomnema/&quot;&gt;hypomnema&lt;/a&gt;. Every page ships with
&lt;code&gt;script-src &#39;none&#39;&lt;/code&gt;. It reads the same in any browser, it archives, and there’s nothing on it to inject into.
I’m not giving that up.&lt;/p&gt;
&lt;p&gt;There was a halfway option: animate things with CSS and SVG, no scripts at all. It felt fake. If I’m showing a
shader, I want the shader.&lt;/p&gt;
&lt;h2 id=&quot;islands&quot;&gt;islands&lt;/h2&gt;
&lt;p&gt;So an island is the real thing, opted into one page at a time:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The still is the page.&lt;/strong&gt; The post’s folder holds a still frame, the module and the wasm. The still is what
everyone gets first; the module upgrades it in place if the browser can run it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One page, one exception.&lt;/strong&gt; That page gets its own
&lt;a rel=&quot;nofollow external&quot; href=&quot;https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy&quot;&gt;content security policy&lt;/a&gt;:
same-origin modules and WebAssembly, nothing else. Every other page stays at &lt;code&gt;script-src &#39;none&#39;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scripts are refused everywhere else.&lt;/strong&gt; The leak check that gates publishing fails on a &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; in any
page that hasn’t declared an island.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It fits the screen.&lt;/strong&gt; A wide banner on desktop, a taller frame on a phone, and the canvas follows the frame.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;proving-it-on-every-deploy&quot;&gt;proving it on every deploy&lt;/h2&gt;
&lt;p&gt;A policy that’s only right on my machine isn’t worth much. The site deploys with
&lt;a rel=&quot;nofollow external&quot; href=&quot;https://github.com/botBehavior/edgepub&quot;&gt;edgepub&lt;/a&gt;, and every deploy is checked against the live site before it
counts: each page with its own header rule is fetched and must carry exactly its policy. This one must allow
the island; the rest must still say &lt;code&gt;&#39;none&#39;&lt;/code&gt;. If not, the previous version goes back up.&lt;/p&gt;
&lt;h2 id=&quot;what-it-took&quot;&gt;what it took&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The shader is one file, 237 lines of Rust.&lt;/strong&gt; It gained a second entry point: on the desktop its
parameters arrive as a Vulkan push constant, and WebGPU doesn’t have those, so in the browser the same
32 bytes are a uniform buffer.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a rel=&quot;nofollow external&quot; href=&quot;https://github.com/gfx-rs/wgpu/tree/trunk/naga&quot;&gt;naga&lt;/a&gt; translated the SPIR-V to WGSL&lt;/strong&gt; cleanly on the
first try. 15 KB of SPIR-V became 22 KB of WGSL.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The host is new:&lt;/strong&gt; about 210 lines of Rust against WebGPU directly, no wgpu. The wasm is 218 KB
(62 KB compressed), and that includes the glyph atlas, baked at 32 px instead of the desktop’s 128. The still
is a 40 KB WebP.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The leak check caught the first build.&lt;/strong&gt; Rust release builds keep source paths for panic messages, and
mine had my home directory in them. The build now remaps them and refuses to finish if any are left.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;what-s-next&quot;&gt;what’s next&lt;/h2&gt;
&lt;p&gt;The policy for each island page is still written by hand. Next, the publisher writes it from the island
itself, and &lt;a rel=&quot;nofollow external&quot; href=&quot;https://github.com/botBehavior/hypomnema&quot;&gt;hypomnema’s&lt;/a&gt; preview enforces the same policy, so a
mistake shows up while I’m writing instead of after a deploy.&lt;/p&gt;
</content>
        
    </entry>
</feed>
