# iqdb-cache v0.6.0 — Consumer Integration (Alpha)
**Proven against a real workload.** With the feature set frozen at 0.4 and the API frozen at 0.5, v0.6.0 is about confidence: a consumer-simulation suite drives the cache the way the real index crates will, and three runnable examples show the full surface in motion. No API change — this release adds tests, examples, and assurance.
## What is iqdb-cache?
An in-process caching layer between the database and an index. It wraps any `iqdb_index::IndexCore` as a `CachedIndex` — itself an `IndexCore` — and memoizes search results, turning a repeated query into a memory read. It is opt-in and transparent: a database is correct with no cache, and wrapping one never changes what a search returns.
## What's new in 0.6.0
### Consumer-simulation suite
`tests/consumer_simulation.rs` exercises the cache the way `iqdb-flat` / `iqdb-hnsw` / `iqdb-ivf` will — through the public surface only, with a realistic shape:
- a 200-vector, 8-dimensional index;
- a 500-query stream skewed to a small hot-set (4 in 5 queries repeat; 1 in 5 is cold), so the cache has something real to exploit;
- a mid-run write mix — an insert at one-third, a delete at two-thirds — mirrored on a bare reference index.
It then asserts the two guarantees that actually matter end to end, **for every eviction policy**:
1. **Transparency.** Every cached result equals the reference index's, through the inserts and deletes — the cache is never observed to be stale.
2. **It earns its keep.** The hit rate stays well above a useful floor, i.e. the cache genuinely turns repeated queries into memory reads rather than just adding bookkeeping.
A disabled-cache (`capacity = 0`) run confirms the same correctness with zero hits — the honest baseline.
### Runnable examples
Three documented examples in `examples/`, over a shared brute-force demo index that stands in for a real index crate:
```sh
cargo run --example quickstart # wrap an index; first search misses, the repeat hits
cargo run --example policies # the four eviction policies side by side
cargo run --example tuning # capacity + TTL + policy via CacheConfig, and invalidation on write
```
## Breaking changes
**None.** The public API is unchanged and remains frozen for the 1.x series. This release adds only tests and examples.
## Verification
The new suite and examples join the existing gates — unit tests, the transparency / per-policy property tests, the TTL and concurrency tests, the `loom` model checks, and the benchmarks — all run across the CI matrix (Linux, macOS, Windows) on stable and the 1.87 MSRV:
```bash
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-features
cargo build --examples
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features
```
MSRV: Rust 1.87.
## What's next
- **v1.0.0 — stable.** The Definition of Done is satisfied; 1.0 commits the public API under SemVer for the 1.x series. (The separate beta/rc cadence is folded into 1.0 — see `dev/ROADMAP.md` for the recorded rationale: feature- and API-frozen, fully verified, no outstanding work.)
## Installation
```toml
[dependencies]
iqdb-cache = "0.6"
```
## Documentation
- [README](https://github.com/jamesgober/iqdb-cache/blob/main/README.md)
- [API reference](https://github.com/jamesgober/iqdb-cache/blob/main/docs/API.md)
- [ROADMAP](https://github.com/jamesgober/iqdb-cache/blob/main/dev/ROADMAP.md)
- [Standards (REPS)](https://github.com/jamesgober/iqdb-cache/blob/main/REPS.md)
- [CHANGELOG](https://github.com/jamesgober/iqdb-cache/blob/main/CHANGELOG.md)
---
**Full diff:** [`v0.5.0...v0.6.0`](https://github.com/jamesgober/iqdb-cache/compare/v0.5.0...v0.6.0).
**Changelog:** [`CHANGELOG.md`](https://github.com/jamesgober/iqdb-cache/blob/main/CHANGELOG.md).