feat: align gkg.proto for API design
Builds on ADR 003 — Orbit API Design and implements the proto changes needed for the REST API surface.
Related to gitlab-org#20566 Related to gitlab-org/gitlab#591396
What changed
Proto (4 RPCs, down from 5)
- Dropped
ExecuteTool— queries go throughExecuteQuery, schema throughGetGraphSchema - Replaced
GetOntologywithGetGraphSchema— addsexpand_nodesfor selective property loading andResponseFormatfor RAW vs LLM output - Added
ResponseFormattoExecuteQueryandGetClusterHealth - Restructured
ExecuteQueryResult— usesoneof content { result_json, formatted_text }with a separateQueryMetadatamessage (query_type,raw_query_strings,row_count) - Removed
generated_sql,redacted_count,execution_time_msfromExecuteQueryResult(per sync decisions) - Removed accidental JSON blob from proto file
Rust service
-
execute_querypicks raw or context-engine pipeline based onResponseFormat, populatesQueryMetadatafrom pipeline output -
get_graph_schemareturnsStructuredSchema(RAW) or TOON text (LLM), withexpand_nodescontrolling expansion -
get_cluster_healthwraps response in a oneof for format switching - Removed all
ExecuteToolhandler code
How to review
-
gkg.proto— message/RPC changes drive everything else -
grpc/service.rs— handler implementations for the 4 RPCs -
query_pipeline/types.rs+stages/formatting.rs—PipelineOutputfields and formatting stage -
docs/design-documents/decisions/003_api_design.md— updated response examples and proto definition
Test plan
-
cargo checkcompiles cleanly -
cargo test -p gkg-server— 147 unit tests pass - Integration test with updated Rails gRPC client (separate MR)
Edited by Michael Angelo Rivera