Skip to content
CAI
Software that uses CAICheck a score

ruby/debug

64.1

Adequate · 20 September 2026

8.8k

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is the 'debug' gem, a comprehensive rewrite of Ruby's legacy debugging library designed for Ruby 2.7 and later. It provides a modern interactive debugger with a C extension for efficient frame inspection and instruction sequence collection, supporting both local and remote debugging via DAP and CDP protocols. The tooling includes a CLI interface for managing debug sessions, abbreviation-based command completion, and a trace inspector for detailed execution logging.

Features

Documentation for the new debug.rb library

Added a comprehensive README for the new debug.rb library, which replaces the traditional lib/debug.rb standard library. The documentation outlines installation via the 'debug' gem (version 1.0.0+), usage with the 'rdbg' command or 'binding.break', and features such as remote debugging via UNIX domain sockets and TCP/IP, integration with VSCode and Chrome DevTools, and support for Ruby 2.7 and later.

misc · high confidence

Introduce C extension for Ruby debugger frame inspection and ISeq collection

This change adds a new C extension (ext/debug) that implements core debugger functionality using Ruby's internal APIs. It enables the debugger to capture stack frames with accurate depth information (using rb\_debug\_inspector\_frame\_depth where available, falling back to backtrace length on older Ruby versions) and supports skipping frames based on path prefixes. Additionally, it introduces ObjectSpace methods (each\_iseq, count\_iseq) to iterate over and count InstructionSequence objects, which are used for debugging and introspection. The extension includes compatibility checks for different Ruby versions (e.g., handling dummy frames in Ruby \< 3.2.0) and is compiled only on MRI.

ext · high confidence

Introduce Rdbg Trace Inspector for DAP

Adds a new Trace Inspector capability to the Debug Adapter Protocol (DAP) integration, allowing users to enable, disable, and collect detailed execution traces (including line events, call/return events, and parameters) via the debugger. The implementation introduces a \MultiTracer\ and \Custom\_Recorder\ to capture trace data with a configurable maximum log size, automatically dropping older entries when the limit is reached and tracking the count of dropped traces. A new DAP request handler (\rdbgTraceInspector\) processes sub-commands to manage these traces, exposing the collected log and drop statistics to the client.

_lib/debug/dap\custom · high confidence

Introduce abbreviation command completion in the debugger REPL

The debugger now supports typing abbreviated command names (e.g., 'b' for 'break') in the interactive console. This is implemented via a new \lib/debug/abbrev\_command.rb\ module that builds a character trie from the available commands, allowing the REPL to resolve partial inputs to full commands automatically.

lib/debug · high confidence

Introduce rdbg executable for launching and attaching to debug sessions

A new \rdbg\ command-line tool is introduced to manage Ruby debugging sessions. It supports two modes: 'start' and 'attach'. In start mode, it prepares the environment by setting \RUBYOPT\ and \RUBY\_DEBUG\_ADDED\_RUBYOPT\ to load the debugger, optionally using a specified Ruby interpreter or command, and then executes the target script. In attach mode, it connects to an existing debug server using host and port configuration or command-line arguments. The tool uses a new \Config\ class to parse arguments and manage settings, replacing previous direct environment variable manipulation with a more structured approach via \config\_to\_env\_hash\.

exe · high confidence

New development and test generation tooling

The repository now includes new executable scripts in the bin directory to streamline development workflows. A new \bin/gentest\ command allows users to generate test files with customizable method, class, and file names, and supports remote debugging sessions via VS Code (DAP) or Chrome (CDP). Additionally, \bin/console\ provides an interactive Ruby environment with the debug gem pre-loaded for easier experimentation, while \bin/setup\ automates the initial bundle installation process.

bin · high confidence

Behavioural changes

Debugger rewritten with modern Ruby features

The debugger implementation in lib/debug.rb has been completely rewritten to utilize recent Ruby language features, replacing the previous interactive command-loop structure with a more modern approach. This change fundamentally alters how the debugger operates internally, likely improving stability and integration with the current Ruby runtime, though it may affect compatibility with scripts relying on the specific behavior of the old command parser.

lib · medium confidence

Test coverage

Added test builder tool for generating debugger tests; Expanded test coverage for the Ruby debugger console; New test framework and utilities for DAP and CDP protocol testing.

Dependencies

Initial release of the debug gem with Ruby 2.7+ support

Introduces the new 'debug' gem, a complete rewrite of the legacy debug.rb functionality for Ruby 2.7 and later. The package depends on irb (\~\> 1.10) for the irb:debug integration and reline (\>= 0.3.8) to ensure proper console handling. Development dependencies include rake, rake-compiler, and the test-unit framework.

(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 64.

Lenses

  • Code Health 78
  • Architecture 97
  • Maturity 53
  • Readiness 65
  • Security 82

Changes since last survey

  • 300 commits — 254 feature/other, 46 fixes

By area

  • lib/debug — 160 commits
  • test/support — 36 commits
  • (root) — 31 commits
  • test/console — 28 commits
  • .github/workflows — 21 commits
  • test/protocol — 13 commits
  • ext/debug — 7 commits
  • .github/dependabot.yml — 1 commit
  • exe/rdbg — 1 commit
  • lib/debug.rb — 1 commit
  • misc/README.md.erb — 1 commit

Notable commits

  • fix: :rewind: Revert Ruby 2.6
  • fix: Fix "lib/debug/session.rb:2527: warning: assigned but unused variable - sym"
  • fix: Fix "lib/debug/thread_client.rb:618: warning: assigned but unused variable - e"
  • fix: Fix ENOENT error when running tests under Rails
  • fix: Fix FrameInfo#block_identifier
  • fix: Fix ::Process::daemon patch
  • fix: Fix info c <exp> when <exp> doesn't return a constant
  • fix: Fix bug that "trace line" does not work after stopping trace once
  • fix: Fix flakey test "test_reponse_returns_correct_threads_info"
  • fix: Fix flaky tests
  • fix: Fix help message of the eval command
  • fix: Fix incorrect method name
  • fix: Fix load_history method
  • fix: Fix name of rb_iseq_t struct
  • fix: Fix prelude doc example to use curly braces
  • fix: Fix prompt list size and colorized code line size to match input line size
  • fix: Fix showing help message on wrong options
  • fix: Fix syntax warnings
  • fix: Fix test builder
  • fix: Fix test for ruby/debug#953
  • …and 280 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

ruby/debug 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 6510cfbc7496c55ebbefa437a25c17ca58f7c5eb — 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.