Skip to content
CAI
Software that uses CAICheck a score

palkan/isolator

65.5

Adequate · 20 September 2026

957

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a Ruby library called Isolator that prevents unsafe database operations by detecting and raising errors when code executes within active database transactions. It provides a modular adapter architecture to monitor isolation violations across various contexts, including background jobs (Sidekiq, Resque, ActiveJob), HTTP requests, mailers, and WebSockets. The library also offers plugins to enforce stricter transaction controls, such as disallowing concurrent transactions or limiting subtransaction depth, ensuring data integrity in complex Rails applications.

Features

Add HTTP isolation adapters for Sniffer and WebMock

Users can now isolate HTTP requests using two new adapters: Sniffer and WebMock. The Sniffer adapter integrates with the Sniffer library to capture HTTP calls, automatically enabling and disabling the sniffer only when the HTTP adapter is active, and provides detailed error messages including the request method, host, port, and query string. The WebMock adapter integrates with WebMock to capture requests, optimizing performance by checking if notification is needed before invoking the expensive \caller\ method, and includes the HTTP method and URI in error details.

lib/isolator/adapters/http · high confidence

Add Mailer isolation adapter with detailed exception context

A new adapter has been added to isolate the Mailer target (Mail::Message) by wrapping the deliver method. When an isolation error occurs, the exception now includes specific details such as the sender, recipient, and subject of the email, improving debugging visibility.

lib/isolator/adapters/mailers · high confidence

Add background job isolation adapters for ActiveJob, Resque, Sidekiq, Sucker Punch, and Resque Scheduler

The library now includes dedicated isolation adapters for five major background job processing systems. Users can isolate \ActiveJob\ (targeting \enqueue\ with support for \enqueue\_after\_transaction\_commit\), \Resque\ (\enqueue\), \Resque Scheduler\ (\enqueue\_at\), \Sidekiq\ (\raw\_push\), and \Sucker Punch\ (\find\_or\_create\). Each adapter is configured to raise \Isolator::BackgroundJobError\ when jobs are executed outside an isolated context, providing specific details about the job class and arguments in the error message to aid debugging.

_lib/isolator/adapters/background\jobs · high confidence

Add plugins to prevent concurrent database transactions and limit subtransaction depth

Two new plugins are introduced to enforce stricter database transaction isolation. The concurrent database transactions plugin allows users to configure \disallow\_per\_thread\_concurrent\_transactions\ to raise a \ConcurrentTransactionError\ when multiple isolated connections attempt to open transactions simultaneously. The database subtransactions plugin introduces a \max\_subtransactions\_depth\ configuration option that raises a \MaxSubtransactionsExceededError\ if the nesting depth of subtransactions exceeds the specified limit.

lib/isolator/plugins · high confidence

New isolator adapters for background jobs, websockets, HTTP, mailers, and database commits

This change introduces a new set of adapter modules within the isolator library to detect unsafe operations across various Ruby ecosystem components. The diff adds specific integration points for ActiveRecord's \after\_commit\ hooks, Action Cable (websockets), Action Mailer, and HTTP requests (including WebMock support). It also establishes a unified \background\_jobs\ adapter that conditionally loads implementations for Sidekiq, Resque, Resque Scheduler, and Sucker Punch. These adapters share a common base implementation that handles enabling/disabling, exception building, and conditional ignoring logic, allowing the isolator to monitor these specific execution contexts.

lib/isolator/adapters · high confidence

Behavioural changes

Improved transaction tracking for Rails 7.1+ and ROM

The library now uses the new \transaction.active\_record\ event introduced in Rails 7.1 to track transactions more accurately, falling back to the previous \sql.active\_record\ method for older Rails versions. This change improves reliability by correctly handling transaction restarts and raw SQL execution. Additionally, support for ROM::SQL has been added via a new adapter that subscribes to \sql.rom\ events.

_lib/isolator/orm\adapters · high confidence

Isolator v1.2.0: New adapter architecture and transaction-aware isolation

Isolator has been updated to version 1.2.0, introducing a new modular adapter system that allows developers to isolate specific methods (such as HTTP requests, background jobs, mailers, and WebSockets) from database transactions. The library now supports transaction callbacks and integrates with \database\_cleaner\ to manage connection thresholds, ensuring that isolation checks are accurate during test runs. Configuration is now centralized, allowing users to customize exception raising, logging, and backtrace filtering, while the new \AdapterBuilder\ enables dynamic registration and removal of isolation rules.

lib/isolator · high confidence

Migrate linting to StandardRB and update CI configuration

