Skip to content

Harden plugin registry diagnostics for multi-assembly merges (DP033+) #108

Description

@Skymly

Summary

Extend compile-time diagnostics for multi-assembly partial registries after the plugin-assembly pattern is documented and tested. Improve failure modes when provider projects contribute conflicting or incomplete registrations.

Proposed diagnostics

ID Severity Trigger
DP033 Error Duplicate strategy key across assemblies merging into the same partial *Registry
DP034 Info Provider assembly is referenced but its strategy key never appears in sample/config documentation (documentation hint; optional)

DP032 (warning when RegistryConfiguration key literal is absent from App.config) is explicitly out of scope unless a follow-up proves compile-time config analysis is worthwhile.

Documentation

  • Add companion-type registration guidance to docs/PluginAssemblies.md: related contracts share the same strategy key via separate [RegisterStrategy] attributes; host module calls RegisterAutofac on each registry
  • Document evaluation path for multi-interface Autofac registration (As<TContract>().As<TAdditional>()): manual module supplement in v1; assess AdditionalContracts generator parameter only if sample friction warrants it

Acceptance criteria

  • DP033 implemented with analyzer/generator tests and entries in DesignPatterns.Diagnostics
  • User-facing diagnostics documented in DesignPatterns.Docs (DP033 anchor; DP034 if shipped)
  • No false positives on intentional single-assembly registries
  • ROADMAP next-available diagnostic ID updated

Dependencies

  • Plugin assembly documentation + cross-project tests (related issue)
  • RegistryConfiguration helpers (related issue) for end-to-end sample wiring in a follow-up PR

Non-goals

  • App.config MSBuild analyzer (DP032)
  • New [RegisterStrategyBundle] attribute — defer unless companion-type boilerplate becomes excessive

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions