fix(knowledge-pages): show exact freshness in page detail - #3325
Open
Sanderhoff-alt wants to merge 1 commit into
Open
fix(knowledge-pages): show exact freshness in page detail#3325Sanderhoff-alt wants to merge 1 commit into
Sanderhoff-alt wants to merge 1 commit into
Conversation
The page detail already fetches its backing model for provenance. Use its exact staleness result for the page badge, falling back to the tree's bank-wide approximation until it is available.
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
The Knowledge Pages tree reports freshness using a bank-wide write watermark. That is intentionally conservative: a page can be marked
is_stale: trueeven when the new memory is outside the page's scope.When a page is opened, the control plane already fetches its backing mental model to show provenance. That response includes the exact scope-aware
is_stalevalue, but the page header was still reading the tree's approximate value. As a result, a page could show “May need refresh” in its detail view even when its exact freshness check reported that it was current. This makes the detail view appear inconsistent and reduces trust in the status indicator.What changed
This makes the detail view use information it already retrieved, so there is no additional request or database cost. It does not attempt to change the tree's deliberately conservative semantics.
Verification
./scripts/hooks/lint.shnpm test(119 tests)