Repository navigation
fix: 严格 review 的 R01–R10(路径扫描/正则误判、TEMP 回显错位、winget 清单、FastCtx 生命周期、后台退出码) - #34
Merged
KannaKuron merged 2 commits intoOct 23, 2026
Merged
Conversation
…and fastctx bridge - R01/R02: path literal scanner no-op guard, TEMP root whole-value mapping - R03: keep brace alternatives in absolute glob patterns - R04: native promotion propagates lossy and gapBefore with spill path - R05: winget inventory uses per-export UUID paths and verifies structure - R06: fastctx bridge separates user switch, peer yield and payload states - R07: settings card resets clean draft on scope/ready changes - R08: default directory IO uses Dirent and excludes same-name dirs - R09/R10: background outcome null preservation, typed native path percent signs Tests: review-core-regressions, review-native-regressions, review-native-preview added.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
成功保存后的草稿仍保持 dirty,后续配置更新会被忽略,再次保存可能覆盖新配置。
1 open issue
What changed in this PR
本 PR 修复 Git Bash 插件严格审查中确认的 R01–R10 问题,涵盖路径处理、工具生命周期、安装清单与执行结果展示。
Changes:
- 修正路径扫描、TEMP 回显、glob 拆分及命令文件识别。
- 加固 FastCtx 开关与异步生命周期、winget 清单读取和设置草稿同步。
- 保留输出缺口与退出码事实,并新增普通回归和真实 Core 预览用例。
| File | Description |
|---|---|
| tests/review-native-regressions.mjs | 覆盖输出缺口、退出码和原生路径回归。 |
| tests/review-native-preview.mjs | 新增真实 Core 输出与路径验证。 |
| tests/review-core-regressions.mjs | 覆盖扫描、路径、winget 和 Bash 回归。 |
| tests/client-regressions.mjs | 验证草稿同步与迟到保存响应。 |
| tests/bridge-regressions.mjs | 验证 FastCtx 开关、取消和禁止重放。 |
| src/toolchain.js | 区分命令文件、目录和符号链接。 |
| src/tool-runner.js | 使用独立导出清单并在读取失败时阻止安装。 |
| src/native-tool.js | 在后台提升时保留输出缺口提示。 |
| src/native-executor.js | 允许绝对路径中的字面百分号。 |
| src/index.js | 修正正则识别、TEMP 回显和 glob 拆分。 |
| src/fastctx-bridge.js | 加入代际所有权及实时开关检查。 |
| src/client.js | 按 scope 和草稿所有权管理同步与保存状态。 |
| src/bash-tool.js | 在后台提升时呈现 chunk 缺口。 |
| src/bash-render.js | 保留 null 退出码,缺失值显示 unknown。 |
| package.json | 将新增回归与预览文件接入测试脚本。 |
| CHANGELOG.md | 记录修复、验证结果及覆盖边界。 |
Review effort: Balanced
Add 'dirty' state management to bash draft saving logic. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Owner
|
Reviewed all ten fixes against the branch — merged as-is. Verified locally (323 tests, 322 pass + 1 platform-gated skip on macOS, matching your Windows run). The prefix-matching decision in R06 is accepted as the conservative bias: standing down gb_* on any |
KannaKuron
added a commit
that referenced
this pull request
Oct 23, 2026
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-gitbash-shell全仓做了一轮严格 review(范围是当前全仓,不只增量),覆盖 19 个产品 JS 模块、组合/patch/包清单/发布脚本与相关测试,结论是 10 项确认问题:9 项 P2、1 项 P3,未确认 P0/P1。本 PR 是这些问题的修复。修复基于
v0.42.2 / 5965fa7重新 rebase,已吸收上游dsh-ops 0.4.0渐进加载的退避检测(OPS_PRESENCE_MARKERS)。修复清单
pathEcho的 whole-value 分支不要求真实 TEMP 根前缀,D:/backup/c/Temp/result.txt被改写成/d/backup/tmp/result.txtlossy,丢弃chunks[].gapBefore,模型不知道输出有缺口renderJobRead,同时传播lossy与gapBefore,附可用 spill 路径;Bash promotion 同类遗漏一并修正winget export用固定共享临时路径且静默吞异常 ⇒ 无法建立可信清单时仍可能启动安装tools/call可能被重放tools/call不自动重试proc.exitCode ?? 0把合法的null伪造成成功退出码,后台 Job 的 detail 显示exit code: 0null,缺字段显示unknown,真实 0/非零/kill 原样%/$/~保持数据语义验证
npm test:323/323 通过,0 fail / skip / cancel(Windows / Node 24.13.0)tests/review-core-regressions.mjs、tests/review-native-regressions.mjs、tests/review-native-preview.mjs,并扩充tests/client-regressions.mjs与tests/bridge-regressions.mjsnode --check通过,npm pack --dry-run --ignore-scripts通过rebase 中的一处实质判断
上游
OPS_PRESENCE_MARKERS只列了 6 个名字(ops_inspect_local_file/ops_grep/ops_bash/ops_read_files/ops_result/ops_load_sdk),但实际 dsh-ops 环境有 10 个ops_*工具——ops_batch/ops_glob/ops_replace/ops_run未收录。R06 的代际检测原本用
startsWith('ops_')。合并时我采用前缀匹配 + 常量兜底:既覆盖上游关心的 0.4.0 三个常驻名,也覆盖列表尚未收录的名字,避免"后来调用者拿到一个从未在 face 1 常驻的名字"时漏检。上游那条断言OPS_PRESENCE_MARKERS内容的测试保留不变。边界与未覆盖
tool-bash(app.asar偏移 86825519 处同样为exit code: ${proc.exitCode ?? 0}),本 PR 只修插件侧镜像,官方侧另行报告关联
CHANGELOG.md的 "全仓严格 review" 一节,供追溯scanCommands误报)相关的部分由 R08 覆盖符号链接与无扩展名场景