Skip to content
CAI
Software that uses CAICheck a score

rails/spring

60.1

Adequate · 6 November 2026

2.5k

lines of production code

Ruby

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is Spring, an application preloader designed to accelerate Rails and Rake command execution by keeping application processes alive in the background. It manages the lifecycle of these preloaded processes, monitors file changes to trigger automatic reloading, and provides a structured command-line interface for interacting with the server. The implementation has been modernized to use process spawning instead of forking, with strict support requirements for Ruby 3.1+ and Rails 6.0+.

How it got here

2012 — Spring 4.7.0 architectural upgrade

8 changes.

This period focused on upgrading the Spring preloader to version 4.7.0, which introduced a major architectural shift from forking to Process.spawn and dropped support for legacy Rails and Ruby versions. The work included updating the binstub for compatibility, removing the old library entry point, and refactoring the test suite to align with the new requirements and dependencies.

2013–2019 — Client restructuring and test infrastructure

5 changes.

The Spring client was restructured into distinct command classes with modernized binstub generation and improved environment handling for Rails and Rake tasks. This period also involved refactoring the file watcher into an abstract base class and establishing comprehensive unit and acceptance test suites to validate the new architecture.

Removals

Removal of the main Spring library entry point

The primary \lib/spring.rb\ file has been deleted, removing the \Spring\ class that previously handled server bootstrapping, client-server communication via UNIX sockets, and command execution. This change eliminates the core runtime logic for managing the Spring application preloader process.

lib · high confidence

Architecture

Refactored file watcher into abstract base class with polling implementation

The file watching logic has been restructured by extracting common functionality into a new \Spring::Watcher::Abstract\ base class, which handles path resolution, symlink validation, and stale-state management. A concrete \Spring::Watcher::Polling\ implementation is provided, which runs a background thread to periodically check file modification times and notify listeners when changes are detected. This change improves code organization and ensures that relative paths are automatically resolved against the root directory while gracefully handling dangling symlinks.

lib/spring/watcher · high confidence

Behavioural changes

Introduce structured Spring client commands and modernized binstub generation

The Spring client is restructured into distinct command classes (Help, Rails, Run, Server, Status, Stop, Version) to provide clearer CLI interfaces, including a unified \spring rails\ command that wraps subcommands like console, runner, generate, destroy, and test. Binstub generation is modernized with a new \lib/spring/client/binstub.rb\ that supports upgrading legacy binstubs, inserting Spring loaders while preserving shebangs and comments, and removing Spring integration via \--remove\. The \spring rails\ command also extends support to \db:\ tasks (excluding \db:system:change\) by routing them through rake, and the client now handles server version mismatches by auto-restarting the server to ensure compatibility.

lib/spring/client · high confidence

Spring binstub upgraded to v1.1 with client-based execution and compatibility checks

The bin/spring script has been updated to use the new Spring::Client interface instead of the legacy Spring.run method, which is a required step when upgrading from Spring 1.0 to 1.1. The script now detects if Spring is already loaded to prevent conflicts with older binstubs and provides clear instructions for regeneration. It also includes checks for Rubygems versions below 2.1.0 and warns users to run \gem pristine --all\ if unstubbed gems are detected, ensuring better startup performance.

bin · high confidence

Spring command wrappers for Rails and Rake with environment handling

Spring now includes dedicated command wrappers for \rails console\, \rails generate\, \rails destroy\, \rails runner\, \rails test\, and \rake\. These wrappers ensure that environment flags (such as \-e\ or \--environment\) are correctly parsed and passed to the underlying Rails or Rake processes. Specifically, \rails test\ defaults to the \test\ environment unless overridden, while \rails runner\ and \rails console\ respect explicit environment arguments. The \rake\ command supports environment matching via task names (e.g., \test:all\) and environment variables, defaulting to \test\ for test-related tasks.

lib/spring/commands · high confidence

Spring preloader upgraded to version 4.7.0 with major architectural changes

