CHANGELOG.md
All notable changes to Familia are documented here.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
## [2.0.0-pre10] - 2025-09-02 18:07:56.439890
Added
-
The
Familia::Horreuminitializer now supports creating an object directly from its identifier by passing a single argument (e.g.,Customer.new(customer_id)). This provides a more convenient and intuitive way to instantiate objects from lookups. - Automatic indexing and class-level tracking on
save()operations, eliminating the need for manual index updates. - Enhanced collection syntax supports the Ruby-idiomatic
<<operator for more natural relationship management.
Changed
-
The
member_ofrelationship is now bidirectional. A single call tomember.add_to_owner_collection(owner)is sufficient to establish the relationship, removing the need for a second, redundant call on the owner object. This fixes bugs where members could be added to collections twice. - BREAKING: Refactored Familia Relationships API to remove “global” terminology and simplify method generation. (Closes #86)
- Split
generate_indexing_instance_methodsinto focusedgenerate_direct_index_methodsandgenerate_relationship_index_methodsfor better separation between direct class-level and relationship-based indexing. - Simplified method generation by removing complex global vs parent conditionals.
- All indexes are now stored at the class level for consistency.
Fixed
-
Fixed a bug in the
class_indexed_byfeature where finder methods (e.g.,find_by_email) would fail to correctly instantiate objects from the index, returning partially-formed objects. -
Refactored connection handling to properly cache and reuse Redis connections. This eliminates repetitive “Overriding existing connection” warnings and improves performance.
- Method generation now works consistently for both
class_indexed_byandindexed_bywith aparent:. - Resolved metadata storage issues for dynamically created classes.
- Improved error handling for nil class names in tracking relationships.
Documentation
- Updated the
examples/relationships_basic.rbscript to reflect the improved, bidirectionalmember_ofAPI and to ensure a clean database state for each run.
AI Assistance
- This refactoring was implemented with Claude Code assistance, including comprehensive test updates and API modernization.
# [2.0.0-pre9] - 2025-09-02 00:35:28.974817
Added
- Added
class_tracked_inmethod for global tracking relationships following Horreum’s establishedclass_prefix convention - Added
class_indexed_bymethod for global index relationships with consistent API design
Changed
- BREAKING:
tracked_in :global, collectionsyntax now raises ArgumentError - useclass_tracked_in collectioninstead - BREAKING:
indexed_by field, index, context: :globalsyntax replaced withclass_indexed_by field, index - BREAKING:
indexed_by field, index, context: SomeClasssyntax replaced withindexed_by field, index, parent: SomeClass - Relationships API now provides consistent parameter naming across all relationship types
Documentation
- Updated Relationships Guide with new API syntax and migration examples
- Updated relationships method documentation with new method signatures
- Updated basic relationships example to demonstrate new API patterns
- Added tryouts test coverage in try/features/relationships/relationships_api_changes_try.rb
Added
- Implemented Scriv-based changelog system for sustainable documentation
- Added fragment-based workflow for tracking changes
- Created structured changelog templates and configuration
Documentation
- Set up Scriv configuration and directory structure
- Created README for changelog fragment workflow
Added
- Comprehensive relationships system with three relationship types:
tracked_in- Multi-presence tracking with score encodingindexed_by- O(1) hash-based lookupsmember_of- Bidirectional membership with collision-free naming
- Categorical permission system with bit-encoded permissions
- Time-based permission scoring for temporal access control
- Permission tier hierarchies with inheritance patterns
- Scalable permission management for large object collections
- Score-based sorting with custom scoring functions
- Permission-aware queries filtering by access levels
- Relationship validation framework ensuring data integrity
Changed
- Performance optimizations for large-scale relationship operations
Security
- GitHub Actions security hardening with matrix optimization
Added
- New
save_if_not_existsmethod for conditional persistence - Atomic persistence operations with transaction support
- Enhanced error handling for persistence failures
- Improved data consistency guarantees
Changed
- Connection provider pattern for flexible pooling strategies
- Multi-database support with intelligent pool management
- Thread-safe connection handling for concurrent applications
- Configurable pool sizing and timeout management
- Modular class structure with cleaner separation of concerns
- Enhanced feature system with dependency management
- Improved inheritance patterns for better code organization
- Streamlined base class functionality
Fixed
- Critical security fixes in Ruby workflow vulnerabilities
- Systematic dependency resolution via multi-constraint optimization
Added
- Field-level encryption with transparent access patterns
- Multiple encryption providers:
- XChaCha20-Poly1305 (preferred, requires rbnacl)
- AES-256-GCM (fallback, OpenSSL-based)
- Field-specific key derivation for cryptographic domain separation
- Configurable key versioning supporting key rotation
- Non-persistent field storage for sensitive runtime data
- RedactedString wrapper preventing accidental logging/serialization
- Memory-safe handling of sensitive data in Ruby objects
- API-safe serialization excluding transient fields
Security
- Encryption field security hardening with additional validation
- Enhanced memory protection for sensitive data handling
- Improved key management patterns and best practices
- Security test suite expansion with comprehensive coverage
Added
- Complete API redesign for clarity and modern Ruby conventions
- Valkey compatibility alongside traditional Redis support
- Ruby 3.4+ modernization with fiber and thread safety improvements
- Connection pooling foundation with provider pattern architecture
Changed
Familia::Basereplaced byFamilia::Horreumas the primary base class- Connection configuration moved from simple string to block-based setup
- Feature activation changed from
includetofeaturedeclarations - Method naming updated for consistency (
delete→destroy,exists→exists?,dump→serialize)
Documentation
- YARD documentation workflow with automated GitHub Pages deployment
- Comprehensive migration guide for v1.x to v2.0.0-pre transition