Skip to content
CAI
Software that uses CAICheck a score

avdi/naught

65.4

Adequate · 20 September 2026

1.3k

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

Naught is a Ruby library that generates flexible null object instances to handle missing values and prevent nil errors. It provides a builder DSL for configuring behaviors such as method mimicking, black hole mode, and null-safe method chaining, while also tracking call stacks to aid in debugging. The system includes helper methods for converting values into null or actual states and supports static type checking via RBS signatures.

Features

Add RBS type signatures for the Naught library

This change introduces RBS signature files (sig/naught.rbs) that define the type structure for the Naught null-object toolkit. The signatures cover the core API including the NullClassBuilder DSL, conversion helpers (Null, Maybe, Just, Actual), and the ChainProxy used for tracking method calls on null objects. This enables static type checking for users of the library via Steep or other RBS-compatible tools.

sig · high confidence

Naught null objects now track call stacks and support method chaining

Naught null objects now record the call stack for every method invocation, providing detailed location information (file, line, method name, and arguments) via the new \Naught::CallLocation\ class and \Naught::CallerInfo\ parser. This enables debugging by revealing exactly where null object methods were called. Additionally, chained method calls (e.g., \null.foo.bar\) are now grouped into a single trace entry via \Naught::ChainProxy\, while separate calls remain distinct. The library also introduces a \Conversions\ module with \Null()\, \Maybe()\, \Just()\, and \Actual()\ helpers for handling null-equivalent values, and uses \Naught::BasicObject\ as the base class for generated null objects to ensure minimal footprint.

lib/naught · high confidence

Removals

Removal of Bundler-generated executable wrappers

The \bin/\ directory has been removed, deleting executable wrappers for tools such as \rspec\, \rake\, \pry\, \guard\, \coderay\, \thor\, \autospec\, \htmldiff\, and \ldiff\. These files were standard Bundler-generated shims that facilitated running the corresponding gems; their removal means these commands are no longer available via the local project bin path and must be invoked through other means (e.g., directly from the gem or via \bundle exec\).

bin · high confidence

Architecture

Null object builder refactored into modular command classes

The internal implementation of the null object builder has been restructured from a monolithic class into a set of distinct, composable command classes (such as Callstack, Mimic, Pebble, PredicatesReturn, and NullSafeProxy). This architectural change preserves all existing user-facing capabilities—including method mimicking, predicate overrides, callstack tracking, and null-safe proxies—while improving code maintainability and enabling more granular configuration of null object behaviors.

_lib/naught/null\_class\builder/commands · high confidence

Behavioural changes

Modernized development tooling and added static type checking

The project has been updated to support Ruby 3.2+ and replaced RSpec with Minitest for testing, including running specs in random order to catch order-dependency bugs. Development workflows now use the Standard Ruby style guide and RuboCop for linting, with new Rake tasks for linting, documentation verification, and type checking. Steep static type checking has been added with RBS signatures for the library's dynamic method-discovery DSL, and the release process has been adapted to skip local gem pushing in favor of GitHub Actions.

(repo-wide) · high confidence

Refactor builder logic into dedicated command classes

The internal implementation of the NullClassBuilder has been restructured to extract specific builder operations into individual command classes (such as Callstack, Pebble, and NullSafeProxy). This change moves logic out of the main builder class into separate files, improving code organization and maintainability without altering the public API or user-facing behavior.

_lib/naught/null\_class\builder · high confidence

Refactored null object generation to use a builder DSL

The core mechanism for creating null objects has been restructured from a static \NullObject\ class inheriting from \BasicObject\ to a dynamic builder pattern. Users now generate null object classes via \Naught.build\, which accepts a block to configure the builder (e.g., enabling black hole behavior). This change introduces a new \NullClassBuilder\ and associated command modules, allowing for more flexible null object configurations such as mimicking specific interfaces or combining null object patterns with other behaviors, while maintaining backward compatibility through the \Naught.build\ entry point.

lib · high confidence

Test coverage

Migrate test suite to Minitest and add comprehensive coverage; Removed RSpec test infrastructure files.

Dependencies

Modernize gem for Ruby 3.2+ and update tooling dependencies

The gem now requires Ruby 3.2.0 or later and has shifted its dependency management from the gemspec to the Gemfile. Development dependencies have been updated to use Minitest (\>= 6) instead of RSpec, and RuboCop has been replaced by the Standard Ruby style guide along with related performance and minitest cops. Additional tooling includes SimpleCov (\>= 1) for coverage, Steep for type checking, and YARD for documentation.

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

Lenses

  • Code Health 100
  • Architecture 69
  • Maturity 56
  • Readiness 69
  • Security 87

Changes since last survey

  • 222 commits — 207 feature/other, 15 fixes

By area

  • (root) — 87 commits
  • lib/naught — 61 commits
  • (repo) — 30 commits
  • lib/naught.rb — 17 commits
  • .github/workflows — 5 commits
  • spec/functions — 4 commits
  • spec/naught_spec.rb — 4 commits
  • spec/naught — 3 commits
  • spec/explicit_conversions_spec.rb — 2 commits
  • .github/dependabot.yml — 1 commit
  • sig/naught.rbs — 1 commit
  • spec/blackhole_spec.rb — 1 commit
  • spec/functions_spec.rb — 1 commit
  • spec/mimic_spec.rb — 1 commit
  • spec/predicate_spec.rb — 1 commit
  • spec/singleton_null_object_spec.rb — 1 commit
  • spec/support — 1 commit
  • test/blackhole_test.rb — 1 commit

Notable commits

  • fix: Add regression test for coerce with predicates_return
  • fix: Adopt minitest-strict to fix assert_same on null objects
  • fix: Fix .org link in README
  • fix: Fix Marshal.dump compatibility with black_hole null objects
  • fix: Fix RSpec warning
  • fix: Fix RuboCop offenses
  • fix: Fix RuboCop offenses introduced in version 0.20.0
  • fix: Fix composing mimic with predicates_return for classes with method_missing
  • fix: Fix define_method with blocks in Ruby 1.8 and earlier
  • fix: Fix rubocop warnings
  • fix: Fix specs on JRuby
  • fix: Fix specs on Rubinius
  • fix: Fix specs on Ruby 1.9
  • fix: Merge pull request #21 from dandorman/readme-formatting-fix
  • fix: Run specs in random order to catch order-dependency bugs
  • change: Add "Installation" to README
  • change: Add "Libraries Using Naught" to Readme
  • change: Add .get for getting an instance from both singleton and original flavor null object classes.
  • change: Add /bin to .gitignore
  • change: Add BlankSlate to the prior art list.
  • …and 202 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

avdi/naught 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 c418b5df5ad4d3b07a5fcd20f42b07be9c2e88a2 — 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.