familia 2.0.0.pre12 → 2.0.0.pre14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +2 -3
  3. data/CHANGELOG.rst +529 -0
  4. data/CLAUDE.md +1 -1
  5. data/Gemfile +1 -6
  6. data/Gemfile.lock +13 -7
  7. data/README.md +21 -2
  8. data/changelog.d/README.md +5 -5
  9. data/{setup.cfg → changelog.d/scriv.ini} +1 -1
  10. data/docs/guides/Feature-System-Autoloading.md +228 -0
  11. data/docs/guides/time-utilities.md +221 -0
  12. data/docs/migrating/v2.0.0-pre11.md +14 -16
  13. data/docs/migrating/v2.0.0-pre13.md +95 -0
  14. data/docs/migrating/v2.0.0-pre14.md +37 -0
  15. data/examples/autoloader/mega_customer/safe_dump_fields.rb +6 -0
  16. data/examples/autoloader/mega_customer.rb +17 -0
  17. data/examples/safe_dump.rb +1 -1
  18. data/familia.gemspec +1 -0
  19. data/lib/familia/autoloader.rb +53 -0
  20. data/lib/familia/base.rb +5 -0
  21. data/lib/familia/data_type.rb +4 -0
  22. data/lib/familia/encryption/encrypted_data.rb +4 -4
  23. data/lib/familia/encryption/manager.rb +6 -4
  24. data/lib/familia/encryption.rb +1 -1
  25. data/lib/familia/errors.rb +3 -0
  26. data/lib/familia/features/autoloadable.rb +113 -0
  27. data/lib/familia/features/encrypted_fields/concealed_string.rb +4 -2
  28. data/lib/familia/features/expiration.rb +4 -0
  29. data/lib/familia/features/external_identifier.rb +3 -3
  30. data/lib/familia/features/quantization.rb +5 -0
  31. data/lib/familia/features/safe_dump.rb +7 -0
  32. data/lib/familia/features.rb +20 -16
  33. data/lib/familia/field_type.rb +2 -0
  34. data/lib/familia/horreum/core/serialization.rb +3 -3
  35. data/lib/familia/horreum/subclass/definition.rb +3 -4
  36. data/lib/familia/horreum.rb +2 -0
  37. data/lib/familia/json_serializer.rb +70 -0
  38. data/lib/familia/logging.rb +12 -10
  39. data/lib/familia/refinements/logger_trace.rb +57 -0
  40. data/lib/familia/refinements/snake_case.rb +40 -0
  41. data/lib/familia/refinements/time_literals.rb +279 -0
  42. data/lib/familia/refinements.rb +3 -49
  43. data/lib/familia/utils.rb +2 -0
  44. data/lib/familia/validation/{test_helpers.rb → validation_helpers.rb} +2 -2
  45. data/lib/familia/validation.rb +1 -1
  46. data/lib/familia/version.rb +1 -1
  47. data/lib/familia.rb +15 -3
  48. data/try/core/autoloader_try.rb +112 -0
  49. data/try/core/extensions_try.rb +38 -21
  50. data/try/core/familia_extended_try.rb +4 -3
  51. data/try/core/time_utils_try.rb +130 -0
  52. data/try/data_types/datatype_base_try.rb +3 -2
  53. data/try/features/autoloadable/autoloadable_try.rb +61 -0
  54. data/try/features/encrypted_fields/concealed_string_core_try.rb +8 -3
  55. data/try/features/encrypted_fields/secure_by_default_behavior_try.rb +59 -17
  56. data/try/features/encrypted_fields/universal_serialization_safety_try.rb +36 -12
  57. data/try/features/external_identifier/external_identifier_try.rb +26 -0
  58. data/try/features/feature_improvements_try.rb +2 -1
  59. data/try/features/real_feature_integration_try.rb +1 -1
  60. data/try/features/safe_dump/safe_dump_autoloading_try.rb +111 -0
  61. data/try/helpers/test_helpers.rb +24 -0
  62. data/try/integration/cross_component_try.rb +3 -1
  63. metadata +34 -6
  64. data/CHANGELOG.md +0 -247
  65. data/lib/familia/core_ext.rb +0 -135
  66. data/lib/familia/features/autoloader.rb +0 -57
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 003a28f3135f0e89f6813e61cf08482350dbff865d2d97971998c714aafcc898
4
- data.tar.gz: 6c713c9861043c71d7b2cfc99a37c4522e404ed7461d8dafed5462022735440b
3
+ metadata.gz: 21e0d1d581a958fbf3492579039d9190764a83fb4add2a47fe3eb23d2d27ef2b
4
+ data.tar.gz: 9cda237209e910633ddcb9a7605cecb291eb66825de05aacd3bc6522168d220b
5
5
  SHA512:
6
- metadata.gz: b0e4cb9f390ee0a3e1d83cc94a2248690fe757ce343665ef6e4ea6dbd2c74f8f7d07e352661380f0aac23e91f437315300a409847d28896b58b4ddf567d5e953
7
- data.tar.gz: 2ec7616c6b2d64d522d441447ac93e58fe89f35eccd357bfdfc65305fc4324122148e5a3722c4bfd613d1f194fac1e5c0228d72b3774aa0e86e09bcdfe8b90fb
6
+ metadata.gz: 65cda30c3f3f96c0315c03f200dff37b507474d9a6367c6ce03b899450fd041403263ce6a5bfdb318bc90120c59234190e07548e576a522f92bcb4718dba6a55
7
+ data.tar.gz: 7a14a093a0fd83bce0e1fd08be41b98c4c418352d1d4210937cc3473f29264e1bf3dae2b671dee18c89b75faeb3a8e38b93ebf55632bba696da8653eb91b4eb3
data/.rubocop_todo.yml CHANGED
@@ -64,14 +64,13 @@ Naming/BlockForwarding:
64
64
  - "lib/familia/data_type/types/list.rb"
65
65
  - "lib/familia/data_type/types/sorted_set.rb"
66
66
  - "lib/familia/data_type/types/unsorted_set.rb"
67
- - "lib/familia/refinements.rb"
67
+ - "lib/familia/refinements/logger_trace.rb"
68
68
 
69
69
  # Offense count: 8
70
70
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
71
71
  # AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
72
72
  Naming/MethodParameterName:
73
73
  Exclude:
74
- - "lib/familia/core_ext.rb"
75
74
  - "lib/familia/horreum/class_methods.rb"
76
75
  - "lib/familia/data_type/types/sorted_set.rb"
77
76
  - "lib/familia/data_type/types/unsorted_set.rb"
@@ -107,7 +106,7 @@ Style/ArgumentsForwarding:
107
106
  - "lib/familia/data_type/types/list.rb"
108
107
  - "lib/familia/data_type/types/sorted_set.rb"
109
108
  - "lib/familia/data_type/types/unsorted_set.rb"
110
- - "lib/familia/refinements.rb"
109
+ - "lib/familia/refinements/logger_trace.rb"
111
110
 
112
111
  # Offense count: 11
113
112
  # Configuration parameters: AllowedConstants.
