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

Upgrade leaves stale state: save_manifest and --force both merge instead of replacing

Aperta
#3,581 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@SrijanSriv ci sta già lavorando.

Dal 6/10/2026.

  • #4175 di @SrijanSriv — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Trace the save_manifest path and the graphify update --force path, focusing on how manifest.json and graph.json are loaded and written. Reproduce the upgrade from project path A to path B, then verify that rewritten manifests and forced graph updates do not retain stale entries; check node and hyperedge counts and unresolved source_file paths.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

Upgrading in place from 0.5.4 → 0.9.62 leaves stale state behind in two separate places,
because both manifest.json and graph.json are merged into rather than replaced. The result
is a graph that keeps entries pointing at files that no longer exist at those paths, indefinitely,
with no warning.

The graph.json half is the more damaging of the two, and it survives --force.

1. save_manifest merges, so stale keys are never dropped

Before the upgrade, manifest.json held 38 keys, all absolute paths. After the upgrade wrote
new repo-relative keys, the file held 301 — the 263 new relative keys plus all 38 stale
absolute ones
. Nothing was removed.

So one file ends up describing the same tree twice, under two different key conventions, and the
stale half never expires.

Workaround: delete manifest.json before the first update. Doing so produced a clean
263 keys, 0 absolute, confirming the new code path is correct and only the merge is at fault.

2. graphify update --force merges graph.json too — this is the bigger one

--force reads as "discard and rebuild", and the guard message reinforces that reading:

WARNING: new graph has 4809 nodes but existing graph.json has 8473.
Refusing to overwrite — you may be missing chunk files from a previous session.
Pass --force to override.

It does not discard. Measured against a byte-identical backup of the pre-force graph.json:

count
nodes after --force 4809
of those, already present before 3708
newly created this run 1101
dropped 4765

Among the survivors, 219 nodes carry an absolute source_file under a directory the project was
checked out at previously and no longer is
. Zero of those 219 were newly created — every one
is a carry-over. They cannot be regenerated, because nothing exists at those paths now; they can
only persist.

Deleting manifest.json does not help here, because these live in graph.json.

Why this is worth fixing rather than documenting

  • The guard counts nodes only. On another repo in the same rollout the node count rose 61%
    while hyperedges fell 81% — the headline number hid the loss entirely. A merge that silently
    preserves unreachable nodes makes that harder to notice, not easier.
  • A tool that reports a knowledge graph of a codebase is expected to describe the current
    codebase. Nodes keyed to a path the code has not lived at for months are indistinguishable, to a
    consumer of graph.json, from live ones.
  • The only reliable remedy found was rm -rf of the whole output directory and a full rebuild,
    which also discards every LLM-derived rationale node — an expensive price for what reads like
    a cache-invalidation bug.

Reproduction

  1. On 0.5.4, build a graph for a project at path A.
  2. Move or re-clone the project to path B.
  3. Upgrade to 0.9.62.
  4. graphify update <B> → the guard refuses (fewer nodes without an LLM run, since rationale
    nodes cannot be reproduced).
  5. graphify update <B> --force.
  6. Inspect graph.json: nodes whose source_file still begins with path A are present, and
    none of them are new.

Expected

  • save_manifest replaces the manifest for the paths it rewrites, rather than unioning old and
    new key conventions.
  • --force replaces the graph, or the flag/message says plainly that it merges and that stale
    nodes are retained.
  • Ideally, nodes whose source_file no longer resolves are pruned on rebuild regardless of flag.

Environment

  • graphify 0.9.62 (upgraded in place from 0.5.4), installed as a uv tool
  • macOS, Python 3.14
  • Python project, ~160 source files, AST-only extraction (no LLM key configured at update time)
Lingua principale
Python
Stelle
124k
Fork
11.9k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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

Tutte le issue di Graphify-Labs/graphify

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.