Skip to main content

Module executor

Module executor 

Source
Expand description

Execution-environment seam: the kernel-side executor implementations and process primitives.

  • local::LocalExecutor — reference ToolExecutor backed by the local filesystem (tokio::fs) and process table (tokio::process).
  • sandbox::SandboxExecutor — stub executor for remote-sandbox execution (ExecutorKind::Sandbox); every operation fails promptly with [ExecutorError::UnsupportedKind] until a real backend lands.
  • file_lock::FileLock — cross-process advisory lock for the editing tools’ read→modify→write cycle (issue #17).

Both executors are always compiled. The execution environment is selected at runtime by [executor] kind = "local" | "sandbox" in config.toml (issue #123): the TUI passes the choice to thewayd as --executor-kind, and the composition root binds it via executor_for_kind. The legacy local / sandbox cargo features remain as compatibility labels and no longer gate executor code.

Modules§

file_lock
FileLock — cross-process advisory file lock for the editing tools.
local
LocalExecutor — reference ToolExecutor backed by the local filesystem (tokio::fs) and process table (tokio::process), openspec change sdk-split-local-sandbox (design decision 1/6: local editing mode, the default).
sandbox
SandboxExecutor — stub ToolExecutor for remote-sandbox execution (openspec change sdk-split-local-sandbox, “Sandbox seam” requirement).

Functions§

default_executor
Compatibility composition root: the default local executor for callers that do not carry a runtime executor choice.
executor_for_cwd
Build a local executor with an explicit cwd. Kept for callers/tests that predate the runtime selection; daemon startup uses executor_for_kind.
executor_for_kind
The composition-root executor for a runtime-selected execution environment. local roots a local::LocalExecutor at cwd; sandbox returns the sandbox::SandboxExecutor stub.
parse_executor_kind
Parse an executor-kind string ("local" / "sandbox", case-insensitive) for the [executor] kind config value and the --executor-kind CLI flag.