cadi_core/
lib.rs

1//! CADI Core - Core types and utilities for Content-Addressed Development Interface
2//!
3//! This crate provides the fundamental types and utilities used across the CADI ecosystem.
4//!
5//! ## Modules
6//!
7//! - `chunk` - Basic chunk types
8//! - `manifest` - CADI manifest parsing
9//! - `hash` - Content hashing utilities
10//! - `atomic` - Atomic chunk system with aliases
11//! - `smart_chunker` - Intelligent code analysis
12//! - `graph` - Merkle DAG graph store for dependencies
13//! - `atomizer` - Language-aware AST parsing (Phase 1)
14//! - `rehydration` - Virtual view assembly (Phase 2)
15//!
16//! ## The Graph Store
17//!
18//! The `graph` module provides the core infrastructure for O(1) dependency queries:
19//!
20//! ```rust,ignore
21//! use cadi_core::graph::{GraphStore, GraphNode, EdgeType};
22//!
23//! let store = GraphStore::open(".cadi/graph")?;
24//! store.insert_node(&node)?;
25//! let deps = store.get_dependencies("chunk:sha256:abc...")?;
26//! ```
27//!
28//! ## The Atomizer
29//!
30//! The `atomizer` module provides language-aware code parsing:
31//!
32//! ```rust,ignore
33//! use cadi_core::atomizer::{AtomExtractor, AtomizerConfig};
34//!
35//! let extractor = AtomExtractor::new("rust", AtomizerConfig::default());
36//! let atoms = extractor.extract(source)?;
37//! ```
38//!
39//! ## Virtual Views (Rehydration)
40//!
41//! The `rehydration` module assembles atoms into coherent contexts:
42//!
43//! ```rust,ignore
44//! use cadi_core::rehydration::{RehydrationEngine, ViewConfig};
45//!
46//! let engine = RehydrationEngine::new(graph);
47//! let view = engine.create_view(atom_ids, ViewConfig::default()).await?;
48//! ```
49
50pub mod chunk;
51pub mod manifest;
52pub mod hash;
53pub mod error;
54
55pub use chunk::*;
56pub use manifest::*;
57pub use hash::*;
58pub use error::*;
59
60pub mod ast;
61pub mod parser;
62pub mod validator;
63
64// New atomic chunk and smart chunking system
65pub mod atomic;
66pub mod smart_chunker;
67pub mod project_analyzer;
68
69pub use atomic::*;
70pub use smart_chunker::*;
71pub use project_analyzer::*;
72
73// Phase 0: Graph Store for O(1) dependency queries
74pub mod graph;
75
76// Phase 1: Language-aware AST parsing
77pub mod atomizer;
78
79// Phase 2: Virtual view assembly (rehydration)
80pub mod rehydration;
81
82