# Changelog

## Score

- CAI 58 → 58 (-0.8)
- Rubric changed (rubric-2026.10.1 → rubric-2026.10.5) — scores are not directly comparable.

## Lenses

- Code Health 98 → 75 (-23.3)
- Architecture 69 → 81 (+11.7)
- Maturity 55 → 54 (-1.0)
- Readiness 47 → 47 (+0.0)
- Security 97 → 97 (+0.0)

## Resolved (4)

- Duplicate intent between generator classes. `ActiveRecordTransitionGenerator` and `MigrationGenerator` both expose `create_migration_file`. It is unclear if these are distinct implementations for different contexts or if `MigrationGenerator` is a redundant alias/wrapper for the migration part of `ActiveRecordTransitionGenerator`.
- Inconsistent naming for configuration access. `configure` implies setting up configuration, while `config` implies retrieving it. However, `Config` class also has `storage_adapter` and `mysql_gaplock_protection?` which are also exposed on the top-level `Statesman` module. It is unclear if `Statesman.config()` returns the `Config` instance or a snapshot, and how it relates to `Statesman.configure`.
- While `!` often denotes raising exceptions in Ruby, the presence of both `transition_to` and `transition_to!` alongside `can_transition_to?` and `allowed_transitions` creates a slightly fragmented API for state transitions. More importantly, `Machine.reset()` exists, but there is no `Machine.clear_history()` or similar, which might be expected if `reset` is ambiguous.
- Workflow token permissions not restricted

## New (6)

- Duplicate Capability Check: The check for database support of partial indexes is implemented in both the Adapter (`ActiveRecord`) and the Generator Helpers (`GeneratorHelpers`). This leads to potential drift if database capabilities change, as both locations must be updated.
- Inconsistent Configuration API: `configure` implies setting up global state, while `config` implies retrieving it. However, `Config` class also has `initialize(block)` and `storage_adapter`. The top-level `Statesman` methods are ambiguous regarding whether they modify global state or just return a config object, especially since `Config` exists as a distinct type.
- Inconsistent Error Handling Convention: Ruby/Rails conventions typically use `!` to denote methods that raise exceptions on failure (e.g., `save` vs `save!`). Here, `transition_to` and `transition_to!` exist. However, `Machine` also has `can_transition_to?` which is a predicate. The distinction between `transition_to` (likely returning a result object or nil) and `transition_to!` (raising) is clear, but `Machine` also has `allowed_transitions` which is a query. The inconsistency lies in the fact that `transition_to` might not raise, but the error handling path is complex with `execute_on_failure`. It is a minor inconsistency but worth noting if `transition_to` is expected to be the 'safe' version.
- Orphaned file (lib/statesman/machine.rb)
- Redundant Generator Classes: `ActiveRecordTransitionGenerator` and `MigrationGenerator` both expose `create_migration_file`. `ActiveRecordTransitionGenerator` also exposes `create_model_file`, suggesting it is a composite generator, while `MigrationGenerator` seems to be a specialized subset. This creates confusion about which generator to use for standard state machine setup.
- Workflow token permissions not restricted (.github/workflows/tests.yml)

## Changes since last survey

- 2 commits — 2 feature/other, 0 fixes

## By area

- (root) — 1 commit
- lib/statesman — 1 commit

## Notable commits

- change: Bump v13.4.0 (#580)
- change: [Bulk transition] [V1] PR-1928: BulkTransition MVP  (#576)
