From c42e7ad05091a98c367efcf50cb4f6956d0b5f64 Mon Sep 17 00:00:00 2001 From: Virgil Date: Thu, 2 Apr 2026 17:35:43 +0000 Subject: [PATCH] fix(mcp): harden subsystem interface contracts --- pkg/mcp/agentic/prep.go | 6 ++++++ pkg/mcp/brain/brain.go | 6 ++++++ pkg/mcp/brain/direct.go | 6 ++++++ pkg/mcp/ide/ide.go | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/pkg/mcp/agentic/prep.go b/pkg/mcp/agentic/prep.go index 55aae8d..fdfa121 100644 --- a/pkg/mcp/agentic/prep.go +++ b/pkg/mcp/agentic/prep.go @@ -36,6 +36,12 @@ type PrepSubsystem struct { notifier coremcp.Notifier } +var ( + _ coremcp.Subsystem = (*PrepSubsystem)(nil) + _ coremcp.SubsystemWithShutdown = (*PrepSubsystem)(nil) + _ coremcp.SubsystemWithNotifier = (*PrepSubsystem)(nil) +) + // NewPrep creates an agentic subsystem. // // prep := NewPrep() diff --git a/pkg/mcp/brain/brain.go b/pkg/mcp/brain/brain.go index d8b1e3f..87357dc 100644 --- a/pkg/mcp/brain/brain.go +++ b/pkg/mcp/brain/brain.go @@ -23,6 +23,12 @@ type Subsystem struct { notifier coremcp.Notifier } +var ( + _ coremcp.Subsystem = (*Subsystem)(nil) + _ coremcp.SubsystemWithShutdown = (*Subsystem)(nil) + _ coremcp.SubsystemWithNotifier = (*Subsystem)(nil) +) + // New creates a brain subsystem that uses the given IDE bridge for Laravel communication. // // brain := New(ideBridge) diff --git a/pkg/mcp/brain/direct.go b/pkg/mcp/brain/direct.go index 739b9a6..85beccc 100644 --- a/pkg/mcp/brain/direct.go +++ b/pkg/mcp/brain/direct.go @@ -35,6 +35,12 @@ type DirectSubsystem struct { onChannel channelSender } +var ( + _ coremcp.Subsystem = (*DirectSubsystem)(nil) + _ coremcp.SubsystemWithShutdown = (*DirectSubsystem)(nil) + _ coremcp.SubsystemWithChannelCallback = (*DirectSubsystem)(nil) +) + // OnChannel sets a callback for channel event broadcasting. // Called by the MCP service after creation to wire up notifications. // diff --git a/pkg/mcp/ide/ide.go b/pkg/mcp/ide/ide.go index 3713d4f..6347788 100644 --- a/pkg/mcp/ide/ide.go +++ b/pkg/mcp/ide/ide.go @@ -35,6 +35,12 @@ type Subsystem struct { activity []ActivityEvent } +var ( + _ coremcp.Subsystem = (*Subsystem)(nil) + _ coremcp.SubsystemWithShutdown = (*Subsystem)(nil) + _ coremcp.SubsystemWithNotifier = (*Subsystem)(nil) +) + // New creates an IDE subsystem from a Config DTO. // // cfg := DefaultConfig()