Skip to content

feat: add Manual Task Gate pattern#455

Merged
JerrettDavis merged 1 commit into
mainfrom
feat/manual-task-gate-448
May 30, 2026
Merged

feat: add Manual Task Gate pattern#455
JerrettDavis merged 1 commit into
mainfrom
feat/manual-task-gate-448

Conversation

@JerrettDavis

Copy link
Copy Markdown
Owner

Summary

  • adds the Manual Task Gate application architecture pattern for human approvals and manual workflow pauses
  • adds fluent and source-generated factory paths, order approval demo, IServiceCollection integration, docs, catalog coverage, and benchmark entries
  • adds TinyBDD coverage for runtime behavior, generator diagnostics/output, abstractions, examples, DI, and production-readiness audits

Closes #448

Verification

  • dotnet test test\PatternKit.Tests\PatternKit.Tests.csproj --configuration Release --no-restore --filter "FullyQualifiedName~ManualTaskGateTests" -p:TestTfmsInParallel=false --logger "console;verbosity=minimal"
  • dotnet test test\PatternKit.Generators.Tests\PatternKit.Generators.Tests.csproj --configuration Release --no-restore --filter "FullyQualifiedNameManualTaskGateGeneratorTests|FullyQualifiedNameAbstractionsTests" -p:TestTfmsInParallel=false --logger "console;verbosity=minimal"
  • dotnet test test\PatternKit.Examples.Tests\PatternKit.Examples.Tests.csproj --configuration Release --no-restore --filter "FullyQualifiedNameManualTaskGateDemo|FullyQualifiedNameProductionReadiness|FullyQualifiedName~DependencyInjection" -p:TestTfmsInParallel=false --logger "console;verbosity=minimal"
  • dotnet format PatternKit.slnx --verify-no-changes --verbosity minimal
  • dotnet build PatternKit.slnx --configuration Release --no-restore
  • dotnet test PatternKit.slnx --configuration Release --no-build -p:TestTfmsInParallel=false --logger "console;verbosity=minimal"

@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 Manual Task Gate application architecture pattern for tracking human-owned tasks (approve/reject/cancel/complete) that block workflows. The implementation closely mirrors the existing TimeoutManager<TKey> and ActivityTracker patterns and integrates fully across runtime, generator, examples, DI, docs, catalogs, and benchmarks.

Changes:

  • New ManualTaskGate<TKey> runtime with Pending/Approved/Rejected/Canceled states, lock-protected dictionary storage, builder with WithClock/WithKeyComparer, and GetGateState/Snapshot ordering.
  • New ManualTaskGateGenerator (PKMTG001/PKMTG002) and [GenerateManualTaskGate] abstraction attribute mirroring TimeoutManagerGenerator.
  • Order approval example, DI extension, aggregate registration, catalog entries, docs/TOCs, benchmark class, and TinyBDD coverage; pattern count bumped 107→108 (Application Architecture 22→23) with benchmark route totals updated to 432.

Reviewed changes

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

Show a summary per file
File Description
src/PatternKit.Core/Application/ManualTaskGates/ManualTaskGate.cs New runtime gate, record, state, and builder
src/PatternKit.Generators/ManualTaskGates/ManualTaskGateGenerator.cs New incremental generator for typed factories
src/PatternKit.Generators/AnalyzerReleases.Unshipped.md Registers PKMTG001/PKMTG002
src/PatternKit.Generators.Abstractions/ManualTaskGates/ManualTaskGateAttributes.cs New [GenerateManualTaskGate] attribute
src/PatternKit.Examples/ManualTaskGateDemo/OrderApprovalManualTaskGateDemo.cs Fluent/generated/service/runner/DI demo
src/PatternKit.Examples/DependencyInjection/PatternKitExampleServiceCollectionExtensions.cs Aggregate example registration
src/PatternKit.Examples/ProductionReadiness/PatternKitPatternCatalog.cs Adds catalog entry
src/PatternKit.Examples/ProductionReadiness/PatternKitExampleCatalog.cs Adds example descriptor
benchmarks/PatternKit.Benchmarks/Application/ManualTaskGateBenchmarks.cs Scenario benchmark class
test/PatternKit.Tests/Application/ManualTaskGates/ManualTaskGateTests.cs Runtime TinyBDD coverage
test/PatternKit.Generators.Tests/ManualTaskGateGeneratorTests.cs Generator TinyBDD coverage
test/PatternKit.Generators.Tests/AbstractionsTests.cs Attribute reflection tests
test/PatternKit.Examples.Tests/ManualTaskGateDemo/OrderApprovalManualTaskGateDemoTests.cs Example + DI integration tests
test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitPatternCatalogTests.cs Family count 22→23 + new pattern
test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitBenchmarkCoverageTests.cs Updates published route total to 432
README.md, docs/index.md, docs/guides/pattern-coverage.md, docs/guides/benchmarks.md, docs/guides/benchmark-results.md Pattern count/category and benchmark matrix updates
docs/patterns/toc.yml, docs/patterns/application/manual-task-gate.md Pattern docs + TOC
docs/generators/toc.yml, docs/generators/index.md, docs/generators/manual-task-gate.md Generator docs + TOC
docs/examples/toc.yml, docs/examples/order-approval-manual-task-gate.md Example docs + TOC

💡 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   8m 27s ⏱️
 3 857 tests  3 857 ✅ 0 💤 0 ❌
12 002 runs  12 002 ✅ 0 💤 0 ❌

Results for commit 6c414c3.

@codecov

codecov Bot commented May 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.84173% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.79%. Comparing base (aa7f909) to head (6c414c3).

Files with missing lines Patch % Lines
...erators/ManualTaskGates/ManualTaskGateGenerator.cs 95.91% 4 Missing ⚠️
...Core/Application/ManualTaskGates/ManualTaskGate.cs 98.31% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #455      +/-   ##
==========================================
+ Coverage   96.62%   96.79%   +0.16%     
==========================================
  Files         555      559       +4     
  Lines       45224    45502     +278     
  Branches     2980     6555    +3575     
==========================================
+ Hits        43697    44042     +345     
+ Misses       1527     1460      -67     
Flag Coverage Δ
unittests 96.79% <97.84%> (+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

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

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Summary
  Generated on: 05/30/2026 - 12:53:27
  Coverage date: 05/30/2026 - 12:50:53 - 05/30/2026 - 12:53:15
  Parser: MultiReport (12x Cobertura)
  Assemblies: 5
  Classes: 1640
  Files: 559
  Line coverage: 96.6%
  Covered lines: 43964
  Uncovered lines: 1538
  Coverable lines: 45502
  Total lines: 97751
  Branch coverage: 82.2% (13741 of 16703)
  Covered branches: 13741
  Total branches: 16703
  Method coverage: 96.6% (8558 of 8851)
  Full method coverage: 90.2% (7992 of 8851)
  Covered methods: 8558
  Fully covered methods: 7992
  Total methods: 8851

PatternKit.Core                                                                                                     95.5%
  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%

@JerrettDavis JerrettDavis merged commit 760e26a into main May 30, 2026
13 checks passed
@JerrettDavis JerrettDavis deleted the feat/manual-task-gate-448 branch May 30, 2026 12:58
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 Human Approval / Manual Task Gate pattern

2 participants