Kasa.
Backend engineering, system design, and the potholes in between.
LatestEngineering · 2026.10.25
muse.ai Email Approval Cards Getting Skipped: Moving a Chrome Extension From Button Text to React Data
A store review said my extension skipped email approval cards. One approval can appear in three forms and labels vary by action and language, so 1.3.0 reads Muse's attributes and React data instead.
Read more →More posts
-
Two Minutes to Publish: Moving a Static Astro Blog to Rendering on Cloudflare Workers
Every post used to trigger a 1 to 2 minute rebuild. With Workers rendering and edge caching, publishing now purges one cache tag and goes live in about 5 seconds, on the free plan.
-
Can You Trust a Backtest? Five Pitfalls, From TradingView Understating Drawdown to Lookahead Bias
A pretty backtest doesn't prove a strategy works; these are the pitfalls I hit, from TradingView understating drawdown to missing random baselines, dirty data, short samples, and lookahead, and how I avoid each.
-
TradingView Webhooks to Binance Auto Orders: A Relay and Exchange-Side Stops for a BTC Daily Strategy
A BTC daily strategy from backtest to automated Binance orders: only daily had enough samples, tuning the backtest wrapper beat tuning the indicator, the relay syncs to target position, and stops sit on the exchange.
-
The Reconciliation Alert Fired Twice: Missed and Double-Counted Interest When Bitfinex Positions Switch Sides
I check user earnings with a ratio of interest actually paid to booked accrual; it fired twice, once undercounting and once double-counting, both because Bitfinex splits one position across credits and loans.
-
Claude Code Triaging Sentry Alerts Read-Only: Locking It Down With --allowedTools, and the Pitfalls
When an alert fires, a Claude session with read-only tools hunts the root cause and posts to Discord; here's how I drew the permission boundary and two pitfalls: rewritten command paths and Sentry noise.
-
Clickable Bands in Claude Code Mods: API Limits Shape the Design, and What leftovers Still Can't See
After shipping my Claude Code mods, I made the bands clickable within limits like uncolorable Buttons and hover misclicks, taught leftovers absolute paths and variable substitution, and listed what command matching still misses.
-
React Number Input Pitfalls: Clearing Saves 0, Typing e in type=number Empties It
Clearing the reserve field on my lending settings page silently saved 0; this covers string drafts, checking upper and lower bounds differently, the e key in type=number, and per-keystroke input jsdom can't test.
-
High Coverage, Still Missing Tests? Using the CRAP Metric to Find the Functions That Need Them Most
With mostly agent-written code, high line coverage couldn't show whether the gaps sat in the most complex functions; a CRAP threshold of 8 cleared 200-plus offending functions and turned up 72 issues to fix.
-
Catching Dependency Cycles in Rust and TypeScript: A Homemade Module Scanner With Layering Rules in CI
My 18 backend packages had several dependency cycles tracked only by memory, so I wrote a compile-free scanner for a clickable architecture map and CI layering rules, then cleared 23 violations in one day.
-
Claude Code Mods From a Month of Session Logs: Five Bands, Status Line Items, and Commands
I had Claude read a month of session logs for requests I kept repeating and turned them into bands, status line items, and commands; the most useful, leftovers, tracks what Claude leaves behind.
-
Guarding main When AI Agents Open PRs in Parallel: GitHub Required Checks, a PROD Preflight, and a Merge Script
GitHub branch protection alone couldn't hold up with several AI agents opening PRs and a release commit after every merge, so I fixed the required checks and added a PROD deploy preflight and a merge script.
-
Automating a Bitfinex Lending Rate Report: A Claude Code Routine Opens a PR, a Human Merges It
The rate report is calculated only from Bitfinex's public candles, so anyone can reproduce it. A Claude Code cloud routine opens a PR every month, but nothing merges until a person reviews it.
-
Claude Code /code-review on an Entire Frontend: The Four Most Instructive Kinds Among 70-Plus Findings
I ran Claude Code's /code-review max over a whole frontend and confirmed 70-plus issues. Here are the four most instructive kinds, the rule that every test must fail on the unfixed build, and Playwright cross-browser results.
-
A JWT Expiry Race, 2FA Copy, and Client-Side Password Encryption: Three Account Security Fixes
My lending platform can reach users' exchange API keys, so after launch I fixed three account security issues: checking security copy against the backend, parsing JWTs once to avoid an expiry race, and encrypting passwords before sending.
-
Lighthouse Timing Out on a Next.js Site? The Cause Was One Unread Response Body
My mobile PageSpeed score was 46 and Lighthouse timed out on every run. The main cause was an unread body on anonymous refresh requests. After fixing it and a few other things the score hit 61, and public pages stopped checking login state.
-
SEO for a New Domain: Checking Search Volume With Self-Hosted OpenSEO Before Writing Long-Tail Guides
A new domain whose brand name is taken can only win long-tail traffic with guides. I ranked topics by OpenSEO search volume, checked each claim against primary sources, and loaded GA4 only on public pages.
-
Image Models Can't Write Chinese Text: AI Illustrations, and HTML Plus Playwright for Figures
Sixteen text-only guides needed images. Covers come from an image model plus a compositing script, figures with text are HTML rendered by Playwright, and every number on them is recomputed from public data.
-
Designing a SaaS Admin Console: Kill Switches, Broadcasts, and Telegram Notification Channels
Once my lending platform had users and billing, I built an admin console and multi-channel notifications; this covers permissions, kill switches, broadcast transaction boundaries, Telegram binding, and recipient rules for targeted broadcasts.
-
Speeding Up Rust and Next.js CI on GitHub Actions: From 11.5 Minutes to 1.5 on a 2 vCPU Runner
After moving the backend to Rust, the PR backend job went from 11.5 minutes to 1.5 and frontend checks from 81 seconds to 30, mostly through test databases, bcrypt, and caches that broke silently.
-
Should You Change a Trading Strategy While Losing? Coding the Review Process, and 13 Variants That Failed
I wrote 'reassess if losses persist' as preset triggers and a fixed decision order; the first automatic trigger caught two bugs in the review code, and none of 13 risk-reduction variants passed the preset bar.
-
A Crypto Trend Strategy Backtested at 240x Lost 10.7% in 2.5 Days of Paper Trading: Survivorship Bias in the Coin List
A trend strategy that backtested at 240x lost 10.7% in 2.5 days live; a hindsight-picked coin list had inflated it, and with point-in-time rankings, 10x in a year only happened from a bull-market start.
-
Publishing a Chrome Extension to the Chrome Web Store, Plus a Cross-Platform One-Line Install Script
Getting Auto Approve for Muse through Chrome Web Store review, and a one-line install script for macOS, Linux, and Windows that keeps the steps to a minimum, since Chrome won't let programs install extensions.
-
Auto-Approving muse.ai Cards With a Chrome Extension: From Allow-All to a Trust List
My Chrome extension clicks Allow on muse.ai approval cards that stall overnight scheduled tasks, and once other people used it, it moved to a trust list with irreversible actions like posting handled separately.
-
SaaS Billing After Performance Fees: Plan Limits, Promotions, and Suspension in a Flat Subscription
My auto-lending SaaS moved from performance fees to subscriptions. Plan limits shipped before billing, promo bonuses freeze onto the invoice, the 30-day notice only gates passive charges, and suspension never touches users' lending toggles.
-
Code Review After Porting Java to Rust: 15 Findings, 6 Bugs Carried Over From Java
Four lessons from a full code review after a Java-to-Rust port: transaction semantics copied from a misleading annotation, sqlx returning Ok on failed commits, disconnects killing handlers, and suspension sharing the lending flag.
-
Migrating From Java Spring Boot to Rust: Memory From 734 MiB to 32 MiB in One Cutover
My lending platform's backend went from Java 21 to Rust in one cutover with contracts and data intact: memory 734 MiB to 32 MiB, startup 30 s to about 0.03 s, API latency about the same.
-
Running Two LINE Accounts on One iPhone With LiveContainer: Three Free Apple ID Pitfalls
How I run a second LINE account on one iPhone with LiveContainer and SideStore, and how I got past running out of free App IDs, SideStore login failures, and Shortcut refresh errors.
-
GPT as a Read-Only Reviewer for Claude Code: Adversarial Review With Pi
I wrapped Pi, connected to GPT models over an API, as a read-only reviewer Claude Code can call, and found out why permission rules can't stop file writes and how adversarial review converges.
-
QQQ or SPY? Why I Dollar-Cost Average Everything Into QQQ on IBKR, and the Drawdown I Accept
Why I dropped my 30% drawdown cap and now dollar-cost average monthly into QQQ on IBKR, covering the QQQ vs SPY history, the drawdown I accept, my rules for crashes, and long-term costs.
-
Market Timing vs Buy and Hold: Backtests Across Taiwan and US Stocks, Futures, and Crypto, and None Beat Holding
I backtested timing and quant strategies across Taiwan stocks, US stocks, futures, and crypto, and after costs and daily-equity drawdowns none beat holding, while raising monthly contributions actually worked.
-
Profitable in Simulation, Losing Live: An Honest Dry Run and Testing an AI Trading Model's Hit Rate
I made an always-profitable dry run pay gas and take rejections; a 24-hour test then found no directional edge in the AI model, so I shut the project down under a preset rule.
-
A Full-Site Redesign With Design Tokens: AI Scores Make a Bad Gate, and One PR Reskinned 90%
My product, dashboard, admin, and email swapped dark rounded cards for a square-cornered blueprint style. AI review scores work only as a regression list; swapping design token values first reskinned 90% of screens in one PR.
-
An AI Trading Bot on Monad Mainnet: Requoting Every 300ms Costs Ten Times More Gas Than the Spread
Running an AI trading demo on Monad mainnet showed requoting every block costs ten times more gas than the spread earns; I also fixed a margin bug reverting 83% to 95% of orders.
-
Does Naked Candlestick Trading Work? Backtesting 1,026 Taiwan Stocks, It Lost to Random Entries Out of Sample
I turned a YouTuber's naked candlestick method into rules, backtested it on daily bars for over 1,000 Taiwan stocks against a random-timing control, and out of sample it lost by 2.62 standard deviations.
-
Google Only Saw a Spinner on a Static Next.js Export: Multilingual Prerendering and robots.txt Fixes
My Next.js static export served HTML with nothing but a spinner, and Google only recognized the English version. I switched to URL-based locale prerendering, then fixed two indexing problems caused by robots.txt.
-
Can Predicting Bitfinex Lending Rate Spikes Pay? Out of Sample It Kept About 10bp, So I Passed
Using perfect foresight as an upper-bound gate and then out-of-sample backtests, I tested holding capital for predicted lending-rate spikes: the ceiling was large, but a model using only current data kept about 10bp.
-
How Long Should You Lend on Bitfinex? Backtesting 2-, 30-, and 120-Day Lending and the Lock-Up Risk
Long-tenor Bitfinex funding quotes far higher rates, but most 30-day loans repay within an hour. After fixing two inflating backtest bugs, only one 30-day lane survived, its gains are concentrated, and 120 days means lock-up risk.
-
Bitfinex Lending's Hidden Clock: A Batch Auction Every 20 Minutes
Bitfinex 2-day funding is really a batch auction clearing every 20 minutes; here's how I found it in the data, where my new quoting strategy earns in backtests, and the pitfalls of a three-step rollout.
-
From a FastAPI Script to a Spring Boot SaaS: Rebuilding My Bitfinex Auto-Lending Platform
A Bitfinex auto-lending side project rewritten from a good-enough FastAPI script into a multi-module Spring Boot and Next.js platform with idempotency, reconciliation, circuit breaking, and full monitoring.
Nothing else in this category yet.