feat(scoring): implemented tiered conflict severity system v2.73.0

This commit is contained in:
g1nation
2026-05-05 11:15:03 +09:00
parent 563e499324
commit e6bc263872
4 changed files with 25 additions and 9 deletions
+6 -4
View File
@@ -28,17 +28,19 @@ describe('Scoring Engine Unit Tests (v2.72.0)', () => {
expect(expanded).toContain('optimization');
});
test('Conflict Detection: should flag documents with controversial terms', () => {
test('Conflict Detection & Severity: should flag documents with tiered severity', () => {
const query = ['설계'];
const docs = [
{ title: '정상 설계 문서', content: '이 시스템은 효율적으로 설계되었습니다.' },
{ title: '상충 발생 문서', content: '이 설계는 기존 아키텍처와 충돌 논란이 있습니다.' }
{ title: '상충 발생 문서 (LOW)', content: '이 설계는 기존 아키텍처와 충돌 위험이 있습니다.' },
{ title: '강한 상충 문서 (HIGH)', content: '이 설계는 오류가 많고 논란이 크며 반대 의견과 반박이 거셉니다.' }
];
const results = scoreTfIdf(tokenize(query.join(' ')), docs);
expect(results[0].conflictDetected).toBe(false);
expect(results[1].conflictDetected).toBe(true);
expect(results[0].conflictSeverity).toBe('NONE');
expect(results[1].conflictSeverity).toBe('LOW');
expect(results[2].conflictSeverity).toBe('HIGH');
});
test('IDF Smoothing: should provide stable scores for small datasets', () => {