feat(eventmodeling): enforce Event Modeling connection invariants via Langium validator#7588
Conversation
🦋 Changeset detectedLatest commit: d50c423 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Screen is a loose term for human interface which can be an email, voice command or voice feedback. |
|
@pbrolin47 These changes are based on @adymitruk (the author of eventmodeling 😃) to make sure the diagram is proper. As @adymitruk mentioned above, |
e0b28f0 to
72f1ece
Compare
@mermaid-js/examples
mermaid
@mermaid-js/layout-elk
@mermaid-js/layout-tidy-tree
@mermaid-js/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #7588 +/- ##
==========================================
- Coverage 3.33% 3.33% -0.01%
==========================================
Files 536 537 +1
Lines 56240 56298 +58
Branches 820 821 +1
==========================================
+ Hits 1877 1878 +1
- Misses 54363 54420 +57
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
659411e to
58e481c
Compare
… Langium validator Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
58e481c to
d50c423
Compare
|
@yordis Thanks for this PR. |
|
@pbrolin47 any opportunity to take this one before the official release cause the situation to be a breaking change? I have another PR I would like to make around the word "screen" |
|
@yordis, Thank you for the contribution! |
📑 Summary
Adds a Langium semantic validator to the Event Modeling diagram that enforces the directional connection invariants defined by the Event Modeling methodology.
📏 Design Decisions
Event Modeling defines a strict information flow between entity types:
Without enforcement, the grammar silently accepted connections that violate these invariants. Most notably, an event flowing directly into a processor (bypassing a read model), which is not a valid pattern in Event Modeling.
The validator enforces the following rules via Langium's
ValidationRegistry, reporting errors on invalid->>source references:eventcommandonlyread modeleventonlyprocessorread modelonlyscreenread modelonlyeventorread modelThe check also covers the complementary direction, e.g. a
command, frame cannot consume aneventas its source. Ensuring events flow exclusively into read models, and read models flow exclusively into processors or screens.📋 Tasks
Make sure you
MERMAID_RELEASE_VERSIONis used for all new features.pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.