Skip to content

Add comprehensive tests, benchmarks, and bug fixes#2

Merged
urmzd merged 11 commits intomainfrom
feat/testing-and-fixes
Mar 29, 2026
Merged

Add comprehensive tests, benchmarks, and bug fixes#2
urmzd merged 11 commits intomainfrom
feat/testing-and-fixes

Conversation

@urmzd
Copy link
Copy Markdown
Owner

@urmzd urmzd commented Mar 29, 2026

Summary

  • Add testing dependencies for server and CLI crates
  • Add comprehensive E2E validation script
  • Add testing guide to README and CONTRIBUTING docs
  • Fix CLI fallback to created_at when last_accessed is not set
  • Extract router builder and add comprehensive server tests
  • Add comprehensive CLI integration tests
  • Cache resolved project memory directory in app state for performance
  • Add criterion benchmarks for llmem-index (HNSW, IVF, distance) and llmem-quant (TurboQuant MSE/Prod, pack/unpack)
  • Add 19 insta snapshot tests across core types, server routes, and CLI outputs
  • Add benchmark results to README via embed-src

Test plan

  • Run cargo test to verify all tests pass (117 total)
  • Run cargo bench to verify benchmarks execute
  • Run the E2E validation script to confirm end-to-end flow
  • Verify CLI handles missing last_accessed gracefully

urmzd added 9 commits March 28, 2026 22:52
Add dev dependencies required for comprehensive test coverage:
- server: tower, tempfile, http-body-util, http for
  testing HTTP endpoints without network access
- cli: tempfile, serde_json for testing CLI commands
  in isolated environments
Add bash script that runs all llmem CLI commands and server
endpoints against a clean, isolated HOME directory. Reports
pass/fail with timing for each operation. Requires release
binaries to be built beforehand.
Covers all command groups: init, config, memorize, note,
remember, reflect, learn, consolidate, forget, ctx, and server
endpoints (/health, /search, /reload).
Exits with the count of failures for CI integration.
Add testing section to README with quick reference for running
tests and E2E validation. Add comprehensive testing documentation
to CONTRIBUTING.md including:
- Instructions for running unit and integration tests
- Per-crate test counts and coverage summary
- Details on end-to-end validation script
Documentation clarifies that tests are colocated with source
except for CLI which uses dedicated integration.rs file.
When calculating days since access for memory consolidation, use the
created_at timestamp if last_accessed is None. This ensures memories
without explicit access times can still be consolidated correctly.
Extract router construction into build_router() function to enable
testing the Axum application without a running server. Add comprehensive
tests for /health, /search, and /reload endpoints including edge cases
like empty results, matching memories, and parameter validation.
Add integration test suite covering all CLI commands: init, memorize,
note, remember, reflect, consolidate, forget, ctx, and config. Tests
verify JSON output, exit codes, file creation, and capacity limits
using isolated temporary directories.
Add a new project_mem_dir field to AppState to cache the resolved project
memory directory path instead of recomputing it on each request.

This improves performance by:
- Deriving the directory once during initialization and reload
- Eliminating repeated path computations in search requests
- Simplifying the search handler logic

Update all AppState construction sites (main initialization, reload handler,
and test helpers) to populate the new field. Update tests to use the new
test_state_with_mem_dir() helper for cases that need to specify both root
and memory directory independently.
Add benchmark suites for llmem-index (HNSW, IVF, distance functions)
and llmem-quant (TurboQuant MSE/Prod, pack/unpack) using criterion.

Add insta snapshot tests across core types (memory, index, inbox,
config), server routes (health, search, reload), and CLI outputs
(init, memorize, note, reflect, consolidate, config, forget).
Add docs/benchmarks.md with performance numbers for distance functions,
HNSW, IVF-Flat, TurboQuant MSE/Prod, and bit packing. Embedded into
README using embed-src markers for single-source-of-truth updates.
@urmzd urmzd changed the title Add comprehensive tests, validation, and bug fixes Add comprehensive tests, benchmarks, and bug fixes Mar 29, 2026
urmzd added 2 commits March 29, 2026 01:38
The embedded field depends on Ollama availability, which differs
between local dev (true) and CI (false). Redact it for determinism.
@urmzd urmzd merged commit db3e829 into main Mar 29, 2026
4 checks passed
@urmzd urmzd deleted the feat/testing-and-fixes branch March 29, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant