Skip to main content

Module exec

Module exec 

Source
Expand description

The execution layer — how a tool touches the machine.

Four contracts, designed as one because they are entangled: a sandbox constrains a process, a process needs files and a network, and the network policy has to reach inside the sandbox. docs/ARCHITECTURE.md §5 is the blueprint; this module is its vocabulary.

§What is deliberately not here

An execution layer is the easiest place in an engine for a second kernel to grow, so the boundary is written down rather than assumed. Retries, timeouts, caching and metrics belong to tool_middleware; whether a provider is healthy belongs to health; kept time belongs to environment; path safety is a policy and stays with permissions; and the sandbox policy — what to constrain and whether to constrain at all — is the kernel’s. A provider decides how to constrain, never whether.

This machine’s own answers to the four contracts are the platform crate, which depends on this one; [env] stays here because it is the sandbox.env setting and the engine’s credential list, both of which base itself reads.

Re-exports§

pub use capture::capture;
pub use capture::Captured;
pub use env::EnvPlan;
pub use env::EnvScope;
pub use env::SubprocessEnv;
pub use env::SubprocessEnvMode;
pub use filesystem::DirEntry;
pub use filesystem::FileSystem;
pub use filesystem::Metadata;
pub use network::domains_name_host;
pub use network::is_internal_address;
pub use network::names_loopback;
pub use network::HttpRequest;
pub use network::HttpResponse;
pub use network::HttpStream;
pub use network::Network;
pub use network::Origin;
pub use network::DEFAULT_MAX_REDIRECTS;
pub use process::ExitStatus;
pub use process::OutputChunk;
pub use process::OutputStream;
pub use process::Process;
pub use process::ProcessHandle;
pub use process::ProcessSpec;
pub use process::OUTPUT_GRACE_AFTER_EXIT;
pub use sandbox::default_deny_read;
pub use sandbox::default_deny_read_in;
pub use sandbox::Confined;
pub use sandbox::ConfinementReport;
pub use sandbox::EgressProxy;
pub use sandbox::Enforcement;
pub use sandbox::NetworkMode;
pub use sandbox::ReadScope;
pub use sandbox::Sandbox;
pub use sandbox::SandboxMode;
pub use sandbox::SandboxPolicy;
pub use sandbox::SandboxSettings;

Modules§

capture
Running a process through the execution contract and keeping all of it.
env
The environment a child process on this machine starts from.
filesystem
FileSystem — reading and writing wherever the tools’ files live.
in_process
The second provider: everything in this process, nothing on the machine.
network
Network — outbound requests, and whether they may leave.
process
Process — running a program somewhere.
sandbox
Sandbox — how a process is constrained.

Structs§

ExecProviders
The four providers a tool reaches the machine through.

Enums§

ExecError
Why an execution-layer call did not do what was asked.