Diagnostics Reference¶
Deepstaging analyzers validate your attribute usage at compile time and offer automated code fixes where possible. All diagnostics use the DS prefix followed by a module-specific code.
Suppressing diagnostics
Any diagnostic can be suppressed via <NoWarn>, .editorconfig, or #pragma warning disable. See MSBuild Integration for details.
Effects Module (DSEFX)¶
Diagnostics for [EffectsModule] — wrapping interfaces and DbContexts as LanguageExt effect modules.
| ID | Severity | Title | Description | Code Fix |
|---|---|---|---|---|
| DSEFX01 | Error | EffectsModule class must be partial | Class has [EffectsModule] but is not declared as partial |
Add partial modifier |
| DSEFX02 | Warning | EffectsModule class should be sealed | Class has [EffectsModule] but is not declared as sealed |
Add sealed modifier |
| DSEFX03 | Warning | EffectsModule target should be interface | [EffectsModule] targets a concrete class instead of an interface |
— |
| DSEFX04 | Error | Duplicate EffectsModule target type | Class has multiple [EffectsModule] attributes targeting the same type |
— |
| DSEFX05 | Error | Excluded method not found | Method specified in Exclude does not exist on the target type |
— |
| DSEFX06 | Error | IncludeOnly method not found | Method specified in IncludeOnly does not exist on the target type |
— |
| DSEFX07 | Warning | EffectsModule target has no methods | Target type has no methods; use [Capability] instead |
Replace with [Capability] |
| DSEFX08 | Error | Recovery fallback not found | [Recover] fallback method not found on interface or has incompatible return type |
— |
| DSEFX09 | Error | Recover must specify strategy | [Recover] must specify either Fallback or Default, not both or neither |
— |
Runtime (DSRT)¶
Diagnostics for [Runtime] and [Uses] — the runtime aggregator that composes effect modules.
| ID | Severity | Title | Description | Code Fix |
|---|---|---|---|---|
| DSRT01 | Error | Runtime class must be partial | Class has [Runtime] but is not declared as partial |
Add partial modifier |
| DSRT02 | Error | Uses attribute requires Runtime | Class has [Uses] but is missing [Runtime] attribute |
Add [Runtime] attribute |
| DSRT03 | Error | Uses target must be EffectsModule, ConfigModule, or Capability | Type referenced in [Uses] is not a recognized Deepstaging module |
— |
| DSRT04 | Info | Effects module available but unreferenced | An effects module from an external assembly is not referenced by any [Uses] on a runtime (local modules are auto-discovered) |
Add [Uses(typeof(…))] |
Dispatch (DSDSP)¶
Diagnostics for [DispatchModule], [CommandHandler], [QueryHandler], and authorization policies.
| ID | Severity | Title | Description | Code Fix |
|---|---|---|---|---|
| DSDSP01 | Error | DispatchModule class must be partial | Class has [DispatchModule] but is not declared as partial |
Add partial modifier |
| DSDSP02 | Error | DispatchModule class must be static | Class has [DispatchModule] but is not declared as static |
— |
| DSDSP03 | Error | CommandHandler method must be static | Method has [CommandHandler] but is not declared as static |
— |
| DSDSP04 | Error | QueryHandler method must be static | Method has [QueryHandler] but is not declared as static |
— |
| DSDSP05 | Warning | CommandHandler method has invalid signature | Method has [CommandHandler] but does not return Eff<RT, T> with at least one parameter |
— |
| DSDSP06 | Warning | QueryHandler method has invalid signature | Method has [QueryHandler] but does not return Eff<RT, T> with at least one parameter |
— |
| DSDSP07 | Warning | ValidatorType is missing a Validate method | Type specified as ValidatorType does not have a static Validate method with the correct signature |
Scaffold validator |
| DSDSP08 | Error | AuthPolicies class must be static partial | Class has [AuthPolicies] but is not declared as static partial |
— |
| DSDSP09 | Error | AuthPolicy method has invalid signature | Method has [AuthPolicy] but must be static, return bool, and accept a single ClaimsPrincipal parameter |
— |
| DSDSP10 | Error | Validated and ValidatorType conflict | Handler sets both Validated = true and ValidatorType — pick one |
— |
| DSDSP11 | Warning | Validated but no rules | Validated = true but input type has no DataAnnotations or Validate methods |
— |
| DSDSP12 | Error | Wrong Validate return type | Custom Validate{Field} method returns wrong type — should return FieldResult<T> |
— |
| DSDSP13 | Info | Add custom validators | Input type has validated fields without custom Validate methods |
Generate validators |
| DSDSP14 | Warning | Handler has no access control attribute | Handler method has no [Require], [Authorize], or [Public] attribute — add an explicit access control decision |
Add [Require] |
Typed IDs (DSID)¶
Diagnostics for [TypedId] — generating strongly-typed ID structs.
| ID | Severity | Title | Description | Code Fix |
|---|---|---|---|---|
| DSID01 | Error | TypedId struct must be partial | Struct has [TypedId] but is not declared as partial |
Add partial modifier |
| DSID02 | Warning | TypedId struct should be readonly | Struct has [TypedId] but is not declared as readonly |
Add readonly modifier |
| DSID03 | Error | StreamId requires TypedId | Struct has [StreamId] but is missing [TypedId] |
— |
| DSID04 | Warning | StreamId requires Guid or String backing type | [StreamId] uses a backing type that is not supported for stream identity |
— |
| DSID05 | Error | TypedId references unknown profile | [TypedId] specifies a Profile with no matching [assembly: TypedIdProfile] |
— |
| DSID06 | Error | Duplicate default TypedId profile | Assembly has multiple unnamed [TypedIdProfile] declarations |
— |
Configuration (DSCFG)¶
Diagnostics for [ConfigRoot], [ConfigModule], [Exposes<T>], [ConfigSection], and [Secret].
| ID | Severity | Title | Description | Code Fix |
|---|---|---|---|---|
| DSCFG01 | Error | ConfigRoot class must be partial | Class has [ConfigRoot] but is not declared as partial |
Add partial modifier |
| DSCFG02 | Warning | ConfigRoot class should be sealed | Class has [ConfigRoot] but is not declared as sealed |
Add sealed modifier |
| DSCFG03 | Error | Section name could not be inferred | Class has [ConfigRoot] but has no ConfigRoot suffix and no explicit Section |
— |
| DSCFG04 | Warning | Exposed type has no properties | Type exposed by [Exposes<T>] has no public instance properties |
— |
| DSCFG05 | Warning | Property may contain secrets | Property name suggests secrets or PII — consider adding [Secret] |
Add [Secret] attribute |
| ~~DSCFG06~~ | — | ~~Removed~~ | Config files are now kept current automatically by deepstaging sync |
— |
| DSCFG07 | Error | UserSecretsId may be missing | [Secret] properties exist but the assembly has no UserSecretsIdAttribute |
Add <UserSecretsId> to project |
| DSCFG09 | Info | User secrets can be synced | [Secret] properties exist — run deepstaging.secrets-update.sh to sync |
Run update secrets |
| DSCFG10 | Info | Infrastructure config section available | (Planned) A [ConfigSection]-annotated type from a referenced package is available but not exposed |
Add [Exposes<T>] attribute |
| DSCFG11 | Error | ConfigModule class must be partial | Class has [ConfigModule] but is not declared as partial |
Add partial modifier |
| DSCFG12 | Error | ConfigModule class must be static | Class has [ConfigModule] but is not declared as static |
Add static modifier |
Configuration module reference
HTTP Client (DSHTTP)¶
Diagnostics for [HttpClient] and HTTP verb attributes ([Get], [Post], [Put], [Patch], [Delete]).
| ID | Severity | Title | Description | Code Fix |
|---|---|---|---|---|
| DSHTTP01 | Error | HttpClient class must be partial | Class has [HttpClient] but is not declared as partial |
Add partial modifier |
| DSHTTP02 | Error | HTTP method must be partial | Method has an HTTP verb attribute but is not declared as partial |
Add partial modifier |
| DSHTTP04 | Error | HTTP path must not be empty | Method has an HTTP verb attribute with an empty or whitespace path | — |
| DSHTTP05 | Error | Form and Body cannot be combined | Method uses both [Form] and [Body] parameters — these are mutually exclusive |
— |
Event Queue (DSEQ)¶
Diagnostics for [EventQueue] and [EventQueueHandler] — in-process event queues backed by Channel<T>.
| ID | Severity | Title | Description | Code Fix |
|---|---|---|---|---|
| DSEQ01 | Error | EventQueue class must be partial | Class has [EventQueue] but is not declared as partial |
Add partial modifier |
| DSEQ02 | Warning | EventQueue class should be static | Class has [EventQueue] but is not declared as static |
— |
| DSEQ03 | Error | EventQueueHandler class must be static | Class has [EventQueueHandler] but is not declared as static |
— |
| DSEQ04 | Warning | EventQueueHandler has no handler methods | Class has [EventQueueHandler] but contains no valid handler methods |
— |
| DSEQ05 | Error | EventQueueHandler references unknown queue | Class references a queue name but no [EventQueue] with that name exists in the assembly |
— |
Integration Events (DSEQ)¶
Diagnostics for [IntegrationEvents] and [IntegrationEventHandler] — event queues with stable wire names and external transport support.
| ID | Severity | Title | Description | Code Fix |
|---|---|---|---|---|
| DSEQ06 | Error | Event type missing [IntegrationEvent] | Event type handled by [IntegrationEventHandler] does not have an [IntegrationEvent] attribute defining its stable wire name |
— |
| DSEQ07 | Error | Topic type missing [IntegrationEventTopic] | Type used as a topic by [IntegrationEvents] or [IntegrationEventHandler] is not marked with [IntegrationEventTopic] |
— |
| DSEQ09 | Error | IntegrationEventHandler class must be static | Class has [IntegrationEventHandler] but is not declared as static |
— |
| DSEQ10 | Warning | IntegrationEventHandler has no handler methods | Class has [IntegrationEventHandler] but contains no valid handler methods |
— |
Integration Events module reference
Data Store (DSDS)¶
Diagnostics for [DataStore] and [StoredEntity] — EF Core data store generation.
| ID | Severity | Title | Description | Code Fix |
|---|---|---|---|---|
| DSDS01 | Error | DataStore class must be partial | Class has [DataStore] but is not declared as partial |
— |
| DSDS02 | Warning | DataStore class should be static | Class has [DataStore] but is not declared as static |
— |
| DSDS03 | Error | StoredEntity class must be partial | Class has [StoredEntity] but is not declared as partial |
— |
| DSDS04 | Error | StoredEntity must have a TypedId property | Class has [StoredEntity] but does not have a property with a [TypedId] type |
— |
| DSDS05 | Error | Only one DataStore allowed per assembly | Another [DataStore] already exists in this assembly |
— |
| DSDS06 | Error | ForeignKey target must be a StoredEntity | Property has [ForeignKey<T>] but the target type is not decorated with [StoredEntity] |
— |
| DSDS07 | Error | CompositeKey property not found | [CompositeKey] references a property that does not exist on the type |
— |
| DSDS08 | Info | StoredEntity without DataStore container | Class has [StoredEntity] but no [DataStore] container exists in this assembly |
— |
Event Store (DSES)¶
Diagnostics for [EventStore] and [EventSourcedAggregate] — event-sourced persistence generation.
| ID | Severity | Title | Description | Code Fix |
|---|---|---|---|---|
| DSES01 | Error | EventStore class must be partial | Class has [EventStore] but is not declared as partial |
Add partial modifier |
| DSES02 | Warning | EventStore class should be static | Class has [EventStore] but is not declared as static |
— |
| DSES03 | Error | EventSourcedAggregate class must be partial | Class has [EventSourcedAggregate] but is not declared as partial |
Add partial modifier |
| DSES04 | Error | Only one EventStore allowed per assembly | Another [EventStore] already exists in this assembly |
— |
| DSES05 | Info | EventSourcedAggregate without EventStore container | Class has [EventSourcedAggregate] but no [EventStore] container exists in this assembly |
— |
| DSES06 | Error | EventSourcedAggregate must have a StreamId property | Class has [EventSourcedAggregate] but does not have a property with a [StreamId] type |
— |
Background Jobs (DSJOB)¶
Diagnostics for [JobHandler] and [BackgroundJob].
| ID | Severity | Title | Description | Code Fix |
|---|---|---|---|---|
| DSJOB01 | Error | JobHandler method must be static | Method has [JobHandler] but is not declared as static |
— |
| DSJOB02 | Error | JobHandler has invalid signature | Method has [JobHandler] but does not match the required signature (single parameter, returns Eff<RT, Unit>) |
— |
| DSJOB03 | Warning | BackgroundJob has no handler | Type is marked [BackgroundJob] but no [JobHandler] method accepts it as a parameter |
— |
| DSJOB04 | Warning | DeduplicateBy property not found | [BackgroundJob(DeduplicateBy = "...")] references a property that doesn't exist on the type |
— |
Background Jobs module reference
Testing (DSTEST)¶
Diagnostics from Deepstaging.Testing.Analyzers for test runtime support.
| ID | Severity | Title | Description | Code Fix |
|---|---|---|---|---|
| DSEFX07 | Info | Generate capability test scenarios | Capability on a [TestRuntime<T>] class — generate success/error test scenarios |
— |
Note
The testing analyzer reuses DSEFX07 to surface informational hints about capabilities available for test scenario generation on [TestRuntime<T>] classes.
Azure Table Storage (DSAT)¶
Diagnostics for [TableEntity] and [TableStore] — Azure Table Storage generation.
| ID | Severity | Title | Description | Code Fix |
|---|---|---|---|---|
| DSAT01 | Error | TableEntity must be partial | Type has [TableEntity] but is not declared as partial |
Add partial modifier |
| DSAT02 | Error | TableEntity must have a PartitionKey | Type has [TableEntity] but no property is marked with [PartitionKey] |
— |
| DSAT03 | Error | TableEntity must have a RowKey | Type has [TableEntity] but no property is marked with [RowKey] |
— |
| DSAT04 | Info | Property will be JSON-serialized | Property type is not natively supported by Azure Table Storage and will be stored as JSON | — |
| DSAT10 | Error | TableStore must be partial | Type has [TableStore] but is not declared as partial |
— |
| DSAT11 | Warning | TableStore should be static | Type has [TableStore] but is not declared as static |
— |
PostgreSQL (DSPG)¶
Diagnostics for EF Core / PostgreSQL data store integration.
| ID | Severity | Title | Description | Code Fix |
|---|---|---|---|---|
| DSPG01 | Error | TypedId must include EfCoreValueConverter | [TypedId] used by a [StoredEntity] must include IdConverters.EfCoreValueConverter |
Add EF Core converter |
| DSPG02 | Warning | DataStore has no EF Core migrations | [DataStore] has a generated DbContext but no Migration subclass — run dotnet ef migrations add |
— |
Marten (DSMRT)¶
Diagnostics for Marten event store backend integration.
| ID | Severity | Title | Description | Code Fix |
|---|---|---|---|---|
| DSMRT01 | Warning | StreamId backing type should be Guid | [StreamId] uses a backing type other than Guid — Marten defaults to Guid stream identity |
— |
Docs Module (DSDOC)¶
Diagnostics for [DocsModule] — compile-time documentation generation from bounded context models.
| ID | Severity | Title | Description | Code Fix |
|---|---|---|---|---|
| DSDOC01 | Error | DocsModule class must be partial | Class has [DocsModule] but is not declared as partial |
Add partial modifier |
| DSDOC02 | Error | DocsModule class must be static | Class has [DocsModule] but is not declared as static |
Add static modifier |
| ~~DSDOC03~~ | — | ~~Removed~~ | Docs are now kept current automatically by deepstaging sync |
— |
Quick Lookup¶
All diagnostics sorted by ID for quick reference:
| ID | Module | Title |
|---|---|---|
| DSCFG01 | Configuration | ConfigRoot class must be partial |
| DSCFG02 | Configuration | ConfigRoot class should be sealed |
| DSCFG03 | Configuration | Section name could not be inferred |
| DSCFG04 | Configuration | Exposed type has no properties |
| DSCFG05 | Configuration | Property may contain secrets |
| ~~DSCFG06~~ | Configuration | ~~Removed — config sync is automatic~~ |
| DSCFG07 | Configuration | UserSecretsId may be missing |
| DSCFG09 | Configuration | User secrets can be synced |
| DSCFG10 | Configuration | Infrastructure config section available |
| DSCFG11 | Configuration | ConfigModule class must be partial |
| DSCFG12 | Configuration | ConfigModule class must be static |
| DSDS01 | Data Store | DataStore class must be partial |
| DSDS02 | Data Store | DataStore class should be static |
| DSDS03 | Data Store | StoredEntity class must be partial |
| DSDS04 | Data Store | StoredEntity must have a TypedId property |
| DSDS05 | Data Store | Only one DataStore allowed per assembly |
| DSDS06 | Data Store | ForeignKey target must be a StoredEntity |
| DSDS07 | Data Store | CompositeKey property not found |
| DSDS08 | Data Store | StoredEntity without DataStore container |
| DSDSP01 | Dispatch | DispatchModule class must be partial |
| DSDSP02 | Dispatch | DispatchModule class must be static |
| DSDSP03 | Dispatch | CommandHandler method must be static |
| DSDSP04 | Dispatch | QueryHandler method must be static |
| DSDSP05 | Dispatch | CommandHandler method has invalid signature |
| DSDSP06 | Dispatch | QueryHandler method has invalid signature |
| DSDSP07 | Dispatch | ValidatorType is missing a Validate method |
| DSDSP08 | Dispatch | AuthPolicies class must be static partial |
| DSDSP09 | Dispatch | AuthPolicy method has invalid signature |
| DSDSP10 | Dispatch | Validated and ValidatorType conflict |
| DSDSP11 | Dispatch | Validated but no rules |
| DSDSP12 | Dispatch | Wrong Validate return type |
| DSDSP13 | Dispatch | Add custom validators |
| DSDSP14 | Dispatch | Handler has no access control attribute |
| DSEFX01 | Effects | EffectsModule class must be partial |
| DSEFX02 | Effects | EffectsModule class should be sealed |
| DSEFX03 | Effects | EffectsModule target should be interface |
| DSEFX04 | Effects | Duplicate EffectsModule target type |
| DSEFX05 | Effects | Excluded method not found |
| DSEFX06 | Effects | IncludeOnly method not found |
| DSEFX07 | Effects / Testing | EffectsModule target has no methods / Generate capability test scenarios |
| DSEFX08 | Effects | Recovery fallback not found |
| DSEFX09 | Effects | Recover must specify strategy |
| DSEQ01 | Event Queue | EventQueue class must be partial |
| DSEQ02 | Event Queue | EventQueue class should be static |
| DSEQ03 | Event Queue | EventQueueHandler class must be static |
| DSEQ04 | Event Queue | EventQueueHandler has no handler methods |
| DSEQ05 | Event Queue | EventQueueHandler references unknown queue |
| DSEQ06 | Integration Events | Event type missing [IntegrationEvent] |
| DSEQ07 | Integration Events | Topic type missing [IntegrationEventTopic] |
| DSEQ09 | Integration Events | IntegrationEventHandler class must be static |
| DSEQ10 | Integration Events | IntegrationEventHandler has no handler methods |
| DSES01 | Event Store | EventStore class must be partial |
| DSES02 | Event Store | EventStore class should be static |
| DSES03 | Event Store | EventSourcedAggregate class must be partial |
| DSES04 | Event Store | Only one EventStore allowed per assembly |
| DSES05 | Event Store | EventSourcedAggregate without EventStore container |
| DSES06 | Event Store | EventSourcedAggregate must have a StreamId property |
| DSHTTP01 | HTTP Client | HttpClient class must be partial |
| DSHTTP02 | HTTP Client | HTTP method must be partial |
| DSHTTP04 | HTTP Client | HTTP path must not be empty |
| DSHTTP05 | HTTP Client | Form and Body cannot be combined |
| DSID01 | Typed IDs | TypedId struct must be partial |
| DSID02 | Typed IDs | TypedId struct should be readonly |
| DSID03 | Typed IDs | StreamId requires TypedId |
| DSID04 | Typed IDs | StreamId requires Guid or String backing type |
| DSID05 | Typed IDs | TypedId references unknown profile |
| DSID06 | Typed IDs | Duplicate default TypedId profile |
| DSJOB01 | Background Jobs | JobHandler method must be static |
| DSJOB02 | Background Jobs | JobHandler has invalid signature |
| DSJOB03 | Background Jobs | BackgroundJob has no handler |
| DSJOB04 | Background Jobs | DeduplicateBy property not found |
| DSMRT01 | Marten | StreamId backing type should be Guid |
| DSPG01 | PostgreSQL | TypedId must include EfCoreValueConverter |
| DSPG02 | PostgreSQL | DataStore has no EF Core migrations |
| DSRT01 | Runtime | Runtime class must be partial |
| DSRT02 | Runtime | Uses attribute requires Runtime |
| DSRT03 | Runtime | Uses target must be EffectsModule, ConfigModule, or Capability |
| DSRT04 | Runtime | Effects module available but unreferenced |
| DSAT01 | Azure Table Storage | TableEntity must be partial |
| DSAT02 | Azure Table Storage | TableEntity must have a PartitionKey |
| DSAT03 | Azure Table Storage | TableEntity must have a RowKey |
| DSAT04 | Azure Table Storage | Property will be JSON-serialized |
| DSAT10 | Azure Table Storage | TableStore must be partial |
| DSAT11 | Azure Table Storage | TableStore should be static |
| DSDOC01 | Docs Module | DocsModule class must be partial |
| DSDOC02 | Docs Module | DocsModule class must be static |
| ~~DSDOC03~~ | Docs Module | ~~Removed — docs sync is automatic~~ |