Skip to content
CAI
Software that uses CAICheck a score

dry-rb/dry-validation

57.7

Adequate · 6 November 2026

2.1k

lines of production code

Ruby

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add benchmarks for form validation and profiling

Added a new suite of benchmarks to compare the performance of dry-validation against ActiveModel and ActiveRecord validations. The suite includes scripts for valid and invalid form inputs, including scenarios with huge schemas, as well as profiling scripts for schema definition, schema calls, and message generation.

benchmarks · high confidence

Add interactive REPL console with Dry Validation helpers

A new bin/console script has been added to provide an interactive Ruby REPL environment. It automatically loads the bundler setup and the dry-validation and dry-types libraries, exposing a Context class that provides convenient helper methods for defining schemas (schema, params, json) and building validation contracts (contract). Users can now run bin/console to start an IRB session with these tools pre-configured for rapid prototyping and testing.

bin · high confidence

Add new validation examples for basic, params, JSON, nested, each, and multiple rules

The examples directory now includes new demonstration files showing how to use dry-validation with different input types and rule configurations. Users can see examples for basic schema validation, params validation, JSON input processing, nested schemas, array validation with the \each\ rule, and applying multiple custom rules to a single field.

examples · high confidence

New extensions for hints, monads, and predicate macros

This change introduces three new optional extensions for dry-validation. The :hints extension adds a hints method to validation results, allowing users to retrieve human-readable suggestions for fixing input errors separately from strict validation messages. The :monads extension integrates with dry-monads (requiring version 1.6.0 or higher) to provide a to\_monad method on validation results, enabling functional error handling patterns. The :predicates\_as\_macros extension allows users to import dry-logic predicates (such as format?, gteq?, and included\_in?) as validation macros within contracts, simplifying rule definitions by reusing existing predicate logic.

lib/dry/validation/extensions · high confidence

Removals

Removal of legacy Dry::Validator processor and attribute extractor

The \lib/dry/validator/processor.rb\ and \lib/dry/validator/processor/attribute\_extractor.rb\ files have been removed. This eliminates the previous implementation that used \Dry::Rules\ to iterate over validator rules and extract attribute values from objects, indicating a shift away from this specific internal processing mechanism.

lib/dry/validator · high confidence

Removal of legacy rule modules and registry

The \lib/dry/rules\ directory has been cleaned up by removing several legacy rule implementations and the registry class. Specifically, the \Each\, \Embedded\, \Length\, and \Presence\ rule modules have been deleted, along with the \Registry\ class that extended \Dry::Container::Registry\. This change removes the direct support for these specific validation rules and the custom registry mechanism from this location.

lib/dry/rules · high confidence

Behavioural changes

Library renamed from dry-validator to dry-validation with new entry points

The library has been renamed from dry-validator to dry-validation. The old require paths (lib/dry-validator.rb and lib/dry/validator.rb) have been removed and replaced with new entry points (lib/dry-validation.rb and lib/dry/validation.rb). The new entry point uses Zeitwerk for autoloading and registers extensions like monads and hints. The old Dry::Validator class and Dry::Rules module have been removed, indicating a significant API change where the previous validator implementation is no longer available via these paths.

lib/dry · high confidence

Log support directory relocated

The .gitkeep file previously located in spec/support has been moved to the log directory. This change reorganizes the project's internal directory structure without altering any functional behavior or user-facing features.

log · low confidence

Migrate CI to GitHub Actions and modernize development tooling

The project has moved from Travis CI to GitHub Actions, removing the \.travis.yml\ configuration and adding a \zizmor.yml\ security policy file. Development tooling has been updated to use Hanakai's synced RuboCop configuration (replacing the local \.rubocop.yml\ and deleting \.rubocop\_todo.yml\), and the Rakefile now includes dedicated tasks for running specs with specific extensions or in isolation. Documentation and metadata have also been refreshed, including a new \.yardopts\ file for YARD documentation generation, an updated \repo-sync.yml\ defining gem metadata and dependencies, and a new \Gemfile.devtools\ for development-only gems.

(repo-wide) · high confidence

New class interface and build shortcut for validation contracts

The contract definition API has been refactored into a dedicated \ClassInterface\ module, introducing a \build\ class method that allows creating one-off, non-inheritable contract instances without defining a named class. The interface now explicitly supports defining \params\, \json\, and \schema\ blocks, with the latter two accepting external schemas. Additionally, rule definitions now strictly validate that specified keys exist within the defined schema, raising an \InvalidKeysError\ if mismatches are detected.

lib/dry/validation/contract · high confidence

New message resolution logic for validation errors

A new Messages::Resolver class has been introduced to handle the resolution of validation error messages. This component manages the lookup of message templates based on rule names and field paths, supports locale-specific resolution, and formats full error messages by combining field keys with the error text. It also handles the parsing of token values, such as converting arrays into comma-separated strings, ensuring consistent error output for users.

lib/dry/validation/messages · high confidence

Removal of RuboCop rake tasks

The RuboCop integration tasks have been removed from the Rake environment. Users can no longer invoke RuboCop checks or auto-configuration generation via the standard Rake tasks defined in the project.

rakelib · high confidence

dry-validation 1.11.1: New Contract API and Result object

The library has been updated to version 1.11.1, introducing a new \Contract\ class that wraps schema validation and custom rules into a single callable unit. This change replaces the previous \Validator\ namespace with \Validation\ and provides a \Result\ object that aggregates schema errors and rule failures, offering methods like \success?\, \failure?\, and \errors\ for easier inspection. The update also includes a new \Evaluator\ context for rule blocks, a \Failures\ accumulator, and support for localized messages via \MessageSet\.

lib/dry/validation · high confidence

Test coverage

Added integration tests for Contract, Evaluator, and Result; removed legacy Validator specs; Added integration tests for Dry::Validation::Contract; Added integration tests for evaluator error handling, failure APIs, and context usage; Added integration tests for macro validation features; Added integration tests for the Contract class interface; Added integration tests for the message resolver; Added integration tests for validation rules; Added test support configuration files; Added tests for Result pattern matching; Added tests for predicates\_as\_macros extension; Added tests for the monads extension's Result\#to\_monad method; Added unit tests for rule composition and value path resolution; Standardized RSpec configuration and test environment setup.

Dependencies

Major dependency overhaul and Ruby version upgrade

The gem has been renamed from dry-validator to dry-validation and now requires Ruby 3.3 or higher. Runtime dependencies have been significantly updated: dry-schema is now pinned to \~\> 1.14, dry-core to \~\> 1.1, and dry-initializer to \~\> 3.2, while adding concurrent-ruby and zeitwerk as new runtime requirements. The old dependencies (dry-configurable, dry-container, thread\_safe) have been removed. Development tooling has also shifted, replacing rubocop and guard with dry-monads and i18n for testing, and adding a benchmarks group with ActionPack, ActiveModel, ActiveRecord, and SQLite3.

(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 59 → 58 (-1.4)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 76 → 76 (+0.0)
  • Architecture 100 → 100 (+0.0)
  • Maturity 37 → 37 (+0.0)
  • Readiness 74 → 74 (+0.0)
  • Security 81 → 71 (-9.7)
  • Domain Modelling 100 → 100 (+0.0)
  • Performance 85 → 85 (+0.0)

Resolved (3)

  • Documentation: no installation or build instructions (README.md)
  • Inconsistent error querying granularity. error?(key) is ambiguous compared to the specific schema_error?, rule_error?, and base_rule_error?. It is unclear if error? is a superset or if it behaves differently than the specific variants. This creates confusion for API users on which method to use for general error checking.
  • Redundant schema export methods with ambiguous intent. params, json, and schema likely produce similar outputs (schema definitions) but for different contexts (e.g., API params vs JSON schema vs internal schema). However, without clear documentation distinguishing the output format or use-case, these appear as duplicate operations for 'getting the schema'.

Changes since last survey

  • 2 commits — 2 feature/other, 0 fixes

By area

  • .github/workflows — 2 commits

Notable commits

  • change: File sync from hanakai-rb/repo-sync
  • change: File sync from hanakai-rb/repo-sync

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

Survey your own repository

dry-rb/dry-validation 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 50ef11ad633feff54df726ff4c8d6ae6eae6f6a5 — 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.