Route commands and aggregates through Chronicle event source definitions - #182
Merged
Merged
Conversation
Add the eventSourceDefinition decorator, per-event source and stream replacement as a unit, startup validation, and aggregate source/stream guarding. Pin @cratis/chronicle 6.49.0 for development and adjust the unsupported-projection specs for the in-memory arithmetic support added in that release.
Add command, aggregate, nested transaction, mixed override, legacy and older-store specs, a live kernel check, and the Event source definitions page.
Contributor
Author
|
Checklist (reviewer-facing; verified locally on
Part of #181 and Cratis/Arc#2987; neither is closed by this PR. |
Contributor
Author
|
Independent review (head a745d42): no blocking defects. Added a clear diagnostic and spec for event source thunks that return neither a class nor a name. Verified: full suite 1200 files/3475 specs, build/typecheck/lint/consumers/declarations/docs, peer-floor, runtime load against real @cratis/chronicle 6.29.0 (string routing works, definition use fails with the 6.49.0 message), live suites against isolated kernel 18800: existing 4/4 and event-source-routing 4/4. |
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.
Commands and aggregates can now route their events through a Chronicle event source definition and stream instead of free-form strings. The string decorators keep working.
Added
@eventSourceDefinition(Source, 'Stream')for commands and aggregate roots (class, name, or a function returning the class for circular imports). Each event records its definition, and Chronicle derives the concurrency scope from the definition when no explicit scope or flags are set. Requires@cratis/chronicle6.49.0 or later; older SDKs keep string routing and fail with a clear message only when a definition is selected. See Event source definitions. (part of Definition-based command and aggregate event source routing #181)@eventSourceclass, an unknown name, a stream the definition does not declare, or string routing that contradicts the definition. (part of Definition-based command and aggregate event source routing #181)eventSourceandeventStreamoneventForEventSourceIdreplace the command's source and stream as a unit, and a raw per-event source or stream type wins over the command's definition. (part of Definition-based command and aggregate event source routing #181)defineChronicleCommandaccepts an optionaleventSourcereference. (part of Definition-based command and aggregate event source routing #181)ChronicleArtifacts.eventSourcesexposes the discovered definitions to the Chronicle client.Changed
@cratis/chronicle6.49.0; the peer floor stays^6.29.0.