Repository navigation
Releases: sumingwang233/dsh-code-review-graph
Release list
v1.0.4 — Fix session-fatal tool schema (non-JSON-serializable `required`)
1.0.4
修复一个会导致会话在调用 crg_workflow / crg_prompt 之后整轮失败的缺陷,无功能变化。
缺陷
注册 MCP 工具时把输入的 JSON Schema 复制一份并剥掉 repo_root:
parameters.required = parameters.required?.filter(n => n !== 'repo_root');capabilities.json 里多数工具没有 required 字段,于是这一行的右值求值为 undefined,
并被赋成一个自有可枚举键 required: undefined。DSH 的会话日志会对每条事件做
无损 JSON 校验(snapshotJsonValue),undefined 直接判定为不可序列化:
session event "request/header" carries non-JSON-serializable data
第一次请求写 request/header 时这些工具还处于 workflow mask 屏蔽状态,所以不受影响;
一旦 crg_workflow 揭示它们,工具表发生变化,DSH 需要重记 request/header,
append 立即抛错,整轮以 turn/end { kind: "error" } 结束(连模型都没被调用)。
修复
// capabilities.json omits `required` for most tools, so a plain optional chain
// would assign `undefined` as an own key and break DSH's lossless-JSON session
// log ("session event \"request/header\" carries non-JSON-serializable data").
if (Array.isArray(parameters.required)) parameters.required = parameters.required.filter(n => n !== 'repo_root');
else delete parameters.required;- 不是数组(未声明)就不产生这个键,而不是写一个值为
undefined的键。 src/index.ts之外无同型反模式(backend.ts的?.filter(...)由?? ''兜底)。
回归测试
新增 tests/schema.test.mjs(node --test tests/*.test.mjs 自动收集),用 stub Cordis
ctx 装载真实的 dist/index.js,对注册出来的全部工具定义施加与 DSH 会话日志同一套
无损 JSON 判定:
- 所有注册 schema 可无损序列化,且 JSON round-trip 后结构相等;
capabilities.json未写required的工具,注册后不得出现自有required键;repo_root不得出现在任何面向模型的 schema 中;- 六个 workflow 揭示的每个工具 schema 都干净,且揭示的名字都已注册;
- 交叉验证:直接调用
@deepseek-ai/dsh-util-values的snapshotJsonValue
(即当初抛错的函数本体),测试运行时未准备时自动 skip。
红→绿:在 1.0.3 的 dist 上第 4 条失败,context workflow 揭示的三个工具
(build_or_update_graph_tool、get_minimal_context_tool、list_graph_stats_tool)
报 $.required;npm run build 后 10 个用例全绿,npm run typecheck 为 0。
npm test 保持全部通过,工具数量、五个 prompt workflow、七个技能、/crg-setup
与 /crg-graph 均未改动。验证范围及证据限制见 验证记录。
安装 dsh-code-review-graph@1.0.4 后重启 DSH 生效;此前因该缺陷中断的会话可以直接
继续(工具揭示状态是运行期内存态,重启后不会自动重放),但请先升级到本版本,
否则再次调用 crg_workflow / crg_prompt 仍会复现。
English
Fixes a defect that failed the whole turn after crg_workflow / crg_prompt. No
behaviour change otherwise.
When registering MCP tools the plugin strips repo_root from a copy of the input
schema. Most tools in capabilities.json omit required, so the optional chain
evaluated to undefined and assigned it as an own key — required: undefined.
DSH validates every session event as lossless JSON (snapshotJsonValue), which
rejects undefined, so recording the reason: "change" request/header that
crg_workflow triggers threw
session event "request/header" carries non-JSON-serializable data and the turn
ended with turn/end { kind: "error" } before the model was ever called.
The fix only narrows required when it is an array and deletes the key otherwise.
tests/schema.test.mjs pins the invariant on the real built bundle, including a
cross-check against the real snapshotJsonValue validator, and fails on the 1.0.3
build (three context-revealed tools, path $.required).
v0.1.2 — Direct graph controls and one-click engine setup
0.1.2
交互图谱可以直接操作,无需模型或工具参数:
- 右侧代码图谱页新增“准备引擎并生成图谱”和“更新图谱”按钮,首次主动操作自动准备隔离、固定版本的引擎。
- 新增真正的 DSH 用户命令
/crg-setup、/crg-graph,不接受参数、不运行模型。 - 支持取消、重试、解析警告和 HTML 导出;仍沿用当前会话的仓库绑定和已有后端生命周期。
- 中英文 README 改为界面优先,并解释高级工具选项。
桌面版通过原生插件管理器安装 dsh-code-review-graph@0.1.2,启用后在项目会话打开
右侧栏 → 新标签页 → 开始 → Code graph,点击“准备引擎并生成图谱”。首次需要联网及
uv 或真实 Python 3.10+;自定义引擎仍由用户自行准备。正常启动不下载依赖。
安装脚本受 pnpm 执行审批限制,因此准备入口在安装后的首次主动操作中;本版不添加
隐藏的 npm postinstall。验证范围及发行包证据见 验证记录。
English
- Generate/update the interactive graph directly from its native sidebar, without a model or JSON parameters.
- Add native
/crg-setupand/crg-graphuser commands. Both execute directly with no arguments. - Prepare the isolated pinned engine on the first explicit UI action; retain cancellation, retry, parse warnings, HTML export and session-bound repository ownership.
- Update both READMEs with UI-first instructions and explanations of advanced options.
Install dsh-code-review-graph@0.1.2 through the native Desktop manager, enable it,
then open the project session's right sidebar → New tab → Start → Code graph.
Click Set up and generate graph. First preparation needs network access and
uv or real Python 3.10+. Custom engines remain user-managed; ordinary startup
does not download dependencies. No hidden npm postinstall is added because
pnpm install scripts require execution approval. See validation.
0.1.1 — Native client and sidebar fixes
0.1.1
修复 DSH Web/桌面客户端的原生加载和图谱侧栏显示:
- Client 发行文件改用 DSH 官方 closure-factory 格式,解决
Cannot use import statement outside a module。 - 侧栏正文按插件 provider ID 注册,解决打开图谱后显示“这类内容还没有可用的查看方式”。
- 浏览器回归直接执行发行文件;补充真实 Windows Desktop 0.2.0-rc.2 的隔离安装、启用、图谱读取、搜索、HTML 导出和卸载/重装验证。
桌面安装 dsh-code-review-graph@0.1.1,完成后点击“立即启用”。已有旧版先通过
原生插件管理器卸载;安装状态尚未确认时先核对状态。
用户报告的 pnpm 十分钟无输出超时未能复现。相同旧包及原有依赖组合均可正常安装;
本次修复不代表该安装器超时已解决。其他桌面平台/版本未整机实测,详细范围见
验证记录。没有运行模型推理,也未修改用户的 DSH 配置。
English
- Emit the Client in DSH's native closure-factory format, fixing
Cannot use import statement outside a modulein the actual loader. - Register the sidebar body under the plugin provider ID, fixing the unavailable-view fallback when opening a graph.
- Execute the published Client in browser regressions; add isolated installation, enablement, native graph reading/search/HTML export, removal and reinstallation checks using the actual Windows Desktop 0.2.0-rc.2 application.
Install dsh-code-review-graph@0.1.1 in the native Desktop plugin manager, then
choose Enable now. Remove an existing old version through that manager first;
reconcile an unconfirmed installation before proceeding.
The reported ten-minute pnpm no-output timeout did not reproduce with the same
old package and dependency combination. This release does not claim to resolve
that installer timeout. Other Desktop platforms/releases have not been tested as
complete applications. See validation for scope. No model
inference or changes to the user's DSH configuration were involved.
Validation and package
- Adapter: Windows/Linux/macOS × DSH 0.1.5-rc.2 and 0.2.0-rc.2
- Core: Windows/Linux/macOS
- Actual Windows Desktop: clean profile
- Actual Windows Desktop: existing three-plugin combination
The attached npm tarball is the exact package exercised by both real Desktop runs.
SHA-256: b363fc2401e0e8afeb1182433ecbf12384e8e6721c46af191f448c031f0e49bf.