Skip to content

feat: add bounded context pattern slice#410

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

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

Conversation

@JerrettDavis

Copy link
Copy Markdown
Owner

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

Includes:

  • fluent BoundedContextDescriptor capability/adapter APIs
  • GenerateBoundedContextDescriptor source generator path
  • IServiceCollection-importable fulfillment 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~BoundedContexts"
  • dotnet test test\PatternKit.Generators.Tests\PatternKit.Generators.Tests.csproj --configuration Release --filter "FullyQualifiedNameBoundedContextDescriptorGeneratorTests|FullyQualifiedNameAbstractionsAttributeCoverageTests"
  • dotnet test test\PatternKit.Examples.Tests\PatternKit.Examples.Tests.csproj --configuration Release --filter "FullyQualifiedNameBoundedContextDemo|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 22:10
@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 a new Domain Modeling “slice” for the DDD Bounded Context pattern, spanning runtime APIs, a source generator, an importable DI example, tests, docs, and benchmark coverage to meet the production-readiness catalog requirements tied to #403.

Changes:

  • Introduces BoundedContextDescriptor runtime API (capabilities + adapters) plus fluent builder validation/ordering.
  • Adds BoundedContextDescriptorGenerator + abstractions attributes + Roslyn tests/diagnostics entries.
  • Integrates a Fulfillment bounded-context example into DI, catalog coverage, docs, and BenchmarkDotNet scenario/docs count updates.

Reviewed changes

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

Show a summary per file
File Description
test/PatternKit.Tests/Application/BoundedContexts/BoundedContextTests.cs Adds TinyBDD coverage for fluent bounded context descriptor behavior and validation.
test/PatternKit.Generators.Tests/BoundedContextDescriptorGeneratorTests.cs Adds generator tests for successful generation and expected diagnostics.
test/PatternKit.Generators.Tests/AbstractionsAttributeCoverageTests.cs Extends attribute coverage suite for new bounded context generator attributes.
test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitPatternCatalogTests.cs Updates catalog expectations to include “Bounded Context” and family counts.
test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitBenchmarkCoverageTests.cs Updates expected published benchmark route result totals.
test/PatternKit.Examples.Tests/BoundedContextDemo/FulfillmentBoundedContextDemoTests.cs Adds example tests for fluent vs generated descriptors and DI importability.
src/PatternKit.Generators/BoundedContexts/BoundedContextDescriptorGenerator.cs Implements incremental generator emitting BoundedContextDescriptor factories + diagnostics.
src/PatternKit.Generators/AnalyzerReleases.Unshipped.md Registers new generator diagnostic IDs in analyzer release notes.
src/PatternKit.Generators.Abstractions/BoundedContexts/BoundedContextAttributes.cs Introduces generator-facing attributes for bounded context descriptor generation.
src/PatternKit.Examples/ProductionReadiness/PatternKitPatternCatalog.cs Adds bounded context entry to the production-readiness pattern catalog.
src/PatternKit.Examples/ProductionReadiness/PatternKitExampleCatalog.cs Adds the Fulfillment bounded context example descriptor to the example catalog.
src/PatternKit.Examples/DependencyInjection/PatternKitExampleServiceCollectionExtensions.cs Wires the bounded context pattern example into the repo-wide DI registration surface.
src/PatternKit.Examples/BoundedContextDemo/FulfillmentBoundedContextDemo.cs Adds fluent + generated descriptor demo, DI registration, and generator host type.
src/PatternKit.Core/Application/BoundedContexts/BoundedContext.cs Adds runtime bounded context capability/adapter models and fluent descriptor builder.
README.md Updates pattern counts/table and adds benchmark rows for bounded context (pending measurements).
docs/patterns/toc.yml Adds bounded context to the patterns TOC.
docs/patterns/application/bounded-context.md Adds bounded context pattern documentation with fluent and generator examples.
docs/index.md Updates published pattern count/table to include bounded context.
docs/guides/pattern-coverage.md Adds bounded context to the pattern coverage guide table.
docs/guides/benchmarks.md Adds bounded context benchmark rows (pending measurements).
docs/guides/benchmark-results.md Updates coverage matrix totals and includes bounded context in matrices and generator list.
docs/generators/toc.yml Adds bounded context generator page to generators TOC.
docs/generators/bounded-context.md Adds generator documentation and diagnostics list for bounded context generator.
docs/examples/toc.yml Adds fulfillment bounded context example page to examples TOC.
docs/examples/fulfillment-bounded-context-pattern.md Adds example documentation for DI and usage.
benchmarks/PatternKit.Benchmarks/Application/BoundedContextBenchmarks.cs Adds BenchmarkDotNet scenario covering fluent and generated construction/execution routes.

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

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

    12 files      12 suites   9m 1s ⏱️
 3 583 tests  3 583 ✅ 0 💤 0 ❌
10 760 runs  10 760 ✅ 0 💤 0 ❌

Results for commit 175a64e.

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Summary
  Generated on: 05/28/2026 - 22:18:10
  Coverage date: 05/28/2026 - 22:15:50 - 05/28/2026 - 22:17:59
  Parser: MultiReport (12x Cobertura)
  Assemblies: 5
  Classes: 1655
  Files: 670
  Line coverage: 94.7%
  Covered lines: 43111
  Uncovered lines: 2405
  Coverable lines: 45516
  Total lines: 99170
  Branch coverage: 75.5% (12625 of 16708)
  Covered branches: 12625
  Total branches: 16708
  Method coverage: 96% (8643 of 8994)
  Full method coverage: 88.2% (7941 of 8994)
  Covered methods: 8643
  Fully covered methods: 7941
  Total methods: 8994

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.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%
  PatternKit.Application.Specification.SpecificationRegistry<T>                                                     93.3%
  PatternKit.Application.TableDataGateway.InMemoryTableDataGateway<T1, T2>                                            86%

@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 98.60140% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.70%. Comparing base (a4fe01f) to head (175a64e).

Files with missing lines Patch % Lines
...Core/Application/BoundedContexts/BoundedContext.cs 95.31% 3 Missing ⚠️
...undedContexts/BoundedContextDescriptorGenerator.cs 99.34% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #410      +/-   ##
==========================================
+ Coverage   89.63%   95.70%   +6.07%     
==========================================
  Files         543      547       +4     
  Lines       43657    43943     +286     
  Branches     6297     6333      +36     
==========================================
+ Hits        39131    42056    +2925     
+ Misses       2034     1887     -147     
+ Partials     2492        0    -2492     
Flag Coverage Δ
unittests 95.70% <98.60%> (+6.07%) ⬆️

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.

@JerrettDavis JerrettDavis merged commit 71aa512 into main May 28, 2026
13 checks passed
@JerrettDavis JerrettDavis deleted the feat/domain-modeling-bounded-context branch May 28, 2026 22:23
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