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>
98 lines
2.6 KiB
C#
98 lines
2.6 KiB
C#
using Xunit;
|
|
using OpenHarbor.MCP.Gateway.Core.Models;
|
|
|
|
namespace OpenHarbor.MCP.Gateway.Core.Tests.Models;
|
|
|
|
/// <summary>
|
|
/// Unit tests for GatewayRequest and GatewayResponse models following TDD approach.
|
|
/// Tests request/response representation.
|
|
/// </summary>
|
|
public class GatewayRequestResponseTests
|
|
{
|
|
[Fact]
|
|
public void GatewayRequest_WithToolCall_CreatesSuccessfully()
|
|
{
|
|
// Arrange & Act
|
|
var request = new GatewayRequest
|
|
{
|
|
ToolName = "search_documents",
|
|
Arguments = new Dictionary<string, object>
|
|
{
|
|
{ "query", "architecture" },
|
|
{ "limit", 10 }
|
|
}
|
|
};
|
|
|
|
// Assert
|
|
Assert.Equal("search_documents", request.ToolName);
|
|
Assert.NotNull(request.Arguments);
|
|
Assert.Equal("architecture", request.Arguments["query"]);
|
|
Assert.Equal(10, request.Arguments["limit"]);
|
|
}
|
|
|
|
[Fact]
|
|
public void GatewayRequest_WithoutArguments_AllowsNull()
|
|
{
|
|
// Arrange & Act
|
|
var request = new GatewayRequest
|
|
{
|
|
ToolName = "list_tools"
|
|
};
|
|
|
|
// Assert
|
|
Assert.Equal("list_tools", request.ToolName);
|
|
Assert.Null(request.Arguments);
|
|
}
|
|
|
|
[Fact]
|
|
public void GatewayResponse_Success_CreatesSuccessfully()
|
|
{
|
|
// Arrange & Act
|
|
var response = new GatewayResponse
|
|
{
|
|
Success = true,
|
|
Result = new Dictionary<string, object>
|
|
{
|
|
{ "documents", new[] { "doc1", "doc2" } },
|
|
{ "count", 2 }
|
|
}
|
|
};
|
|
|
|
// Assert
|
|
Assert.True(response.Success);
|
|
Assert.NotNull(response.Result);
|
|
Assert.Equal(2, response.Result["count"]);
|
|
Assert.Null(response.Error);
|
|
}
|
|
|
|
[Fact]
|
|
public void GatewayResponse_Error_CreatesSuccessfully()
|
|
{
|
|
// Arrange & Act
|
|
var response = new GatewayResponse
|
|
{
|
|
Success = false,
|
|
Error = "Server unavailable",
|
|
ErrorCode = "SERVER_UNAVAILABLE"
|
|
};
|
|
|
|
// Assert
|
|
Assert.False(response.Success);
|
|
Assert.Equal("Server unavailable", response.Error);
|
|
Assert.Equal("SERVER_UNAVAILABLE", response.ErrorCode);
|
|
Assert.Null(response.Result);
|
|
}
|
|
|
|
[Fact]
|
|
public void GatewayResponse_DefaultState_IsNotSuccess()
|
|
{
|
|
// Arrange & Act
|
|
var response = new GatewayResponse();
|
|
|
|
// Assert
|
|
Assert.False(response.Success);
|
|
Assert.Null(response.Result);
|
|
Assert.Null(response.Error);
|
|
}
|
|
}
|