Skip to content

Commit 048b91d

Browse files
committed
fix: clarify architecture prompts to output only structured JSON
Changed 'When complete (STRUCTURED OUTPUT):' to 'When complete, respond with ONLY this JSON (no reasoning, tool_call, or is_final fields):' This prevents the LLM from outputting both the old wrapper format AND the new structured format, which was causing parsing to fail. The LLM should now output JUST: {"analysis": "...", "hub_nodes": [...], ...} Instead of: {"reasoning": "...", "is_final": true} {"analysis": "...", ...}
1 parent e72235c commit 048b91d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/codegraph-mcp/src/architecture_analysis_prompts.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ RESPONSE FORMAT (JSON):
3030
"is_final": false
3131
}
3232
33-
When complete (STRUCTURED OUTPUT):
33+
When complete, respond with ONLY this JSON (no 'reasoning', 'tool_call', or 'is_final' fields):
3434
{
3535
"analysis": "ARCHITECTURE SUMMARY:\n- Coupling metrics: [data]\n- Circular deps: [count]\n- Hub nodes: [list with degrees]\n- Interpretation: [objective observations only]",
3636
"layers": [],
@@ -86,7 +86,7 @@ RESPONSE FORMAT (JSON):
8686
"is_final": false
8787
}
8888
89-
When complete (STRUCTURED OUTPUT):
89+
When complete, respond with ONLY this JSON (no 'reasoning', 'tool_call', or 'is_final' fields):
9090
{
9191
"analysis": "ARCHITECTURE ANALYSIS SUMMARY:\n\n## Coupling Metrics\n- Ca, Ce, I distributions for key nodes\n- Stability zones (stable I<0.3, unstable I>0.7)\n\n## Architectural Hotspots\n- Hub nodes with degrees and coupling metrics\n- God object candidates (high degree + high Ce)\n\n## Dependency Health\n- Circular dependencies count by edge type\n- Problematic dependency patterns\n\n## Change Impact Assessment\n- High-impact nodes (high Ca)\n- Blast radius for critical components\n\n## Interpretation\n[Objective observations only - no prescriptive judgments]",
9292
"layers": ["Layer 1: Infrastructure", "Layer 2: Core"],
@@ -142,7 +142,7 @@ RESPONSE FORMAT (JSON):
142142
"is_final": false
143143
}
144144
145-
When complete (STRUCTURED OUTPUT) - provide comprehensive report:
145+
When complete, respond with ONLY this JSON (no 'reasoning', 'tool_call', or 'is_final' fields):
146146
{
147147
"analysis": "[Detailed architectural analysis with coupling distributions, hub analysis, dependency health, change impact, execution patterns, and objective synthesis]",
148148
"layers": ["Layer 1: Infrastructure", "Layer 2: Core", "Layer 3: Application"],
@@ -194,7 +194,7 @@ RESPONSE FORMAT (JSON):
194194
"is_final": false
195195
}
196196
197-
When complete (STRUCTURED OUTPUT) - provide exhaustive report:
197+
When complete, respond with ONLY this JSON (no 'reasoning', 'tool_call', or 'is_final' fields):
198198
{
199199
"analysis": "[Exhaustive architectural analysis with complete coupling landscape, architectural topology, dependency health, change impact, execution analysis, cross-dimensional patterns, and statistical health metrics]",
200200
"layers": ["Layer 1: Infrastructure", "Layer 2: Core", "Layer 3: Application", "Layer 4: Presentation"],

0 commit comments

Comments
 (0)