[Design] PluginSystemOptions.RegisteredALCs is hidden mutable state — side-channel coupling between PluginLoader and PluginManager
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start with Plugins/FluentCMS.Infrastructure.Plugins/PluginSystemOptions.cs at the RegisteredALCs property, then trace PluginLoader.LoadPluginTypes and the PluginManager call sites that consume the list. Define the result shape described in the issue, pass it directly between the components, and remove the runtime registry from the options object. Done means the data flow is explicit and existing plugin behavior remains intact.
Written by the indexing model from the issue text.
Description
Summary
PluginSystemOptions contains an internal mutable list of AssemblyLoadContext instances (RegisteredALCs). This list is populated by PluginLoader and consumed by PluginManager. Using a public options/configuration object as a hidden communication channel between two components is an anti-pattern: the options class should carry only configuration values, not mutable runtime state.
Location
Plugins/FluentCMS.Infrastructure.Plugins/PluginSystemOptions.cs — line 51
Problematic Code
internal List<AssemblyLoadContext> RegisteredALCs { get; } = [];
Impact
- Hidden coupling:
PluginLoaderandPluginManagerare implicitly coupled through the shared options object with no documented contract. - Unexpected mutation: Any component that holds a reference to
PluginSystemOptionscan observe or modify the ALC list, which should be an implementation detail. - Testing difficulty: Creating a
PluginSystemOptionsinstance in tests doesn't give the expected clean state without knowing about this hidden list. - Violation of SRP:
PluginSystemOptionsnow serves two roles: configuration data-bag and runtime ALC registry.
Recommendation
Remove RegisteredALCs from PluginSystemOptions and change LoadPluginTypes to return a result type that packages both outputs together:
public record PluginLoadResult(
IReadOnlyList<Type> PluginTypes,
IReadOnlyList<AssemblyLoadContext> LoadContexts
);
// PluginLoader.LoadPluginTypes() returns PluginLoadResult
// PluginManager receives PluginLoadResult directly
This makes the data-flow explicit and removes the hidden state from the configuration object.
Severity
🔵 Design / Maintainability
- Dominant language
- C#
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fluentcms/FluentCMS.Infrastructure
-
bug security
Difficulty 5/5 Over a week Newbie friendliness 35/100
All issues in fluentcms/FluentCMS.Infrastructure
Similar issues
-
[Feat] 조합 영역 구분선 개선 Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100