cypriss/mutations
55.0
Adequate · 6 November 2026
972
lines of production code
Ruby
primary language
4
measurements over time
What this system is
Mutations is a Ruby gem designed to compose business logic by sanitizing and validating input for Rails applications. It provides a comprehensive suite of input filters for various data types, including strings, numbers, dates, files, and custom objects, along with configurable error handling and validation rules. The system structures execution outcomes and supports extensibility through custom filter registration and inheritance.
Features
Initial release of Mutations gem with comprehensive changelog and documentation
This release introduces the Mutations gem, a library for composing business logic into commands that sanitize and validate input for Ruby and Rails applications. The package includes a full changelog documenting features from v0.5.10 through v0.9.2, such as various input filters (string, integer, date, time, symbol, array, hash, model, duck, file), options like \empty\_is\_nil\ and \discard\_empty\, and support for Ruby 2.1+. It also provides an MIT license, a Rakefile for testing, and updated README documentation with installation instructions and usage examples.
(repo-wide) · high confidence
Behavioural changes
Expanded input filtering and configurable error handling
The library now supports a broader range of input types through new filters for dates, times, files, symbols, floats, and duck-typed objects, alongside existing string, integer, boolean, model, array, and hash filters. This expansion is enabled by adding dependencies on ActiveSupport and the Date/Time/BigDecimal standard libraries. Additionally, users can now customize error message generation by injecting a custom error message creator via the new \error\_message\_creator\ accessor, and the library enables constant caching by default to improve performance.
lib · high confidence
New date, time, file, symbol, and duck-type filters with improved error handling and array validation
The library introduces several new input filters: DateFilter and TimeFilter for parsing and validating dates and times (with range checks), FileFilter for validating uploaded files (with size limits), SymbolFilter for restricting values to specific symbols, and DuckFilter for validating that objects respond to specific methods. Existing filters have been updated: BooleanFilter and IntegerFilter now check for the Integer class instead of the deprecated Fixnum, and StringFilter now supports min/max length, control character stripping, and an empty\_is\_nil option. ArrayFilter now supports min\_length and max\_length constraints and allows custom filters to be registered via the new AdditionalFilter base class. The Command class now exposes raw\_inputs, validates without executing via a new validate method, and returns a structured Outcome object containing the filtered inputs. Error reporting has been overhauled to use a DefaultErrorMessageCreator for full-sentence messages and ErrorAtom/ErrorHash structures, replacing the previous HashWithIndifferentAccess-based errors.
lib/mutations · high confidence
Test coverage
Comprehensive test coverage for input filters and commands
Added extensive test suites for the core input filtering system, including \AdditionalFilter\, \ArrayFilter\, \BooleanFilter\, \DateFilter\, \DuckFilter\, \FileFilter\, \FloatFilter\, \HashFilter\, \IntegerFilter\, \ModelFilter\, \StringFilter\, \SymbolFilter\, and \TimeFilter\. These tests validate type coercion, validation rules (such as \min\/\max\, \in\, \nils\, \empty\_is\_nil\), and error handling. Additionally, tests were added for \Command\ execution flows, including custom validation methods, error reporting structures, and inheritance behavior.
spec · high confidence
Dependencies
Adopts gemspec for dependency management
The project now manages its dependencies through the newly created mutations.gemspec file instead of the previous Gemfile. This change consolidates the runtime dependency on activesupport and development dependencies (minitest, rake) into the gemspec, removes the explicit minitest version constraint from the Gemfile, and deletes the Gemfile.lock to allow for more flexible testing across different Ruby versions and VMs.
(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 55 → 55 (-0.0)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 73 → 73 (+0.0)
- Architecture 69 → 69 (+0.0)
- Maturity 38 → 38 (+0.0)
- Readiness 65 → 65 (+0.0)
- Security 99 → 98 (-0.7)
Resolved (7)
- Consistent signatures for model, but ArrayFilter has model while HashFilter also has model. This is consistent. However, ArrayFilter has hash and array methods that differ from HashFilter. The inconsistency is specifically in hash and array methods between these two types.
- Duplicate intent with ambiguous distinction. Two methods exist with nearly identical names (run vs run!) but different signatures (one takes no args, one takes no args). The ! suffix usually implies mutation or raising errors, but without seeing bodies, the API surface suggests redundant entry points for execution.
- Inconsistent arity and naming convention for execution methods. One takes arguments, the other does not, despite both being named 'run' variants. This suggests a confusion between 'building' a command with args vs 'executing' it, or a copy-paste error in signature design.
- Inconsistent method signatures for defining nested array structures. ArrayFilter.array takes (options, block) while HashFilter.array takes (name, options, block). The name parameter is missing in ArrayFilter.
- Inconsistent method signatures for defining nested structures. ArrayFilter.hash takes (options, block) while HashFilter.hash takes (name, options, block). The name parameter is missing in ArrayFilter, making the API inconsistent for defining nested hash inputs within an array context.
- Off-boarding risk: anonymized user #1
- While these are on different types, the naming message vs message_list is inconsistent across error container types. ErrorAtom has both, but ErrorHash and ErrorArray also have both. However, ErrorAtom is a single error, ErrorHash/ErrorArray are collections. The inconsistency lies in ErrorAtom having message (singular) and message_list (plural), whereas the collection types also have both. This is actually consistent, BUT ErrorAtom.message() and ErrorHash.message() returning different structures (string vs array of strings?) would be an inconsistency. Assuming they return strings, it's fine. However, ErrorAtom having message_list is semantically odd for a single atom.
New (1)
- Off-boarding risk: anonymized user #1
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
cypriss/mutations 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 475d011463a48075a01081bf26f632d1fc681652 — 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.