All 8 test categories from the task plan, plus a JobRepo subset:
migration — tests/migration.rs: fresh DB after run_migrations
exposes every required §5 table + index.
unit (copy) — tests/asset_writer.rs: copy mode writes file with
mode 0o644 + correct bytes.
unit (ref) — tests/asset_writer.rs: reference mode does not write
file; row records source path.
unit (cs) — tests/asset_writer.rs: tampered checksum returns a
Conflict-flavoured anyhow error.
unit (idem) — tests/idempotency.rs: same put_document twice → 1 row,
doc_version 1→2; tags re-derived.
unit (rb) — tests/idempotency.rs: put_blocks with FK violation
rolls back; pre-existing rows unchanged.
contract — tests/contract_roundtrip.rs: drives kb-parse-md +
kb-normalize + kb-chunk on
fixtures/markdown/code-and-table.md, persists, then
reloads via DocumentStore::get_document /
get_chunk and asserts byte-equal round-trip.
snapshot — tests/ingest_report_snapshot.rs +
snapshots/ingest_report.snapshot.json: pin the wire
JSON form of kb_core::IngestReport for an inline
fixture run.
jobs — tests/jobs.rs: create → progress → finish flow;
error message round-trip; list filters on status/kind.
Drops the unused `serde` direct dep from Cargo.toml; serde_json brings
its own. Dev-deps confirmed via `cargo tree -p kb-store-sqlite --depth 1`
to live only in the dev tree.
35 lines
1.4 KiB
TOML
35 lines
1.4 KiB
TOML
[package]
|
|
name = "kb-store-sqlite"
|
|
version = { workspace = true }
|
|
edition = { workspace = true }
|
|
rust-version = { workspace = true }
|
|
license = { workspace = true }
|
|
repository = { workspace = true }
|
|
description = "SQLite-backed DocumentStore + JobRepo for kb (§5 DDL, §7.2 traits)"
|
|
|
|
[dependencies]
|
|
kb-core = { path = "../kb-core" }
|
|
kb-config = { path = "../kb-config" }
|
|
# `bundled` ships SQLite source + builds in-tree (no system libsqlite3).
|
|
# Explicitly NOT `bundled-sqlcipher` per task allowed-deps list.
|
|
rusqlite = { version = "0.32", features = ["bundled"] }
|
|
refinery = { version = "0.8", features = ["rusqlite"] }
|
|
serde_json = { workspace = true }
|
|
time = { workspace = true }
|
|
blake3 = { workspace = true }
|
|
tracing = { workspace = true }
|
|
anyhow = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
tempfile = "3"
|
|
serde_json = { workspace = true }
|
|
# kb-parse-md / kb-normalize / kb-chunk are dev-only — used to build a
|
|
# CanonicalDocument + Vec<Chunk> from a fixture in the contract round-trip
|
|
# test. Forbidden as regular deps per design §8 (store consumes domain
|
|
# types from kb-core only); `cargo tree -p kb-store-sqlite --depth 1`
|
|
# (default scope, excludes dev-deps) confirms this.
|
|
kb-parse-md = { path = "../kb-parse-md" }
|
|
kb-normalize = { path = "../kb-normalize" }
|
|
kb-chunk = { path = "../kb-chunk" }
|