mirror of
https://github.com/ruvnet/RuView
synced 2026-08-09 20:21:43 +00:00
761b2248cb
- ruvector-core = "2.2.0" + sha2 = "0.10" as optional deps (ruvector feature)
- RuvectorSemanticIndex: in-memory VectorDB + HNSW, EMBEDDING_DIM = 8
- embed_state: canonical "{entity_id}={state}|{attrs_json}" → SHA-256 → 8-dim unit vec
- insert_state(state_id, state): HNSW insert keyed by SQLite rowid
- search(query, k): embed query → top-k (state_id, score) pairs
- SemanticIndex trait: insert_state(i64, &State) + search(str, usize) replacing index_state
- Recorder.semantic: Arc<RwLock<dyn SemanticIndex>> for interior mutability
- Recorder::search_semantic(query, k): HNSW → SQLite JOIN → Vec<StateRow>
- Tests: 20 passed (was 14 at P1): determinism, unit-norm, dim, insert+search, ranking, e2e
- P3 note: swap embed_bytes for ruvector-attention; raise dim to 384
Co-Authored-By: claude-flow <ruv@ruv.net>
64 lines
1.9 KiB
TOML
64 lines
1.9 KiB
TOML
# homecore-recorder — SQLite state history + semantic search (ADR-132)
|
|
#
|
|
# P1 ships: SQLite structural persistence with HA-compat schema.
|
|
# P2 ships: ruvector-backed SemanticIndex — hash embeddings, HNSW search (ADR-132 P2, Iter-6 track C).
|
|
# P3 plan: replace hash embeddings with ruvector-attention sentence embeddings (dim → 384).
|
|
#
|
|
# Build: cargo build -p homecore-recorder --features ruvector
|
|
# Test (P2): cargo test -p homecore-recorder --features ruvector (20 tests)
|
|
# Test (P1): cargo test -p homecore-recorder --no-default-features (14 tests)
|
|
|
|
[package]
|
|
name = "homecore-recorder"
|
|
version = "0.1.0-alpha.0"
|
|
edition = "2021"
|
|
license = "MIT"
|
|
authors = ["rUv <ruv@ruv.net>", "HOMECORE Contributors"]
|
|
description = "SQLite state-history recorder for HOMECORE — HA-compat schema + ruvector semantic search (ADR-132)"
|
|
repository = "https://github.com/ruvnet/RuView"
|
|
|
|
[lib]
|
|
name = "homecore_recorder"
|
|
path = "src/lib.rs"
|
|
|
|
[features]
|
|
default = []
|
|
ruvector = ["dep:ruvector-core", "dep:sha2"]
|
|
|
|
[dependencies]
|
|
homecore = { path = "../homecore", version = "0.1.0-alpha.0" }
|
|
|
|
# Async runtime
|
|
tokio = { version = "1", features = ["sync", "rt", "rt-multi-thread", "time", "macros"] }
|
|
|
|
# SQLite via sqlx — only the lite feature set; no postgres, no tls
|
|
sqlx = { version = "0.7", default-features = false, features = [
|
|
"runtime-tokio-native-tls",
|
|
"sqlite",
|
|
"chrono",
|
|
"uuid",
|
|
] }
|
|
|
|
# Serialisation
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
|
|
# Time
|
|
chrono = { version = "0.4", features = ["serde"] }
|
|
|
|
# Error handling
|
|
thiserror = "1"
|
|
|
|
# Structured logging
|
|
tracing = "0.1"
|
|
|
|
# Trait objects for SemanticIndex
|
|
async-trait = "0.1"
|
|
|
|
# P2: ruvector-core HNSW index + sha2 for hash-based embeddings (ruvector feature)
|
|
ruvector-core = { version = "2.2.0", optional = true, default-features = false }
|
|
sha2 = { version = "0.10", optional = true }
|
|
|
|
[dev-dependencies]
|
|
tokio = { version = "1", features = ["full", "test-util"] }
|