refactor(daemon): drop assigned-but-unread composition handles

Three exported Daemon fields were wired by the composition root and read
nowhere: CapabilityHost (*plugin.Host), Curators (*curator.Registry) and
ToolRegistry (*tools.Registry). No field access exists anywhere in the
repo, and git history shows no read ever existed.

Each handle has a live owner outside the daemon: the curator
registry/runtime is boot-owned (the curator isolation invariant keeps it
off the agent loop), the capability host is lifecycle-owned by the
composition root and consumed by the control plane, and the tool registry
is consumed by chat, curator and MCP wiring. Keeping the daemon copies was
decorative wiring, so the fields, their composition assignments and the
now-unused plugin/curator imports go together.

The daemon architecture test now refuses the three names, and the plugin
host contract test refuses a CapabilityHost: handle on the daemon alongside
the PluginRegistry: one it already refused.
This commit is contained in:
sam committed 2026-10-02 12:57:53 +10:00
1 parent f6037e0d76
commit 92ea5dee56
4 files changed
+21 -23

No files matched your search

+8 -3
View File
@@ -113,7 +113,6 @@ func TestArchiedWiresCapabilityHostLifecycle(t *testing.T) {
"capabilityHost.Register(",
"capabilityHost.Start(",
"capabilityHost.Stop(",
"CapabilityHost:",
} {
if !strings.Contains(wiring, required) {
t.Errorf("cmd/archied does not contain capability-host wiring %q", required)
@@ -126,8 +125,14 @@ func TestArchiedWiresCapabilityHostLifecycle(t *testing.T) {
if !strings.Contains(before, "capabilityHost.Stop(") {
t.Error("capability host cleanup must be registered before Start so failed rollback cleanup is retried")
}
if strings.Contains(wiring, "PluginRegistry:") {
t.Error("daemon composition exposes divergent legacy plugin inventory")
// The host lifecycle belongs to the composition root, which the control
// plane and gateway consume. A CapabilityHost field on the daemon would be
// assigned there and read nowhere -- the same defect PluginRegistry: had --
// so both spellings are refused.
for _, forbidden := range []string{"PluginRegistry:", "CapabilityHost:"} {
if strings.Contains(wiring, forbidden) {
t.Errorf("daemon composition carries an unread capability handle %q; the composition root owns the host lifecycle", forbidden)
}
}
}