feat(kubernetes): add API discovery and schema inspection #1707
All Vouch review confidence checks passed
Residual risk 0.32 = Change Risk (0.60) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.60 · 219 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.323
Sensitive Paths
sensitive_paths
0.060
Real PR Conversation Timeline
1 comments
"Review active on #1707"
general
weight: 0.35
ychampion
Summary
Related to #1706.
This PR extends API discovery so clients can find available types and inspect their schemas without listing CRD objects or resource instances. The motivating case is a kcp consumer workspace, but the tools use standard Kubernetes discovery and OpenAPI endpoints.
api_resources_listwith unfiltered inventory and optional filters. Results are paginated within a 16 KiB application-JSON budget.api_resources_explainfor full schemas or selected field paths. Responses exceeding 24 KiB identify omitted branches and provide arguments for narrower reads.apiVersionrather than guessing.Both tools respect
denied_resources. The budgets were informed by reviewing client tool-output handling and representative CRD schemas; they are starting points rather than assumed optimal limits.Compatibility
Existing exact-kind
api_resources_listcalls remain supported. Clients should follow continuation tokens when they need the complete inventory.The shared error conversion retains explicitly supplied text and structured content together, so text-only clients receive discovery recovery details.
Existing Kubernetes Status error output is preserved.
Tests
go test -count=1 ./pkg/kubernetes ./pkg/toolsets/core ./pkg/mcpmake build, including lint.The implementation was also tested against our kcp-based cluster. The automated tests use fixtures and MCP integration coverage; they do not currently include a real-kcp integration suite.