Add async Python client (ate-env-client) under clients/python #47
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 433 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.363
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #47"
general
weight: 0.35
SHRUTI6991
Summary
Adds an async Python client for the ate-env-api gRPC services under
clients/python/— distributionate-env-client, import packageate_env— mirroring the Go client (env/) with the full API surface,grpc.aiothroughout.Client— lifecycle overEnvironmentService(create/get/suspend/delete) plus a no-RPCenv()handle factory; async context manager; endpoint normalization matching the Go client.Env— process API (start_process,get_process,kill_process,wait,stream_outputsas an async iterator with follow support,shellwith captured output/exit code) and file API (read_fileserver-streaming,read_file_bytes,write_fileclient-streaming accepting bytes or sync/async chunk iterables). Guest calls automatically carry thex-env-id/x-env-atespacerouting metadata.EnvErrorhierarchy (NotFoundError,InvalidArgumentError,PermissionDeniedError,RpcError).Codegen
Generated stubs are committed under
src/ate_env/_gen/(matching the committed Go pb files). Regenerate withclients/python/scripts/gen-protos.sh(ormake python-protos) —grpc_tools.protocwith a relative-import rewrite. Notebuf.gen.yamlonly covers Go (and hardcodes local plugin paths), so the script is the Python codegen path.Testing
Three layers:
1. 56 unit tests — pytest + pytest-asyncio against in-process
grpc.aiofakes that replicate the API server's semantics, including the metadata contract (INVALID_ARGUMENT "x-env-id header is required"), streaming in both directions, 64 KiB chunking boundaries, shell's poll loop, cancellation, and error mapping.2. 17 integration tests against a real
examples/guest-daemon(gated onATE_ENV_GUEST_TARGET, zero cluster dependencies): real subprocesses, cwd/env passthrough, binary/empty/large file roundtrips, output offset replay, kill terminating a follow stream, sandbox-escape →PermissionDeniedError.3. Full-stack suite against a live ate-env-api (gated on
ATE_ENV_API_TARGET): verified on a GKE substrate cluster — the environment lifecycle path (create, wake-on-route, status, suspend-then-delete, NotFound mapping) works end-to-end.Known dependency
Guest operations (process/file) through a cluster additionally require substrate to carry gRPC trailers on the actor path — i.e. agent-substrate/substrate#1183. Without it they fail with
server closed the stream without sending trailers(the router'sactor_original_dstupstream is pinned to HTTP/1.1). Environment lifecycle is unaffected; the client README carries a callout.Follow-ups (not in this PR)
ate-env-clientname availability unverified; nothing is published here).