whodunit-chronicles 0.2.0 → 0.4.0

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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -179
  3. data/LICENSE +1 -1
  4. data/README.md +96 -599
  5. data/exe/whodunit-chronicles +6 -0
  6. data/lib/whodunit/chronicles/chronicler.rb +62 -0
  7. data/lib/whodunit/chronicles/cli.rb +131 -0
  8. data/lib/whodunit/chronicles/errors.rb +17 -0
  9. data/lib/whodunit/chronicles/ledger.rb +69 -0
  10. data/lib/whodunit/chronicles/ledger_entry.rb +143 -0
  11. data/lib/whodunit/chronicles/ledger_factory.rb +66 -0
  12. data/lib/whodunit/chronicles/ledgers/file_ledger.rb +56 -0
  13. data/lib/whodunit/chronicles/ledgers/memory_ledger.rb +29 -0
  14. data/lib/whodunit/chronicles/ledgers/sqlite_ledger.rb +172 -0
  15. data/lib/whodunit/chronicles/version.rb +2 -1
  16. data/lib/whodunit/chronicles.rb +13 -71
  17. data/lib/whodunit-chronicles.rb +0 -1
  18. data/sig/whodunit/chronicles/chronicler.rbs +14 -0
  19. data/sig/whodunit/chronicles/cli.rbs +17 -0
  20. data/sig/whodunit/chronicles/errors.rbs +15 -0
  21. data/sig/whodunit/chronicles/ledger.rbs +13 -0
  22. data/sig/whodunit/chronicles/ledger_entry.rbs +62 -0
  23. data/sig/whodunit/chronicles/ledger_factory.rbs +14 -0
  24. data/sig/whodunit/chronicles/ledgers/file_ledger.rbs +14 -0
  25. data/sig/whodunit/chronicles/ledgers/memory_ledger.rbs +12 -0
  26. data/sig/whodunit/chronicles/ledgers/sqlite_ledger.rbs +30 -0
  27. data/sig/whodunit/chronicles.rbs +5 -0
  28. metadata +44 -295
  29. data/.codeclimate.yml +0 -50
  30. data/.rubocop.yml +0 -93
  31. data/.yardopts +0 -14
  32. data/CODE_OF_CONDUCT.md +0 -132
  33. data/Rakefile +0 -18
  34. data/examples/images/campaign-performance-analytics.png +0 -0
  35. data/examples/images/candidate-journey-analytics.png +0 -0
  36. data/examples/images/recruitment-funnel-analytics.png +0 -0
  37. data/lib/.gitkeep +0 -0
  38. data/lib/whodunit/chronicles/adapters/mysql.rb +0 -261
  39. data/lib/whodunit/chronicles/adapters/postgresql.rb +0 -278
  40. data/lib/whodunit/chronicles/change_event.rb +0 -201
  41. data/lib/whodunit/chronicles/configuration.rb +0 -112
  42. data/lib/whodunit/chronicles/connection.rb +0 -88
  43. data/lib/whodunit/chronicles/persistence.rb +0 -129
  44. data/lib/whodunit/chronicles/processor.rb +0 -127
  45. data/lib/whodunit/chronicles/service.rb +0 -207
  46. data/lib/whodunit/chronicles/stream_adapter.rb +0 -91
  47. data/lib/whodunit/chronicles/table.rb +0 -120
  48. data/whodunit-chronicles.gemspec +0 -65
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b961b73fe4f8a8b195a51a4c37078b87ebd55effbb47bef6c1128896fc567b2
4
- data.tar.gz: ec689969f3bc3acea94f92eeca518d756b06313f8833e8af0f29066e0574199c
3
+ metadata.gz: c5860f6ea71bf324cb88c3962606f53c7292ba89cbf572ba408443f60248f366
4
+ data.tar.gz: 7333d83462ec43b3d93c38666ff51cacafff8af2579abc28594603e0d5e75a1a
5
5
  SHA512:
6
- metadata.gz: 4f32308b39334f4fc2b40fc178ce06d49cc98cd20eb284a6c45affc3561397b738781d20395284ff81b79d93c35daa2eceda598a6f057df1c655b1cea0e6dc59
7
- data.tar.gz: 85719789afd7e4de120ec6534473d39238d9b4d58e0355cdf00e983bd51af9292e9b23cb89a7d7acce086f610527dc41fb01bd699169520c77881ffee32d185c
6
+ metadata.gz: 8cce125043fb2152e3ba2e82a7c4df6a4294c624bce1278caa55ed4605166f7b658e7efe66b11a45168e154db8910a1cd5aca8c6266310e0df9e2943deb70880
7
+ data.tar.gz: 12bb800f8a9f0fe4b9f0355a2be1442195feeb58deab010bc25acdcc2e597cf041eb0c15bfe102b28f746b2c93e4aa1ff44677864ccaac9b2c2f501fcb03e8ff
data/CHANGELOG.md CHANGED
@@ -1,181 +1,24 @@
1
1
  # Changelog
