impl: #16 知识注入 L2 引擎层 — WikiGuideSection
- prompt_composer.py: 新增 WikiGuideSection 类(priority=60) - task_handler.py: get_sections() 注入 WikiGuideSection - mail_handler.py: get_sections() 注入 WikiGuideSection - toolchain_handler.py: get_sections() 注入 WikiGuideSection L0(gate-enforcer wiki-rule)和 L1(SOUL.md Red Flags)不在本仓库, 直接在对应文件修改。 设计文档:docs/design/16-knowledge-injection.md(v2 已合并)
This commit is contained in:
@@ -127,3 +127,27 @@ class PromptComposer:
|
||||
)
|
||||
|
||||
return result
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# WikiGuideSection — 知识查询引导段
|
||||
# ---------------------------------------------------------------------------
|
||||
class WikiGuideSection:
|
||||
"""知识查询引导段 — 引导 Agent 在关键决策点查 wiki-vault。"""
|
||||
|
||||
name: str = "wiki_guide"
|
||||
priority: int = 60 # PRIORITY_EXTENSION
|
||||
|
||||
WIKI_GUIDE = (
|
||||
"## 知识查询引导\n"
|
||||
"涉及方案设计、编码实现、故障排查时,先查 wiki-vault 相关实践:\n"
|
||||
"- 路径:/Volumes/KnowledgeBase/wiki-vault/\n"
|
||||
"- 速查:index.md → grep 关键词 → summary 字段 → 按需读全文\n"
|
||||
"- 查不到:在 _meta/knowledge-gaps.md 记录"
|
||||
)
|
||||
|
||||
def render(self, context: "PromptContext") -> str:
|
||||
return self.WIKI_GUIDE
|
||||
|
||||
def should_include(self, context: "PromptContext") -> bool:
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user