rom-rb/rom
48.0
Weak · 10 November 2026
13k
lines of production code
Ruby
primary language
10
measurements over time
What this system is
This system is the ROM (Ruby Object Mapper) framework, a modular data persistence library for Ruby that structures data access through relations, commands, and mappers. It provides a composable changeset API for preparing and validating data transformations before persistence, supporting create, update, and delete operations with diff-based updates and associated record handling. The architecture is decoupled into core, repository, and changeset components, enabling flexible integration with SQL databases and other adapters while maintaining strict type safety and schema validation.
Features
Add Relation\#changeset method for creating and committing changesets
Relations now include a \changeset\ method that allows users to create changesets for create, update, and delete operations directly from the relation. This enables a fluent API where users can chain \.changeset(:create, data)\ or \.changeset(:update, data)\ followed by \.commit\ to persist changes, supporting both predefined types and custom changeset classes.
changeset/lib/rom/plugins/relation · high confidence
Added ROM repository performance benchmarks
New benchmark scripts have been added to the repository/benchmarks directory to measure and compare the performance of ROM-repository against Sequel and ActiveRecord. The suite includes basic creation and update benchmarks, a specific comparison between ROM commands and changesets, a garbage collection suite for accurate timing, and a profiling script using Hotch.
repository/benchmarks · high confidence
Added ROM vs ActiveRecord benchmark suite
The core/benchmarks directory now includes a comprehensive benchmark suite comparing ROM and ActiveRecord performance. The new files include basic\_bench.rb for standard load tests (single/many records, associations, JSON serialization), gc\_suite.rb for garbage collection control, and profile scripts (profile\_combine.rb, profile\_one.rb, profile\_wrap.rb) using Hotch for profiling specific operations. The setup.rb file configures the database schema, seeds data optionally via the SEED environment variable, and defines the comparison scenarios.
core/benchmarks · high confidence
Added SQL and Upsert example scripts for ROM repository usage
The repository/examples directory now includes two new Ruby scripts demonstrating core ROM repository patterns. The sql.rb script provides a basic example of setting up a SQL-backed repository with SQLite, including relation definitions, command registration (create, update, delete), and basic CRUD operations. The upsert.rb script demonstrates a more complex scenario using PostgreSQL, showing how to implement a custom upsert command (fetch\_or\_create) for handling unique constraints on tags, managing associations between books and tags, and performing transactions with changesets.
repository/examples · high confidence
Added bin/console, bin/bundle, and bin/doc scripts
The project now includes three new executable scripts in the bin directory to improve developer workflow. bin/console provides an interactive IRB environment pre-configured with the ROM SQL gateway, sample database schemas (books, users, tasks), and a UserRepo, allowing developers to experiment with the data layer. bin/bundle automates running bundle install across the core, repository, and changeset subdirectories. bin/doc runs Yard documentation generation for the core, mapper, and repository modules.
bin · high confidence
Introduce ROM Changeset library with composable data transformation and persistence
The \rom-changeset\ library is introduced, providing a structured way to prepare and persist data through ROM relations. It includes a base \Changeset\ class and specialized subclasses for \Create\, \Update\, and \Delete\ operations. The \Stateful\ changesets support composable data transformation via a \Pipe\ system built on \Transproc\, allowing users to define mapping steps (e.g., \map\, \extend\) that transform data before persistence. The \Update\ changeset specifically calculates diffs between original and new data, committing only when changes exist. Additionally, the \Associated\ changeset enables composite commands for persisting parent-child relationships in a single operation, and a plugin API is registered to allow extensibility.
changeset/lib · high confidence
New instrumentation and registry reader plugins for relations
Added two new plugins to the relation plugin system: an instrumentation plugin that allows relations to integrate with external monitoring systems (like dry-monitor or ActiveSupport::Notifications) by wrapping specified methods with notification hooks, and a registry reader plugin that enables relations to access other relations through a shared registry instance.
core/lib/rom/plugins/relation · high confidence
ROM Repository v5.4.3 introduces structured repository classes and plugin support
The repository library has been restructured into a modular architecture with dedicated classes for \Repository\, \Root\, \Session\, and \RelationReader\, replacing the previous ad-hoc implementation. This change introduces support for repository plugins via the \use\ method and allows commands to accept plugin options, enabling custom behavior extension. The \Repository::Root\ class now serves as the primary interface for defining repositories with a specific root relation, while the \Session\ class provides a mechanism to queue changesets for batched commits. Additionally, the \RelationReader\ has been optimized with memoization to improve performance when accessing relations, and the \auto\_struct\ and \struct\_namespace\ options are now configurable at both the class and instance levels.
repository/lib · high confidence
Standardize development environment and CI configuration
The repository now includes standardized configuration files for RuboCop, Code Climate, Inch CI, YARD, and RSpec, along with a Docker-based development environment (Dockerfile, docker-compose.yml, and docker\_start.sh). These changes establish consistent linting rules, code quality metrics, documentation generation, and test execution settings across the project, while also providing a containerized setup for local development.
(repo-wide) · high confidence
Behavioural changes
Extract rom-changeset into a standalone gem
The changeset functionality has been extracted from rom-repository into its own separate gem (rom-changeset). This decouples changesets from repositories, allowing them to use relations to retrieve their commands and making the \Relation\#changeset\ interface available as a relation plugin. The diff confirms this structural change by adding the standalone gem's configuration files (\.rspec\, \.yardopts\, \Rakefile\), documentation (\README.md\, \CHANGELOG.md\), and license, marking version 1.0.0 as the initial release of this independent component.
changeset · high confidence
Migrate core library to ROM 3.0 structure
The library has been restructured to align with the ROM 3.0 architecture. The previous \lib/session.rb\ implementation, which handled unit-of-work operations like insert, update, and remove via a \Session\ module, has been removed. It is replaced by a new \lib/rom.rb\ entry point that requires the \rom-core\, \rom-repository\, and \rom-changeset\ gems, indicating a shift to a modular component-based design.
lib · high confidence
ROM core library restructured with new association and command APIs
The core library has been reorganized into a new directory structure, introducing dedicated modules for associations (including definitions for one-to-one, one-to-many, many-to-one, and many-to-many relationships) and commands (including a command compiler, registry, and graph-based command execution). This change also adds support for auto-currying relation views, a new attribute class with aliasing support, and a namespaced cache system, providing a more modular and extensible foundation for relation and command handling.
core/lib · high confidence
Removal of Repository::Root\#aggregate method
The \Repository::Root\#aggregate\ method has been removed from the repository component. Users must now use \Relation\#combine\ instead to compose relation graphs, which represents a breaking change in how data associations are handled within the repository layer.
repository · high confidence
Simplified command schema plugin and enhanced timestamp plugin
The command schema plugin has been simplified to automatically compose input schemas from relation schemas when building commands, ensuring that input processing respects the relation's defined schema. Additionally, the timestamp plugin now supports both timestamp and datestamp attributes, allowing users to specify which columns should be automatically populated with the current time or date when a command is executed.
core/lib/rom/plugins/command · high confidence
Test coverage
Added integration tests for ROM core components; Added integration tests for changeset functionality; Added integration tests for create, update, and delete commands; Added integration tests for gateway parameter configuration; Added integration tests for relation gateways and reading behaviors; Added integration tests for repository features; Added integration tests for the mapper DSL; Added shared test fixtures for changeset specs; Added shared test suites for command, relation, and dataset behavior; Added test fixtures for command, mapper, and relation classes; Added test infrastructure for the changeset component; Added test support utilities for schema definition and constant leak detection; Added tests for ROM auto-registration behavior; Added tests for ROM::Relation::Wrap\#combine; Added tests for memory repository linting and relation instrumentation; Added tests for the schema timestamps plugin; Added unit tests for ManyToOne and OneToMany associations; Added unit tests for ROM Changeset core functionality; Added unit tests for ROM Relation core behaviors; Added unit tests for ROM Schema operations; Added unit tests for ROM command execution patterns; Added unit tests for ROM::Attribute behavior; Added unit tests for ROM::Processor::Transproc; Added unit tests for ROM::Relation::Combined; Added unit tests for Relation class interface methods; Added unit tests for command schema and timestamps plugins; Added unit tests for core ROM components; Added unit tests for repository class interface, sessions, and transactions; Refactored test infrastructure and removed spike tests; Tests for ROM container setup and schema plugin configuration; Updated test configuration and helper setup; Updated test configuration for Ruby 3.4 and warning strictness.
Dependencies
ROM 5.4 dependency structure and version alignment
The ROM gem and its sub-components (rom-core, rom-repository, rom-changeset) are updated to version 5.4, with rom-repository pinned to \>= 5.4.3. The dependency graph is aligned to use dry-\* libraries (dry-core, dry-initializer, dry-struct, dry-types, etc.) at versions \~\> 1.0 or higher, and transproc at \~\> 1.1. The main Gemfile now explicitly includes rom-sql from the main branch and Sequel \~\> 5.0 for SQL operations, while dropping older dev tools in favor of the debug gem for Ruby 3.4+.
(dependencies) · high confidence
Housekeeping
Added placeholder for core/log directory; ROM core repository structure and configuration files; ROM library version updated to 5.4.3.
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 50 → 48 (-1.6)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 75 → 75 (+0.0)
- Architecture 94 → 94 (-0.5)
- Maturity 50 → 50 (+0.0)
- Readiness 33 → 32 (-0.2)
- Security 70 → 59 (-10.8)
- Domain Modelling 100 → 100 (+0.0)
- Performance 80 → 80 (+0.0)
Resolved (6)
- Inconsistent argument order for associate. ManyToMany takes (children, parent), while ManyToOne and OneToMany take (child, parent). This inconsistency in argument ordering (plural vs singular, order of entities) can lead to bugs when switching between association types.
- Inconsistent constructor signatures for 'new'. Changeset.new takes (relation, options), while Pipe.new has two distinct signatures: (args, opts) and (processor, opts). This lack of uniformity in how new instances are created across related change-processing types is confusing.
- Inconsistent invocation methods for commands. ROM.Command exposes both execute and call, while CommandProxy and specific command types (Graph, Lazy) only expose call. This creates ambiguity for users on whether to use execute or call for standard commands.
- Off-boarding risk: anonymized user #1
- Split core
- While fetch_or_store is consistent between Cache and Namespaced Cache, the base ROM.Cache class also exposes for reading, whereas Namespaced Cache also exposes . However, the primary inconsistency is that ROM.Cache has but ROM.Cache.Namespaced also has . This is actually consistent. A better inconsistency is found in ROM.Command vs ROM.CommandProxy. Command has execute and call. CommandProxy only has call. Lazy commands only have call. This suggests execute is legacy or redundant.
New (3)
- Floating git dependency: rom-sql
- Off-boarding risk: anonymized user #1
- Projects may be oversized for their cohesion
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
rom-rb/rom 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 10 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 800d1633a74287b53f24d7f66caf03297ba0f852 — 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.4+preprod-464a0040a931.