Research conducted on modern AI coding assistants (Cursor, GitHub Copilot, Cline,
Aider, Windsurf, Replit Agent) to understand architecture patterns, context management,
code editing workflows, and tool use protocols.
Key Decision: Pivoted from building full CLI (40-50h) to validation-driven MCP-first
approach (10-15h). Build 5 core CODEX MCP tools that work with ANY coding assistant,
validate adoption over 2-4 weeks, then decide on full CLI if demand proven.
Files:
- research/ai-systems/modern-coding-assistants-architecture.md (comprehensive research)
- research/ai-systems/codex-coding-assistant-implementation-plan.md (original CLI plan, preserved)
- research/ai-systems/codex-mcp-tools-implementation-plan.md (approved MCP-first plan)
- ideas/registry.json (updated with approved MCP tools proposal)
Architech Validation: APPROVED with pivot to MCP-first approach
Human Decision: Approved (pragmatic validation-driven development)
Next: Begin Phase 1 implementation (10-15 hours, 5 core MCP tools)
🤖 Generated with CODEX Research System
Co-Authored-By: The Archivist <archivist@codex.svrnty.io>
Co-Authored-By: The Architech <architech@codex.svrnty.io>
Co-Authored-By: Mathias Beaulieu-Duncan <mat@svrnty.io>
128 lines
3.0 KiB
C#
128 lines
3.0 KiB
C#
using Xunit;
|
|
using OpenHarbor.MCP.Gateway.Core.Configuration;
|
|
|
|
namespace OpenHarbor.MCP.Gateway.Core.Tests.Configuration;
|
|
|
|
/// <summary>
|
|
/// Unit tests for RoutingConfig following TDD approach.
|
|
/// Tests routing configuration and validation.
|
|
/// </summary>
|
|
public class RoutingConfigTests
|
|
{
|
|
[Fact]
|
|
public void RoutingConfig_DefaultStrategy_IsRoundRobin()
|
|
{
|
|
// Arrange & Act
|
|
var config = new RoutingConfig();
|
|
|
|
// Assert
|
|
Assert.Equal("RoundRobin", config.Strategy);
|
|
}
|
|
|
|
[Fact]
|
|
public void RoutingConfig_WithCustomStrategy_StoresCorrectly()
|
|
{
|
|
// Arrange & Act
|
|
var config = new RoutingConfig
|
|
{
|
|
Strategy = "ToolBased",
|
|
ToolMapping = new Dictionary<string, string>
|
|
{
|
|
{ "search_*", "server-1" },
|
|
{ "get_*", "server-2" }
|
|
}
|
|
};
|
|
|
|
// Assert
|
|
Assert.Equal("ToolBased", config.Strategy);
|
|
Assert.NotNull(config.ToolMapping);
|
|
Assert.Equal(2, config.ToolMapping.Count);
|
|
}
|
|
|
|
[Fact]
|
|
public void RoutingConfig_WithClientBasedStrategy_StoresClientMapping()
|
|
{
|
|
// Arrange & Act
|
|
var config = new RoutingConfig
|
|
{
|
|
Strategy = "ClientBased",
|
|
ClientMapping = new Dictionary<string, string>
|
|
{
|
|
{ "web-client", "server-1" },
|
|
{ "mobile-client", "server-2" }
|
|
}
|
|
};
|
|
|
|
// Assert
|
|
Assert.Equal("ClientBased", config.Strategy);
|
|
Assert.NotNull(config.ClientMapping);
|
|
Assert.Equal("server-1", config.ClientMapping["web-client"]);
|
|
}
|
|
|
|
[Fact]
|
|
public void RoutingConfig_WithRetrySettings_StoresCorrectly()
|
|
{
|
|
// Arrange & Act
|
|
var config = new RoutingConfig
|
|
{
|
|
EnableRetry = true,
|
|
MaxRetryAttempts = 3,
|
|
RetryDelayMs = 1000
|
|
};
|
|
|
|
// Assert
|
|
Assert.True(config.EnableRetry);
|
|
Assert.Equal(3, config.MaxRetryAttempts);
|
|
Assert.Equal(1000, config.RetryDelayMs);
|
|
}
|
|
|
|
[Fact]
|
|
public void RoutingConfig_Validate_WithValidStrategy_ReturnsTrue()
|
|
{
|
|
// Arrange
|
|
var config = new RoutingConfig
|
|
{
|
|
Strategy = "RoundRobin"
|
|
};
|
|
|
|
// Act
|
|
var isValid = config.Validate();
|
|
|
|
// Assert
|
|
Assert.True(isValid);
|
|
}
|
|
|
|
[Fact]
|
|
public void RoutingConfig_Validate_WithInvalidStrategy_ReturnsFalse()
|
|
{
|
|
// Arrange
|
|
var config = new RoutingConfig
|
|
{
|
|
Strategy = "InvalidStrategy"
|
|
};
|
|
|
|
// Act
|
|
var isValid = config.Validate();
|
|
|
|
// Assert
|
|
Assert.False(isValid);
|
|
}
|
|
|
|
[Fact]
|
|
public void RoutingConfig_Validate_ToolBasedWithoutMapping_ReturnsFalse()
|
|
{
|
|
// Arrange
|
|
var config = new RoutingConfig
|
|
{
|
|
Strategy = "ToolBased",
|
|
ToolMapping = null
|
|
};
|
|
|
|
// Act
|
|
var isValid = config.Validate();
|
|
|
|
// Assert
|
|
Assert.False(isValid);
|
|
}
|
|
}
|