Skip to content

feat: 增加候选冲突检测与裁决门控 - #47

Open
bingchuH wants to merge 6 commits into
SkillNerds:mainfrom
bingchuH:fix/conflict-detection
Open

feat: 增加候选冲突检测与裁决门控#47
bingchuH wants to merge 6 commits into
SkillNerds:mainfrom
bingchuH:fix/conflict-detection

Conversation

@bingchuH

@bingchuH bingchuH commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

在 candidates 累积达标后、SkillEditAgent 启动前,插入冲突检测与自动裁决逻辑。

bingchuH and others added 6 commits May 27, 2026 14:09
本次改动在 candidates 晋升到 SkillEditAgent 之前加入冲突处理闭环,避免互斥经验直接进入 SKILL.md。

主要改动:

1. 新增 .conflicts.yml 读写与 ConflictGroup/AtomPosition 数据结构,用于持久化硬冲突、软冲突、裁决结果和合并提示。

2. 增加候选冲突检测、自动裁决和过滤逻辑:明显领先的硬冲突自动保留胜出 Atom,未解决硬冲突阻断自动更新,软冲突生成条件合并提示。

3. 将冲突检测接入 SkillEditAgent.maybe_run,在候选达到阈值后、实际编辑前执行,并把软冲突提示注入 agent prompt。

4. 新增 xskill conflict list/show/resolve CLI,用于查看冲突历史和人工裁决未解决硬冲突。
pytest 在为参数化用例自动生成 id 时会探测异常对象的 __name__。

urllib.error.HTTPError 在 Python 3.9 下会把未知属性访问委托到底层 file 对象,导致 collection 阶段触发 tempfile 的 KeyError: 'file'。

本次为价格刷新失败分类用例显式指定参数 id,避免 pytest 对异常对象做自动探测,使 py3.9 的 Linux/macOS/Windows CI 能正常收集测试。
copy 模式安装时,install-meta 写在 dest 目录外部,并且 installed_at 记录的是 copy 完成后的浮点秒时间。

因此 dest 内部文件只要晚于 installed_at 发生变更,就可以判定为安装后的用户或外部 agent 编辑;不需要再额外要求晚 1 秒。

之前沿用了 source 仓用户编辑检测里的 1 秒阈值。该阈值是为 git commit 时间戳整数秒截断设计的,放在 copy-mode dest 上会让 Windows CI 的边界时间戳漏判,导致 ngagent 重装前没有 reverse sync 回 source。

本次将 has_pending_dest_edit 的判断改为 max_mtime > installed_at,并保留 quiet_seconds 防抖逻辑,使 ngagent/openclaw 等 copy-mode install 能稳定吸收 dest 侧用户改动。
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.

1 participant