RHOAIENG-96075: Add modular host contracts for namespace, authorization, capability discovery, and gateway access #10029
All Vouch review confidence checks passed
Residual risk 0.32 = Change Risk (0.80) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.80 · 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
Sensitive Paths
sensitive_paths
0.080
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #10029"
general
weight: 0.35
paulovmr
<!--- If this is a non-code change, this template is not required; reference any issues or top-level descriptions as needed -->
<!--- All code change PRs should relate to an issue, reference it here; see example below -->
<!--- https://issues.redhat.com/browse/RHOAIENG-123456 -->
https://redhat.atlassian.net/browse/RHOAIENG-96075
## Description
Add modular host contracts for namespace resolution, authorization, resource capability discovery, and gateway access. Migrate llmd-serving to these contracts so it no longer relies on legacy namespace, SSAR, or generic proxy utilities for these operations.
The implementation follows [package-topology.md](/docs/package-topology.md): distribution hosts compose services,
plugin-coreowns package-neutral contracts,k8s-coreprovides stateless Kubernetes utilities, andmodel-servingowns gateway domain behavior. llmd-serving depends on the serving hub and core packages, not thesibling KServe package.
Key changes:
| Area | Changes |
|------|---------|
| Host contracts | Wire namespace, strict access-review, and discovery services into RHOAI and RHAII. Keep the operator namespace separate from deployment projects. |
| Authorization | Add fail-closed access-review states and operation-specific permissions for llmd configuration routes and actions. Preserve unrelated legacy access-check behavior. |
| Capability discovery | Activate llmd functionality only when the required API is available and the caller has list/watch access in a supported scope. Handle loading, missing, forbidden, and error states without leaving routes indefinitely loading. |
| llmd integration | Remove the KServe package dependency and use hub-only activation. Gate create, duplicate, edit, toggle, and delete operations with their exact resource permissions. |
| Gateway access | Add an optional hub-owned gateway service. Constrain both backend implementations to the fixed GET operation with a validated namespace, preserve caller identity and gateway metadata, and support request cancellation. |
| Documentation | Update package and backend documentation with ownership boundaries, activation requirements, gateway behavior, and the permission inventory. |
## How Has This Been Tested?
Validation completed after rebasing:
-
pnpm install --frozen-lockfile— passed.- Scoped type checking — all 16 tasks passed.
- Scoped source lint and Cypress lint — passed with existing warnings only.
- Scoped unit tests across affected workspaces and dependencies — 6,102 tests passed.
- Core BFF API and proxy tests —
go test ./internal/api ./internal/proxypassed.- Core BFF contract tests — 236 tests passed across OpenShift and XKS.
- RHAII production build, RHOAI Cypress host build, and model-serving federated build — passed with existing bundle-size warnings.
- Existing llmd Cypress mock coverage — all 6 specs passed, totaling 97 tests.
- Checked package boundaries and built Module Federation manifests for the required shared contracts.
-
git diff --checkpassed; the rebase preserved the implementation patch.To rerun the llmd Cypress mock suites, run from
packages/cypressagainst the configured Cypress host:Manual UI and live-cluster verification have not been performed.
Test Impact
Added or updated unit, backend, and contract coverage for:
- Exact SSAR attributes, limited-access users, denied/error responses, cancellation, and stale-result handling.
- Capability discovery and activation states, project-scoped authorization, and initial route loading.
- Operation-specific llmd permissions, including editing without create permission.
- Both distribution host adapters and shared-context identity.
- Gateway metadata validation, optional-service failures, caller identity forwarding, and rejection of unsupported paths, methods, or query parameters.
Shared Cypress fixtures were updated, and the existing llmd mock suites were rerun. No new Cypress specs were added.
Request review criteria:
<!--- This PR will be merged by any repository approver when it meets all the points in the checklist -->
<!--- Go over all the following points, and put an
xin all the boxes that apply. -->Self checklist (all need to be checked):
If you have UI changes:
<!--- You can ignore these if you are doing manifest, backend, internal logic, etc changes; aka non-UI / visual changes -->
After the PR is posted & before it merges:
main<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Added gateway discovery for a selected namespace and LLM-d sample configuration retrieval for supported topologies.
LLM-serving features now check whether required resources are available and permissions are granted before becoming available.
Improvements
Configuration create, edit, duplicate, delete, and enable/disable controls now reflect your permissions. Unauthorized actions are hidden or disabled.
Model-serving requests are limited to gateway discovery and supported sample configurations; unsupported paths, methods, and query parameters are rejected.
* Kubernetes resource discovery and access checks use the caller’s identity. Gateway selectors remain disabled when gateway data cannot be loaded.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->