Repository navigation
fix(#21-#24) 多方案-sol-a:全面修复 4 个 issue - #25
Closed
Nicholas023 wants to merge 4 commits into
Closed
Nicholas023 wants to merge 4 commits into
Nicholas023 wants to merge 4 commits into
Conversation
Owner
Author
|
整合 PR #29 已吸收本方案精华并合并(lead 实测比对后取舍)。本 PR 关闭存档,diff 仍可通过本页查看。 |
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.
概述
独立修复 dsh-code-review 的 4 个 issue(#21/#22/#23/#24),未触碰引擎 Go 源码与生产目录。每个 issue 单独提交,commit message 遵循
fix(#NN): ...风格。逐 issue 修复
fix(#21) —
src/model-provider.js(L62-78)loadProfileLlmConfig()的catch分支静默return null——js-yaml 依赖损坏/缺失时路由表为空、评审 0.0s 失败且失败文案不指向原因,排查无从下手。console.error输出可诊断信息(含真实错误原因),保持return null契约不变(不抛、不改返回值;运行态降级链与scripts/switch-model-e2e.mjs的check('解析出端点', !!ep)+ep?.keyEnv安全链均依赖此契约)。createModelSource不抛异常,resolveProvider('session')返回null(契约保持)。fix(#22) —
scripts/engine-e2e-smoke.mjs(L114-122)+scripts/sensitive-e2e-smoke.mjs(L105-125 区域)OCR_LLM_TOKEN: key(成字面量'undefined')并 spawn 引擎空等 180s 必败。新增else if (typeof key !== 'string' || key.length < 8)短路分支,输出check('跳过引擎调用(key 缺失)', true, ...)显式说明跳过原因,无 key 环境不再空等、不误报失败。if (candidates.length > 0)报告分支内——reviewOnce 静默失败且报告未落盘时整段跳过 = 假绿。已提出为独立断言:text非空时断言无泄露;为空时显式失败归因(「评审返回空文本,无法验证送审链路」,与上方「评审返回非空文本」失败项叠加指向同一根因),杜绝静默跳过。fix(#23) —
dsh-plugin.json(3 处权限声明)+src/set-config-tool.js(L130-190 report_dir 校验块)engine_bin已有同风格写前校验(L129-140)作样式参照,report_dir 补齐后两字段口径统一;③ 风险可控:set-config 测试只覆盖查询与 review_model 写入、e2e 各脚本直接构造配置不经此 execute,加校验不回退既有测试。~展开(与 report.js expandHome 同口径);② resolve 规范化后必须位于 home 下(win32 忽略大小写前缀判断);③ 对最近存在的祖先做 realpath 后拼接不存在的后续段,防符号链接逃逸;④ 已存在但非目录拒绝;⑤ 落盘规范化绝对路径(expandHome 幂等);⑥ 被拒只剔除该字段(与 engine_bin 同「逐字段合并」语义),整单只剩被拒字段时整体拒写。~展开/绝对路径合法写入且落盘绝对路径;home 外路径、home 外会话目录下的相对路径被拒(单字段整体拒写、多字段字段级拒写);空串清空恢复默认。fix(#24) —
src/sensitive-list.js(4 处)tokens?后加(?=[._-]|$)显式词边界——tokenizer-decoder.yml 这类「token 词段后接普通字符」从结构上锁死不误伤。.secrets/.my.secret/.secrets.yml保持命中),r9 加(?!.)负向前瞻只管「非点开头词段」——两行职责互斥。(\.|$)→.env式(\.[^/]+)?$,扩展名后只能跟一个后缀段并到行尾。~ # &(删除线/标题锚点/HTML 实体起始字符,防文件名破坏报告 markdown 结构)。npm run unit56 项全过。Gate 测试结果
npm run checknode --check语法通过npm run unitnpm run selfchecknpm run e2e-enginebin/codecheck.exe缺失,出 issue 范围),check 输出明确「引擎存在 — 请先把引擎二进制放到插件包 bin/」;key 缺失短路分支就绪npm run e2e-sensitivenpm run e2e-switch已知 Tradeoffs
bin/下无codecheck.exe(引擎为 Go 源码、发布走 GitHub Release,编译产物不在本任务范围)。e2e 三件套均 5 分钟内自然结束、无挂死、无新增异常形态,符合任务判据;修复的代码路径(key 缺失短路、断言提出嵌套、null 契约)均已通过针对性验证。