Skip to content
CAI
Software that uses CAICheck a score

splitwise/super_diff

71.4

Strong · 20 September 2026

8.6k

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

SuperDiff is a Ruby library that enhances test failure output by generating structured, readable diffs for various object types and RSpec matchers. It provides specialized integration for Rails, ActiveRecord, and ActiveSupport ecosystems, allowing developers to see precise differences in complex data structures like hashes, arrays, and database records. The system is designed as a modular, extensible engine that formats inspection trees and equality matcher failures with customizable colorization and elision.

How it got here

2018 — v0.19.0 architecture overhaul

12 changes.

This period focused on the major v0.19.0 release, which restructured the library into a modular architecture with explicit namespaces and a new global configuration system. It introduced comprehensive integration modules for Rails, ActiveSupport, and RSpec, alongside a complete rewrite of the ANSI color handling and equality matcher subsystems. The release also standardized development workflows through extensive documentation, new convenience scripts, and updated tooling dependencies.

2019–2020 — ActiveRecord and RSpec matcher diffing

15 changes.

This period focused on expanding SuperDiff's capabilities to provide specialized, readable diffs for ActiveRecord models and relations, as well as various RSpec collection and attribute matchers. Significant effort was invested in building a robust integration testing infrastructure to validate these new features across multiple Rails and RSpec versions, ensuring accurate failure message formatting in both colored and uncolored modes.

2021–2026 — Modular architecture and test expansion

14 changes.

The project underwent a significant architectural restructuring, replacing the monolithic implementation with a modular, component-based design under the SuperDiff::Basic and Core namespaces. This refactoring introduced abstract base classes, dispatchers, and specialized differ classes to improve extensibility and code organization. Concurrently, comprehensive unit tests were added to cover the new inspection and diffing logic for various object types, including ActiveRecord, RSpec matchers, and binary strings.

Features

Add custom Zeus plan configuration

A new \config/zeus\_plan.rb\ file has been added to define a custom Zeus plan. This configuration initializes a \CustomZeusPlan\ that delegates boot and test execution tasks to a shared \TestPlan\, enabling faster test runs by preloading the application environment and specific test suites (ActiveSupport, ActiveRecord, Rails, and Rails Engine with ActionController).

config · high confidence

Add diff support for RSpec collection and attribute matchers

SuperDiff now provides specialized diffing for several RSpec argument matchers. It supports \a\_collection\_containing\_exactly\ by identifying inserted, deleted, and unchanged array elements; \a\_collection\_including\ and \array\_including\ by highlighting extra items in the expected collection; \a\_hash\_including\ and \hash\_including\ by showing missing or mismatched keys; and \an\_object\_having\_attributes\ by comparing specific object attributes. This allows users to see precise, element-level differences when these matchers are used in tests.

_lib/super\_diff/rspec/operation\_tree\builders · high confidence

Add documentation support for code screenshots

Added support files for generating and documenting code screenshots using Carbon. This includes configuration for the Carbon tool (carbon-config.json), a markdown file (carbon.md) explaining the screenshot process and providing links to the 'before' and 'after' snippets, and Ruby files (before.rb, after.rb) containing the sample code used for these screenshots.

docs-support · high confidence

Add support for diffing ActiveRecord objects and relations

SuperDiff now provides specialized diffing capabilities for ActiveRecord models and relations. When comparing ActiveRecord instances, diffs display attributes sorted with the primary key first (supporting custom primary keys), and for ActiveRecord::Relation objects, diffs render them as structured collections with clear bookends, improving readability over generic array diffs.

_lib/super\_diff/active\record · high confidence

New development and testing convenience scripts

The project now includes new executable scripts in the bin directory to streamline local development. A new bin/console script provides an interactive IRB environment with the application and super\_diff loaded. A new bin/rspec script allows running tests against the latest appraisal configuration automatically. Additionally, a new bin/rubocop binstub is added to facilitate linting. The existing bin/setup script has been significantly rewritten to use bash, include colored output, and explicitly install appraisals during setup.

bin · high confidence

New integration modules for Rails, ActiveSupport, and RSpec matchers

