event_engine 0.2.2 → 0.2.3

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: 147bcd5804bc40820fdbe36f46bd6e5ca76a7b7d09b39bf1955ccbda2925e1cd
4
- data.tar.gz: bdb36c1bf535f603b58950749ef12d1ea19bbbbd1c59e4f3831525c4d336342b
3
+ metadata.gz: e487942b070a87cfa23e72a27d34e9247704caadfa887be26c1cd63eb3d4506d
4
+ data.tar.gz: 4f87ddcd5d44b28009ad2e45bc46296ab52d9f047037ec7023067238554f6a4e
5
5
  SHA512:
6
- metadata.gz: 90690f42ed2498c5516a52230b750273777d115fa136af306e84c0c3a2dd4615f79d63570aa14ba0d34087a2c582e036f9a3acad6175a757305783225404c93c
7
- data.tar.gz: 507ce9e63e9a161436a88eabcb7d6114f06bdd77e7fa88a23296c3655910994b7e9696f3f0a5cd4420876e39f02da963c748773c8551096f39cec22d0076c4a4
6
+ metadata.gz: 6f63838b3a3c2835e9c1511172413f6991cb0831afdf3b21247e5ef5ba03f0d40a92fb21ba1282ef6ce100a5081837821999de9b51f3cc920a2a5b30a94ec9fa
7
+ data.tar.gz: 688da6973e692d3b57b6d468191c37e9f701fa767888c030aec9318a0193685388ba6441b88be08d5fb54ff85ee6f8f019eee4a91791259ee4cce2af4a3baef2
data/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.2.3] - 2026-10-23
11
+
12
+ ### Added
13
+
14
+ - **Unrouted events.** A rule of `unrouted` defines an event before anything
15
+ handles it. It passes `validate_rules!`, and emitting it raises
16
+ `EventEngine::UnroutableEventError`.
17
+
10
18
  ## [0.2.2] - 2026-09-06
11
19
 
12
20
  ### Fixed
data/README.md CHANGED
@@ -234,6 +234,7 @@ packs:
234
234
  events:
235
235
  invoice_voided: audit # this one event
236
236
  lead_converted: # catalogued but undecided
237
+ lead_scored: unrouted # defined, not routed yet
237
238
  ```
238
239
 
239
240
  A rule names a **registered processor**. Resolution is **event → pack → default**,
@@ -251,6 +252,13 @@ and the resolved name is both the processor invoked and the value stamped on
251
252
  A newly catalogued event appears with no value. It falls through to its pack rule or
252
253
  the default; if neither exists, emitting it raises rather than being dropped.
253
254
 
255
+ ### Defining an event before it is routed
256
+
257
+ Give an event the rule `unrouted` to define it before anything handles it. It
258
+ passes `validate_rules!` and `event_engine:rules:check`, and emitting it raises
259
+ `EventEngine::UnroutableEventError`. Replace `unrouted` with a processor name once
260
+ the event has one.
261
+
254
262
  ### When a rule is wrong
255
263
 
256
264
  Both misconfigurations fail loudly and name the fix:
@@ -2,6 +2,8 @@ require "yaml"
2
2
 
3
3
  module EventEngine
4
4
  class ProcessingRules
5
+ UNROUTED = :unrouted
6
+
5
7
  def self.load(path)
6
8
  return new unless File.exist?(path.to_s)
7
9
 
@@ -33,7 +35,7 @@ module EventEngine
33
35
  end
34
36
 
35
37
  def processor_names
36
- ([ @default ] + @packs.values + @events.values).compact.uniq
38
+ ([ @default ] + @packs.values + @events.values).compact.uniq - [ UNROUTED ]
37
39
  end
38
40
  end
39
41
  end
@@ -9,8 +9,10 @@ module EventEngine
9
9
  end
10
10
 
11
11
  def resolve(event)
12
- @rules.for(event_name: event.event_name, pack: event.domain) ||
13
- raise(UnroutableEventError.new(event))
12
+ name = @rules.for(event_name: event.event_name, pack: event.domain)
13
+ raise UnroutableEventError.new(event) if name.nil? || name == ProcessingRules::UNROUTED
14
+
15
+ name
14
16
  end
15
17
  end
16
18
  end
@@ -1,3 +1,3 @@
1
1
  module EventEngine
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -145,6 +145,8 @@ off to that local first and come back.
145
145
  domain; pair narrow rules with a `default_processor`.
146
146
  - Routing at a name with no registered processor fails at emit time, not at boot.
147
147
  Keep steps 3 and 4 in the same initializer so they cannot drift.
148
+ - A rule of `unrouted` defines an event before anything handles it. It passes the
149
+ rules check, and emitting it raises `EventEngine::UnroutableEventError`.
148
150
  - A pack helper firing an event that is not in the committed catalog raises
149
151
  `EventEngine::DefinitionPublisher::EventNotInCatalogError`. That means the
150
152
  catalog is stale — rebuild it in step 2, do not work around it in app code.
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: event_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - tylercschneider
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-09-06 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: railties
@@ -102,7 +101,6 @@ metadata:
102
101
  changelog_uri: https://github.com/DYB-Development/event_engine/blob/main/CHANGELOG.md
103
102
  bug_tracker_uri: https://github.com/DYB-Development/event_engine/issues
104
103
  documentation_uri: https://github.com/DYB-Development/event_engine#readme
105
- post_install_message:
106
104
  rdoc_options: []
107
105
  require_paths:
108
106
  - lib
@@ -117,8 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
115
  - !ruby/object:Gem::Version
118
116
  version: '0'
119
117
  requirements: []
120
- rubygems_version: 3.5.16
121
- signing_key:
118
+ rubygems_version: 4.0.20
122
119
  specification_version: 4
123
120
  summary: The Rails host runtime for the schema-first EventEngine pipeline
124
121
  test_files: []