Rust HTTP client calls with a literal path are recorded as route registrations
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 76/100
Hướng nghiên cứu
Start with internal/cbm/service_patterns.c, src/pipeline/pass_parallel.c, and src/pipeline/pass_calls.c, then check the Rust seed data in internal/cbm/lsp/generated/rust_crates_seed.c. Reproduce with the provided src/lib.rs fixture and the index_repository and query_graph commands, expecting HTTP_CALLS edges and no route_registration. Add Rust-specific regression coverage while confirming axum, actix, and other languages retain their existing route-registration behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version
0.12.1. Also reproduced on main at f5f24739
Platform
Linux (x64)
Install channel
Built from source
Binary variant
standard
What happened, and what did you expect?
A Rust HTTP client call such as client.get("/v2/users") on a reqwest::Client is indexed as a server route registration: the enclosing function gets a CALLS edge with via: route_registration to a Route node __route__GET__/v2/users, as if it served that path. No HTTP_CALLS edge is produced, so the client's outgoing call is invisible to trace_path and to cross-repo matching, and the repo gains Route nodes it does not serve. This happens even when the receiver is typed through use reqwest::Client (local variable, &Client parameter, struct field).
Expected: an HTTP_CALLS edge from the calling function to the GET /v2/users route, the same shape a Python requests.get("/v2/users") produces, and no route registration.
Cause, as far as I can tell from the source: the callee does not resolve to a graph node (reqwest is an external crate), so classification falls back to the callee text. cbm_service_pattern_route_method() matches the .get suffix in route_reg_suffixes (internal/cbm/service_patterns.c), the call becomes CBM_SVC_ROUTE_REG, and find_route_path_in_args() accepts the slash-prefixed literal. The same fallback exists in emit_service_edge, emit_xlang_refused_route and the unresolved-callee branch in src/pipeline/pass_parallel.c, and in calls_emit_route_call in src/pipeline/pass_calls.c.
Possible fixes, for discussion:
- Classify by the Rust LSP's external target when there is one. The crate seed already has
reqwest.Client.getand.post(internal/cbm/lsp/generated/rust_crates_seed.c), andreqwestis an HTTP pattern, so such a call would become a typedHTTP_CALLSedge without guessing. I have not checked yet whether the LSP row still carries that QN when the fallback runs. - As a fallback for untyped receivers, a Rust-only guard: a verb-suffix call whose first argument is a path literal and that has no handler argument is not a registration. Rust frameworks register through
.route(...)(axum, actix),.at(...)(poem),web::resource(...)or attributes (actix, rocket), not through<receiver>.get("/path").
Either way the change would be limited to Rust, with regression tests showing that axum and actix .route(...) registrations and the existing suffix registrations in other languages are unchanged.
Reproduction
-
Code, a dummy crate with one file
src/lib.rs:use reqwest::Client; pub fn typed_local() { let c = Client::new(); let _ = c.get("/v2/users").send(); } pub fn typed_param(c: &Client) { let _ = c.post("/v2/orgs").send(); } pub struct S { client: Client } impl S { pub fn field(&self) { let _ = self.client.delete("/v2/sessions").send(); } } -
Commands, with an isolated cache:
mkdir -p /tmp/repro/src && git -C /tmp/repro init # lib.rs from step 1 in /tmp/repro/src export CBM_CACHE_DIR=/tmp/cbm-repro/cache CBM_RUNTIME_DIR=/tmp/cbm-repro/run codebase-memory-mcp cli index_repository --repo-path /tmp/repro codebase-memory-mcp cli query_graph --project tmp-repro \ --query "MATCH (a)-[r]->(b) WHERE b.label = 'Route' RETURN a.name, type(r), b.qualified_name, r" -
Result:
typed_local CALLS __route__GET__/v2/users {"callee":"c.get","url_path":"/v2/users","via":"route_registration"} typed_param CALLS __route__POST__/v2/orgs {"callee":"c.post","url_path":"/v2/orgs","via":"route_registration"} field CALLS __route__DELETE__/v2/sessions {"callee":"self.client.delete","url_path":"/v2/sessions","via":"route_registration"}Expected: three
HTTP_CALLSedges (GET, POST, DELETE) and noroute_registrationedges.
Logs
-
Diagnostics trajectory (memory / performance / leak issues)
-
Project scale (if relevant)
Not relevant (single-file reproduction).
Confirmations
- I searched existing issues and this is not a duplicate.
- My reproduction uses shareable code (a dummy snippet or a public OSS repository), not proprietary code.
- Ngôn ngữ chính
- C
- Star
- 45.8k
- Fork
- 3.8k
- Merge trung bình
- 2 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 108
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DeusData/codebase-memory-mcp
-
bug ux/behavior
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
DeusData/codebase-memory-mcp#3191 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation enhancement parsing/quality ux/behavior
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
DeusData/codebase-memory-mcp#3131 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
hook-augment: the five-row cap keeps the first five search_graph rows, so variables and modules displace function definitions (v0.12.1)Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug editor/integration parsing/quality ux/behavior
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
DeusData/codebase-memory-mcp#3062 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Generated client files (AGENTS.md block, SKILL.md) teach a call syntax no harness can executeĐang mởbug documentation editor/integration parsing/quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
DeusData/codebase-memory-mcp#3050 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
editor/integration parsing/quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
DeusData/codebase-memory-mcp#2286 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của DeusData/codebase-memory-mcp
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NVIDIA/open-gpu-kernel-modules#1635 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
iOS: the "Edit controls" button never hides, even with a controller connected, and covers the gameĐang mởgame: 010065A014024000 ios
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
seedds/nxnative#3714 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày