- Build:
cargo build --workspace - Check:
cargo clippy --workspace --all-targets -- -D warnings - Format:
cargo fmt --all(check:cargo fmt --all --check) - Test all:
cargo test --workspace - Test single:
cargo test -p <crate> <test_name>(e.g.cargo test -p store-sqlite schema_and_integrity) - Docs regression smoke:
cargo test -p cli docs_index_search_allowlist_and_regressions -- --exact
Rust workspace (edition 2024) with a CLI binary (crates/cli) backed by library crates:
- core-model – canonical data types (
Session,Message,Event,Artifact,Provenance,Checkpoint,ArchiveRun), theAgentAdaptertrait, anddeterministic_id(blake3). - store-sqlite – SQLite persistence via
rusqlite(FTS5 for lexical/docs search,SqliteStoreAPI). DB at~/.local/share/remi/remi.db. - ingest –
sync_adapter()orchestrates discover → scan → normalize → save → checkpoint withSyncPhaseprogress reporting. - search – session
search()uses FTS5 BM25 + recency via Reciprocal Rank Fusion (RRF), with substring fallback and FTS query sanitization; docs search is separate and returns path/snippet hits. - archive – plan/execute/restore session archival with dry-run default.
- docs indexing – CLI-owned filesystem scan for one local root at a time; allows
.md,.markdown,.txt,.rst; skips hidden files, symlinks, unreadable files, and non-UTF-8 content. - adapter-common – shared utilities for adapters (file discovery, JSONL parsing, composite cursor, content extraction).
- adapters/{pi,droid,opencode,claude,amp,codex} – per-agent implementations of
AgentAdapter.
- Parallel file I/O via
rayonin adapter scan phases. - SQLite WAL mode + prepared statement caching.
- Composite cursor (
{ts}\x1f{source_id}) for correct incremental sync without data loss.
- Search renders a session list first, then exports the chosen session to HTML/Markdown.
- Docs search is separate:
remi docs index --root <PATH>populates docs tables, andremi docs search <QUERY>prints title/path/snippet hits without entering the session-search flow. - Semantic builds accept
--semantic <auto|on|off>,--ort-dylib-path, and--auto-ort.
- Errors:
anyhow::Resultfor app-level,thiserrorfor library error enums. - Serde derives on all model types. IDs are deterministic blake3 hashes (
deterministic_id). - No comments unless complex logic requires context. Use
let-elseandif let-chains (edition 2024). - Imports:
usegrouped as std → external crates → workspace crates; multi-imports with{}.