Upgrade leaves stale state: save_manifest and --force both merge instead of replacing
I maintainer di solito rispondono entro 1 giorno
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
- Ambito
- cli, data-engineering
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 ofgraph.json, from live ones. - The only reliable remedy found was
rm -rfof the whole output directory and a full rebuild,
which also discards every LLM-derivedrationalenode — an expensive price for what reads like
a cache-invalidation bug.
Reproduction
- On 0.5.4, build a graph for a project at path A.
- Move or re-clone the project to path B.
- Upgrade to 0.9.62.
graphify update <B>→ the guard refuses (fewer nodes without an LLM run, sincerationale
nodes cannot be reproduced).graphify update <B> --force.- Inspect
graph.json: nodes whosesource_filestill begins with path A are present, and
none of them are new.
Expected
save_manifestreplaces the manifest for the paths it rewrites, rather than unioning old and
new key conventions.--forcereplaces the graph, or the flag/message says plainly that it merges and that stale
nodes are retained.- Ideally, nodes whose
source_fileno 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Graphify-Labs/graphify
-
[Bug]: changed-files rebuild (hook/watch) evicts placeholder nodes for files that were never scannedForse già presa @rohit-jsfreaky l’ha presa 1 giorno fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
Graphify-Labs/graphify#4160 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
Graphify-Labs/graphify#3763 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Graphify-Labs/graphify#3638 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Graphify-Labs/graphify#3611 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Nix supportAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Graphify-Labs/graphify#3193 · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Graphify-Labs/graphify
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
Harmony OPeNDAP SubSetter (HOSS) Geographic LARC_CLOUD PREFIRE_SAT2_AUX-SAT R01 production
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
nasa/harmony-autotester#245 ·
-
[FEATURE] - Add UTVD supportApertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Deltares/imod-python#1928 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100