Release: v2.36.0 - P-Reinforce v3.0 Standard Integration
This commit is contained in:
@@ -28,6 +28,21 @@ describe('Second Brain Trace', () => {
|
||||
'# General Note\n\nThis unrelated note talks about coffee and weather.',
|
||||
'utf8'
|
||||
);
|
||||
fs.mkdirSync(path.join(brainRoot, '00_Raw', 'conversations'), { recursive: true });
|
||||
fs.writeFileSync(
|
||||
path.join(brainRoot, '00_Raw', 'conversations', '2026-05-01.md'),
|
||||
[
|
||||
'# Raw Conversation',
|
||||
'',
|
||||
'dependency complexity schema drift documentation gap recommendations',
|
||||
'This is a noisy transcript and should not be selected before curated records.'
|
||||
].join('\n'),
|
||||
'utf8'
|
||||
);
|
||||
fs.writeFileSync(
|
||||
path.join(brainRoot, 'Index_692.md'),
|
||||
'# Index\n\ndependency complexity schema drift documentation gap'
|
||||
);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -41,6 +56,7 @@ describe('Second Brain Trace', () => {
|
||||
expect(trace.secondBrainUsed).toBe(true);
|
||||
expect(trace.retrievedDocuments[0].path).toContain('ADR-0002-low-dependency-design.md');
|
||||
expect(trace.retrievedDocuments[0].usedInAnswer).toBe(true);
|
||||
expect(trace.retrievedDocuments[0].selectedForAnswerContext).toBe(true);
|
||||
expect(trace.groundingScore).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
@@ -52,10 +68,11 @@ describe('Second Brain Trace', () => {
|
||||
expect(markdown).toContain('<details>');
|
||||
expect(markdown).toContain('<summary>2nd Brain Trace: 사용함');
|
||||
expect(markdown).toContain('## 2nd Brain 사용 여부');
|
||||
expect(markdown).toContain('## 참고한 2nd Brain 문서');
|
||||
expect(markdown).toContain('## 답변 컨텍스트로 선택된 2nd Brain 문서');
|
||||
expect(markdown).toContain('## Second Brain Debug JSON');
|
||||
expect(context).toContain('[SECOND BRAIN TRACE]');
|
||||
expect(context).toContain('Retrieval query:');
|
||||
expect(context).toContain('Do not imitate dramatic wording');
|
||||
});
|
||||
|
||||
it('explains when Second Brain is not needed', () => {
|
||||
@@ -66,4 +83,15 @@ describe('Second Brain Trace', () => {
|
||||
expect(renderSecondBrainTraceMarkdown(trace)).toContain('사용하지 않음');
|
||||
expect(renderSecondBrainTraceMarkdown(trace)).toContain('<details>');
|
||||
});
|
||||
|
||||
it('prefers curated notes over raw conversations and index files', () => {
|
||||
const trace = buildSecondBrainTrace(
|
||||
'dependency complexity schema drift documentation gap 문제 대응 가이드',
|
||||
brainRoot
|
||||
);
|
||||
|
||||
expect(trace.retrievedDocuments[0].path).toContain('ADR-0002-low-dependency-design.md');
|
||||
expect(trace.retrievedDocuments.find((doc) => doc.path.includes('00_Raw'))).toBeUndefined();
|
||||
expect(trace.retrievedDocuments[0].path).not.toContain('Index_692.md');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user