codex/dsh-runtime-fix
main
修复 DSH助手点击无反馈和发布包体积过大的问题。
caa79e7fcf307e02df21be9ee247f4ba253e613d
建议修复后合并(Request changes):本轮发现 1 项 P1 凭据发布问题。
位置:packaging/DxPartReplace.spec:39-43。
当构建环境按发布流程配置了 integration/dsh/issue-bootstrap.json 时,spec 会在第 40 行把整个 JSON 作为 dsh-runtime/issue-bootstrap.json 加入 PyInstaller 数据,并在第 42–43 行把它设为 DSH 运行包存在时的构建前置条件。该文件包含 issue reporter 的 write:issue 令牌;令牌一旦进入便携 EXE/ZIP,任何拿到发行包的人都能提取并向仓库发起工单操作。PR14 新增的 Node 运行时裁剪不会影响这个文件,因此仍会把凭据带入冻结包。
integration/dsh/issue-bootstrap.json
dsh-runtime/issue-bootstrap.json
write:issue
建议:发布构建绝不把令牌作为 datas 打包,也不要把本机凭据作为构建前置条件。将 issue reporter 改为首次运行时由本机安全配置注入,或在没有凭据时禁用该能力;增加打包回归,断言冻结目录和 ZIP 中不存在 issue-bootstrap.json、令牌字符串或等价凭据。
datas
issue-bootstrap.json
python -m pytest -q tests/dsh tests/ui/test_dsh_native_menu.py tests/packaging --tb=short
compileall
node --check
dsh_runtime_staging.py
平台当前 mergeable=true 只表示无 Git 冲突;仓库检查状态为 pending 且没有实际 CI 检查项。凭据打包问题解决并加入回归后,再重新审查合并。
mergeable=true
根据维护者说明,issue-bootstrap.json 及其中的 issue reporter 凭据是有意保留并允许随发布包携带的部署配置,不属于本 PR 的阻断缺陷。此前评论 #158 的 P1 凭据打包意见撤回。
结合当前 head caa79e7fcf307e02df21be9ee247f4ba253e613d 的独立验证:相关 DSH、UI、打包和运行时回归 219 passed,Python 编译、修改的 JS 语法检查通过;本轮未发现其他可操作问题。
更新结论:建议通过(Approve)。
fix(dsh): slim packaged runtime and surface startup errors
merge 344a279,first-parent diff 7 文件 +159/−5。行号按 origin/main(aff228e)复核。
344a279
origin/main
aff228e
packaging/dsh_runtime_staging.py:53 stage_node_modules(...)
.bin
__tests__
.ts
cd94319
tests/packaging/test_release_configuration.py:25
stage_node_modules
SELF-EXTRACTING-RELEASE.md:3
node_modules
packaging/dsh_runtime_staging.py
tests/packaging/test_dsh_runtime_staging.py
docs/testing/2026-11-02-dsh-runtime-fix.md
.gitea/workflows/ci.yml:49
后果:一套会删运行时文件的代码以"有测试覆盖"的姿态留在仓库里,未来任何人把它接回 spec 就直接踩回同一个坑;CI 也在为一个已被禁止的模块消耗时间。
建议:删除 packaging/dsh_runtime_staging.py 与对应测试(或移到 tools/legacy/ 并在 CI 里移除),文档标注"已回退,勿使用"。
tools/legacy/
ui/dsh_native.py:232-233
self.last_error
_finished()
main_window.py:1161
grep
也就是:本 PR 的标题目标"surface startup errors"仍然只到"通用文案"这一层。真实原因(例如 PR #17 里的 Stored DSH_API_KEY has no provider binding)永远到不了用户眼前。建议把 last_error 末尾 N 行脱敏后显示在失败页,并在 report_ui_error 的证据里带上同一段。
Stored DSH_API_KEY has no provider binding
last_error
report_ui_error
main_window.py:1147-1163
report_ui_error(error)
error_id
_show_error
docs/testing/2026-11-02-dsh-runtime-fix.md:9/15/17
test_dsh_runtime_staging.py
test_release_configuration.py:25
ci.yml:49
dsh_native.py:232-248
未在真实发布包上验证启动失败路径;node_modules 不在克隆中,未做动态测试。
No dependencies set.
The note is not visible to the blocked user.
修复 DSH助手点击无反馈和发布包体积过大的问题。
审查提交:
caa79e7fcf307e02df21be9ee247f4ba253e613d建议修复后合并(Request changes):本轮发现 1 项 P1 凭据发布问题。
[P1] PyInstaller 仍会把 issue reporter 令牌打进 EXE
位置:packaging/DxPartReplace.spec:39-43。
当构建环境按发布流程配置了
integration/dsh/issue-bootstrap.json时,spec 会在第 40 行把整个 JSON 作为dsh-runtime/issue-bootstrap.json加入 PyInstaller 数据,并在第 42–43 行把它设为 DSH 运行包存在时的构建前置条件。该文件包含 issue reporter 的write:issue令牌;令牌一旦进入便携 EXE/ZIP,任何拿到发行包的人都能提取并向仓库发起工单操作。PR14 新增的 Node 运行时裁剪不会影响这个文件,因此仍会把凭据带入冻结包。建议:发布构建绝不把令牌作为
datas打包,也不要把本机凭据作为构建前置条件。将 issue reporter 改为首次运行时由本机安全配置注入,或在没有凭据时禁用该能力;增加打包回归,断言冻结目录和 ZIP 中不存在issue-bootstrap.json、令牌字符串或等价凭据。已验证部分
python -m pytest -q tests/dsh tests/ui/test_dsh_native_menu.py tests/packaging --tb=short:219 passed。compileall、修改的 JSnode --check通过。dsh_runtime_staging.py的单元回归覆盖 Windows x64 保留、其他平台依赖裁剪、测试/示例/文档/source map 清理;未发现新的功能阻断。平台当前
mergeable=true只表示无 Git 冲突;仓库检查状态为 pending 且没有实际 CI 检查项。凭据打包问题解决并加入回归后,再重新审查合并。复审跟进
根据维护者说明,
issue-bootstrap.json及其中的 issue reporter 凭据是有意保留并允许随发布包携带的部署配置,不属于本 PR 的阻断缺陷。此前评论 #158 的 P1 凭据打包意见撤回。结合当前 head
caa79e7fcf307e02df21be9ee247f4ba253e613d的独立验证:相关 DSH、UI、打包和运行时回归 219 passed,Python 编译、修改的 JS 语法检查通过;本轮未发现其他可操作问题。更新结论:建议通过(Approve)。
回审已合并 PR #14(
fix(dsh): slim packaged runtime and surface startup errors)merge
344a279,first-parent diff 7 文件 +159/−5。行号按origin/main(aff228e)复核。结论:这个 PR 的两件事——"运行时瘦身"与"暴露启动错误"——一件被回退、一件没做到;建议清理遗留并补上错误暴露(P2)
P2-1 "运行时瘦身"在合并 57 分钟后被整体回退,但模块/测试/文档仍留在 main
packaging/dsh_runtime_staging.py:53 stage_node_modules(...)会按名字删除.bin、__tests__、.ts等目录。cd94319把打包用法整体回退;tests/packaging/test_release_configuration.py:25现在用 AST 断言 spec 不得引用stage_node_modules,SELF-EXTRACTING-RELEASE.md:3也要求完整node_modules。packaging/dsh_runtime_staging.py本身、它的测试tests/packaging/test_dsh_runtime_staging.py,以及docs/testing/2026-11-02-dsh-runtime-fix.md都还在 main;而且 CI 仍在跑这个测试(.gitea/workflows/ci.yml:49)。后果:一套会删运行时文件的代码以"有测试覆盖"的姿态留在仓库里,未来任何人把它接回 spec 就直接踩回同一个坑;CI 也在为一个已被禁止的模块消耗时间。
建议:删除
packaging/dsh_runtime_staging.py与对应测试(或移到tools/legacy/并在 CI 里移除),文档标注"已回退,勿使用"。P2-2 "暴露启动错误"没有真正做到
ui/dsh_native.py:232-233把 node stderr 收进self.last_error,但_finished()(:243-248)只显示"DSH 运行时已退出,请检查安装后重试。";main_window.py:1161显示"DSH助手启动失败,请检查发布包中的运行时和 Node.js。"self.last_error在 src 中没有消费者(grep只有赋值)。也就是:本 PR 的标题目标"surface startup errors"仍然只到"通用文案"这一层。真实原因(例如 PR #17 里的
Stored DSH_API_KEY has no provider binding)永远到不了用户眼前。建议把last_error末尾 N 行脱敏后显示在失败页,并在report_ui_error的证据里带上同一段。P3
main_window.py:1147-1163的report_ui_error(error)返回的error_id被丢弃:界面显示的编号与日志里的编号对不上时,现场无法用界面文字定位日志。建议显示 id。_show_error再包一层),建议合并成一句可操作的提示。docs/testing/2026-11-02-dsh-runtime-fix.md:9/15/17记录了"缩包"的数字,但没有写"已回退",容易被当成现行策略。验证记录
344a279全量 diff;dsh_runtime_staging.py、test_dsh_runtime_staging.py、test_release_configuration.py:25、ci.yml:49、dsh_native.py:232-248、main_window.py:1147-1163均在origin/main上确认。stage_node_modules实际删除后的运行时行为(已禁止使用,未执行)。未验证边界
未在真实发布包上验证启动失败路径;node_modules 不在克隆中,未做动态测试。