🐛 fix(mcp): 收口全部 MCP 响应 JSON 序列化 - #164
Merged
ZhaoXingPeng merged 2 commits intoSep 9, 2026
Merged
Conversation
ZhaoXingPeng
changed the base branch from
main
to
fix/161-shared-json-serialization
September 8, 2026 18:48
Owner
Author
实现完成(2026-09-09)当前结论已完成 Issue #163 的实现:MCP server 内所有面向客户端的 JSON 响应入口均收口到共享 变更与设计取舍
验证与证据
兼容性与下一步
|
Owner
Author
验证完成(2026-09-09)当前结论本地验证已完成,686 个单元测试全部通过;新增跨模块驱动值回归通过。结果证明本次改动没有破坏现有工具响应合同,并覆盖了此前直接 变更与设计取舍
验证与证据
兼容性与下一步
|
This was referenced Sep 8, 2026
ZhaoXingPeng
force-pushed
the
fix/161-shared-json-serialization
branch
2 times, most recently
from
September 9, 2026 02:12
6ebb683 to
7356eb6
Compare
* 🐛 fix(codegen): 规范无前缀模板输出路径 * 🐛 fix(codegen): 统一分析结果与模板导入映射 (#168) * 🐛 fix(codegen): 统一分析结果与模板导入映射 * 🐛 fix(mcp): 补齐 PostgreSQL 时间类型别名映射 (#170) * 🐛 fix(mcp): 补齐 PostgreSQL 时间类型别名映射 * 🐛 fix(codegen): 补齐自增主键模板上下文标记 (#172) * 🐛 fix(codegen): 补齐自增主键模板上下文标记 * 🐛 fix(generator): 修正遗留实体上下文自增标志 (#174) * 🐛 fix(generator): 修正遗留实体上下文自增标志 * 🐛 fix(generator): 保留 Java 属性名内部大小写 (#176) * 🐛 fix(generator): 保留 Java 属性名内部大小写 * 🐛 fix(template): 仅为自增主键启用 generated keys (#178) * 🐛 fix(template): 仅为自增主键启用 generated keys * 🐛 fix(codegen): 统一主键列表与列上下文 (#180) * 🐛 fix(codegen): 统一主键列表与列上下文 * 🐛 fix(mcp): 统一描述与代码生成类型映射 (#182) * 🐛 fix(mcp): 统一描述与代码生成类型映射 * 🐛 fix(codegen): 统一旧入口方言表名发现 (#184) * 🐛 fix(codegen): 统一旧入口方言表名发现 * ♻️ refactor(codegen): 复用统一表名元数据合同 (#186) * ♻️ refactor(codegen): 复用统一表名元数据合同 * 🐛 fix(codegen): 补齐批量分析表名上下文 (#188) * 🐛 fix(codegen): 补齐批量分析表名上下文 * 🐛 fix(database): 持久化 SQLite execute_query 写入 (#190) * 🐛 fix(database): 持久化 SQLite execute_query 写入 * 🐛 fix(governance): 对齐工具注册表数据库能力 (#192) * 🐛 fix(governance): 对齐工具注册表数据库能力 * 🔒 security(mcp-apps): 收紧代码 diff 路径边界 (#194) * 🔒 security(mcp-apps): 收紧代码 diff 路径边界 * 🐛 fix(codegen): 对齐生成文件写入统计与结果状态 (#196) * 🐛 fix(codegen): 对齐生成文件写入统计与结果状态 * ✨ feat(codegen): 统一 DTO 与 VO 生成选项合同 (#198) * ✨ feat(codegen): 统一 DTO 与 VO 生成选项合同 * 📚 docs(governance): 固化 GitHub 元数据正文门禁 (#200) * 📚 docs(governance): 固化 GitHub 元数据正文门禁 * 🐛 fix(database): 回滚失败 SQLite 查询事务 (#202) * 🐛 fix(database): 回滚失败 SQLite 查询事务 * 🐛 fix(schema): 规范图算法重复表输入 (#204) * 🐛 fix(schema): 规范图算法重复表输入 * 🐛 fix(dependencies): 隔离版本分析状态 (#206) * 🐛 fix(dependencies): 隔离版本分析状态 * 🐛 fix(cli): 统一解析 MCP 响应 (#208) * 🐛 fix(cli): 统一解析 MCP 响应 * ✨ feat(connection): 增加 MCP 连接释放工具 (#210) * ✨ feat(connection): 增加 MCP 连接释放工具 * ⚡ perf(mcp): 隔离同步数据库调用与事件循环 (#212)
ZhaoXingPeng
force-pushed
the
fix/163-mcp-json-boundary
branch
from
September 9, 2026 02:25
f233b4a to
0bef176
Compare
5 tasks
ZhaoXingPeng
added a commit
that referenced
this pull request
Sep 9, 2026
* 🐛 fix(mcp): 收口全部 MCP 响应 JSON 序列化 * 🐛 fix(codegen): 规范无前缀模板输出路径 (#166) * 🐛 fix(codegen): 规范无前缀模板输出路径 * 🐛 fix(codegen): 统一分析结果与模板导入映射 (#168) * 🐛 fix(codegen): 统一分析结果与模板导入映射 * 🐛 fix(mcp): 补齐 PostgreSQL 时间类型别名映射 (#170) * 🐛 fix(mcp): 补齐 PostgreSQL 时间类型别名映射 * 🐛 fix(codegen): 补齐自增主键模板上下文标记 (#172) * 🐛 fix(codegen): 补齐自增主键模板上下文标记 * 🐛 fix(generator): 修正遗留实体上下文自增标志 (#174) * 🐛 fix(generator): 修正遗留实体上下文自增标志 * 🐛 fix(generator): 保留 Java 属性名内部大小写 (#176) * 🐛 fix(generator): 保留 Java 属性名内部大小写 * 🐛 fix(template): 仅为自增主键启用 generated keys (#178) * 🐛 fix(template): 仅为自增主键启用 generated keys * 🐛 fix(codegen): 统一主键列表与列上下文 (#180) * 🐛 fix(codegen): 统一主键列表与列上下文 * 🐛 fix(mcp): 统一描述与代码生成类型映射 (#182) * 🐛 fix(mcp): 统一描述与代码生成类型映射 * 🐛 fix(codegen): 统一旧入口方言表名发现 (#184) * 🐛 fix(codegen): 统一旧入口方言表名发现 * ♻️ refactor(codegen): 复用统一表名元数据合同 (#186) * ♻️ refactor(codegen): 复用统一表名元数据合同 * 🐛 fix(codegen): 补齐批量分析表名上下文 (#188) * 🐛 fix(codegen): 补齐批量分析表名上下文 * 🐛 fix(database): 持久化 SQLite execute_query 写入 (#190) * 🐛 fix(database): 持久化 SQLite execute_query 写入 * 🐛 fix(governance): 对齐工具注册表数据库能力 (#192) * 🐛 fix(governance): 对齐工具注册表数据库能力 * 🔒 security(mcp-apps): 收紧代码 diff 路径边界 (#194) * 🔒 security(mcp-apps): 收紧代码 diff 路径边界 * 🐛 fix(codegen): 对齐生成文件写入统计与结果状态 (#196) * 🐛 fix(codegen): 对齐生成文件写入统计与结果状态 * ✨ feat(codegen): 统一 DTO 与 VO 生成选项合同 (#198) * ✨ feat(codegen): 统一 DTO 与 VO 生成选项合同 * 📚 docs(governance): 固化 GitHub 元数据正文门禁 (#200) * 📚 docs(governance): 固化 GitHub 元数据正文门禁 * 🐛 fix(database): 回滚失败 SQLite 查询事务 (#202) * 🐛 fix(database): 回滚失败 SQLite 查询事务 * 🐛 fix(schema): 规范图算法重复表输入 (#204) * 🐛 fix(schema): 规范图算法重复表输入 * 🐛 fix(dependencies): 隔离版本分析状态 (#206) * 🐛 fix(dependencies): 隔离版本分析状态 * 🐛 fix(cli): 统一解析 MCP 响应 (#208) * 🐛 fix(cli): 统一解析 MCP 响应 * ✨ feat(connection): 增加 MCP 连接释放工具 (#210) * ✨ feat(connection): 增加 MCP 连接释放工具 * ⚡ perf(mcp): 隔离同步数据库调用与事件循环 (#212)
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.
关联 Issue
Closes #163
本 PR 收口全部 MCP 响应入口的共享 JSON 序列化,覆盖 AI、发现、可观测性、Schema 算法、质量配置和服务器错误封装。
背景(Situation)
PR #162 已为查询和原子代码生成响应引入共享序列化器,但其他 MCP 组合 payload 仍可能直接调用标准库 JSON。驱动值进入这些路径时,客户端可能拿不到结构化成功响应或错误 envelope。
任务(Task)
统一所有 MCP 响应入口的 JSON 编码,保持工具字段、文本、缩进和未知对象显式失败语义不变,并补齐跨模块嵌套驱动值回归证据。
行动(Action)
验证(Verification)
环境:Windows;Python 3.12.12;pytest 9.1.1;Ruff。
实验与证据(Evidence)
固定在 AI、发现、可观测性等嵌套响应中注入 Decimal 1.25、0.875、2.5 和 3.75,回归测试确认共享序列化器输出可追踪 JSON。工具名称、字段结构和文本快照保持不变;未知对象继续进入显式 TypeError 路径。
兼容性、风险与回滚
公共 MCP 工具名、输入 schema、响应字段和人类可读文本保持不变。新工具若绕过共享序列化器仍可能复现问题,应单独修复;本 PR 不宣称性能收益,不涉及数据迁移。恢复提交 fc7732d 可回滚。后续在最终 main 基线复核依赖链,并继续清理开放串联 PR。