[Feature Request - Codemaps] Deduplicate Structural Graph Edges and Augment with Metadata (Call Sites)
@satvikkk đang làm issue này rồi.
Từ ngày 16/2/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
In the codemaps GraphService unconditionally adds an edge each time a parser detects a relationship (e.g., calls, imports). If a function calls the fs module 10 times, the parser emits 10 identical structural edges into the JSON payload. While this captures raw control flow, it significantly inflates the token size of the graph output for LLM agents and creates redundant noise during traversal.
Problem Statement: When an MCP agent queries the AST graph to understand the architecture or look for security boundaries, the identical duplicate edges are inefficient:
- Token Bloat: Sending 50 identical
A -> Bedges wastes LLM context window limits. - Analysis Complexity: Graph algorithms run slower and need manual filtering if traversing a multigraph.
**Proposed Solution:**The backend GraphService should natively de-duplicate edges between the same conceptual source and target nodes, but preserve the frequency and location metadata. Instead of an array of redundant edges, the graph JSON for an edge would look like this:
{ "source": "src/index.ts:scan_dir",
"target": "module:fs",
"type": "calls",
"weight": 3,
"locations": [
{"line": 28, "snippet": "await fs.readdir"},
{"line": 34, "snippet": "await fs.stat"},
{"line": 45, "snippet": "await fs.realpath"}
]
}
**Why this matters for Agents:**By collapsing edges but enriching them with target telemetry (like code snippets and varying lines), the structural architecture answers "Who interacts with whom?" exactly once. If a security agent spots a dangerous data cross (e.g. untrusted input -> exec), it can immediately inspect the locations array attached to that single edge to launch a direct pinpoint audit without re-parsing the entire codebase.
Implementation Details:- Update add_edge() in GraphService to check if a {source, target} pair already exists.- If it does, push the new line references into the locations array and bump the weight.
Note: This is dependent on the CodeMaps tool.
- Ngôn ngữ chính
- TypeScript
- Star
- 794
- Fork
- 58
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 gemini-cli-extensions/security
-
HelpĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 10/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
gemini-cli-extensions/security#133 · 3 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
gemini-cli-extensions/security#102 · 5 bình luận ·
Tất cả issue của gemini-cli-extensions/security
Issue tương tự
-
bug via-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
pingdotgg/t3code#14452 · 1 bình luận ·
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 75/100
solana-foundation/program-examples#747 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 9 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
remotion-dev/remotion#11847 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openwatersio/slackwater#355 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
melgarafael/DeskcommCRM#1998 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày