Skip to content

Commit 7f5021a

Browse files
committed
feat(mutators): initial implementation of full mutation engine framework
- Added core mutation engine (`MutationEngine`) with: - Single and batch mutation execution (`ExecuteAsync`, `ExecuteBatchAsync`) - Policy evaluation and enforcement - Audit logging and history storage - Metrics collection (scoped and aggregated) - Interceptor pipeline for before/after/failure events - Implemented supporting components: - `MutationExecutor` for low-level mutation execution - `PolicyRegistry` for thread-safe policy management - `MetricsCollectorImpl` and `MetricsScope` for in-memory metric tracking - Logging interceptors: `LoggingInterceptor`, `MutationHistoryLogger`, `MutationResultLogger` - Added DI integration via `MutatorsServiceCollectionExtensions.AddMutators`: - Registers engine, executor, registry, auditor, history store, metrics collector - Optional default console logging interceptor - Supports engine options (`MutationEngineOptions`) and scoped configuration - Included example usage and documentation: - Quick start, core concepts, best practices - API reference, metrics & logging, ADR references - Exception handling improvements: - `MutationException` constructors made public
1 parent c16d7ad commit 7f5021a

7 files changed

Lines changed: 855 additions & 2 deletions

File tree

ModularityKit.Mutator/Abstractions/Exceptions/MutationException.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class MutationException : Exception
2929
/// Initializes a new instance of <see cref="MutationException"/> with a specified message.
3030
/// </summary>
3131
/// <param name="message">Human-readable description of the error.</param>
32-
protected MutationException(string message)
32+
public MutationException(string message)
3333
: base(message)
3434
{
3535
}
@@ -40,7 +40,7 @@ protected MutationException(string message)
4040
/// </summary>
4141
/// <param name="message">Human-readable description of the error.</param>
4242
/// <param name="innerException">The underlying exception that triggered this error.</param>
43-
protected MutationException(string message, Exception innerException)
43+
public MutationException(string message, Exception innerException)
4444
: base(message, innerException)
4545
{
4646
}

ModularityKit.Mutator/ModularityKit.Mutator.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
88

9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.2" />
11+
</ItemGroup>
12+
913
</Project>

0 commit comments

Comments
 (0)