smart-rb/smart_operation
54.8
Adequate · 8 November 2026
763
lines of production code
Ruby
primary language
7
measurements over time
What this system is
This system is a Ruby library that provides a structured framework for defining and executing discrete operations. It enables dependency injection and enforces type-safe parameter configuration through a dedicated class constructor. The library manages execution outcomes using explicit result types—Success, Failure, Fatal, and Callback—which support both synchronous return values and block-based callback handling for robust error management.
Features
Introduces interface modules for callable operations, dependency injection, and result handling
This change adds three new interface modules to the library: \Callable\, which provides a class-level \call\ method for instantiating and executing operations; \DI\, which includes the \SmartCore::Injection\ module to enable dependency injection within operations; and \Result\, which exposes factory methods (\Success\, \Failure\, \Fatal\, \Callback\) for constructing result objects. These modules form the foundational interface layer for defining and executing smart core operations with support for dependency injection and structured result handling.
_lib/smart\core/operation/interface · high confidence
Behavioural changes
Introduce structured Result types for operations
The \lib/smart\_core/operation/result\ directory now contains a complete set of classes to represent operation outcomes, replacing the previous implicit or unstructured approach. Users can now distinguish between \Success\, \Failure\, \Fatal\, and \Callback\ results. \Success\ results allow accessing returned data via virtual accessors and a \to\_h\ method, while preventing key collisions with core methods. \Failure\ and \Fatal\ results provide structured error handling through an \Error::Set\ that aggregates error codes and contexts, enabling iteration over individual error cases. This change provides a consistent, type-safe interface for handling both successful execution and various error states within operations.
_lib/smart\core/operation/result · high confidence
Introduction of Parameters class for type system configuration
A new Parameters class has been added to the ClassConstructor module to manage the type system configuration. This class accepts a type\_system argument (String or Symbol) during initialization, providing a dedicated structure for handling parameter type definitions within the operation's class constructor logic.
_lib/smart\_core/operation/class\constructor · high confidence
Operation class refactored to support dependency injection and structured results
The SmartCore::Operation class has been restructured to include interfaces for dependency injection (DI), callability, and result handling. This change introduces a new result system with Success, Failure, Fatal, and Callback states, and integrates DI support via the SmartCore::Injection module. Users can now define operations that automatically inject dependencies and return structured results, improving error handling and modularity.
_lib/smart\core · high confidence
Operation execution now supports block-based result handling
The \SmartCore::Operation\ class has been updated to allow its \call\ method to accept a block. When a block is provided, the result (whether success or fatal error) is yielded to that block, enabling asynchronous or callback-style handling of operation outcomes without requiring explicit return value inspection. This change is implemented via the new \InstanceBuilder\ which prepends a module to the operation's singleton class to intercept the \call\ method and yield results.
_lib/smart\core/operation · high confidence
Switches development console from IRB to Pry
The local development console (bin/console) now uses Pry instead of IRB for the interactive Ruby shell, providing users with enhanced debugging and navigation capabilities when running the application locally.
bin · high confidence
Test coverage
Added smoke tests for operation results and dependency injection
Added a new smoke test suite (\spec/smoke\_test\_spec.rb\) that validates core operation behaviors, including basic execution, dependency injection via container registration, and the four result types: Success, Failure, Fatal, and Callback. The tests also verify the block-notation API for handling these results. Additionally, the test configuration (\spec/spec\_helper.rb\) was updated to enable branch and line code coverage reporting and added a dependency on \pry\.
spec · high confidence
Dependencies
Upgrade smart\_operation to 0.1.0 with new dependencies and tooling updates
The smart\_operation gem has been updated to version 0.1.0, introducing new runtime dependencies on smart\_initializer (\~\> 0.4) and smart\_injection (\~\> 0.2), while upgrading the core smart\_engine dependency from \~0.5 to \~0.11. Development tooling has also been updated, including bundler (\~\> 2.2), rspec (\~\> 3.10), armitage-rubocop (\~\> 1.7), and simplecov (\~\> 0.21), with the addition of pry (\~\> 0.13) as a new development dependency.
(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.2)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 76 → 76 (+0.0)
- Architecture 69 → 69 (+0.0)
- Maturity 54 → 54 (+0.0)
- Readiness 43 → 43 (+0.0)
- Security 95 → 100 (+5.4)
Resolved (1)
- Ambiguous method signature: The class exposes two methods named call. One takes an operation argument, and the other takes none. This is likely an error in the API surface (e.g., one should be initialize or build, or the no-arg version is a typo for a different method). In Ruby, defining two methods with the same name in the same scope is invalid unless one is an alias or the signatures are distinct in a way that allows overloading (which Ruby does not support natively).
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
smart-rb/smart_operation 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 8 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 bdf607eaad92f49616d084636d0f9db8ef479648 — 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.3+preprod-45ab2cab63de.