Repository navigation
Treat an undecided rule as no rule - #256
Merged
Merged
Conversation
The catalog task scaffolds a rules file listing every event with no value. Those keys made the events hash non-empty, so routes? was true while resolution returned nil — meaning running event_engine:catalog broke emit for every event until every rule was filled in. An app with only handlers and no processors could not emit at all after building its catalog. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
Running
event_engine:catalogbroke emit.The task scaffolds a rules file listing every catalogued event with no value:
Those keys made
@eventsnon-empty, soProcessingRules#any?returned true andProcessorResolver#routes?decided routing was active. Resolution then returnednil, and every emit raised:So building your catalog broke your app until you filled in every rule. Worse for an app that uses only handlers and needs no processors at all —
event_engine-storerecords every event viaregister_handler, and such an app could not emit anything after running the catalog task.Introduced in #245, where the rules file was added, and missed because the tests only exercised rules with values.
The fix
any?now counts declared processor names rather than hash keys, so a key with no value is what it looks like: undecided.Resulting semantics
{}"I have not wired processing yet" works. "I wired some of it and forgot one" is an error.
event_engine:rules:checkstill reports the all-undecided case, so it stays visible without being fatal.Verification
Suite green: 135 runs, 175 assertions, 0 failures.
Verified in the example app across both states:
Note
This is a second open PR in this repo alongside #255 (a README link). Raised separately because it blocks migrating an existing app onto these gems, and #255 is documentation only.
🤖 Generated with Claude Code