Skip to content

Commit f4c8802

Browse files
committed
refactor: 共享 helper 落座 store_bridge(候选 #5)
- pending_raws_by_task 正主从 capture_conversation 迁入 store_bridge (本就是 KnowledgeStore 薄转发)——task_manager 与 distill 停止 import 兄弟模块私有名 - task_manager 的 _resolve_output_dir/_slugify 改指 store_bridge 与 store.slugify 正主 - knowledge_loop._slugify 保持不动:与 store.slugify 语义不同 (CJK 标题 hash 回退 vs 返回空串),是 ingest 文件名约定,随 ingest 模块搬迁(见候选 #1)
1 parent 92bf399 commit f4c8802

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

‎codewiki/mcp/tools/distill_conversation.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,7 @@ def handle_distill_conversation(
14851485
# source of truth get_task_context uses for pending_raw_count.
14861486
task_filter = str(arguments.get("task_id") or "").strip()
14871487
if task_filter:
1488-
from codewiki.mcp.tools.capture_conversation import pending_raws_by_task
1488+
from codewiki.mcp.tools.store_bridge import pending_raws_by_task
14891489

14901490
allowed = {
14911491
str((raw_dir / e["relpath"]).resolve())

‎codewiki/mcp/tools/store_bridge.py‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from __future__ import annotations
2626

2727
from pathlib import Path
28-
from typing import Any, Dict, Optional
28+
from typing import Any, Dict, List, Optional
2929

3030
from codewiki.mcp.session import SessionState
3131
from codewiki.src.store import KnowledgeStore
@@ -57,3 +57,14 @@ def store_for(
5757
) -> KnowledgeStore:
5858
"""A KnowledgeStore rooted at the resolved repowiki output directory."""
5959
return KnowledgeStore(resolve_output_dir(session, arguments))
60+
61+
62+
def pending_raws_by_task(output_dir: Path) -> Dict[str, List[Dict[str, str]]]:
63+
"""Pending (undistilled) raw conversations grouped by task_id.
64+
65+
Thin re-export of ``KnowledgeStore.pending_raws_by_task`` — the seam for
66+
task-scoped capture/distill tooling. (Architecture review 2026-09 #5:
67+
previously imported from capture_conversation, a historical home that
68+
forced sibling tools to reach into its private namespace.)
69+
"""
70+
return KnowledgeStore(output_dir).pending_raws_by_task()

‎codewiki/mcp/tools/task_manager.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@
6161
from typing import Any, Dict, List, Optional, Tuple
6262

6363
from codewiki.mcp.session import SessionStore
64-
from codewiki.mcp.tools.capture_conversation import (
65-
_resolve_output_dir,
66-
_slugify,
64+
from codewiki.mcp.tools.store_bridge import (
6765
pending_raws_by_task,
66+
resolve_output_dir as _resolve_output_dir,
6867
)
68+
from codewiki.src.store import slugify as _slugify
6969
from codewiki.src.store import (
7070
KnowledgeStore,
7171
SUMMARY_HEADING,

0 commit comments

Comments
 (0)