The project has replaced RuboCop with StandardRB for code style enforcement, updating .rubocop.yml to inherit from Standard configurations and adding a separate .rubocop-md.yml for Markdown linting. The CI pipeline has migrated from Travis CI to GitHub Actions, evidenced by the removal of .travis.yml and the addition of a GitHub Actions badge in README.md. Additionally, the gem release process is now automated via a new .gem\_release.yml configuration file, and the default Rake task now runs both RuboCop and RSpec tests.

(repo-wide) · high confidence

Refactored transaction tracking with configurable thresholds and multi-connection support

The Isolator library has been significantly refactored to support tracking transactions across multiple database connections using connection-specific IDs and thresholds. The default transaction threshold is now set to 1, and users can configure these thresholds globally or per-connection via the new configuration API. The internal state management has been rewritten to use a ThreadStateProxy for safer thread-local variable access, and transaction increment/decrement logic now properly handles nested transactions and connection isolation. Additionally, the library now supports Ruby 3 keyword arguments and includes new methods for enabling/disabling isolation within specific blocks.

lib · high confidence

Test coverage

Add Isolator specs and update test configuration; Added comprehensive test coverage for ActiveRecord transaction isolation; Added integration test fixtures for transactional database strategies; Added integration tests for transactional and external service behaviors; Added test coverage for HTTP and Mailer adapters; Added test coverage for background job adapters; Added test coverage for callbacks, dynamic adapters, and configuration; Added tests for base adapter ignore\_if and ignore\_on behaviors; Added tests for concurrent transaction and subtransaction isolation; Added tests for the ActionCable WebSocket adapter; Added worker stubs for background job adapters; Expanded test infrastructure with multi-database and background job support.

Dependencies

Updated CI gemfiles for Rails 6–8 and JRuby compatibility

The gemfiles used for continuous integration have been updated to support testing against Rails 6, 7, and 8, alongside specific fixes for Rails 7.0 and 8.0 transaction commit behaviors. The JRuby configuration has been upgraded to use the activerecord-jdbcsqlite3-adapter version 60.x and Rails 6.0, while the legacy ActiveRecord 4.2 gemfile has been removed. Additionally, the master branch gemfile now pins the sqlite3 gem to version 2.0 and includes PostgreSQL and MySQL adapters.

gemfiles · high confidence

Updated gem dependencies and development tooling

The project has updated its dependency specifications, raising the minimum required Ruby version to 2.7.0 and adding runtime dependencies on \benchmark\ and \sniffer\ (\>= 0.5.0). Development dependencies have been refreshed to include \rspec-rails\, \minitest\, and a suite of background job adapters (Sidekiq, Resque, Sucker Punch) along with testing utilities like \database\_cleaner\ and \webmock\. The default Rails version for local development has been set to \~\> 8.0, and the \Gemfile\ now uses \eval\_gemfile\ for safer inclusion of local configurations.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 66.

Lenses

  • Code Health 99
  • Architecture 69
  • Maturity 58
  • Readiness 70
  • Security 76

Changes since last survey

  • 226 commits — 175 feature/other, 51 fixes

By area

  • (root) — 105 commits
  • lib/isolator — 65 commits
  • spec/isolator — 16 commits
  • lib/isolator.rb — 13 commits
  • spec/integrations — 9 commits
  • (repo) — 8 commits
  • .github/workflows — 3 commits
  • spec/support — 3 commits
  • spec/spec_helper.rb — 2 commits
  • gemfiles/jruby.gemfile — 1 commit
  • gemfiles/rails6.gemfile — 1 commit

Notable commits

  • fix: Add ActionMailer adapter and fix specs
  • fix: Add fix offences instructions [ci skip]
  • fix: Fix 2.7 warnings
  • fix: Fix Rails 8.0 support
  • fix: Fix RuboCop Style/EmptyStringInsideInterpolation offense
  • fix: Fix RuboCop warnings
  • fix: Fix Sniffer log config; improve adapters loading
  • fix: Fix ThreadStateProxy to use namespaces thread-local variables
  • fix: Fix database_cleaner support: require base.rb explicitly
  • fix: Fix action mailer exception message
  • fix: Fix action_mailer require for ruby 2.3.1
  • fix: Fix backtrace filtering
  • fix: Fix broken link in README
  • fix: Fix broken mention in changelog
  • fix: Fix callback names in README
  • fix: Fix connection_id reference
  • fix: Fix debug message for decrementing thresholds
  • fix: Fix enable! regresson
  • fix: Fix enable/disable
  • fix: Fix failed ActiveJob specs
  • …and 206 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

palkan/isolator was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 1ed61276b21fd0565f234e0f9e710b8b0dd1066e — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.