Files
sanguo_llmwiki/.claude/review_agent.md
T
claude_dev 4cf9fc2e37 fix: 添加连字符扩展的 strip() 处理尾随空格
- 修复 _expand_hyphenated_text() 尾随空格问题
- trailing- → trailing (无尾随空格)
- -leading → leading (无前导空格)
- 所有边缘情况测试通过

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 07:56:19 +08:00

56 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Code Review Agent - sanguo_llmwiki 搜索改进
## 任务
对以下 PR 进行全面的代码审查:
**分支**: `feat/search-improvements``main`
**提交**: `feat: 搜索改进与代码修复`
## 审查重点
### 1. 搜索改进功能
**连字符扩展** (`database.py:505-519`):
```python
def _expand_hyphenated_text(self, text: str) -> str:
if not text:
return ""
return text.replace('-', ' ')
```
- 检查是否有边缘情况处理(如连续连字符、连字符在开头/结尾)
- 验证扩展后的文本是否正确存储到 FTS 表
**中文同义词支持** (`query.py:17-27, 53-74`):
- 检查同义词映射表是否完整
- 验证查询扩展逻辑是否正确处理 OR 连接
- 检查缓存 key 是否包含 `use_synonyms` 参数
### 2. 代码质量
- 一致性:代码风格是否与现有代码一致
- 错误处理:是否有适当的异常处理
- 性能:查询扩展是否会影响性能
- 测试覆盖:新功能是否有对应测试
### 3. 文档更新
- 设计文档 (docs/02-design.md) 是否准确反映改动
- 注释是否清晰
## 审查输出
请提供:
1. **发现问题列表**(按严重性分类)
2. **建议改进**
3. **是否 LGTMLooks Good To Me**
---
**参考文件**:
- mcp_server/services/query.py
- mcp_server/storage/database.py
- mcp_server/services/parser.py
- docs/02-design.md