@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 +6 -0
- package/README.md +3 -1
- package/package.json +1 -1
- package/src/review.mjs +6 -0
- package/src/risk-read-coverage.mjs +6 -0
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
package/package.json
CHANGED
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
|
+
}
|