Skip to content

Compliance suite: live aggregation and AggregateStreamToLastKnownAsync #5141

Description

@jeremydmiller

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

Live aggregation — folding a stream on read with no persisted document — runs entirely through shared surfaces: AggregateStreamAsync<T> and AggregateStreamToLastKnownAsync<T> on IQueryEventStore, both with Guid and string overloads and both with version/timestamp/fromVersion bounds.

The one seam fact worth recording up front: EventStoreComplianceFixture.SupportsLiveAggregationRegistration already exists (false in stores that build live aggregators automatically and reject explicit registration), and ComplianceStoreConfig.LiveAggregation<T>() is already wired. So the plumbing for this suite is in place.

What each store tests today

Marten Polecat
Aggregation/when_doing_live_aggregations.cs Projections/live_aggregation_tests.cs
Aggregation/aggregate_stream_returns_null_if_the_aggregate_is_null_at_that_point_in_stream.cs Events/aggregate_stream_to_last_known_tests.cs
Aggregation/live_aggregation_without_an_aggregate_identifier.cs Projections/aggregateto_linq_operator_tests.cs
Aggregation/explicit_code_for_aggregation_logic.cs, Projections/using_explicit_code_for_live_aggregation.cs
Aggregation/when_finding_the_last_good_aggregation.cs

Scope

New LiveAggregationCompliance suite:

  1. AggregateStreamAsync<T> over a full stream, a version-bounded slice, and a timestamp-bounded slice
  2. Null result when the stream does not exist, and when the fold legitimately produces null (a "deleted" aggregate)
  3. AggregateStreamToLastKnownAsync skipping a trailing event the aggregate cannot apply, where AggregateStreamAsync would fail — this is the whole point of the method and both stores test it separately today
  4. Aggregation with no identity member on the aggregate type
  5. Explicit Apply/Create conventions vs source-generated EvolveAsync producing the same result (the EvolveAsync half is already covered by SelfAggregatingEvolveCompliance — assert the equivalence, don't re-test evolve)
  6. Guid and string stream identity

Acceptance

  • Suite enrolled in both stores; SupportsLiveAggregationRegistration used only where a store genuinely rejects explicit registration
  • 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