Skip to main content

cortexa_gcc/
lib.rs

1//! # cortexa-gcc
2//!
3//! Git-inspired context management for LLM agents. COMMIT, BRANCH, MERGE, and
4//! CONTEXT operations over a persistent versioned memory workspace.
5//!
6//! Paper: *"Git Context Controller: Manage the Context of LLM-based Agents like Git"*
7//! arXiv:2508.00031 — Junde Wu et al., 2025
8//!
9//! ## File System Layout
10//! ```text
11//! .GCC/
12//! ├── main.md                 # Global roadmap / planning artifact
13//! └── branches/
14//!     ├── main/
15//!     │   ├── log.md          # Continuous OTA trace (Observation-Thought-Action)
16//!     │   ├── commit.md       # Milestone-level commit summaries
17//!     │   └── metadata.yaml   # Branch intent, status, creation info
18//!     └── <branch>/
19//!         └── ...
20//! ```
21//!
22//! ## Example
23//! ```rust,no_run
24//! use cortexa_gcc::GCCWorkspace;
25//!
26//! let mut ws = GCCWorkspace::new("/path/to/project");
27//! ws.init("Build a production REST API").unwrap();
28//!
29//! ws.log_ota("dir is empty", "scaffold first", "create_file(main.rs)").unwrap();
30//! ws.commit("Scaffolded project", None, None).unwrap();
31//!
32//! ws.branch("jwt-auth", "Explore JWT vs session auth").unwrap();
33//! ws.commit("JWT middleware implemented", None, None).unwrap();
34//! ws.merge("jwt-auth", None, "main").unwrap();
35//!
36//! let ctx = ws.context(None, 1).unwrap();
37//! println!("{}", ctx.summary());
38//! ```
39
40pub mod error;
41pub mod models;
42pub mod workspace;
43
44pub use models::{BranchMetadata, CommitRecord, ContextResult, OTARecord};
45pub use workspace::GCCWorkspace;