Skip to content

feat: add context map pattern slice#411

Merged
JerrettDavis merged 1 commit into
mainfrom
feat/domain-modeling-context-map
May 28, 2026
Merged

feat: add context map pattern slice#411
JerrettDavis merged 1 commit into
mainfrom
feat/domain-modeling-context-map

Conversation

@JerrettDavis

Copy link
Copy Markdown
Owner

Adds the next domain modeling slice for #403: Context Map.

Includes:

  • fluent ContextMapDescriptor relationship APIs
  • GenerateContextMapDescriptor source generator path
  • IServiceCollection-importable commerce context map example
  • TinyBDD runtime, generator, example, and catalog coverage
  • BenchmarkDotNet scenario and benchmark result docs
  • README/docs/catalog/toc updates

Local validation:

  • dotnet test test\PatternKit.Tests\PatternKit.Tests.csproj --configuration Release --filter "FullyQualifiedName~ContextMaps"
  • dotnet test test\PatternKit.Generators.Tests\PatternKit.Generators.Tests.csproj --configuration Release --filter "FullyQualifiedNameContextMapDescriptorGeneratorTests|FullyQualifiedNameAbstractionsAttributeCoverageTests"
  • dotnet test test\PatternKit.Examples.Tests\PatternKit.Examples.Tests.csproj --configuration Release --filter "FullyQualifiedNameContextMapDemo|FullyQualifiedNameProductionReadiness"
  • dotnet build benchmarks\PatternKit.Benchmarks\PatternKit.Benchmarks.csproj --configuration Release -m:1
  • dotnet format PatternKit.slnx --verify-no-changes --verbosity minimal
  • dotnet build PatternKit.slnx --configuration Release --no-restore -m:1
  • dotnet test PatternKit.slnx --configuration Release --no-build -p:TestTfmsInParallel=false
  • docfx docs\docfx.json --warningsAsErrors

Copilot AI review requested due to automatic review settings May 28, 2026 23:13
@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 Context Map domain modeling slice to PatternKit, covering runtime fluent APIs, source generation, examples, docs, tests, catalog entries, and benchmark coverage for issue #403.

Changes:

  • Introduces ContextMapDescriptor, relationships, and generator attributes/source generator.
  • Adds commerce Context Map examples with DI registration and TinyBDD coverage.
  • Updates pattern catalogs, documentation tables/TOCs, and benchmark coverage/result docs.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/PatternKit.Core/Application/ContextMaps/ContextMap.cs Adds runtime Context Map descriptor and relationship model.
src/PatternKit.Generators.Abstractions/ContextMaps/ContextMapAttributes.cs Adds generator-facing Context Map attributes and enum.
src/PatternKit.Generators/ContextMaps/ContextMapDescriptorGenerator.cs Generates Context Map descriptor factories from attributes.
src/PatternKit.Generators/AnalyzerReleases.Unshipped.md Registers new generator diagnostics.
src/PatternKit.Examples/ContextMapDemo/CommerceContextMapDemo.cs Adds fluent, generated, and DI commerce Context Map example.
src/PatternKit.Examples/DependencyInjection/PatternKitExampleServiceCollectionExtensions.cs Registers the Context Map example in aggregate DI setup.
src/PatternKit.Examples/ProductionReadiness/PatternKitPatternCatalog.cs Adds Context Map to the production pattern catalog.
src/PatternKit.Examples/ProductionReadiness/PatternKitExampleCatalog.cs Adds the commerce Context Map example descriptor.
benchmarks/PatternKit.Benchmarks/Application/ContextMapBenchmarks.cs Adds Context Map construction and execution benchmarks.
test/PatternKit.Tests/Application/ContextMaps/ContextMapTests.cs Covers fluent Context Map behavior and validation.
test/PatternKit.Generators.Tests/ContextMapDescriptorGeneratorTests.cs Covers Context Map generator output and diagnostics.
test/PatternKit.Generators.Tests/AbstractionsAttributeCoverageTests.cs Adds attribute target/default/validation coverage.
test/PatternKit.Examples.Tests/ContextMapDemo/CommerceContextMapDemoTests.cs Covers generated/fluent parity and DI importability.
test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitPatternCatalogTests.cs Updates catalog count/name assertions.
test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitBenchmarkCoverageTests.cs Updates benchmark route total assertion.
README.md Updates pattern counts and benchmark table rows.
docs/index.md Updates published pattern counts and table.
docs/patterns/toc.yml Adds Context Map pattern TOC entry.
docs/patterns/application/context-map.md Documents runtime and generated Context Map usage.
docs/generators/toc.yml Adds Context Map generator TOC entry.
docs/generators/context-map.md Documents generator usage and diagnostics.
docs/examples/toc.yml Adds commerce Context Map example TOC entry.
docs/examples/commerce-context-map-pattern.md Documents the commerce Context Map example.
docs/guides/pattern-coverage.md Adds Context Map to coverage guide.
docs/guides/benchmarks.md Adds Context Map benchmark rows.
docs/guides/benchmark-results.md Updates benchmark result matrix and totals.

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

