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>
114 lines
3.0 KiB
C#
114 lines
3.0 KiB
C#
using Xunit;
|
|
using OpenHarbor.MCP.Gateway.Core.Configuration;
|
|
using OpenHarbor.MCP.Gateway.Core.Models;
|
|
|
|
namespace OpenHarbor.MCP.Gateway.Core.Tests.Configuration;
|
|
|
|
/// <summary>
|
|
/// Unit tests for GatewayConfig following TDD approach.
|
|
/// Tests gateway configuration and validation.
|
|
/// </summary>
|
|
public class GatewayConfigTests
|
|
{
|
|
[Fact]
|
|
public void GatewayConfig_WithDefaultValues_CreatesSuccessfully()
|
|
{
|
|
// Arrange & Act
|
|
var config = new GatewayConfig();
|
|
|
|
// Assert
|
|
Assert.NotNull(config);
|
|
Assert.NotNull(config.Servers);
|
|
Assert.Empty(config.Servers);
|
|
Assert.NotNull(config.Routing);
|
|
Assert.NotNull(config.Security);
|
|
}
|
|
|
|
[Fact]
|
|
public void GatewayConfig_WithServers_StoresCorrectly()
|
|
{
|
|
// Arrange & Act
|
|
var config = new GatewayConfig
|
|
{
|
|
Servers = new List<ServerConfig>
|
|
{
|
|
new ServerConfig { Id = "server-1", Name = "Server 1" },
|
|
new ServerConfig { Id = "server-2", Name = "Server 2" }
|
|
}
|
|
};
|
|
|
|
// Assert
|
|
Assert.Equal(2, config.Servers.Count);
|
|
Assert.Contains(config.Servers, s => s.Id == "server-1");
|
|
Assert.Contains(config.Servers, s => s.Id == "server-2");
|
|
}
|
|
|
|
[Fact]
|
|
public void GatewayConfig_WithRoutingConfig_StoresCorrectly()
|
|
{
|
|
// Arrange & Act
|
|
var routingConfig = new RoutingConfig { Strategy = "RoundRobin" };
|
|
var config = new GatewayConfig
|
|
{
|
|
Routing = routingConfig
|
|
};
|
|
|
|
// Assert
|
|
Assert.NotNull(config.Routing);
|
|
Assert.Equal("RoundRobin", config.Routing.Strategy);
|
|
}
|
|
|
|
[Fact]
|
|
public void GatewayConfig_WithSecurityConfig_StoresCorrectly()
|
|
{
|
|
// Arrange & Act
|
|
var securityConfig = new SecurityConfig { EnableAuthentication = true };
|
|
var config = new GatewayConfig
|
|
{
|
|
Security = securityConfig
|
|
};
|
|
|
|
// Assert
|
|
Assert.NotNull(config.Security);
|
|
Assert.True(config.Security.EnableAuthentication);
|
|
}
|
|
|
|
[Fact]
|
|
public void GatewayConfig_Validate_WithValidConfig_ReturnsTrue()
|
|
{
|
|
// Arrange
|
|
var config = new GatewayConfig
|
|
{
|
|
Servers = new List<ServerConfig>
|
|
{
|
|
new ServerConfig { Id = "server-1", Name = "Server 1", TransportType = "Stdio" }
|
|
},
|
|
Routing = new RoutingConfig { Strategy = "RoundRobin" },
|
|
Security = new SecurityConfig { EnableAuthentication = false }
|
|
};
|
|
|
|
// Act
|
|
var isValid = config.Validate();
|
|
|
|
// Assert
|
|
Assert.True(isValid);
|
|
}
|
|
|
|
[Fact]
|
|
public void GatewayConfig_Validate_WithEmptyServers_ReturnsFalse()
|
|
{
|
|
// Arrange
|
|
var config = new GatewayConfig
|
|
{
|
|
Servers = new List<ServerConfig>(),
|
|
Routing = new RoutingConfig { Strategy = "RoundRobin" }
|
|
};
|
|
|
|
// Act
|
|
var isValid = config.Validate();
|
|
|
|
// Assert
|
|
Assert.False(isValid);
|
|
}
|
|
}
|