dsh-code-security 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/docs/USAGE.en.md +4 -0
- package/docs/USAGE.md +4 -0
- package/docs/VALIDATION.md +4 -0
- package/docs/validation-0.6.1.md +19 -0
- package/lib/diff.js +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
[历史英文记录](docs/CHANGELOG.en.md)
|
|
6
6
|
|
|
7
|
+
## 0.6.1(2026-10-26)
|
|
8
|
+
|
|
9
|
+
- 移除旧 Git 不支持隔离属性时的无保护重试;明确返回检查未完成,并建议升级 Git 或改用全文件扫描,避免执行仓库过滤器后仍误报通过。
|
|
10
|
+
- Windows 回归 82 项通过、3 项跳过;宿主与未验收范围见[本次记录](docs/validation-0.6.1.md)。
|
|
11
|
+
|
|
7
12
|
## 0.6.0(2026-10-25)
|
|
8
13
|
|
|
9
14
|
- 安全检查主工作台,问题、证据、覆盖与工具配置分开;切项目保护未保存设置,并通过原生会话打开文件。
|
package/docs/USAGE.en.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
[Overview](../README.en.md) · [Changelog](../CHANGELOG.md) · [Validation](VALIDATION.md)
|
|
4
4
|
|
|
5
|
+
## Unsupported Git
|
|
6
|
+
|
|
7
|
+
If Git cannot safely isolate attributes, diff scanning reports incomplete instead of falling back to commands that could execute repository filters. Upgrade Git or use the full-file scan; incomplete is not a security pass.
|
|
8
|
+
|
|
5
9
|
## Start with a change
|
|
6
10
|
|
|
7
11
|
Ask in a project chat: “Check the current changes for security issues, show evidence, and recheck the repairs.” Or open **Settings → Code security**, select the project and choose **Scan code** or **Check changes**.
|
package/docs/USAGE.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
[返回简介](../README.md) · [更新记录](../CHANGELOG.md) · [验证范围](VALIDATION.md)
|
|
4
4
|
|
|
5
|
+
## 旧 Git 的处理
|
|
6
|
+
|
|
7
|
+
若 Git 不支持安全的属性隔离,diff 检查返回未完成,不会退回可能运行仓库过滤器的命令。请升级 Git,或改用插件的全文件扫描;不能把未完成当作安全通过。
|
|
8
|
+
|
|
5
9
|
## 从一次修改开始
|
|
6
10
|
|
|
7
11
|
在项目聊天中说:“检查当前改动的安全问题,给出证据,修好后再复查。”也可以打开 DSH「设置 → 代码安全」,选择项目后点击「检查代码」或「检查改动」。
|
package/docs/VALIDATION.md
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# 0.6.1 验证记录
|
|
2
|
+
|
|
3
|
+
日期:2026-10-26。官方 Windows 宿主:DSH 0.2.1-rc.3。
|
|
4
|
+
|
|
5
|
+
## 行为变化
|
|
6
|
+
|
|
7
|
+
移除旧 Git 不支持隔离属性时的无保护重试;明确返回检查未完成,并建议升级 Git 或改用全文件扫描,避免执行仓库过滤器后仍误报通过。
|
|
8
|
+
|
|
9
|
+
## 验证与限制
|
|
10
|
+
|
|
11
|
+
- Windows 本地:85 项,82 通过、3 跳过;没有把跳过计为通过。
|
|
12
|
+
- 真实当前 Git 的 fsmonitor/clean filter 防护及阳性对照通过;不支持 --attr-source 的旧 Git 通过注入执行器模拟,未安装旧二进制。3 项外部扫描器检查明确跳过。
|
|
13
|
+
- GitHub 的跨平台 CI 和 npm 发布完整性以该版本工作流及 registry 为准;本记录不把本地测试等同于已发布。
|
|
14
|
+
|
|
15
|
+
## English
|
|
16
|
+
|
|
17
|
+
Unsupported Git attribute isolation fails closed with upgrade or full-file-scan guidance. The previous unprotected diff retry is removed, so an incomplete scan cannot be presented as a pass.
|
|
18
|
+
|
|
19
|
+
Runtime/account limits are listed above. Synthetic peers and model adapters do not establish live account delivery or model quality.
|
package/lib/diff.js
CHANGED
|
@@ -50,11 +50,11 @@ export async function runGitDiff(runner, cwd, base, target, timeoutMs = 30000, s
|
|
|
50
50
|
argv.push('--no-ext-diff', '--no-textconv', '--no-color', '--relative', '--src-prefix=a/', '--dst-prefix=b/', '--unified=3', '--output-indicator-new=+', '--output-indicator-old=-', '--output-indicator-context= ', base.trim(), '--');
|
|
51
51
|
if (target !== undefined && target.trim() !== '')
|
|
52
52
|
argv.push(target.trim());
|
|
53
|
-
|
|
54
|
-
//
|
|
55
|
-
//
|
|
53
|
+
const result = await runner.run(argv, { timeoutMs, cwd });
|
|
54
|
+
// Never disable attribute isolation on an older or incompatible Git. Doing
|
|
55
|
+
// so can execute a repository's clean filter and accept its altered output.
|
|
56
56
|
if (result.exitCode !== 0 && /attr-source/i.test(result.stderr)) {
|
|
57
|
-
|
|
57
|
+
throw new Error('当前 Git 无法启用安全的属性隔离(--attr-source),未运行未加固的 diff,审查未完成。请升级到支持该选项的 Git,或改用文件全量扫描。');
|
|
58
58
|
}
|
|
59
59
|
if (result.exitCode !== 0 && result.exitCode !== 1) {
|
|
60
60
|
throw new Error('git diff 失败(退出码 ' + String(result.exitCode) + '):' + result.stderr.trim().split(/\r?\n/).slice(-4).join(' | '));
|