pub trait WorkspaceProvider: Send + Sync {
// Required methods
fn kind(&self) -> WorkspaceProviderKind;
fn provision<'life0, 'life1, 'async_trait>(
&'life0 self,
spec: &'life1 ProvisionSpec,
) -> Pin<Box<dyn Future<Output = Result<WorkspaceHandle>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn readiness<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
handle: &'life1 WorkspaceHandle,
progress: &'life2 mut ProgressSink<'life3>,
) -> Pin<Box<dyn Future<Output = Result<ReadinessOutcome>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn teardown<'life0, 'async_trait>(
&'life0 self,
handle: WorkspaceHandle,
mode: TeardownMode,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn run_data_hook<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
handle: &'life1 WorkspaceHandle,
hook: DataHookKind,
command: &'life2 str,
progress: &'life3 mut ProgressSink<'life4>,
) -> Pin<Box<dyn Future<Output = Result<Option<CommandOutcome>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait { ... }
}Expand description
The seam: provision a runnable environment, prove it ready, tear it down.
Distinct from crate::backend::AgentBackend — the backend drives model
sessions INSIDE the workspace this trait supplies.
Required Methods§
Sourcefn kind(&self) -> WorkspaceProviderKind
fn kind(&self) -> WorkspaceProviderKind
Which kind this provider is (recorded in workspace.provisioned).
Sourcefn provision<'life0, 'life1, 'async_trait>(
&'life0 self,
spec: &'life1 ProvisionSpec,
) -> Pin<Box<dyn Future<Output = Result<WorkspaceHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn provision<'life0, 'life1, 'async_trait>(
&'life0 self,
spec: &'life1 ProvisionSpec,
) -> Pin<Box<dyn Future<Output = Result<WorkspaceHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Establish the workspace for one mission and return its handle.
Sourcefn readiness<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
handle: &'life1 WorkspaceHandle,
progress: &'life2 mut ProgressSink<'life3>,
) -> Pin<Box<dyn Future<Output = Result<ReadinessOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn readiness<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
handle: &'life1 WorkspaceHandle,
progress: &'life2 mut ProgressSink<'life3>,
) -> Pin<Box<dyn Future<Output = Result<ReadinessOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Prove the workspace ready for spend (see ProgressSink).
Sourcefn teardown<'life0, 'async_trait>(
&'life0 self,
handle: WorkspaceHandle,
mode: TeardownMode,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn teardown<'life0, 'async_trait>(
&'life0 self,
handle: WorkspaceHandle,
mode: TeardownMode,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Tear the workspace down per mode (see TeardownMode for v1
local-worktree semantics).
Provided Methods§
Sourcefn run_data_hook<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
handle: &'life1 WorkspaceHandle,
hook: DataHookKind,
command: &'life2 str,
progress: &'life3 mut ProgressSink<'life4>,
) -> Pin<Box<dyn Future<Output = Result<Option<CommandOutcome>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn run_data_hook<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
handle: &'life1 WorkspaceHandle,
hook: DataHookKind,
command: &'life2 str,
progress: &'life3 mut ProgressSink<'life4>,
) -> Pin<Box<dyn Future<Output = Result<Option<CommandOutcome>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Run one declared golden-data hook (design D-D) inside this workspace
and report its workspace data: decision line through progress.
Used by readiness (clone/migrate/skewCheck) and by the engine’s
reset-between-rounds drive from validation_round — one method so
the reset fires through the same execution path as the provision-time
hooks. Returns the failing CommandOutcome only on failure.
The default runs the command with the gate’s env discipline (the
shared bounded shell runner in the handle’s cwd, with the CLEARED
gate env workspace_gate::gate_command_env builds — the handle’s env,
the mission’s shared gate HOME, the fixed operational allowlist, and
only those secrets[] names the OPERATOR also granted; never the
engine’s ambient environment; 2026-09-01 adversarial audit H4,
follow-up review H-6/M-1/M-2). The
container provider overrides to exec INSIDE the container network, so
data hooks never run on the host when a container workspace exists.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".