Skip to content

feat: add snapshot checkpoint management pattern#459

Merged
JerrettDavis merged 1 commit into
mainfrom
feat/snapshot-checkpoint-management-452
May 30, 2026
Merged

feat: add snapshot checkpoint management pattern#459
JerrettDavis merged 1 commit into
mainfrom
feat/snapshot-checkpoint-management-452

Conversation

@JerrettDavis

Copy link
Copy Markdown
Owner

Closes #452

Adds the Snapshot / Checkpoint Management pattern with fluent runtime APIs, source-generated factory support, DI-importable order replay example, TinyBDD coverage, docs, catalogs, and benchmark matrix entries.

Copilot AI review requested due to automatic review settings May 30, 2026 19:02
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the Snapshot / Checkpoint Management pattern with a fluent SnapshotCheckpointManager<TKey, TSnapshot>, a Roslyn source generator that emits factories from [GenerateSnapshotCheckpointManager]-annotated partial hosts, an order replay demo wired through IServiceCollection, TinyBDD coverage, docs/catalog entries, and benchmark matrix rows.

Changes:

  • New core type SnapshotCheckpointManager with builder, load/save/remove APIs, stale-write policy, and state snapshot.
  • New incremental generator (PKSCP001/PKSCP002 diagnostics) plus abstractions attribute for compile-time factories.
  • New OrderReplaySnapshotCheckpointDemo example with DI extension, plus catalogs/docs/benchmarks updated to track the 113th pattern.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/PatternKit.Core/Application/SnapshotCheckpoints/SnapshotCheckpointManager.cs Fluent checkpoint manager, results, state, and policy enums.
