@feng0531/dsh-code-review 0.26.0 → 0.26.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 +5 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/interaction-input.mjs +2 -1
- package/src/verification-loop.mjs +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defectGuidance } from './defect-guidance.mjs';
|
|
1
2
|
import { changeMap } from './change-map.mjs';
|
|
2
3
|
|
|
3
4
|
// Pure navigation over one already approved snapshot. No source reads or model sends.
|
|
@@ -8,7 +9,7 @@ export function prepareInteractionInput(snapshot, group, measure) {
|
|
|
8
9
|
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
10
|
const file = matches[0], changes = changeMap(file.left.text, file.right.text);
|
|
10
11
|
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 })) };
|
|
12
|
+
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
13
|
});
|
|
13
14
|
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
15
|
if (files.some(f => f.unavailable)) return { status: 'blocked', reason: 'exact-edit-analysis-unavailable', fileIds: [...group.fileIds] };
|
|
@@ -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);
|