Skip to content
CAI
Software that uses CAICheck a score

tmm1/rbtrace

62.4

Adequate · 19 September 2026

1.2k

lines of production code

Ruby

with C

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

rbtrace is a command-line tool for tracing method calls and evaluating code in running Ruby processes. It uses a C extension and MessagePack for inter-process communication to attach to target processes, supporting multiple Ruby versions. The system provides features for slow method tracing, garbage collection monitoring, and remote interactive debugging via IRB or RIB shells. It also includes predefined tracers for common libraries like ActiveRecord, Redis, and Unicorn to enable automatic instrumentation.

Features

Add interactive IRB and RIB shells for remote evaluation

Users can now use the -i/--interactive flag to launch an interactive shell (IRB or RIB) for remote code evaluation. This change introduces lib/rbtrace/interactive/irb.rb and lib/rbtrace/interactive/rib.rb, which override output methods (puts, print) to route through the tracer and implement evaluation (evaluate/loop\_eval) to send commands to the remote process, enabling real-time debugging and inspection.

lib/rbtrace/interactive · high confidence

Added new tracers for ActiveRecord, EventMachine, IO, MongoDB, Redis, Test::Unit, and Unicorn

This update introduces a set of new predefined tracers to enable automatic instrumentation for several key Ruby libraries and frameworks. The \activerecord.tracer\ now covers database interactions for MySQL, PostgreSQL, and SQLite adapters. New tracers have been added for \eventmachine.tracer\ (covering connection lifecycle, timers, and the event loop), \io.tracer\ (for standard IO and TCP sockets), \mongo.tracer\ (MongoDB commands), \redis.tracer\ (Redis client processing), \testunit.tracer\ (test suite execution), and \unicorn.tracer\ (handling requests in older Rails setups). These additions allow users to gain visibility into these specific components without manual instrumentation.

tracers · high confidence

Initial release of rbtrace v0.5.5

This change introduces the initial codebase for rbtrace version 0.5.5, a tool for tracing method calls in running Ruby processes. The library provides a Ruby interface (\lib/rbtrace.rb\) and a C extension (\rbtrace.so\) for attaching to processes, alongside a CLI (\lib/rbtrace/cli.rb\) that supports options for tracing specific methods, monitoring slow calls, and evaluating code in the target process. It includes core components for inter-process communication via message queues (\lib/rbtrace/msgq.rb\), a tracer implementation (\lib/rbtrace/rbtracer.rb\), and utilities for memory reporting (\lib/rbtrace/memory\_report.rb\) and FFI error handling (\lib/rbtrace/core\_ext.rb\).

lib/rbtrace · high confidence

Introduce rbtrace CLI entry point

The bin/rbtrace executable is added as the command-line entry point for the tool. It loads the Ruby environment and delegates execution to the RBTraceCLI.run method, enabling users to invoke tracing features directly from the terminal.

bin · high confidence

Behavioural changes

Initial release of rbtrace 0.5.5 with Ruby 4.1 and C23 compatibility fixes

This entry covers the initial commit of the project, establishing the baseline for version 0.5.5. It introduces support for Ruby 4.1 by adopting the current postponed-job and block callback APIs, and fixes native command handling to validate MessagePack input and reject invalid tracer IDs. The release also addresses C23 compatibility by fixing the \rbtrace\_gc\_mark\ signature and ensures \ObjectSpace\ APIs are loaded correctly for heap and shape dumps. The commit includes the core executable, C extension build infrastructure, integration tests, and documentation.

(repo-wide) · high confidence

Native extension refactored to use msgpack and support multiple Ruby versions

The native extension has been significantly refactored to use msgpack for communication between the tracer and the target process, replacing previous mechanisms. The build system (extconf.rb) now automatically downloads, compiles, and links a bundled version of the msgpack C library, ensuring consistent behavior across environments. The core C code (rbtrace.c) has been rewritten to support multiple Ruby versions (including 1.9, 2.0, and newer), introducing features like devmode for Rails reloading, slow method tracing with configurable thresholds, and garbage collection tracing. The extension now uses a unified state structure and handles platform-specific details (like OSX fat binaries and Android compatibility) more robustly.

ext · high confidence

Test coverage

Added behavioral test for interactive IRB output

Added a new test file \test/interactive\_irb\_test.rb\ that verifies the \--interactive irb\ command correctly prints evaluation results (specifically checking for the \=\> 2\ output when evaluating \1 + 1\) in a TTY environment, addressing a regression where no output was produced.

test · high confidence

Dependencies

Initial release of rbtrace gem with dependency specifications

The rbtrace gem is introduced with a Gemfile and gemspec, defining it as a tool to trace method calls in Ruby processes in real time. The package specifies runtime dependencies on FFI (\>= 1.0.6), Optimist (\>= 3.0.0), and msgpack (\>= 0.4.3), along with development dependencies on rake and irb (\>= 1.15) to support interactive testing.

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

Lenses

  • Code Health 87
  • Architecture 69
  • Maturity 53
  • Readiness 62
  • Security 99

Changes since last survey

  • 300 commits — 255 feature/other, 45 fixes

By area

  • (root) — 105 commits
  • bin/rbtrace — 50 commits
  • (repo) — 42 commits
  • ext/rbtrace.c — 41 commits
  • lib/rbtrace — 34 commits
  • ext/extconf.rb — 16 commits
  • tracers/activerecord.tracer — 3 commits
  • ext/.gitignore — 2 commits
  • ext/src — 2 commits
  • .github/workflows — 1 commit
  • tracers/mongo.tracer — 1 commit
  • tracers/redis.tracer — 1 commit
  • tracers/testunit.tracer — 1 commit
  • tracers/unicorn.tracer — 1 commit

Notable commits

  • fix: 32bit obj id fix
  • fix: Fix --interactive irb mode
  • fix: Fix --interactive irb mode not printing eval results
  • fix: Fix rbtrace --exec
  • fix: Fix coding style
  • fix: Fix error due to more strict function argument syntax in C23
  • fix: Fix for evaling on the same tracer more than once
  • fix: Fix for issue 14: rbtrace ignores the value for --slow
  • fix: Fix native command validation and cleanup
  • fix: Fix native input and allocation handling
  • fix: Fix off-by-one error when sending messages
  • fix: Fix pids that are strings
  • fix: Fix require failing in Termux on Android
  • fix: Fix ruby 2.8/3.0 deprecations about File.exists?
  • fix: Merge pull request #106 from OsamaSayegh/fix-irb-mode
  • fix: Merge pull request #108 from OsamaSayegh/fix-irb-output-release
  • fix: Merge pull request #71 from adam12/fix-instances-of-nil
  • fix: Merge pull request #79 from casperisfine/fix-ruby-head-deprecations
  • fix: Merge pull request #80 from ZimbiX/fix-gem-require-in-termux-on-android
  • fix: Setup CI and fix some small errors
  • …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

tmm1/rbtrace 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 19 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 6ae1dec3cbda95ddc7c78ce764ce2a440f77a84e — 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-13a154b7f5d1.