merge - #30
Merged
Merged
Conversation
- 所有知识库工具的 inputSchema 移除 output_dir 参数,统一以 repo_path 为唯一 目标锚,库路径由 default_output_dir(repo_path) 推导;调用方仍传 output_dir 时被静默忽略以保兼容 - registry / prompts 及各 tool handler(ingest、query、lint、stats、capture、 distill、consolidate、workspace 一族)同步收敛;缺失锚点时注入服务端启动 CWD,并在解析失败时返回带 fix 提示的可执行错误 - 文档、schema.yaml 与 workspace 模板同步更新 - 附带本轮重构的演进计划、收敛检查清单与批量替换脚本
- 各测试 helper 由传 output_dir=<repo>/repowiki 改为 repo_path=<repo>(推导 结果相同);adoption 的 capture 集成用例改为在 <root>/repowiki 下建库 - target_anchor_guards 重写为单锚不变量:断言无工具再广告 output_dir,并保留 注入/报错(C 部分)的回归覆盖 - promotion 的 promote-note prompt 断言同步为 repo_path(arguments 不再含 output_dir;插值后的路径分隔符不参与断言) - 非 handler 场景(cache.search、_resolve_output_dir、output_dir 退休兼容 验证用例)保留原有 output_dir 传参
session.py 在收敛改动后遗留 SessionWorkspace(_P(rp), ...),而 _P 已随 output_dir 退休被移除,任何走 find_or_restore 的路径都会抛 NameError (review_changes.prepare 端到端用例复现)。SessionWorkspace 内部已做 Path(repo_path).resolve(),直接传入 rp 即可。 另:.gitignore 忽略 pytest basetemp(.pytest-tmp/,本机瞬态、每次全量跑会 产生上千个文件);新增「发版本」任务记录。
collect_evidence_drift 作为 lint 与增量的共享采集点(单点收敛), _enrich_stale_evidence 挂变更路径输出 stale_evidence_pages 第三信号源 (与 affected_modules/stale_pages 并列);no_changes 路径显式静默(ADR-0005)。 hint 引导复核+re-stamp 而非重写,守"证据只驱动提醒"红线。
四项目源码横评(openwiki/deepwiki-open/OpenDeepWiki/deepwiki-rs), 勘误段记录实现期代码核对发现的 B2/B1 表述偏差与 B6 落地事实。
两区制布局的词汇与基建(ADR-0004):草稿区 skills/ 落 repowiki 根(与 notes/ 同层的知识资产),生效区 .codebuddy/skills/ 在仓库根、repowiki 不扫描。 - config: SKILLS_DIR / SKILL_EFFECT_DIR 两区常量(PAGE_TYPE_DIRS 保持 wiki/-relative 语义不动,skill 走 page_router 专用分支) - schema: page_types.skill 三处声明(模板/仓内实例/生成器默认表), 五段必填章节与 scenario 同构 - 索引: cache.py(SQLite) 与 wiki_search.py(legacy JSON) 双路径扫 skills/<name>/SKILL.md,source="skill"(召回隔离是 T5 #28 的入口职责) - lint: 新增 skill_sections 检查(schema 驱动必填章节,缺章节 error), registry checks 枚举与 README 同步 - 测试: tests/test_skill_pages.py 12 例(路由/章节校验/双路径索引/ 生效区隔离不变量) Closes #24
- docs/skill-creator需求与设计方案.md:实施唯一输入(四 mode 工具、 两区制、lint 八项、检索隔离、验收 7 条、实施拆解 8 工单) - docs/adr/0004:技能与场景分轨,两区制守确认闸门 - docs/WikiSkill论文与wikiskill源码精读.md:论文 Table 1-7 全表 + wikiskill v0.1.4 源码精读(research 子代理产出) - CONTEXT.md:skill 领域词条入表
ADR-0004 决策 2:草稿区技能页参与索引构建(lint/容量统计/prepare 候选 扫描依赖),但永不进 query_wiki 召回——行为指令的消费方是宿主 IDE 触发, 可检索会造成「检索知识」与「行为指令」语义混淆。 - cache.py search():主评分循环与展开词循环两处排除 source="skill" - wiki_search.py search():legacy JSON 路径主循环同款排除 - 测试 3 例:legacy/SQLite 双路径零召回(带对照笔记证明索引有效、 排除只针对 skill)+ 展开路径不泄漏 Closes #28
调研报告从 docs/ 根移入 docs/compare/,合集四份源码调研笔记与公众号 系列12副本;系列12新增"对LLM依赖程度""团队经验沉淀与任务记忆"两个 分水岭章节(增补版同步 articles/ 与 compare/ 两处),并修正"学到什么" 章节中 B6 已落地、B2/B1 经代码核对后的真实范围表述。
Mode C 前两 mode(沿 note_consolidation 骨架,ADR-0004 两区制):
- prepare:候选素材(未吸收 scenario + stable pitfall/lesson/decision
笔记 + 技能名下 open issues 聚合)、Jaccard>0.6 冲突预检、容量分级
(橙 9 只 UPDATE / 红 12 先合并)、防碎片纪律与写作系统提示,零副作用
- submit:全量先校验后落盘(name_slug/description_trigger/body ≤8KB/
source_refs 路径逃逸/敏感串/冲突与批量防碎片,失败报具体规则名);
OKF frontmatter + revisions 审计链 + 双向溯源互链(source_refs ⇄
素材 compiled_into);空产出 no_action 合法;submit 后重建索引
- 修复子代理实现缺陷:_norm_rel 的 lstrip("./") 会把 ../.. 逃逸路径
剥成合法相对路径,绕过路径安全检查——在原始串上先行拒绝
- install/retire mode 显式报错指向 T3(#26);注册同步:registry/
prompts(正文+注册)/resources/README 中英/测试
Closes #25
两区制的生效侧(ADR-0004): - install:草稿 → 生效区 .codebuddy/skills/<name>/,剥离全部管理 frontmatter(只留 name/description/正文,省宿主上下文 token); installed_at/installed_to/installed_hash 写回草稿——规范化哈希 (sha256(name+description+body))是 T4 漂移检测的比对契约;幂等 - retire:草稿标 deprecated(正文保留审计,revisions 记录 reason, installed_* 三元组清除)+ 生效区移除;deprecated 拒绝再 install; reason 必填(审计链) - 注册同步:registry description / prompts 工作流(步骤 5/6)/ README 中英 / 测试 5 例(剥离断言/幂等/修订重装/退役闭环/错误路径) Closes #26
设计 §4.5 八项全量落地(submit 校验的 backstop,捕捉工具外手写/手改 的草稿): - errors:name_slug / description_trigger / frontmatter_required(status+ source_refs)/ body ≤8KB / sensitive_content(绝对路径+密钥,与 submit 共享 _sensitive_scan 单点实现,两层永不漂移)/ revisions_required - warnings:skill_possibly_stale(素材 deprecated/软删/缺失,设计 Q5 对端新鲜度联动,只提示不自动修订);skill_drift(草稿规范化哈希 ≠ installed_hash——install 后草稿又被修订,生效区仍旧版,设计 Q6, reinstall 留给用户) - 容量:红 12 error / 橙 9 warning(阈值 import skill_creator 常量, 单点收敛;deprecated 不计数) - registry 枚举 + 描述、README 同步;测试 6 例(含六 error 各自正反、 素材三种退化形态、漂移、容量分级) Closes #27
用本仓真实知识走完整生命周期(非 fixture): - prepare:38 个真实候选(8 场景块 + 30 笔记),容量绿、无冲突 - submit:maintain-fork-pr-merge 技能从「发布与依赖治理方法」场景 + fork-PR lesson 编译落草稿区,2 条素材获得 compiled_into 回链 - lint 全绿 → install(生效区产物验证:仅 name/description/正文) - flag_issue(skill-ineffective:DRAFT 态 caveat 缺失)→ prepare 聚合 → 修订(revisions 2)→ drift warning 实测触发 → reinstall 生效区刷新 - 七处同步清单逐项核对通过;设计文档状态更新为已实施 CodeBuddy 真机技能发现验证留人工步骤(安装产物已就位于 .codebuddy/skills/maintain-fork-pr-merge/)。 Closes #29
回答「采集脚本丢工具信息影响技能生成」:压缩时丢掉的操作细节蒸馏 永远找不回来,正是技能素材的主体。原 _NOISE_BLOCK_TYPES 一刀切(11 类块全丢)改为两级消化,共享单点实现 codewiki/src/tool_digest.py (stdlib-only,两条采集路径永不漂移): - 纯噪音(thinking/reasoning/system/context)仍无条件丢弃 - tool 调用(tool_use/tool-call/function_call 双拼写)→ 一行压缩 [tool: 名 · 命令首行](≤160 字符),保持原序——顺序即修复链 - tool 结果仅疑似错误保留(is_error 或错误指纹)→ [tool-error: 摘录] (≤200 字符追加预算);成功结果仍丢弃 触点:capture_conversation + _ide_hook 双侧接入;测试断言改契约 + tool_digest 专项 3 例(85 相关测试全过);AGENTS.md 捕获协议同步 (保留关键命令/报错修复对/参数钉子);P0 设计文档 §2.1 勘误 (toolError 摩擦信号从不可得变为可扫 raw);设计方案 §9 收口。 副产品:未来捕获的会话 raw 天然携带命令-报错-修复链,蒸馏产出的 笔记即含完整 SOP 素材,skill_creator 编译不再缺操作细节。
…ed 必带 reason)
- 每个未吸收候选必须有归宿,不允许无声跳过
- report.dispositions=[{file, verdict: deferred|excluded, reason?}],excluded 缺 reason 拒绝
- absorbed 由 source_notes 派生不可提交;prompt/registry 描述与测试同步
- UserPromptSubmit hook(claude 家族):匹配 status=draft 草稿注入 install 指针,只读不写 - skill_creator 状态语义补全:install→stable(不再被推荐)、修订回 draft(可再被推荐) - note_consolidation / distill_conversation submit 返回 additive skill_hint,默认返回值不变 - stdlib-only skill_match:containment 非 Jaccard(0.6 Jaccard 永不触发系实测推翻);L2 素材判据=命令密度 - distill-worker 剧本明令 skill_hint 只汇报不执行;真实技能迁移 stable;docs §10 + 28 例测试
skill-creator §10 的 UserPromptSubmit(草稿技能提示)此前只能手动加 settings.json;本次纳入 install-hooks: - merge_settings_json 新增注册:matcher 空串 = 每条用户指令都过匹配器 (脚本内部 containment 阈值把关),command = PROMPT_HOOK_CMD `python -m codewiki.mcp._ide_hook --enable`(同步执行、stdout 回吐 hookSpecificOutput,timeout 10)。 - hook 命令不含任何路径,settings.json 随仓库共享天然可移植,无需 物理脚本 wrapper(与 SessionStart/End 的相对路径拷贝互补)。 - HOOKS_REGISTRATION 骨架与模块注释同步。 测试(116 通过):注册形状、幂等去重、保留用户自有 UserPromptSubmit matcher、真实 install 后 settings 三事件齐全。 本仓库 .codebuddy/settings.json 同步真实启用(当前草稿区为空,命中 静默不注入)。
dbc5ef9 给 distill-worker 剧本补 "skill_hint 只汇报、不执行" 约束时只改了 .codebuddy/agents/distill-worker.md(本仓库 IDE 安装副本),codewiki/agents/ 下的两个包内源副本(默认 + claude 变体)漏改。install-hooks 每次强制拷贝 会用旧源覆盖新副本(本次真实接线即复现),且所有新接线项目拿到的剧本都 缺此约束,subagent 可能自行调用 skill_creator。 补齐两处源副本:第 4 步汇报句 + 约束区 bullet。
- notes: skill-creator/output_dir 纯函数/consolidate disposition 三值决策定稿 - conversations: 3 条积压会话归档(wikiskill 调研、微信文章、humanizer 安装) - notes 08-15: source_ref 随 raw→conversations 迁移同步修正 - 遥测、任务记忆与蒸馏日志随动更新
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release 5.7.0