Version 2.52.0 Release: Index Routing and Query De-noising

This commit is contained in:
g1nation
2026-05-03 20:09:39 +09:00
parent 53edc33c3e
commit f230eb4663
4 changed files with 84 additions and 9 deletions
+20
View File
@@ -360,4 +360,24 @@ describe('Second Brain Trace', () => {
expect(context).toContain('Material planning rule');
expect(context).toContain('Coverage rule');
});
it('treats index documents as routing hints instead of overusing them as slot material', () => {
const trace = buildSecondBrainTrace(
'나는 /Volumes/Data/project/Antigravity/ConnectAI 여기에서 사용자가 질문이나 보고서를 작성해달라고 했을때 backend에 저장된 혹은 frontend에 저장된 template 말고 제2뇌 지식으로 최선의 결과물을 만들고 싶어',
brainRoot,
{ force: true }
);
const indexDoc = trace.retrievedDocuments.find((doc) => doc.path === 'AI_and_ML/AI_and_ML.md');
const context = renderSecondBrainTraceContext(trace);
if (indexDoc) {
expect(indexDoc.knowledgeRole).toBe('routing-hint');
expect(indexDoc.usedInAnswer).not.toBe(true);
}
expect(trace.knowledgeSlots.some((slot) => slot.selectedPaths.includes('AI_and_ML/AI_and_ML.md'))).toBe(false);
expect(trace.knowledgeSlots.find((slot) => slot.id === 'writing')?.retrievalQuery).not.toContain('/Volumes');
expect(trace.knowledgeSlots.find((slot) => slot.id === 'writing')?.retrievalQuery).not.toContain('사용자가');
expect(trace.knowledgeSlots.find((slot) => slot.id === 'writing')?.selectedPaths.join('\n')).toContain('Report Narrative Structure.md');
expect(context).toContain('Index rule');
});
});