Taurus Development Guide
This guide is for contributors working on Taurus itself. It documents how Taurus is structured, how execution flows through the runtime, and how to run and test changes locally.
What Taurus Does
Taurus is the execution runtime in the CodeZero execution block.
- Consumes flow execution requests from NATS (
execution.*) - Executes flow graphs via
taurus-core::runtime::engine::ExecutionEngine - Delegates remote nodes to external services over NATS (
action.<service>.<execution_id>) - Reports runtime status and execution results to Aquila in dynamic mode
Workspace Layout
| Path | Purpose |
|---|---|
crates/taurus | Main runtime binary (startup, config, NATS worker, dynamic integrations) |
crates/taurus-core | Execution engine, compiler, runtime functions, errors, tracing |
crates/taurus-provider | NATS remote-runtime transport adapter |
crates/taurus-manual | Manual CLI executor for running a single validation flow file |
crates/taurus-tests | Local execution-suite runner for JSON flow fixtures under flows/ |
flows/local/ | Validation flow cases that never call an action |
flows/remote/ | Validation flow cases that call actions, run against simulated actions |
Runtime Flow
Execution details
- Taurus subscribes to queue subject
execution.*with queue grouptaurus. - Incoming payload is decoded as
tucana::shared::ExecutionFlow. ExecutionEngine::execute_flow_with_execution_id(...)compiles and executes nodes.- Local nodes run handlers from the built-in function registry.
- Non-local
definition_sourcevalues are executed remotely viaRemoteRuntime. - The completed
ExecutionResultis transmitted through the Aquila execution gRPC API in dynamic mode.
Runtime Modes
Taurus mode is controlled by MODE.
dynamic
dynamic enables control-plane integrations:
- Sends definitions to Aquila (retry loop until success)
- Starts runtime status reporting (including heartbeat)
- Sends execution result updates after each flow run
static
static disables those control-plane interactions.
- Taurus still executes flows from NATS
- No definition push
- No runtime status updates
- No execution result updates
Environment Variables
Defaults are defined in crates/taurus/src/config/mod.rs.
| Name | Description | Default |
|---|---|---|
ENVIRONMENT | Running env | development |
MODE | Runtime mode (dynamic or static) | dynamic |
NATS_URL | NATS connection URL | nats://localhost:4222 |
AQUILA_URL | Aquila gRPC endpoint (used in dynamic mode) | http://localhost:50051 |
AQUILA_TOKEN | Auth token for Aquila runtime APIs | token |
WITH_HEALTH_SERVICE | Enables gRPC health server | false |
GRPC_HOST | Health server host | 127.0.0.1 |
GRPC_PORT | Health server port | 50051 |
DEFINITIONS | Path sent to FlowUpdateService for definition sync | ./definitions |
RUNTIME_STATUS_UPDATE_INTERVAL_SECONDS | Heartbeat interval in dynamic mode (0 disables heartbeat) | 30 |
AQUILA_GRPC_CONNECT_TIMEOUT_SECS | Timeout in seconds for establishing Aquila gRPC channels | 2 |
AQUILA_GRPC_REQUEST_TIMEOUT_SECS | Timeout in seconds for Aquila gRPC requests | 10 |
EXECUTION_RESULT_SAMPLE_RATE | Probability (0.0-1.0) that an execution reports its full result (input + node results) for Sagittarius; test executions always do | 1.0 |
RUNTIME_USAGE_STREAM | JetStream work-queue stream (and subject) runtime usages are published to | runtime_usage |
RUNTIME_USAGE_BATCH_SIZE | Maximum number of runtime usages per published NATS message | 1000 |
RUNTIME_USAGE_FLUSH_INTERVAL_MS | Maximum time in milliseconds a runtime usage waits before its batch is published | 1000 |
RUNTIME_USAGE_BUFFER_CAPACITY | Maximum number of buffered runtime usages before new ones are dropped | 100000 |
OPENTELEMETRY_ENABLED | Enables OpenTelemetry export when an endpoint is configured | false |
OPENTELEMETRY_SERVICE_NAME | Service name used for exported telemetry | taurus |
OPENTELEMETRY_LOGS_ENDPOINT | OTLP logs endpoint | empty |
OPENTELEMETRY_METRICS_ENDPOINT | OTLP metrics endpoint | empty |
OPENTELEMETRY_TRACES_ENDPOINT | OTLP traces endpoint | empty |
Local Development
1. Start dependencies
At minimum, start a reachable NATS instance at NATS_URL.
2. Configure environment
Create .env in the repository root (you can copy from .env-example and extend it).
3. Run Taurus
cargo run -p taurus4. Run the execution suite
cargo run -p taurus-testsThis executes the local suite (./flows/local, no remote runtime) and the
remote suite (./flows/remote, against simulated actions) and compares
runtime outputs; it exits non-zero if any case fails. Pass local or
remote (cargo run -p taurus-tests -- remote) to run a single suite.
5. Run one flow manually
cargo run -p taurus-manual -- --path ./flows/local/0003_for_each.json --index 0 --offlineThis is useful when debugging one case or remote-execution behavior.
Testing
- Core unit/integration tests:
cargo test -p taurus-core- Full workspace checks (recommended before merge):
cargo testExtending Taurus
Add or modify built-in functions
- Implement handler logic in
crates/taurus-core/src/runtime/functions/* - Register function IDs via the
FUNCTIONSarrays - Registration is aggregated through
ALL_FUNCTION_SETSinruntime/functions/mod.rs
Remote execution routing rule
In the compiler, a node or function-backed sub-flow is treated as local when
definition_source is:
- empty
taurus- prefixed with
draco
Any other source is routed as remote execution to that service name.
Sub flow functions returned by actions
An action may return a sub flow function (SubFlowFunctionResult) instead of
a value. Taurus never runs it on its own: the node's result keeps the
function, and the node itself contributes null as a value. A later node that
references the result receives it as a sub flow parameter, exactly like a sub
flow defined in the flow:
- a local function (e.g.
std::list::map) calls it with the inputs it seeds; the function has no declared parameters, so it receives all of them in order - a remote node receives it as a callable sub flow reference it may invoke zero, one or many times while its call is outstanding (e.g. a handler)
- an eager parameter runs it, as for any sub flow passed to one
The function runs wherever its definition_source points, following the
routing rule above.