Skip to main content

Module workspace

Module workspace 

Source
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§

CodebaseContext
A single codebase loaded into a workspace.
Comparison
Side-by-side comparison of a symbol across all contexts.
ContextComparison
Comparison data for one context within a Comparison.
CrossContextResult
The result of a cross-context symbol query for a single context.
CrossReference
Cross-reference report showing where a symbol exists and where it is missing.
SymbolMatch
A single symbol that matched a query.
TranslationMap
Tracks the porting status of symbols from one context to another.
TranslationMapping
A mapping from a single source symbol to its target counterpart.
TranslationProgress
Summary statistics for a TranslationMap.
Workspace
A named collection of codebase contexts that can be queried together.
WorkspaceManager
Owns all workspaces and provides the public API for multi-context operations.

Enums§

ContextRole
The role a codebase plays within a workspace.
TranslationStatus
The porting status of a single source symbol.