@feng0531/dsh-code-review 0.55.0 → 0.56.0
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 -1
- package/CORE-ALIGNMENT-TASKS.md +2 -2
- package/CORE-SOURCE-INVENTORY.md +2 -2
- package/RELEASE-NOTES.md +3 -4
- package/package.json +1 -1
- package/src/defect-guidance.mjs +15 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
本文件介绍对使用者有意义的变化。安装与参数见 [README](README.md),本次发布正文见 [发布说明](RELEASE-NOTES.md)。历史提交和安装包保留在 [GitHub Releases](https://github.com/f-e-n-g-0531/dsh-code-review/releases);本文不把开发日志当作功能介绍。
|
|
4
4
|
|
|
5
|
+
## 0.56.0 — 依赖清单与配置文件专用指导
|
|
6
|
+
|
|
7
|
+
为 Cargo.toml、composer.json、package.json、pom.xml、build.gradle 等依赖清单补充版本可复现、依赖声明约束与发布元数据的保守缺陷提示;为 GitHub 工作流/配置、yaml、properties、json 等配置文件补充最小权限、模板字段与键名拼写的保守缺陷提示。按具体路径与后缀选择,仍为证据门控提示,不是解析或格式校验结果。只读批准快照,不改变审查行为或参数。
|
|
8
|
+
|
|
5
9
|
## 0.55.0 — 模板引擎与基础设施即代码专用指导
|
|
6
10
|
|
|
7
|
-
为 Freemarker、Handlebars/Mustache、Jinja、Pug、Astro 等模板引擎补充转义边界、模板注入、缺失值与部分/继承的保守缺陷提示;为 Terraform、Bicep 补充硬编码凭据、过度授权访问、状态/生命周期与版本可复现的保守缺陷提示。按具体引擎后缀选择,仍为证据门控提示,不是语义解析或渲染执行结果。只读批准快照,不改变审查行为或参数。
|
|
11
|
+
为 Freemarker、Handlebars/Mustache、Jinja、Pug、Astro 等模板引擎补充转义边界、模板注入、缺失值与部分/继承的保守缺陷提示;为 Terraform、Bicep 补充硬编码凭据、过度授权访问、状态/生命周期与版本可复现的保守缺陷提示。按具体引擎后缀选择,仍为证据门控提示,不是语义解析或渲染执行结果。只读批准快照,不改变审查行为或参数。446 项完整回归、实际宿主、隔离安装与四组 CI 通过;npm、Release 与原产物 106,969 字节一致,双哈希和清单通过。
|
|
8
12
|
|
|
9
13
|
## 0.54.0 — 对齐结论与边界收尾
|
|
10
14
|
|
package/CORE-ALIGNMENT-TASKS.md
CHANGED
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
|
|
26
26
|
- 继承、原型链与动态分派:需要语言解析器或类型检查器做语义绑定,超出「只读批准快照、不放宽预算」的保守边界。
|
|
27
27
|
- SVN 历史区间等旧侧独有来源:历史/旧侧三层链、oldContextPaths、删除旧正文复用已交付;SVN 历史区间按设计不支持。
|
|
28
|
-
- 依赖清单与配置类引擎版本:按「不按文件名推定行为」保持通用提示。
|
|
29
28
|
- 真实模型质量评测:目标明确后置,保存真实输出、人工裁决、分开统计,不作为对齐前提。
|
|
30
29
|
|
|
31
30
|
各版交付结论见「当前验证结论」与 [版本变化](CHANGELOG.md)。
|
|
32
31
|
|
|
33
32
|
## 当前验证结论
|
|
34
33
|
|
|
35
|
-
- 最近完整回归:
|
|
34
|
+
- 最近完整回归:446 项通过。
|
|
35
|
+
- v0.55.0 已正式交付模板引擎与基础设施即代码专用指导。446 项回归、实际宿主、隔离安装与四组 CI 通过;npm、Release 与原包 106,969 字节一致,SHA-256、SHA-512、清单与发布说明核验通过;不改变审查行为或参数。
|
|
36
36
|
- v0.54.0 已正式交付对齐结论与边界收尾。443 项回归、实际宿主与四组 CI 通过;npm、Release 与原包 104,761 字节一致,SHA-256、SHA-512、清单与发布说明核验通过;不改变审查行为或参数。
|
|
37
37
|
- v0.53.0 已正式交付分组×验证×检索的组合验收。443 项回归、实际宿主、13 项独立安装专项与四组 CI 通过;npm、Release 与原包 104,757 字节一致,双哈希与清单核验通过;不改变审查行为或参数。
|
|
38
38
|
- v0.52.1 已正式交付保守类实例方法导航。442 项回归、实际宿主、24 项独立安装专项和四组 CI 通过;npm、Release 与原包 104,817 字节一致,SHA-256、SHA-512 与清单核验通过。v0.52.0 复核发现接收者逃逸、静态修饰符与字段初始化器幻影方法误判且未参与预算省略,由 0.52.1 替代,未发布不计作交付。
|
package/CORE-SOURCE-INVENTORY.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
| agent、delegate | 风险规划、分组、窗口、综合、多次审查、失败回退 | 剩余预算组合与完整场景验收 |
|
|
14
14
|
| llmloop | 模型循环、有限检索、候选反证、明确结束状态 | 真实模型质量验证 |
|
|
15
15
|
| tool | 批准快照内的文件查找、搜索、读取和证据校验 | 必要语义调用方、定义、别名与实例上下文 |
|
|
16
|
-
| config/rules | 语言和文件用途检查提示、显式项目规则 |
|
|
16
|
+
| config/rules | 语言和文件用途检查提示、显式项目规则 | |
|
|
17
17
|
| diff、gitcmd、pathutil | 只读变更、固定历史对象、路径保护、命令限额 | 不照搬实时无界读取 |
|
|
18
18
|
| model、session/manifest | 覆盖状态、未完成原因、失败与取消区别 | 组合场景的整体一致性验收 |
|
|
19
19
|
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
- PO/POT、MyBatis 映射:文本身份、复数、占位符、绑定值与动态 SQL 提示。
|
|
39
39
|
- JS/TS/React:hook、异步清理与渲染副作用提示。
|
|
40
40
|
|
|
41
|
-
Protobuf、Thrift、Cap’n Proto、GraphQL、Prisma 的专用指导已交付;Go/Python/Rust 的版本前提与调用契约提示、ArkTS 提示、Objective-C/Swift/Kotlin/Java/C/C++ 的生命周期与并发细化提示也已交付;模板引擎(Freemarker、Handlebars/Mustache、Jinja、Pug、Astro
|
|
41
|
+
Protobuf、Thrift、Cap’n Proto、GraphQL、Prisma 的专用指导已交付;Go/Python/Rust 的版本前提与调用契约提示、ArkTS 提示、Objective-C/Swift/Kotlin/Java/C/C++ 的生命周期与并发细化提示也已交付;模板引擎(Freemarker、Handlebars/Mustache、Jinja、Pug、Astro)、基础设施即代码(Terraform、Bicep)与依赖清单/配置(Cargo.toml、composer.json、package.json、pom.xml、build.gradle、GitHub 工作流/配置、yaml、properties、json)的保守缺陷提示均已交付。全部提示不是语义解析、迁移执行结果或缺陷证据。
|
|
42
42
|
|
|
43
43
|
## 固定参考文件索引
|
|
44
44
|
|
package/RELEASE-NOTES.md
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
# v0.
|
|
1
|
+
# v0.56.0 发布说明
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 依赖清单与配置文件专用指导
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
本轮把此前对依赖清单与配置文件的通用提示细化为按文件类型的保守缺陷指导:Cargo.toml、composer.json、package.json、pom.xml、build.gradle 关注版本可复现、依赖声明约束与发布元数据;GitHub 工作流/配置、yaml、properties、json 关注最小权限、模板字段与键名拼写。全部提示只针对具体缺陷和反证,不照搬风格偏好或格式偏好,也不新增读取或放宽预算。
|
|
6
6
|
|
|
7
7
|
## 限制
|
|
8
8
|
|
|
9
9
|
- 只读批准快照,不新增读取、不放宽预算、不改变审查行为或参数。
|
|
10
|
-
- 依赖清单与配置类文件(Cargo.toml、composer.json、package.json、pom.xml、build.gradle、GitHub 工作流、yaml、properties、json)仍保持通用提示,按“不按文件名推定行为”处理。
|
|
11
10
|
|
|
12
11
|
使用方法见 [README](README.md)。
|
package/package.json
CHANGED
package/src/defect-guidance.mjs
CHANGED
|
@@ -40,7 +40,17 @@ const checklists = {
|
|
|
40
40
|
pug: ['Check !{value} / != value on untrusted HTML, escaped #{value} / = value in JS/CSS/JSON/URL/handler contexts, and &attributes(spread) or link/event attributes built from caller-controlled keys and values; do not report ordinary #{value} or = value HTML text.', 'Check script. blocks interpolating values without JS/JSON-safe serialization or without neutralizing </script>, and secrets or oversized objects serialized to client-visible markup.', 'Check attacker-authored template source (compile/render), request-controlled include/extends without an allowlist, and unbuffered code (-) performing filesystem/network/shared-state side effects; do not treat compile-time filters as runtime sanitizers of dynamic locals.'],
|
|
41
41
|
astro: ['Check set:html on untrusted content, and non-PUBLIC_ env, cookies, headers, sessions or secrets reaching client HTML, scripts or hydrated islands unless the boundary is intentional.', 'Check client:* directives on non-framework components, missing fallback for client:only or server:defer, and over-hydration from large or unnecessary islands.', 'Check props or data crossing server:defer or define:vars boundaries for functions, circular objects, secrets or oversized payloads; do not assume frontmatter values are reactive in the browser.'],
|
|
42
42
|
terraform: ['Check literal secrets (passwords, API keys, access keys, connection strings) assigned to arguments, variable/locals defaults or committed .tfvars, and credential-shaped variables missing sensitive = true.', 'Check 0.0.0.0/0, ::/0 or "*" sources on sensitive ports and wildcard IAM actions/resources or public ACLs without a public-content purpose stated in the diff.', 'Check committed .tfstate, removed prevent_destroy on stateful resources, stateful resources missing lifecycle where siblings have one, and unbounded provider/module versions where siblings pin; do not flag terraform fmt whitespace.'],
|
|
43
|
-
bicep: ['Check literal secrets (passwords, connection strings, API keys) on resource properties, parameter defaults or variables, and credential-shaped parameters missing @secure().', 'Check broad roleAssignments (Owner/Contributor), NSG rules with */Internet/0.0.0.0 on sensitive ports, and publicNetworkAccess enabled without compensating networkAcls or private endpoints.', 'Check storage without a pinned minimumTlsVersion or with supportsHttpsTrafficOnly = false only when the diff shows the insecure value, stale api-version relative to siblings, and unpinned module references where siblings pin; do not flag omitted optional hardening alone.']
|
|
43
|
+
bicep: ['Check literal secrets (passwords, connection strings, API keys) on resource properties, parameter defaults or variables, and credential-shaped parameters missing @secure().', 'Check broad roleAssignments (Owner/Contributor), NSG rules with */Internet/0.0.0.0 on sensitive ports, and publicNetworkAccess enabled without compensating networkAcls or private endpoints.', 'Check storage without a pinned minimumTlsVersion or with supportsHttpsTrafficOnly = false only when the diff shows the insecure value, stale api-version relative to siblings, and unpinned module references where siblings pin; do not flag omitted optional hardening alone.'],
|
|
44
|
+
pom_xml: ['Check SNAPSHOT versions in newly added coordinates in production builds; a missing version is normally parent-POM-managed, and do not flag versions not on added lines.'],
|
|
45
|
+
build_gradle: ['Check SNAPSHOT or floating versions in newly added dependencies; prefer a specific version number, and do not flag versions not on added lines.'],
|
|
46
|
+
package_json: ['Check dependencies pinned to "latest" or "*" instead of a specific version, and do not flag versions not on added lines.', 'Check the same dependency declared in both dependencies and devDependencies, and tools named in scripts that are missing from devDependencies.'],
|
|
47
|
+
cargo_toml: ['Check wildcard (*) dependency versions, unpinned git sources without rev/tag, and dependencies placed in the wrong section (dependencies versus dev-dependencies/build-dependencies); require reproducible sources only where a lock or policy demands it.', 'Check missing edition or rust-version where the workspace requires it, and feature flags that disable dependent behavior, leak internal optional dependency names, or enable heavy integrations by default; do not treat additive features as defects.', 'Check published crates missing license/repository/description metadata and packaged artifacts, credentials, local paths or secrets; report only when the crate is actually distributed.'],
|
|
48
|
+
composer_json: ['Check wildcard or mutable VCS constraints without a committed lock for applications, changed constraints permitting an unintended major, and production packages available only through require-dev; do not flag compatible ranges in libraries or unverified vulnerability claims.', 'Check the php constraint against changed syntax/APIs/CI runtime, missing mandatory ext-* requirements, and config.platform that masks a production mismatch.', 'Check PSR-4/autoload mapping that cannot resolve a moved or renamed class, autoload.files side effects, and lifecycle scripts running destructive or interpolated commands without declared tool dependencies.', 'Check disabled secure-http, plaintext or credential-bearing repository URLs, and weakened minimum-stability without prefer-stable; report an exposed secret or internal source only with concrete evidence.'],
|
|
49
|
+
github_workflows: ['Check pull_request_target workflows that run untrusted PR head code with write permissions, expressions interpolated directly into run: shell, and secrets printed or applied beyond the steps that need them.', 'Check hardcoded credentials and overly broad permissions (write-all or a missing permissions key); require least-privilege and a full-SHA pin for third-party actions, while actions/* at v4 is acceptable.', 'Check broken job dependencies, matrix coverage gaps and missing timeouts where the surrounding workflow shows them; do not report missing caching or first-party tag pinning as defects.'],
|
|
50
|
+
github_config: ['Check issue/PR template completeness (name/description/body/id), valid input types and non-empty dropdown options where the schema requires them.', 'Check release configuration category labels, a catch-all default category, and misspelled configuration keys that would be silently ignored.'],
|
|
51
|
+
yaml: ['Check spelling of YAML keys against the surrounding schema; ignore value content and do not infer a schema that is not captured.'],
|
|
52
|
+
properties: ['Check duplicate keys, malformed key-value entries (missing separator or stray whitespace) and unescaped backslashes/unicode in the visible scope.', 'Check plaintext passwords, API keys or connection strings; report only concrete sensitive values, not every user-editable property.'],
|
|
53
|
+
json: ['Check spelling of JSON keys against the surrounding schema; ignore value content and do not infer a schema that is not captured.']
|
|
44
54
|
};
|
|
45
55
|
export function defectGuidance(filePath, sourceText = '') {
|
|
46
56
|
const lower = filePath.toLowerCase(), protocol = protocolGuidance(filePath);
|
|
@@ -55,6 +65,8 @@ export function defectGuidance(filePath, sourceText = '') {
|
|
|
55
65
|
const infraFormat = /\.(tf|hcl|tfvars)$/.test(lower) ? 'terraform' : /\.bicep$/.test(lower) ? 'bicep' : undefined;
|
|
56
66
|
const purposeChecks = purpose === 'protocol-schema' ? protocol.checks : purpose === 'template' ? (checklists[templateFormat] ?? ['Check escaping for the actual HTML/attribute/URL/script context, untrusted raw output and template execution boundaries.', 'Check missing/null variables and changed conditional branches against captured callers; do not invent engine defaults.']) : purpose === 'infrastructure' ? (checklists[infraFormat] ?? ['Check privilege/network exposure, secret/state handling and untrusted interpolation against actual provider semantics.', 'Check replacement/deletion, dependency order and changed defaults for concrete data loss or service disruption; configuration is not an applied plan.']) : [];
|
|
57
67
|
const reactChecks = /\.(jsx|tsx)$/.test(lower) ? checklists.react : [];
|
|
58
|
-
const
|
|
59
|
-
|
|
68
|
+
const manifestFormat = /(?:^|\/)package\.json$/.test(lower) ? 'package_json' : /(?:^|\/)cargo\.toml$/.test(lower) ? 'cargo_toml' : /(?:^|\/)pom\.xml$/.test(lower) ? 'pom_xml' : /(?:^|\/)build\.gradle$/.test(lower) ? 'build_gradle' : /(?:^|\/)composer\.json$/.test(lower) ? 'composer_json' : undefined;
|
|
69
|
+
const configFormat = fileType === 'github-workflow' ? 'github_workflows' : /^\.github\/.+\.(yaml|yml)$/.test(lower) ? 'github_config' : /\.(yaml|yml)$/.test(lower) ? 'yaml' : /\.properties$/.test(lower) ? 'properties' : /\.(json|json5)$/.test(lower) ? 'json' : undefined;
|
|
70
|
+
const format = manifestFormat ?? configFormat;
|
|
71
|
+
return { version:5, language, ...(sniffed ? {selection:'bounded-first-nonblank-line-hint'} : {}), ...(purpose ? {fileType:purpose} : {}), ...(format || templateFormat || infraFormat ? {format: format ?? templateFormat ?? infraFormat} : {}), checks:[...common,...(format ? (checklists[format] ?? []) : (checklists[language] ?? [])),...reactChecks,...purposeChecks], notice:'Guidance is not evidence, a semantic parser, a style rule or permission to read outside the snapshot.' };
|
|
60
72
|
}
|