Eternet.Analyzers.Mediator
1.0.27
Prefix Reserved
dotnet add package Eternet.Analyzers.Mediator --version 1.0.27
NuGet\Install-Package Eternet.Analyzers.Mediator -Version 1.0.27
<PackageReference Include="Eternet.Analyzers.Mediator" Version="1.0.27" />
<PackageVersion Include="Eternet.Analyzers.Mediator" Version="1.0.27" />
<PackageReference Include="Eternet.Analyzers.Mediator" />
paket add Eternet.Analyzers.Mediator --version 1.0.27
#r "nuget: Eternet.Analyzers.Mediator, 1.0.27"
#:package Eternet.Analyzers.Mediator@1.0.27
#addin nuget:?package=Eternet.Analyzers.Mediator&version=1.0.27
#tool nuget:?package=Eternet.Analyzers.Mediator&version=1.0.27
Eternet.Analyzers.Mediator
Roslyn analyzers for Eternet.Mediator step-boundary rules.
Current diagnostics:
EAMS001: mediatorHandlemixes distinct responsibility groups and should be split into explicit steps or boundariesEAMS002: mediatorHandlemixes manual side effects with other responsibilitiesEAMS003: mediatorHandlemixes background trigger work with other responsibilitiesEAMS004: step delegates workflow to a feature-local service boundary instead of owning the step logic directlyEAMS005: step name intent does not match the observed responsibility; rename-dominant cases expose a safe rename code fixEAMS006: step mixes async lookup with business validation and should split lookup and validation before naming cleanupEAMS007: nested mediator dispatch depth exceeds the default threshold and should be flattened into fewer internal boundariesEAMS008: a loop repeatedly dispatches the same mediator request type and should move to a generated branch, batch lane, or explicit loop-aware boundaryEAMS013: a stateful pipeline step uses a replay-unsafe re-execution policy for stale reads or duplicate side effectsEAMS014: retry, branch, or other control-flow-critical metadata is hidden from the public graph surfaceEAMS015: a step takes the whole request even though it only reads a narrow subset of request members- Code fix: for the deterministic single-member case, rewrite
Handle(Request request)to consume that request member directly, for exampleHandle(int nodeTypeId), and replacerequest.NodeTypeIdreads. The fix is not registered when source call sites already invoke the stepHandle(...)method directly.
- Code fix: for the deterministic single-member case, rewrite
EAMS016: manualif/switchbranch dispatch should become a generated mediator branchEAMS017: a pause-capable stateful pipeline is missing the request contract required to resume safelyEAMS018: a generated pipeline handler uses a local request whose request declaration or required containing type is notpartial- Code fix: add
partialonly to the missing local request and containing type declarations in the editable document.
- Code fix: add
EAMR001: step handles framework-eligible retry patterns manuallyEAMR002: step exposes retry-policy provider behavior without an active mediator retry policyEAMR003: retry scope wraps side-effecting work without idempotency evidenceEANM001: mutating step resolves related state from a scalar*Idparameter insideHandleEANM002: mutating step uses throwing selectors such asSingleorFirstto model expected domain absence insideHandleEANM003: mutating step dereferences nullable scalar*.Valueto model expected presence insideHandleEANM004: mutating step passes a scalar*Idparameter directly into an aggregate mutator instead of passing an already-resolved valueEANM005: mutating step forcesFirstOrDefault/SingleOrDefaultto exist with!or?? throwinstead of handling expected absence explicitlyEANM006: step-like class injects another step-like class and manually calls itsHandle(...)instead of sequencing both through the mediator pipelineEANM007: step-like class is registered manually in DI even though generated mediator pipelines register steps automatically- Code fix: remove the standalone
AddScoped/AddTransient/AddSingletonstatement that manually registers the step-like type.
- Code fix: remove the standalone
EANM010: mutating step can deterministically convert throwing expected-absence selectors into explicit invalid-state guards- Code fix: change eligible
Single/Firstlocal lookups toSingleOrDefault/FirstOrDefault, insert anInvalidStateError(...)/InvalidState(...)guard, and addBaseHandlerResponsesonly when no existing base class would be replaced.
- Code fix: change eligible
EANM011: generated pipeline step lives outside the deterministic ownerStepsfolder or nearest commonSharedStepsfolder- Code fix: move or split the step type into the computed deterministic file path.
EANM012: generated pipeline entry point lives outside its deterministic owner layout- Code fix: move or split the pipeline type to the analyzer
TargetPath. When the source already lives under an action-scoped role folder such asSingle/Create/Commands/CreateFoo.cs, the command stays flat and owned steps targetSingle/Create/Commands/Steps. Broader role folders such asCommands/CreateFoo.csstill use the owner-folder layoutCommands/CreateFoo/CreateFoo.cs. Relational companion pipelines named<Owner>Relationalare owned by the<Owner>layout and can live beside the public command. - Metadata:
LayoutKind=ActionScopedFlatmeans the path already scopes the action by token match, for exampleRegisterApprovedByVendor/Commands/RegisterPortabilityApprovedByVendor.cs;LayoutKind=OwnerFoldermeans the role folder is broad and needs an owner subfolder.
- Code fix: move or split the pipeline type to the analyzer
EANM013: a generated pipeline step only projects a public request property into a renamed keyed result- Code fix: remove the projection step, remove its
GenerateExecutePipelineregistration, and rebind downstream consumers to the request property keyed input by scalar parameter name. Shared consumers are cloned owner-local instead of being mutated globally.
- Code fix: remove the projection step, remove its
EANM014: a stepHandlemethod has a redundant[KeyedResult("T")]attribute when the non-nullable result type is alreadyT- Code fix: remove the redundant
[KeyedResult]attribute while preserving other attributes on the method. Supports Fix All for document, project, and solution through Roslyn's batch fixer.
- Code fix: remove the redundant
EANM015: a stepHandleparameter has a redundant[KeyedParameter("x")]attribute when the key already matches the parameter name case-insensitively- Code fix: remove the redundant
[KeyedParameter]attribute while preserving other attributes on the parameter. Supports Fix All for document, project, and solution through Roslyn's batch fixer.
- Code fix: remove the redundant
EANM016: a stepHandleparameter uses[KeyedParameter("X")]even though the key can become a collision-free implicit parameter name- Code fix: rename the parameter to the lower-camel key name and remove
[KeyedParameter]. The diagnostic is not reported for non-identifier keys, all-caps acronym keys, parameter collisions, or local-name collisions.
- Code fix: rename the parameter to the lower-camel key name and remove
EAR001: generated mediator pipeline writes through EF Core directly instead of using a relational lane; disabled by default and intended for diff-scoped review runsEAR002: generated handler/step injectsISenderorIMediatorinstead of using explicit pipeline steps or an explicit boundaryEAR003: generated pipeline only wraps handler-like step(s) and has no meaningful validation/load/check/mutation stepEAR004: mediator handlers or generated-pipeline steps call manualSaveChangesAsyncafter multiple EF write units or entity types and should be modeled asEntityChangesCommandEAR005: store-like infrastructure hidesExecuteUpdateAsyncorExecuteDeleteAsyncwithout explicit relational/bulk/custom/runtime classification; disabled by defaultEAR006: homogeneous bulk workflow is modeled asEntityChangesCommandinstead of the matching relational bulk laneEAR007: relational business handler performs loading, validation, querying, or persistence insideHandleEAR008: relational write uses manual outbox staging instead of domain-event emission plus relational projectorsEAR009: opt-in test-project diagnostic that flags relational command tests still using legacyPipelineTest-style bases instead of the generated*RequestPipelineTestBaseEAR010: opt-in test-project diagnostic that flags relational command tests whose pre-sendSaveChangessetup can be replaced by generated step overridesEAR011: opt-in test-project diagnostic that flags relational command tests which only re-prove generic framework persistence instead of feature-owned behaviorEAR012: opt-in test-project diagnostic that flags test projects targeting handlers with[GeneratePipelineTestBase]support but without an available generated test baseEAT001: opt-in test-project diagnostic forSaveChanges()orSaveChangesAsync(...)calls that do not useTestContext.Current.CancellationToken; helper methods are marked review-required when a signature cascade may be neededEAT002: opt-in validator registration inventory forAddValidatorsFromAssembly*boundaries in API, contracts, and test fixturesEAT003: opt-in detection for localClearDatabase*helper clones; the recommended action is to use shared cleanup helper packages, not to generate deletion logic here
Inventory diagnostics EMI001, EMI002, EMI003, and EMI004 are metadata-only signals for EAC/review tooling.
They are disabled by default and only emit when analyzer config sets
eternet_mediator_inventory_enabled = true.
The relational command test modernization family (EAR009-EAR012) is also disabled by default. It only emits for test
projects when analyzer config sets eternet_relational_command_test_modernization_enabled = true and the diagnostics are
enabled through analyzer severity.
The Mobile test automation family (EAT001-EAT003) is disabled by default. It only emits when analyzer config sets
eternet_mobile_test_automation_patterns_enabled = true and the diagnostics are enabled through analyzer severity.
FluentAssertions-to-AwesomeAssertions package migration is intentionally not modeled as a semantic analyzer; EAC should
own that migration as a transformer plus postflight package/namespace scan.
Mediator pipeline exposure SARIF property catalog
Mediator inventory and quality metadata is emitted as diagnostic properties and flows into SARIF under
runs[].results[].properties.customProperties.
Inventory diagnostics
| Diagnostic | Stable property keys |
|---|---|
EMI001 |
MediatorPipelineId, MediatorFeatureType, RequestType, ResponseType, HandlerType, PipelineKind, IsStateful, ExecutionIdProperty, ExecutionIdIsNullable, StoreRequestSnapshot, ImplementsIRequestStateful, ForceStatelessSupported, AllowPauseSupported, GeneratedTestBase, ChunkShape |
EMI002 |
StepType, StepName, StepOrder, PipelinePath, PipelineDepth, HandleParameterTypes, HandleParameterNames, HandleReturnType, StepIsAsync, HasCancellationTokenParameter, ConsumedInputKeys, ProducedOutputKeys, KeyedParameters, RegisterPropertiesKeys, ReExecutionPolicy, RetryPolicy, RetryScopePolicy, GraphVisibility, GraphCriticality, HasParallelFanOut, ParallelFanOutEvidence, ConstructorDependencyCount, InjectRequestAsParameter, HandleParameterCount, StepHasCache, StepCacheDurationSeconds, DoNotDispose, GraphNodeId, GraphNodeKind, GraphEdgeKind |
EMI003 |
MediatorPipelineId, GeneratedTestBase, HandlerType, RequestType, ResponseType, PipelineKind |
EMI004 |
MediatorPipelineId, HandlerType, PipelineKind, GraphVisibility, GraphCriticality, GraphNodeId, GraphNodeKind, GraphEdgeKind, BranchSelectorSource, BranchSelectorKey, BranchSelectorType, BranchSelectorIsNullable, BranchResolverType, BranchResolverInputTypes, BranchTargetTypes, SelectorInferenceConfidence |
Quality diagnostics
| Diagnostic | Stable property keys |
|---|---|
EAMR001 |
StepName, HandlerType, ManualRetryPattern, FrameworkRetryEligible, CodeFixEligible, RemediationComplexity |
EAMR002 |
StepName, HandlerType, FrameworkRetryActive, ProviderOnly |
EAMR003 |
StepName, HandlerType, RetryScopeName, SideEffectSteps, IdempotencyEvidence |
EAMS007 |
StepName, HandlerType, PipelineDepth, DepthThreshold, SuggestedAction |
EAMS008 |
StepName, HandlerType, LoopKind, RepeatedRequestType, SuggestedAction |
EAMS013 |
StepName, HandlerType, ResumeRiskKind, SuggestedReExecutionPolicy |
EAMS014 |
StepName, HandlerType, GraphVisibility, GraphCriticality, SuggestedAction |
EAMS015 |
StepName, HandlerType, AccessedRequestMemberCount, AccessedRequestMembers, ParameterMinimalismEvidence, SuggestedAction |
EAMS016 |
StepName, HandlerType, BranchArmCount, SuggestedAction |
EAMS017 |
StepName, HandlerType, PauseTrigger, PauseContractGaps, ExecutionIdIsNullable, ForceStatelessSupported, AllowPauseSupported |
EAMS018 |
HandlerType, RequestType, PipelineKind, requestAssemblyName, handlerAssemblyName, requiredPartialTargets, recommendedAction |
EANM014 |
StepType, HandleReturnType, ProducedOutputKeys |
EANM015 |
StepType, HandleParameterNames, KeyedParameters |
EANM016 |
StepType, HandleParameterNames, KeyedParameters, SuggestedParameterName |
EAR001 |
RecommendedLane, RecommendedCommand, DbContextType, WriteSteps, PersistenceSteps, SideEffectSteps, EntityTypes, OperationKinds, SaveChangesCount, CheckpointCommitCount, CheckpointCommitSteps, CheckpointRecoverySupported, CheckpointRecoverySteps, CheckpointRecoveryKinds, WriteUnitCount, HasIntermediateFlush, RemediationComplexity, SecondaryEntityTypes, SharedTransactionWrites, RequiresTicketActionPreservation, GetOrCreateDetected, UpsertCandidate, DerivedStateLookups, DerivedKeyProperties, BulkItemsNeedDerivedState, DbGeneratedKeyRisk, AuxiliaryResponseState, RiskFactors |
EAR009 |
TestClass, TestMethod, CurrentBaseType, RequestType, HandlerType, RelationalRequestType, RelationalLane, GeneratedTestBaseType, GeneratedTestBaseAvailable, MediatorSendCount, ExecutePipelineCount, ExecuteWithMediatorCount, SaveChangesCount, AssertionKinds, SuggestedExecutionMode, TargetStepTypes, OverrideInterfaces, TestProjectPath, PackageReferenceExpected |
EAR010 |
TestClass, TestMethod, CurrentBaseType, RequestType, HandlerType, RelationalRequestType, RelationalLane, GeneratedTestBaseType, GeneratedTestBaseAvailable, MediatorSendCount, ExecutePipelineCount, ExecuteWithMediatorCount, SaveChangesCount, DbContextTypes, SeedEntityTypes, AssertionKinds, StepOverridesPresent, SuggestedExecutionMode, RiskLevel, TargetStepTypes, OverrideInterfaces, ResponseMembers, StepsResultsReads, TestProjectPath, PackageReferenceExpected |
EAR011 |
TestClass, TestMethod, CurrentBaseType, RequestType, HandlerType, RelationalRequestType, RelationalLane, GeneratedTestBaseType, GeneratedTestBaseAvailable, MediatorSendCount, ExecutePipelineCount, ExecuteWithMediatorCount, SaveChangesCount, AssertionKinds, SuggestedExecutionMode, RiskLevel, ResponseMembers, StepsResultsReads, SuggestedCoverageTarget, TestProjectPath, PackageReferenceExpected |
EAR012 |
TestProjectPath, PackageReferenceExpected, HandlerTypes, BlockingReasons, RiskLevel |
EAT001 |
dbContextExpression, enclosingMethod, isTestProject, hasCurrentCancellationToken, callerCount, requiresSignatureCascade, saveChangesMethod, recommendedAction |
EAT002 |
validatorRegistrationMethod, assemblyMarkerType, isTestProject, recommendedAction |
EAT003 |
cleanupMethod, isTestProject, recommendedAction |
Ownership boundaries
Eternet.Analyzers.Mediatorowns mediator inventory and quality evidence that can be proven from source and analyzer semantics. That includes graph metadata, branch metadata, retry/resume risk metadata, pause-contract metadata, and step-shape quality metadata.AlwaysReExecute+StepHasCacheremains a companionEternet.Mediator.Generator.Analyzersownership boundary inEternet.AspNetCore. This package intentionally exposes the rawReExecutionPolicyandStepHasCacheinventory properties, but it does not add a duplicate contradiction diagnostic here.ParallelFanOutEvidence,NestedDispatchScopeIsolationEvidence, andChunkShapestay attached to the existing inventory or relational diagnostics that already own the behavior. The package does not mint duplicate diagnostics just to surface those facts.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.27 | 147 | 5/13/2026 |
| 1.0.26 | 105 | 5/12/2026 |
| 1.0.25 | 107 | 5/11/2026 |
| 1.0.24 | 119 | 5/9/2026 |
| 1.0.23 | 112 | 5/9/2026 |
| 1.0.22 | 114 | 5/9/2026 |
| 1.0.21 | 118 | 5/8/2026 |
| 1.0.20 | 103 | 5/7/2026 |
| 1.0.19 | 103 | 5/7/2026 |
| 1.0.18 | 106 | 5/6/2026 |
| 1.0.17 | 102 | 5/6/2026 |
| 1.0.16 | 96 | 5/6/2026 |
| 1.0.15 | 101 | 5/5/2026 |
| 1.0.14 | 103 | 5/5/2026 |
| 1.0.13 | 100 | 5/4/2026 |
| 1.0.12 | 104 | 5/4/2026 |
| 1.0.11 | 99 | 5/4/2026 |
| 1.0.10 | 106 | 5/3/2026 |
| 1.0.8 | 114 | 5/3/2026 |
| 1.0.7 | 105 | 5/3/2026 |