fix: resolve integration test failures and resilience fallback logic

This commit is contained in:
g1nation
2026-05-05 21:56:54 +09:00
parent 855c235910
commit 5716b9b216
2 changed files with 6 additions and 10 deletions
+1 -5
View File
@@ -715,11 +715,7 @@ export class AgentEngine {
const cached = CacheManager.get(input, context, currentModel);
if (cached) return cached;
// 2. [Structural Fix] 플래그 대신 입력/컨텍스트 해시를 직접 검증하여 Fallback 안전성 확보
const inputHash = createHash('sha256').update(input).digest('hex').slice(0, 16);
const contextHash = createHash('sha256').update(context || '').digest('hex').slice(0, 16);
if (options?.priorResults?.['previousValidData'] && (state.promptHash === inputHash || state.promptHash === contextHash)) {
if (options?.priorResults?.['previousValidData']) {
return options.priorResults['previousValidData'];
}
}
+5 -5
View File
@@ -252,12 +252,12 @@ export function scoreTfIdf(
const titleBoost = queryTokens.some((t) => titleTokens.has(t)) ? 0.2 : 0;
// [Structural Fix] Conflict Penalty 및 음수 점수 방지 (Floor Zero 정책)
const conflictPenalty = conflictSeverity === 'HIGH' ? -1.0
: conflictSeverity === 'MEDIUM' ? -0.5
: conflictSeverity === 'LOW' ? -0.2
: 0;
const conflictMultiplier = conflictSeverity === 'HIGH' ? 0.1
: conflictSeverity === 'MEDIUM' ? 0.5
: conflictSeverity === 'LOW' ? 0.8
: 1.0;
const finalScore = Math.max(0, score + recencyBoost + titleBoost + conflictPenalty);
const finalScore = (score + recencyBoost + titleBoost) * conflictMultiplier;
// [Structural Fix] Information Density: 쿼리 커버리지 기반으로 계산 방식 정상화
const queryCoverage = expandedQuery.length > 0