[WRONG BRANCH] routing: evaluate policy locality against effective provider destination - #20
[WRONG BRANCH] routing: evaluate policy locality against effective provider destination#20luvs01 wants to merge 1 commit into
Conversation
|
Warning Review limit reached
Next review available in: 2 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Comment |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Its title has been prefixed with |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 051e2dbaa4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (assessment.kind === "public" || assessment.kind === "hostname") { | ||
| return { remoteAllowed: true, localOnly: false }; |
There was a problem hiding this comment.
Keep unresolved hostnames as unknown locality
When a self-hosted provider uses a DNS name such as ollama.internal that resolves to loopback or RFC1918 space and is admitted with allowPrivateNetwork, assessUrlDestination returns hostname; these lines therefore assert remoteAllowed: true and localOnly: false without resolving it. This makes localOnly profiles reject valid local candidates and can make remoteAllowed profiles accept private ones. Keep hostname unknown here, or use DNS-resolved evidence, rather than treating every hostname as public.
Useful? React with 👍 / 👎.
|
Closing this public review surface. The effective-destination mismatch is real, but this patch classifies an unresolved hostname as remote-allowed and can therefore replace one locality error with another. A complete correction must keep unresolved/special destinations unknown and cover all local/public address classes, so it is being handled through private security review. |
Motivation
localOnly/remoteAllowed) from being satisfied by a stale or ignored configuredbaseUrlwhen the actual dispatch uses a registry-pinned destination.Description
effectiveProviderBaseUrlinsrc/providers/registry.tsto resolve the destination routing will actually use for a configured provider row.effectiveProviderBaseUrlinsrc/router.tswhen building the routed provider config so dispatch continues to validate the effective destination and warn about discarded configured URLs.src/routing/capability.tswith the canonicalassessUrlDestinationclassifier and evaluate locality evidence against the effective provider destination rather than the raw configuredbaseUrl.tests/policy-execution.test.tsthat verifies a registry-pinned remote provider with a stale loopbackbaseUrlcannot satisfy alocalOnlypolicy requirement.Testing
bun run typecheck, which completed successfully.bun run privacy:scan, which completed successfully.policy-executionregression passed (tests/policy-execution.test.ts).bun run test); the policy regression passed but a later unrelated provider outbound test timed out in the environment (the timeout is not related to these routing changes).