[Feature Request - Codemaps] Deduplicate Structural Graph Edges and Augment with Metadata (Call Sites)
@satvikkk がすでに取り組んでいます。
2026年2月16日 から。
評価
この issue はまだ評価されていません。
説明
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.
- 主要言語
- TypeScript
- スター
- 794
- フォーク
- 58
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
gemini-cli-extensions/security のほかの issue
-
Helpオープン
難易度 1/5 1時間未満 初心者へのやさしさ 10/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
gemini-cli-extensions/security#133 · コメント 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
gemini-cli-extensions/security#102 · コメント 5 件 ·
gemini-cli-extensions/security の issue をすべて見る
似ている issue
-
area/frontend good first issue kind/cooldown
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
voidzero-dev/oxc-angular-compiler#511 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
langchain-ai/deepagentsjs#898 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
anomalyco/models.dev#8509 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug documentation P2 UI/UX
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信