Skip to content

Compliance suite: the IEvent metadata contract #5143

Description

@jeremydmiller

Part of #5118 (compliance wave growth), epic #5110.

ActivityCorrelationCompliance (wave 3) pins session-scoped correlation/causation. Nothing yet pins the rest of the IEvent contract, which is entirely shared — Id, Version, Sequence, StreamId, StreamKey, TenantId, Timestamp, EventTypeName, DotNetTypeName, Headers, CorrelationId, CausationId, IsArchived — and is exactly the kind of surface where two independent implementations quietly disagree (which clock stamps Timestamp, whether Sequence is global or per-stream, whether headers survive a round trip).

IEvent is a JasperFx type and every accessor is on it, so this is portable with no seam addition beyond the already-present ComplianceStoreConfig.EnableCorrelationTracking. A header-enable flag may be needed on the config (Marten Events.MetadataConfig.HeadersEnabled, Polecat's equivalent) — one boolean, same pattern as EnableCorrelationTracking.

What each store tests today

Marten Polecat
flexible_event_metadata.cs Events/event_metadata_tests.cs
fetch_a_single_event_with_metadata.cs Metadata/event_metadata_filter_tests.cs
EventSourcingTests/Metadata/* Events/event_append_counter_tests.cs
event_wrapper_must_be_serializable.cs

Scope

New EventMetadataCompliance suite:

  1. Every IEvent member populated as documented after a round trip through FetchStreamAsync
  2. Version is per-stream and 1-based; Sequence is store-global and monotonic across streams
  3. Timestamp is server-assigned and non-default, and ordering by Timestamp agrees with ordering by Sequence for a single stream
  4. EventTypeName / DotNetTypeName match what IEventRegistry.EventMappingFor(Type) reports (already the zero-IVT assertion path the library uses)
  5. Custom headers set on the session survive the round trip; headers are absent (not empty-throwing) when the feature is off
  6. TenantId is the default tenant in a single-tenant store
  7. IEvent<T>.Data typing via LoadAsync<T>

Acceptance

  • Suite enrolled in both stores; any config flag added follows the EnableCorrelationTracking precedent (fixture-owned, not registrar-routed)
  • Originals retired in both repos

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions