Skip to content

fix: resolve 3 Copilot review comments — CLI entry, path heuristic, source path#7

Merged
Tenstu merged 1 commit into
mainfrom
fix/copilot-review-comments
Jun 18, 2026
Merged

fix: resolve 3 Copilot review comments — CLI entry, path heuristic, source path#7
Tenstu merged 1 commit into
mainfrom
fix/copilot-review-comments

Conversation

@Tenstu

@Tenstu Tenstu commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Summary

Fix 3 genuine issues identified by Copilot code review on PR #6 that remained unresolved post-merge:

  1. CLI entry point brokenconsole_scripts pointed to async def main, which doesn't work as a CLI command. Added sync_main() wrapper and updated pyproject.toml.
  2. Path heuristic too aggressive_looks_like_path treated any string with a known extension (e.g. "哈希表.md") as a file path, contradicting its "保守策略" docstring. Now requires path separator OR actual file existence.
  3. Source path misalignedsources.yaml used targets/... but resolution starts from shared/exam_memory/, resulting in a non-existent directory. Corrected to ../../targets/....

Files changed

  • shared/exam_memory/server.py — version bump + sync_main wrapper
  • shared/exam_memory/pyproject.toml — entry point update
  • shared/exam_memory/source_connector.py — _looks_like_path fix
  • shared/exam_memory/sources.yaml — relative path fix

🤖 Generated with Claude Code

…ource path

- server.py: add sync_main() wrapper for console_scripts entry point, align version to 2.0.0
- source_connector.py: require path separator in _looks_like_path to avoid Chinese text misdetection
- sources.yaml: correct relative path to ../../targets/ for repo-root targets directory

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 18, 2026 00:56
@Tenstu Tenstu merged commit 96439b8 into main Jun 18, 2026
@Tenstu Tenstu deleted the fix/copilot-review-comments branch June 18, 2026 00:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to address previously reported review findings in the exam-memory MCP package (CLI entry point correctness, safer path heuristics, and correct relative source paths), within the project’s exam-prep harness.

Changes:

  • Fixed the exam-memory console script by routing it through a sync wrapper (sync_main) instead of an async def main.
  • Made _looks_like_path more conservative to avoid misclassifying plain text titles as filesystem paths.
  • Corrected sources.yaml local source paths to resolve properly from shared/exam_memory/.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
shared/exam_memory/server.py Adds sync_main and bumps server version; also introduces new review-scheduling MCP tools.
shared/exam_memory/pyproject.toml Updates exam-memory entry point and adds a new review-schedule script.
shared/exam_memory/source_connector.py Tightens _looks_like_path heuristic (separator + known extension, or existence).
shared/exam_memory/sources.yaml Fixes relative source path to point to ../../targets/....
README.md Expands project positioning and adds agent retrieval hints + review scheduling roadmap notes.
README_CN.md Chinese counterpart of README updates (positioning, retrieval hints, roadmap notes).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 35 to +37
[project.scripts]
exam-memory = "exam_memory.server:main"
exam-memory = "exam_memory.server:sync_main"
review-schedule = "exam_memory.review_cli:main"
Comment on lines +606 to +613
if name == "list_due_reviews":
try:
from exam_memory.review_cli import due as _due
target = arguments.get("target", "")
d = arguments.get("date", "")
from datetime import date as _date
today = _date.fromisoformat(d) if d else _date.today()
limit = arguments.get("limit", 10)
Comment on lines +198 to +222
Tool(
name="list_due_reviews",
description="列出项目中到期的复习项。使用 review_schedule 的 review-queue 文件。",
inputSchema={
"type": "object",
"properties": {
"target": {
"type": "string",
"description": "目标名称(如 pdd-algo),默认扫描 project_root/targets/ 下首个目标",
},
"date": {
"type": "string",
"description": "检查日期 YYYY-MM-DD(可选,默认今天)",
},
"limit": {
"type": "integer",
"description": "最大返回条数(默认 10)",
},
},
},
),
Tool(
name="mark_review_result",
description="标记一条复习项的结果并自动更新下一次复习计划(SM-2 简化调度)。",
inputSchema={
Comment thread README.md
Comment on lines +47 to +50
| Target-specific exam material | `targets/{target}/` |
| Shared MCP server and retrieval helpers | `shared/exam_memory/` |
| Development roadmap | `docs/dev-roadmap.md` |
| Review mechanism plan | `docs/plans/2026-06-17-review-mechanism-implementation-plan.md` |
Comment thread README.md
Comment on lines +210 to +213
- File-based review queue under `targets/{target}/progress/reviews/`
- SM-2 inspired scheduling for mistakes, weak topics, and choice-question errors
- Optional MCP tools for `list_due_reviews` and `mark_review_result`
- Planned in [Review Mechanism Implementation Plan](docs/plans/2026-06-17-review-mechanism-implementation-plan.md)
Comment thread README_CN.md
Comment on lines +47 to +50
| 目标考试专属材料 | `targets/{target}/` |
| 共享 MCP server 与检索辅助 | `shared/exam_memory/` |
| 开发路线图 | `docs/dev-roadmap.md` |
| 复习机制实现规划 | `docs/plans/2026-06-17-review-mechanism-implementation-plan.md` |
Comment thread README_CN.md
Comment on lines +210 to +213
- 在 `targets/{target}/progress/reviews/` 下维护文件式 review queue
- 基于 SM-2 简化规则调度错题、薄弱知识点、选择题错误
- 可选 MCP 工具:`list_due_reviews` 与 `mark_review_result`
- 详见 [复习机制实现规划](docs/plans/2026-06-17-review-mechanism-implementation-plan.md)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants