feat: warn when knowledge graphs are stale#558
Merged
Conversation
jiang4wqy
marked this pull request as ready for review
July 10, 2026 08:16
Contributor
Author
Collaborator
|
Thank you @jiang4wqy |
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.
Why
Understand Anything graphs are snapshots. After source files or Git history change, the dashboard and graph-consuming skills could continue presenting old relationships without telling the user. This addresses item 3 of #413: graph staleness was silent.
What the initial PR version missed
The first version established the warning path, but its freshness model was too narrow for real repositories:
HEAD, so staged, unstaged, and untracked source changes were invisiblebehind,ahead, anddivergedhistoriesgit diffwithout first resolving it as a commitWhat this revision adds
Core freshness engine
fresh,dirty,stale, orunknown, with structured reasons instead of guessing.understand-anything/outputbehind,ahead, anddivergedhistoriesDashboard behavior
/staleness.jsondata with sanitized failures andCache-Control: no-storefocusVITE_STALENESS_URLis explicitly configuredSkill preflight and release metadata
understand-chat,understand-diff,understand-domain,understand-explain, andunderstand-onboardgit rev-parse --verify --end-of-optionsbefore using it2.8.2to2.8.3Scope
This PR detects and explains stale graphs; it does not silently regenerate them. Regeneration remains an explicit
/understandor/understand --forceaction so opening or refocusing the dashboard cannot trigger expensive analysis unexpectedly.Related work
Validation
Final publish branch after merging current
main:pnpm lintpnpm --filter @understand-anything/core buildpnpm --filter @understand-anything/skill buildpnpm buildpassedgit diff --check origin/main..HEADpassedchild_processruntime importManual browser validation used a real repository graph with 432 tracked files, 97 nodes, 183 edges, and 7 layers. Dirty, stale, and fresh transitions updated on window focus without reload; the changed-path summary and 390 px mobile layout were also checked.