Skip to content

Annotate operations / sessions / EventGraph for AOT (slice 6)#85

Merged
jeremydmiller merged 1 commit into
mainfrom
feature/aot-operations-sessions
May 13, 2026
Merged

Annotate operations / sessions / EventGraph for AOT (slice 6)#85
jeremydmiller merged 1 commit into
mainfrom
feature/aot-operations-sessions

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Summary

Sixth slice in Polecat's AOT-pillar (jasperfx#213) cleanup, following the Patching slice (#79).

The session + event-operations layer threads document and event types through ISerializer (ToJson/FromJson), the JasperFx.Events event-registry infrastructure (Event<T>.MakeGenericType + aggregator-source factories), and JasperFx natural-key reflection. Document and event types are preserved by registration on the caller side (Schema.For<T>() / StoreOptions.Events.AddEventType / projection registration) per the AOT publishing guide. AOT consumers supply a source-generator-backed ISerializer impl.

Applied class-level [UnconditionalSuppressMessage]:

File Codes
Events/EventOperations IL2026/IL2090/IL3050 (serializer + JasperFx.Events generic factories + FindNaturalKeyDefinition<T> property reflection)
Internal/QuerySession (all partials) IL2026/IL3050 (load/query through ISerializer.FromJson)
Internal/DocumentSessionBase IL2026/IL3050 (store/update/delete through ISerializer.ToJson + inline projection runners)
AdvancedOperations IL2026/IL3050 (BulkInsertAsync / BulkInsertWithVersionAsync via ISerializer.ToJson)
Events/EventGraph IL2026/IL2057/IL3050 (EventRegistry extension, dynamic aggregate-type resolution by .NET type name as a fallback, Type.MakeGenericType for aggregator-source factories)
Events/EventGraph.PolecatEventType IL3050 (Wrap uses Event<T>.MakeGenericType for envelope construction)

Warning delta

`Polecat.csproj` IL warnings on this branch: 194 → 88 (-106 cumulative with #79's -42; this slice alone -64).

Test plan

  • `dotnet build src/Polecat/Polecat.csproj -c Debug` — 0 errors
  • `dotnet build src/Polecat.Tests/Polecat.Tests.csproj -c Debug` — 0 errors
  • CI passes

Stacks on #79 (Patching slice).

Sixth slice in Polecat's AOT-pillar (jasperfx#213) cleanup, following the
Patching slice (#79).

The session + event-operations layer threads document and event types
through ISerializer (ToJson/FromJson), the JasperFx.Events event-registry
infrastructure (Event<T>.MakeGenericType + aggregator-source factories),
and JasperFx natural-key reflection. Document and event types are
preserved by registration on the caller side (Schema.For<T>() /
StoreOptions.Events.AddEventType / projection registration) per the AOT
publishing guide. AOT consumers supply a source-generator-backed
ISerializer impl.

Apply class-level [UnconditionalSuppressMessage] with justifications:

- Events/EventOperations: IL2026/IL2090/IL3050 (serializer + JasperFx.Events
  generic factories + FindNaturalKeyDefinition<T> property reflection)
- Internal/QuerySession (all partials): IL2026/IL3050 (load/query through
  ISerializer.FromJson)
- Internal/DocumentSessionBase: IL2026/IL3050 (store/update/delete through
  ISerializer.ToJson + inline projection runners)
- AdvancedOperations: IL2026/IL3050 (BulkInsertAsync /
  BulkInsertWithVersionAsync via ISerializer.ToJson)
- Events/EventGraph: IL2026/IL2057/IL3050 (EventRegistry extension, dynamic
  aggregate-type resolution by .NET type name as a fallback,
  Type.MakeGenericType for aggregator-source factories)
- Events/EventGraph.PolecatEventType: IL3050 (Wrap uses
  Event<T>.MakeGenericType for envelope construction)

194 → 88 unique IL warnings on this branch (-106 cumulative with #79's
-42; this slice alone accounts for -64).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jeremydmiller jeremydmiller merged commit 98cf445 into main May 13, 2026
6 checks passed
jeremydmiller added a commit that referenced this pull request May 13, 2026
Final slice in Polecat's AOT-pillar (jasperfx#213) cleanup, following the
Patching slice (#79) and Operations/Sessions slice (#85). Annotates the
remaining reflective surfaces across projection storage, batching, result
readers, the LINQ parser pipeline, IoC service-collection extensions, and
flat-table projection helpers.

Apply class-level [UnconditionalSuppressMessage] with justifications:

Serializer consumers (IL2026 + IL3050):
- Projections/PolecatProjectionStorage
- Internal/Batching/QueryBatchItem (QueryListBatchItem + QueryFirstOrDefaultBatchItem)
- Internal/Batching/LoadBatchQueryItem
- Internal/Batching/LoadManyBatchQueryItem
- Internal/AdvancedSqlResultReader (JsonReader + DocumentReader)
- Events/Internal/PcEventsRowReader
- Events/Linq/EventListHandler
- Events/Daemon/PolecatEventLoader
- Linq/QueryHandlers/GroupByListHandler
- Events/Protected/StreamCompacting.StreamCompactingRequest<T>

JasperFx.Events projection registration (IL2026 + IL3050):
- Projections/PolecatProjectionOptions
- Projections/PolecatCompositeProjection

Expression.Lambda / Type.MakeGenericType (IL3050 only):
- Projections/Flattened/StatementMap<TEvent>
- Projections/Flattened/EventDeleter<TEvent>
- Linq/Parsing/WhereClauseParser
- Linq/Parsing/LinqQueryParser
- Linq/Parsing/GroupBySelectBuilder
- Linq/Joins/JoinResultSelectorRewriter
- Events/Operations/EventWhereClauseParser

IoC type-argument flow:
- PolecatStoreServiceCollectionExtensions: IL2091 (M.E.DI registration of T)
- PolecatConfigurationExpression: IL2087 (fluent generic flow)

194 → 106 unique IL warnings on this branch (-88). Combined with the open
slice 5 (#79, -42) and slice 6 (#85, -64), Polecat.csproj will be at or
near 0 IL warnings once all three merge.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jeremydmiller jeremydmiller deleted the feature/aot-operations-sessions branch May 14, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant