Generate typed Rust endpoint bindings for CLI and MCP clients #75
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem and evidence
CLI and MCP share
crates/infraternal/src/http.rsandstream.rs, but route methods and DTO mappings are maintained by hand. The HTTP client imports many individual proto request/response types (http.rs:1-20); MCP tools separately encode container endpoint behavior, for examplecrates/infraternal/src/mcp.rs:680-709. TypeScript's generated client currently generates only an OpenAPI-fetch wrapper (packages/api-client/scripts/generate-client.ts:1-12).Recommendation
After route/schema generation is extracted, generate typed Rust path/method/request/response bindings for the shared CLI/MCP API client where they remove duplicated endpoint knowledge. Keep human command names, dry-run/plan requirements and MCP safety annotations explicit in product code.
Payoff and estimate
Reduces path/DTO drift while preserving clear help and mutation safety. Estimate: 2–3 engineering days after route metadata is available, including generated-output equality and typed client checks.
Priority: Next milestone (PLAN step 6).
2026-10-04 owner decisions: Matches one API contract and code/tests as the spec. Keep dry-run and human safety semantics explicit; generated transport types do not decide authorization.
Report: arch-review report
Source: arch-review 2026-10-04