OCPEDGE-2650: Add pagination, filtering, response trimming, and field projection #13
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.57) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.57 · 650 lines diff across 8 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.388
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #13"
general
weight: 0.35
jeff-roche
Summary
ReshapeJSONfor field controllimit/page) on every domain tool; client-sidePaginateArraywith 5-minuteResponseCachefor endpoints that ignore server-side paginationfieldsparam on every domain tool for LLM-driven response projection, withget_tool_fieldsdiscovery toolinclude_metricstoggle on test report tools (default off)--cache-ttlflagCloses #4
🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
This PR extends the existing PR description with concrete implementation and test details, plus tooling/eval config updates already present in the change set.
What's new / concrete implementation details (additive)
- Implemented JSON shaping helpers and many typed response structs in pkg/client/types.go:
- FilterFields(), PaginateArray(), generic ReshapeJSON[T](), ReshapeTestReport(), and ToolFieldRegistry().
- Added many endpoint-specific types (JobRunRow, JobRunsResponse, JobReportRow, TestReportRow with custom UnmarshalJSON, Regression, RegressionMatch, PRTestResult, PayloadTestFailure, ReleaseHealth/HealthResponse, ComponentReadinessResponse, SearchResponse, etc.)
- ReshapeTestReport supports include_metrics toggling and nested metrics extraction.
- New ResponseCache in pkg/client/cache.go with NewResponseCache(ttl) and GetOrFetch(key, fetch) for optional, concurrency-safe caching (nil receiver handled).
- Unit tests added in pkg/client/cache_test.go to validate caching, expiry, and error propagation.
- New domain tool get_tool_fields (pkg/tools/domain/fields.go) returning tool name and allowed fields via ToolFieldRegistry; registered into core tools and covered by pkg/tools/domain/fields_test.go tests.
- README and smoke tests updated to reflect get_tool_fields presence.
- Tests/CIs:
- get_ci_test_report, get_recent_test_failures, get_test_details: include_metrics and fields support; variant filtering added for test details.
- Jobs:
- get_job_report: configurable sort_field/sort_order (mapped to upstream sortField/sort) and fields trimming.
- get_job_runs: page support (forwarding/handling) and fields trimming; tests validate page conversion and trimming.
- Payloads:
- get_payload_status: limit param truncates tags via truncatePayloadTags.
- get_payload_diff and get_payload_test_failures: support limit/page and test_name filtering; use ResponseCache for client-side pagination when upstream lacks perPage; tests added.
- Pull requests:
- get_pull_request_impact: pagination (limit/page → perPage/page) and fields.
- get_release_prs (GetPullRequestsHandler): fetch full list into cache and apply client-side PaginateArray + fields.
- Components:
- get_regressions: limit/page/fields, uses cache.GetOrFetch and client-side pagination; GetRegressionDetailHandler reshapes and combines regression + matches.
- get_component_readiness: reshape to ComponentReadinessResponse and supports fields; README notes passing a view to avoid extra /views call.
- Releases:
- get_releases: fields param and ReshapeJSON usage.
- get_release_health: sections param (health, release_health) to request only needed endpoints and combine responses; fields supported.
- Search:
- search_ci_logs: added limit (mapped to maxResults) and fields; Search client updated to respect explicit type param (only default type=all when missing).
- CLI adds --cache-ttl flag (default 5m) and increases default upstream timeout from 30s → 60s (cmd/openshift-ci-mcp/main.go).
- Server Config gains CacheTTL (pkg/server/server.go) default 5m and constructs/propagates a ResponseCache into payload/PR tool registrations; core tools include get_tool_fields.
- Added extensive unit tests: pkg/client/types_test.go (reshape/pagination/filtering/ToolFieldRegistry), pkg/client/cache_test.go, pkg/client/searchci_test.go, many domain tool tests under pkg/tools/domain/_test.go covering pagination, filters, trimming, and parameter forwarding.
- New capturingSearchCI test double and updated guidance for test helpers (CONTRIBUTING.md, .agents SKILL.md).
- Smoke test adjustments to expect get_tool_fields and handle wrapped/paginated payloads.
- Split mcpchecker evals into domain-only and proxy-only evaluations:
- mcpchecker/domain-eval.yaml updated to use domain-mcp-config.yaml and removed proxy suite; increased maxToolCalls for tests/payload suites.
- New mcpchecker/proxy-eval.yaml and proxy-mcp-config.yaml created for proxy-specific evals (sippy_api required).
- Makefile: check target reorganized into check-domain and check-proxies; added check-all target; check-% rules adjusted to run domain-eval; check-proxies runs proxy-eval.
- SearchCI client now only defaults type=all when not provided; tests added to validate explicit type preserved.
- Guards added to PaginateArray and truncatePayloadTags to prevent panics/truncation errors on negative limits/pages.
- Increased default upstream timeout and exposed cache TTL flag.
- Split mcpchecker eval checks to avoid accidental proxy tool usage during domain evals.
Tests added/updated summary
Closing/issue
#4(Pagination and Filtering Improvements for Reduced Context Bloat).Notes for reviewers (concise)
<!-- end of auto-generated comment: release notes by coderabbit.ai -->