src/PatternKit.Generators.Abstractions/SnapshotCheckpoints/SnapshotCheckpointAttributes.cs New GenerateSnapshotCheckpointManagerAttribute.
src/PatternKit.Generators/SnapshotCheckpoints/SnapshotCheckpointManagerGenerator.cs Incremental generator emitting partial host factory.
src/PatternKit.Generators/AnalyzerReleases.Unshipped.md Registers PKSCP001/PKSCP002 diagnostics.
src/PatternKit.Examples/SnapshotCheckpointDemo/OrderReplaySnapshotCheckpointDemo.cs Demo events/snapshot, service, policies, DI extension, generated host.
src/PatternKit.Examples/ProductionReadiness/PatternKitPatternCatalog.cs Adds Snapshot / Checkpoint Management catalog entry.
src/PatternKit.Examples/ProductionReadiness/PatternKitExampleCatalog.cs Adds the order replay example descriptor.
src/PatternKit.Examples/DependencyInjection/PatternKitExampleServiceCollectionExtensions.cs Wires up AddOrderReplaySnapshotCheckpointPatternExample.
test/PatternKit.Tests/Application/SnapshotCheckpoints/SnapshotCheckpointManagerTests.cs Core fluent manager scenarios.
test/PatternKit.Generators.Tests/SnapshotCheckpointManagerGeneratorTests.cs Generator success/failure scenarios.
test/PatternKit.Generators.Tests/AbstractionsTests.cs Attribute constructor/usage assertions.
test/PatternKit.Examples.Tests/SnapshotCheckpointDemo/OrderReplaySnapshotCheckpointDemoTests.cs Demo BDD coverage including DI.
test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitPatternCatalogTests.cs Adds catalog count + name expectation.
test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitBenchmarkCoverageTests.cs Updates totals and pattern-name humanizer.
README.md / docs/index.md / docs/guides/* / docs/patterns/* / docs/generators/* / docs/examples/* New docs pages, TOC entries, and updated counts.
benchmarks/PatternKit.Benchmarks/Application/SnapshotCheckpointManagementBenchmarks.cs BenchmarkDotNet construction/execution rows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Summary
  Generated on: 05/30/2026 - 19:09:07
  Coverage date: 05/30/2026 - 19:07:02 - 05/30/2026 - 19:08:56
  Parser: MultiReport (12x Cobertura)
  Assemblies: 5
  Classes: 1702
  Files: 575
  Line coverage: 96.6%
  Covered lines: 45265
  Uncovered lines: 1556
  Coverable lines: 46821
  Total lines: 100117
  Branch coverage: 82.3% (14100 of 17117)
  Covered branches: 14100
  Total branches: 17117
  Method coverage: 96.7% (8847 of 9144)
  Full method coverage: 90.4% (8274 of 9144)
  Covered methods: 8847
  Fully covered methods: 8274
  Total methods: 9144

PatternKit.Core                                                                                                     95.6%
  PatternKit.Application.ActivityTracking.ActivityGateState                                                          100%
  PatternKit.Application.ActivityTracking.ActivityLease                                                              100%
  PatternKit.Application.ActivityTracking.ActivityRecord                                                             100%
  PatternKit.Application.ActivityTracking.ActivityTracker                                                            100%
  PatternKit.Application.Aggregates.AggregateCommandHandler<T1, T2, T3>                                              100%
  PatternKit.Application.Aggregates.AggregateCommandResult<T>                                                        100%
  PatternKit.Application.Aggregates.AggregateRoot<T1, T2>                                                            100%
  PatternKit.Application.AntiCorruption.AntiCorruptionLayer<T1, T2>                                                 90.4%
  PatternKit.Application.AntiCorruption.AntiCorruptionResult<T>                                                      100%
  PatternKit.Application.AuditLog.AuditLogAppendResult<T>                                                           85.7%
  PatternKit.Application.AuditLog.InMemoryAuditLog<T1, T2>                                                          95.4%
  PatternKit.Application.BoundedContexts.BoundedContextAdapter                                                       100%
  PatternKit.Application.BoundedContexts.BoundedContextCapability                                                   83.3%
  PatternKit.Application.BoundedContexts.BoundedContextDescriptor                                                   95.4%
  PatternKit.Application.ContextMaps.ContextMapDescriptor                                                           96.8%
  PatternKit.Application.ContextMaps.ContextMapRelationship                                                          100%
  PatternKit.Application.DataMapping.DataMapper<T1, T2>                                                             94.6%
  PatternKit.Application.DataMapping.DataMapperError                                                                  90%
  PatternKit.Application.DataMapping.DataMapperResult<T>                                                            84.6%
  PatternKit.Application.DomainEvents.DomainEventDispatcher<T>                                                      95.4%
  PatternKit.Application.DomainEvents.DomainEventDispatchResult                                                      100%
  PatternKit.Application.DomainServices.DomainServiceOperation<T1, T2>                                               100%
  PatternKit.Application.DomainServices.DomainServiceRegistry<T1, T2>                                                100%
  PatternKit.Application.EventSourcing.EventStoreAppendResult                                                        100%
  PatternKit.Application.EventSourcing.InMemoryEventStore<T1, T2>                                                   97.9%
  PatternKit.Application.EventSourcing.StoredEvent<T1, T2>                                                            80%
  PatternKit.Application.FeatureToggles.FeatureToggleDecision                                                       87.5%
  PatternKit.Application.FeatureToggles.FeatureToggleRule<T>                                                         100%
  PatternKit.Application.FeatureToggles.FeatureToggleSet<T>                                                         96.9%
  PatternKit.Application.IdentityMap.IdentityMap<T1, T2>                                                             100%
  PatternKit.Application.IdentityMap.IdentityMapResult<T>                                                           92.8%
  PatternKit.Application.ManualTaskGates.ManualTaskGate<T>                                                          98.5%
  PatternKit.Application.ManualTaskGates.ManualTaskGateState<T>                                                      100%
  PatternKit.Application.ManualTaskGates.ManualTaskRecord<T>                                                        96.9%
  PatternKit.Application.MaterializedViews.MaterializedView<T1, T2>                                                 98.4%
  PatternKit.Application.Repository.InMemoryRepository<T1, T2>                                                      92.8%
  PatternKit.Application.Repository.RepositoryResult<T>                                                             93.3%
  PatternKit.Application.ServiceLayer.ServiceLayerOperation<T1, T2>                                                 96.7%

@codecov

codecov Bot commented May 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.53695% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.83%. Comparing base (a5bfa66) to head (dea5231).

Files with missing lines Patch % Lines
...tCheckpoints/SnapshotCheckpointManagerGenerator.cs 96.49% 4 Missing ⚠️
...n/SnapshotCheckpoints/SnapshotCheckpointManager.cs 97.94% 3 Missing ⚠️
...heckpointDemo/OrderReplaySnapshotCheckpointDemo.cs 97.22% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #459      +/-   ##
==========================================
+ Coverage   96.67%   96.83%   +0.16%     
==========================================
  Files         571      575       +4     
  Lines       46417    46821     +404     
  Branches     3044     6170    +3126     
==========================================
+ Hits        44873    45340     +467     
+ Misses       1544     1481      -63     
Flag Coverage Δ
unittests 96.83% <97.53%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

    12 files      12 suites   10m 38s ⏱️
 3 927 tests  3 927 ✅ 0 💤 0 ❌
12 212 runs  12 212 ✅ 0 💤 0 ❌

Results for commit dea5231.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 PR Validation Results

Version: ``

✅ Validation Steps

  • Build solution
  • Run tests
  • Build documentation
  • Dry-run NuGet packaging

📊 Artifacts

Dry-run artifacts have been uploaded and will be available for 7 days.


This comment was automatically generated by the PR validation workflow.

@JerrettDavis JerrettDavis merged commit f88facf into main May 30, 2026
13 checks passed
@JerrettDavis JerrettDavis deleted the feat/snapshot-checkpoint-management-452 branch May 30, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Snapshot / Checkpoint Management pattern

2 participants