SuperDiff now includes dedicated integration modules for Rails and ActiveSupport ecosystems, adding custom diffing and inspection for \HashWithIndifferentAccess\, \ActiveSupport::OrderedOptions\, and \ActionDispatch::Request\. It also expands RSpec support with specialized handlers for fuzzy matchers like \a\_collection\_containing\_exactly\, \hash\_including\, \an\_object\_having\_attributes\, and RSpec doubles, ensuring these objects are displayed with readable, structured diffs rather than generic object representations.

_lib/super\diff · high confidence

New release detection and selective linting scripts

Added two new automation scripts to the project. The \collect-release-info.rb\ script compares the current gem version against the latest published version to determine if a new release is occurring, setting GitHub Actions outputs accordingly. The \lint-changed-files.sh\ script identifies modified Ruby files (optionally including uncommitted changes) and runs Rubocop on them to enforce code style only on changed code.

scripts · high confidence

Architecture

Reorganized SuperDiff into a modular Basic backend

The SuperDiff library has been restructured into a modular architecture under the \SuperDiff::Basic\ namespace, introducing dedicated components for diffing, inspection, and formatting. This change adds new differ classes for Arrays, Hashes, CustomObjects, DateLike, TimeLike, and MultilineStrings, alongside corresponding operation tree builders that utilize libraries like \diff-lcs\ and \patience\_diff\ to generate structured change data. It also introduces inspection tree builders to handle object representation and a new \DiffFormatters\ module to render these changes, effectively replacing the previous monolithic implementation with a more extensible, component-based design.

_lib/super\diff/basic · high confidence

Reorganized core diffing architecture with new abstract base classes and inspection tree nodes

The core diffing engine has been restructured to improve extensibility and code organization. This change introduces a set of abstract base classes (AbstractDiffer, AbstractOperationTree, AbstractInspectionTreeBuilder, etc.) that define the interfaces for diffing components, alongside a dispatcher pattern (DifferDispatcher, OperationTreeBuilderDispatcher) to resolve the appropriate implementation at runtime. A new InspectionTree DSL with dedicated node types (e.g., AsLinesWhenRenderingToLines, Nesting, OnlyWhen) allows for more flexible and composable object inspection. Additionally, the TieredLinesElider has been simplified to support elision for flat line trees, and the DifferDispatcher no longer uses Ruby's \pp\ library, relying instead on the new internal formatting structures.

_lib/super\diff/core · high confidence

Behavioural changes

1 commit (0 fixes) modifying .yarn

A change to existing behaviour in .yarn — 1 commit, 1 file.

.yarn · low confidence · unverified

Introduce structured test plan and appraisal management for integration tests

Integration tests now use a dedicated \TestPlan\ class to manage the boot sequence, allowing for explicit selection of library combinations (such as RSpec, Active Support, ActiveRecord, Action Dispatch, and Rails) and consistent configuration of features like color output. A new \CurrentBundle\ helper automatically detects the active Appraisal environment and provides a fallback to the latest appraisal if none is specified, ensuring tests run correctly across different dependency matrices without manual gemfile management.

support · high confidence

Major library restructure and API overhaul

The library has been rewritten to introduce a modular architecture with autoloaded namespaces (Core, Basic, Csi, etc.) and a new global configuration system accessible via \SuperDiff.configure\. The public API now exposes explicit methods for diffing (\diff\), building operation trees (\build\_operation\_tree\_for\), and inspecting objects (\inspect\_object\), replacing the previous direct require of \super\_diff/differ\. Additionally, support for date-like objects has been added, the \String\ type is now treated as a primitive, and deprecated constants are routed through a \const\_missing\ hook that warns users to migrate to the new \Core\ or \Basic\ namespaces.

lib · high confidence

Pre-push hook now lints changed files and audits dependencies

The pre-push Git hook has been updated to run a new script that lints only the changed files, rather than the entire codebase. Additionally, the hook now performs dependency auditing using both Yarn and Bundler (via bundle-audit) before allowing the push, ensuring that dependency vulnerabilities are caught early. The hook also includes logic to skip execution when deleting a remote branch.

.husky · high confidence

