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

[Bug]: graph_diff reports "no changes" when a call is reversed (skill --update summary)

Cerrado
#4,067 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

  • #4170 de @Mpasha17 — cerrado sin fusionar

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
devtools

Línea de trabajo

Start at analyze.graph_diff and run the two-file reproduction from the issue, then inspect tools/skillgen/fragments/references/shared/update.md and the aider and devin core fragments. Check how the skill loads G_old, including paths.load_node_link_graph, and use the mentioned regression test as the guide. Done means a reversed call reports one new and one removed edge with correct source and target while no-edit and line-shift cases remain unchanged.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Pre-flight checks
  • I have checked the Troubleshooting section in the README
What happened?

analyze.graph_diff reports no changes when a call reverses (a calls b becomes b calls a). The skill's --update flow uses it for the "what changed" summary (tools/skillgen/fragments/references/shared/update.md, plus the aider and devin core fragments). A reversed call is therefore invisible to the user.

There are two causes:

  1. graph_diff keys undirected edges by sorted endpoint pair, so a→b and b→a produce the same key.
  2. The skill loads G_old with a plain json_graph.node_link_graph() call, which loses the arc-order direction (see #4066). So even a direction-aware diff would have nothing to compare.

Expected: a reversed call shows as one removed and one new edge, with the correct source/target.

Measured through the skill's own code on a two-file project:

Edit Shown on 0.9.75 Expected
no edit no changes no changes
call reversed no changes 1 new, 1 removed edge
lines inserted above functions no changes no changes
new call added 1 new edge 1 new edge

Low severity: it only affects the update summary, not the graph.

Steps to reproduce
python - <<'EOF'
import networkx as nx
from graphify.analyze import graph_diff

def g(src, tgt):
    G = nx.Graph()
    G.add_node("normalize", label="normalize()")
    G.add_node("tokenize", label="tokenize()")
    G.add_edge(src, tgt, relation="calls", _src=src, _tgt=tgt)
    return G

print(graph_diff(g("tokenize", "normalize"), g("normalize", "tokenize")))
EOF
Error output or graph output
{'new_nodes': [], 'removed_nodes': [], 'new_edges': [], 'removed_edges': [], 'summary': 'no changes'}
Graphify version

0.9.75 (v8 @ 48d7c0e)

Operating System

Linux

Python Version

3.12

Installation Method

built from source (git clone)

Additional Environment Details

No provider environment variables set. Reproduced on a clean checkout.

Additional context

Proposed fix (I'm happy to send a PR after #4066):

  • Count an edge as reversed only when both graphs carry _src/_tgt and the markers differ. In that case it appears in both new_edges and removed_edges.
  • Report source/target from the markers.
  • Have the skill fragments load G_old through paths.load_node_link_graph and regenerate them with skillgen.

Gating on markers keeps today's output for callers that don't stamp them, which matters for the proposed public graph_diff in #164. The naive fix (key every edge by _src/_tgt) gives false positives today, because G_old comes back without markers.

Prototyped with a regression test that fails on v8 and passes with the fix. The no-edit and line-shift cases above still report no changes.

AI disclosure: I investigated this and wrote the reproduction and prototype with Claude Code (Claude Opus 5.5), and verified them myself.

Lenguaje dominante
Python
Estrellas
124k
Forks
11.9k
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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 Graphify-Labs/graphify

Todos los issues de Graphify-Labs/graphify

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.