<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Posts · Playground</title>
    <link>https://imjasonh.github.io/playground/preview/pr-259/posts/</link>
    <description>Posts from Playground.</description>
    <atom:link href="https://imjasonh.github.io/playground/preview/pr-259/posts/feed.xml" rel="self" type="application/rss+xml"/>
    <lastBuildDate>Thu, 20 Aug 2026 20:18:48 -0400</lastBuildDate>
    <item>
      <title>Introducing Inkbot</title>
      <link>https://imjasonh.github.io/playground/preview/pr-259/posts/inkbot-esp32/</link>
      <guid isPermaLink="true">https://imjasonh.github.io/playground/preview/pr-259/posts/inkbot-esp32/</guid>
      <description>Introducing Inkbot</description>
      <pubDate>Thu, 20 Aug 2026 18:12:40 -0400</pubDate>
      <content:encoded><![CDATA[<p>Everyone seems to be hopping on the ESP32 bandwagon these days. They've been cool for a while now, due to them being relatively cheap, relatively powerful, and widely available. But I think the real gasoline on the bonfire has been the introduction of coding agents capable of translating ideas into embedded code in a matter of minutes. Coding agents are almost literally born and bred to be able to understand and write code for these little devices! Unfortunately I was only born and bred to write backend code that moves bits from one place to another place in a slightly different shape, ideally correctly, securely and quickly. Sometimes I get to make a little red X turn into a green checkmark. If I'm lucky!</p>
<p>Anyway, I'm not immune to this ESP32 hype. While I was between jobs I toyed with <a href="http://github.com/imjasonh/esp32">signed over-the-air (OTA) updates automated with GitHub Actions</a>, but at the end all it did was blink and log that it was working. It was fun, and I learned a lot from the experience, but in the end it was ...uninspiring. </p>
<p>A few weeks ago, <a href="https://x.com/steveruizok/status/2085480605278515656">a guy on Twitter started doing more cool shit with ESP32s, and most importantly, posting about it and getting other folks jazzed about doing cool shit with ESP32s</a>. It was then that I knew The Fever had returned.</p>
<p>I was a little less interested in building LCD fluid simulations and tiny Flappy Birds or custom Tamagotchis (though those are cool, admittedly). Instead I got interested in e-ink displays. And I wanted something cool for my desk at work. So that's what I built!</p>]]></content:encoded>
    </item>
    <item>
      <title>pasta: a polyglot linter/fixer for monorepos</title>
      <link>https://imjasonh.github.io/playground/preview/pr-259/posts/pasta/</link>
      <guid isPermaLink="true">https://imjasonh.github.io/playground/preview/pr-259/posts/pasta/</guid>
      <description>pasta: a polyglot linter/fixer for monorepos</description>
      <pubDate>Wed, 19 Aug 2026 09:41:18 -0400</pubDate>
      <content:encoded><![CDATA[<p>I believe that monorepos are the future. For the record, I believed that <em>before</em> LLMs could write tens of thousands of lines of code before I finished checking Slack. It's only more true now.</p>
<p><img src="https://imjasonh.github.io/playground/preview/pr-259/posts/pasta/monorepo.jpg" alt="a delightful meme about monorepos"></p>
<p>All the benefits of monorepos for humans -- consistent checks and policy, consistently available context, consistent access control -- are only more important when you can hire a relatively cheap army of over-eager junior supergeniuses.</p>
<p>One consistent problem I've experienced in a monorepo is ensuring consistent quality checks across the codebase. Is every* line of Go <a href="https://go.dev/blog/gofmt"><code>gofmt</code></a>ed and <a href="https://pkg.go.dev/cmd/vet"><code>go vet</code></a>ted and <a href="https://golangci-lint.run/"><code>golangci-lint run</code></a>ned? In a polyglot monorepo -- a monorepo which may include backend code, frontend code, infra-as-code, CI-as-code, docs, and the whole kitchen sink -- this gets even worse. You may start running <a href="https://rust-lang.github.io/rustfmt/"><code>rustfmt</code></a> and <a href="https://doc.rust-lang.org/clippy/"><code>clippy</code></a> and <a href="https://eslint.org/"><code>eslint</code></a>, then before you know it you're running <a href="https://www.checkov.io/"><code>checkov</code></a> and <a href="https://docs.zizmor.sh/"><code>zizmor</code></a> and <a href="https://github.com/google/yamlfmt"><code>yamlfmt</code></a> and who knows what else.</p>
<p>Each of these tools is great! Most of them are either highly configurable, or simple and strict enough there's nothing to configure (<code>gofmt</code> you absolute legend 🤎). But a growing roster of tools each with their own bespoke configuration and idiosyncratic quirks made me wonder if there might be a better way to handle this more consistently across languages.</p>
<h3>🌲 ASTs</h3>
<p>Each of these tools is fundamentally doing <a href="https://en.wikipedia.org/wiki/Static_program_analysis">static program analysis</a>, where the source code characters are being parsed into an <a href="https://en.wikipedia.org/wiki/Abstract_syntax_tree">abstract syntax tree</a> (AST) consisting to nodes with children. So the source code <code>if err != nil {</code> isn't seen as <code>[]byte{'i', 'f', ' ', 'e', 'r', 'r', ...}</code>, but rather as a node representing <code>if</code>, with a boolean statement <code>err != nil</code>, where that statement node has three children: the variable <code>err</code>, the operation <code>!=</code>, and the value <code>nil</code>. With that representation, the tool can perform checks on the tree, for example to ensure that it's not comparing the variable <code>err</code> with a poorly-named variable <code>nill</code>.</p>
<p>I took a lot of inspiration from <a href="https://pkg.go.dev/golang.org/x/tools/go/analysis">Go's <code>analysis</code> framework</a>, which powers <code>go vet</code>, and offers a Go API to define rules to enforce on Go AST nodes, and even lets you define transformations on that AST that should be applied when the rule isn't satisfied. I started by having an agent write <a href="https://github.com/imjasonh/iferr-analyzer">an Analyzer for a particular Go style preference of mine</a>, and sure enough, you can run it to find and automatically fix non-compliant code. I had an agent write a <a href="https://github.com/imjasonh/ctxhttp-analyzer">couple</a> <a href="https://github.com/imjasonh/pkgerrors-analyzer">more</a>. It was fun, and easy, and if you write Go regularly I highly recommend playing around with it.</p>
<h3>🗯️ Polyglot Analyzers</h3>
<p>The problem with a monorepo, however, is that you may have other languages you want to analyze and autofix. One could (and I did) imagine a Rust Analyzer framework, a JavaScript Analyzer framework, a TypeScript Analyzer, a YAML Analyzer, CSS Analyzer, and so on, and sure, you could probably put an agent on that and get some okay results pretty quickly. But you'd still end up with a sprawl of static analyzer passes in each of those languages, potentially inconsistently applied across your codebase.</p>
<p>You could (and I did) also imagine a Go-based analyzer framework that worked on <em>any</em> language, and you could probably get an agent to build that too. For AST handling across many languages you'd probably want to use <a href="https://tree-sitter.github.io/tree-sitter/">Tree-sitter</a>, which powers syntax highlighting and <a href="https://langserver.org/">LSP servers</a> in basically any place you see them. But writing Go to lint TypeScript feels sort of <em>...wrong.</em></p>
<p>I wanted some neutral ~language for describing AST nodes and the rules that govern them. For that I reached for <a href="https://cuelang.org/">CUE</a>, which I've used elsewhere with moderate success. CUE is like YAML in that it declaratively describes data structures, but unlike YAML in that it's typed, and has much more sane rules and syntax for referencing other variables. And it's typed.</p>
<aside class="alert alert-important" role="note">
<p class="alert-label">Important</p>
<p>Right about now you might be saying, "you didn't want to make TypeScript developers learn Go, but you'll make them learn CUE instead?" to which I'll say, <em>shut up</em>, this is my project and I'll do what I want! Have your own agents write your own thing if you want. I stand by CUE, and thanks to the next paragraph <em>you haven't even read yet</em> it doesn't really matter anyway.</p>
</aside>
<p>CUE is a bit verbose, and for some complicated rules can be pretty opaque and dense to read. Luckily, the Go Analysis framework has more life lessons to learn from, in its documented <a href="https://pkg.go.dev/golang.org/x/tools/go/analysis#hdr-Testing_an_Analyzer">testing philosophy</a>. To test a Go analyzer you can pass it to a checker along with a <code>testdata</code> directory containing files to check. That testdata file includes examples of code that passes and fails the check, with a comment noting where the analyzer should find an issue (example <a href="https://imjasonh.github.io/playground/preview/pr-259/posts/pasta/[url](https:/cs.opensource.google/go/x/tools/+/refs/tags/v0.49.0:go/analysis/passes/httpmux/testdata/src/a/a.go">here</a>)). I took this a step further in my tool, and had my tool also check for <code>testdata/*.golden</code> files that specify the file contents after being fixed by the rule's autofix transform, if specified.</p>
<p>This means that I don't even have to read any of the CUE that the agent writes, I only need to eyeball the testdata files showing good and bad examples, and the fixes it produces. Not bad!</p>
<p>I call the tool 🍝<code>pasta</code> by the way. Like AST? And because code is spaghetti? Anyway I was entertained by it.</p>
<p>With this in place, it was just a matter of having an agent write a bunch of rules, and generating before/after testdata examples. <code>pasta</code> looks for rules in a <code>.pasta/</code> directory. Like any good linter tool, it also supports <code>//nolint</code> directives in comments, to ignore known rules violations.</p>
<p>My agent and I have managed to implement a subset of both <a href="https://github.com/imjasonh/playground/pull/229">Zizmor</a> and <a href="https://github.com/imjasonh/playground/pull/238">Checkov</a> rules with relatively little config.</p>
<h3>🌴 Tree-Sitter and Go Crimes</h3>
<p><code>pasta</code> worked well for my monorepo, but my monorepo isn't exactly a challenge, so eventually I ran it against a large slice of a codebase at work, with a few relatively simple rules, just to see how it went.</p>
<p>It went ...slowly.</p>
<p>Out of a strong preference for pure-Go solutions (<a href="https://go.dev/wiki/cgo">cgo</a> tends to complicate things unless it's truly necessary), I'd opted for <a href="https://github.com/odvcencio/gotreesitter"><code>gotreesitter</code></a>, a pure-Go implementation of tree-sitter. Unfortunately this made parsing code into ASTs significantly slower than just using the standard C tree-sitter code via cgo. Cgo was truly necessary. 😭</p>
<p>...Or was it! I'd heard of other folks avoiding cgo by compiling C to <a href="https://webassembly.org/">Wasm</a> then executing it directly in Go, and that seemed just crazy enough to work for me too. After a bit of prompting, I got tree-sitter wasmed and <code>go:embed</code>ded into <code>pasta</code>, where it executes using <a href="https://wazero.io/"><code>wazero</code></a>. It's an abomination, but it made <code>pasta</code> <em>14x faster</em>. This wasn't as fast as tree-sitter via cgo, but it was fast enough for me, and it made <code>pasta lint</code>ing tens of thousands of files reasonably fast. It now parses and lints at ~1MB/s, and the whole journey only made the binary ~1.4 MB bigger. Not bad!</p>
<p>For reference, the PR where we made the change: <a href="https://github.com/imjasonh/playground/pull/210">https://github.com/imjasonh/playground/pull/210</a></p>
<h3>Conclusion</h3>
<p>I'm pretty happy with this turned out. It's not perfect, nothing is, but it's pretty fast, easy to review and debug via examples, and LLM agents are pretty great at one-shotting new rules based on my vague directions. If nothing else, it was fun to build, and to write about here.</p>
<p>If you've got a monorepo handy and this sounds like it might be useful, give it a shot. If you're an AST nerd who just wants to play, give it a shot!</p>]]></content:encoded>
    </item>
    <item>
      <title>It&#x27;s Not Jaws</title>
      <link>https://imjasonh.github.io/playground/preview/pr-259/posts/its-not-jaws/</link>
      <guid isPermaLink="true">https://imjasonh.github.io/playground/preview/pr-259/posts/its-not-jaws/</guid>
      <description>It&#x27;s Not Jaws</description>
      <pubDate>Fri, 07 Aug 2026 12:45:19 -0400</pubDate>
      <content:encoded><![CDATA[<p>Months ago, my kids and I came up with a fun guessing game. The rules are simple:</p>
<blockquote>
<p>One person picks a movie that we’ve all seen, and keeps it secret. Everyone else takes turns guessing movie titles; if we guessed correctly, we win. If not, the person responds with a clue in the form of, “it’s not X, but like X, it <em>_</em><em>_</em>_”, giving a signal to “triangulate” the answer.</p>
</blockquote>
<p>It’s a pretty fun game! Try it with your own friends and family! Sort of like Wordle for movie lovers.</p>
<p>Around the time Fable came out, I wondered if the model was sophisticated enough to understand and follow these rules. And, much to my surprise, on my very first game, Fable’s thinking traces (which were visible to me) included the name of the movie. This made the game a little… easy.</p>
<p>Repeated attempts to prompt the model not to leak the answer were somewhat successful, but I could never reliably stamp it out.</p>
<p>I tried a few other models, and after some attempt eventually even had some good fun games! Try it with your own local LLM model!</p>
<p>This morning I wondered whether I could systematize this experience and try to find the “best” model for this game. “Best” is a little complicated, since it includes both a.) picking a good target movie, b.) giving useful clues so the game is fun, c.) crucially, not leaking the answer, or too many extra clues in thinking traces.</p>
<p>When I got to work, I used the <a href="https://cursor.com/docs/sdk/typescript">Cursor SDK</a> to build an agent harness to match up a series of models against each other in successive games.</p>
<p>Some interesting findings:</p>
<ol>
<li>Composer 2.5 is the most likely model to leak the full title — in 12 games, it directly said the answer 11 times.</li>
<li>Clue leaks are an endemic problem among Fable, GPT 5.5 and 5.6-Sol. All three leaked clues in 8 of 12 games. Fable never leaked the full title though.</li>
<li>Grok 4.5 didn’t leak a single clue or title in its 12 matchups! It still lost every game, which might indicate weak movie choices or clues that are too strong.</li>
<li>All of the models tend to pick the same ~3 movies (<em>The Lion King</em>, <em>Truman Show</em>, <em>Shawshank</em>) so these are good guesses if you're ever up against an agent.</li>
</ol>
<p>Anyway, I don’t know what this could be useful for, but it was super fun to build! I encourage you to have fun ideas and experiment with them, it’s one of the last things that make us truly human.</p>
<p>You can see one matchup <a href="https://github.com/imjasonh/playground/actions/runs/31191985994">here</a>. It takes 30m and costs ~$20 to run, if you feel like reproducing my results. PRs welcome!</p>
<p>And if we’re ever hanging out and you want to play a game, I’d be happy to give it a go.</p>
<p>PS: the game is called “It’s Not <em>Jaws</em>” because there’s an extra rule where you cannot under any circumstances choose Jaws as the answer. I didn’t tell the models this, but they still never picked <em>Jaws</em> as the answer.</p>]]></content:encoded>
    </item>
  </channel>
</rss>
