Repository navigation
fix(cross-repo): skip CROSS_HTTP_CALLS for calls the caller serves itself (#1459) - #2319
Merged
Merged
Conversation
…self (#1459) match_http_routes linked every outbound HTTP_CALLS to any other indexed project exposing the same method/path, without first asking whether the caller's own project serves that route. A repo whose own frontend calls its own API (the common case) got a cross-service edge to every other project that happens to expose the same path, e.g. /health or /api/users. Add a caller-local floor: before looking at the target, the pass checks whether the call is served in the caller's own project, and skips it if so. "Served" is a HANDLES edge on the Route node the HTTP_CALLS points at, or the same exact-method / ANY / template resolution already used for the target, applied to the caller's own store. The second check is needed on real input: a method-less fetch('/api/users') points at the __route__ANY__ node, while the local app.get handler sits on the __route__GET__ node. The target lookup is factored into resolve_route_handler() so both sides use one resolver. Since match_http_routes also runs in the provider-side (reverse) direction, the floor applies there too. Calls with no local handler still cross as before. Proof (dev binary, three small Express fixtures, api/mono both serving GET /api/users, mono and client both fetching it): mono -> [api] cross_http_calls 1 -> 0 client -> [api] cross_http_calls 1 -> 1 (control) api -> [mono, client] cross_http_calls 2 -> 1 Refs #1459 (the per-edge evidence/ambiguity shape and the opt-in gateway binding discussed there remain open). Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This was referenced Sep 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
match_http_routes linked every outbound HTTP_CALLS to any other indexed
project exposing the same method/path, without first asking whether the
caller's own project serves that route. A repo whose own frontend calls
its own API (the common case) got a cross-service edge to every other
project that happens to expose the same path, e.g. /health or /api/users.
Add a caller-local floor: before looking at the target, the pass checks
whether the call is served in the caller's own project, and skips it if
so. "Served" is a HANDLES edge on the Route node the HTTP_CALLS points
at, or the same exact-method / ANY / template resolution already used
for the target, applied to the caller's own store. The second check is
needed on real input: a method-less fetch('/api/users') points at the
route__ANY node, while the local app.get handler sits on the
route__GET node. The target lookup is factored into
resolve_route_handler() so both sides use one resolver.
Since match_http_routes also runs in the provider-side (reverse)
direction, the floor applies there too. Calls with no local handler
still cross as before.
Proof (dev binary, three small Express fixtures, api/mono both serving
GET /api/users, mono and client both fetching it):
mono -> [api] cross_http_calls 1 -> 0
client -> [api] cross_http_calls 1 -> 1 (control)
api -> [mono, client] cross_http_calls 2 -> 1
Refs #1459 (the per-edge evidence/ambiguity shape and the opt-in gateway
binding discussed there remain open).
Merge order: land this before the NestJS route PR for #1428. Touches
src/pipeline/pass_cross_repo.cnext to the #1133 PR (different hunks; agit merge-treedry run merges cleanly).