Skip to content

Compliance suite: snapshot lifecycle equivalence (Inline / Async / Live) #5142

Description

@jeremydmiller

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

The compliance library asserts async snapshots (AsyncDaemonCompliance) and self-aggregating evolve (SelfAggregatingEvolveCompliance), but nothing yet pins the equivalence of the three lifecycles: the same aggregate registered Inline, Async or Live must produce the same document state, and only the persistence timing should differ.

ComplianceStoreConfig.Snapshot<TDoc>(SnapshotLifecycle) and the fixture's LoadDocumentAsync are already in place, so this is portable with no seam addition.

What each store tests today

Marten Polecat
Projections/inline_aggregation_by_stream_with_multiples.cs Projections/inline_projection_tests.cs
Projections/inline_aggregation_with_base_view_class.cs Projections/snapshot_registration_tests.cs
Projections/inline_aggregation_with_non_public_setter.cs Events/inline_projection_side_effects_tests.cs
Projections/inline_aggregation_with_private_constructor.cs
Projections/inline_aggregation_with_subclass.cs
Aggregation/when_doing_inline_per_stream_aggregations_with_Guid_stream_identity.cs
Aggregation/setting_version_number_on_aggregate.cs

Marten's inline-aggregation set is unusually broad (base classes, subclasses, non-public setters, private constructors) and Polecat's is thin — a classic drift asymmetry worth closing in the strongest direction.

Scope

New SnapshotLifecycleCompliance suite:

  1. Same aggregate, same events, registered Inline vs Async vs Live → identical resulting state (the load-back for Live goes through AggregateStreamAsync)
  2. Inline snapshot is persisted at SaveChangesAsync, asserted through LoadDocumentAsync, not a re-fold (this is precisely the drift Epic: cross-store event sourcing compliance test library (test harness standardization Phase 3) #5110 found in Polecat's originals)
  3. Aggregate shapes: private constructor, non-public setter, base-class view, subclass
  4. Version number stamped onto the aggregate (setting_version_number_on_aggregate)
  5. Inline projection side effects ordering relative to the document write
  6. A second append updates rather than duplicates the snapshot

Acceptance

  • Suite enrolled in both stores, zero capability gates
  • Marten's richer aggregate-shape cases survive the merge; Polecat gains them
  • 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