fix(gate): 会话实测二批修复——并发写原子化 + 指纹截断盲区 + UPS 问句句级抑制 - #39
Merged
Merged
Conversation
基于 zcode 侧 codex-java-sdk 三分支发布全程实战(双副本挂载 + 并行会话共用 工作树场景),codegraph 全量索引后定位的四项不足: 1. dedup/gate-cache 写入原子化:hook_dedup.json 与 gate cache 此前为裸 read-modify-write——UPS 与 PreToolUse 数秒窗口内先后执行会互相覆盖 (丢抑制事件→双份报告)或读到半截 JSON(ValueError 静默吞→去重失效)。 加 fcntl 进程锁(Windows 降级可选)+ tmp+os.replace 原子替换; dedup 时间戳从 monotonic 改墙钟(monotonic 跨重启回绕,不能持久化)。 2. _worktree_fingerprint 去掉 [:500] 截断:截断使第 501+ 文件的修复在 60s 缓存窗口内被旧指纹掩盖(retry-timing 陷阱对大改动面复活)。 名字集合全量入 hash,stat 叠加不再封顶(每次仅对变更文件 stat,成本可控)。 3. UPS 问句抑制改句级:`这个方案 OK 吗?帮我提交` 问句与祈使混排时整条被 静默——改为按句子切分,仅当全部触发句均为问句才静默。 4. languages.json 移除 .zsh 扩展(gate_lib 剥离兜住 run_gate 路径,但 fix.py/run_check 直调仍会送检);docs/LANGUAGES.md 同步重生成。 5. tests/run_all fail-open 测试免疫本机 codeguard.skipGate 配置—— 此前依赖仓库本地 git config 未设 skipGate,环境污染即假失败(实测复现)。 测试:141 通过 / 0 失败(run_all 全量);ruff hooks/+tests/ 全过。
….zsh 注册表移除回滚——归属契约测试锁定送检剥离才是正解
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.
背景
基于 zcode 侧 codex-java-sdk 三分支发布全程实战(双副本挂载 + 并行会话共用工作树场景),codegraph 全量索引后定位的四项不足。
修复
这个方案 OK 吗?帮我提交问句与祈使混排时整条被静默——改为按句子切分,仅当全部触发句均为问句才静默。验证
tests/run_all.py:141 通过 / 0 失败(修复前 140/1:有一行降级说明假失败已消除)