Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
sleep 30
publish llmem-index
sleep 30
publish llmem-cli
publish llmem
sleep 30
publish llmem-server

Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
if [ "${{ matrix.cross }}" = "true" ]; then
BUILD_CMD="cross"
fi
$BUILD_CMD build --release --target ${{ matrix.target }} -p llmem-cli
$BUILD_CMD build --release --target ${{ matrix.target }} -p llmem
$BUILD_CMD build --release --target ${{ matrix.target }} -p llmem-server
shell: bash

Expand Down
33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,39 @@ Conventional commits via `sr commit`:

Scope by crate: `feat(core):`, `feat(cli):`, `feat(server):`, `docs(spec):`.

## Testing

### Unit and integration tests

Run the full test suite with:

```bash
cargo test --workspace
# or
just test
```

Tests are colocated with their source in `#[cfg(test)]` modules, except for the CLI which uses a dedicated file at `crates/llmem-cli/tests/integration.rs`.

| Crate | Tests | What is covered |
|-------|-------|-----------------|
| `llmem-core` | 21 | Config TOML roundtrip and dot-notation get/set; embedding store binary format and hash-based change detection; inbox capacity eviction and JSON persistence; MEMORY.md index parsing, search, and save; memory file frontmatter parsing and markdown roundtrip; `FileBackend` store/get/remove/list |
| `llmem-index` | 16 | HNSW insert, remove, save/load, and recall ≥ 90% on 200 vectors; IVF-Flat insert, remove, save/load, and recall ≥ 85% on 200 vectors; cosine similarity, dot product, L2 distance, and normalization; tree-sitter Rust chunking and language-extension mapping |
| `llmem-quant` | 39 | Lloyd-Max codebook structure and scalar quantize/dequantize at 1–4 bits; bit-packing roundtrip for 1–4 bits including non-byte-aligned counts; `TurboQuantMse` roundtrip MSE, norm preservation, zero vector, and empirical MSE against theoretical bound; `TurboQuantProd` unbiased inner-product property and fast estimate; QJL determinism and unbiased inner-product property; rotation orthogonality, forward/inverse roundtrip, and norm preservation; compressed embedding store save/load for MSE and Prod variants |
| `llmem-server` | 6 | HTTP handler tests using `tower::ServiceExt::oneshot` (no network): `/health` status and version fields; `/search` empty state, text matching, `top_k` truncation, and level filtering; `/reload` response |
| `llmem-cli` | 15 | End-to-end CLI tests that spawn the binary as a subprocess: `init`, `memorize` (with type, name, and stdin JSON), `note` (inbox capacity enforcement), `remember` (match and no-match), `reflect`, `consolidate` (dry-run and real), `forget` (success and nonexistent), `ctx switch`/`show`, `config init`/`get`/`set` |

### End-to-end validation

`scripts/validate.sh` runs every CLI command and the RAG server against a clean, isolated `$HOME` directory and reports pass/fail with timing for each operation. It requires release binaries built beforehand:

```bash
cargo build --release
bash scripts/validate.sh
```

The script covers all command groups in order — `init`, `config`, `memorize`, `note`, `remember`, `reflect`, `learn`, `consolidate`, `forget`, `ctx`, and the server endpoints (`/health`, `/search`, `/reload`) — and exits with the number of failures as its exit code.

## Pull Requests

1. Fork the repository
Expand Down
Loading
Loading