@feng0531/dsh-code-review 0.33.2 → 0.33.3

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.33.3
4
+
5
+ - 超预算主审切为精确窗口时,上下文正文留在原批准快照按需read;初始输入仅带版本侧catalog,避免上下文重复导致所有窗口持续超限。不扩大读取范围,不裁剪证据;报告明确未声明全部上下文核查。
6
+ - 当前/历史旧侧隔离、无scope仍阻断、预览执行预算一致、超时等适配器清理且窗口pending验收通过;320离线及真实宿主离线smoke通过。候选待远端门禁,不宣称用户碰撞审查已恢复或超时根因已定位。
7
+
3
8
  ## 0.33.2
4
9
 
5
10
  - 接受唯一完整JSON的单一json/无语言Markdown围栏,不提取任意说明中的JSON、不修正文法/字段、不重试;后续原schema及证据校验不变。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feng0531/dsh-code-review",
3
- "version": "0.33.2",
3
+ "version": "0.33.3",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" },
@@ -46,7 +46,9 @@ export function preparePrimaryInput(input, file, { instructions, scope, grouping
46
46
  const windows = changeWindows(file, changes);
47
47
  if (windows) {
48
48
  const compactFile = { ...file, left: { ...file.left, text: undefined }, right: { ...file.right, text: undefined } };
49
- const compact = JSON.stringify({ ...base, file: compactFile, windows, sourceMode: 'change-windows', windowNotice: '仅提供全部精确hunk窗口,start/count为原始源码行号,不得重编号。完整源码未随初始输入发送,可在catalog批准范围内检索;缺少上下文时说明限制。' });
49
+ const contextCatalog = scope.catalog().filter(source => ['context', 'context-old'].includes(source.side));
50
+ if (contextCatalog.length) metadata.contextMode = 'approved-retrieval';
51
+ const compact = JSON.stringify({ ...base, context: [], contextCatalog, contextMode: 'approved-retrieval', contextNotice: '上下文全文仍在同一批准快照,仅目录进入窗口初始输入;必须按sourceId和版本侧read原文,不把目录视为证据或完整覆盖。', file: compactFile, windows, sourceMode: 'change-windows', windowNotice: '仅提供全部精确hunk窗口,start/count为原始源码行号,不得重编号。完整源码未随初始输入发送,可在catalog批准范围内检索;缺少上下文时说明限制。' });
50
52
  if (!measure(compact).fits) {
51
53
  const envelope = JSON.parse(compact);
52
54
  const plan = planWindowBatches(windows, subset => JSON.stringify({ ...envelope, windows: subset, windowNotice: '本批仅审查windows包含的编辑,其他hunk另批;行号为原始行号,跨片段上下文不足说明限制。' }), measure);
package/src/review.mjs CHANGED
@@ -117,6 +117,7 @@ export async function reviewSnapshot(snapshot, model, options = {}) {
117
117
  const prepared = preparePrimaryInput(input, file, { instructions: REVIEW_INSTRUCTIONS, scope, grouping: report.grouping, maxInputBytes });
118
118
  const { changes, payload } = prepared;
119
119
  Object.assign(state, prepared.metadata);
120
+ if (state.contextMode === 'approved-retrieval') report.limitations.push({ fileId: file.id, text: '窗口初始输入仅带上下文身份目录,全文须按需读取;不声明所有上下文已核查。' });
120
121
  if (prepared.synthesis) state.synthesisStatus = prepared.synthesis.budget.fits ? 'pending' : 'blocked';
121
122
  if (prepared.synthesis && !prepared.synthesis.budget.fits) report.limitations.push({ fileId: file.id, text: '跨窗口综合输入超限,未发送;单窗口完成不表示交互影响已检查' });
122
123
  if (state.sourceMode === 'change-windows') state.windowCoverage = { completed: [], pending: [...state.windowIds] };