fix(onboarding): 接入写入幂等——内容不变不重写,Codex 托管块不再累积空行 #25
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/onboarding-idempotent-writes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
目标
接入写入幂等(蓝图 agent-client-parity P3b):炼境向子项目写文件时,内容不变就不重写;Codex 托管块不再每次注入多一个空行。
为什么
enterprise 未提交改动归属梳理时发现:
.codex/config.toml已累积 16 行;core.autocrlf,炼境在内容不变时也用 LF 重写 CRLF 检出的文件,git status 因此误报改动(CONVENTIONS.md、context.json),文件修改时间也被刷新,干扰了「这次改动是谁做的」的判断。改动
d098905lib.rs新增write_if_content_changed(忽略行尾比较,内容不变不写);sync_blueprint_rules(CONVENTIONS + AGENTS/CLAUDE 托管块)、context.json、.claude/settings.json、Codex 托管块改用它;托管块未变时返回unchanged;Codex 托管块吸收 END 之后的空行019d81c自验
cargo test --locked:245 passed / 5 ignored。新增回归:Codex 托管块连续注入字节不变并吸收累积空行;CRLF 检出的同内容托管块返回 unchanged 且不被重写;语义相同的 settings.json 保留客户端格式;CRLF 检出的同内容 CI workflow 的 plan 为 noop。.codex/config.toml末尾空行 16→0;再次注入,.codex/config.toml、.claude/settings.json、.lian-jing/context.json、.claude/liangjing.json四个文件修改时间均不变。没验什么
sync_blueprint_rules、CI workflow apply / generate_workflow、agent_infra 生成、notes-archive 回填这几条路径只有单元测试,没有在真实子项目上实际触发。git add,暂存的是空 diff)。后续(已立卡,未在本 PR 实现)
🤖 Generated with Claude Code