Skip to main content

Capability Registry & Providers

Architectural Layer: L2 Capabilities
Source Directory: src/capability
File Count: 38 source files

Typed capabilities, health monitoring, provider implementations (fs, git, lsp, terminal, web, etc.).

Module Files & Detailed Reference​

Source FileLinesKey TypesResponsibility
error.rs80CapabilityErrorCapability errors and failure classification (D-02, CTL-01).
family.rs135CapabilityFamilyCore capability families enum (CTL-01, D-01).
health.rs283CapabilityHealthTracker, HealthConfig, HealthTransitionRecordCapability health state machine and transition tracker (CTL-03, D-02).
instance.rs63CapabilityInstanceCapability instance metadata and descriptor (CTL-03).
mod.rs25Functions/TraitsCapabilities and tool execution runtime subsystem. Owns the 15 core c...
permissions.rs300CapabilityPermissions, CapabilityOperationStrongly typed capability permissions and resource scoping (CTL-03, D-...
cli_git.rs494CliGitProvider, DisabledGitProviderCLI-based Git capability provider running host git (CTL-02, D-01, D-03...
event_bus.rs70EventBusProviderTelemetry and events capability provider wrapping EventBus (CTL-02, D-...
fs_artifacts.rs130FsArtifactStoreProviderArtifact store capability provider wrapping FsArtifactStore (CTL-02, D...
local_fs.rs705LocalFileSystemProviderLocal filesystem capability provider with strict workspace path contai...
local_lsp.rs514LocalLspProcessClient, PersistentLspSession, LspOutgoingMessagelocal lsp persistent stdio process provider.
local_memory.rs83LocalMemoryProvider, MemoryEntryLocal in-memory contextual memory capability provider (CTL-02, D-01, D...
local_network.rs58LocalNetworkProviderNetwork capability provider for connectivity check and DNS lookup (CTL...
local_process.rs400LocalJobProvider, LocalProcessProviderLocal process, shell, and background job capability providers (CTL-01,...
local_sandbox.rs120LocalSandboxProviderSubsystem component
local_terminal.rs385LocalTerminalProvider, TerminalSessionHandleLocal terminal session capability provider (CTL-02, D-01, D-03).
local_verification.rs131LocalVerificationProviderLocal verification and QA capability provider (CTL-02, D-01, D-03). V...
local_web.rs325LocalWebProviderWeb capability provider backed by reqwest (CTL-02, D-01, D-03).
mod.rs31Functions/TraitsNative local capability providers (CTL-02, D-01, D-03).
model_caller.rs72ModelCallerProviderModel capability provider wrapping ModelCaller (CTL-02, D-01, D-03).
repo_graph.rs147RepositoryGraphProviderRepository graph capability provider wrapping BoundedQueryEngine (CTL-...
registry.rs608CapabilityRegistryCentral capability registry (CTL-01, CTL-02, CTL-03).
artifacts.rs24Functions/TraitsImmutable artifact storage service trait (CTL-01, CTL-02).
fs.rs64FileMetadataFile system capability service trait (CTL-01, CTL-02).
git.rs122GitBranchInfo, GitCommitInfo, GitStatusResultGit version control service trait (CTL-01, CTL-02).
jobs.rs54Functions/TraitsBackground jobs supervision service trait (CTL-01, CTL-02).
memory.rs19Functions/TraitsContextual memory service trait (CTL-01, CTL-02).
mod.rs35Functions/TraitsThe 15 core capability service traits (CTL-01, CTL-02).
model.rs32ModelInvocationRequest, ModelInvocationResponseModel inference service trait (CTL-01, CTL-02).
network.rs14Functions/TraitsNetwork connectivity and resolution service trait (CTL-01, CTL-02).
process.rs23Functions/TraitsSupervised process execution service trait (CTL-01, CTL-02).
repo.rs44CodeSearchResultRepository graph and code navigation service trait (CTL-01, CTL-02).
sandbox.rs55SandboxConfig, SandboxHandleSandbox boundary and environment service trait (CTL-01, CTL-02).
shell.rs26ShellOutputBounded shell execution service trait (CTL-01, CTL-02).
telemetry.rs24Functions/TraitsTelemetry and metrics recording service trait (CTL-01, CTL-02).
terminal.rs106TerminalSessionConfig, TerminalSessionStatusTerminal session service trait (CTL-01, CTL-02).
verification.rs43VerificationReport, VerificationTarget, VerificationKindVerification and QA service trait (CTL-01, CTL-02).
web.rs41WebFetchResult, WebSearchResultWeb access and external search service trait (CTL-01, CTL-02).

src/capability/error.rs​

Primary Responsibility​

Capability errors and failure classification (D-02, CTL-01).

Types & Trait Declarations​

  • Enums (1): CapabilityError

Key Functions & Signatures (3 shown)​

// pub
fn is_infrastructure(&self) -> bool;
// pub
fn is_semantic(&self) -> bool;
// private
fn from(err: std::io::Error) -> Self;

src/capability/family.rs​

Primary Responsibility​

Core capability families enum (CTL-01, D-01).

Types & Trait Declarations​

  • Enums (1): CapabilityFamily

Key Functions & Signatures (4 shown)​

// private
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result;
// private
fn from_str(s: &str) -> Result<Self, Self::Err>;
// private
fn test_all_15_families_present();
// private
fn test_family_round_trip();

Unit Verification (2 inline tests)​

Tests defined within module: test_all_15_families_present, test_family_round_trip


src/capability/health.rs​

Primary Responsibility​

Capability health state machine and transition tracker (CTL-03, D-02).

Types & Trait Declarations​

  • Structs (3): CapabilityHealthTracker, HealthConfig, HealthTransitionRecord
  • Enums (1): CapabilityHealthState

Key Functions & Signatures (13 shown)​

// pub
fn is_admissible(&self) -> bool;
// pub
fn is_healthy(&self) -> bool;
// private
fn default() -> Self;
// pub
fn new(config: HealthConfig) -> Self;
// pub
fn with_initial_state(config: HealthConfig, state: CapabilityHealthState) -> Self;
// pub
fn current_state(&mut self) -> CapabilityHealthState;
// pub
fn peek_state(&self) -> CapabilityHealthState;
// pub
fn record_success(&mut self);
// pub
fn record_failure(&mut self, is_infrastructure_fault: bool, reason: impl Into<String>);
// private
fn transition_to(&mut self, new_state: CapabilityHealthState, reason: String);
// pub
fn history(&self) -> &[HealthTransitionRecord];
// private
fn test_health_state_transitions();
// private
fn test_half_open_failure_returns_to_unavailable();

Unit Verification (2 inline tests)​

Tests defined within module: test_health_state_transitions, test_half_open_failure_returns_to_unavailable


src/capability/instance.rs​

Primary Responsibility​

Capability instance metadata and descriptor (CTL-03).

Types & Trait Declarations​

  • Structs (1): CapabilityInstance

Key Functions & Signatures (3 shown)​

// pub
fn new(id: impl Into<String>,
name: impl Into<String>,
version: impl Into<String>,
family: Capab;
// pub
fn with_metadata(mut self, key: impl Into<String>, value: impl Into<String>) -> Self;
// pub
fn with_health(mut self, health: CapabilityHealthState) -> Self;

src/capability/mod.rs​

Primary Responsibility​

Capabilities and tool execution runtime subsystem. Owns the 15 core capability family definitions, capability instance descriptors, operational health tracking, strongly typed permissions, and central registry (CTL-01, CTL-02, CTL-03). Core principle: The model proposes. The runtime decides.


src/capability/permissions.rs​

Primary Responsibility​

Strongly typed capability permissions and resource scoping (CTL-03, D-04).

Types & Trait Declarations​

  • Structs (1): CapabilityPermissions
  • Enums (1): CapabilityOperation

Key Functions & Signatures (15 shown)​

// private
fn default() -> Self;
// pub
fn new(operations: impl IntoIterator<Item = CapabilityOperation>) -> Self;
// pub
fn with_path_scope(mut self, path: impl Into<PathBuf>) -> Self;
// pub
fn with_domains(mut self, domains: Vec<String>) -> Self;
// pub
fn with_max_risk(mut self, risk: RiskClass) -> Self;
// pub
fn read_only() -> Self;
// pub
fn full_access() -> Self;
// pub
fn permits_operation(&self, op: CapabilityOperation) -> bool;
// pub
fn permits_path(&self, target_path: &Path) -> bool;
// pub
fn permits_domain(&self, domain: &str) -> bool;
// pub
fn permits_risk(&self, risk: RiskClass) -> bool;
// pub
fn validate(&self,
op: CapabilityOperation,
path: Option<&Path>,
domain: Option<&str>,
r;
// pub
fn intersect(&self, other: &CapabilityPermissions) -> CapabilityPermissions;
// private
fn test_permissions_operation_check();
// private
fn test_permissions_path_validation();

Unit Verification (3 inline tests)​

Tests defined within module: test_permissions_operation_check, test_permissions_path_validation, test_permissions_intersection


src/capability/providers/cli_git.rs​

Primary Responsibility​

CLI-based Git capability provider running host git (CTL-02, D-01, D-03).

Types & Trait Declarations​

  • Structs (2): CliGitProvider, DisabledGitProvider

Key Functions & Signatures (15 shown)​

// pub
fn new(workspace_root: impl Into<PathBuf>) -> Self;
// private
async fn run_git(&self, args: &[&str]) -> Result<String, CapabilityError>;
// private
async fn status(&self) -> Result<GitStatusResult, CapabilityError>;
// private
async fn diff(&self, staged: bool) -> Result<String, CapabilityError>;
// private
async fn log(&self, max_count: usize) -> Result<Vec<GitCommitInfo>, CapabilityError>;
// private
async fn show(&self, revision: &str) -> Result<String, CapabilityError>;
// private
async fn branch(&self) -> Result<GitBranchInfo, CapabilityError>;
// private
async fn checkout(&self,
branch_or_commit: &str,
gate: &GitGate,) -> Result<(), CapabilityError>;
// private
async fn add(&self, paths: &[PathBuf], gate: &GitGate) -> Result<(), CapabilityError>;
// private
async fn commit(&self, message: &str, gate: &GitGate) -> Result<String, CapabilityError>;
// private
async fn add_all(&self, gate: &GitGate) -> Result<(), CapabilityError>;
// private
async fn reset(&self, paths: &[&str], gate: &GitGate) -> Result<(), CapabilityError>;
// private
async fn commit_with_trailers(&self,
message: &str,
trailers: &crate::git::trailers::CommitTrailers,
;
// private
async fn merge(&self,
branch: &str,
no_edit: bool,
gate: &GitGate,) -> Result<String, Capability;
// private
async fn merge_abort(&self, gate: &GitGate) -> Result<(), CapabilityError>;

src/capability/providers/event_bus.rs​

Primary Responsibility​

Telemetry and events capability provider wrapping EventBus (CTL-02, D-01, D-03).

Types & Trait Declarations​

  • Structs (1): EventBusProvider

Key Functions & Signatures (6 shown)​

// private
fn default() -> Self;
// pub
fn new() -> Self;
// pub
fn with_bus(bus: Arc<dyn EventBus>) -> Self;
// pub
fn bus(&self) -> Option<&Arc<dyn EventBus>>;
// private
async fn record_event(&self,
event_name: &str,
attributes: HashMap<String, String>,) -> Result<(), Capab;
// private
async fn record_metric(&self,
metric_name: &str,
value: f64,
unit: &str,) -> Result<(), Capabili;

src/capability/providers/fs_artifacts.rs​

Primary Responsibility​

Artifact store capability provider wrapping FsArtifactStore (CTL-02, D-01, D-03).

Types & Trait Declarations​

  • Structs (1): FsArtifactStoreProvider

Key Functions & Signatures (7 shown)​

// pub
fn new(base_dir: impl AsRef<Path>) -> Self;
// pub
fn from_arc(store: Arc<dyn ArtifactStore>) -> Self;
// pub
fn from_service(service: Arc<ArtifactService>) -> Self;
// pub
fn with_service(mut self, service: Arc<ArtifactService>) -> Self;
// private
async fn store_artifact(&self,
artifact_id: &str,
data: &[u8],
extension: &str,) -> Result<PathB;
// private
async fn load_artifact(&self,
artifact_id: &str,
extension: &str,) -> Result<Vec<u8>, CapabilityError>;
// private
async fn test_artifact_provider();

Unit Verification (1 inline tests)​

Tests defined within module: test_artifact_provider


src/capability/providers/local_fs.rs​

Primary Responsibility​

Local filesystem capability provider with strict workspace path containment (CTL-02, D-01, D-03).

Types & Trait Declarations​

  • Structs (1): LocalFileSystemProvider

Key Functions & Signatures (15 shown)​

// pub
fn new(workspace_root: impl Into<PathBuf>) -> Result<Self, CapabilityError>;
// pub
fn workspace_root(&self) -> &Path;
// pub
fn resolve_and_verify(&self, path: &Path) -> Result<PathBuf, CapabilityError>;
// private
fn reject_final_symlink_for_mutation(workspace_root: &Path,
user_path: &Path,
op: &str,) -> Result<PathBuf, Capa;
// private
fn verify_open_fd(fd: std::os::unix::io::RawFd,
workspace_root: &Path,
user_path: &Path,
op: &str,) -> Resul;
// pub
fn strip_verbatim_prefix(path: &Path) -> PathBuf;
// private
fn normalize_path(path: &Path) -> PathBuf;
// private
async fn read_file(&self,
path: &Path,
offset: Option<u64>,
limit: Option<usize>,) -> Result<Vec;
// private
async fn write_file(&self, path: &Path, content: &[u8]) -> Result<usize, CapabilityError>;
// private
async fn edit_file(&self,
path: &Path,
old_content: &str,
new_content: &str,) -> Result<(), Capa;
// private
async fn list_files(&self,
path: &Path,
recursive: bool,) -> Result<Vec<PathBuf>, CapabilityError>;
// private
async fn file_metadata(&self, path: &Path) -> Result<FileMetadata, CapabilityError>;
// private
async fn delete_file(&self, path: &Path) -> Result<(), CapabilityError>;
// private
async fn create_directory(&self, path: &Path) -> Result<(), CapabilityError>;
// private
async fn move_file(&self, src: &Path, dst: &Path) -> Result<(), CapabilityError>;

Unit Verification (2 inline tests)​

Tests defined within module: test_workspace_containment, test_fs_operations


src/capability/providers/local_lsp.rs​

Primary Responsibility​

local lsp persistent stdio process provider.

Types & Trait Declarations​

  • Structs (2): LocalLspProcessClient, PersistentLspSession
  • Enums (2): LspOutgoingMessage, LspSessionState

Key Functions & Signatures (13 shown)​

// pub
async fn start(workspace_root: &Path,
cmd_bin: &str,
cmd_args: &[&str],) -> Result<Self, String>;
// pub
fn workspace_root(&self) -> &Path;
// pub
fn cmd_bin(&self) -> &str;
// pub
fn cmd_args(&self) -> &[String];
// pub
async fn is_alive(&self) -> bool;
// pub
async fn state(&self) -> LspSessionState;
// pub
async fn query(&self,
method: &str,
params: serde_json::Value,
timeout: Duration,) -> Result<ser;
// pub
async fn did_open(&self,
file_path: &Path,
content: &str,
language_id: &str,) -> Result<(), Stri;
// pub
async fn did_change(&self, file_path: &Path, content: &str) -> Result<(), String>;
// pub
async fn did_close(&self, file_path: &Path) -> Result<(), String>;
// pub
async fn shutdown(&self) -> Result<(), String>;
// pub
async fn open_documents(&self) -> HashMap<String, i32>;
// pub
async fn query_stdio(workspace_root: &Path,
cmd_bin: &str,
cmd_args: &[&str],
method: &str,
;

src/capability/providers/local_memory.rs​

Primary Responsibility​

Local in-memory contextual memory capability provider (CTL-02, D-01, D-03).

Types & Trait Declarations​

  • Structs (2): LocalMemoryProvider, MemoryEntry

Key Functions & Signatures (5 shown)​

// private
fn default() -> Self;
// pub
fn new() -> Self;
// private
async fn store_memory(&self,
key: &str,
value: &str,
ttl_secs: Option<u64>,) -> Result<(), Capab;
// private
async fn recall_memory(&self, key: &str) -> Result<Option<String>, CapabilityError>;
// private
async fn test_local_memory_provider();

Unit Verification (1 inline tests)​

Tests defined within module: test_local_memory_provider


src/capability/providers/local_network.rs​

Primary Responsibility​

Network capability provider for connectivity check and DNS lookup (CTL-02, D-01, D-03).

Types & Trait Declarations​

  • Structs (1): LocalNetworkProvider

Key Functions & Signatures (4 shown)​

// private
fn default() -> Self;
// pub
fn new() -> Self;
// private
async fn check_connectivity(&self, host: &str, port: u16) -> Result<bool, CapabilityError>;
// private
async fn resolve_host(&self, host: &str) -> Result<Vec<String>, CapabilityError>;

src/capability/providers/local_process.rs​

Primary Responsibility​

Local process, shell, and background job capability providers (CTL-01, CTL-02, TL-02).

Types & Trait Declarations​

  • Structs (2): LocalJobProvider, LocalProcessProvider

Key Functions & Signatures (15 shown)​

// pub
fn new(workspace_root: PathBuf) -> Self;
// pub
fn with_supervisor(workspace_root: PathBuf, supervisor: Arc<ProcessSupervisor>) -> Self;
// pub
fn with_sandbox(workspace_root: PathBuf,
supervisor: Arc<ProcessSupervisor>,
sandbox: Option<Arc<dyn San;
// pub
fn with_enforcement(mut self, enforcement: crate::sandbox::SandboxEnforcement) -> Self;
// pub
fn set_sandbox_required(&mut self, required: bool);
// pub
fn is_sandbox_required(&self) -> bool;
// private
fn is_network_isolated(&self) -> bool;
// pub
fn sandbox_provider(&self) -> Option<Arc<dyn SandboxProvider>>;
// private
async fn spawn_command(&self,
program: &str,
args: &[String],
working_dir: Option<&Path>,
;
// private
async fn terminate_process(&self, pid: u32) -> Result<(), CapabilityError>;
// private
async fn execute_bounded_shell(&self,
command: &str,
working_dir: Option<&Path>,
timeout_secs: u;
// pub
fn new(workspace_root: PathBuf, supervisor: Arc<JobSupervisor>) -> Self;
// pub
fn supervisor(&self) -> &Arc<JobSupervisor>;
// private
async fn start_job(&self,
command: &str,
args: &[String],) -> Result<JobDescriptor, CapabilityError>;
// private
async fn start_job_scoped(&self,
mission_id: crate::ids::MissionId,
task_id: TaskId,
agent_id: c;

src/capability/providers/local_sandbox.rs​

Primary Responsibility​

Internal implementation file.

Types & Trait Declarations​

  • Structs (1): LocalSandboxProvider

Key Functions & Signatures (7 shown)​

// private
fn default() -> Self;
// pub
fn new() -> Self;
// pub
fn with_provider(provider: Arc<dyn SandboxProvider>) -> Self;
// pub
fn provider(&self) -> Arc<dyn SandboxProvider>;
// private
fn capabilities(&self) -> Option<SandboxCapabilities>;
// private
async fn prepare_environment(&self,
config: &SandboxConfig,) -> Result<SandboxHandle, CapabilityError>;
// private
async fn cleanup_sandbox(&self, handle: &SandboxHandle) -> Result<(), CapabilityError>;

src/capability/providers/local_terminal.rs​

Primary Responsibility​

Local terminal session capability provider (CTL-02, D-01, D-03).

Types & Trait Declarations​

  • Structs (2): LocalTerminalProvider, TerminalSessionHandle

Key Functions & Signatures (12 shown)​

// private
fn default() -> Self;
// pub
fn new() -> Self;
// pub
fn with_workspace(workspace_root: impl Into<PathBuf>) -> Self;
// private
async fn spawn_session_internal(&self,
session_id: &str,
config: TerminalSessionConfig,) -> Result<Termi;
// private
async fn start_session(&self,
session_id: &str,
config: TerminalSessionConfig,) -> Result<(), Capability;
// private
async fn write_input(&self, session_id: &str, input: &[u8]) -> Result<(), CapabilityError>;
// private
async fn read_stream(&self,
session_id: &str,
timeout_ms: u64,) -> Result<Vec<u8>, CapabilityError>;
// private
async fn resize(&self, session_id: &str, cols: u16, rows: u16) -> Result<(), CapabilityError>;
// private
async fn terminate_session(&self, session_id: &str) -> Result<(), CapabilityError>;
// private
async fn session_status(&self,
session_id: &str,) -> Result<TerminalSessionStatus, CapabilityError>;
// private
async fn cleanup_agent_sessions(&self,
agent_id: &crate::ids::AgentId,) -> Result<(), CapabilityError>;
// private
async fn cleanup_mission_sessions(&self,
mission_id: &crate::ids::MissionId,) -> Result<(), CapabilityError>;

src/capability/providers/local_verification.rs​

Primary Responsibility​

Local verification and QA capability provider (CTL-02, D-01, D-03). Verification commands execute through the same production security boundaries as agent process execution — workspace containment, command safety, environment scrubbing, timeout with kill, and bounded output. There is no "verification is trusted" exemption: verification commands operate on potentially model-modified state and must remain strictly contained.

Types & Trait Declarations​

  • Structs (1): LocalVerificationProvider

Key Functions & Signatures (2 shown)​

// pub
fn new(workspace_root: impl Into<PathBuf>) -> Self;
// private
async fn run_verification(&self,
target: &VerificationTarget,) -> Result<VerificationReport, CapabilityError>;

src/capability/providers/local_web.rs​

Primary Responsibility​

Web capability provider backed by reqwest (CTL-02, D-01, D-03).

Types & Trait Declarations​

  • Structs (1): LocalWebProvider

Key Functions & Signatures (6 shown)​

// private
fn default() -> Self;
// pub
fn new() -> Self;
// pub
fn with_policy(destination_policy: NetworkDestinationPolicy) -> Self;
// private
async fn fetch_url(&self,
url: &str,
timeout_secs: u64,) -> Result<WebFetchResult, CapabilityError>;
// private
async fn search_web(&self,
query: &str,
max_results: usize,) -> Result<Vec<WebSearchResult>, CapabilityE;
// private
fn clean_html(input: &str) -> String;

src/capability/providers/mod.rs​

Primary Responsibility​

Native local capability providers (CTL-02, D-01, D-03).


src/capability/providers/model_caller.rs​

Primary Responsibility​

Model capability provider wrapping ModelCaller (CTL-02, D-01, D-03).

Types & Trait Declarations​

  • Structs (1): ModelCallerProvider

Key Functions & Signatures (2 shown)​

// pub
fn new(caller: Arc<dyn ModelCaller>, default_model: impl Into<String>) -> Self;
// private
async fn invoke_model(&self,
request: &ModelInvocationRequest,) -> Result<ModelInvocationResponse, CapabilityErr;

src/capability/providers/repo_graph.rs​

Primary Responsibility​

Repository graph capability provider wrapping BoundedQueryEngine (CTL-02, D-01, D-03).

Types & Trait Declarations​

  • Structs (1): RepositoryGraphProvider

Key Functions & Signatures (7 shown)​

// pub
fn new(workspace_root: impl Into<PathBuf>,
engine: Option<Arc<BoundedQueryEngine>>,) -> Self;
// private
async fn query_symbols(&self, query: &str) -> Result<Vec<RepositorySymbol>, CapabilityError>;
// private
async fn query_dependencies(&self,
symbol_id: &str,) -> Result<Vec<RepositorySymbol>, CapabilityError>;
// private
async fn search_code(&self, query: &str) -> Result<Vec<CodeSearchResult>, CapabilityError>;
// private
async fn find_tests(&self, target: &str) -> Result<Vec<String>, CapabilityError>;
// private
async fn analyze_impact(&self,
changed_files: &[String],) -> Result<crate::repo::query::ChangeImpactReport, Capa;
// private
async fn get_overview(&self) -> Result<crate::repo::types::IndexStatus, CapabilityError>;

src/capability/registry.rs​

Primary Responsibility​

Central capability registry (CTL-01, CTL-02, CTL-03).

Types & Trait Declarations​

  • Structs (1): CapabilityRegistry

Key Functions & Signatures (15 shown)​

// private
fn default() -> Self;
// pub
fn new() -> Self;
// pub
fn new_with_auth(auth_authority: Arc<crate::git::AuthorizationAuthority>) -> Self;
// pub
fn with_health_config(health_config: HealthConfig) -> Self;
// pub
fn with_health_config_and_auth(health_config: HealthConfig,
auth_authority: Arc<crate::git::AuthorizationAuthori;
// pub
fn production(workspace_root: impl AsRef<Path>,
bus: Option<Arc<dyn crate::events::EventBus>>,
model_cal;
// pub
fn production_with_auth(workspace_root: impl AsRef<Path>,
bus: Option<Arc<dyn crate::events::EventBus>>,
;
// pub
fn register_instance(&self, instance: CapabilityInstance);
// pub
fn deregister_instance(&self, id: &str) -> Option<CapabilityInstance>;
// pub
fn sync_git_capability(&self,
workspace_root: impl AsRef<Path>,
enabled: bool,
provider: Arc<dyn;
// pub
fn get_instance(&self, id: &str) -> Option<CapabilityInstance>;
// pub
fn list_capabilities(&self) -> Vec<CapabilityInstance>;
// pub
fn is_available(&self, family: &CapabilityFamily) -> bool;
// pub
fn record_success(&self, instance_id: &str);
// pub
fn record_failure(&self,
instance_id: &str,
is_infra_fault: bool,
reason: impl Into<String>,);

src/capability/traits/artifacts.rs​

Primary Responsibility​

Immutable artifact storage service trait (CTL-01, CTL-02).

Types & Trait Declarations​

  • Traits (1): ArtifactStoreService

Key Functions & Signatures (2 shown)​

// private
async fn store_artifact(&self,
artifact_id: &str,
data: &[u8],
extension: &str,) -> Result<PathB;
// private
async fn load_artifact(&self,
artifact_id: &str,
extension: &str,) -> Result<Vec<u8>, CapabilityError>;

src/capability/traits/fs.rs​

Primary Responsibility​

File system capability service trait (CTL-01, CTL-02).

Types & Trait Declarations​

  • Structs (1): FileMetadata
  • Traits (1): FileSystemService

Key Functions & Signatures (10 shown)​

// private
async fn read_file(&self,
path: &Path,
offset: Option<u64>,
limit: Option<usize>,) -> Result<Vec;
// private
async fn write_file(&self, path: &Path, content: &[u8]) -> Result<usize, CapabilityError>;
// private
async fn edit_file(&self,
path: &Path,
old_content: &str,
new_content: &str,) -> Result<(), Capa;
// private
async fn list_files(&self,
path: &Path,
recursive: bool,) -> Result<Vec<PathBuf>, CapabilityError>;
// private
async fn file_metadata(&self, path: &Path) -> Result<FileMetadata, CapabilityError>;
// private
async fn delete_file(&self, path: &Path) -> Result<(), CapabilityError>;
// private
async fn create_directory(&self, path: &Path) -> Result<(), CapabilityError>;
// private
async fn move_file(&self, src: &Path, dst: &Path) -> Result<(), CapabilityError>;
// private
async fn rename_file(&self, src: &Path, dst: &Path) -> Result<(), CapabilityError>;
// private
async fn copy_file(&self, src: &Path, dst: &Path) -> Result<u64, CapabilityError>;

src/capability/traits/git.rs​

Primary Responsibility​

Git version control service trait (CTL-01, CTL-02).

Types & Trait Declarations​

  • Structs (3): GitBranchInfo, GitCommitInfo, GitStatusResult
  • Traits (1): GitService

Key Functions & Signatures (15 shown)​

// private
async fn status(&self) -> Result<GitStatusResult, CapabilityError>;
// private
async fn diff(&self, staged: bool) -> Result<String, CapabilityError>;
// private
async fn log(&self, max_count: usize) -> Result<Vec<GitCommitInfo>, CapabilityError>;
// private
async fn show(&self, revision: &str) -> Result<String, CapabilityError>;
// private
async fn branch(&self) -> Result<GitBranchInfo, CapabilityError>;
// private
async fn checkout(&self,
branch_or_commit: &str,
gate: &crate::git::GitGate,) -> Result<(), CapabilityEr;
// private
async fn add(&self,
paths: &[PathBuf],
gate: &crate::git::GitGate,) -> Result<(), CapabilityError>;
// private
async fn commit(&self,
message: &str,
gate: &crate::git::GitGate,) -> Result<String, CapabilityError>;
// private
async fn add_all(&self, gate: &crate::git::GitGate) -> Result<(), CapabilityError>;
// private
async fn reset(&self,
paths: &[&str],
gate: &crate::git::GitGate,) -> Result<(), CapabilityError>;
// private
async fn commit_with_trailers(&self,
message: &str,
trailers: &crate::git::trailers::CommitTrailers,
;
// private
async fn merge(&self,
branch: &str,
no_edit: bool,
gate: &crate::git::GitGate,) -> Result<String;
// private
async fn merge_abort(&self, gate: &crate::git::GitGate) -> Result<(), CapabilityError>;
// private
async fn restore_head(&self,
path: &str,
gate: &crate::git::GitGate,) -> Result<(), CapabilityError>;
// private
async fn status_porcelain(&self) -> Result<String, CapabilityError>;

src/capability/traits/jobs.rs​

Primary Responsibility​

Background jobs supervision service trait (CTL-01, CTL-02).

Types & Trait Declarations​

  • Traits (1): JobService

Key Functions & Signatures (5 shown)​

// private
async fn start_job(&self,
command: &str,
args: &[String],) -> Result<JobDescriptor, CapabilityError>;
// private
async fn start_job_scoped(&self,
_mission_id: crate::ids::MissionId,
_task_id: crate::ids::TaskId,
;
// private
async fn get_status(&self, job_id: &str) -> Result<JobStatusInfo, CapabilityError>;
// private
async fn get_output(&self,
job_id: &str,
offset: u64,
limit: usize,) -> Result<JobOutputChunk, C;
// private
async fn stop_job(&self, job_id: &str) -> Result<(), CapabilityError>;

src/capability/traits/memory.rs​

Primary Responsibility​

Contextual memory service trait (CTL-01, CTL-02).

Types & Trait Declarations​

  • Traits (1): MemoryService

Key Functions & Signatures (2 shown)​

// private
async fn store_memory(&self,
key: &str,
value: &str,
ttl_secs: Option<u64>,) -> Result<(), Capab;
// private
async fn recall_memory(&self, key: &str) -> Result<Option<String>, CapabilityError>;

src/capability/traits/mod.rs​

Primary Responsibility​

The 15 core capability service traits (CTL-01, CTL-02).


src/capability/traits/model.rs​

Primary Responsibility​

Model inference service trait (CTL-01, CTL-02).

Types & Trait Declarations​

  • Structs (2): ModelInvocationRequest, ModelInvocationResponse
  • Traits (1): ModelService

Key Functions & Signatures (1 shown)​

// private
async fn invoke_model(&self,
request: &ModelInvocationRequest,) -> Result<ModelInvocationResponse, CapabilityErr;

src/capability/traits/network.rs​

Primary Responsibility​

Network connectivity and resolution service trait (CTL-01, CTL-02).

Types & Trait Declarations​

  • Traits (1): NetworkService

Key Functions & Signatures (2 shown)​

// private
async fn check_connectivity(&self, host: &str, port: u16) -> Result<bool, CapabilityError>;
// private
async fn resolve_host(&self, host: &str) -> Result<Vec<String>, CapabilityError>;

src/capability/traits/process.rs​

Primary Responsibility​

Supervised process execution service trait (CTL-01, CTL-02).

Types & Trait Declarations​

  • Traits (1): ProcessService

Key Functions & Signatures (2 shown)​

// private
async fn spawn_command(&self,
program: &str,
args: &[String],
working_dir: Option<&Path>,
;
// private
async fn terminate_process(&self, pid: u32) -> Result<(), CapabilityError>;

src/capability/traits/repo.rs​

Primary Responsibility​

Repository graph and code navigation service trait (CTL-01, CTL-02).

Types & Trait Declarations​

  • Structs (1): CodeSearchResult
  • Traits (1): RepositoryService

Key Functions & Signatures (6 shown)​

// private
async fn query_symbols(&self, query: &str) -> Result<Vec<RepositorySymbol>, CapabilityError>;
// private
async fn query_dependencies(&self,
symbol_id: &str,) -> Result<Vec<RepositorySymbol>, CapabilityError>;
// private
async fn search_code(&self, query: &str) -> Result<Vec<CodeSearchResult>, CapabilityError>;
// private
async fn find_tests(&self, target: &str) -> Result<Vec<String>, CapabilityError>;
// private
async fn analyze_impact(&self,
changed_files: &[String],) -> Result<ChangeImpactReport, CapabilityError>;
// private
async fn get_overview(&self) -> Result<IndexStatus, CapabilityError>;

src/capability/traits/sandbox.rs​

Primary Responsibility​

Sandbox boundary and environment service trait (CTL-01, CTL-02).

Types & Trait Declarations​

  • Structs (2): SandboxConfig, SandboxHandle
  • Traits (1): SandboxService

Key Functions & Signatures (4 shown)​

// pub
fn to_sandbox_plan(&self) -> SandboxPlan;
// private
fn capabilities(&self) -> Option<SandboxCapabilities>;
// private
async fn prepare_environment(&self,
config: &SandboxConfig,) -> Result<SandboxHandle, CapabilityError>;
// private
async fn cleanup_sandbox(&self, handle: &SandboxHandle) -> Result<(), CapabilityError>;

src/capability/traits/shell.rs​

Primary Responsibility​

Bounded shell execution service trait (CTL-01, CTL-02).

Types & Trait Declarations​

  • Structs (1): ShellOutput
  • Traits (1): ShellService

Key Functions & Signatures (1 shown)​

// private
async fn execute_bounded_shell(&self,
command: &str,
working_dir: Option<&Path>,
timeout_secs: u;

src/capability/traits/telemetry.rs​

Primary Responsibility​

Telemetry and metrics recording service trait (CTL-01, CTL-02).

Types & Trait Declarations​

  • Traits (1): TelemetryService

Key Functions & Signatures (2 shown)​

// private
async fn record_event(&self,
event_name: &str,
attributes: HashMap<String, String>,) -> Result<(), Capab;
// private
async fn record_metric(&self,
metric_name: &str,
value: f64,
unit: &str,) -> Result<(), Capabili;

src/capability/traits/terminal.rs​

Primary Responsibility​

Terminal session service trait (CTL-01, CTL-02).

Types & Trait Declarations​

  • Structs (2): TerminalSessionConfig, TerminalSessionStatus
  • Traits (1): TerminalService

Key Functions & Signatures (9 shown)​

// private
fn default() -> Self;
// private
async fn start_session(&self,
session_id: &str,
config: TerminalSessionConfig,) -> Result<(), Capability;
// private
async fn write_input(&self, session_id: &str, input: &[u8]) -> Result<(), CapabilityError>;
// private
async fn read_stream(&self,
session_id: &str,
timeout_ms: u64,) -> Result<Vec<u8>, CapabilityError>;
// private
async fn resize(&self, session_id: &str, cols: u16, rows: u16) -> Result<(), CapabilityError>;
// private
async fn terminate_session(&self, session_id: &str) -> Result<(), CapabilityError>;
// private
async fn session_status(&self,
session_id: &str,) -> Result<TerminalSessionStatus, CapabilityError>;
// private
async fn cleanup_agent_sessions(&self,
_agent_id: &crate::ids::AgentId,) -> Result<(), CapabilityError>;
// private
async fn cleanup_mission_sessions(&self,
_mission_id: &crate::ids::MissionId,) -> Result<(), CapabilityError>;

src/capability/traits/verification.rs​

Primary Responsibility​

Verification and QA service trait (CTL-01, CTL-02).

Types & Trait Declarations​

  • Structs (2): VerificationReport, VerificationTarget
  • Enums (1): VerificationKind
  • Traits (1): VerificationService

Key Functions & Signatures (1 shown)​

// private
async fn run_verification(&self,
target: &VerificationTarget,) -> Result<VerificationReport, CapabilityError>;

src/capability/traits/web.rs​

Primary Responsibility​

Web access and external search service trait (CTL-01, CTL-02).

Types & Trait Declarations​

  • Structs (2): WebFetchResult, WebSearchResult
  • Traits (1): WebService

Key Functions & Signatures (2 shown)​

// private
async fn fetch_url(&self,
url: &str,
timeout_secs: u64,) -> Result<WebFetchResult, CapabilityError>;
// private
async fn search_web(&self,
query: &str,
max_results: usize,) -> Result<Vec<WebSearchResult>, CapabilityE;