chore: version up to 2.80.35 and package with experience memory
This commit is contained in:
@@ -26,18 +26,21 @@ describe('brainIndex.getBrainTokenIndex', () => {
|
||||
try { fs.rmSync(brain, { recursive: true, force: true }); } catch { /* ignore */ }
|
||||
});
|
||||
|
||||
it('tokenizes files and returns one entry per file', () => {
|
||||
it('tokenizes files, returns one entry per file, and tags lesson cards', () => {
|
||||
const a = writeMd(brain, 'architecture-overview.md', '# Architecture overview\nThis describes the system architecture and design.');
|
||||
const b = writeMd(brain, 'records/bug-report.md', '# Bug report\n이 설계는 기존 구조와 충돌 위험이 있습니다.');
|
||||
const out = getBrainTokenIndex(brain, [a, b]);
|
||||
expect(out).toHaveLength(2);
|
||||
const c = writeMd(brain, 'lessons/allowlist.md', '# Lesson\n## Prevention Checklist\n- check the allowlist');
|
||||
const out = getBrainTokenIndex(brain, [a, b, c]);
|
||||
expect(out).toHaveLength(3);
|
||||
const byPath = new Map(out.map(d => [d.filePath, d]));
|
||||
expect(byPath.get(a)!.tokens).toContain('architecture');
|
||||
expect(byPath.get(a)!.tokens).toContain('design');
|
||||
expect(byPath.get(a)!.titleTokens.length).toBeGreaterThan(0);
|
||||
expect(byPath.get(a)!.kind).toBe('');
|
||||
expect(byPath.get(b)!.relativePath).toBe(path.join('records', 'bug-report.md'));
|
||||
expect(byPath.get(b)!.conflictCount).toBeGreaterThan(0); // "충돌" is a conflict indicator
|
||||
expect(byPath.get(a)!.conflictCount).toBe(0);
|
||||
expect(byPath.get(c)!.kind).toBe('lesson'); // detected from the lessons/ path segment
|
||||
});
|
||||
|
||||
it('reuses cached tokens for unchanged files and re-indexes only changed ones', () => {
|
||||
|
||||
Reference in New Issue
Block a user