Skip to content

Add registered event source and stream definitions - #229

Merged
einari merged 6 commits into
mainfrom
feature/registered-event-sources
Oct 3, 2026
Merged

einari merged 6 commits into
mainfrom
feature/registered-event-sources

Conversation

@einari

@einari einari commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Event sources and streams can now be registered with the Kernel and used when appending. Existing appends, options and event contexts are unchanged.

Added

Changed

  • Requires @cratis/chronicle.contracts 19.30.0 and a Chronicle 19.30.0 Kernel to use event sources.

einari added 3 commits October 3, 2026 07:16
Introduce @eventSource/@eventstream definitions registered through the
EventSources wire service, AppendOptions.eventSource/eventStream and
per-event routing, derived concurrency scopes, and EventContext.eventSource.
@einari einari added the minor label Oct 3, 2026
einari added 2 commits October 3, 2026 07:30
…its of work

eventSources is now optional on IEventStore so custom implementations
keep compiling. Transactional append accepts eventSource/eventStream and
UnitOfWork forwards them on commit. Scenarios reject the options loudly.
Re-baseline fixtures against the 19.30.0 engine and contracts. The only
semantic drift: a parent created by a child-only event stays uninitialized
on later child-only events; the in-process projection processor now matches.
The oracle reads the client's ambient causation through the new entry wrapper.
@cratis-direct

cratis-direct Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

The "Projection oracle" CI failure on this PR (the fixture version/hash mismatch reported at run 37099328763) was caused by Tools/ProjectionOracle/ProjectionOracle.csproj's ChronicleVersion/Cratis.Arc pins not following the @cratis/chronicle.contracts bump to 19.30.0 in a0b7b92, plus the packaged client's CausationManager wrapping each ambient Causation in a new private Entry type (breaking the oracle's reflection-based causation push). Commit 1e015fd already fixes both — confirmed yarn oracle:check (91/91 fixtures) and yarn workspace @cratis/chronicle test (3113 tests) both pass clean on this branch now, and CI (check job) is green.

One thing worth a second pair of eyes while re-verifying: 1e015fd also updates ProjectionReadModelProcessor.ts and children-identified-removed.json to follow a real Chronicle kernel behavior change — a read-model document created only from child events (no root From) no longer transitions __initialized to true on a later child-only event. I bisected this independently while working the same CI failure: it's present from Chronicle 19.28.0 onward and absent in 19.27.0, with no mention in the 19.27.0–19.30.0 release notes. I filed Cratis/Chronicle#4544 to get the Chronicle team to confirm whether it's intentional, since right now there's nothing marking it as a tracked kernel question (the other kernel quirks in this oracle's README link an issue). Worth linking that issue from the fixture/README once triaged, in case the kernel team comes back and says it was unintentional.

…ource id

The Kernel keeps one concurrency scope per event source id. Every definition event now contributes its required guard: equivalent predicates share a scope, an unguarded event never suppresses a guarded one, and differing predicates throw before any wire append or unit of work group write.
@einari

einari commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

Scope-guard fix pushed: batches needing differing concurrency guards for one event source id now fail before any write (client, and unit-of-work preflight). Verified: 3120 unit specs, build, standard-types, native, snippets, kernel integration on isolated 18700 (jobs flake once on cold start, passes on rerun). Core tracking: Cratis/Chronicle#4545.

@einari
einari marked this pull request as ready for review October 3, 2026 06:58
@einari
einari merged commit a457eb2 into main Oct 3, 2026
10 of 12 checks passed
@einari
einari deleted the feature/registered-event-sources branch October 3, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant