feat(#5907): surface reindex-after-upgrade in dashboard + doctor + update#5911
Merged
Conversation
…index-status API + feed (#5907 FIX3) The web dashboard's GET /api/v2/groups/{group}/index-status endpoint dropped statusfile.File's ReindexRequired/ReindexReason when building indexStatusRepo, so a repo whose graph.fb was stamped by an older grafel build read as an idle row — a silent multi-minute stall from the frontend's point of view, even though the engine's FIX2 loop-guarded auto-reindex had already enqueued a fix. - indexStatusRepo now carries ReindexRequired/ReindexReason verbatim, plus a derived `status` field (idle/indexing/enhancing/reindex-required/ reindexing-after-upgrade) so the frontend doesn't have to re-derive the same precedence from four booleans. - webui-v2: threaded reindexRequired/reindexReason through ProgressRow / ProgressGroup / the status-plane join, and added a warning-tone "reindex required" / "reindexing after upgrade" badge to IndexProgressFeed's per-repo and monorepo-group rows, mirroring the existing "enhancing" badge. Report-only surfacing slice of #5907 — no engine/trigger logic changes.
…rade (#5907 FIX4) Adds Check 9 to `grafel doctor`: scans every registered repo (across every group) via graph.ReindexRequiredReason(daemon.StateDirForRepo(repo.Path)) and reports (Info severity) when one or more repos' on-disk graph.fb was written by an older grafel build than this binary supports. Report-only by design: the engine's FIX2 auto-reindex arm (internal/daemon/stale_reindex.go's loop-guarded maybeEnqueue) already owns enqueueing the fix, so doctor must not duplicate that decision — it only makes the otherwise-silent post-upgrade reindex visible in doctor output. Tests (internal/install/reindex_required_test.go) reuse the writeOldFormatGraphFB fixture technique from internal/graph/reindex_required_test.go to fabricate a stale-format graph.fb without an actual old binary, and cover: stale repo reported with summary + per-repo drift line, current-format repo not reported, no registered groups not reported.
#5907 FIX4) RunUpdate now reports, after the daemon restart + version probe (RunCopy), how many registered repos need a reindex after this format upgrade (UpdateResult.ReposNeedingReindex), via the same graph.ReindexRequiredReason(daemon.StateDirForRepo(path)) check doctor uses. `grafel update`'s CLI summary prints "N repo(s) reindexing after upgrade" when non-zero. Report-only: RunUpdate never enqueues a reindex itself — the engine's own loop-guarded auto-reindex arm (internal/daemon/stale_reindex.go) already owns that once the restarted daemon's next heartbeat observes the mismatch. This just prevents the reindex from looking like a silent stall right after `grafel update` returns. Tests (internal/install/update_reindex_test.go) register a fake group/repo against the same GRAFEL_HOME/XDG_CONFIG_HOME the existing update tests use, fabricate a stale-format graph.fb (writeOldFormatGraphFB technique from internal/graph/reindex_required_test.go), and cover both the stale-count and current-format-no-count cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Surfacing slice of #5907 — makes the stale-format auto-reindex (engine core merged in #5910) VISIBLE instead of a silent multi-minute stall. Report/display only; no engine/trigger logic touched.
FIX3 — web dashboard:
indexStatusReponow carriesReindexRequired/ReindexReason(previously dropped) + a derivedStatus(idle/indexing/enhancing/reindex-required/reindexing-after-upgrade). webui-v2 threads it through and shows a warning-tone badge per-repo + on the monorepo group header, mirroring the existing "enhancing" badge.FIX4 — doctor: new report-only Check 9 (
checkReindexRequired) scanning registered repos viagraph.ReindexRequiredReason.FIX4 — update:
UpdateResult.ReposNeedingReindexpopulated post-restart; CLI prints "N repo(s) reindexing after upgrade" (FIX2 already enqueues — this is report-only, no duplicate trigger).Skipped the optional
FormatUpgradeReason— the derivedStatusalready distinguishes reindex-required vs reindexing-after-upgrade without touching load.go.Verified: display/report-only (no engine/trigger files touched),
deriveIndexStatusprecedence correct, gofmt/build/vet clean, dashboard+install+cli tests green.🤖 Generated with Claude Code
https://claude.ai/code/session_017quGgaqK7NRoxGT6BTqV2o