This folder contains runnable console apps that show how to use ModularityKit.Mutator in concrete domain flows.
The examples are split into two groups:
Core/for direct mutation engine usageGovernance/for request lifecycle and governance runtime behavior
The projects are intentionally small and focused. Each one demonstrates a different style of mutation workflow, policy enforcement, and engine usage without requiring you to read the whole library first.
| Example | Focus | Readme |
|---|---|---|
BillingQuotas |
quota changes, validation, and policy limits | Examples/Core/BillingQuotas/README.md |
FeatureFlags |
feature toggles, audit/history, and batch execution | Examples/Core/FeatureFlags/README.md |
IamRoles |
role changes, approval rules, and batch migration | Examples/Core/IamRoles/README.md |
WorkflowApprovals |
ordered workflow state transitions and approvals | Examples/Core/WorkflowApprovals/README.md |
| Example | Focus | Readme |
|---|---|---|
RequestLifecycle |
pending requests, lifecycle transitions, expiration, and cancellation | Examples/Governance/RequestLifecycle/README.md |
GovernedExecution |
approved request -> resolution -> execution -> executed decision | Examples/Governance/GovernedExecution/README.md |
DecisionTaxonomy |
lifecycle, approval, and version-resolution decision categories | Examples/Governance/DecisionTaxonomy/README.md |
ApprovalWorkflow |
request-level approvals, multi-step sign-off, and governed approval actions | Examples/Governance/ApprovalWorkflow/README.md |
VersionedResolution |
stale request handling and expected state version semantics | Examples/Governance/VersionedResolution/README.md |
Start with the project-specific README for the domain you care about. Each one explains:
- the domain model used in the sample
- the mutation types and policies involved
- the main scenarios the app runs
- the key files to inspect first
Then open Program.cs in that example. That is the entry point that wires up the engine, registers policies, and runs the scenarios.
Build the full solution from the repository root:
dotnet build ModularityKit.Mutator.slnx -c ReleaseYou can also build just one example:
dotnet build Examples/Core/BillingQuotas/BillingQuotas.csproj -c Release
dotnet build Examples/Core/FeatureFlags/FeatureFlags.csproj -c Release
dotnet build Examples/Core/IamRoles/IamRoles.csproj -c Release
dotnet build Examples/Core/WorkflowApprovals/WorkflowApprovals.csproj -c Release
dotnet build Examples/Governance/RequestLifecycle/RequestLifecycle.csproj -c Release
dotnet build Examples/Governance/GovernedExecution/GovernedExecution.csproj -c Release
dotnet build Examples/Governance/DecisionTaxonomy/DecisionTaxonomy.csproj -c Release
dotnet build Examples/Governance/ApprovalWorkflow/ApprovalWorkflow.csproj -c Release
dotnet build Examples/Governance/VersionedResolution/VersionedResolution.csproj -c ReleaseEach example is a separate console app.
From the repository root:
dotnet run --project Examples/Core/BillingQuotas/BillingQuotas.csproj
dotnet run --project Examples/Core/FeatureFlags/FeatureFlags.csproj
dotnet run --project Examples/Core/IamRoles/IamRoles.csproj
dotnet run --project Examples/Core/WorkflowApprovals/WorkflowApprovals.csproj
dotnet run --project Examples/Governance/RequestLifecycle/RequestLifecycle.csproj
dotnet run --project Examples/Governance/GovernedExecution/GovernedExecution.csproj
dotnet run --project Examples/Governance/DecisionTaxonomy/DecisionTaxonomy.csproj
dotnet run --project Examples/Governance/ApprovalWorkflow/ApprovalWorkflow.csproj
dotnet run --project Examples/Governance/VersionedResolution/VersionedResolution.csprojIf you want to run one sample repeatedly while changing code, stay in its folder:
cd Examples/Core/BillingQuotas
dotnet run- Open the project README for the example you care about.
- Read
Program.csto see how the engine is composed. - Inspect the
State/types to understand the domain model. - Read the
Mutations/files to see how changes are applied. - Read the
Policies/files to see what is allowed or blocked. - Read the
Scenarios/files to see how everything is exercised together.
Most examples follow the same layout:
Program.cs- console entry point and composition rootState/- immutable or mostly immutable domain stateMutations/- mutation implementationsPolicies/- business rules and safeguardsScenarios/- runnable flows that use the engineREADME.md- example-specific documentation
That layout is deliberate. It makes each sample easy to scan and keeps the mutation engine usage visible instead of hidden behind helper abstractions.
Shows quota management workflows such as increasing quotas, applying limits, and resetting values on schedule. It is the simplest place to look if you want a compact example of validation plus policy enforcement.
See Core/BillingQuotas/README.md.
Shows feature toggle workflows with policy checks and history logging. This example is useful if you want to see how the engine behaves when you care about auditability and batch changes.
See Core/FeatureFlags/README.md.
Shows role grant and revoke workflows with approval-style rules. This is the example to read if you care about protection against unsafe privilege changes.
Shows a multi-step approval process with ordered execution and rejection handling. This example is the best fit if you want to study state transitions that must happen in a strict sequence.
See Core/WorkflowApprovals/README.md.
Shows the governance runtime as a request lifecycle system instead of an immediate execution path. This is the example to read if you want to understand pending requests, approval, cancellation, and expiration.
See Governance/RequestLifecycle/README.md.
Shows the full governed execution loop from approved request to version resolution, core mutation execution, and terminal executed decision.
See Governance/GovernedExecution/README.md.
Shows how governance turns approval requirements into explicit request-level approval actions with ordered steps and terminal approval or rejection behavior.
See Governance/ApprovalWorkflow/README.md.
Shows why governance request decisions are split into lifecycle, approval, and version-resolution categories instead of being kept in one flat enum.
See Governance/DecisionTaxonomy/README.md.
Shows how governance resolves approved requests once the underlying state version has moved. This is the example to read if you want concrete stale request semantics.
See Governance/VersionedResolution/README.md.
- The examples are separate console applications, not libraries.
- Core examples reference the mutation engine under
src/ModularityKit.Mutator.csproj. - Governance examples reference
src/ModularityKit.Mutator.Governance.csproj. - The sample code is meant to be readable and runnable, not minimal for its own sake.
- Benchmarking lives in
Benchmarks/and is separate from the examples. - Tests, when added, should live in
Tests/.
- Root project overview:
README.md - Mutation engine source:
src/ - Benchmark project:
Benchmarks/README.md