2
2
 
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [Unreleased]
9
-
10
- ## [0.2.0] - 2025-01-28
11
-
12
- ### Added
13
-
14
- - **MySQL/MariaDB Support**: Complete multi-database adapter architecture
15
- - MySQL adapter using trilogy gem for high-performance connections
16
- - Binary log streaming support for MySQL change capture
17
- - Cross-database compatibility testing
18
- - **Enhanced Testing Suite**: Comprehensive test coverage improvements
19
- - New test files: `table_test.rb`, `connection_test.rb`, `persistence_test.rb`
20
- - Enhanced PostgreSQL adapter tests with connection and replication scenarios
21
- - Increased line coverage from 91.28% to 97.29% (+6.01 percentage points)
22
- - 227 tests with 552 assertions providing robust validation
23
- - **Ruby 3.4+ Compatibility**: Forward compatibility improvements
24
- - Added `bigdecimal` dependency for Ruby 3.4+ support
25
- - Explicit dependency management for removed stdlib components
26
- - **CI/CD Enhancements**: Improved automation and quality gates
27
- - Matrix testing across PostgreSQL and MySQL databases
28
- - Enhanced MySQL integration testing with proper connection handling
29
- - Security scanning integration and automated dependency updates
30
-
31
- ### Changed
32
-
33
- - **Architecture Refactoring**: Modular component extraction
34
- - Extracted AuditProcessor into separate, focused components
35
- - Improved service layer with multi-adapter support patterns
36
- - Enhanced configuration system supporting both PostgreSQL and MySQL
37
- - **Database Adapter Pattern**: Extensible multi-database support
38
- - Abstract adapter base class for consistent interface
39
- - Database-specific implementations with optimized performance
40
- - Unified change event system across different database types
41
- - **Test Infrastructure**: Comprehensive testing improvements
42
- - Enhanced mock-based testing for complex database operations
43
- - Improved test organization with better separation of concerns
44
- - Integration test scenarios for real-world usage patterns
45
-
46
- ### Fixed
47
-
48
- - **MySQL CI Integration**: Resolved connection and setup issues
49
- - Fixed MySQL container configuration and health checks
50
- - Improved database readiness detection and timeout handling
51
- - Enhanced error reporting and debugging for CI environments
52
- - **Dependency Management**: Ruby version compatibility
53
- - Added explicit `bigdecimal ~> 3.1` dependency for Ruby 3.4+
54
- - Resolved trilogy gem loading issues in newer Ruby versions
55
- - Improved gem specification with proper version constraints
56
-
57
- ### Technical Improvements
58
-
59
- - **Code Coverage**: Significant testing improvements
60
- - Line coverage: 97.29% (647/665 lines covered)
61
- - Branch coverage: 83.6% (158/189 branches covered)
62
- - Comprehensive unit tests for all core modules
63
- - **Performance Optimizations**: Multi-adapter efficiency
64
- - Database-specific SQL generation and parameter binding
65
- - Optimized connection management across different adapters
66
- - Efficient batch processing for both PostgreSQL and MySQL
67
- - **Error Handling**: Enhanced resilience and debugging
68
- - Improved error messages and stack trace reporting
69
- - Better handling of database-specific error conditions
70
- - Enhanced logging for troubleshooting and monitoring
71
-
72
- ### Development Experience
73
-
74
- - **Documentation**: Enhanced developer resources
75
- - Updated README with MySQL/MariaDB configuration examples
76
- - Improved inline documentation for multi-adapter usage
77
- - Better error messages and troubleshooting guides
78
- - **Testing Framework**: Improved development workflow
79
- - Faster test execution with better mock strategies
80
- - More reliable CI/CD pipeline with matrix testing
81
- - Enhanced debugging capabilities for test failures
82
-
83
- ## [0.1.0] - 2025-01-21
84
-
85
- ### Added
86
-
87
- - Comprehensive GitHub Actions CI/CD pipeline with multi-Ruby testing
88
- - Automated security scanning with bundler-audit and CodeQL
89
- - YARD documentation generation with GitHub Pages deployment
90
- - Automated gem publishing workflow for tagged releases
91
- - Structured issue and pull request templates for better contributor experience
92
- - Dependabot configuration for automated dependency updates
93
- - Security scanning dependencies (bundler-audit, brakeman)
94
- - Comprehensive README with architecture diagrams and examples
95
- - RuboCop configuration with relaxed metrics for test files
96
-
97
- ### Changed
98
-
99
- - Updated dependencies to latest versions with security patches
100
- - Improved RuboCop configuration to exclude test files from ClassLength limits
101
- - Enhanced gemspec with proper metadata and security dependencies
102
-
103
- ## [0.1.0] - 2025-01-21
104
-
105
- ### Added
106
-
107
- - **Core Architecture**: Complete zero-latency audit streaming implementation
108
- - **PostgreSQL Adapter**: Logical replication streaming with WAL decoding
109
- - **ChangeEvent System**: Unified change representation across database adapters
110
- - **Processor**: Intelligent transformation of changes into audit records
111
- - **Configuration Management**: Comprehensive settings with validation using dry-configurable
112
- - **Service Orchestration**: Thread-safe service with error handling and retry logic
113
- - **Abstract Adapter Pattern**: Extensible design supporting multiple database systems
114
- - **User Attribution**: Automatic extraction of user information from creator/updater/deleter fields
115
- - **Batch Processing**: Efficient bulk processing of audit records
116
- - **Connection Management**: Robust database connection handling with retries
117
- - **Error Handling**: Comprehensive error recovery and logging
118
- - **Thread Safety**: Concurrent processing with thread pool management
119
-
120
- ### Technical Implementation
121
-
122
- - **Modern Ruby Support**: Ruby 3.1+ with frozen string literals
123
- - **Database Features**:
124
- - PostgreSQL logical replication with pgoutput plugin
125
- - Publication and replication slot management
126
- - WAL position tracking and resumption
127
- - Connection pooling and management
128
- - **Event Processing**:
129
- - Real-time change capture at database level
130
- - Structured change events with metadata
131
- - Configurable table and schema filtering
132
- - Transaction ID and sequence number tracking
133
- - **Audit Records**:
134
- - Complete before/after data capture
135
- - Calculated field-level changes
136
- - User attribution from standard columns
137
- - Timestamps and version tracking
138
- - JSON metadata storage
139
-
140
- ### Development & Testing
141
-
142
- - **Test Coverage**: 94.3% code coverage (447/474 lines)
143
- - **Testing Framework**: Minitest with shoulda-style assertions and mocha mocking
144
- - **Test Suite**: 129 tests covering all components with comprehensive error scenarios
145
- - **Code Quality**: RuboCop compliance with modern Ruby standards
146
- - **Security**: bundler-audit integration for vulnerability scanning
147
- - **Documentation**: Inline YARD documentation for all public APIs
148
-
149
- ### Dependencies
150
-
151
- - **Core**: concurrent-ruby, dry-configurable, dry-logger, pg
152
- - **Development**: minitest, rubocop, simplecov, yard
153
- - **Testing**: mocha for mocking, pry for debugging
154
- - **Security**: bundler-audit for vulnerability scanning
155
-
156
- ### Configuration Options
157
-
158
- - Database connection URLs (source and audit)
159
- - PostgreSQL publication and replication slot names
160
- - Batch processing sizes and retry policies
161
- - Table and schema inclusion/exclusion filters
162
- - Logging levels and output configuration
163
- - Thread pool and concurrency settings
164
-
165
- ### Performance Features
166
-
167
- - **Zero Application Overhead**: No Rails callbacks or Active Record hooks
168
- - **Efficient Streaming**: PostgreSQL logical replication optimization
169
- - **Memory Management**: Streaming processing without dataset loading
170
- - **Configurable Batching**: Tunable batch sizes for optimal throughput
171
- - **Connection Reuse**: Persistent connections with automatic recovery
172
- - **Background Processing**: Non-blocking operation with thread pools
173
-
174
- ### Production Ready Features
175
-
176
- - **Monitoring**: Service status and health checking
177
- - **Resilience**: Automatic retry logic with exponential backoff
178
- - **Graceful Shutdown**: Clean service termination
179
- - **Error Recovery**: Robust error handling with detailed logging
180
- - **Position Tracking**: WAL position persistence for reliable resumption
181
- - **Resource Management**: Bounded thread pools and memory usage
3
+ ## Unreleased
4
+
5
+ ## 0.4.0
6
+
7
+ - Rebuilt as a minimal CDC audit sink.
8
+ - Added `Chronicler` as a `CDC::Core::Processor`.
9
+ - Added runtime dependency on `cdc-core`.
10
+ - Added immutable `LedgerEntry`.
11
+ - Added `Ledger` base contract.
12
+ - Added `MemoryLedger`.
13
+ - Added `FileLedger`.
14
+ - Added `SQLiteLedger`.
15
+ - Added ledger lifecycle CLI.
16
+ - Added RBS signatures.
17
+ - Added 100% code coverage and 100% YARD coverage gates.
18
+ - Added runtime dependency on `sqlite3` for built-in SQLite ledger support.
19
+ - Added real SQLite integration coverage for persistence, custom tables, status counts, and duplicate event IDs.
20
+ - Clarified SQLite duplicate append behavior: duplicate `event_id` values raise `Whodunit::Chronicles::AppendError`.
21
+ - Added JSON status output and stricter option validation to the ledger lifecycle CLI.
22
+ - Improved CLI errors for malformed configuration, missing required ledger options, unsupported lifecycle methods, and failed verification.
23
+ - Completed the Steep-backed RBS quality gate.
24
+ - Added GitHub Actions workflows for generated YARD documentation and tagged RubyGems releases.
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Ken C. Demanawa
3
+ Copyright (c) 2026 Kenneth C. Demanawa
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal