fix: 整体 deep review 全量修复 — 无 P0/P1, P2 清零 - #14
Merged
Conversation
五路 zcode deep review (security deep + 四组件) 共 15 P1 + 31 P2, 复审 又抓 2 P1 + 7 P2, 全部修复: mcp-server: - MimosaMcpClient._send 写超时 (select 可写性检查, 防 server 异常时永久阻塞) - files 200 上限+元素类型过滤 / code 体积上限 ZCODE_BRIDGE_CODE_MAX / stdout 截断 ZCODE_BRIDGE_MAX_OUTPUT (先提取 response 再截断, 保 JSON 结构) - has_error 判定: stderr 命中错误词时仅当 stdout 不可解析出 --json 结果 才判错误 (修误杀成功 + 防漏判错误回显); _parse_result_json 容忍前置警告行 - -32603 改通用文案防内部路径泄露; provider_error 副本对齐权威版 quota 模式 - batch 拒收回数组形式; _git 超时分档; O_NOFOLLOW 防 TOCTOU; node 缺失明确提示 acp-bridge: - _next_id 改 itertools.count 原子化; stdout 写口收编 _write_stdout + 锁 - pending_turns try/finally 兜底清理; 轮询连续失败探测后端死进程立即报错 - _fetch_last_reply 重试间隙 drain inbox; 事件流超时返回 -32603 (契约变更, README 限制 #9 记录); _wait_for_turn_idle 退避+drain; close() kill 后收尸 - session 状态 FIFO 上限淘汰; _redact_secret 补 hex/uuid; register 覆盖告警 - ZCODE_ACP_DEFAULT_MODE 可收紧默认 yolo + 启动显眼告警 agent-help / shared: - _safe_host 与权威版逐字对齐 (残留诊断不再与注入行为矛盾); --section 越界报错; creds 空时显示 env 残留; 异常捕获放宽; 副本同步约定列入 agent-help + C11/C12 对拍测试 docs: - README eval 示例注入修复 (shlex.quote, 实测注入被阻断); client 可信假设 声明; 新 env 表; 事件超时契约限制 #9 测试: 全套件 10 文件全绿 (新增约 60 用例); ruff 全过
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.
动机
用自家 review 体系对全仓库做了一次整体 deep review(zcode_security_review depth=deep 全仓安全专项 + 四组件 zcode_review 通读),目标:无 P0/P1,P2 清零。
审查结论
修复亮点(完整清单见 commit message)
_send写超时防死锁;files/code/stdout 三重体积上限;has_error 判定改为「stdout 可解析出 --json 结果」——同时修了误杀成功调用和漏判错误回显两个方向;_parse_result_json容忍 zcode 前置警告行(实测形态);-32603不再泄露内部路径_next_id原子化、stdout 写锁、pending_turns异常泄漏 finally 兜底、轮询遇死进程快速失败、cancel 在等待期间可响应、事件流超时契约明确为-32603(README 限制 feat(mcp-server): review 体系告别 plan 模式 — yolo+写工具物理禁用 + zcode_security_review (mimosa 预扫) #9 记录)、ZCODE_ACP_DEFAULT_MODE可收紧默认 yolo--section越界不再静默打印全量shlex.quote,实测含恶意 payload 的 config 不再能注入)验证