Project configuration and documentation overhaul

This release introduces a comprehensive set of configuration files and documentation assets to standardize development workflows and improve project maintainability. It adds an \.editorconfig\ for consistent code formatting (2-space indentation, LF line endings), a \.rubocop\_todo.yml\ generated from the codebase to manage linting offenses, and a \.git-blame-ignore-revs\ file to exclude the Prettier-to-Rubocop migration from blame history. The project now specifies a development Ruby version (3.2.5) via \.ruby-version\ and Node version (20.12.2) via \.nvmrc\. Additionally, it establishes a formal Code of Conduct (Contributor Covenant 2.1), a Security policy, and a structured documentation site using MkDocs, replacing the previous README-centric documentation model.

(repo-wide) · high confidence

RSpec integration overhaul with new matcher support and formatting

The RSpec integration has been restructured to provide enhanced diffing and failure message formatting. The library now supports diffing for \a\_hash\_including\, \a\_collection\_including\, and \contain\_exactly\ matchers, alongside improved handling for \raise\_error\, \have\attributes\, and \be\\*\ matchers. Failure messages are now formatted with better colorization, respecting RSpec's \extra\_failure\_lines\ metadata and ensuring consistent color output via the \ConsoleCodes\ monkey patches. The architecture introduces dedicated modules for \AugmentedMatcher\, \Differ\, and \MatcherTextBuilders\ to manage these behaviors, while maintaining backward compatibility through deprecated namespace warnings for \InspectionTreeBuilders\.

_lib/super\diff/rspec · high confidence

Refactored ANSI color handling with a unified Color class hierarchy and Document API

The \lib/super\_diff/csi\ module has been rewritten to replace the previous flat sequence classes with a structured approach. A new \Color\ base class is now inherited by \FourBitColor\, \EightBitColor\, and \TwentyFourBitColor\, standardizing how color codes are resolved and rendered. The old \Sequence\ factory and specific sequence classes (like \EightBitSequence\) have been removed in favor of this hierarchy. Additionally, a new \Document\ class provides a high-level API for building formatted output, supporting features like bold text, nested colorization, and indentation, while an \UncolorizedDocument\ variant allows for plain-text generation. The legacy \ColorHelper\ module has been deleted as its functionality is now integrated into the new \Document\ and \Color\ classes.

_lib/super\diff/csi · high confidence

Refactored RSpec matcher failure messages with new builder classes

The structure of RSpec matcher failure messages has been reorganized to use a dedicated \Base\ class and specific builders for matchers like \be\_predicate\, \have\_predicate\, \contain\_exactly\, \match\, \raise\_error\, and \respond\_to\. This change improves the clarity and accuracy of failure output, such as correctly distinguishing between 'Expected' and 'Expected raised exception' for \raise\_error\, adding helpful suggestions for \be(true)\/\be\_truthy\ usage, and providing detailed arity and keyword information for \respond\_to\ matchers.

_lib/super\_diff/rspec/matcher\_text\builders · high confidence

Rework equality matcher architecture for diff generation

The equality matcher subsystem has been restructured to use a new \EqualityMatchers\ module with a \Base\ class and specific matchers for \Array\, \Hash\, \String\ (single and multiline), and \Primitive\ types. This change introduces a \Main\ dispatcher that resolves the appropriate matcher based on the expected and actual values, allowing for more granular and type-specific diff output. The \Default\ matcher serves as a fallback for other object types, delegating to the core diffing logic.

_lib/super\_diff/equality\matchers · high confidence

Test coverage

Add ActiveRecord test fixtures for custom primary keys and relations; Add unit tests for ActionDispatch::Request inspection; Added integration test helpers and matchers; Added integration test infrastructure for various Ruby environments; Added integration test matcher for verifying command output; Added integration tests for RSpec matchers and binary strings; Added integration tests for Rails components; Added shared test suites for integration and configuration features; Added test support infrastructure for RSpec integration and process forking; Added test support models and warnings logger infrastructure; Added tests for ActiveSupport object inspection; Added tests for RSpec matcher object inspection; Added unit test helpers and matchers for SuperDiff; Added unit tests for ActiveRecord object inspection; Added unit tests for Data, Range, Hash, and MultilineString diffing; Added unit tests for RSpec aliased matcher inspection; Added unit tests for RSpec matcher descriptions; Added unit tests for binary string diff support; Added unit tests for core configuration, helpers, and diff formatting; Added unit tests for deprecated constant mappings and main API entry points; Added unit tests for equality matcher output formatting.

