@feng0531/dsh-code-review 0.30.0 → 0.30.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # 变更记录
2
2
 
3
+ ## 0.30.1
4
+
5
+ - 风险请求来源sourceReadCoverage记录本批生成阶段requested/read/unread;未读来源不能以无发现冒充完整核查。
6
+ - search/find与旧批次不算片段读取,报告partial限制,无新调用/权限,285测试通过。
7
+ - 完成主loop核心退出/定位/预算调度复核;agent/templates剩余核查仍待。
8
+
3
9
  ## 0.30.0
4
10
 
5
11
  - Git自动直接上下文改512字面候选index探针,不枚举全tracked;普通tracked有效性及同probe竞态重核保持。
package/README.md CHANGED
@@ -4,7 +4,9 @@
4
4
 
5
5
  ## 当前状态
6
6
 
7
- 当前代码版本为 0.30.0
7
+ 当前代码版本为 0.30.1
8
+
9
+ 风险计划sourceIds会记录本批生成读取片段/未读状态;未读产生partial覆盖限制。search/find不算读,读过片段也不证明条件已核查或缺陷成立,不自动添加调用。
8
10
 
9
11
  Git自动直接依赖上下文仅查询从已捕获源码导出的最多512路径索引探针,不列整个tracked树;累计索引1MiB并在结束核对同探针指纹。SVN沿用原索引限额,此项不冒充SVN等价。
10
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feng0531/dsh-code-review",
3
- "version": "0.30.0",
3
+ "version": "0.30.1",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" },
package/src/review.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { correctAnchor } from './anchor-correction.mjs';
2
+ import { riskReadCoverage } from './risk-read-coverage.mjs';
2
3
  import { BUSINESS_GROUP_INSTRUCTIONS, prepareBusinessGroups, validateBusinessGroups } from './business-groups.mjs';
3
4
  import { RISK_PLAN_INSTRUCTIONS, validateRiskPlan } from './risk-plan.mjs';
4
5
  import { prepareInteractionInput } from './interaction-input.mjs';
@@ -186,6 +187,11 @@ export async function reviewSnapshot(snapshot, model, options = {}) {
186
187
  response = decoded;
187
188
  }
188
189
  }
190
+ if (options.enableRiskPlanning === true && !batch.synthesis) {
191
+ const entry=state.riskPlans.at(-1);
192
+ entry.sourceReadCoverage=riskReadCoverage(entry.risks,(state.retrievalAudit??[]).slice(auditStart),scope?.catalog()??[],input.id);
193
+ if(entry.sourceReadCoverage.some(c=>c.unreadSourceIds.length)) report.limitations.push({fileId:file.id,text:'风险计划请求的部分来源未在本次生成阶段读取;不能视为已核查风险条件或排除问题'});
194
+ }
189
195
  const generated = batch.interaction ? validateInteractionFindings(response, input, batch.interaction, (state.retrievalAudit ?? []).slice(auditStart), scope.catalog()) : validateResponse(response, file, changes);
190
196
  if (batch.synthesis) validateSynthesisReads(generated.findings, changes, (state.retrievalAudit ?? []).slice(auditStart), scope.catalog(), file.id, input.id);
191
197
  if (!batch.interaction && state.sourceMode === 'change-windows') validateWindowFindings(generated.findings, batch.synthesis ? prepared.synthesis.windows : JSON.parse(batch.payload).windows, batch.synthesis === true);
@@ -0,0 +1,6 @@
1
+ // Read occurrence only, never complete source coverage or semantic verification.
2
+ export function riskReadCoverage(risks, audit, catalog, snapshotId){
3
+ const allowed=new Set(catalog.map(s=>s.id));
4
+ const read=new Set(audit.filter(r=>r.kind==='read'&&r.snapshotId===snapshotId&&r.stage==='retrieved-locally'&&Number.isSafeInteger(r.count)&&r.count>0&&allowed.has(r.sourceId)).map(r=>r.sourceId));
5
+ return risks.map(r=>({riskId:r.id,requestedSourceIds:[...r.sourceIds],readSourceIds:r.sourceIds.filter(id=>read.has(id)),unreadSourceIds:r.sourceIds.filter(id=>!read.has(id)),status:r.sourceIds.some(id=>!read.has(id))?'unread-sources':r.sourceIds.length?'fragments-read':'no-sources-requested',conditions:'unverified'}));
6
+ }