5 => "OpenHostService",
6 => "PublishedLanguage",
7 => "SeparateWays",
_ => "SeparateWays"
.AddCommerceContextMapDemo();

using var provider = services.BuildServiceProvider();
var summary = provider.GetRequiredService<CommerceContextMapReporter>().Summarize();
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

    12 files      12 suites   6m 51s ⏱️
 3 595 tests  3 595 ✅ 0 💤 0 ❌
10 796 runs  10 796 ✅ 0 💤 0 ❌

Results for commit a8d5f4b.

@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.

@codecov

codecov Bot commented May 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.58333% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.69%. Comparing base (71aa512) to head (a8d5f4b).

Files with missing lines Patch % Lines
...ators/ContextMaps/ContextMapDescriptorGenerator.cs 93.70% 8 Missing ⚠️
....Examples/ContextMapDemo/CommerceContextMapDemo.cs 78.94% 4 Missing ⚠️
...ternKit.Core/Application/ContextMaps/ContextMap.cs 97.91% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #411      +/-   ##
==========================================
+ Coverage   89.62%   95.69%   +6.06%     
==========================================
  Files         547      551       +4     
  Lines       43943    44183     +240     
  Branches     6333     6357      +24     
==========================================
+ Hits        39386    42282    +2896     
+ Misses       2039     1901     -138     
+ Partials     2518        0    -2518     
Flag Coverage Δ
unittests 95.69% <94.58%> (+6.06%) ⬆️

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

Code Coverage

Summary
  Generated on: 05/28/2026 - 23:20:57
  Coverage date: 05/28/2026 - 23:18:34 - 05/28/2026 - 23:20:45
  Parser: MultiReport (12x Cobertura)
  Assemblies: 5
  Classes: 1663
  Files: 675
  Line coverage: 94.7%
  Covered lines: 43341
  Uncovered lines: 2419
  Coverable lines: 45760
  Total lines: 99621
  Branch coverage: 75.5% (12671 of 16773)
  Covered branches: 12671
  Total branches: 16773
  Method coverage: 96% (8689 of 9044)
  Full method coverage: 88.2% (7983 of 9044)
  Covered methods: 8689
  Fully covered methods: 7983
  Total methods: 9044

PatternKit.Core                                                                                                     95.4%
  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.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%
  PatternKit.Application.ServiceLayer.ServiceLayerResult<T>                                                         94.7%
  PatternKit.Application.ServiceLayer.ServiceLayerRule<T>                                                            100%
  PatternKit.Application.Specification.Specification<T>                                                              100%

@JerrettDavis JerrettDavis merged commit 7812e9f into main May 28, 2026
13 checks passed
@JerrettDavis JerrettDavis deleted the feat/domain-modeling-context-map branch May 28, 2026 23:26
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.

2 participants