data/CHANGELOG.rst ADDED
@@ -0,0 +1,529 @@
1
+ CHANGELOG.rst
2
+ =============
3
+
4
+ All notable changes to Familia are documented here.
5
+
6
+ The format is based on `Keep a
7
+ Changelog <https://keepachangelog.com/en/1.1.0/>`__, and this project
8
+ adheres to `Semantic
9
+ Versioning <https://semver.org/spec/v2.0.0.html>`__.
10
+
11
+ .. raw:: html
12
+
13
+ <!--scriv-insert-here-->
14
+
15
+ .. _changelog-2.0.0.pre14:
16
+
17
+ 2.0.0.pre14 — 2025-09-08
18
+ ========================
19
+
20
+ Changed
21
+ -------
22
+
23
+ - **BREAKING CHANGE**: Renamed ``Familia::Refinements::TimeUtils`` to ``Familia::Refinements::TimeLiterals`` to better reflect the module's primary purpose of enabling numeric and string values to be treated as time unit literals (e.g., ``5.minutes``, ``"30m".in_seconds``). Functionality remains the same - only the module name has changed. Users must update their refinement usage from ``using Familia::Refinements::TimeUtils`` to ``using Familia::Refinements::TimeLiterals``.
24
+
25
+ Fixed
26
+ -----
27
+
28
+ - Fixed ExternalIdentifier HashKey method calls by replacing incorrect ``.del()`` calls with ``.remove_field()`` in three critical locations: extid setter (cleanup old mapping when changing value), find_by_extid (cleanup orphaned mapping when object not found), and destroy! (cleanup mapping when object is destroyed). Added comprehensive test coverage for all scenarios to prevent regression. PR #100
29
+
30
+ AI Assistance
31
+ -------------
32
+
33
+ - Claude Code helped rename TimeUtils to TimeLiterals throughout the codebase, including module name, file path, all usage references, and updating existing documentation.
34
+ - Gemini 2.5 Flash wrote the inline docs for TimeLiterals based on a discussion re: naming rationale.
35
+ - Claude Code fixed the ExternalIdentifier HashKey method bug, replacing incorrect ``.del()`` calls with proper ``.remove_field()`` calls, and implemented test coverage for the affected scenarios.
36
+
37
+ .. _changelog-2.0.0.pre13:
38
+
39
+ 2.0.0.pre13 — 2025-09-07
40
+ ========================
41
+
42
+ Added
43
+ -----
44
+
45
+ - **Feature Autoloading System**: Features can now automatically discover and load extension files from your project directories. When you include a feature like ``safe_dump``, Familia searches for configuration files using conventional patterns like ``{model_name}/{feature_name}_*.rb``, enabling clean separation between core model definitions and feature-specific configurations. See ``docs/migrating/v2.0.0-pre13.md`` for migration details.
46
+
47
+ - **Consolidated autoloader architecture**: Introduced ``Familia::Autoloader`` as a shared utility for consistent file loading patterns across the framework, supporting both general-purpose and feature-specific autoloading scenarios.
48
+
49
+ - Added ``PER_MONTH`` constant (2,629,746 seconds = 30.437 days) derived from Gregorian year for consistent month calculations.
50
+ - Added ``months``, ``month``, and ``in_months`` conversion methods to Numeric refinement.
51
+ - Added month unit mappings (``'mo'``, ``'month'``, ``'months'``) to TimeLiterals ``UNIT_METHODS`` hash.
52
+
53
+ - **Error Handling**: Added ``NotSupportedError`` for invalid serialization mode combinations in encryption subsystem. PR #97
54
+
55
+ Changed
56
+ -------
57
+
58
+ - Refactored time and numeric extensions from global monkey patches to proper Ruby refinements for better encapsulation and reduced global namespace pollution
59
+ - Updated all internal classes to use refinements via ``using Familia::Refinements::TimeLiterals`` statements
60
+ - Added centralized ``RefinedContext`` module in test helpers to support refinement testing in tryouts files
61
+
62
+ - Updated ``PER_YEAR`` constant to use Gregorian year (31,556,952 seconds = 365.2425 days) for calendar consistency.
63
+
64
+ - **Performance**: Replaced stdlib JSON with OJ gem for 2-5x faster JSON operations and reduced memory allocation. All existing code remains compatible through mimic_JSON mode. PR #97
65
+
66
+ - **Encryption**: Enhanced serialization safety for encrypted fields with improved ConcealedString handling across different JSON processing modes. Strengthened protection against accidental data exposure during serialization. PR #97
67
+
68
+ Fixed
69
+ -----
70
+
71
+ - Fixed byte conversion logic in ``to_bytes`` method to correctly handle exact 1024-byte boundaries (``size >= 1024`` instead of ``size > 1024``)
72
+ - Resolved refinement testing issues in tryouts by implementing ``eval``-based code execution within refined contexts
73
+
74
+ - Fixed TimeLiterals refinement ``months_old`` and ``years_old`` methods returning incorrect values (raw seconds instead of months/years). The underlying ``age_in`` method now properly handles ``:months`` and ``:years`` units. Issue #94.
75
+ - Fixed calendar consistency issue where ``12.months != 1.year`` by updating ``PER_YEAR`` to use Gregorian year (365.2425 days) and defining ``PER_MONTH`` as ``PER_YEAR / 12``.
76
+
77
+ Security
78
+ --------
79
+
80
+ - **Encryption**: Improved concealed value protection during JSON serialization, ensuring encrypted data remains properly protected across all OJ serialization modes. PR #97
81
+
82
+ Documentation
83
+ -------------
84
+
85
+ - **Feature System Autoloading Guide**: Added comprehensive guide at ``docs/guides/Feature-System-Autoloading.md`` explaining the new autoloading system, including file naming conventions, directory patterns, and usage examples.
86
+ - **Enhanced API documentation**: Added detailed YARD documentation for autoloading modules and methods.
87
+
88
+ AI Assistance
89
+ -------------
90
+
91
+ - Provided comprehensive analysis of Ruby refinement scoping issues and designed the eval-based testing solution
92
+ - Assisted with refactoring global extensions to proper refinements while maintaining backward compatibility
93
+ - Helped debug and fix the byte conversion boundary condition bug
94
+
95
+ - Significant AI assistance in architectural design and implementation of the feature-specific autoloading system, including pattern matching logic, Ruby introspection methods, and comprehensive debugging of edge cases and thread safety considerations.
96
+
97
+ - Claude Code assisted with implementing the fix for broken ``months_old`` and ``years_old`` methods in the TimeLiterals refinement, including analysis, implementation, testing, and documentation.
98
+
99
+ - Performance optimization research and OJ gem integration strategy, including compatibility analysis and testing approach for seamless stdlib JSON replacement. PR #97
100
+
101
+ 2.0.0.pre12 — 2025-09-04
102
+ ========================
103
+
104
+ Added
105
+ ~~~~~
106
+
107
+ - Added the ``Familia::VerifiableIdentifier`` module to create and
108
+ verify identifiers with an embedded HMAC signature. This allows an
109
+ application to stateless-ly confirm that an identifier was generated
110
+ by itself, preventing forged IDs from malicious sources.
111
+
112
+ - **Scoped VerifiableIdentifier**: Added ``scope`` parameter to
113
+ ``generate_verifiable_id()`` and ``verified_identifier?()`` methods,
114
+ enabling cryptographically isolated identifier namespaces for
115
+ multi-tenant, multi-domain, or multi-environment applications while
116
+ maintaining full backward compatibility with existing code.
117
+
118
+ Changed
119
+ ~~~~~~~
120
+
121
+ - ObjectIdentifier feature now tracks which generator (uuid_v7,
122
+ uuid_v4, hex, or custom) was used for each objid to provide
123
+ provenance information for security-sensitive operations.
124
+
125
+ - Updated external identifier derivation to normalize objid format
126
+ based on the known generator type, eliminating format ambiguity
127
+ between UUID and hex formats.
128
+
129
+ - Refactored identifier generation methods for clarity and consistency.
130
+ Method ``generate_objid`` is now ``generate_object_identifier``, and
131
+ ``generate_external_identifier`` is now
132
+ ``derive_external_identifier`` to reflect its deterministic nature.
133
+
134
+ Removed
135
+ ~~~~~~~
136
+
137
+ - Removed the ``generate_extid`` class method, which was less secure
138
+ than the instance-level derivation logic.
139
+
140
+ Security
141
+ ~~~~~~~~
142
+
143
+ - Hardened external identifier derivation with provenance validation.
144
+ ExternalIdentifier now validates that objid values come from the
145
+ ObjectIdentifier feature before deriving external identifiers,
146
+ preventing derivation from potentially malicious or unvalidated objid
147
+ values while maintaining deterministic behavior for legitimate use
148
+ cases.
149
+
150
+ - Improved the security of external identifiers (``extid``) by using
151
+ the internal object identifier (``objid``) as a seed for a new random
152
+ value, rather than deriving the ``extid`` directly. This prevents
153
+ potential information leakage from the internal ``objid``.
154
+
155
+ Documentation
156
+ ~~~~~~~~~~~~~
157
+
158
+ - Added detailed YARD documentation for ``VerifiableIdentifier``,
159
+ explaining how to securely generate and manage the required
160
+ ``VERIFIABLE_ID_HMAC_SECRET`` key.
161
+
162
+ AI Assistance
163
+ ~~~~~~~~~~~~~
164
+
165
+ - Security analysis of external identifier derivation and hardened
166
+ design approach was discussed and developed with AI assistance,
167
+ including provenance tracking, validation logic, format
168
+ normalization, and comprehensive test updates.
169
+
170
+ - Implementation of scoped verifiable identifiers was developed with AI
171
+ assistance to ensure cryptographic security properties and
172
+ comprehensive test coverage.
173
+
174
+ 2.0.0.pre11 - 2025-09-03
175
+ ======================
176
+
177
+ .. _added-1:
178
+
179
+ Added
180
+ ~~~~~
181
+
182
+ - **Enhanced Feature System**: Introduced a hierarchical feature system
183
+ with ancestry chain traversal for model-specific feature
184
+ registration. This enables better organization, standardized naming,
185
+ and automatic loading of project-specific features via the new
186
+ ``Familia::Autoloader`` module.
187
+ - **Improved SafeDump DSL**: Replaced the internal
188
+ ``@safe_dump_fields`` implementation with a cleaner, more robust DSL
189
+ using ``safe_dump_field`` and ``safe_dump_fields`` methods.
190
+ - Added ``generate_short_id`` and ``shorten_securely`` utility methods
191
+ for creating short, secure identifiers, adapted from
192
+ ``OT::Utils::SecureNumbers``.
193
+ - For a detailed guide on migrating to the new feature system, see
194
+ ``docs/migration/v2.0.0-pre11.md``.
195
+
196
+ .. _changed-1:
197
+
198
+ Changed
199
+ ~~~~~~~
200
+
201
+ - External identifier now raises an ``ExternalIdentifierError`` if the
202
+ model does not have an objid field. Previously: returned nil. In
203
+ practice this should never happen, since the external_identifier
204
+ feature declares its dependency on object_identifier.
205
+ - Moved lib/familia/encryption_request_cache.rb to
206
+ lib/familia/encryption/request_cache.rb for consistency.
207
+ - **Simplified ObjectIdentifier Feature Implementation**: Consolidated
208
+ the ObjectIdentifier feature from two files (~190 lines) to a single
209
+ file (~140 lines) by moving the ObjectIdentifierFieldType class
210
+ inline. This reduces complexity while maintaining all existing
211
+ functionality including lazy generation, data integrity preservation,
212
+ and multiple generator strategies.
213
+ - **Renamed Identifier Features to Singular Form**: Renamed
214
+ ``object_identifier`` → ``object_identifier`` and
215
+ ``external_identifier`` → ``external_identifier`` for more accurate
216
+ naming. Added full-length aliases
217
+ (``object_identifier``/``external_identifier``) alongside the short
218
+ forms (``objid``/``extid``) for clarity when needed.
219
+ - **Simplified ExternalIdentifier Feature Implementation**:
220
+ Consolidated the ExternalIdentifier feature from two files (~240
221
+ lines) to a single file (~120 lines) by moving the
222
+ ExternalIdentifierFieldType class inline, following the same pattern
223
+ as ObjectIdentifier.
224
+
225
+ Fixed
226
+ ~~~~~
227
+
228
+ - Fixed external identifier generation returning all zeros for
229
+ UUID-based objids. The ``shorten_to_external_id`` method now
230
+ correctly handles both 256-bit secure identifiers and 128-bit UUIDs
231
+ by detecting input length and applying appropriate bit truncation
232
+ only when needed.
233
+
234
+ .. _security-1:
235
+
236
+ Security
237
+ ~~~~~~~~
238
+
239
+ - Improved input validation in ``shorten_to_external_id`` method by
240
+ replacing insecure character count checking with proper bit length
241
+ calculation and explicit validation. Invalid inputs now raise clear
242
+ error messages instead of being silently processed incorrectly.
243
+
244
+ 2.0.0-pre10 - 2025-09-02
245
+ ======================
246
+
247
+ .. _added-2:
248
+
249
+ Added
250
+ ~~~~~
251
+
252
+ - The ``Familia::Horreum`` initializer now supports creating an object
253
+ directly from its identifier by passing a single argument (e.g.,
254
+ ``Customer.new(customer_id)``). This provides a more convenient and
255
+ intuitive way to instantiate objects from lookups.
256
+
257
+ - Automatic indexing and class-level tracking on ``save()`` operations,
258
+ eliminating the need for manual index updates.
259
+
260
+ - Enhanced collection syntax supports the Ruby-idiomatic ``<<``
261
+ operator for more natural relationship management.
262
+
263
+ .. _changed-2:
264
+
265
+ Changed
266
+ ~~~~~~~
267
+
268
+ - The ``member_of`` relationship is now bidirectional. A single call to
269
+ ``member.add_to_owner_collection(owner)`` is sufficient to establish
270
+ the relationship, removing the need for a second, redundant call on
271
+ the owner object. This fixes bugs where members could be added to
272
+ collections twice.
273
+
274
+ - **BREAKING**: Refactored Familia Relationships API to remove “global”
275
+ terminology and simplify method generation. (Closes #86)
276
+
277
+ - Split ``generate_indexing_instance_methods`` into focused
278
+ ``generate_direct_index_methods`` and
279
+ ``generate_relationship_index_methods`` for better separation between
280
+ direct class-level and relationship-based indexing.
281
+
282
+ - Simplified method generation by removing complex global vs parent
283
+ conditionals.
284
+
285
+ - All indexes are now stored at the class level for consistency.
286
+
287
+ .. _fixed-1:
288
+
289
+ Fixed
290
+ ~~~~~
291
+
292
+ - Fixed a bug in the ``class_indexed_by`` feature where finder methods
293
+ (e.g., ``find_by_email``) would fail to correctly instantiate objects
294
+ from the index, returning partially-formed objects.
295
+
296
+ - Refactored connection handling to properly cache and reuse Redis
297
+ connections. This eliminates repetitive “Overriding existing
298
+ connection” warnings and improves performance.
299
+
300
+ - Method generation now works consistently for both
301
+ ``class_indexed_by`` and ``indexed_by`` with a ``parent:``.
302
+
303
+ - Resolved metadata storage issues for dynamically created classes.
304
+
305
+ - Improved error handling for nil class names in tracking
306
+ relationships.
307
+
308
+ .. _documentation-1:
309
+
310
+ Documentation
311
+ ~~~~~~~~~~~~~
312
+
313
+ - Updated the ``examples/relationships_basic.rb`` script to reflect the
314
+ improved, bidirectional ``member_of`` API and to ensure a clean
315
+ database state for each run.
316
+
317
+ .. _ai-assistance-1:
318
+
319
+ AI Assistance
320
+ ~~~~~~~~~~~~~
321
+
322
+ - This refactoring was implemented with Claude Code assistance,
323
+ including comprehensive test updates and API modernization.
324
+
325
+ 2.0.0-pre9 - 2025-09-02
326
+ ======================
327
+
328
+ .. _added-3:
329
+
330
+ Added
331
+ ~~~~~
332
+
333
+ - Added ``class_tracked_in`` method for global tracking relationships
334
+ following Horreum’s established ``class_`` prefix convention
335
+ - Added ``class_indexed_by`` method for global index relationships with
336
+ consistent API design
337
+
338
+ .. _changed-3:
339
+
340
+ Changed
341
+ ~~~~~~~
342
+
343
+ - **BREAKING**: ``tracked_in :global, collection`` syntax now raises
344
+ ArgumentError - use ``class_tracked_in collection`` instead
345
+ - **BREAKING**: ``indexed_by field, index, context: :global`` syntax
346
+ replaced with ``class_indexed_by field, index``
347
+ - **BREAKING**: ``indexed_by field, index, context: SomeClass`` syntax
348
+ replaced with ``indexed_by field, index, parent: SomeClass``
349
+ - Relationships API now provides consistent parameter naming across all
350
+ relationship types
351
+
352
+ .. _documentation-2:
353
+
354
+ Documentation
355
+ ~~~~~~~~~~~~~
356
+
357
+ - Updated Relationships Guide with new API syntax and migration
358
+ examples
359
+ - Updated relationships method documentation with new method signatures
360
+ - Updated basic relationships example to demonstrate new API patterns
361
+ - Added tryouts test coverage in
362
+ try/features/relationships/relationships_api_changes_try.rb
363
+
364
+ 2.0.0-pre8 - 2025-09-01
365
+ ======================
366
+
367
+ .. _added-4:
368
+
369
+ Added
370
+ ~~~~~
371
+
372
+ - Implemented Scriv-based changelog system for sustainable
373
+ documentation
374
+ - Added fragment-based workflow for tracking changes
375
+ - Created structured changelog templates and configuration
376
+
377
+ .. _documentation-3:
378
+
379
+ Documentation
380
+ ~~~~~~~~~~~~~
381
+
382
+ - Set up Scriv configuration and directory structure
383
+ - Created README for changelog fragment workflow
384
+
385
+ .. raw:: html
386
+
387
+ <!-- scriv-end-here -->
388
+
389
+ 2.0.0-pre7 - 2025-08-31
390
+ ======================
391
+
392
+ .. _added-5:
393
+
394
+ Added
395
+ ~~~~~
396
+
397
+ - Comprehensive relationships system with three relationship types:
398
+
399
+ - ``tracked_in`` - Multi-presence tracking with score encoding
400
+ - ``indexed_by`` - O(1) hash-based lookups
401
+ - ``member_of`` - Bidirectional membership with collision-free
402
+ naming
403
+
404
+ - Categorical permission system with bit-encoded permissions
405
+ - Time-based permission scoring for temporal access control
406
+ - Permission tier hierarchies with inheritance patterns
407
+ - Scalable permission management for large object collections
408
+ - Score-based sorting with custom scoring functions
409
+ - Permission-aware queries filtering by access levels
410
+ - Relationship validation framework ensuring data integrity
411
+
412
+ .. _changed-4:
413
+
414
+ Changed
415
+ ~~~~~~~
416
+
417
+ - Performance optimizations for large-scale relationship operations
418
+
419
+ .. _security-2:
420
+
421
+ Security
422
+ ~~~~~~~~
423
+
424
+ - GitHub Actions security hardening with matrix optimization
425
+
426
+ 2.0.0-pre6 - 2025-08-15
427
+ ======================
428
+
429
+ .. _added-6:
430
+
431
+ Added
432
+ ~~~~~
433
+
434
+ - New ``save_if_not_exists`` method for conditional persistence
435
+ - Atomic persistence operations with transaction support
436
+ - Enhanced error handling for persistence failures
437
+ - Improved data consistency guarantees
438
+
439
+ .. _changed-5:
440
+
441
+ Changed
442
+ ~~~~~~~
443
+
444
+ - Connection provider pattern for flexible pooling strategies
445
+ - Multi-database support with intelligent pool management
446
+ - Thread-safe connection handling for concurrent applications
447
+ - Configurable pool sizing and timeout management
448
+ - Modular class structure with cleaner separation of concerns
449
+ - Enhanced feature system with dependency management
450
+ - Improved inheritance patterns for better code organization
451
+ - Streamlined base class functionality
452
+
453
+ .. _fixed-2:
454
+
455
+ Fixed
456
+ ~~~~~
457
+
458
+ - Critical security fixes in Ruby workflow vulnerabilities
459
+ - Systematic dependency resolution via multi-constraint optimization
460
+
461
+ 2.0.0-pre5 - 2025-08-05
462
+ ======================
463
+
464
+ .. _added-7:
465
+
466
+ Added
467
+ ~~~~~
468
+
469
+ - Field-level encryption with transparent access patterns
470
+ - Multiple encryption providers:
471
+
472
+ - XChaCha20-Poly1305 (preferred, requires rbnacl)
473
+ - AES-256-GCM (fallback, OpenSSL-based)
474
+
475
+ - Field-specific key derivation for cryptographic domain separation
476
+ - Configurable key versioning supporting key rotation
477
+ - Non-persistent field storage for sensitive runtime data
478
+ - RedactedString wrapper preventing accidental logging/serialization
479
+ - Memory-safe handling of sensitive data in Ruby objects
480
+ - API-safe serialization excluding transient fields
481
+
482
+ .. _security-3:
483
+
484
+ Security
485
+ ~~~~~~~~
486
+
487
+ - Encryption field security hardening with additional validation
488
+ - Enhanced memory protection for sensitive data handling
489
+ - Improved key management patterns and best practices
490
+ - Security test suite expansion with comprehensive coverage
491
+
492
+ 2.0.0-pre - 2025-07-25
493
+ ======================
494
+
495
+ .. _added-8:
496
+
497
+ Added
498
+ ~~~~~
499
+
500
+ - Complete API redesign for clarity and modern Ruby conventions
501
+ - Valkey compatibility alongside traditional Redis support
502
+ - Ruby 3.4+ modernization with fiber and thread safety improvements
503
+ - Connection pooling foundation with provider pattern architecture
504
+
505
+ .. _changed-6:
506
+
507
+ Changed
508
+ ~~~~~~~
509
+
510
+ - ``Familia::Base`` replaced by ``Familia::Horreum`` as the primary
511
+ base class
512
+ - Connection configuration moved from simple string to block-based
513
+ setup
514
+ - Feature activation changed from ``include`` to ``feature``
515
+ declarations
516
+ - Method naming updated for consistency (``delete`` → ``destroy``,
517
+ ``exists`` → ``exists?``, ``dump`` → ``serialize``)
518
+
519
+ .. _documentation-4:
520
+
521
+ Documentation
522
+ ~~~~~~~~~~~~~
523
+
524
+ - YARD documentation workflow with automated GitHub Pages deployment
525
+ - Comprehensive migrating guide for v1.x to v2.0.0-pre transition
526
+
527
+ .. raw:: html
528
+
529
+ <!-- scriv-end-here -->
data/CLAUDE.md CHANGED
@@ -47,7 +47,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
47
47
 
48
48
  ### Changelog Management
49
49
 
50
- Add changelog fragment with each user-facing or documented change (optional but encouraged). See:
50
+ Add changelog fragment with each user-facing or documented change (optional but encouraged). Fragments use RST format. See:
51
51
  @changelog.d/README.md
52
52
 
53
53
  ### Known Issues & Quirks
data/Gemfile CHANGED
@@ -5,12 +5,7 @@ source 'https://rubygems.org'
5
5
  gemspec
6
6
 
7
7
  group :test do
8
- if ENV['LOCAL_DEV']
9
- gem 'tryouts', path: '../tryouts'
10
- gem 'uri-valkey', path: '..//uri-valkey/gems', glob: 'uri-valkey.gemspec'
11
- else
12
- gem 'tryouts', '~> 3.5.2', require: false
13
- end
8
+ gem 'tryouts', '~> 3.6.0', require: false
14
9
  gem 'concurrent-ruby', '~> 1.3.5', require: false
15
10
  gem 'ruby-prof'
16
11
  gem 'stackprof'
data/Gemfile.lock CHANGED
@@ -1,11 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- familia (2.0.0.pre12)
5
- benchmark
6
- connection_pool
7
- csv
8
- logger
4
+ familia (2.0.0.pre14)
5
+ benchmark (~> 0.4)
6
+ connection_pool (~> 2.5)
7
+ csv (~> 3.3)
8
+ logger (~> 1.7)
9
+ oj (~> 3.16)
9
10
  redis (>= 4.8.1, < 6.0)
10
11
  stringio (~> 3.1.1)
11
12
  uri-valkey (~> 1.4)
@@ -16,6 +17,7 @@ GEM
16
17
  ast (2.4.3)
17
18
  base64 (0.3.0)
18
19
  benchmark (0.4.1)
20
+ bigdecimal (3.2.3)
19
21
  byebug (11.1.3)
20
22
  coderay (1.1.3)
21
23
  concurrent-ruby (1.3.5)
@@ -39,6 +41,10 @@ GEM
39
41
  logger (1.7.0)
40
42
  method_source (1.1.0)
41
43
  minitest (5.25.5)
44
+ oj (3.16.11)
45
+ bigdecimal (>= 3.0)
46
+ ostruct (>= 0.2)
47
+ ostruct (0.6.3)
42
48
  parallel (1.27.0)
43
49
  parser (3.3.8.0)
44
50
  ast (~> 2.4.1)
@@ -113,7 +119,7 @@ GEM
113
119
  ruby-progressbar (1.13.0)
114
120
  stackprof (0.2.27)
115
121
  stringio (3.1.7)
116
- tryouts (3.5.2)
122
+ tryouts (3.6.0)
117
123
  concurrent-ruby (~> 1.0)
118
124
  irb
119
125
  minitest (~> 5.0)
@@ -148,7 +154,7 @@ DEPENDENCIES
148
154
  rubocop-thread_safety
149
155
  ruby-prof
150
156
  stackprof
151
- tryouts (~> 3.5.2)
157
+ tryouts (~> 3.6.0)
152
158
  yard (~> 0.9)
153
159
 
154
160
  BUNDLED WITH
data/README.md CHANGED
@@ -170,7 +170,26 @@ All relationships support automatic indexing and tracking - objects are automati
170
170
 
171
171
  ## Organizing Complex Models
172
172
 
173
- For large applications, you can organize model complexity using custom features:
173
+ For large applications, you can organize model complexity using custom features and the Feature Autoloading System:
174
+
175
+ ### Feature Autoloading System
176
+
177
+ Familia automatically discovers and loads feature-specific configuration files, enabling clean separation between core model definitions and feature configurations:
178
+
179
+ ```ruby
180
+ # app/models/user.rb - Clean model definition
181
+ class User < Familia::Horreum
182
+ field :name, :email, :password
183
+ feature :safe_dump # Configuration auto-loaded
184
+ end
185
+
186
+ # app/models/user/safe_dump_extensions.rb - Automatically discovered
187
+ class User
188
+ safe_dump_fields :name, :email # password excluded for security
189
+ end
190
+ ```
191
+
192
+ Extension files follow the pattern: `{model_name}/{feature_name}_*.rb`
174
193
 
175
194
  ### Self-Registering Features
176
195
 
@@ -201,7 +220,7 @@ class Customer < Familia::Horreum
201
220
  end
202
221
  ```
203
222
 
204
- This keeps complex models organized while maintaining Familia's clean, declarative style.
223
+ These approaches keep complex models organized while maintaining Familia's clean, declarative style. For detailed migration information, see the [migration guides](docs/migrating/).
205
224
 
206
225
  ## AI Development Assistance
207
226