@feng0531/dsh-code-review 0.26.0 → 0.26.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 +10 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/interaction-input.mjs +5 -2
- package/src/verification-loop.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# 变更记录
|
|
2
2
|
|
|
3
|
+
## 0.26.2
|
|
4
|
+
|
|
5
|
+
- 跨文件规划/生成输入附批准上下文import/include/caller语法绑定线索,带primaryFileId及历史contextSide/contextVersion。
|
|
6
|
+
- 只已捕获快照导航,无全仓caller扫描,不增加审查覆盖或因果证明;原输入预算测量含线索,272测试通过。
|
|
7
|
+
|
|
8
|
+
## 0.26.1
|
|
9
|
+
|
|
10
|
+
- 跨文件生成目录附各文件专用缺陷指引,按已捕获正文选择,复核复用.m内容提示不退回路径默认。
|
|
11
|
+
- 不复制正文或新增读取调用;指引纳入原输入预算,271测试通过。
|
|
12
|
+
|
|
3
13
|
## 0.26.0
|
|
4
14
|
|
|
5
15
|
- Shader/HLSL/GLSL/cginc/hlsli/compute直接字面include纳入有界自动上下文,不宏/条件展开,不编译搜索路径。
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { inferContextRelations } from './context-relations.mjs';
|
|
2
|
+
import { defectGuidance } from './defect-guidance.mjs';
|
|
1
3
|
import { changeMap } from './change-map.mjs';
|
|
2
4
|
|
|
3
5
|
// Pure navigation over one already approved snapshot. No source reads or model sends.
|
|
@@ -8,11 +10,12 @@ export function prepareInteractionInput(snapshot, group, measure) {
|
|
|
8
10
|
if (matches.length !== 1 || matches[0].eligibility !== 'reviewable' || typeof matches[0].left?.text !== 'string' || typeof matches[0].right?.text !== 'string') throw new Error('Interaction file outside approved reviewable scope');
|
|
9
11
|
const file = matches[0], changes = changeMap(file.left.text, file.right.text);
|
|
10
12
|
if (changes.status !== 'changed' || changes.precision !== 'exact') return { fileId: file.id, path: file.path, unavailable: true };
|
|
11
|
-
return { fileId: file.id, path: file.path, edits: changes.edits.map(({ id, old, new: after }) => ({ id, old, new: after })) };
|
|
13
|
+
return { fileId: file.id, path: file.path, defectGuidance: defectGuidance(file.path,file.rightExists===false?file.left.text:file.right.text), edits: changes.edits.map(({ id, old, new: after }) => ({ id, old, new: after })) };
|
|
12
14
|
});
|
|
13
15
|
if (group.fileIds.filter(id => { const file = snapshot.files.find(f => f.id === id); return file.left.text !== file.right.text; }).length < 2) return { status: 'not-applicable', fileIds: [...group.fileIds] };
|
|
14
16
|
if (files.some(f => f.unavailable)) return { status: 'blocked', reason: 'exact-edit-analysis-unavailable', fileIds: [...group.fileIds] };
|
|
15
|
-
const
|
|
17
|
+
const contextRelations = group.fileIds.flatMap(id=>inferContextRelations(snapshot,snapshot.files.find(f=>f.id===id)).map(relation=>({primaryFileId:id,...relation})));
|
|
18
|
+
const payload = JSON.stringify({ contextRelations, contextRelationNotice:'Approved-context import/include and call binding hints only; not a call graph, complete caller coverage, semantic binding or causal evidence. Historical contextSide/contextVersion must not be interchanged.', snapshotId: snapshot.id, sourceMode: 'file-interaction', groupId: group.id, files, context: snapshot.context ?? [], rules: snapshot.rules ?? [], notice: 'Only combined defects across at least two listed files; directories are navigation not evidence. Read referenced edit source sides from approved catalog in this generation. Return ordinary findings with fileId of one listed primary and exact original line anchor; attribution.editIds references only that primary. Add interaction:{editRefs:[{fileId,editId}]} including all involved edits across at least two files. This sourceMode overrides single-primary input instructions. Retain original primary anchor and file-qualified edit references. Unsupported conclusions become limitations; no repeated single-file issues. Relations and read coverage are not causal proof.' });
|
|
16
19
|
const budget = measure(payload);
|
|
17
20
|
return { status: budget.fits ? 'ready' : 'blocked', reason: budget.fits ? undefined : 'input-budget', fileIds: [...group.fileIds], payload, budget };
|
|
18
21
|
}
|
|
@@ -15,7 +15,7 @@ export async function verificationLoop(model, request, candidates, scope, option
|
|
|
15
15
|
const ids = candidates.map((_, i) => 'c' + (i + 1));
|
|
16
16
|
const envelope = request.input ? JSON.parse(request.input) : {};
|
|
17
17
|
const rules = envelope.rules ?? [];
|
|
18
|
-
const input = JSON.stringify({ defectGuidance: [...new Set(candidates.map(f => scope.catalog().find(s => s.fileId === f.fileId)?.path).filter(Boolean))].map(path => envelope.file?.path === path && envelope.defectGuidance ? envelope.defectGuidance : defectGuidance(path)), rules, candidates: candidates.map((finding, i) => ({ candidateId: ids[i], finding })) });
|
|
18
|
+
const input = JSON.stringify({ defectGuidance: [...new Set(candidates.map(f => scope.catalog().find(s => s.fileId === f.fileId)?.path).filter(Boolean))].map(path => envelope.file?.path === path && envelope.defectGuidance ? envelope.defectGuidance : envelope.files?.find(f=>f.path===path)?.defectGuidance ?? defectGuidance(path)), rules, candidates: candidates.map((finding, i) => ({ candidateId: ids[i], finding })) });
|
|
19
19
|
const receipts = createEvidenceReceipts(scope.read);
|
|
20
20
|
const retrievalScope = { ...scope, read: receipts.read };
|
|
21
21
|
const response = await retrievalLoop(model, { ...request, input, instructions: VERIFICATION_INSTRUCTIONS }, retrievalScope, options);
|