diff --git a/Benchmarks/Governance/Approval/ApprovalRequestCreationBenchmarks.cs b/Benchmarks/Governance/Approval/ApprovalRequestCreationBenchmarks.cs
new file mode 100644
index 0000000..5311921
--- /dev/null
+++ b/Benchmarks/Governance/Approval/ApprovalRequestCreationBenchmarks.cs
@@ -0,0 +1,35 @@
+using BenchmarkDotNet.Attributes;
+using ModularityKit.Mutator.Governance.Abstractions.Requests.Model;
+using ModularityKit.Mutator.Benchmarks.Governance.Approval.Support;
+
+namespace ModularityKit.Mutator.Benchmarks.Governance.Approval;
+
+///
+/// Benchmarks approval request creation and assignment overhead.
+///
+[BenchmarkCategory("Governance")]
+[MemoryDiagnoser]
+[InProcess]
+public class ApprovalRequestCreationBenchmarks : ApprovalWorkflowBenchmarkBase
+{
+ ///
+ /// Measures approval request creation and single approval assignment.
+ ///
+ [Benchmark(Baseline = true)]
+ public MutationRequest PendingApproval_SingleRequest()
+ => ApprovalWorkflowBenchmarkSupport.CreatePendingApprovalRequest(RequestId);
+
+ ///
+ /// Measures approval request creation with two approval steps.
+ ///
+ [Benchmark]
+ public MutationRequest PendingApproval_TwoStepRequest()
+ => ApprovalWorkflowBenchmarkSupport.CreateTwoStepApprovalRequest(RequestId);
+
+ ///
+ /// Measures approval request creation driven by role metadata.
+ ///
+ [Benchmark]
+ public MutationRequest PendingApproval_RoleBasedRequest()
+ => ApprovalWorkflowBenchmarkSupport.CreateRoleBasedApprovalRequest(RequestId);
+}
diff --git a/Benchmarks/Governance/Approval/ApprovalWorkflowDecisionBenchmarks.cs b/Benchmarks/Governance/Approval/ApprovalWorkflowDecisionBenchmarks.cs
new file mode 100644
index 0000000..cc03f44
--- /dev/null
+++ b/Benchmarks/Governance/Approval/ApprovalWorkflowDecisionBenchmarks.cs
@@ -0,0 +1,88 @@
+using BenchmarkDotNet.Attributes;
+using ModularityKit.Mutator.Abstractions.Context;
+using ModularityKit.Mutator.Governance.Abstractions.Approval.Model;
+using ModularityKit.Mutator.Governance.Abstractions.Requests.Model;
+using ModularityKit.Mutator.Benchmarks.Governance.Approval.Support;
+
+namespace ModularityKit.Mutator.Benchmarks.Governance.Approval;
+
+///
+/// Benchmarks approval decision paths in the governance runtime.
+///
+[BenchmarkCategory("Governance")]
+[MemoryDiagnoser]
+[InProcess]
+public class ApprovalWorkflowDecisionBenchmarks : ApprovalWorkflowBenchmarkBase
+{
+ ///
+ /// Measures single approval requirement being approved and the request being finalized.
+ ///
+ [Benchmark(Baseline = true)]
+ public async Task ApproveRequirement_Granted()
+ {
+ var (manager, request) = CreateSingleApprovalWorkflow();
+ var approvalId = request.ApprovalRequirements[0].ApprovalId;
+
+ return await manager.ApproveRequirement(
+ request.RequestId,
+ approvalId,
+ ApprovalWorkflowBenchmarkSupport.CreateDecisionContext("alice", "Approve governance benchmark request"))
+ .ConfigureAwait(false);
+ }
+
+ ///
+ /// Measures the first approval in two step approval workflow before the request can finalize.
+ ///
+ [Benchmark]
+ public async Task ApproveRequirement_FirstStepPending()
+ {
+ var (manager, request) = CreateTwoStepApprovalWorkflow();
+ var approvalId = request.ApprovalRequirements[0].ApprovalId;
+
+ return await manager.ApproveRequirement(
+ request.RequestId,
+ approvalId,
+ ApprovalWorkflowBenchmarkSupport.CreateDecisionContext("alice", "Approve first step in benchmark workflow"))
+ .ConfigureAwait(false);
+ }
+
+ ///
+ /// Measures the second approval in two step approval workflow that finalizes the request.
+ ///
+ [Benchmark]
+ public async Task ApproveRequirement_FinalizeAfterSecondStep()
+ {
+ var (manager, request) = CreateTwoStepApprovalWorkflow();
+ var firstApprovalId = request.ApprovalRequirements[0].ApprovalId;
+ var secondApprovalId = request.ApprovalRequirements[1].ApprovalId;
+
+ var firstApproved = await manager.ApproveRequirement(
+ request.RequestId,
+ firstApprovalId,
+ ApprovalWorkflowBenchmarkSupport.CreateDecisionContext("alice", "Approve first benchmark step"))
+ .ConfigureAwait(false);
+
+ return await manager.ApproveRequirement(
+ firstApproved.RequestId,
+ secondApprovalId,
+ ApprovalWorkflowBenchmarkSupport.CreateDecisionContext("bob", "Approve second benchmark step"))
+ .ConfigureAwait(false);
+ }
+
+ ///
+ /// Measures single approval requirement being rejected and the request being terminated.
+ ///
+ [Benchmark]
+ public async Task RejectRequirement_Rejected()
+ {
+ var (manager, request) = CreateSingleApprovalWorkflow();
+ var approvalId = request.ApprovalRequirements[0].ApprovalId;
+
+ return await manager.RejectRequirement(
+ request.RequestId,
+ approvalId,
+ ApprovalWorkflowBenchmarkSupport.CreateDecisionContext("alice", "Reject governance benchmark request"),
+ rejection: ApprovalWorkflowBenchmarkSupport.CreateRejectionReason())
+ .ConfigureAwait(false);
+ }
+}
diff --git a/Benchmarks/Governance/Approval/ApprovalWorkflowExpirationBenchmarks.cs b/Benchmarks/Governance/Approval/ApprovalWorkflowExpirationBenchmarks.cs
new file mode 100644
index 0000000..ffa9832
--- /dev/null
+++ b/Benchmarks/Governance/Approval/ApprovalWorkflowExpirationBenchmarks.cs
@@ -0,0 +1,29 @@
+using BenchmarkDotNet.Attributes;
+using ModularityKit.Mutator.Abstractions.Context;
+using ModularityKit.Mutator.Governance.Abstractions.Requests.Model;
+using ModularityKit.Mutator.Benchmarks.Governance.Approval.Support;
+
+namespace ModularityKit.Mutator.Benchmarks.Governance.Approval;
+
+///
+/// Benchmarks expiration handling for pending governance approvals.
+///
+[BenchmarkCategory("Governance")]
+[MemoryDiagnoser]
+[InProcess]
+public class ApprovalWorkflowExpirationBenchmarks : ApprovalWorkflowBenchmarkBase
+{
+ ///
+ /// Measures expiration of pending approval request and the resulting rejection bookkeeping.
+ ///
+ [Benchmark(Baseline = true)]
+ public async Task> ExpirePendingApprovals_Sweep()
+ {
+ var (manager, _) = CreateExpiredWorkflow();
+
+ return await manager.ExpirePendingApprovals(
+ DateTimeOffset.UtcNow,
+ MutationContext.Service("approval-sweeper", "Expire pending governance approvals"))
+ .ConfigureAwait(false);
+ }
+}
diff --git a/Benchmarks/Governance/Approval/Support/ApprovalWorkflowBenchmarkBase.cs b/Benchmarks/Governance/Approval/Support/ApprovalWorkflowBenchmarkBase.cs
new file mode 100644
index 0000000..2111339
--- /dev/null
+++ b/Benchmarks/Governance/Approval/Support/ApprovalWorkflowBenchmarkBase.cs
@@ -0,0 +1,47 @@
+using ModularityKit.Mutator.Governance.Abstractions.Approval.Contracts;
+using ModularityKit.Mutator.Governance.Abstractions.Requests.Model;
+using ModularityKit.Mutator.Governance.Runtime.Approval.Execution;
+using ModularityKit.Mutator.Governance.Runtime.Storage;
+
+namespace ModularityKit.Mutator.Benchmarks.Governance.Approval.Support;
+
+///
+/// Shared setup helpers for governance approval workflow benchmarks.
+///
+public abstract class ApprovalWorkflowBenchmarkBase
+{
+ protected const string RequestId = "governance-approval-request";
+
+ protected static (IMutationRequestApprovalWorkflowManager Manager, MutationRequest Request) CreateSingleApprovalWorkflow()
+ {
+ var store = new InMemoryMutationRequestStore();
+ var manager = new MutationRequestApprovalWorkflowManager(store);
+ var request = store.Create(ApprovalWorkflowBenchmarkSupport.CreatePendingApprovalRequest(RequestId))
+ .GetAwaiter()
+ .GetResult();
+
+ return (manager, request);
+ }
+
+ protected static (IMutationRequestApprovalWorkflowManager Manager, MutationRequest Request) CreateTwoStepApprovalWorkflow()
+ {
+ var store = new InMemoryMutationRequestStore();
+ var manager = new MutationRequestApprovalWorkflowManager(store);
+ var request = store.Create(ApprovalWorkflowBenchmarkSupport.CreateTwoStepApprovalRequest(RequestId))
+ .GetAwaiter()
+ .GetResult();
+
+ return (manager, request);
+ }
+
+ protected static (IMutationRequestApprovalWorkflowManager Manager, MutationRequest Request) CreateExpiredWorkflow()
+ {
+ var store = new InMemoryMutationRequestStore();
+ var manager = new MutationRequestApprovalWorkflowManager(store);
+ var request = store.Create(ApprovalWorkflowBenchmarkSupport.CreateExpiredApprovalRequest(RequestId))
+ .GetAwaiter()
+ .GetResult();
+
+ return (manager, request);
+ }
+}
diff --git a/Benchmarks/Governance/Approval/Support/ApprovalWorkflowBenchmarkSupport.cs b/Benchmarks/Governance/Approval/Support/ApprovalWorkflowBenchmarkSupport.cs
new file mode 100644
index 0000000..3c8068d
--- /dev/null
+++ b/Benchmarks/Governance/Approval/Support/ApprovalWorkflowBenchmarkSupport.cs
@@ -0,0 +1,140 @@
+using ModularityKit.Mutator.Abstractions.Context;
+using ModularityKit.Mutator.Abstractions.Intent;
+using ModularityKit.Mutator.Abstractions.Policies;
+using ModularityKit.Mutator.Governance.Abstractions.Approval.Model;
+using ModularityKit.Mutator.Governance.Abstractions.Requests.Factory;
+using ModularityKit.Mutator.Governance.Abstractions.Requests.Model;
+
+namespace ModularityKit.Mutator.Benchmarks.Governance.Approval.Support;
+
+///
+/// Builds repeatable approval workflow benchmark fixtures.
+///
+internal static class ApprovalWorkflowBenchmarkSupport
+{
+ ///
+ /// Creates a pending approval request with one approval requirement.
+ ///
+ public static MutationRequest CreatePendingApprovalRequest(
+ string requestId,
+ DateTimeOffset? expiresAt = null)
+ => MutationRequestFactory.PendingApproval(
+ stateId: "governance-benchmark:approval",
+ stateType: "GovernanceState",
+ mutationType: "ApproveGovernanceMutation",
+ intent: CreateIntent(),
+ context: MutationContext.User("requester", "Requester", "Need approval"),
+ requirements:
+ [
+ PolicyRequirement.Approval("alice", "Manager approval")
+ ],
+ expectedStateVersion: "v10",
+ expiresAt: expiresAt)
+ with
+ {
+ RequestId = requestId
+ };
+
+ ///
+ /// Creates a pending approval request with two sequential approval requirements.
+ ///
+ public static MutationRequest CreateTwoStepApprovalRequest(string requestId)
+ => MutationRequestFactory.PendingApproval(
+ stateId: "governance-benchmark:approval",
+ stateType: "GovernanceState",
+ mutationType: "ApproveGovernanceMutation",
+ intent: CreateIntent(),
+ context: MutationContext.User("requester", "Requester", "Need approval"),
+ requirements:
+ [
+ PolicyRequirement.Approval("alice", "Manager approval"),
+ PolicyRequirement.Approval("bob", "Security approval")
+ ],
+ expectedStateVersion: "v10")
+ with
+ {
+ RequestId = requestId
+ };
+
+ ///
+ /// Creates a request that already has an expired approval requirement.
+ ///
+ public static MutationRequest CreateExpiredApprovalRequest(string requestId)
+ => CreatePendingApprovalRequest(
+ requestId,
+ DateTimeOffset.UtcNow.AddMinutes(-5));
+
+ ///
+ /// Creates a pending approval request driven by role metadata.
+ ///
+ public static MutationRequest CreateRoleBasedApprovalRequest(string requestId)
+ => MutationRequestFactory.PendingApproval(
+ stateId: "governance-benchmark:approval-role",
+ stateType: "GovernanceState",
+ mutationType: "ApproveGovernanceMutation",
+ intent: CreateIntent(),
+ context: MutationContext.User("requester", "Requester", "Need role-based approval"),
+ requirements:
+ [
+ new PolicyRequirement
+ {
+ Type = "Approval",
+ Description = "Role approval",
+ Data = new
+ {
+ ApproverRole = "security-approver",
+ StepOrder = 1,
+ Reason = "Role-based sign-off"
+ }
+ }
+ ],
+ expectedStateVersion: "v10")
+ with
+ {
+ RequestId = requestId
+ };
+
+ ///
+ /// Creates the intent used by approval workflow benchmark scenarios.
+ ///
+ public static MutationIntent CreateIntent()
+ => new()
+ {
+ OperationName = "ApproveGovernanceChange",
+ Category = "Governance",
+ Description = "Approve governance request in benchmark workflow"
+ };
+
+ ///
+ /// Creates a user context used for benchmark approval decisions.
+ ///
+ public static MutationContext CreateDecisionContext(string actorId, string reason)
+ => MutationContext.User(actorId, actorId, reason);
+
+ ///
+ /// Creates structured rejection payload for benchmark scenarios.
+ ///
+ public static MutationApprovalRejectionReason CreateRejectionReason()
+ => new()
+ {
+ Code = "benchmark-rejection",
+ Category = "policy",
+ Message = "Benchmark rejection path"
+ };
+
+ ///
+ /// Creates a mutation context that carries approval roles for role-based resolution.
+ ///
+ public static MutationContext CreateRoleDecisionContext(
+ string actorId,
+ string actorName,
+ string reason,
+ params string[] roles)
+ => MutationContext.User(actorId, actorName, reason) with
+ {
+ Metadata = new Dictionary
+ {
+ ["ActorRoles"] = roles
+ }
+ };
+}
diff --git a/Benchmarks/Governance/Lifecycle/RequestLifecycleExpirationBenchmarks.cs b/Benchmarks/Governance/Lifecycle/RequestLifecycleExpirationBenchmarks.cs
new file mode 100644
index 0000000..cfdda35
--- /dev/null
+++ b/Benchmarks/Governance/Lifecycle/RequestLifecycleExpirationBenchmarks.cs
@@ -0,0 +1,28 @@
+using BenchmarkDotNet.Attributes;
+using ModularityKit.Mutator.Governance.Abstractions.Requests.Model;
+using ModularityKit.Mutator.Benchmarks.Governance.Lifecycle.Support;
+
+namespace ModularityKit.Mutator.Benchmarks.Governance.Lifecycle;
+
+///
+/// Benchmarks expiration sweeps for governed requests.
+///
+[BenchmarkCategory("Governance")]
+[MemoryDiagnoser]
+[InProcess]
+public class RequestLifecycleExpirationBenchmarks : RequestLifecycleBenchmarkBase
+{
+ ///
+ /// Measures expiration of due requests in the pending lifecycle.
+ ///
+ [Benchmark(Baseline = true)]
+ public async Task> ExpireDueRequests_Sweep()
+ {
+ var manager = CreateExpirationWorkflow();
+
+ return await manager.ExpireDueRequests(
+ DateTimeOffset.UtcNow,
+ RequestLifecycleBenchmarkSupport.CreateSweepContext())
+ .ConfigureAwait(false);
+ }
+}
diff --git a/Benchmarks/Governance/Lifecycle/RequestLifecycleTransitionBenchmarks.cs b/Benchmarks/Governance/Lifecycle/RequestLifecycleTransitionBenchmarks.cs
new file mode 100644
index 0000000..a1aadb4
--- /dev/null
+++ b/Benchmarks/Governance/Lifecycle/RequestLifecycleTransitionBenchmarks.cs
@@ -0,0 +1,58 @@
+using BenchmarkDotNet.Attributes;
+using ModularityKit.Mutator.Abstractions.Context;
+using ModularityKit.Mutator.Governance.Abstractions.Lifecycle.Model;
+using ModularityKit.Mutator.Governance.Abstractions.Requests.Model;
+using ModularityKit.Mutator.Benchmarks.Governance.Lifecycle.Support;
+
+namespace ModularityKit.Mutator.Benchmarks.Governance.Lifecycle;
+
+///
+/// Benchmarks lifecycle transitions on governed requests.
+///
+[BenchmarkCategory("Governance")]
+[MemoryDiagnoser]
+[InProcess]
+public class RequestLifecycleTransitionBenchmarks : RequestLifecycleBenchmarkBase
+{
+ ///
+ /// Measures a pending request being approved through the lifecycle manager.
+ ///
+ [Benchmark(Baseline = true)]
+ public async Task Approve_PendingRequest()
+ {
+ var (manager, request) = CreatePendingWorkflow();
+
+ return await manager.Approve(
+ request.RequestId,
+ RequestLifecycleBenchmarkSupport.CreateDecisionContext("approver", "Approver", "Approve lifecycle request"))
+ .ConfigureAwait(false);
+ }
+
+ ///
+ /// Measures a pending request being rejected through the lifecycle manager.
+ ///
+ [Benchmark]
+ public async Task Reject_PendingRequest()
+ {
+ var (manager, request) = CreatePendingWorkflow();
+
+ return await manager.Reject(
+ request.RequestId,
+ RequestLifecycleBenchmarkSupport.CreateDecisionContext("reviewer", "Reviewer", "Reject lifecycle request"))
+ .ConfigureAwait(false);
+ }
+
+ ///
+ /// Measures a pending request being cancelled through the lifecycle manager.
+ ///
+ [Benchmark]
+ public async Task Cancel_PendingRequest()
+ {
+ var (manager, request) = CreatePendingWorkflow();
+
+ return await manager.Cancel(
+ request.RequestId,
+ RequestLifecycleBenchmarkSupport.CreateDecisionContext("operator", "Operator", "Cancel lifecycle request"))
+ .ConfigureAwait(false);
+ }
+}
diff --git a/Benchmarks/Governance/Lifecycle/RequestSubmissionBenchmarks.cs b/Benchmarks/Governance/Lifecycle/RequestSubmissionBenchmarks.cs
new file mode 100644
index 0000000..7658e96
--- /dev/null
+++ b/Benchmarks/Governance/Lifecycle/RequestSubmissionBenchmarks.cs
@@ -0,0 +1,25 @@
+using BenchmarkDotNet.Attributes;
+using ModularityKit.Mutator.Governance.Abstractions.Requests.Model;
+using ModularityKit.Mutator.Benchmarks.Governance.Lifecycle.Support;
+
+namespace ModularityKit.Mutator.Benchmarks.Governance.Lifecycle;
+
+///
+/// Benchmarks submission of governed requests into the pending lifecycle.
+///
+[BenchmarkCategory("Governance")]
+[MemoryDiagnoser]
+[InProcess]
+public class RequestSubmissionBenchmarks : RequestLifecycleBenchmarkBase
+{
+ ///
+ /// Measures a pending governed request being submitted and stored.
+ ///
+ [Benchmark(Baseline = true)]
+ public async Task Submit_PendingRequest()
+ {
+ var (manager, request) = CreateSubmissionWorkflow();
+
+ return await manager.Submit(request).ConfigureAwait(false);
+ }
+}
diff --git a/Benchmarks/Governance/Lifecycle/Support/RequestLifecycleBenchmarkBase.cs b/Benchmarks/Governance/Lifecycle/Support/RequestLifecycleBenchmarkBase.cs
new file mode 100644
index 0000000..8588330
--- /dev/null
+++ b/Benchmarks/Governance/Lifecycle/Support/RequestLifecycleBenchmarkBase.cs
@@ -0,0 +1,60 @@
+using ModularityKit.Mutator.Governance.Abstractions.Lifecycle.Contracts;
+using ModularityKit.Mutator.Governance.Abstractions.Requests.Model;
+using ModularityKit.Mutator.Governance.Runtime.Lifecycle.Execution;
+using ModularityKit.Mutator.Governance.Runtime.Storage;
+
+namespace ModularityKit.Mutator.Benchmarks.Governance.Lifecycle.Support;
+
+///
+/// Shared setup helpers for governance request lifecycle benchmarks.
+///
+public abstract class RequestLifecycleBenchmarkBase
+{
+ protected const string RequestId = "governance-lifecycle-request";
+
+ protected static (IMutationRequestLifecycleManager Manager, MutationRequest Request) CreateSubmissionWorkflow()
+ {
+ var store = new InMemoryMutationRequestStore();
+ var manager = new MutationRequestLifecycleManager(store);
+ var request = RequestLifecycleBenchmarkSupport.CreatePendingRequest(RequestId);
+
+ return (manager, request);
+ }
+
+ protected static (IMutationRequestLifecycleManager Manager, MutationRequest Request) CreatePendingWorkflow()
+ {
+ var store = new InMemoryMutationRequestStore();
+ var manager = new MutationRequestLifecycleManager(store);
+ var request = store.Create(RequestLifecycleBenchmarkSupport.CreatePendingRequest(RequestId))
+ .GetAwaiter()
+ .GetResult();
+
+ return (manager, request);
+ }
+
+ protected static (IMutationRequestLifecycleManager Manager, MutationRequest Request) CreateApprovedWorkflow()
+ {
+ var store = new InMemoryMutationRequestStore();
+ var manager = new MutationRequestLifecycleManager(store);
+ var request = store.Create(RequestLifecycleBenchmarkSupport.CreateApprovedRequest(RequestId))
+ .GetAwaiter()
+ .GetResult();
+
+ return (manager, request);
+ }
+
+ protected static IMutationRequestLifecycleManager CreateExpirationWorkflow()
+ {
+ var store = new InMemoryMutationRequestStore();
+ var manager = new MutationRequestLifecycleManager(store);
+
+ store.Create(RequestLifecycleBenchmarkSupport.CreateExpiredRequest($"{RequestId}-expired"))
+ .GetAwaiter()
+ .GetResult();
+ store.Create(RequestLifecycleBenchmarkSupport.CreatePendingRequest($"{RequestId}-active"))
+ .GetAwaiter()
+ .GetResult();
+
+ return manager;
+ }
+}
diff --git a/Benchmarks/Governance/Lifecycle/Support/RequestLifecycleBenchmarkSupport.cs b/Benchmarks/Governance/Lifecycle/Support/RequestLifecycleBenchmarkSupport.cs
new file mode 100644
index 0000000..1230754
--- /dev/null
+++ b/Benchmarks/Governance/Lifecycle/Support/RequestLifecycleBenchmarkSupport.cs
@@ -0,0 +1,83 @@
+using ModularityKit.Mutator.Abstractions.Context;
+using ModularityKit.Mutator.Abstractions.Intent;
+using ModularityKit.Mutator.Governance.Abstractions.Lifecycle.Model;
+using ModularityKit.Mutator.Governance.Abstractions.Requests.Factory;
+using ModularityKit.Mutator.Governance.Abstractions.Requests.Model;
+
+namespace ModularityKit.Mutator.Benchmarks.Governance.Lifecycle.Support;
+
+///
+/// Builds repeatable request lifecycle benchmark fixtures.
+///
+internal static class RequestLifecycleBenchmarkSupport
+{
+ ///
+ /// Creates a pending request used for lifecycle submission and terminal transition benchmarks.
+ ///
+ public static MutationRequest CreatePendingRequest(
+ string requestId,
+ DateTimeOffset? expiresAt = null)
+ => MutationRequestFactory.Pending(
+ stateId: "governance-benchmark:lifecycle",
+ stateType: "GovernanceState",
+ mutationType: "ManageGovernanceMutation",
+ intent: CreateIntent(),
+ context: MutationContext.User("requester", "Requester", "Need lifecycle processing"),
+ pendingReason: PendingMutationReason.Approval,
+ expectedStateVersion: "v12",
+ expiresAt: expiresAt)
+ with
+ {
+ RequestId = requestId
+ };
+
+ ///
+ /// Creates a pending request that is already due for expiration sweeps.
+ ///
+ public static MutationRequest CreateExpiredRequest(string requestId)
+ => CreatePendingRequest(
+ requestId,
+ DateTimeOffset.UtcNow.AddMinutes(-5));
+
+ ///
+ /// Creates an approved request used to exercise the lifecycle manager approval path.
+ ///
+ public static MutationRequest CreateApprovedRequest(string requestId)
+ => MutationRequestFactory.Approved(
+ stateId: "governance-benchmark:lifecycle",
+ stateType: "GovernanceState",
+ mutationType: "ManageGovernanceMutation",
+ intent: CreateIntent(),
+ context: MutationContext.User("requester", "Requester", "Need lifecycle processing"),
+ expectedStateVersion: "v12")
+ with
+ {
+ RequestId = requestId
+ };
+
+ ///
+ /// Creates the intent used by request lifecycle benchmark scenarios.
+ ///
+ public static MutationIntent CreateIntent()
+ => new()
+ {
+ OperationName = "ManageGovernanceRequest",
+ Category = "Governance",
+ Description = "Manage governance request lifecycle in benchmark"
+ };
+
+ ///
+ /// Creates a decision context used for lifecycle transitions.
+ ///
+ public static MutationContext CreateDecisionContext(
+ string actorId,
+ string actorName,
+ string reason)
+ => MutationContext.User(actorId, actorName, reason);
+
+ ///
+ /// Creates a sweep context used for expiration benchmarks.
+ ///
+ public static MutationContext CreateSweepContext()
+ => MutationContext.Service("lifecycle-sweeper", "Expire pending governance requests");
+}
diff --git a/Benchmarks/ModularityKit.Mutator.Benchmarks.csproj b/Benchmarks/ModularityKit.Mutator.Benchmarks.csproj
index 1383676..efc3865 100644
--- a/Benchmarks/ModularityKit.Mutator.Benchmarks.csproj
+++ b/Benchmarks/ModularityKit.Mutator.Benchmarks.csproj
@@ -10,6 +10,7 @@
+
diff --git a/Benchmarks/README.md b/Benchmarks/README.md
index bcb39c4..aea25e4 100644
--- a/Benchmarks/README.md
+++ b/Benchmarks/README.md
@@ -14,6 +14,8 @@ This folder contains BenchmarkDotNet measurements for `ModularityKit.Mutator`.
- interception, audit/history, and logging diagnostics overhead in the core runtime
- parallel execution, state gate contention, and concurrent batch scheduling pressure in the core runtime
- mutation result creation and history/audit output materialization in the core runtime
+- governance approval workflow overhead in the governance runtime
+- governance request lifecycle overhead in the governance runtime
The throughput benchmarks use cloned array backed state so state size effects remain visible in the
actual mutation path rather than being hidden behind an artificial inner loop.
@@ -63,6 +65,12 @@ Run the results suite:
dotnet Benchmarks/bin/Release/net10.0/ModularityKit.Mutator.Benchmarks.dll --anyCategories Results
```
+Run the governance suite:
+
+```bash
+dotnet Benchmarks/bin/Release/net10.0/ModularityKit.Mutator.Benchmarks.dll --anyCategories Governance
+```
+
Key parameters reported by BenchmarkDotNet:
- `StateSize` controls the size of the cloned mutation state