@feng0531/dsh-code-review 0.30.1 → 0.30.2

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,10 @@
1
1
  # 变更记录
2
2
 
3
+ ## 0.30.2
4
+
5
+ - 对照Agent核心plan失败继续main行为,风险计划异常回退原输入主审查,不传无效假设,保留fallback原因/partial限制。
6
+ - 原调用/时间预算与取消不绕过,不重试计划;主及交互回退287测试通过。
7
+
3
8
  ## 0.30.1
4
9
 
5
10
  - 风险请求来源sourceReadCoverage记录本批生成阶段requested/read/unread;未读来源不能以无发现冒充完整核查。
package/README.md CHANGED
@@ -4,7 +4,9 @@
4
4
 
5
5
  ## 当前状态
6
6
 
7
- 当前代码版本为 0.30.1
7
+ 当前代码版本为 0.30.2
8
+
9
+ 风险计划失败时在原预算内回退不带计划的主审查,保留fallback原因与partial限制;不重试无效计划,取消/超时/调用耗尽仍阻断。
8
10
 
9
11
  风险计划sourceIds会记录本批生成读取片段/未读状态;未读产生partial覆盖限制。search/find不算读,读过片段也不证明条件已核查或缺陷成立,不自动添加调用。
10
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feng0531/dsh-code-review",
3
- "version": "0.30.1",
3
+ "version": "0.30.2",
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
@@ -162,6 +162,7 @@ export async function reviewSnapshot(snapshot, model, options = {}) {
162
162
  state.riskPlans ??= [];
163
163
  const entry = { status: 'pending', windowIds: batch.windowIds, ...(batch.interaction ? {groupId:batch.interaction.id,sourceMode:'file-interaction'} : {}), risks: [] };
164
164
  state.riskPlans.push(entry);
165
+ try {
165
166
  const response = await executor({ ...enclosingRequest, input: batch.payload, instructions: RISK_PLAN_INSTRUCTIONS });
166
167
  const riskFiles = batch.interaction ? JSON.parse(batch.payload).files : [{ fileId: file.id, edits: changes.edits ?? [] }];
167
168
  const risks = validateRiskPlan(response, riskFiles, scope?.catalog() ?? []);
@@ -169,6 +170,11 @@ export async function reviewSnapshot(snapshot, model, options = {}) {
169
170
  entry.status = 'completed'; entry.risks = risks;
170
171
  batchPayload = JSON.stringify({ ...JSON.parse(batch.payload), riskPlan: risks, riskPlanNotice: '未可信假设而非发现或证据;须验证及寻找反证,不增加读取权限。' });
171
172
  if (!initialInputBudget({ instructions: REVIEW_INSTRUCTIONS, input: batchPayload }, scope, maxInputBytes).fits) throw new Error('Risk-enriched review input exceeds budget');
173
+ } catch(error) {
174
+ enclosingRequest.signal.throwIfAborted();
175
+ entry.status='fallback';entry.reason=error?.message??String(error);entry.risks=[];batchPayload=batch.payload;
176
+ report.limitations.push({fileId:file.id,text:'风险计划未完成,回退原输入主审查:'+entry.reason});
177
+ }
172
178
  }
173
179
  const request = { ...enclosingRequest, input: batchPayload };
174
180
  const auditStart = state.retrievalAudit?.length ?? 0;