Development
This page covers how to build, test, lint, and benchmark the project.
Build
bash
cargo build --releaseThe release profile enables LTO and a single codegen unit for smaller, faster binaries.
Run the test suite
bash
cargo testThis runs unit tests, contract tests, integration tests, and observability tests. Some tests may download a small model from Hugging Face on first run.
Check formatting
bash
cargo fmt -- --checkTo apply formatting:
bash
cargo fmtRun clippy
The CI treats warnings as errors:
bash
cargo clippy --all-targets --all-features -- -D warningsRun benchmarks
bash
cargo benchBenchmarks are located in benches/embeddings.rs and use Criterion with async Tokio support.
Validate Helm
bash
bash tests/helm/lint_test.sh
bash tests/helm/template_test.shValidate the docs site
bash
cd docs
npm install
npm run docs:build
npm run docs:previewBefore committing
Run the full quality check locally:
bash
cargo fmt -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test
bash tests/helm/lint_test.sh
bash tests/helm/template_test.shCode style reminders
- Do not introduce
unsafeblocks (unsafe_code = "forbid"). - Avoid
unwrapin production code (unwrap_used = "deny"). - Add doc comments for new public items (
missing_docs = "warn"). - Keep handlers thin and move validation into small, testable functions.
