headroom/tests
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
..
cli Add Click-based CLI with memory management commands 2026-01-29 21:30:21 -08:00
integrations/test_strands feat: Add AWS Strands Agents SDK integration 2026-01-31 00:31:37 -08:00
test_cache Add pluggable storage backend abstraction for CompressionStore 2026-01-20 23:25:28 -08:00
test_compression Fix flaky JavaScript signature preservation test threshold 2026-01-15 15:38:25 -08:00
test_integrations fix: improve error handling and add comprehensive test coverage 2026-01-27 16:08:36 -08:00
test_memory Add DiffCompressor and fix hnswlib SIGILL crash on CI 2026-01-31 01:03:48 -08:00
test_providers Fix mypy type errors in LiteLLM and OpenAI providers 2026-01-16 16:42:11 -08:00
test_storage Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_transforms Add DiffCompressor and fix hnswlib SIGILL crash on CI 2026-01-31 01:03:48 -08:00
__init__.py Initial commit: Headroom SDK - LLM context optimization toolkit 2026-01-06 23:16:58 -08:00
conftest.py Add global httpx.ReadTimeout handler for all tests 2026-01-30 16:37:34 -08:00
test_acceptance.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_ccr.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_ccr_batch_processor.py fix: improve error handling and add comprehensive test coverage 2026-01-27 16:08:36 -08:00
test_ccr_context_tracker.py v0.2.2: Add CCR Response Handler, Context Tracker, and restructure docs 2026-01-14 13:03:41 -08:00
test_ccr_feedback.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_ccr_response_handler.py v0.2.2: Add CCR Response Handler, Context Tracker, and restructure docs 2026-01-14 13:03:41 -08:00
test_ccr_tool_injection.py Add multi-provider batch API support with CCR post-processing 2026-01-24 11:41:18 -08:00
test_compression_store.py fix: improve error handling and add comprehensive test coverage 2026-01-27 16:08:36 -08:00
test_config.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_critical_fixes.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_critical_gaps.py Update test for lowered TOIN confidence threshold default 2026-01-21 21:40:11 -08:00
test_crushability.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_google_multimodal.py Fix Google Gemini conversion to preserve non-text content (Gap #4) 2026-01-24 12:20:13 -08:00
test_google_multimodal_e2e.py Add E2E tests for Google multimodal content preservation 2026-01-24 21:01:25 -08:00
test_hnsw_only.py Add DiffCompressor and fix hnswlib SIGILL crash on CI 2026-01-31 01:03:48 -08:00
test_image_compressor.py Add hierarchical memory system with graph + vector storage 2026-01-26 21:58:47 -08:00
test_log_compressor.py fix: improve error handling and add comprehensive test coverage 2026-01-27 16:08:36 -08:00
test_memory_eval.py Add hierarchical memory system with graph + vector storage 2026-01-26 21:58:47 -08:00
test_memory_integration.py Add hierarchical memory system with graph + vector storage 2026-01-26 21:58:47 -08:00
test_memory_system.py Add hierarchical memory system with graph + vector storage 2026-01-26 21:58:47 -08:00
test_models.py Use LiteLLM for model pricing instead of hardcoded values 2026-01-16 00:35:04 -08:00
test_parser.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_provider_model_fallback.py Add AST-based code compression and custom model configuration 2026-01-14 13:46:55 -08:00
test_proxy_batch_integration.py Add multi-provider batch API support with CCR post-processing 2026-01-24 11:41:18 -08:00
test_proxy_ccr.py Fix ruff formatting 2026-01-17 17:14:12 -08:00
test_proxy_compression_headers.py Remove unused ProxyConfig import from compression tests 2026-01-14 20:27:08 -06:00
test_proxy_count_tokens_integration.py Add multi-provider batch API support with CCR post-processing 2026-01-24 11:41:18 -08:00
test_proxy_gemini_integration.py Add multi-provider batch API support with CCR post-processing 2026-01-24 11:41:18 -08:00
test_proxy_gemini_native_integration.py Add multi-provider batch API support with CCR post-processing 2026-01-24 11:41:18 -08:00
test_proxy_intelligent_context.py feat(toin): add TOIN + CCR integration to IntelligentContextManager 2026-01-27 16:08:36 -08:00
test_proxy_llmlingua.py Fix mypy type errors in LiteLLM and OpenAI providers 2026-01-16 16:42:11 -08:00
test_proxy_memory_integration.py fix: correct cost calculation for cache tokens and simplify memory DevEx 2026-01-26 22:49:31 -08:00
test_proxy_openai_responses_integration.py Add multi-provider batch API support with CCR post-processing 2026-01-24 11:41:18 -08:00
test_proxy_passthrough_integration.py Add multi-provider batch API support with CCR post-processing 2026-01-24 11:41:18 -08:00
test_proxy_scalability.py fix: resolve CI failures 2026-01-27 16:17:24 -08:00
test_quality_retention.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_relevance.py Fix all mypy type errors and flaky embedding test 2026-01-10 18:27:33 -08:00
test_search_compressor.py fix: improve error handling and add comprehensive test coverage 2026-01-27 16:08:36 -08:00
test_telemetry.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_text_compressors.py Fix lint errors in text compression utilities 2026-01-12 17:32:51 -08:00
test_toin.py Add comprehensive evaluation framework for compression accuracy 2026-01-22 09:31:54 -08:00
test_toin_field_learning.py Fix ruff formatting 2026-01-17 17:14:12 -08:00
test_toin_fixes.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_toin_full_integration.py Update test for lowered TOIN confidence threshold default 2026-01-21 21:40:11 -08:00
test_toin_integration.py Add pluggable storage backend abstraction for CompressionStore 2026-01-20 23:25:28 -08:00
test_tokenizers.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00