@feng0531/dsh-code-review 0.55.0 → 0.57.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 CHANGED
@@ -2,9 +2,17 @@
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.57.0 — 对齐结论与边界收尾
6
+
7
+ 完成组合场景整体一致性验收与完整语义导航的源码对照收尾:范围内已对齐项清空「仍需补齐」;参考独有的会话存储、断点续跑、豁免与 token 预估记为有意不同;完整语义调用方、别名与跨目录实例上下文明确为需语义解析器的范围外。不改变审查行为或参数。
8
+
9
+ ## 0.56.0 — 依赖清单与配置文件专用指导
10
+
11
+ 为 Cargo.toml、composer.json、package.json、pom.xml、build.gradle 等依赖清单补充版本可复现、依赖声明约束与发布元数据的保守缺陷提示;为 GitHub 工作流/配置、yaml、properties、json 等配置文件补充最小权限、模板字段与键名拼写的保守缺陷提示。按具体路径与后缀选择,仍为证据门控提示,不是解析或格式校验结果。只读批准快照,不改变审查行为或参数。449 项完整回归、实际宿主、隔离安装与四组 CI 通过;npm、Release 与原产物 108,081 字节一致,双哈希和清单通过。
12
+
5
13
  ## 0.55.0 — 模板引擎与基础设施即代码专用指导
6
14
 
7
- 为 Freemarker、Handlebars/Mustache、Jinja、Pug、Astro 等模板引擎补充转义边界、模板注入、缺失值与部分/继承的保守缺陷提示;为 Terraform、Bicep 补充硬编码凭据、过度授权访问、状态/生命周期与版本可复现的保守缺陷提示。按具体引擎后缀选择,仍为证据门控提示,不是语义解析或渲染执行结果。只读批准快照,不改变审查行为或参数。
15
+ 为 Freemarker、Handlebars/Mustache、Jinja、Pug、Astro 等模板引擎补充转义边界、模板注入、缺失值与部分/继承的保守缺陷提示;为 Terraform、Bicep 补充硬编码凭据、过度授权访问、状态/生命周期与版本可复现的保守缺陷提示。按具体引擎后缀选择,仍为证据门控提示,不是语义解析或渲染执行结果。只读批准快照,不改变审查行为或参数。446 项完整回归、实际宿主、隔离安装与四组 CI 通过;npm、Release 与原产物 106,969 字节一致,双哈希和清单通过。
8
16
 
9
17
  ## 0.54.0 — 对齐结论与边界收尾
10
18
 
@@ -21,18 +21,20 @@
21
21
 
22
22
  ## 结论与边界
23
23
 
24
- 保守语法范围内的核心审查能力已对齐并正式交付:变更采集、范围保护、审查流程、检索、字面/命名空间/类实例调用方发现、命名与默认定义、历史同版本上下文、三层依赖链、语言与五类协议提示、多轮×窗口×检索×分组×验证的组合验收。以下剩余项不在本目标的保守范围或由目标明确后置,不猜测也不虚假宣称完成:
24
+ 保守语法范围内的核心审查能力已对齐并正式交付:变更采集、范围保护、审查流程、检索、字面/命名空间/类实例调用方发现、命名与默认定义、历史同版本上下文、三层依赖链、语言与各类文件(模板、基础设施、依赖清单、配置)的专用指导及五类协议提示、多轮×窗口×检索×分组×验证的组合验收。以下剩余项不在本目标的保守范围或由目标明确后置,不猜测也不虚假宣称完成:
25
25
 
26
26
  - 继承、原型链与动态分派:需要语言解析器或类型检查器做语义绑定,超出「只读批准快照、不放宽预算」的保守边界。
27
+ - 完整语义调用方、别名与跨目录实例上下文:需要语义解析器;保守的命名/默认/命名空间成员/类实例方法导航已交付,其余不猜测。
27
28
  - SVN 历史区间等旧侧独有来源:历史/旧侧三层链、oldContextPaths、删除旧正文复用已交付;SVN 历史区间按设计不支持。
