chore: version up to 2.80.35 and package with experience memory

This commit is contained in:
g1nation
2026-05-12 23:23:23 +09:00
parent 065e598cca
commit f6b27a125b
25 changed files with 1088 additions and 103 deletions
+6 -3
View File
@@ -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', () => {