@@ -111,16 +111,18 @@ func TestResult_MCPServers(t *testing.T) {
111111 },
112112 },
113113 {
114- name : "MCP servers from rules without IDs" ,
114+ name : "MCP servers from rules without explicit IDs in frontmatter " ,
115115 result : Result {
116116 Rules : []markdown.Markdown [markdown.RuleFrontMatter ]{
117117 {
118118 FrontMatter : markdown.RuleFrontMatter {
119+ ID : "rule-file-1" , // ID is auto-set to filename during loading
119120 MCPServer : mcp.MCPServerConfig {Type : mcp .TransportTypeStdio , Command : "server1" },
120121 },
121122 },
122123 {
123124 FrontMatter : markdown.RuleFrontMatter {
125+ ID : "rule-file-2" , // ID is auto-set to filename during loading
124126 MCPServer : mcp.MCPServerConfig {Type : mcp .TransportTypeStdio , Command : "server2" },
125127 },
126128 },
@@ -130,8 +132,8 @@ func TestResult_MCPServers(t *testing.T) {
130132 },
131133 },
132134 want : map [string ]mcp.MCPServerConfig {
133- "rule-0 " : {Type : mcp .TransportTypeStdio , Command : "server1" },
134- "rule-1 " : {Type : mcp .TransportTypeStdio , Command : "server2" },
135+ "rule-file-1 " : {Type : mcp .TransportTypeStdio , Command : "server1" },
136+ "rule-file-2 " : {Type : mcp .TransportTypeStdio , Command : "server2" },
135137 },
136138 },
137139 {
@@ -185,23 +187,24 @@ func TestResult_MCPServers(t *testing.T) {
185187 },
186188 },
187189 {
188- name : "mixed rules with and without IDs" ,
190+ name : "mixed rules with explicit and auto-generated IDs" ,
189191 result : Result {
190192 Rules : []markdown.Markdown [markdown.RuleFrontMatter ]{
191193 {
192194 FrontMatter : markdown.RuleFrontMatter {
193- ID : "explicit-id" ,
195+ ID : "explicit-id" , // Explicit ID in frontmatter
194196 MCPServer : mcp.MCPServerConfig {Type : mcp .TransportTypeStdio , Command : "server1" },
195197 },
196198 },
197199 {
198200 FrontMatter : markdown.RuleFrontMatter {
201+ ID : "some-rule" , // ID auto-set to filename during loading
199202 MCPServer : mcp.MCPServerConfig {Type : mcp .TransportTypeStdio , Command : "server2" },
200203 },
201204 },
202205 {
203206 FrontMatter : markdown.RuleFrontMatter {
204- ID : "another-id" ,
207+ ID : "another-id" , // Explicit ID in frontmatter
205208 MCPServer : mcp.MCPServerConfig {Type : mcp .TransportTypeHTTP , URL : "https://example.com" },
206209 },
207210 },
@@ -212,7 +215,7 @@ func TestResult_MCPServers(t *testing.T) {
212215 },
213216 want : map [string ]mcp.MCPServerConfig {
214217 "explicit-id" : {Type : mcp .TransportTypeStdio , Command : "server1" },
215- "rule-1" : {Type : mcp .TransportTypeStdio , Command : "server2" },
218+ "some-rule" : {Type : mcp .TransportTypeStdio , Command : "server2" },
216219 "another-id" : {Type : mcp .TransportTypeHTTP , URL : "https://example.com" },
217220 },
218221 },
0 commit comments