Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#141 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@satvikkk ci sta già lavorando.

Dal 16/2/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.

Lingua principale
TypeScript
Stelle
794
Fork
58
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di gemini-cli-extensions/security

Tutte le issue di gemini-cli-extensions/security

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.