Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Feature Request - Codemaps] Deduplicate Structural Graph Edges and Augment with Metadata (Call Sites)

オープン
#141 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

@satvikkk がすでに取り組んでいます。

2026年2月16日 から。

評価

この issue はまだ評価されていません。

説明

enhancement

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:

  1. Token Bloat: Sending 50 identical A -> B edges wastes LLM context window limits.
  2. 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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

gemini-cli-extensions/security のほかの issue

gemini-cli-extensions/security の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。