Skip to content

Commit 643b520

Browse files
authored
feat: Add DI mutation safety with native integration and complete test coverage (#24)
1 parent c255147 commit 643b520

26 files changed

+4009
-4
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,36 @@
22

33
A .NET library for routing service calls through configurable trials based on feature flags, configuration values, or custom routing logic.
44

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+
535
## Fluent DSL Design
636

737
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

Comments
 (0)