feat: add snapshot checkpoint management pattern#459
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
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
SnapshotCheckpointManagerwith builder, load/save/remove APIs, stale-write policy, and state snapshot. - New incremental generator (
PKSCP001/PKSCP002diagnostics) plus abstractions attribute for compile-time factories. - New
OrderReplaySnapshotCheckpointDemoexample 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.
Code Coverage |
Codecov Report❌ Patch coverage is 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Test Results 12 files 12 suites 10m 38s ⏱️ Results for commit dea5231. |
🔍 PR Validation ResultsVersion: `` ✅ Validation Steps
📊 ArtifactsDry-run artifacts have been uploaded and will be available for 7 days. This comment was automatically generated by the PR validation workflow. |
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.