headroom/tests/test_memory
chopratejas 34c5cd9da6 Add DiffCompressor and fix hnswlib SIGILL crash on CI
DiffCompressor:
- Parse unified diff format and compress by reducing context lines
- Preserve file headers and all +/- change lines
- Score hunks by relevance (error keywords, query matches)
- Add summary line: [N files, +X -Y lines]
- Expected 30-50% savings on typical git diffs
- Wire into content router for CompressionStrategy.DIFF
- 30 tests covering parsing, compression, edge cases

hnswlib SIGILL fix:
- Move hnswlib import from module level to lazy loading
- hnswlib crashes with SIGILL (Illegal Instruction) on CPUs
  without AVX support, before Python can catch the error
- Now imports only when HNSWVectorIndex is actually used
- HNSW_AVAILABLE is checked lazily via __getattr__

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 01:03:48 -08:00
..
__init__.py Add persistent memory system with zero-latency inline extraction 2026-01-14 21:32:09 -08:00
conftest.py Add global httpx.ReadTimeout handler for memory tests 2026-01-28 09:43:44 -08:00
test_core_operations.py Fix mypy errors and add network timeout handler for flaky CI tests 2026-01-27 19:39:33 -08:00
test_easy.py Fix asyncio event loop error in Python 3.10+ tests 2026-01-30 16:27:26 -08:00
test_extraction.py Add hierarchical memory system with graph + vector storage 2026-01-26 21:58:47 -08:00
test_factory.py Add hierarchical memory system with graph + vector storage 2026-01-26 21:58:47 -08:00
test_hierarchical.py Add DiffCompressor and fix hnswlib SIGILL crash on CI 2026-01-31 01:03:48 -08:00