28
- - 依赖清单与配置类引擎版本:按「不按文件名推定行为」保持通用提示。
29
29
  - 真实模型质量评测:目标明确后置,保存真实输出、人工裁决、分开统计,不作为对齐前提。
30
30
 
31
31
  各版交付结论见「当前验证结论」与 [版本变化](CHANGELOG.md)。
32
32
 
33
33
  ## 当前验证结论
34
34
 
35
- - 最近完整回归:443 项通过。
35
+ - 最近完整回归:449 项通过。
36
+ - v0.56.0 已正式交付依赖清单与配置文件专用指导。449 项回归、实际宿主、隔离安装与四组 CI 通过;npm、Release 与原包 108,081 字节一致,SHA-256、SHA-512、清单与发布说明核验通过;不改变审查行为或参数。
37
+ - v0.55.0 已正式交付模板引擎与基础设施即代码专用指导。446 项回归、实际宿主、隔离安装与四组 CI 通过;npm、Release 与原包 106,969 字节一致,SHA-256、SHA-512、清单与发布说明核验通过;不改变审查行为或参数。
36
38
  - v0.54.0 已正式交付对齐结论与边界收尾。443 项回归、实际宿主与四组 CI 通过;npm、Release 与原包 104,761 字节一致,SHA-256、SHA-512、清单与发布说明核验通过;不改变审查行为或参数。
37
39
  - v0.53.0 已正式交付分组×验证×检索的组合验收。443 项回归、实际宿主、13 项独立安装专项与四组 CI 通过;npm、Release 与原包 104,757 字节一致,双哈希与清单核验通过;不改变审查行为或参数。
38
40
  - v0.52.1 已正式交付保守类实例方法导航。442 项回归、实际宿主、24 项独立安装专项和四组 CI 通过;npm、Release 与原包 104,817 字节一致,SHA-256、SHA-512 与清单核验通过。v0.52.0 复核发现接收者逃逸、静态修饰符与字段初始化器幻影方法误判且未参与预算省略,由 0.52.1 替代,未发布不计作交付。
@@ -10,12 +10,12 @@
10
10
 
11
11
  | 参考模块 | 当前对应能力 | 仍需补齐 |
12
12
  |---|---|---|
13
- | agent、delegate | 风险规划、分组、窗口、综合、多次审查、失败回退 | 剩余预算组合与完整场景验收 |
13
+ | agent、delegate | 风险规划、分组、窗口、综合、多次审查、失败回退 | |
14
14
  | llmloop | 模型循环、有限检索、候选反证、明确结束状态 | 真实模型质量验证 |
15
- | tool | 批准快照内的文件查找、搜索、读取和证据校验 | 必要语义调用方、定义、别名与实例上下文 |
16
- | config/rules | 语言和文件用途检查提示、显式项目规则 | 剩余专用指导及路径选择验收 |
15
+ | tool | 批准快照内的文件查找、搜索、读取和证据校验 | |
16
+ | config/rules | 语言和文件用途检查提示、显式项目规则 | |
17
17
  | diff、gitcmd、pathutil | 只读变更、固定历史对象、路径保护、命令限额 | 不照搬实时无界读取 |
18
- | model、session/manifest | 覆盖状态、未完成原因、失败与取消区别 | 组合场景的整体一致性验收 |
18
+ | model、session/manifest | 覆盖状态、未完成原因、失败与取消区别 | |
19
19
 
20
20
  ## 有意不同的实现
21
21
 
@@ -25,6 +25,9 @@
25
25
  - 默认一次审查,可选三次,不照搬参考默认次数和对话继承方式。
26
26
  - 历史重命名按删除和新增表达;区间比较使用明确端点,不自动计算合并基点。
27
27
  - 参考中的风格偏好、无条件性能建议和错误绝对规则不作为缺陷标准。
