tcb 0.5.0 → 0.6.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36fd8e211b32e06207655daa3315da63d7f656327a4d16635d4a543627d65788
4
- data.tar.gz: 1ceac959afd426cd864ee13f5cfe19bb7df320b96ec421cc73602c57bd9ed581
3
+ metadata.gz: 77ac348140af6f18f4416932f320bc474f3131c14903c592cf83f352a02e1297
4
+ data.tar.gz: 4f5462a8425eb01612a3e6ffb3b89c8c848504db97d8a2fb913c7961abbc67b2
5
5
  SHA512:
6
- metadata.gz: 14156191e1ffb38ffc16f6dc047c4f2f1bb524727cec39420ba9685a7f24c07d511f8397349cc9979bf81d7266a10cc184a4657a0730d7ab268a234d60828ee4
7
- data.tar.gz: 6e2f57602e4b610615a1ea0e5749f9fd7881617801f23939287552fe8b2ac2d5d446fc484fd28182656438a462866b2ba08ecbc3131e17db259fc7da13566cb7
6
+ metadata.gz: 2eed8f7a67fcef1a356262a854b707964a2d5eb15c910a5a508368fc602e7f0892742e0ff24035a26f7542ae9de14740288db7fe07655d7e13e25a444db8799e
7
+ data.tar.gz: d41fd603ec8b6cc729396ea7ac5b9b692bd983b080f59e8f1df23faab88976563bd460513ed0634d25fba6a3911f77e583e8508c0ce455997347ed25eef00e12
data/CHANGELOG.md CHANGED
@@ -5,7 +5,46 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [Unreleased]
8
+ ## [0.6.1] - 2026-05-06
9
+
10
+ ### Fixed
11
+
12
+ - Rails generators now invoked with lowercase namespace: `rails g tcb:install`, `rails g tcb:domain`, `rails g tcb:event_store`
13
+
14
+ ## [0.6.0] - 2026-04-24
15
+
16
+ ### Added
17
+
18
+ - `TCB.read_correlation(correlation_id, across: [...])` — cross-domain correlation query; returns all envelopes with the given `correlation_id` across specified domains, ordered by `occurred_at`; `across:` is optional, defaults to all domains with persistence registrations; supports `occurred_after`, `occurred_before`, `between` filters
19
+ - `TCB::CorrelationQuery` — fluent interface for correlation queries with `occurred_after`, `occurred_before`, `between`, `to_a`
20
+ - `TCB::EventStore::InMemory#read_by_correlation` — correlation query support for in-memory store
21
+ - `TCB::EventStore::ActiveRecord#read_by_correlation` — correlation query support via SQL UNION across domain tables
22
+ - `TCB::Envelope` — unified primitive replacing `TCB::EventStore::EventStreamEnvelope`; carries `event`, `event_id`, `stream_id`, `version`, `occurred_at`, `correlation_id`, `causation_id`
23
+ - `TCB::Envelope.wrap(event, correlation_id:, causation_id:)` — factory for wrapping bare events into envelopes with auto-generated `event_id` and `occurred_at`
24
+ - `TCB::Envelope.coerce(event_or_envelope)` — idempotent coercion; returns envelope unchanged, wraps bare events
25
+ - `TCB.dispatch(command, correlation_id:)` — returns `correlation_id` (String); accepts optional override, generates `SecureRandom.uuid` by default
26
+ - `correlation_id` propagation — all envelopes produced within a dispatch share the same `correlation_id`; propagates across thread boundary via envelope data, not execution state
27
+ - `causation_id` propagation — reactive handlers registered via `on / react_with` automatically set `causation_id` to the `event_id` of the triggering envelope; handler interface unchanged (`def call(event)`)
28
+ - `TCB::EventStore::InMemory#append` — accepts `correlation_id:` and `causation_id:`
29
+ - `TCB::EventStore::ActiveRecord#append` — accepts `correlation_id:` and `causation_id:`; persists to DB columns
30
+ - Migration template — adds `correlation_id`, `causation_id` columns with indexes on `event_id` and `correlation_id`
31
+ - `TCB::EventBus.new(sync:)` — synchronous execution mode; handlers execute in caller thread, no dispatcher thread, no polling in tests
32
+ - `TCB::EventBus.new(max_queue_size:, high_water_mark:)` — bounded queue with pressure signalling; emits `TCB::EventBusQueuePressure` on threshold crossing
33
+ - `TCB.configured?` — returns `false` if config does not exist or `event_bus` is not set
34
+ - `TCB.reset!(graceful_shutdown_time:)` — optional graceful bus drain before reset
35
+ - `TCB.domain_modules=` — declare bounded contexts separately from infrastructure configuration
36
+
37
+ ### Changed
38
+
39
+ - `TCB.record` — returns envelopes instead of bare events; use `envelopes.map(&:event)` to access domain events
40
+ - `TCB.publish` — accepts envelopes or bare events; bare events wrapped via `Envelope.coerce`
41
+ - `TCB.configure` — configures infrastructure only; domain modules declared separately via `TCB.domain_modules=`
42
+ - `TCB.reset!` — no longer replays configure block; caller responsible for reconfiguring after reset
43
+
44
+ ### Removed
45
+
46
+ - `TCB::EventStore::EventStreamEnvelope` — replaced by `TCB::Envelope`
47
+ - `TCB.configure` with `domain_modules:` keyword — replaced by `TCB.domain_modules=` + `TCB.configure`
9
48
 
10
49
  ## [0.5.0] - 2026-04-14
11
50