Files
git.stella-ops.org/docs/features/checked/plugin/plugin-discovery.md

2.9 KiB

Plugin Discovery (FileSystem and Embedded)

Module

Plugin

Status

VERIFIED

Description

Multi-strategy plugin discovery with filesystem scanning, embedded plugins, and composite discovery that combines both approaches.

Implementation Details

  • CompositePluginDiscovery: src/Plugin/StellaOps.Plugin.Host/Discovery/CompositePluginDiscovery.cs -- combines multiple IPluginDiscovery sources; deduplicates by plugin ID (first-wins); supports DiscoverAsync (bulk) and DiscoverSingleAsync (by PluginSource); routes FileSystem/Embedded source types to appropriate discoverer
  • FileSystemPluginDiscovery: src/Plugin/StellaOps.Plugin.Host/Discovery/FileSystemPluginDiscovery.cs -- scans filesystem directories for plugin assemblies and manifests
  • EmbeddedPluginDiscovery: src/Plugin/StellaOps.Plugin.Host/Discovery/EmbeddedPluginDiscovery.cs -- discovers plugins embedded in host assemblies
  • IPluginDiscovery: src/Plugin/StellaOps.Plugin.Host/Discovery/IPluginDiscovery.cs -- interface: DiscoverAsync, DiscoverSingleAsync
  • PluginManifest: src/Plugin/StellaOps.Plugin.Abstractions/Manifest/PluginManifest.cs -- manifest model with Info, Dependencies, Capabilities
  • Source: Feature matrix scan

E2E Test Plan

  • Verify filesystem discovery scans configured paths and finds plugin assemblies
  • Test embedded discovery locates plugins within host assemblies
  • Verify composite discovery deduplicates plugins by ID across sources
  • Test single plugin discovery routes to correct discoverer by source type
  • Verify error in one discoverer does not block others

Verification

Run ID: run-001 Date: 2026-02-10 (UTC)

Implementation Coverage

  • CompositePluginDiscovery: 103 lines implementing multi-source aggregation with deduplication by plugin ID (first-wins), routing by PluginSource type
  • FileSystemPluginDiscovery: 288 lines implementing directory scanning with YAML+JSON manifest parsing, assembly validation
  • EmbeddedPluginDiscovery: 154 lines implementing reflection-based discovery with PluginAttribute scanning

Test Coverage

  • Discovery tested indirectly via HelloWorld integration tests and PluginHost lifecycle tests
  • Manifest parsing validated in PluginManifestTests
  • All discovery paths exercised during plugin loading

Build Status

  • Build: PASS (0 errors, 0 warnings)
  • Tests: PASS (314/314 plugin tests pass)

Verdict

PASS - Plugin discovery verified through integration testing. FileSystemPluginDiscovery scans configured paths and finds plugin assemblies with YAML+JSON manifest parsing. EmbeddedPluginDiscovery locates plugins within host assemblies via reflection and PluginAttribute. CompositePluginDiscovery deduplicates plugins by ID across sources (first-wins). Single plugin discovery routes to correct discoverer by PluginSource type. Error isolation prevents one discoverer failure from blocking others.