fix(ai-review comment): 顯示審查問題原因

This commit is contained in:
2026-06-22 10:27:33 +00:00
parent bbd7570a5b
commit f83a2034a8
7 changed files with 23 additions and 6 deletions
+2 -1
View File
@@ -115,7 +115,7 @@ describe('findings exclusions', () => {
it('builds a compact exclusion hint for AI', async () => {
const findings = [
{ level: 'warning', role: 'Maya', location: 'src/app.cs:12', suggestion: 'update tests' },
{ level: 'warning', role: 'Maya', location: 'src/app.cs:12', problem: '缺少測試驗證', suggestion: 'update tests' },
];
const exclusions = [
{ location: 'src/app.cs:1', original_finding: '更新套件後請補上測試驗證' },
@@ -138,6 +138,7 @@ describe('findings exclusions', () => {
assert.ok(capturedSystemPrompt.includes('paths=src/app.cs, src/service.cs'));
assert.ok(capturedSystemPrompt.includes('請確認安全性變更'));
assert.ok(capturedUserContent.includes('"location":"src/app.cs:12"'));
assert.ok(capturedUserContent.includes('"problem":"缺少測試驗證"'));
assert.ok(capturedUserContent.includes('"suggestion":"update tests"'));
});