Torvyn uses TOML for all configuration, consistent with the Rust ecosystem convention established by Cargo.toml. Configuration lives in Torvyn.toml at the project root.
Configuration values are resolved through a layered precedence model (highest precedence first):
CLI flags — --config key=value on torvyn run and other commands.
Environment variables — TORVYN_ prefix + uppercase path (e.g., TORVYN_RUNTIME_WORKER_THREADS).
Project manifest — Torvyn.toml in the project root.
Global user config — ~/.config/torvyn/config.toml.
Built-in defaults — Compiled into the binary.
Field Type Required Default Description
namestring Yes — Project name. Must be a valid identifier (lowercase, hyphens allowed).
versionstring Yes — Project version (semantic versioning, e.g., "0.1.0").
contract_versionstring Yes — Torvyn contract version this project targets (e.g., "0.1.0").
descriptionstring No ""Human-readable project description.
authorslist of strings No []Author names and emails (e.g., ["Alice <alice@example.com>"]).
licensestring No ""SPDX license identifier (e.g., "Apache-2.0").
repositorystring No ""Source repository URL.
Key-value pairs where keys are capability identifiers and values are booleans. Components will not link if required capabilities are not granted.
[capabilities.required]
wasi-filesystem-read = true
wasi-clocks = true
Capabilities that enhance functionality but are not required. The component must handle their absence gracefully.
Field Type Default Description
max-buffer-sizestring "16MiB"Maximum single buffer size this component needs.
max-memorystring "64MiB"Maximum Wasm linear memory this component needs.
buffer-pool-accessstring "default"Named buffer pool to use.
Field Type Required Default Description
namestring Yes — Component name within this project.
pathstring Yes — Path to component source root (relative to project root).
languagestring No "rust"Implementation language. Values: rust, go, python, zig.
build_commandstring No auto-detected Custom build command override.
Field Type Required Default Description
descriptionstring No ""Human-readable flow description.
Field Type Required Default Description
componentstring Yes — Path to compiled .wasm file or registry reference.
interfacestring Yes — Torvyn interface this component implements (e.g., torvyn:streaming/processor).
configstring No ""Configuration string passed to lifecycle.init(). JSON recommended.
Field Type Required Description
from.nodestring Yes Upstream node name.
from.portstring Yes Output port name (usually "output").
to.nodestring Yes Downstream node name.
to.portstring Yes Input port name (usually "input").
Field Type Default Description
worker_threadsinteger CPU count Tokio worker thread count.
max_memory_per_componentstring "64MiB"Wasm linear memory limit per component instance.
fuel_per_invocationinteger 1_000_000Wasmtime fuel budget per component call. 0 = unlimited.
component_init_timeout_msinteger 5000Timeout for lifecycle.init() calls.
component_teardown_timeout_msinteger 2000Timeout for lifecycle.teardown() calls.
Field Type Default Description
default_queue_depthinteger 64Default bounded queue capacity per stream.
backpressure_policystring "block"Default policy. Values: block, drop-oldest, drop-newest, error.
low_watermark_ratiofloat 0.5Queue depth ratio at which backpressure deactivates.
Field Type Default Description
small_pool_sizeinteger 4096Number of 256-byte buffers pre-allocated.
medium_pool_sizeinteger 1024Number of 4 KiB buffers pre-allocated.
large_pool_sizeinteger 256Number of 64 KiB buffers pre-allocated.
huge_pool_sizeinteger 32Maximum cached 1 MiB buffers (on-demand).
exhaustion_policystring "fallback-alloc"Policy when pool is empty. Values: fallback-alloc, error.
Field Type Default Description
levelstring "production"Observability level. Values: off, production, diagnostic.
tracing_enabledboolean trueEnable trace collection.
tracing_exporterstring "stdout"Trace export target. Values: otlp-grpc, otlp-http, stdout, file, none.
tracing_endpointstring ""OTLP endpoint URL (for otlp-grpc and otlp-http).
sample_ratefloat 0.01Head-based trace sampling rate (0.0–1.0).
error_promoteboolean truePromote errored flows to full tracing.
latency_promote_threshold_msinteger 10Promote flows exceeding this latency.
metrics_enabledboolean trueEnable metrics collection.
prometheus_enabledboolean trueServe /metrics on inspection API.
otlp_metrics_enabledboolean falsePush metrics via OTLP.
otlp_metrics_interval_sinteger 15OTLP metrics push interval.
ring_buffer_capacityinteger 64Per-flow span ring buffer size for retroactive sampling.
Field Type Default Description
default_capability_policystring "deny-all"Default policy for ungranted capabilities.
audit_enabledboolean trueEnable security audit logging.
audit_targetstring "file"Audit log target. Values: file, stdout, event-sink.
[security.grants.my-transform]
capabilities = [
"wasi:filesystem/read:/data/input",
"wasi:clocks/wall-clock",
]
Field Type Default Description
defaultstring ""Default OCI registry URL for torvyn publish.