Outputs
Choose where model output values are observed. If no output flag is selected, the CLI uses stdout. A single-destination shortcut is enough when results have one destination; use --output-config for explicit routing, delivery policies, mirroring, or several destinations.
Destinations
| Destination | CLI selection | Observable encoding |
|---|---|---|
| stdout | --output-stdout, or no output selection | <variable>[<zero-based row>] = <rendered value>; DSRV values use source syntax, MSTLO values use JSON. |
| MQTT | --mqtt-output or --output-mqtt-file PATH | Compact JSON envelope such as {"value":42}. |
| Redis | --redis-output or --output-redis-file PATH | JSON/JSON5 value itself, such as 42; no MQTT value envelope. |
| ROS 2 | --output-ros-file PATH | Message type and route come from the mapping; requires --features ros. |
| Multiple destinations | --output-config PATH | Each configured destination receives its selected output projection. |
The stdout sink increments its row index for each logical output tick. It suppresses auxiliary variables and NoVal values. For example, this DSRV program keeps a running total:
in x: Int
out z: Int
z = default(z[1], 0) + x
With four input values of 1, stdout is:
z[0] = 1
z[1] = 2
z[2] = 3
z[3] = 4
MQTT and Redis route files use the compact variable-to-route object described in the input catalogue. ROS entries include the message codec.
Multi-destination behavior
An output configuration names a default destination and a map of destinations. A secondary destination must establish its role with partition, mirror: true, or a route catalog. partition and mirror are mutually exclusive on one destination. limited-null is a bounded test sink and requires a positive limit.
Each destination has one delivery policy. Direct delivery is the default; a bounded queue enables background delivery, optionally with coalescing that preserves logical ticks. In the Rust API, feed admits output and send also flushes. MQTT flush waits for protocol acknowledgement. Neither flush nor close proves that a remote consumer has persisted or observed the message. Multi-destination output has no cross-transport transaction or rollback: one destination may observe a batch before another fails.
Built-in MQTT output publishes each result at QoS 1 (at least once). A Rust MqttClient::publish request for QoS 2 is rejected before transport submission on MQTT 5 because rumqttc does not expose rejected PubRec acknowledgements; negative MQTT 5 protocol acknowledgements are terminal for the driver.
Timed-provenance output
In DSRV under the causal semantics and the semisync runtime, the trustworthiness checker will provide additional output recording the Timed Provenance of output verdicts. For every output value, this reports which input values the output depended upon.
Given an example two-input specification,
in x: Int
in y: Int
out z: Int
z = x + y
which is recorded in examples/simple_add_typed.dsrv, we can run the specification under the causal semantics via,
cargo run -- examples/simple_add_typed.dsrv \
--input-file examples/simple_add.input \
--semantics causal --runtime semi-sync --output-stdout
The first input tick contains x = 1 and y = 2, producing:
z[0] = {"value":3,"causality":{"alternatives":[{"causes":[{"input":"x","logical_tick":0,"roles":[]},{"input":"y","logical_tick":0,"roles":[]}]}]}}
The logical_tick record the index of the corresponding input tick, counting from zero.
History references can retain causes from earlier ticks. Current cause set output does not use the roles roles
field so it is always empty.
Choose a task
- Write and run DSRV models — inspect exact stdout from finite traces.
- Live MQTT — publish JSON5 values and observe
{"value":...}. - ROS input and output — configure message types with the ROS feature.
- Output configuration reference — use JSON5 destinations, routes, selectors, and delivery policies.
- Output architecture — read the deeper routing, readiness, flush, and failure contract.