Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#141 0 comentarios 0 reacciones 1 asignado Ver en GitHub

@satvikkk ya está trabajando en esto.

Desde el 16/2/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
794
Forks
58
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de gemini-cli-extensions/security

Todos los issues de gemini-cli-extensions/security

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.