[Feature Request - Codemaps] Deduplicate Structural Graph Edges and Augment with Metadata (Call Sites)
@satvikkk ya está trabajando en esto.
Desde el 16/2/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 794
- Forks
- 58
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de gemini-cli-extensions/security
-
HelpAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 10/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
gemini-cli-extensions/security#133 · 3 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
gemini-cli-extensions/security#102 · 5 comentarios ·
Todos los issues de gemini-cli-extensions/security
Issues similares
-
Mend: dependency security vulnerability untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
opensearch-project/security-dashboards-plugin#2545 ·
Los mantenedores suelen responder en 1 día
-
Add: Dream TR SDAbiertocheck:passed streams:add
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
doctor integrity sample scans soft-deleted pages on Postgres (batch path has no deleted_at filter)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
SocialGouv/egapro#4672 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
area:agents area:tui bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
anthropics/claude-code#98358 ·
Los mantenedores suelen responder en 1 día