familia 2.0.0.pre10 → 2.0.0.pre12

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 (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +75 -12
  3. data/CLAUDE.md +4 -54
  4. data/Gemfile.lock +1 -1
  5. data/changelog.d/README.md +45 -34
  6. data/docs/archive/FAMILIA_RELATIONSHIPS.md +1 -1
  7. data/docs/archive/FAMILIA_UPDATE.md +1 -1
  8. data/docs/archive/README.md +15 -19
  9. data/docs/guides/Home.md +1 -1
  10. data/docs/guides/Implementation-Guide.md +1 -1
  11. data/docs/guides/relationships-methods.md +1 -1
  12. data/docs/migrating/.gitignore +2 -0
  13. data/docs/migrating/v2.0.0-pre.md +84 -0
  14. data/docs/migrating/v2.0.0-pre11.md +255 -0
  15. data/docs/migrating/v2.0.0-pre12.md +306 -0
  16. data/docs/migrating/v2.0.0-pre5.md +110 -0
  17. data/docs/migrating/v2.0.0-pre6.md +154 -0
  18. data/docs/migrating/v2.0.0-pre7.md +222 -0
  19. data/docs/overview.md +6 -7
  20. data/{examples/redis_command_validation_example.rb → docs/reference/auditing_database_commands.rb} +29 -32
  21. data/examples/{bit_encoding_integration.rb → permissions.rb} +30 -27
  22. data/examples/{relationships_basic.rb → relationships.rb} +2 -3
  23. data/examples/safe_dump.rb +281 -0
  24. data/familia.gemspec +4 -4
  25. data/lib/familia/base.rb +52 -0
  26. data/lib/familia/{encryption_request_cache.rb → encryption/request_cache.rb} +1 -1
  27. data/lib/familia/errors.rb +2 -0
  28. data/lib/familia/features/autoloader.rb +57 -0
  29. data/lib/familia/features/external_identifier.rb +310 -0
  30. data/lib/familia/features/object_identifier.rb +307 -0
  31. data/lib/familia/features/safe_dump.rb +66 -72
  32. data/lib/familia/features.rb +93 -5
  33. data/lib/familia/horreum/subclass/definition.rb +47 -3
  34. data/lib/familia/secure_identifier.rb +51 -75
  35. data/lib/familia/verifiable_identifier.rb +162 -0
  36. data/lib/familia/version.rb +1 -1
  37. data/lib/familia.rb +1 -0
  38. data/setup.cfg +1 -8
  39. data/try/core/secure_identifier_try.rb +47 -18
  40. data/try/core/verifiable_identifier_try.rb +171 -0
  41. data/try/features/{external_identifiers/external_identifiers_try.rb → external_identifier/external_identifier_try.rb} +25 -28
  42. data/try/features/feature_improvements_try.rb +126 -0
  43. data/try/features/{object_identifiers/object_identifiers_integration_try.rb → object_identifier/object_identifier_integration_try.rb} +28 -30
  44. data/try/features/{object_identifiers/object_identifiers_try.rb → object_identifier/object_identifier_try.rb} +13 -13
  45. data/try/features/real_feature_integration_try.rb +7 -6
  46. data/try/features/safe_dump/safe_dump_try.rb +8 -9
  47. data/try/helpers/test_helpers.rb +17 -17
  48. metadata +30 -22
  49. data/changelog.d/fragments/.keep +0 -0
  50. data/changelog.d/template.md.j2 +0 -29
  51. data/lib/familia/features/external_identifiers/external_identifier_field_type.rb +0 -120
  52. data/lib/familia/features/external_identifiers.rb +0 -111
  53. data/lib/familia/features/object_identifiers/object_identifier_field_type.rb +0 -91
  54. data/lib/familia/features/object_identifiers.rb +0 -194
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f09bb44b39f033bc38faaff02dd33c645ecd6a98bee533a756707daeb47e00c
4
- data.tar.gz: 77afd574073258009058ed9f638151b1ca26ba65d06b49f841ad46b52e50a82a
3
+ metadata.gz: 003a28f3135f0e89f6813e61cf08482350dbff865d2d97971998c714aafcc898
4
+ data.tar.gz: 6c713c9861043c71d7b2cfc99a37c4522e404ed7461d8dafed5462022735440b
5
5
  SHA512:
6
- metadata.gz: c9bf8c181236218f04e7fff9902b63521d316265792a416525ee5da671789ddd636c372d0481b926b9b65b3116680bac698ebef6d37fd3d0117c9235053b98aa
7
- data.tar.gz: d046f73ca2f6d46833e4bdb0f2a59c6c400b807f5e44f92657a470bd50c09ffae56debfd991f6513898a603ce44e761047d1e4449f8526d3d2a5ac333ebb8e72
6
+ metadata.gz: b0e4cb9f390ee0a3e1d83cc94a2248690fe757ce343665ef6e4ea6dbd2c74f8f7d07e352661380f0aac23e91f437315300a409847d28896b58b4ddf567d5e953
7
+ data.tar.gz: 2ec7616c6b2d64d522d441447ac93e58fe89f35eccd357bfdfc65305fc4324122148e5a3722c4bfd613d1f194fac1e5c0228d72b3774aa0e86e09bcdfe8b90fb
data/CHANGELOG.md CHANGED
@@ -7,8 +7,70 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  <!--scriv-insert-here-->
9
9
 
10
+ <a id='changelog-2.0.0.pre12'></a>
11
+ ## 2.0.0.pre12 — 2025-09-04
12
+
13
+ ### Added
14
+
15
+ - Added the `Familia::VerifiableIdentifier` module to create and verify identifiers with an embedded HMAC signature. This allows an application to stateless-ly confirm that an identifier was generated by itself, preventing forged IDs from malicious sources.
16
+
17
+ - **Scoped VerifiableIdentifier**: Added `scope` parameter to `generate_verifiable_id()` and `verified_identifier?()` methods, enabling cryptographically isolated identifier namespaces for multi-tenant, multi-domain, or multi-environment applications while maintaining full backward compatibility with existing code.
18
+
19
+ ### Changed
20
+
21
+ - ObjectIdentifier feature now tracks which generator (uuid_v7, uuid_v4, hex, or custom) was used for each objid to provide provenance information for security-sensitive operations.
22
+ - Updated external identifier derivation to normalize objid format based on the known generator type, eliminating format ambiguity between UUID and hex formats.
23
+
24
+ - Refactored identifier generation methods for clarity and consistency. Method `generate_objid` is now `generate_object_identifier`, and `generate_external_identifier` is now `derive_external_identifier` to reflect its deterministic nature.
25
+
26
+ ### Removed
27
+
28
+ - Removed the `generate_extid` class method, which was less secure than the instance-level derivation logic.
29
+
30
+ ### Security
31
+
32
+ - Hardened external identifier derivation with provenance validation. ExternalIdentifier now validates that objid values come from the ObjectIdentifier feature before deriving external identifiers, preventing derivation from potentially malicious or unvalidated objid values while maintaining deterministic behavior for legitimate use cases.
33
+
34
+ - Improved the security of external identifiers (`extid`) by using the internal object identifier (`objid`) as a seed for a new random value, rather than deriving the `extid` directly. This prevents potential information leakage from the internal `objid`.
35
+
36
+ ### Documentation
37
+
38
+ - Added detailed YARD documentation for `VerifiableIdentifier`, explaining how to securely generate and manage the required `VERIFIABLE_ID_HMAC_SECRET` key.
39
+
40
+ ### AI Assistance
41
+
42
+ - Security analysis of external identifier derivation and hardened design approach was discussed and developed with AI assistance, including provenance tracking, validation logic, format normalization, and comprehensive test updates.
43
+
44
+ - Implementation of scoped verifiable identifiers was developed with AI assistance to ensure cryptographic security properties and comprehensive test coverage.
45
+
46
+ <a id='changelog-2.0.0.pre11'></a>
47
+ ## 2.0.0.pre11 - 2025-09-03
48
+
49
+ ### Added
50
+
51
+ - **Enhanced Feature System**: Introduced a hierarchical feature system with ancestry chain traversal for model-specific feature registration. This enables better organization, standardized naming, and automatic loading of project-specific features via the new `Familia::Features::Autoloader` module.
52
+ - **Improved SafeDump DSL**: Replaced the internal `@safe_dump_fields` implementation with a cleaner, more robust DSL using `safe_dump_field` and `safe_dump_fields` methods.
53
+ - Added `generate_short_id` and `shorten_securely` utility methods for creating short, secure identifiers, adapted from `OT::Utils::SecureNumbers`.
54
+ - For a detailed guide on migrating to the new feature system, see `docs/migration/v2.0.0-pre11.md`.
55
+
56
+ ### Changed
57
+
58
+ - External identifier now raises an `ExternalIdentifierError` if the model does not have an objid field. Previously: returned nil. In practice this should never happen, since the external_identifier feature declares its dependency on object_identifier.
59
+ - Moved lib/familia/encryption_request_cache.rb to lib/familia/encryption/request_cache.rb for consistency.
60
+ - **Simplified ObjectIdentifier Feature Implementation**: Consolidated the ObjectIdentifier feature from two files (~190 lines) to a single file (~140 lines) by moving the ObjectIdentifierFieldType class inline. This reduces complexity while maintaining all existing functionality including lazy generation, data integrity preservation, and multiple generator strategies.
61
+ - **Renamed Identifier Features to Singular Form**: Renamed `object_identifier` → `object_identifier` and `external_identifier` → `external_identifier` for more accurate naming. Added full-length aliases (`object_identifier`/`external_identifier`) alongside the short forms (`objid`/`extid`) for clarity when needed.
62
+ - **Simplified ExternalIdentifier Feature Implementation**: Consolidated the ExternalIdentifier feature from two files (~240 lines) to a single file (~120 lines) by moving the ExternalIdentifierFieldType class inline, following the same pattern as ObjectIdentifier.
63
+
64
+ ### Fixed
65
+
66
+ - Fixed external identifier generation returning all zeros for UUID-based objids. The `shorten_to_external_id` method now correctly handles both 256-bit secure identifiers and 128-bit UUIDs by detecting input length and applying appropriate bit truncation only when needed.
67
+
68
+ ### Security
69
+
70
+ - Improved input validation in `shorten_to_external_id` method by replacing insecure character count checking with proper bit length calculation and explicit validation. Invalid inputs now raise clear error messages instead of being silently processed incorrectly.
71
+
10
72
  <a id='changelog-2.0.0-pre10'></a>
11
- ## [2.0.0-pre10] - 2025-09-02 18:07:56.439890
73
+ ## 2.0.0-pre10 - 2025-09-02
12
74
 
13
75
  ### Added
14
76
 
@@ -45,21 +107,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
45
107
  - This refactoring was implemented with Claude Code assistance, including comprehensive test updates and API modernization.
46
108
 
47
109
  <a id='changelog-2.0.0-pre9'></a>
48
- # [2.0.0-pre9] - 2025-09-02 00:35:28.974817
110
+ ## 2.0.0-pre9 - 2025-09-02
49
111
 
50
- ## Added
112
+ ### Added
51
113
 
52
114
  - Added `class_tracked_in` method for global tracking relationships following Horreum's established `class_` prefix convention
53
115
  - Added `class_indexed_by` method for global index relationships with consistent API design
54
116
 
55
- ## Changed
117
+ ### Changed
56
118
 
57
119
  - **BREAKING**: `tracked_in :global, collection` syntax now raises ArgumentError - use `class_tracked_in collection` instead
58
120
  - **BREAKING**: `indexed_by field, index, context: :global` syntax replaced with `class_indexed_by field, index`
59
121
  - **BREAKING**: `indexed_by field, index, context: SomeClass` syntax replaced with `indexed_by field, index, parent: SomeClass`
60
122
  - Relationships API now provides consistent parameter naming across all relationship types
61
123
 
62
- ## Documentation
124
+ ### Documentation
63
125
 
64
126
  - Updated Relationships Guide with new API syntax and migration examples
65
127
  - Updated relationships method documentation with new method signatures
@@ -68,9 +130,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
68
130
 
69
131
 
70
132
  <a id='changelog-2.0.0-pre8'></a>
71
- ## [2.0.0-pre8] - 2025-09-01
133
+ ## 2.0.0-pre8 - 2025-09-01
72
134
 
73
- #### Added
135
+ ### Added
74
136
 
75
137
  - Implemented Scriv-based changelog system for sustainable documentation
76
138
  - Added fragment-based workflow for tracking changes
@@ -81,9 +143,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
81
143
  - Set up Scriv configuration and directory structure
82
144
  - Created README for changelog fragment workflow
83
145
 
146
+ <!-- scriv-end-here -->
84
147
 
85
148
  <a id='changelog-2.0.0-pre7'></a>
86
- ## [2.0.0-pre7] - 2025-08-31
149
+ ## 2.0.0-pre7 - 2025-08-31
87
150
 
88
151
  ### Added
89
152
 
@@ -109,7 +172,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
109
172
 
110
173
 
111
174
  <a id='changelog-2.0.0-pre6'></a>
112
- ## [2.0.0-pre6] - 2025-08-15
175
+ ## 2.0.0-pre6 - 2025-08-15
113
176
 
114
177
  ### Added
115
178
 
@@ -136,7 +199,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
136
199
 
137
200
 
138
201
  <a id='changelog-2.0.0-pre5'></a>
139
- ## [2.0.0-pre5] - 2025-08-05
202
+ ## 2.0.0-pre5 - 2025-08-05
140
203
 
141
204
  ### Added
142
205
 
@@ -160,7 +223,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
160
223
 
161
224
 
162
225
  <a id='changelog-2.0.0-pre'></a>
163
- ## [2.0.0-pre] - 2025-07-25
226
+ ## 2.0.0-pre - 2025-07-25
164
227
 
165
228
  ### Added
166
229
 
@@ -179,6 +242,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
179
242
  ### Documentation
180
243
 
181
244
  - YARD documentation workflow with automated GitHub Pages deployment
182
- - Comprehensive migration guide for v1.x to v2.0.0-pre transition
245
+ - Comprehensive migrating guide for v1.x to v2.0.0-pre transition
183
246
 
184
247
  <!-- scriv-end-here -->
data/CLAUDE.md CHANGED
@@ -32,9 +32,10 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
32
32
 
33
33
  **Debugging options:**
34
34
  - **Stack traces**: `bundle exec try -s` (stack traces without debug logging)
35
+ - **Verbose failures**: `bundle exec try -vfs` (detailed failure output)
35
36
  - **Debug mode**: `bundle exec try -D` (additional logging including stack traces)
36
- - **Verbose failures**: `bundle exec try -vf` (detailed failure output)
37
- - **Fresh context**: `bundle exec try --fresh-context` (isolate test cases)
37
+ - **Shared context**: `bundle exec try --shared-context` (DEFAULT - reuse shared context across setup, testcases, and teardown)
38
+ - **Fresh context**: `bundle exec try --no-shared-context` (isolate test cases, no shared variables)
38
39
 
39
40
  *Note: Use `--agent` mode for optimal token efficiency when analyzing test results programmatically.*
40
41
 
@@ -60,9 +61,6 @@ Add changelog fragment with each user-facing or documented change (optional but
60
61
  - Updates live as tests run or code executes
61
62
  - Essential for debugging Familia ORM Database interactions, multi/exec, pipelining, logical_database issues
62
63
 
63
- ### Testing Framework
64
- This project uses `tryouts` instead of RSpec/Minitest. Test files are located in the `try/` directory and follow the pattern `*_try.rb`.
65
-
66
64
  ## Architecture Overview
67
65
 
68
66
  ### Core Components
@@ -88,7 +86,7 @@ This project uses `tryouts` instead of RSpec/Minitest. Test files are located in
88
86
  Familia uses a modular feature system where features are mixed into classes:
89
87
  - **Expiration** (`lib/familia/features/expiration.rb`) - TTL management with cascading
90
88
  - **SafeDump** (`lib/familia/features/safe_dump.rb`) - API-safe object serialization
91
- - **Quantization** (`lib/familia/features/quantization.rb`) - Time-based data bucketing
89
+ - **Relationships** (`lib/familia/features/relationships.rb`) - CRUD operations for related objects
92
90
 
93
91
  #### Key Architectural Patterns
94
92
 
@@ -110,15 +108,6 @@ end
110
108
  - Proc: `identifier ->(user) { "user:#{user.email}" }`
111
109
  - Array: `identifier [:type, :email]`
112
110
 
113
- ### Directory Structure
114
-
115
- - `lib/familia.rb` - Main entry point and module definition
116
- - `lib/familia/horreum/` - Horreum class implementation (class_methods, commands, serialization, etc.)
117
- - `lib/familia/data_type/` - Valkey/Redis type implementations and commands
118
- - `lib/familia/features/` - Modular feature implementations
119
- - `try/` - Test files using tryouts framework
120
- - `try/test_helpers.rb` - Shared test utilities and sample classes
121
-
122
111
  ### Database Connection Management
123
112
  - Connection handling in `lib/familia/connection.rb`
124
113
  - Settings management in `lib/familia/settings.rb`
@@ -128,46 +117,7 @@ end
128
117
  ### Important Implementation Notes
129
118
 
130
119
  **Field Initialization**: Objects can be initialized with positional args (brittle) or keyword args (robust). Keyword args are recommended.
131
-
132
120
  **Serialization**: Uses JSON by default but supports custom `serialize_value`/`deserialize_value` methods.
133
-
134
121
  **Database Key Generation**: Automatic key generation using class name, identifier, and field/type names (aka dbkey). Pattern: `classname:identifier:fieldname`
135
-
136
122
  **Memory Efficiency**: Only non-nil values are stored in keystore database to optimize memory usage.
137
-
138
123
  **Thread Safety**: Data types are frozen after instantiation to ensure immutability.
139
-
140
- ## Common Patterns
141
-
142
- ### Defining a Horreum Class
143
- ```ruby
144
- class Customer < Familia::Horreum
145
- feature :safe_dump
146
- feature :expiration
147
-
148
- identifier_field :custid
149
- default_expiration 5.years
150
-
151
- field :custid
152
- field :email
153
- list :sessions
154
- hashkey :settings
155
- end
156
- ```
157
-
158
- ### Using Features
159
- ```ruby
160
- # Safe dump for API responses
161
- customer.safe_dump # Returns only whitelisted fields
162
-
163
- # Expiration management
164
- customer.update_expiration(default_expiration: 1.hour)
165
- ```
166
-
167
- ### Transaction Support
168
- ```ruby
169
- customer.transaction do |conn|
170
- conn.set("key1", "value1")
171
- conn.zadd("key2", score, member)
172
- end
173
- ```
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- familia (2.0.0.pre10)
4
+ familia (2.0.0.pre12)
5
5
  benchmark
6
6
  connection_pool
7
7
  csv
@@ -4,7 +4,7 @@ This directory contains changelog fragments managed by [Scriv](https://scriv.rea
4
4
 
5
5
  ## Our Approach
6
6
 
7
- Changelogs are for humans and agents, not just machines. We follow the core principles of [Keep a Changelog](https://keepachangelog.com) to ensure our release notes are clear, consistent, and trustworthy.
7
+ Changelogs are for humans and agents, not just machines. We follow the core principles of [Keep a Changelog](https://keepachangelog.com) and semvar to ensure our release notes are clear, consistent, and useful.
8
8
 
9
9
  To achieve this, we use a fragment-based workflow with `scriv`. Instead of a single, large `CHANGELOG.md` file that can cause merge conflicts, each developer includes a small changelog fragment with their pull request. At release time, these fragments are collected and aggregated into the main changelog.
10
10
 
@@ -12,55 +12,66 @@ This approach provides several benefits:
12
12
  - **Reduces Merge Conflicts:** Developers can work in parallel without conflicting over a central changelog file.
13
13
  - **Improves Developer Experience:** Creating a small, focused fragment is a simple and repeatable task during development.
14
14
  - **Ensures Consistency:** Automation helps maintain a consistent structure for all changelog entries.
15
+ - **AI Transparency:** An opportunity to be specific and detailed about the assistance provided.
15
16
  - **Builds Trust:** A clear and well-maintained changelog communicates respect for our users and collaborators.
16
17
 
18
+ ## Relevant paths
19
+
20
+ * `changelog.d/` - (e.g. changelog.d/YYYYMMDD_HHmmss_username_branch.md)
21
+ * `docs/migrating/` - (e.g. docs/migrating/v2.0.0-pre.md)
22
+ * `CHANGELOG.md` - The full changelog for all releases, in reverse chronological order. Careful: LARGE DOCUMENT. Limit reading to the first 50 lines.
23
+
24
+ * `setup.cfg` - Scriv tool settings
25
+
17
26
  ## How to Add a Changelog Entry
18
27
 
19
28
  1. **Create a New Fragment:**
20
- ```bash
21
- scriv create
22
- ```
23
- This will create a new file in the `changelog.d/fragments/` directory.
24
29
 
25
- **Alternative:** Use `scriv create --edit` to create and immediately open in your editor.
26
- **Important:** You must add content and save before exiting, or scriv will abort with "Empty fragment, aborting..."
30
+ ```bash
31
+ # This will create a new file in the `changelog.d/` directory.
32
+ scriv create
33
+ ```
27
34
 
28
35
  2. **Edit the Fragment File:**
29
- Open the newly created file and add your entry under the relevant category. See the guidelines below for writing good entries.
36
+ Open the newly created file and add your entry under the relevant category. See the guidelines below for writing good CHANGELOG entries.
37
+
38
+ 3. **Add or Update Migrating Guide:** (optional)
39
+ Include technical details to help developers update to the new version. Start with a specific introduction, e.g. "This version introduces significant improvements to Familia's feature system, making it easier to organize and use features across complex projects.". Including code snippets and multi-line content that is too detailed for the CHANGELOG.
40
+
41
+ Use the content of an existing `docs/migrating/vMajor.Minor.Patch*.md file as a reference.
30
42
 
31
- 3. **Commit with Your Code:**
32
- ```bash
33
- git add changelog.d/fragments/your_fragment_name.md
34
- git commit
35
- ```
43
+ Compare the headers of your draft content with the headers of the previous migration guide to make sure it does not repeat or overlap.
44
+
45
+ 4. **Commit with Your Code:**
46
+ ```bash
47
+ git add changelog.d/YYYYMMDD_HHmmss_username_branch.md [docs/migrating/v2.0.0-pre.md]
48
+ git commit
49
+ ```
36
50
 
37
51
  ## Fragment Guidelines
38
52
 
39
- - **One Fragment Per Change:** Keep each fragment focused on a single feature, fix, or improvement.
40
- - **Documenting AI Assistance:** If a change involved significant AI assistance, place it in its own fragment. This ensures the `### AI Assistance` section clearly corresponds to the single change described in that fragment.
41
- - **Write for a Human Audience:** Describe the *impact* of the change, not just the implementation details.
42
- - **Good:** "Improved the performance and stability of Redis connections under high load."
43
- - **Bad:** "Refactored the `RedisManager` to use a connection pool."
44
- - **Be Specific:** Avoid generic messages like "fixed a bug." Clearly state what was fixed.
45
- - **Include Context:** Reference issue or pull request numbers to provide a link to the discussion and implementation details. `scriv` will automatically create links for them.
46
- - **Example:** `- Fixed a bug where users could not reset their passwords. (Closes #123)`
53
+ - **One Fragment Per Change:** Keep each fragment focused on a single feature, fix, or improvement.
54
+ - **Documenting AI Assistance:** If a change involved significant AI assistance, place it in its own fragment. This ensures the `### AI Assistance` section clearly corresponds to the single change described in that fragment.
55
+ - **Write for a Human Audience:** Describe the *impact* of the change, not just the implementation details.
56
+ - **Good:** "Improved the performance and stability of Redis connections under high load."
57
+ - **Bad:** "Refactored the `RedisManager`."
58
+ - **Be Specific:** Avoid generic messages like "fixed a bug." Clearly state what was fixed.
59
+ - **Include Context:** Reference issue or pull request numbers to provide a link to the discussion and implementation details. `scriv` will automatically create links for them.
60
+ - **Example:** `- Fixed a bug where users could not reset their passwords. PR #123`
47
61
 
48
62
  ### Categories
49
63
 
50
- Use these categories from [Keep a Changelog](https://keepachangelog.com):
64
+ Use these categories:
51
65
 
52
- - **Added**: New features or capabilities.
53
- - **Changed**: Changes to existing functionality.
54
- - **Deprecated**: Soon-to-be removed features.
55
- - **Removed**: Now removed features.
56
- - **Fixed**: Bug fixes.
57
- - **Security**: Security-related improvements.
58
- - **Documentation**: Documentation improvements.
66
+ - **Added**: New features or capabilities.
67
+ - **Changed**: Changes to existing functionality.
68
+ - **Deprecated**: Soon-to-be removed features.
69
+ - **Removed**: Now removed features.
70
+ - **Fixed**: Bug fixes.
71
+ - **Security**: Security-related improvements.
72
+ - **Documentation**: Documentation improvements.
73
+ - **AI Assistance**: Significant AI assistance in the change, including discussion, rubber ducking, formatting, writing documentation, writing tests.
59
74
 
60
75
  ## Release Process
61
76
 
62
- At release time, an authorized maintainer will collect all fragments into the main `CHANGELOG.md` file:
63
-
64
- ```bash
65
- scriv collect --version 2.0.0
66
- ```
77
+ At release time, scriv will collect all fragments into the main `CHANGELOG.md` file with th command `scriv collect`. The version is taken automatically from `lib/familia/version.rb`.
@@ -189,7 +189,7 @@ customer.find_by_name("production-api-key")
189
189
  customer.find_all_by_scope(["read", "write"])
190
190
  ```
191
191
 
192
- ### Migration Guide
192
+ ### Migrating Guide
193
193
  If you have existing code with incorrect syntax, here's how to fix it:
194
194
 
195
195
  ```ruby
@@ -179,7 +179,7 @@ end
179
179
 
180
180
  ---
181
181
 
182
- ## Migration Guide Summary
182
+ ## Migrating Guide Summary
183
183
 
184
184
  ### From v1.x to v2.0.0-pre
185
185
  1. **Update connection configuration** to use new pooling system
@@ -10,9 +10,9 @@ This directory contains original documentation files that have been migrated to
10
10
  ### FAMILIA_UPDATE.md
11
11
  **Original Purpose:** Version summary table and detailed release notes for v2.0.0-pre series
12
12
 
13
- **Migration Destinations:**
13
+ **Migrating Destinations:**
14
14
  - **Changelog entries** → Extracted to Scriv fragments, aggregated into `CHANGELOG.md`
15
- - **Migration guides** → Reorganized into `docs/migration/v2.0.0-pre*.md`
15
+ - **Migrating guides** → Reorganized into `docs/migrating/v2.0.0-pre*.md`
16
16
  - **Feature descriptions** → Cross-referenced with existing feature guides in `docs/guides/`
17
17
 
18
18
  ### FAMILIA_RELATIONSHIPS.md
@@ -33,26 +33,22 @@ This directory contains original documentation files that have been migrated to
33
33
 
34
34
  ```
35
35
  docs/
36
- ├── migration/ # Version-specific migration guides
37
- │ ├── v2.0.0-pre.md # Foundation migration
38
- │ ├── v2.0.0-pre5.md # Security features
39
- │ ├── v2.0.0-pre6.md # Architecture improvements
40
- │ └── v2.0.0-pre7.md # Relationships system
41
- ├── guides/ # Feature guides (moved from wiki/)
42
- ├── relationships-methods.md # From FAMILIA_RELATIONSHIPS.md
36
+ ├── migrating/ # Version-specific migrating guides
37
+ │ ├── v2.0.0-pre.md
38
+ │ ├── v2.0.0-pre5.md # Security features
39
+ │ ├── v2.0.0-pre6.md # Architecture improvements
40
+ │ └── v2.0.0-pre7.md # Relationships system
41
+
42
+ ├── guides/ # Feature-specific guides (moved from wiki/)
43
+ │ ├── relationships.md # From FAMILIA_RELATIONSHIPS.md
43
44
  │ └── [other guides...]
44
- ├── reference/ # Technical reference
45
- │ └── api-technical.md # From FAMILIA_TECHNICAL.md
46
- └── archive/ # This directory
45
+
46
+ ├── reference/ # Technical reference
47
+ └── api-technical.md
48
+
49
+ └── archive/ # This directory
47
50
  ```
48
51
 
49
- ## Why These Files Were Archived
50
-
51
- 1. **Sustainability** - The original files accumulated overlapping content without clear organization
52
- 2. **Maintainability** - Scriv fragment system prevents documentation bloat
53
- 3. **Clarity** - Separation of changelog, guides, and reference improves findability
54
- 4. **Workflow** - Fragment-based workflow scales better with development
55
-
56
52
  ## Finding Migrated Content
57
53
 
58
54
  - **Version changes** → Check `CHANGELOG.md` (generated from fragments)
data/docs/guides/Home.md CHANGED
@@ -23,7 +23,7 @@ Welcome to the comprehensive documentation for Familia v2.0. This wiki covers al
23
23
 
24
24
  ### 🚀 Operations (As Needed)
25
25
 
26
- 9. **[Migration Guide](Migration-Guide.md)** - Upgrading existing fields _(coming soon)_
26
+ 9. **[Migrating Guide](Migrating-Guide.md)** - Upgrading existing fields _(coming soon)_
27
27
  10. **[Key Management](Key-Management.md)** - Rotation and best practices _(coming soon)_
28
28
 
29
29
  ## 🚀 Quick Start Examples
@@ -273,4 +273,4 @@ end
273
273
 
274
274
  - [Security Model](Security-Model) - Understand the cryptographic design
275
275
  - [Key Management](Key-Management) - Rotation and best practices
276
- - [Migration Guide](Migration-Guide) - Upgrade existing fields
276
+ - [Migrating Guide](Migrating-Guide) - Upgrade existing fields
@@ -234,7 +234,7 @@ customer.find_by_name("production-api-key")
234
234
  customer.find_all_by_scope(["read", "write"])
235
235
  ```
236
236
 
237
- ### Migration Guide
237
+ ### Migrating Guide
238
238
  If you have existing code with old syntax, here's how to update it:
239
239
 
240
240
  ```ruby
@@ -0,0 +1,2 @@
1
+ # Even all wiki markdown docs get the blues
2
+ !*.md
@@ -0,0 +1,84 @@
1
+ # Migrating Guide: v1.x to v2.0.0-pre
2
+
3
+ This guide covers migrating from Familia v1.x to the v2.0.0-pre foundation release.
4
+
5
+ ## Overview
6
+
7
+ The v2.0.0-pre series represents a major modernization of Familia with:
8
+ - Complete API redesign for clarity and consistency
9
+ - Valkey compatibility alongside Redis support
10
+ - Ruby 3.4+ modernization with improved thread safety
11
+ - New connection pooling architecture
12
+
13
+ ## Step-by-Step Migration
14
+
15
+ ### 1. Update Connection Configuration
16
+
17
+ **Before (v1.x):**
18
+ ```ruby
19
+ Familia.connect('redis://localhost:6379/0')
20
+ ```
21
+
22
+ **After (v2.0.0-pre):**
23
+ ```ruby
24
+ Familia.configure do |config|
25
+ config.redis_uri = 'redis://localhost:6379/0'
26
+ config.connection_pool = true
27
+ end
28
+ ```
29
+
30
+ ### 2. Migrate Identifier Declarations
31
+
32
+ **Before (v1.x):**
33
+ ```ruby
34
+ class User < Familia::Base
35
+ identifier :user_id
36
+ end
37
+ ```
38
+
39
+ **After (v2.0.0-pre):**
40
+ ```ruby
41
+ class User < Familia::Horreum
42
+ identifier_field :user_id
43
+ end
44
+ ```
45
+
46
+ ### 3. Update Feature Activations
47
+
48
+ **Before (v1.x):**
49
+ ```ruby
50
+ class User < Familia::Base
51
+ include Familia::Features::Expiration
52
+ end
53
+ ```
54
+
55
+ **After (v2.0.0-pre):**
56
+ ```ruby
57
+ class User < Familia::Horreum
58
+ feature :expiration
59
+ end
60
+ ```
61
+
62
+ ### 4. Review Method Calls
63
+
64
+ Several methods were renamed for consistency:
65
+
66
+ | v1.x Method | v2.0.0-pre Method | Notes |
67
+ |-------------|------------------|-------|
68
+ | `delete` | `destroy` | More semantic naming |
69
+ | `exists` | `exists?` | Ruby predicate convention |
70
+ | `dump` | `serialize` | Clearer intent |
71
+
72
+ ## Breaking Changes
73
+
74
+ - `Familia::Base` replaced by `Familia::Horreum`
75
+ - Connection configuration moved to block-based setup
76
+ - Feature inclusion changed from `include` to `feature` declarations
77
+ - Several method names updated for consistency
78
+
79
+ ## Next Steps
80
+
81
+ After completing the foundation migration:
82
+ 1. Review [Security Feature Adoption](v2.0.0-pre5.md) for encrypted fields
83
+ 2. See [Architecture Migration](v2.0.0-pre6.md) for persistence improvements
84
+ 3. Explore [Relationships Migration](v2.0.0-pre7.md) for the new relationship system