The Spring preloader has been upgraded to version 4.7.0, introducing a significant architectural shift from forking to using \Process.spawn\ for application processes, which improves stability and compatibility. This release drops support for Rails versions prior to 6.0 and Ruby versions prior to 2.7, and requires that application reloading be enabled (configurable via \Spring.dangerously\_allow\_disabling\_reloading\). The update also removes the dependency on the \fiddle\ library by replacing the \SID\ module, vendors the \OkJson\ library to prevent conflicts with bundled JSON gems, and introduces new environment variables like \SPRING\_TMP\_PATH\ and \SPRING\_SERVER\_COMMAND\ for greater configuration flexibility.

lib/spring · high confidence

Test coverage

Add Rails 3.2 test application scaffold; Added acceptance test and refactored test helper; Added unit tests for application stability, command environment parsing, and watcher behavior; Added unit tests for client help and version commands; New acceptance and watcher test infrastructure; Removed acceptance test suite for Rails 3.2 application behavior.

Dependencies

Update gemspec and development dependencies

The gemspec now requires Ruby 3.1 or higher, updates the homepage to the Rails organization, adds an MIT license, and includes changelog metadata. Development dependencies have been adjusted: \rake\ and \bump\ are added, \activesupport\ is moved to a development dependency (with version pinning for minitest), and the test app for Rails 3.2 has been removed.

(dependencies) · high confidence

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

How this codebase got here

Score

  • CAI 57 → 60 (+3.1)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 64 → 64 (+0.0)
  • Architecture 99 → 99 (-0.1)
  • Maturity 38 → 51 (+12.4)
  • Readiness 75 → 64 (-10.4)
  • Security 79 → 73 (-6.2)

Resolved (16)

  • Ambiguous naming convention for existence check vs retrieval. command? suggests a boolean predicate (is there a command named X?), while command suggests retrieval. However, in many Ruby libraries, method? is a predicate and method is the accessor. If command? returns a boolean and command returns the command object, this is consistent. But if command? returns the command (truthy/falsy) and command also returns the command, it's redundant. Given the context of Spring being a registry, command?(name) likely checks existence, while command(name) retrieves. This is a minor naming convention inconsistency if command? is intended to be a predicate but might be confused with a getter that returns nil/false.
  • Bang method ambiguity. In Ruby, state! often implies a side effect or a stricter validation than state. However, state usually implies a getter. If state(val) is a setter, state!(val) might be a setter with validation or side effects. If state is a getter, state! is unusual. The presence of both suggests a lack of clear convention for state mutation vs retrieval. Typically, setters are named state= or set_state. Using state(val) as a setter is non-idiomatic.
  • Duplicate intent for execution entry points. Run.call(args) is the standard Ruby interface for executing an object (like a command). Run.run() is also present. In many command patterns, call is the primary entry point. Having both run and call on the same object suggests either one is an alias (redundant) or they serve different purposes (e.g., run for the full lifecycle, call for a specific step). Without bodies, it's hard to tell, but typically call is the preferred idiom for 'execute this command'.
  • Flaky test: AcceptanceTest#test_code_changes_in_pre-referenced_app_files_are_picked_up
  • Floating git dependency: debug
  • Floating git dependency: prism
  • Floating git dependency: reline
  • Floating git dependency: vterm
  • Floating git dependency: yamatanooroti
  • Further sole-owners (lower concentration)
  • Off-boarding risk: anonymized user #1
  • Outdated: minitest
  • Outdated: rake
  • Outdated: web-console
  • Overlapping lifecycle termination methods. terminate, exit, and exit_if_finished all suggest ending the application's lifecycle. exit_if_finished is conditional, but terminate and exit are ambiguous. Does exit call terminate? Does terminate call exit? This creates a confusing API for users trying to shut down the application.
  • Redundant/Confusing accessor for watcher configuration. Spring.watcher is a property/method returning the watcher instance. Spring.watch_method and watch_method= are used to configure the strategy (e.g., polling vs inotify). However, Spring.Watcher is also a namespace/module. The distinction between the instance of the watcher (watcher) and the strategy (watch_method) is clear internally but the API surface exposes both as top-level Spring methods, which can be confusing. More critically, Spring.watcher (method) and Spring.Watcher (module) share the same root name, which is acceptable in Ruby but adds cognitive load.

New (1)

  • Off-boarding risk: anonymized user #1

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

Survey your own repository

rails/spring 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 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 8fefb3850ce648e52a201d73a9882f9a495f3eee — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.2+preprod-5c4e66d9318b.