Improve [[ wiki-link ("@mention") autocomplete ranking to surface…#275
Merged
Conversation
…(#2116) * feat(open-knowledge): bias @mention autocomplete toward page context The [[ wiki-link page picker now re-ranks suggestions by link-graph context: the page being edited and its incoming/outgoing link neighbors are boosted, and docs under skill/tooling folders (.agents, .claude, .cursor) are deprioritized as knowledge-base noise (demoted, not excluded). Applies to both the initial (empty-query) list and typed queries. Ranking is captured once per [[ session from /api/forward-links + /api/backlinks; failures degrade gracefully to no-context ordering. The shared workspace search (command palette, full-text, MCP) is untouched. * fix(open-knowledge): drop unused loadWikiLinkContext export (knip) * fix(open-knowledge): address local review on @mention ranking - Extend context-aware [[ ranking to the source-mode (CodeMirror) picker so it stays in lockstep with WYSIWYG (threads docName through createNestedCMExtensions; TTL-cached link context). Restores the documented lockstep invariant in wiki-link-source.ts. - Add tests for loadWikiLinkContext: outgoing/incoming merge, external-link exclusion, self-link dedupe (current-page boost vs neighbor boost), HTTP-error and malformed-body degradation; plus a >8-page test that pins the widened candidate window. - Re-export loadWikiLinkContext (now consumed by source-mode + tests; resolves the prior knip unused-export). - Log on !r.ok in the link fetchers so a 5xx is distinguishable from a linkless page; guard the (currently unreachable) allSettled context-rejection arm. - Clarify the boost-magnitude comment (full sort key is lexical + fullText*20) and document that the skill-folder list is intentionally narrow (not the broad hidden-doc predicate). GitOrigin-RevId: b58ecdb6673dc4370c69942c4091d2b884772b6e
Contributor
There was a problem hiding this comment.
Automated approval from agents-private public-mirror-sync (run: https://github.com/inkeep/agents-private/actions/runs/28195332834). Source of truth is the monorepo; direct edits on inkeep/open-knowledge are overwritten on next sync.
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.
Improve
[[wiki-link ("@mention") autocomplete ranking to surface the most relevant link targets first. The page you're editing and its link-graph neighbors (incoming and outgoing links) are now boosted, so opening the picker leads with the pages you're most likely to link to; docs under skill/tooling folders (.agents,.claude,.cursor) are deprioritized as knowledge-base noise (deprioritized, not hidden — a skill still appears when it's the best match). Both the WYSIWYG and the source-mode[[pickers re-rank in lockstep. Ranking for the command palette, full-text, and MCP search is unchanged.