28
+ - 不建会话存储、断点续跑与豁免:参考的 reused/waived 覆盖集合与续跑流程属会话/历史管理,单次只读审查不纳入。
29
+ - 不做 pre-run token 预估警告:用共享输入字节与调用预算在运行中约束,实际覆盖以报告终态为准。
30
+ - 未覆盖项保留 pending 并报 partial,不扫成 failed:诚实暴露未完成,不伪造终态。
28
31
 
29
32
  ## 语言指导的现状与剩余细化
30
33
 
@@ -38,7 +41,7 @@
38
41
  - PO/POT、MyBatis 映射:文本身份、复数、占位符、绑定值与动态 SQL 提示。
39
42
  - JS/TS/React:hook、异步清理与渲染副作用提示。
40
43
 
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)的引擎版本和消费者约束,按“不按文件名推定行为”保留通用提示。全部提示不是语义解析、迁移执行结果或缺陷证据。
44
+ 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
45
 
43
46
  ## 固定参考文件索引
44
47
 
package/RELEASE-NOTES.md CHANGED
@@ -1,12 +1,12 @@
1
- # v0.55.0 发布说明
1
+ # v0.57.0 发布说明
2
2
 
3
- ## 模板引擎与基础设施即代码专用指导
3
+ ## 对齐结论与边界收尾
4
4
 
5
- 本轮把此前对模板与基础设施文件的通用提示细化为按引擎的保守缺陷指导:Freemarker、Handlebars/Mustache、Jinja、Pug、Astro 关注转义边界、模板注入、缺失值与部分/继承;Terraform、Bicep 关注硬编码凭据、过度授权、状态/生命周期与版本可复现。全部提示只针对具体缺陷和反证,不照搬风格偏好或性能建议,也不新增读取或放宽预算。
5
+ 本轮完成最后两类差距的源码对照收尾:组合场景整体一致性验收在保守范围内已对齐(分组阈值、预算组合、覆盖终态与失败分类均已验收),参考独有但超出范围的只有会话存储、断点续跑、豁免与 token 预估;完整语义调用方、别名与跨目录实例上下文需要语义解析器,超出保守语法绑定边界。对照表相应「仍需补齐」项清空,「有意不同」按证据补记。
6
6
 
7
7
  ## 限制
8
8
 
9
9
  - 只读批准快照,不新增读取、不放宽预算、不改变审查行为或参数。
10
- - 依赖清单与配置类文件(Cargo.toml、composer.json、package.json、pom.xml、build.gradle、GitHub 工作流、yaml、properties、json)仍保持通用提示,按“不按文件名推定行为”处理。
10
+ - 不使用版本或测试数量表示对齐百分比。
11
11
 
12
12
  使用方法见 [README](README.md)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feng0531/dsh-code-review",
3
- "version": "0.55.0",
3
+ "version": "0.57.0",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" },
@@ -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 typeChecks = fileType === 'github-workflow' ? ['Check event trust boundaries, token permissions and fork/PR-controlled inputs before privileged commands or secret exposure.', 'Check expression interpolation into shell commands, checkout/ref provenance, artifact/cache trust and required job dependency gates.'] : fileType === 'dependency-manifest' ? ['Check changed dependency versions/features against consumers, lock/resolution evidence and runtime compatibility; do not invent a vulnerability from a package name.', 'Check executable install/build hooks, publish/export entry points and platform constraints for concrete changed behavior.'] : [];
59
- return { version:5, language, ...(sniffed ? {selection:'bounded-first-nonblank-line-hint'} : {}), ...(purpose ? {fileType:purpose} : {}), ...(templateFormat || infraFormat ? {format: templateFormat ?? infraFormat} : {}), checks:[...common,...(checklists[language] ?? []),...reactChecks,...typeChecks,...purposeChecks], notice:'Guidance is not evidence, a semantic parser, a style rule or permission to read outside the snapshot.' };
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
  }