Add model-bound constraints and TypeScript parity features for context, event sequences, and event-store discovery#2
Conversation
Agent-Logs-Url: https://github.com/Cratis/Chronicle.Elixir/sessions/53ad43dc-f079-43e2-8959-05bc01faee29 Co-authored-by: einari <134365+einari@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Cratis/Chronicle.Elixir/sessions/53ad43dc-f079-43e2-8959-05bc01faee29 Co-authored-by: einari <134365+einari@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Cratis/Chronicle.Elixir/sessions/53ad43dc-f079-43e2-8959-05bc01faee29 Co-authored-by: einari <134365+einari@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Cratis/Chronicle.Elixir/sessions/53ad43dc-f079-43e2-8959-05bc01faee29 Co-authored-by: einari <134365+einari@users.noreply.github.com>
|
@copilot fix the conflicts and let’s catch up to what the TypeScript client can do and add docs and samples - see it’s git history and build feature by feature: https://github.com/cratis/chronicle.typescript |
…add-elixir-constraints-implementation # Conflicts: # README.md # Source/chronicle/lib/chronicle/constraints.ex Co-authored-by: einari <134365+einari@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Cratis/Chronicle.Elixir/sessions/b13ac73e-e848-45d2-b346-061e29fca1ac Co-authored-by: einari <134365+einari@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Cratis/Chronicle.Elixir/sessions/b13ac73e-e848-45d2-b346-061e29fca1ac Co-authored-by: einari <134365+einari@users.noreply.github.com>
Done. I merged |
|
@copilot When I said get up to speed - gain parity with the TypeScript support, I meant the entire client. Implement all the different things that we've already implemented for the TypeScript client - but do it in an idiomatic Elixir approach and follow the patterns already established - look through the Git history of the TypeScript client and get an idea of what's been done that is not already supported: https://github.com/cratis/chronicle.typescript Add enough to the sample to work with this and also add documentation for it all. |
Agent-Logs-Url: https://github.com/Cratis/Chronicle.Elixir/sessions/e9c56eb8-bb19-474c-bb75-38a3116e0e27 Co-authored-by: einari <134365+einari@users.noreply.github.com>
Implemented the next major TypeScript-parity slice in an idiomatic Elixir way: process-scoped correlation, identity, and causation support integrated into |
|
@copilot Not even close - Look at the TypeScript version and all the folders it has: https://github.com/Cratis/Chronicle.TypeScript/tree/main/Source - backtrack the Git history for all of it and reach feature parity |
|
@copilot Try again |
Agent-Logs-Url: https://github.com/Cratis/Chronicle.Elixir/sessions/7387ec3c-95ee-4a66-9081-adde1c17fb0d Co-authored-by: einari <134365+einari@users.noreply.github.com>
Implemented another parity slice in |
This PR adds an idiomatic, model-bound constraints experience for Elixir, aligned with the existing attribute-driven APIs (like read model projections). Event constraints can now be declared directly on event modules and are discovered/registered automatically during client startup.
It also extends the Elixir client toward broader TypeScript parity by adding process-scoped correlation, identity, and causation context support for event appends, plus event-sequence and event-store discovery APIs.
Event-type constraint DSL (attribute-first)
Chronicle.EventTypeto expose constraint metadata via__chronicle_event_type__(:constraints).@unique/unique(...)for unique-property constraints@remove_constraint/remove_constraint(...)for release/removal eventsunique_event_type(...)macro support in the event-type DSL surfaceConstraint derivation from event metadata
Chronicle.Constraints.from_event_types/1to build constraint definitions from event module declarations.:unique_event_type) derived from event metadataAutomatic registration in startup flow
Chronicle.Projections.Registrarso constraints derived from discovered event types are registered as part of normal client bootstrapping.Correlation, identity, and causation context (TypeScript parity slice)
Chronicle.CorrelationIdChronicle.CorrelationIdManagerChronicle.IdentityChronicle.IdentityProviderChronicle.CausationTypeChronicle.CausationEntryChronicle.CausationManagerChronicle.EventLog.append/3to include::correlation_id:identity:causationChroniclefor reading/setting/clearing correlation and identity context.Event sequence + event store parity additions
Chronicle.EventStoresfor kernel discovery APIs:Chronicle.get_event_stores/1Chronicle.get_namespaces/1Chronicle.EventLogwith event-sequence capabilities::event_sequence_idoption support for append/query operationsChronicle.get_tail_sequence_number/2Chronicle.has_events_for?/2Chronicletop-level delegates.Tests, docs, and sample updates
unique_event_typeconstraint derivationunique_event_typeget_event_stores,get_namespaces)has_events_for?,get_tail_sequence_number) and:event_sequence_idusageunique_event_typeconstraint onAccountOpenedSamples/console/README.mdto document the expanded sample capabilities.Warning
Also includes conflict resolution after merging
origin/main, plus workflow permission hardening in.github/workflows/*to satisfy CodeQLactions/missing-workflow-permissions.