CI Gates, Test Result Caches, and the Code Graph That Might Tell Us What to Test
What I learned from splitting Rails CI by risk, caching exact test results, and exploring whether AI and code graphs can make test selection safer.
Long-lived web applications improved incrementally, without pretending a rewrite is free.
The product works, but every change is slower than the last. Tests are flaky, upgrades are overdue, and the people who knew why are gone.
What I learned from splitting Rails CI by risk, caching exact test results, and exploring whether AI and code graphs can make test selection safer.
A REX production incident exposed the gap between a successful Kubernetes rollout and a working application, and what we changed to close it.
I am exploring how a one-person company can use agents, observability, and market intelligence without turning automation into an ungoverned second company.
A practical, architectural comparison of Hermes, OpenClaw, NanoClaw, ZeroClaw, and IronClaw, and why a layered agent system beats picking one winner.
Two years after publishing a guide to restricting OpenVPN clients to specific IPs, I audited the server it built, and most of the findings trace back to the guide.
A practical comparison of Graft, Graphify, and codebase-memory-mcp: what each indexes, how each feeds coding agents, and when to use one instead of another.
A practical way for small education and SaaS teams to diagnose Rails or LMS platform friction and decide whether a rewrite is actually justified.
Why a Rails test suite can fail on Ubuntu because of an older native libvips, and how to upgrade it safely without confusing it with the ruby-vips gem.
A repeatable way to download, serve, benchmark, and choose small GGUF models for Hermes and coding-agent work across different CPU and memory budgets.
A practical guide to using Hermes Agent with a local Gemma model for routine coding work, while reserving cloud models for tasks that genuinely need them.
从 Prime Agent、Cloudflare Computer、agent-skills、mattpocock/skills 和 Superpowers 看 Agent 基础设施正在如何从聊天框走向持久工作台、长任务运行时和工程方法论。
What a routine security audit found on a small always-on dev VM: passwordless databases, no host firewall, over-privileged jobs, and how it got fixed.
Notes on turning repeated AI workflows into scripts, skills, cron jobs, and guardrails so agents become cheaper, safer, and more useful over time.
A practical reflection on prompt, context, memory, loop, and graph engineering, and what each layer reveals about working with LLMs day to day.
What Oracle's smaller Ampere A1 Always Free limits mean for a self-hosted ARM server, and how I redesigned mine around a 12 GB, 2-core budget.
How a moving set of Rails CI flakes exposed shared download state, Selenium stale-node retries, and specs asserting before the browser settled.
Notes from wiping an old single-node k3s setup and rebuilding it with a smaller, cleaner baseline for ingress, certificates, and persistent storage.
A practical note on promoting repeated AI workflows into slash commands, scripts, and cron jobs, weighing judgment, cost, and safety trade-offs.
A practical look at Alibaba OpenCodeReview, why diff-only AI review is not enough, and how to use AI reviewers without trusting them too much.
A Rails CI debugging story: following the evidence to shared test state, instead of weakening assertions to make failures disappear.
A practical Rails performance field guide for diagnosing CPU, IO, GVL, GC, memory, Puma, and container-runtime bottlenecks before choosing a fix.
How I gave Hermes a persistent local code graph, semantic diagnostics, and stable project instructions without turning agent memory into a stale symbol index.
Notes on building an AI speaking practice app: STT, TTS, Gemini, ElevenLabs, latency, topic control, and useful feedback for oral English learners.
How I wired Hermes Agent on a remote Linux box into Telegram, email, calendar, error monitoring, GitHub, and a daily morning briefing routine.
A Rails after_save callback silently duplicated database rows: how the symptom appeared, why the obvious suspect was innocent, and the real root cause.
Migrating Rails UJS to Turbo can silently break submit buttons and resets in production, because Turbo's event timing and Promise handling differ from UJS.
A progressive escalation guide to debugging Ruby applications in Kubernetes production without restarting: rbspy, kubectl debug, signals, rbtrace, and gdb.
Small probe tasks for testing local AI agents: function calling, skill awareness, prompt-length pressure, cache behavior, and layer-by-layer debugging.
A step-by-step runbook for wiring LM Studio as a local OpenAI-compatible backend for Pi agents and OpenCode, with config examples and troubleshooting.
How LLM coding agents actually build software: the model, the tool loop, context management, precise patching, and verification against real tests.
Using LM Studio and Gemma as a local OpenAI-compatible backend for coding agents: what broke, which settings mattered, and where it still falls short.
A field guide for AI-heavy early adopters on when subagents in Codex speed work up, when they slow it down, and how to use them without creating chaos.
How to use git worktree to run parallel AI coding sessions safely, with practical patterns for isolating gems, databases, ports, and runtime state.
A practical introduction to the main building blocks of modern AI development, with diagrams that show how MCP, skills, agents, rulesets, and hooks work together.
The closing piece of a 12-part series on how software is shifting from apps you click through to intelligent systems and a personal OS that act for you.
A week of testing OpenHands, the autonomous AI coding agent, on real projects: what worked, what failed, and the setup that made it reliable.
How to fix Sentry's GitHub integration when it shows connected but issues won't create, plus why linking Sentry errors to GitHub issues is worth the setup.
How I reduced Docker development friction across three Rails apps by removing rebuild-heavy steps, adding runtime dependency sync, and enabling webpack HMR.
A practical comparison of [type, id] versus [id, type] composite index order for polymorphic associations in Rails and MySQL, and how to choose.
A macOS Terminal script that reads the I/O Kit registry to check negotiated wattage and voltage, so you can tell a fast USB-C cable from a slow one.
A migration path from Webpacker and Yarn to pnpm and Vite in a Rails app, including the dependency, Docker, and asset-hash pitfalls we hit along the way.
Stacked Git (StGit) separates the messy work of thinking through code from the clean history Git commits are for, using a patch-stack workflow.
This document defines official patterns and anti-patterns for handling transactions, derived data, touch, and async updates in Rails services at my company.
A keyword-argument mismatch between Ruby 3.4 and connection_pool 3.x breaks RedisCacheStore at Rails 8.1.1 boot, fixed with a patch loaded before initializers run.
Static CSS color values vs. variables: why hard-coded colors bite you later, and how to structure colors so they stay maintainable.
How to cut the latency cost of moving from a shared database to an API-driven architecture, using caching, request aggregation, and async writes.
How Puma worker timeouts and Nginx 499 errors expose slow Rails requests, and how to fix them with aligned timeouts, background jobs, and caching.
A flaky RSpec suite traced to a Rake task that commits data outside the per-test transaction, and how DatabaseCleaner's truncation strategy fixes it.
Using application services to build test data couples your specs to that business logic, making test suites slow and fragile; Factory Bot traits fix it.
How to wire up VS Code for Ruby debugging with the Shopify Liquid LSP, the rdbg debugger from Ruby's debug gem, and launch configs for RSpec, Minitest, and Cucumber.
A working comparison of how Python, JavaScript, Ruby, PHP, Rust, and Go implement closures and lazy iteration, with a runnable counter and generator example for each.
React Native's default JS engine moved from JSC to Hermes for faster startup and lower memory use, and here is how to control which one your build uses.
Active Storage's variant API gets rough past the basic thumbnail case: multiple sizes, per-attachment metadata, and tests that break on file-not-found errors.
Comparing srcset and picture, the native HTML approach to responsive images, against JavaScript solutions like jQuery Foundation Interchange.
User impersonation lets an admin temporarily act as another user for debugging and support, and the pretender gem handles the current_user switch and session state.
A practical breakdown of when to mock external dependencies in Rails tests versus using the real thing, built around the test pyramid, VCR, WebMock, and Pact.
Rails 7's button_to wraps a form around the button instead of rendering a plain input, which silently breaks existing CSS selectors and JavaScript click handlers.
Multi-step Rails forms need somewhere to hold data between steps, and this compares session storage, direct Redis caching, and temporary DB rows for that job.
Rails normalizes headers to HTTP_-prefixed names, which decides whether Accept, a legacy X- prefix, or a plain name is right for a custom API header.
Rails keeps users logged in by encrypting the whole session into a browser cookie, then lets Warden authenticate each request, which changes how you should test it.
The difference between Web Workers and Service Workers: one offloads CPU work, the other intercepts network requests, and most apps eventually need both.
How Ruby's Global VM Lock limits threaded CPU-bound code, and how Ractor bypasses it entirely by trading shared memory for message passing.
How to tell whether a slow endpoint is I/O bound or CPU bound, using system monitors, timing, and cProfile, and why the fix differs for each.
Catch-all exception handlers hide the real bug. Debuggers that pause on every thrown exception, caught or not, find it faster than logging ever will.
Why Sentry and Bugsnag catch more JavaScript errors than custom try/catch logic, and how to close the gap with global handlers and rejection listeners.
Why Nokogiri XPath queries failed in Docker but not on an M1 Mac: a libxml2 version mismatch caused by indirect dynamic library loading in Ruby.
How to stop duplicate Rails requests from creating the same record twice, using a Redis-backed semaphore lock instead of chasing a race condition.
How British Summer Time breaks Ruby tests, cron schedules, and cloud functions that assume UTC, and how to write timezone-aware specs instead.
The code review anti-patterns that slow teams down most: giant PRs, style-war comments, and reviews that skip the business context entirely.
本文用 Ruby 代码示例,剖析 DRY 与 AHA、YAGNI 与可扩展性设计、继承与组合等几对看似冲突的编程原则,说明该如何在实践中权衡取舍。
A Rails test suite hung intermittently until transactional tests, ActiveJob, and ActiveStorage turned out to be racing over the same locked rows.
Runtime method overrides work very differently in PHP and Ruby: one has no rollback mechanism, the other builds aliasing and scoping in from the start.
Two concurrent requests can both pass an exists? check and race to insert the same row; here is why, and how to write idempotent Rails controllers.
npm ci is not the script-free install it looks like; it still runs prepare scripts for Git-based dependencies, which broke Husky in CI.
When async updates to the same record can finish in any order, the oldest write can silently overwrite the newest one; here is how to stop that.
Poetry and uv solve overlapping problems in Python dependency management; here is where each one wins, and how to use them together.
Two ways to avoid CORS errors in local React development: the package.json proxy field for one backend, or http-proxy-middleware for several.
Compares Ruby's byebug, Python's pdb, and PHP's Xdebug side by side, with the core commands and a working example for each language.
Comparing Ruby retry patterns, exception-based retry, conditional checks, and exponential backoff, and when each keeps performance acceptable.
How to design a booking API that replaces regular time slots with alternatives, using server-side merging, cache versioning, and idempotency keys.
Five parameter-related code smells, from boolean flags to long argument lists, and the refactor that turns each function into one that does one thing.
Why ordering ActiveRecord results by an associated table's column breaks with includes, and how references, Arel, and left_joins fix it for good.
How ActiveRecord's includes prevents N+1 queries in Rails, and the common mistakes with order, filtering, and pluck that silently break it.
A framework for deciding how much to test: the testing pyramid, layered test responsibility by architecture tier, and what makes test data good.
When Laravel's save() silently returns false versus when saveOrFail() throws, and how to pair both with validation and database transactions.
How optimistic concurrency, unique job locks, and throttling stop out-of-order background job updates in both Rails/Sidekiq and Laravel queues.
How to debug Unicode font rendering in Ruby's Prawn PDF library and work around PDF::Inspector's limits when testing non-ASCII characters like it.
Ruby's filter_map cuts a multi-pass select/map/uniq chain to one pass, and a plain each loop goes further still when performance actually matters.
Practical notes on Android build and debug workflow: managing Java versions with jenv, wireless ADB debugging, release signing, and logcat filtering.
A Rails.cache TypeError on an anonymous module led into Ruby's Marshal restrictions and the relationship between object_id and C-level memory addresses.
Setting up Neovim, Fugitive, and Delta for three-way merges gives you a fast, keyboard-driven way to resolve Git conflicts without leaving the terminal.
A step-by-step guide to migrating a Rails app's pagination from Kaminari to will_paginate, covering models, controllers, views, and API responses.
Why Rails caching raises TypeError: can't dump anonymous module with Kaminari-paginated collections, and how to trace and fix the module causing it.
How to inject a Sass variable, like a theme's primary color, at build time using a SASS_OPTIONS environment variable and a custom webpack additionalData function.
What changes when you upgrade React 17 to 18: the new root API, automatic batching, Strict Mode's double-invoked effects, and test setup fixes.
A practical walkthrough of upgrading a React 16 app to React 17, covering dependency updates, Jest and Enzyme test fixes, and new ESLint warnings.
How to use adb shell pm to list, install, uninstall, disable, and inspect Android packages, including removing bloatware without root.
Comparing rufus-scheduler's in-process polling loop with sidekiq-scheduler's Redis-backed queue to pick the right one for single-process vs distributed apps.
How rufus-scheduler's single-threaded main loop triggers, times out, and runs jobs, and where a timer-based rewrite would scale better.
Rack is the standard interface between Ruby web servers and frameworks, traced here through its middleware stack from request to response.
A rundown of debugging React apps: React Developer Tools in the browser, inspecting React Native, and running Jest tests under a real debugger.
Why 0.1 + 0.2 doesn't equal 0.3, how Ruby's arbitrary-precision integers avoid overflow, and how JavaScript's BigInt does the same for large integers.
SCORM is the packaging and tracking standard that lets e-learning content run and report progress consistently across different learning platforms.
Rounding the same float, 2.675, to two decimal places gives different answers in C#, PHP, Go, Python, JavaScript, and Ruby, for concrete reasons.
Running a Ruby on Rails app in Kubernetes means containerizing it correctly and handling migrations, background jobs, and Puma as separate concerns.
Four breaking changes we hit upgrading to Rails 7.2: show_exceptions, array-containment SQL, connection pool locking, and assert_enqueued_email_with.
delete_all skips callbacks and dependent associations while destroy_all runs them, and picking the wrong one silently breaks counter caches and cascades.
Ruby's 0.1 + 0.33 does not equal 0.43 because of binary floating-point rounding, and Rational, BigDecimal, and tolerance comparisons each fix it differently.
A collection of .irbrc helpers for tracing method calls, logging SQL queries, profiling code, and inspecting Ruby objects during Rails console debugging.
A comparison of Rails session stores: cookie sessions, ActiveRecord, and Redis, including how to share sessions across subdomains and multiple apps.
A rundown of Rails credentials, environment variables, 1Password CLI, and cloud secret managers like AWS Secrets Manager and Vault, and when to use each.
Why byebug can't break on Devise's metaprogrammed current_user method, and several ways to debug or patch a method that isn't in your source.
How splitting static and dynamic fields, granular fragment caching, and incremental loading keep a large, frequently updated list fast without stale data.
Redis serves two very different roles in a Rails app, a disposable read cache and a durable job queue, and conflating the two causes real outages.
When two services share one database, a schema change in either one can silently break the other, and here is how to split ownership with APIs or events.
A comparison of Discard and ActsAsParanoid, the two common Rails soft-delete gems, and the query and unscope pitfalls each one introduces.
What Rails actually loads when you run a rake task, the console, the server, or tests, and how to load rake tasks in each environment when you need them.
How ActiveRecord's unscope method selectively removes where and order conditions from default scopes, with examples and alternatives like merge and unscoped.
FFmpeg one-liners to scale and compress images: fixed dimensions, percentage scaling, and aspect-ratio-safe resizing.