Dependencies

Expanded test matrix for Rails 7.0–8.1 and RSpec 3.9–3.13

The gemfiles in the \gemfiles/\ directory have been updated to add Appraisal configurations for Rails 7.0, 7.1, 7.2, 8.0, and 8.1, alongside RSpec versions 3.9.x, 3.12.x, and 3.13.x. This allows the library to be tested against these newer framework and testing tool versions. Additionally, the SQLite3 dependency has been bumped to \\>= 2.1\ for Rails 8.0 and 8.1 to accommodate the adapter's requirements in those versions.

gemfiles · high confidence

SuperDiff v0.19.0: Ruby 3.1+ requirement, new runtime dependencies, and dev tooling overhaul

SuperDiff has been updated to version 0.19.0, raising the minimum supported Ruby version to 3.1 and adding \attr\_extras\ and \diff-lcs\ as new runtime dependencies alongside \patience\_diff\. The development environment has been significantly restructured: \pry-byebug\ has been replaced with the \debug\ gem, and new dev dependencies including \appraisal\, \bundler-audit\, \childprocess\, \climate\_control\, \prettier\_print\, and \rake\ have been added. Additionally, the project now includes a \package.json\ and \yarn.lock\ for Node.js-based tooling (such as \@lavamoat/allow-scripts\ and \husky\), and a \pyproject.toml\ for Python-based documentation generation using \mkdocs\ and \mkdocs-material\.

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

Lenses

  • Code Health 93
  • Architecture 99
  • Maturity 70
  • Readiness 64
  • Security 78

Changes since last survey

  • 300 commits — 254 feature/other, 46 fixes

By area

  • (root) — 158 commits
  • lib/super_diff — 80 commits
  • .github/workflows — 13 commits
  • spec/integration — 11 commits
  • spec/support — 8 commits
  • .husky/pre-push — 6 commits
  • gemfiles/no_rails.gemfile.lock — 5 commits
  • docs/contributors — 3 commits
  • spec/unit — 3 commits
  • .github/FUNDING.yml — 2 commits
  • bin/setup — 2 commits
  • lib/super_diff.rb — 2 commits
  • bin/ci — 1 commit
  • bin/console — 1 commit
  • bin/rspec — 1 commit
  • docs/users — 1 commit
  • gemfiles/no_rails_rspec_gte_3_10.gemfile.lock — 1 commit
  • gemfiles/rails_5_0.gemfile.lock — 1 commit
  • support/current_bundle.rb — 1 commit

Notable commits

  • fix: Add lint:changed and lint:changed:fix (#234)
  • fix: Fix "see what's changed" link in README
  • fix: Fix 'bundle exec rake (spec)' so that it works
  • fix: Fix CHANGELOG
  • fix: Fix CHANGELOG attribution
  • fix: Fix CHANGELOG entry for PR 266 (#274)
  • fix: Fix CI (#217)
  • fix: Fix CI so it more reliably works
  • fix: Fix CI so it runs on main, now that it's been renamed
  • fix: Fix CI: require logger before active_record (#277)
  • fix: Fix GH workflow so docs deploy on new releases (#245)
  • fix: Fix GitHub workflow (#226)
  • fix: Fix Zeus (#211)
  • fix: Fix bounty link in README
  • fix: Fix build_uncolorized_expected_output
  • fix: Fix compatibility issues with rspec-rails
  • fix: Fix compatibility with RSpec 3.10
  • fix: Fix diff from using have_attributes with a hash
  • fix: Fix diffing of ActiveRecord objects in nested objects
  • fix: Fix diffing two different kinds of objects
  • …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

splitwise/super_diff 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 f640ee26b4a8f502275d20c967c57c49319e05ec — 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.