|
2 | 2 |
|
3 | 3 | A .NET library for routing service calls through configurable trials based on feature flags, configuration values, or custom routing logic. |
4 | 4 |
|
| 5 | +## ✨ New: Enterprise-Grade DI Mutation Safety |
| 6 | + |
| 7 | +ExperimentFramework now includes comprehensive service registration safety features to ensure deterministic, validated, and auditable dependency injection mutations: |
| 8 | + |
| 9 | +- **Deterministic Registration Plans** - Preview all changes before applying them |
| 10 | +- **Contract Guarantees** - Validate lifetimes, assignability, open generics, and more |
| 11 | +- **Multi-Registration Support** - Insert/Append/Merge/Replace semantics for `IEnumerable<T>` |
| 12 | +- **Auditable Changes** - JSON and text reports for support tickets and compliance |
| 13 | +- **Minimal Overhead** - Analysis at startup, fast runtime dispatch |
| 14 | + |
| 15 | +```csharp |
| 16 | +// Capture DI state before mutations |
| 17 | +var snapshot = ServiceGraphSnapshot.Capture(services); |
| 18 | + |
| 19 | +// Build and validate a registration plan |
| 20 | +var plan = new RegistrationPlanBuilder() |
| 21 | + .WithValidationMode(ValidationMode.Strict) |
| 22 | + .BuildFromDefinitions(snapshot, definitions, config); |
| 23 | + |
| 24 | +// Generate audit report |
| 25 | +var report = RegistrationPlanReport.GenerateTextReport(plan); |
| 26 | + |
| 27 | +// Execute with automatic rollback on failure |
| 28 | +var result = RegistrationPlanExecutor.Execute(plan, services); |
| 29 | +``` |
| 30 | + |
| 31 | +**📖 [Full Documentation](docs/SERVICE_REGISTRATION_SAFETY.md)** |
| 32 | + |
| 33 | +--- |
| 34 | + |
5 | 35 | ## Fluent DSL Design |
6 | 36 |
|
7 | 37 | ExperimentFramework provides multiple equivalent method names to create a natural, readable configuration DSL. This allows you to describe experiments using terminology that best fits your mental model: |
|
0 commit comments