feat: add eventual consistency monitor pattern#460
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 a new Eventual Consistency Monitor pattern to PatternKit, including a fluent runtime API for tracking source/target watermarks and convergence, plus a source generator and a DI-importable example demonstrating projection convergence.
Changes:
- Introduces
EventualConsistencyMonitor<TKey>(runtime API), status/evaluation/state models, and TinyBDD unit coverage. - Adds
GenerateEventualConsistencyMonitorAttribute+ incremental generator to emit configured monitor factories. - Extends examples, docs, pattern catalogs, and benchmark coverage matrices to include the new pattern and demo.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/PatternKit.Core/Application/EventualConsistency/EventualConsistencyMonitor.cs | Adds the runtime monitor API (watermarks, evaluations, state) and core record/evaluate logic. |
| src/PatternKit.Generators.Abstractions/EventualConsistency/EventualConsistencyMonitorAttributes.cs | Introduces the generator attribute contract (defaults + configuration surface). |
| src/PatternKit.Generators/EventualConsistency/EventualConsistencyMonitorGenerator.cs | Implements the Roslyn incremental generator emitting configured factory methods + diagnostics. |
| src/PatternKit.Examples/EventualConsistencyDemo/OrderProjectionConsistencyDemo.cs | Adds fluent + generated demo plus DI registration for a projection convergence scenario. |
| src/PatternKit.Examples/DependencyInjection/PatternKitExampleServiceCollectionExtensions.cs | Registers the new example into the “importable examples” DI surface. |
| src/PatternKit.Examples/ProductionReadiness/PatternKitExampleCatalog.cs | Adds the eventual consistency demo entry to the example catalog metadata. |
| src/PatternKit.Examples/ProductionReadiness/PatternKitPatternCatalog.cs | Adds the new pattern to the pattern catalog (docs/code/tests/generator/example links). |
| benchmarks/PatternKit.Benchmarks/Application/EventualConsistencyMonitorBenchmarks.cs | Adds construction/execution benchmarks (fluent + generated) for coverage matrix enforcement. |
| test/PatternKit.Tests/Application/EventualConsistency/EventualConsistencyMonitorTests.cs | Adds runtime TinyBDD tests for lagging/converged/missing/unknown/config validation. |
| test/PatternKit.Generators.Tests/EventualConsistencyMonitorGeneratorTests.cs | Adds generator tests covering output shape, nesting, escaping, and diagnostics. |
| test/PatternKit.Generators.Tests/AbstractionsTests.cs | Adds attribute contract tests for the new generator attribute. |
| test/PatternKit.Examples.Tests/EventualConsistencyDemo/OrderProjectionConsistencyDemoTests.cs | Adds end-to-end example tests (fluent vs generated + DI import path). |
| test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitPatternCatalogTests.cs | Updates production-readiness pattern counts and expected catalog names. |
| test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitBenchmarkCoverageTests.cs | Updates benchmark matrix expectations (route totals + name humanization). |
| docs/patterns/application/eventual-consistency-monitor.md | Documents the new runtime pattern. |
| docs/generators/eventual-consistency-monitor.md | Documents the generator usage and diagnostics. |
| docs/generators/index.md | Adds the generator to the generator catalog table. |
| docs/examples/order-projection-eventual-consistency-monitor.md | Documents the DI-importable example. |
| docs/examples/index.md | Adds the new example to the examples index. |
| docs/guides/pattern-coverage.md | Updates the pattern coverage catalog to include the new pattern. |
| docs/guides/benchmarks.md | Adds benchmark matrix rows for the new pattern. |
| docs/guides/benchmark-results.md | Adds benchmark results matrix rows and pattern coverage mapping. |
| docs/index.md | Updates published pattern counts/listing to include the new pattern. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (sourceWatermark < 0) | ||
| throw new ArgumentOutOfRangeException(nameof(sourceWatermark)); | ||
| if (targetWatermark < 0) | ||
| throw new ArgumentOutOfRangeException(nameof(targetWatermark)); |
Test Results 12 files 12 suites 10m 55s ⏱️ Results for commit 0faa072. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #460 +/- ##
==========================================
+ Coverage 96.68% 96.83% +0.15%
==========================================
Files 575 579 +4
Lines 46821 47147 +326
Branches 3071 6757 +3686
==========================================
+ Hits 45267 45656 +389
+ Misses 1554 1491 -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:
|
Code Coverage |
🔍 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 #453
Adds the Eventual Consistency Monitor pattern with source/target watermark tracking, generated factory support, DI-importable order projection convergence example, TinyBDD coverage, docs, catalogs, and benchmark matrix entries.