1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! Context store for AI coding agents.
//!
//! Provides a namespaced key-value store with git-aware invalidation
//! for caching file summaries, symbol indexes, project metadata, and session context.
//!
//! # Namespaces
//!
//! Keys are organized into namespaces for different types of context:
//!
//! - `file:` - File-level context (summaries, AST info, symbols)
//! - `symbol:` - Symbol definitions (functions, classes, types)
//! - `project:` - Project-level context (architecture, patterns, tech stack)
//! - `session:` - Session context (recent decisions, working files)
//! - `agent:` - Agent-specific context (preferences, learned patterns)
//!
//! # Git-Aware Invalidation
//!
//! File-level context is automatically invalidated when:
//! - The file's mtime changes
//! - The file is modified in git (uncommitted changes)
//! - The git commit hash changes (new commits)
//!
//! # Example
//!
//! ```ignore
//! let store = ContextStore::open(".beads/context.db")?;
//!
//! // Store file summary
//! store.set_file_context("src/main.rs", "summary", json!({
//! "purpose": "Application entry point",
//! "functions": ["main"],
//! "imports": ["std::io", "clap"]
//! }))?;
//!
//! // Get with automatic invalidation check
//! if let Some(summary) = store.get_file_context("src/main.rs", "summary")? {
//! // Use cached summary
//! }
//!
//! // Store project context
//! store.set_project_context("architecture", json!({
//! "pattern": "hexagonal",
//! "layers": ["domain", "application", "infrastructure"]
//! }))?;
//! ```
pub use ContextStore;
pub use *;
pub use InvalidationChecker;