refactor(jsonrpc): carry typed inspection errors#2244
Conversation
Signed-off-by: Shiju <shiju@nvidia.com>
|
Label |
PR Review StatusValidation: This concentrated JSON-RPC/MCP refactor is project-valid because it directly supports the typed inspection-error prerequisite described in #2174 and addresses the implementation feedback referenced from #2083 without expanding into the version-specific behavior tracked separately. Review findings:
Docs: Not needed because this is a representation-only refactor with no user-facing configuration, policy shape, wire behavior, or workflow change. E2E: Required because the direct JSON-RPC/MCP relay and forward-proxy enforcement paths changed. I applied Next state: |
Monitoring CompleteMonitoring is complete because this PR has merged. Final status: Gator had completed its code review and pipeline monitoring, the required E2E label was present, maintainer approval was recorded, and the PR merged at head I removed the active |
Summary
Replace raw JSON-RPC inspection-error strings with a typed value that distinguishes invalid JSON from valid JSON that fails JSON-RPC or MCP message inspection. Relay, OPA, and forward-proxy boundaries preserve their existing diagnostics and behavior, including current MCP batch acceptance.
Related Issue
Part of #2174; does not close it. Addresses typed-error review feedback on #2083. This representation-only prerequisite does not fix #2082.
Changes
JsonRpcRequestInfo.errorfromOption<String>toOption<JsonRpcInspectionError>.#[non_exhaustive]JsonRpcInspectionErrorKindwithInvalidJsonandInvalidMessage; keep constructors and fields private so the parser remains the classification authority.kind()anddetail()accessors withoutDeref<str>,AsRef<str>, string comparison support, or Serde on the Rust error value.detail()only at the policy boundary.JSON-RPC request rejected: {detail}denial reason in route-selected relay, direct relay, and forward-proxy paths.Testing
mise run pre-commitpassesChecklist