Expand description
Multi-context workspaces for loading and querying multiple codebases.
Enables migration workflows (e.g., C++ to Rust) by loading source and target codebases into a single workspace, then cross-querying and tracking progress.
§Architecture
A Workspace holds one or more CodebaseContext entries, each wrapping a
[CodeGraph] and annotated with a ContextRole (Source, Target, Reference,
or Comparison). The WorkspaceManager owns all workspaces, tracks the
currently active one, and provides cross-context query and comparison APIs.
The TranslationMap sits on top of a workspace and tracks the porting
status of individual symbols from a source context to a target context.
§Example
use agentic_codebase::workspace::{WorkspaceManager, ContextRole, TranslationMap, TranslationStatus};
use agentic_codebase::graph::CodeGraph;
let mut mgr = WorkspaceManager::new();
let ws_id = mgr.create("cpp-to-rust");
let cpp_graph = CodeGraph::with_default_dimension();
let rs_graph = CodeGraph::with_default_dimension();
let src = mgr.add_context(&ws_id, "/src/cpp", ContextRole::Source, Some("C++".into()), cpp_graph).unwrap();
let tgt = mgr.add_context(&ws_id, "/src/rust", ContextRole::Target, Some("Rust".into()), rs_graph).unwrap();
let mut tmap = TranslationMap::new(src, tgt);
tmap.record("process_payment", Some("process_payment"), TranslationStatus::Ported, None);
let progress = tmap.progress();Structs§
- Codebase
Context - A single codebase loaded into a workspace.
- Comparison
- Side-by-side comparison of a symbol across all contexts.
- Context
Comparison - Comparison data for one context within a
Comparison. - Cross
Context Result - The result of a cross-context symbol query for a single context.
- Cross
Reference - Cross-reference report showing where a symbol exists and where it is missing.
- Symbol
Match - A single symbol that matched a query.
- Translation
Map - Tracks the porting status of symbols from one context to another.
- Translation
Mapping - A mapping from a single source symbol to its target counterpart.
- Translation
Progress - Summary statistics for a
TranslationMap. - Workspace
- A named collection of codebase contexts that can be queried together.
- Workspace
Manager - Owns all workspaces and provides the public API for multi-context operations.
Enums§
- Context
Role - The role a codebase plays within a workspace.
- Translation
Status - The porting status of a single source symbol.