amirkiarafiei commited on
Commit
9d6b77b
·
1 Parent(s): 363d5b1

feat: add prompt for bug report augmentation

Browse files
Files changed (1) hide show
  1. main.py +29 -2
main.py CHANGED
@@ -1,4 +1,4 @@
1
- from typing import AsyncIterator, List
2
  from contextlib import asynccontextmanager
3
  import httpx
4
  from fastmcp import FastMCP, Context
@@ -27,7 +27,6 @@ async def ds_lifespan(server: FastMCP) -> AsyncIterator[DSContext]:
27
  mcp = FastMCP(name="defect-solver-server", lifespan=ds_lifespan)
28
 
29
 
30
-
31
  @mcp.tool(
32
  name="multi_module_bug_localization",
33
  description=(
@@ -200,6 +199,34 @@ async def search_space_routing(request: SearchSpaceRoutingRequest, ctx: Context)
200
  return {"error": "Unexpected error", "details": str(e)}
201
 
202
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
 
204
  if __name__ == "__main__":
205
  mcp.run(transport="streamable-http")
 
1
+ from typing import AsyncIterator
2
  from contextlib import asynccontextmanager
3
  import httpx
4
  from fastmcp import FastMCP, Context
 
27
  mcp = FastMCP(name="defect-solver-server", lifespan=ds_lifespan)
28
 
29
 
 
30
  @mcp.tool(
31
  name="multi_module_bug_localization",
32
  description=(
 
199
  return {"error": "Unexpected error", "details": str(e)}
200
 
201
 
202
+ @mcp.prompt(
203
+ title="Augment Bug Report"
204
+ )
205
+ async def augment_bug_report(raw_bug_description: str) -> str:
206
+ return f"""
207
+ You are a bug localization expert with access to this codebase. Your task is to augment the bug description with technical details that help pinpoint the bug location.
208
+
209
+ Original bug description:
210
+ \"\"\"
211
+ {raw_bug_description}
212
+ \"\"\"
213
+
214
+ Steps:
215
+ 1. **Analyze the codebase** - Examine project structure, modules, and architectural patterns
216
+ 2. **Map bug to code** - Identify likely affected areas based on the bug symptoms
217
+ 3. **Augment the description** - Add:
218
+ - Specific module/package/class names that might be involved
219
+ - File types, naming patterns, and directory paths
220
+ - Technical keywords, error types, and exception names
221
+ - Affected architectural layers and components
222
+ - Cross-cutting concerns and dependencies
223
+ - External system interactions or API calls
224
+ - Component relationships that could cause the bug
225
+
226
+ Return a 2-3x more detailed bug report with precise technical terms for effective bug localization.
227
+ """
228
+
229
+
230
 
231
  if __name__ == "__main__":
232
  mcp.run(transport="streamable-http")