Skip to content

Commit 206dbd4

Browse files
committed
refactor: 拆开 knowledge_loop——六工具族落座独立 module + NoteWriter(候选 #1)
2,947 行单文件按工具族拆分(locality:一族一文件): - note_ingest.py(472)— handle_ingest_note + 模块自匹配/标签/符号链接 - note_lifecycle.py(305)— confirm/reject/batch_set_status + 文档清单迭代 - note_query.py(1,416)— query_wiki 五模式 + legacy 关键词回退 - wiki_stats.py(341)— handle_wiki_stats + cold/promotion 候选 - note_freshness.py(244)— stale_after 窗口评估引擎 - note_writer.py(360)— NoteWriter deep module:文件名 slug(CJK hash 回退约定)、锁内 status 改写(verified 追加/stale_after 续期)、 refresh_note_indexes 写后刷新序列(从 ingest 内联副本抽出) - knowledge_loop.py 降为兼容 facade(20+ 测试与兄弟模块的 import 面 不变);registry 六个 handler 路径改指真实 module(48 工具全注册) - 分层无环:writer → freshness → ingest → lifecycle → query → stats golden 零漂移;pytest 779 通过;smoke 132 通过;okf_regression 与基线 一致(99/3 存量)。legacy 关键词回退路径与基线行为逐点核对一致。
1 parent f4c8802 commit 206dbd4

8 files changed

Lines changed: 3214 additions & 2947 deletions

File tree

‎codewiki/mcp/registry.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ def _register(schema: Tool, handler_path: str, mode: str, takes_store: bool = Tr
10201020
"required": ["title", "content"],
10211021
},
10221022
),
1023-
handler_path="codewiki.mcp.tools.knowledge_loop:handle_ingest_note",
1023+
handler_path="codewiki.mcp.tools.note_ingest:handle_ingest_note",
10241024
mode="thread",
10251025
)
10261026

@@ -1193,7 +1193,7 @@ def _register(schema: Tool, handler_path: str, mode: str, takes_store: bool = Tr
11931193
"required": [],
11941194
},
11951195
),
1196-
handler_path="codewiki.mcp.tools.knowledge_loop:handle_query_wiki",
1196+
handler_path="codewiki.mcp.tools.note_query:handle_query_wiki",
11971197
mode="thread",
11981198
)
11991199

@@ -1236,7 +1236,7 @@ def _register(schema: Tool, handler_path: str, mode: str, takes_store: bool = Tr
12361236
"required": ["note_file"],
12371237
},
12381238
),
1239-
handler_path="codewiki.mcp.tools.knowledge_loop:handle_confirm_note",
1239+
handler_path="codewiki.mcp.tools.note_lifecycle:handle_confirm_note",
12401240
mode="thread",
12411241
)
12421242

@@ -1300,7 +1300,7 @@ def _register(schema: Tool, handler_path: str, mode: str, takes_store: bool = Tr
13001300
"required": ["repo_path"],
13011301
},
13021302
),
1303-
handler_path="codewiki.mcp.tools.knowledge_loop:handle_batch_set_status",
1303+
handler_path="codewiki.mcp.tools.note_lifecycle:handle_batch_set_status",
13041304
mode="thread",
13051305
)
13061306

@@ -1336,7 +1336,7 @@ def _register(schema: Tool, handler_path: str, mode: str, takes_store: bool = Tr
13361336
"required": ["note_file"],
13371337
},
13381338
),
1339-
handler_path="codewiki.mcp.tools.knowledge_loop:handle_reject_note",
1339+
handler_path="codewiki.mcp.tools.note_lifecycle:handle_reject_note",
13401340
mode="thread",
13411341
)
13421342

@@ -2393,7 +2393,7 @@ def _register(schema: Tool, handler_path: str, mode: str, takes_store: bool = Tr
23932393
"required": [],
23942394
},
23952395
),
2396-
handler_path="codewiki.mcp.tools.knowledge_loop:handle_wiki_stats",
2396+
handler_path="codewiki.mcp.tools.wiki_stats:handle_wiki_stats",
23972397
mode="thread",
23982398
takes_store=True,
23992399
)

0 commit comments

Comments
 (0)