Expand description
Surfacing for the hosted server’s typed gRPC error vocabulary (AX H4).
The hosted weft server attaches machine-readable error details to failing
gRPC responses as google.rpc.Status details (the standard
grpc-status-details-bin trailer) — see weft
crates/weft-server/src/server/typed_error.rs. The vocabulary is defined in
api/proto/heddle/api/v1alpha1/errors.proto and both sides consume it via
the heddle-api crate.
This module decodes the three conflict/pagination/stream details the CLI
acts on — ConflictDetail, CursorFailure, StreamFailure — off a
tonic::Status and projects them into:
- the JSON/text error envelope (
cli::commands::error_envelope): a stablekind, a recoveryhint, and structuredextra_json_fieldsan agent can branch on (the conflicting resource, therestart_cursor, whether a stream is resumable), and - the exit-code taxonomy (
exit): a cursor/stream failure is a safe-retry (TempFail= 75, restart the pagination/stream); a conflict needs a changed input (a fresh op-id or a fetch+retry) so it stays a protocol-layer rejection (Protocol= 76).
Decoding is dependency-light: rather than pull in tonic-types, we decode
the google.rpc.Status envelope with a local prost mirror ([RpcStatus])
and match the detail Any by its type.googleapis.com/heddle.api.v1alpha1.*
type URL.
Enums§
- Hosted
Typed Error - A hosted typed error the CLI knows how to render + classify. Built from a
tonic::StatusviaHostedTypedError::from_status; the first matching detail wins (a status carries at most one of these in practice).