aft
aft copied to clipboard
Call-graph store from a previous version is unreadable after upgrade and never rebuilt or removed for non-git roots
AFT: 0.62.0 (upgraded from 0.61.0), OpenCode 2.1.1, macOS. Session root is a plain folder containing several git repos (not itself a repo). views off, no daemon.
What happens
BUILD_OUTPUT_VERSIONchanged fromv18-rust-static-value-references(0.61.0) tov19-position-independent-node-identities(0.62.0) incallgraph_store/mod.rs.- The existing 864 MB store for that root was built by 0.61.0, so
database_ready()returns false andopen_readonlyreturnsNone. - Non-git roots skip the configure-time call-graph build (
commands/configure.rs, "on-demand"), so nothing rebuilds it until anaft_callgraphcall triggers a full cold build. Nothing removes the stale store either. - Meanwhile every engine start logs
tier2 dead_code: callgraph store unavailable … reporting callgraph_unavailableand tier-2 runsbuild_ready … files=0 contributions=0for its categories (~9 s CPU at start for this root). - When a rebuild does happen it writes a second ~0.9 GB generation before the old one is collected.
Expected
After an upgrade that changes the store format, the old store is rebuilt in the background or removed, and aft_inspect says dead-code results are unknown rather than looking clean.
Suggestions
- On fingerprint mismatch, delete the old store (or schedule a background rebuild for roots that had one).
- Surface "call graph unavailable / rebuilding" in
aft_inspectoutput for dead code and unused exports.
Small related item
if removed_any {} in callgraph_store/mod.rs is an empty no-op, so the orphaned-temp sweep never logs what it removed.
Related: #746 (rebuild on start), #606 (call graph while building).
Shipped in 0.63.4 (outdated non-Git call-graph caches are rebuilt). Thanks!