From 1b0133d7b72fa8cf64c5c3e767fa1122470a2c09 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Sun, 20 Sep 2026 11:38:15 +1000 Subject: [PATCH] refactor(plugin): delete the unused Registry type Registry carried no plugin identity, discovery, compatibility or lifecycle, so it was never the seed for the approved internal/domain/plugin package. Host, Manifest and Module are, and they stay. Regenerating pluginextract strips the interface-wrapper nil guards, so those are restored by hand; the only intended change to the generated table is dropping the Registry symbol. --- internal/plugin/plugin.go | 13 ------------- internal/plugin/plugin_test.go | 6 +----- ..._com-samcharles93-archie-core-internal-plugin.go | 1 - internal/plugin/pluginextract/pluginextract_test.go | 7 ------- 4 files changed, 1 insertion(+), 26 deletions(-) diff --git a/internal/plugin/plugin.go b/internal/plugin/plugin.go index 300633bae..1d557271c 100644 --- a/internal/plugin/plugin.go +++ b/internal/plugin/plugin.go @@ -26,19 +26,6 @@ type Plugin interface { Version() string } -// Registry holds loaded plugins and dispatches extension point calls. -type Registry struct { - plugins []Plugin -} - -// Register adds a plugin to the registry. -func (r *Registry) Register(p Plugin) { - r.plugins = append(r.plugins, p) -} - -// Plugins returns all registered plugins. -func (r *Registry) Plugins() []Plugin { return r.plugins } - // LoadDir discovers and evaluates .go files in the given directory. // Each file must export a variable named "Plugin" that implements the // Plugin interface. Failed plugins are logged and skipped -- the daemon diff --git a/internal/plugin/plugin_test.go b/internal/plugin/plugin_test.go index 5f8951ec9..5c6af6081 100644 --- a/internal/plugin/plugin_test.go +++ b/internal/plugin/plugin_test.go @@ -10,7 +10,7 @@ import ( "github.com/samcharles93/archie-core/internal/plugin/pluginextract" ) -// ── Plugin interface and registry ──────────────────────────────────── +// ── Plugin interface ───────────────────────────────────────────────── func TestPluginInterfaceExists(t *testing.T) { var p plugin.Plugin @@ -22,10 +22,6 @@ func TestPluginInterfaceExists(t *testing.T) { var _ nameVersioner = p } -func TestRegistryExists(t *testing.T) { - _ = &plugin.Registry{} -} - // ── LoadDir behavioral tests ───────────────────────────────────────── var symbols = pluginextract.Symbols diff --git a/internal/plugin/pluginextract/github_com-samcharles93-archie-core-internal-plugin.go b/internal/plugin/pluginextract/github_com-samcharles93-archie-core-internal-plugin.go index 25e4f4f59..eea32b2cb 100644 --- a/internal/plugin/pluginextract/github_com-samcharles93-archie-core-internal-plugin.go +++ b/internal/plugin/pluginextract/github_com-samcharles93-archie-core-internal-plugin.go @@ -25,7 +25,6 @@ func init() { "Module": reflect.ValueOf((*plugin.Module)(nil)), "Permission": reflect.ValueOf((*plugin.Permission)(nil)), "Plugin": reflect.ValueOf((*plugin.Plugin)(nil)), - "Registry": reflect.ValueOf((*plugin.Registry)(nil)), // interface wrapper definitions "_Module": reflect.ValueOf((*_github_com_samcharles93_archie_core_internal_plugin_Module)(nil)), diff --git a/internal/plugin/pluginextract/pluginextract_test.go b/internal/plugin/pluginextract/pluginextract_test.go index baeeb3e55..6564480d6 100644 --- a/internal/plugin/pluginextract/pluginextract_test.go +++ b/internal/plugin/pluginextract/pluginextract_test.go @@ -19,13 +19,6 @@ func TestSymbolsContainsExpectedPluginEntries(t *testing.T) { t.Errorf("LoadDir kind = %v, want Func", v.Kind()) } - // Registry must be a pointer type. - if v, ok := pkg["Registry"]; !ok { - t.Error("Registry missing from Symbols") - } else if v.Kind() != reflect.Pointer { - t.Errorf("Registry kind = %v, want Ptr", v.Kind()) - } - // Plugin must be a pointer type. if v, ok := pkg["Plugin"]; !ok { t.Error("Plugin missing from Symbols")