# Changelog

## Score

- CAI 59 → 55 (-4.0)
- Rubric changed (rubric-2026.10.1 → rubric-2026.10.5) — scores are not directly comparable.

## Lenses

- Code Health 100 → 76 (-24.3)
- Architecture 69 → 69 (+0.0)
- Maturity 50 → 45 (-5.7)
- Readiness 57 → 57 (+0.0)
- Security 82 → 82 (+0.0)

## Resolved (5)

- Ambiguous 'leaves' operation: 'leaves' exists on both the instance (Relatable) and class (ClassMethods) levels. While this is common in ORMs, the instance method 'leaves' on Relatable is semantically odd (a single node doesn't have 'leaves' in the plural sense unless it refers to its own descendants that are leaves, which is better named 'leaf_descendants' or similar).
- Inconsistent scope naming and duplication: Both instance (Model) and class (ClassMethods) methods share the name 'nested_set_scope', but the instance method has a confusingly named variant 'nested_set_scope_without_default_scope' that suggests internal implementation details leaking into the public API.
- Naming inconsistency and potential redundancy: 'decendants' is a typo (should be 'descendants'). 'destroy_descendants' and 'decendants_to_destroy_in_order' appear to do similar things but with different return types or side effects, yet the typo makes them look like accidental duplicates.
- PR-triggered workflow without a permissions block
- Redundant iteration logic: ClassMethods.each_with_level delegates to or duplicates the functionality of the Iterator class, exposing both a class method and a separate Iterator type for the same traversal pattern.

## New (12)

- Duplicate 'leaves' operation. ClassMethods.leaves() returns all leaf nodes in the scope, while Relatable.leaves() (instance method) likely returns immediate children that are leaves or similar. The naming is identical but the scope (class vs instance) and potentially the semantic meaning (all leaves vs local leaves) differ, causing confusion.
- Duplicate 'nested_set_scope' method on both Model (instance) and ClassMethods (class). The instance method likely delegates to the class method or provides a default scope wrapper, but exposing both creates redundancy.
- Duplicate functionality for iterating tree nodes with depth information. One is a class method taking an object collection, the other is an iterator object pattern.
- Inconsistent pluralization and scope for root retrieval. ClassMethods has both root (singular) and roots (plural), while Relatable also has both. It is unclear if ClassMethods.root() returns the first root or raises an error if multiple exist, whereas roots() returns all. This pattern is repeated in Relatable, but instance methods usually imply a single entity context.
- Orphaned file (lib/awesome_nested_set/columns.rb)
- Orphaned file (lib/awesome_nested_set/model.rb)
- Orphaned file (lib/awesome_nested_set/model/movable.rb)
- Orphaned file (lib/awesome_nested_set/model/prunable.rb)
- Orphaned file (lib/awesome_nested_set/model/relatable.rb)
- Orphaned file (lib/awesome_nested_set/model/validatable.rb)
- Orphaned file (lib/awesome_nested_set/move.rb)
- PR-triggered workflow without a permissions block (.github/workflows/ci.yml)
