The 15 Engineering Principles & Quality Gate
Every library in the EricksonLopez.* ecosystem is designed around invariants rather than features. Rather than asking “what convenience wrapper can we ship?”, the architecture asks “what invariant must hold under retries, concurrency, trimming, and failure?”.
- Correctness over convenience. Never sacrifice invariant validation, thread safety, or data integrity for shorter syntax.
- Explicitness over magic. Disable implicit usings (
<ImplicitUsings>disable</ImplicitUsings>), avoid reflection auto-wiring, and make dependencies visible in source. - Composition over monoliths. Split core contracts (
Abstractions) from integrations and vendor adapters so consumers pay only for what they reference. - Compile-time over runtime when practical. Shift validation left via Roslyn incremental source generators (
EricksonLopez.DomainPrimitives.Generators,EricksonLopez.Specification.Generators) and analyzers. - Secure defaults over permissive defaults. Reject DTD/external resolvers in XML, validate inputs strictly, and require explicit AAD context in cryptographic envelopes.
- Predictability over cleverness. Favor deterministic execution and explicit control flow over clever dynamic abstractions.
- Performance without sacrificing clarity. Use
readonly struct,Span<T>,ValueTask,ArrayPool<T>, and PostgreSQLUNNESTwhile keeping domain intent readable. - APIs should be easy to discover and hard to misuse. Make invalid states unrepresentable with strongly-typed IDs, factory methods returning
Result, and Roslyn analyzer diagnostics. - Dependencies should be intentional. Minimize third-party dependencies in core
L0–L1libraries; isolate vendor SDKs into satellite packages. - Compatibility is a feature. Respect Semantic Versioning, preserve historical behavior clearly, and treat Native AOT / trim metadata honestly.
- Observability is part of production readiness. Expose structured
System.Diagnostics.ActivitySourceandMeterinstrumentation (OpenTelemetrysatellites). - Tests are executable contracts. Use
[UnitOfWork]_[ScenarioUnderTest]_[ExpectedBehavior]naming (ADR-038) and mutation testing to validate behavior. - Documentation is part of the API. Pair every public contract with XML docs, architectural rationale, and verified code examples.
- Every abstraction must justify its existence. Avoid speculative interfaces that wrap only one concrete behavior without isolating genuine volatility.
- Complexity must be paid for deliberately. Adopt distributed locks, transactional outboxes, and multi-tenant isolation only when invariants demand them.
Mandatory Core Build Rules (EL-CORE-001 to EL-CORE-004)
Section titled “Mandatory Core Build Rules (EL-CORE-001 to EL-CORE-004)”| Rule ID | Invariant | Enforcement |
|---|---|---|
EL-CORE-001 |
Explicit imports mandatory | <ImplicitUsings>disable</ImplicitUsings> across every .csproj |
EL-CORE-002 |
Strong-name signing mandatory | <SignAssembly>true</SignAssembly> with EricksonLopez.snk |
EL-CORE-003 |
Pure ASCII author identity | Erickson Lopez (unaccented ASCII) in package metadata |
EL-CORE-004 |
Roy Osherove test naming (ADR-038) |
Method_Scenario_Result with intentional IDE1006;CA1707 suppression in tests |
CODE ─▶ [ DESIGN | SECURITY | API ] ─▶ STATIC ANALYSIS ─▶ TESTING ─▶ MUTATION TESTING ─▶ BENCHMARKS ─▶ DOCUMENTATION ─▶ COMPATIBILITY ─▶ RELEASENo change is merged simply because “it appears to work” — it must satisfy its contractual invariants across static analysis, behavioral tests, mutation verification, and compatibility checks.