Annotate Patching subsystem for AOT (slice 5)#79
Merged
Conversation
Fifth slice in Polecat's AOT-pillar (jasperfx#213) cleanup, following the Serializer (#74), ProjectionReplay (#75), LINQ (#76), and Storage/Registry (#77) slices that have landed on main. The patching subsystem reflects on the document's property expressions to build JSON path strings and feeds the resulting patch values through ISerializer.ToJson when emitting JSON_MODIFY() SQL. JsonPathHelper also compiles small Expression.Lambda delegates to evaluate constant sub- expressions during path resolution. Document types T flow in from Schema.For<T>() / IDocumentSession.Patch<T>() at the registration boundary and are preserved per the AOT publishing guide; AOT consumers supply a source-generator-backed ISerializer impl. Apply class-level [UnconditionalSuppressMessage] with justifications: - Patching/PatchExpression<T>: IL2026/IL3050 (ISerializer.ToJson on patch values) - Patching/PatchOperation: IL2026/IL3050 (ISerializer.ToJson when building JSON_MODIFY commands) - Patching/JsonPathHelper: IL3050 (Expression.Lambda for constant sub-expression evaluation) 194 → 152 unique IL warnings (-42) in Polecat.csproj. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 13, 2026
jeremydmiller
added a commit
that referenced
this pull request
May 13, 2026
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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fifth slice in Polecat's AOT-pillar (jasperfx#213) cleanup, following the Serializer (#74), ProjectionReplay (#75), LINQ (#76), and Storage/Registry (#77) slices already on main.
The patching subsystem reflects on the document's property expressions to build JSON path strings and feeds the resulting patch values through
ISerializer.ToJsonwhen emittingJSON_MODIFY()SQL.JsonPathHelperalso compiles smallExpression.Lambdadelegates to evaluate constant sub-expressions during path resolution. Document typesTflow in fromSchema.For<T>()/IDocumentSession.Patch<T>()at the registration boundary and are preserved per the AOT publishing guide; AOT consumers supply a source-generator-backedISerializerimpl.Applied class-level
[UnconditionalSuppressMessage]:Patching/PatchExpression<T>ISerializer.ToJsonon patch values)Patching/PatchOperationISerializer.ToJsonwhen buildingJSON_MODIFYcommands)Patching/JsonPathHelperExpression.Lambdafor constant sub-expression evaluation)Warning delta
Polecat.csprojIL warnings: 194 → 152 (-42).Test plan
dotnet build src/Polecat/Polecat.csproj -c Debug— 0 errors, -42 IL warningsdotnet build src/Polecat.Tests/Polecat.Tests.csproj -c Debug— 0 errors