Upgrade leaves stale state: save_manifest and --force both merge instead of replacing
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- python
- 領域
- cli, data-engineering
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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)
- 主要言語
- Python
- スター
- 124k
- フォーク
- 11.9k
- 平均マージ
- 2時間 35分
- マージ済み PR(30日)
- 6
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Graphify-Labs/graphify のほかの issue
-
[Bug]: valid JSON with the wrong global-manifest shape bypasses recovery対応中かも @azizur100389 が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
Graphify-Labs/graphify#5020 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: malformed learning sidecar data can hide valid annotations対応中かも @azizur100389 が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Graphify-Labs/graphify#5019 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: graphify update skips or partially rebuilds a missing graph when the manifest survives対応中かも @azizur100389 が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
Graphify-Labs/graphify#5016 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
Graphify-Labs/graphify#5006 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
extract --out <dir>: semantic cache never saved, docs missing from manifest (relative source_file resolved against --out)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Graphify-Labs/graphify#4831 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
Graphify-Labs/graphify の issue をすべて見る
似ている issue
-
[BUG]: Compliance rules never see Unity Catalog views as views対応中かも @wagnercsantos が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
databrickslabs/ontos#1348 ·
メンテナーはふだん 3 日以内に返信
-
`forum_pr_poster` action will always return `none` when checking for pre-existing feedback threads, even if a feedback thread already exists.対応中かも @pgmzeta が今日担当しました。 オープンE-Verified P-Major
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
goonstation/goonstation#28259 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
woonstadrotterdam/monumenten#70 ·
メンテナーはふだん 15 日以内に返信
-
binding:python bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
The Browser tab fails with a Wayland error when Open Terminal runs from a Wayland desktop sessionオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
open-webui/open-terminal#210 ·