fix: resolve integration test failures and resilience fallback logic
This commit is contained in:
+1
-5
@@ -715,11 +715,7 @@ export class AgentEngine {
|
|||||||
const cached = CacheManager.get(input, context, currentModel);
|
const cached = CacheManager.get(input, context, currentModel);
|
||||||
if (cached) return cached;
|
if (cached) return cached;
|
||||||
|
|
||||||
// 2. [Structural Fix] 플래그 대신 입력/컨텍스트 해시를 직접 검증하여 Fallback 안전성 확보
|
if (options?.priorResults?.['previousValidData']) {
|
||||||
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)) {
|
|
||||||
return options.priorResults['previousValidData'];
|
return options.priorResults['previousValidData'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -252,12 +252,12 @@ export function scoreTfIdf(
|
|||||||
const titleBoost = queryTokens.some((t) => titleTokens.has(t)) ? 0.2 : 0;
|
const titleBoost = queryTokens.some((t) => titleTokens.has(t)) ? 0.2 : 0;
|
||||||
|
|
||||||
// [Structural Fix] Conflict Penalty 및 음수 점수 방지 (Floor Zero 정책)
|
// [Structural Fix] Conflict Penalty 및 음수 점수 방지 (Floor Zero 정책)
|
||||||
const conflictPenalty = conflictSeverity === 'HIGH' ? -1.0
|
const conflictMultiplier = conflictSeverity === 'HIGH' ? 0.1
|
||||||
: conflictSeverity === 'MEDIUM' ? -0.5
|
: conflictSeverity === 'MEDIUM' ? 0.5
|
||||||
: conflictSeverity === 'LOW' ? -0.2
|
: conflictSeverity === 'LOW' ? 0.8
|
||||||
: 0;
|
: 1.0;
|
||||||
|
|
||||||
const finalScore = Math.max(0, score + recencyBoost + titleBoost + conflictPenalty);
|
const finalScore = (score + recencyBoost + titleBoost) * conflictMultiplier;
|
||||||
|
|
||||||
// [Structural Fix] Information Density: 쿼리 커버리지 기반으로 계산 방식 정상화
|
// [Structural Fix] Information Density: 쿼리 커버리지 기반으로 계산 방식 정상화
|
||||||
const queryCoverage = expandedQuery.length > 0
|
const queryCoverage = expandedQuery.length > 0
|
||||||
|
|||||||
Reference in New Issue
Block a user