Expand description
Output rendering: the one place JSON is serialized, so every command’s
--json twin is byte-deterministic the same way.
Reports are always serialized through serde_json::Value, whose map is a
BTreeMap (serde_json’s default, no preserve_order) — so keys sort
alphabetically regardless of struct field order, and an agent can diff two
runs and see only real change (dx-spec §5, “determinism as courtesy”).
Functions§
- emit
- Print a
Renderedresult to the right stream and return its exit code.jsonselects the machine twin; otherwise the human prose is printed. Errors and diagnostics (Rendered::to_stderr) go to stderr regardless. - json_
string - Render a
serde_json::Valueto the exact bytes the--jsontwin prints. - to_json
- Serialize any report to canonical JSON: sorted keys, pretty-printed, one
trailing newline. Panics only on a report that cannot serialize, which is a
programming error (all report structs are plain
Serialize).