Writes
12 posts, newest first. Mostly post-mortems of things that were slower, heavier, or more fragile than they needed to be.
- The Decoder Doesn't Get Its Own KV Cache
DeepSeek-V4.1-Flash doubles its backbone to 552B parameters yet holds global KV cache to 890 bytes per token, because the decoder reads a cache the encoder already built instead of deriving its own.
Sep 2026 - Two Auth Guards, One Inquiry Pipeline
OnlinePlumber captures leads from a Livewire web portal, an Android app, and bulk CSV import - three channels that stayed on two different Laravel auth guards on purpose, funneled into one inquiry status pipeline.
Sep 2026 - A Handler That Does Five Things Gets Reused Zero Times
Invobot's webhook, admin, and agent-console endpoints all needed the same signature check, payload parse, conversation lookup, and rate limit - copying them per handler was how a fix in one place stopped reaching the others, so they became composed FastAPI dependencies instead.
Sep 2026 - The Bot Doesn't Get to Reply After a Human Has Claimed It
Invobot collapses four independent booleans that could disagree into one authoritative status field, checked at the moment a reply is sent, so a bot and a human agent can never both answer the same message.
Aug 2026 - The Frontend Doesn't Get to Define the Boundary
StudySmart AI split student and admin access into separate API contracts before either interface existed, so a Laravel dashboard added months later needed zero renegotiation with the schema already in use.
Aug 2026 - The AI Can Say Anything. The Contract Can't.
StudySmart AI's quiz generation runs behind a strict typed contract so three different clients never have to guard against what the model actually returned.
Aug 2026 - Scoring Against a Two-Document Corpus Is a Bug, Not a Shortcut
Fitting a TF-IDF vectorizer on just the pair being compared caps the weight spread between a shared word and a distinctive one at 1.4x, opening the door to false near-duplicate matches.
Aug 2026 - One Locked SQLite Connection Beats One Per Thread
Why filemetric-engine's cache uses one shared SQLite connection behind a lock instead of one per worker thread, and why WAL mode doesn't make that lock unnecessary.
Aug 2026 - One Upload in Fifty Pays for the Index Rebuild
Why filemetric-engine batches index rebuilds behind a pending buffer so uploads stay an O(1) append instead of a full refit.
Aug 2026 - Cache by Content Hash, Never by Path
A path-keyed cache reprocesses the same file under every filename it's uploaded as - filemetric-engine keys on a SHA-256 of the bytes instead.
Aug 2026 - A Fitted Vectorizer Is a Fact About a Corpus, Not a Request
Why a prebuilt TF-IDF index beats fitting a fresh vectorizer per file pair - the same corpus doesn't need rebuilding on every request.
Aug 2026 - Cutting file comparison from 44s to 59ms
Why StudySmart's file comparison was slow, and the index, cache, and write buffer in filemetric-engine that fixed it.
Aug 2026