Issue Labels
Issue Body
## Environment
- **code-review-graph version:** 2.3.2
- **Python:** 3.12
- **Platform:** macOS (Darwin)
---
## Bug 1: `analysis_tools.py` — `repo_root` type mismatch
### Problem
All 5 functions in `tools/analysis_tools.py` call `_validate_repo_root(repo_root)` directly, passing a bare `str`. But `_validate_repo_root` in `tools/_common.py:61` expects a `Path` object:
```python
# _common.py:68
def _validate_repo_root(path: Path) -> Path:
resolved = path.resolve() # ← AttributeError on str
Error: AttributeError: 'str' object has no attribute 'resolve'
Affected MCP tools: get_hub_nodes_tool, get_bridge_nodes_tool, get_knowledge_gaps_tool, get_surprising_connections_tool, get_suggested_questions_tool
Why other tools work
All other modules call _get_store(repo_root) which internally wraps with Path(). Only analysis_tools.py bypasses this.
Fix (5 lines)
In tools/analysis_tools.py, replace all instances of:
root = _validate_repo_root(repo_root)
store = _get_store(str(root))
with:
store, root = _get_store(repo_root)
Bug 2: graph.py — get_communities_list returns incomplete sqlite3.Row
Problem
# graph.py:1091
"SELECT id, name FROM communities"
But analysis.py:148 does c.get("size", 0) — two problems:
- Missing
size column in the SELECT
sqlite3.Row has no .get() method (crashes with AttributeError: 'sqlite3.Row' object has no attribute 'get')
Affected: get_knowledge_gaps_tool, get_suggested_questions_tool
Fix
def get_communities_list(self) -> list[dict]:
try:
return [
dict(r)
for r in self._conn.execute(
"SELECT id, name, size, level, cohesion, dominant_language "
"FROM communities"
).fetchall()
]
except sqlite3.OperationalError as exc:
logger.debug("Communities list unavailable: %s", exc)
return []
Combined Impact
7 out of ~20 MCP tools are completely non-functional in v2.3.2.
Both fixes are minimal, non-breaking, and follow the existing code patterns.
Issue Labels
Issue Body
Error:
AttributeError: 'str' object has no attribute 'resolve'Affected MCP tools:
get_hub_nodes_tool,get_bridge_nodes_tool,get_knowledge_gaps_tool,get_surprising_connections_tool,get_suggested_questions_toolWhy other tools work
All other modules call
_get_store(repo_root)which internally wraps withPath(). Onlyanalysis_tools.pybypasses this.Fix (5 lines)
In
tools/analysis_tools.py, replace all instances of:with:
Bug 2:
graph.py—get_communities_listreturns incompletesqlite3.RowProblem
But
analysis.py:148doesc.get("size", 0)— two problems:sizecolumn in the SELECTsqlite3.Rowhas no.get()method (crashes withAttributeError: 'sqlite3.Row' object has no attribute 'get')Affected:
get_knowledge_gaps_tool,get_suggested_questions_toolFix
Combined Impact
7 out of ~20 MCP tools are completely non-functional in v2.3.2.
Both fixes are minimal, non-breaking, and follow the existing code patterns.