Background
The project currently has Singleton generation and DI lifetime diagnostics, but lacks a cohesive lifecycle model for async initialization and several common double-owner/mutable-state cases.
Scope
- Add
GenerateSingletonAttribute.InitializeAsync with Task/ValueTask signature validation (DP067).
- Generate
GetInstanceAsync() backed by a lazy async singleton.
- Add analyzer diagnostics for generated-singleton + DI double registration (
DP068), non-thread-safe mutable instance state (DP069), mutable static singleton candidates (DP070), and mutable static singleton + DI registration (DP071).
- Register the new diagnostics and add generator, analyzer, integration, packaging, and CI coverage.
Acceptance criteria
CiPack passes with zero test failures and zero compile warnings/errors.
- NuGet package and net8.0/net48 consumer smoke verification pass.
- Diagnostic IDs and unshipped release tracking remain synchronized.
Background
The project currently has Singleton generation and DI lifetime diagnostics, but lacks a cohesive lifecycle model for async initialization and several common double-owner/mutable-state cases.
Scope
GenerateSingletonAttribute.InitializeAsyncwithTask/ValueTasksignature validation (DP067).GetInstanceAsync()backed by a lazy async singleton.DP068), non-thread-safe mutable instance state (DP069), mutable static singleton candidates (DP070), and mutable static singleton + DI registration (DP071).Acceptance criteria
CiPackpasses with zero test failures and zero compile warnings/errors.