diff --git a/Cargo.lock b/Cargo.lock index f3cec9f..4e91de7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1847,7 +1847,6 @@ dependencies = [ "log", "parking_lot", "rand 0.8.7", - "regex", "reqwest", "rusqlite", "serde", diff --git a/core/Cargo.toml b/core/Cargo.toml index c667795..4526c3d 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -42,7 +42,6 @@ async-trait = "0.1" # tinycortex's major — which `links = "git2"` turns into a hard cargo error # rather than a warning. # `store/factories.rs` exposes a tiny health router for the embedded provider. -axum = { version = "0.8", default-features = false, features = ["http1", "json", "tokio", "query", "ws", "macros"] } chrono = { version = "0.4", features = ["serde"] } # `tinycortex/persona.rs` resolves the user's home directory for the obsidian # vault default. @@ -55,7 +54,6 @@ parking_lot = "0.12" rand = "0.8" reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls", "stream"] } tracing = "0.1" -regex = "1.10" rusqlite = { version = "=0.40.0", features = ["bundled"] } serde = { version = "1", features = ["derive"] } serde_json = "1" @@ -74,6 +72,12 @@ tinymemory-api = { path = "../api", features = ["test-support"] } # hold this crate's own store to the same contract the adapters are held to. # No cycle — `tinymemory-conformance` depends on `tinymemory-api` alone. tinymemory-conformance = { path = "../conformance" } +# Test-only. `store::factories`' tests stand up a throwaway HTTP server to +# exercise the embedder's failure paths — the four `axum` references in this +# crate are all inside `mod tests`. It was declared as a normal dependency, +# which put a web framework in the normal graph of every build linking this +# crate (#18 §D2). +axum = { version = "0.8", default-features = false, features = ["http1", "json", "tokio", "query", "ws", "macros"] } tempfile = "3" tokio = { version = "1", features = ["test-util"] } diff --git a/core/src/engine/sync.rs b/core/src/engine/sync.rs index 54aa871..c72553c 100644 --- a/core/src/engine/sync.rs +++ b/core/src/engine/sync.rs @@ -14,7 +14,16 @@ use crate::sources::{MemorySourceEntry, SourceKind}; use crate::store::MemoryClientRef; use crate::Config; -pub const HOST_SYNC_STATE_NAMESPACE: &str = "composio-sync-state"; +/// The KV namespace Composio sync state is persisted under. +/// +/// Re-exported from the engine rather than re-declared. It was a second +/// `const` holding the same literal as +/// `tinycortex::memory::sync::state::STATE_NAMESPACE`, so the host and the +/// engine agreed only by coincidence of the string: change either and the two +/// would silently read and write *different* namespaces, stranding every +/// persisted sync cursor with no error anywhere. A duplicated literal is a +/// drift hazard precisely when the thing it names is durable (#18 §B2). +pub use tinycortex::memory::sync::state::STATE_NAMESPACE as HOST_SYNC_STATE_NAMESPACE; pub use tinycortex::memory::sync::{ RawCoverage, RawFileRef, RealCostAccumulator, RebuildOutcome, SyncAuditEntry, }; diff --git a/core/src/sync/composio/providers/sync_state.rs b/core/src/sync/composio/providers/sync_state.rs index 4e33f91..d931f25 100644 --- a/core/src/sync/composio/providers/sync_state.rs +++ b/core/src/sync/composio/providers/sync_state.rs @@ -17,3 +17,25 @@ pub fn extract_item_id(item: &serde_json::Value, paths: &[&str]) -> Option