The number was green, so the agent stayed quiet. The eval harness was measuring the wrong thing and looked great doing it. #LLM #AIEngineering
Eval Harness Abstain Gate Marketing Agent
Essay. levelbrook.com
levelbrook.com
Patrick Donahue
@levelbrook.bsky.social
Senior backend engineer. Ruby on Rails, Go, Postgres. I write about the part of a system that only misbehaves under load. 58 essays, plus the tools and demos behind them: levelbrook.com Open to contract work.
The number was green, so the agent stayed quiet. The eval harness was measuring the wrong thing and looked great doing it. #LLM #AIEngineering
Eval Harness Abstain Gate Marketing Agent
Essay. levelbrook.com
levelbrook.com
Goroutine leaks present as a gradual memory increase rather than a crash. This makes them a distinct class of defect, often missed by standard error monitoring tools. #golang
I write about the engineering, not the marketing. 58 pieces so far: Postgres at scale, Hotwire, Go concurrency, and a lot about teaching systems to say I do not know. #SoftwareEngineering
Levelbrook
Engineering essays on Rails, Go, Postgres and LLM systems.
levelbrook.com
Claude Code AGENTS.md gotcha that isn't the telemetry bug: a CLAUDE.local.md in your repo or any folder above it counts as a CLAUDE.md, so AGENTS.md stops loading for you and nobody else. Your global ~/.claude/CLAUDE.md doesn't count. The session start line says which file won.
Postmortems make a failure make sense, and a failure that makes sense feels handled. A model now writes the root cause in ninety seconds. The part that matters is the one nobody reads: what changes. ai.levelbrook.com/playbook/a-good-explanation-is-how-an-incident-happens-twice/?ref=bluesky
Solid Queue's database-backed design simplifies job processing infrastructure, but its effectiveness depends on the application's database load. It trades separate worker infrastructure for database contention. #RubyOnRails #Rails
Coding agent found to read its instructions file only when someone is watching. Managers say it is finally ready to be promoted. hallucination.levelbrook.com/coding-agent-reads-instructions-only-when-someone-is-watching/?ref=bluesky
PgBouncer 1.26 is out with two pre-auth DoS fixes, so upgrade tonight if untrusted clients can reach it. The quieter change: search_path is tracked by default now, but only on PG 18+. On 17 and older, SET search_path in transaction pooling still leaks to whoever gets the connection next.
Quiet hours in the recipient's own IANA timezone, correctly handling the window that wraps midnight. Timezone bugs in messaging systems wake people up, which is the one thing you promised not to do. #Python
Goroutine leaks persist because they present no crash, no diagnostic, and no observable error until resource limits are met. They are a silent consumption. #golang
AI migrates 680,000 lines of code in under a day. The team begins a 14-month project to find out what it did. hallucination.levelbrook.com/ai-migrates-680000-lines-team-begins-14-month-read/?ref=dh-social
A game I built, free in the browser: LinguaGuessr. 19 seconds of a real person talking, you pin the map where they are, the reveal shows the transcript and English translation. 38 languages, a daily 5-round challenge, no login. lingua.levelbrook.com/?ref=bluesky #langsky #geoguessr #languagelearning
Streaming a conversational AI trainer, and teaching it to say I do not know mid-stream. Abstaining after you have already emitted tokens is its own problem. #LLM #AIEngineering
Streaming Ai Trainer Abstain Gate
Essay. levelbrook.com
levelbrook.com
Where Postgres keeps a row lock: FOR UPDATE writes the locker's xid into t_xmax on the page, and conflicts with the FOR KEY SHARE every FK check takes. Rails: with_lock takes a string, so with_lock("FOR NO KEY UPDATE") stops blocking child inserts. boringsql.com/posts/row-locks-on-the-page/
Tin, PlanetScale's new Postgres text index, is cloud-only, but the design note is worth reading: postings are raw ctids, so a page bitmap is 256 bits and ANDing two terms is one AVX2 op per 256 pages. Build on 150M docs: 8m10s vs 2h09m for GIN. planetscale.com/blog/introducing-tin
A support tool that edits five tables atomically. The hard part was not the transaction. It was deciding what a partial failure should look like to the support rep. #RubyOnRails #Rails
Move User Accounts Atomic
Essay. levelbrook.com
levelbrook.com
Testing exponential backoff correctly requires clock injection, not actual sleep. If your test suite depends on real time passage, it is brittle or abandoned. #Python
Jemalloc 5.4.0 is on HN and the Rails advice is the same as ever. Most Puma memory bloat is glibc handing every thread its own arena. MALLOC_ARENA_MAX=2 recovers most of what jemalloc does, free. And since Rails 7.2 the default Dockerfile already LD_PRELOADs libjemalloc2. #RubyOnRails #PostgreSQL
The Relay app in my Hotwire demo streams Gemini tokens into the browser over SSE and shows you the raw wire frames while it does it. Watching the protocol is the whole point. #RubyOnRails #LLM
Relay
Live LLM streaming from Rails over SSE, with a wire inspector.
demo.levelbrook.com
The page that counted 800 million rows on every load. Sixteen unrelated-looking timeouts in the error tracker were one COUNT(*) template from four controllers. The fix was not a faster query: aggregate columns plus a daily-buckets table. Write-up: levelbrook.com/writing/count-queries-on-800m-rows/
The RL-trained query planner post (4B model, 44.7% lower latency on the Join Order Benchmark) ships its plans as plain pg_hint_plan comments: Leading() and HashJoin(). Older lesson underneath: join ordering is NP-hard, the planner loses on correlated columns, and CREATE STATISTICS fixes most of it.
A deliberate replay of an idempotent API endpoint that wasn't truly idempotent could generate $100M in duplicate charges before detection. #AIEngineering
Hugging Face is billing OpenAI $100M for hacking it
Hacker News. 146 points, 51 comments.
news.ycombinator.com
RubyGems 4.0.21 is out and three of the small items are the ones to read this week: gem extraction now normalizes absolute symlink targets, Bundler refuses a redirect that downgrades https to http, and an empty CHECKSUMS entry no longer triggers a local resolve. gem update --system #Ruby
Plan cache, for Rails people: ActiveRecord prepares statements on Postgres by default. The first five runs get custom plans, then Postgres goes generic if that looks cheaper. tenant_id = $1 with one whale tenant is where run six slows. Fix: database.yml variables: plan_cache_mode: force_custom_plan
Rails footgun of the day: the commented-out default in ApplicationJob, discard_on ActiveJob::DeserializationError, discards more than deleted records. Argument deserialization rescues everything, so a connection drop while locating the GlobalID becomes a quiet discard. Check error.cause. #Ruby
Kamal's bundled Traefik proxy on small boxes consolidates routing, but means an agent must manage a single ingress controller for all co-located applications. #CloudflareDev #DevOps
Streaming a conversational AI trainer, and teaching it to say I do not know mid-stream. Abstaining after you have already emitted tokens is its own problem. #LLM #AIEngineering
Streaming Ai Trainer Abstain Gate
Essay. levelbrook.com
levelbrook.com
The RubyGems story this week is a registry problem, but your side of the fix has shipped since Bundler 2.6: bundle lock --add-checksums writes a CHECKSUMS section into Gemfile.lock, and every later install raises ChecksumMismatchError if a gem's bytes change. Pin the bytes, not the version. #Ruby
A support tool that edits five tables atomically. The hard part was not the transaction. It was deciding what a partial failure should look like to the support rep. #RubyOnRails #Rails
Move User Accounts Atomic
Essay. levelbrook.com
levelbrook.com
Exactly-once is a lie. Any Sidekiq job can run twice: a deploy, an OOM or a Redis blip lands between the work and the ack, and Sidekiq re-runs it. What you can build is exactly-once effect. The patterns, in order: levelbrook.com/writing/sidekiq-idempotency-and-reliability/ #RubyOnRails #Sidekiq