Skip to content

Rank mention relevance across resource sources - #2203

Open
brsbl wants to merge 5 commits into
mainfrom
bb/mention-relevance-core-thr_94xb8a4nk2-v3
Open

Rank mention relevance across resource sources#2203
brsbl wants to merge 5 commits into
mainfrom
bb/mention-relevance-core-thr_94xb8a4nk2-v3

Conversation

@brsbl

@brsbl brsbl commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

What was wrong

The composer combined mention sources in fixed source order while each resource type applied its own matching policy. An exact identity match from a later source could therefore lose to a weaker match from an earlier source, and grouped rendering could drift from the flat order used for keyboard navigation.

What changed

@bb/client-core now owns one generic MentionCandidate model for every resource source. The app adapter normalizes threads, projects, sections, paths, and plugin results into visible identity, additional identity terms, supporting text, and a rendered group before applying one relevance policy:

  1. Exact visible-title or identity match
  2. Identity prefix match
  3. Identity substring match
  4. Supporting-text match
  5. Remaining results

Rows keep their source group intact, groups are ordered by their strongest candidate, and original source order remains the final tie-breaker. The resulting grouped model and flattened suggestion list are produced together, so rendered sections and keyboard navigation share the same canonical order. MentionMenu now renders that shared group model instead of rebuilding sections by resource kind.

Plugin identity aliases are only one input to the generic model. The additive experimental PluginMentionItem.experimental_searchAliases field lets a provider expose bounded identity terms without supplying policy-bearing numeric ranks. The server validates at most eight non-empty aliases of at most 256 UTF-8 bytes each and normalizes omission to an empty internal list. Missing wire data remains compatible with older providers and persisted responses.

There are no removals or meaning changes, no SDK/version/engine-floor change, and no server/daemon protocol change. The current web and PWA composers share this implementation path.

How you verified

  • Rebased conflict-free onto main ad79bbb5ec909524f8f281e62d860c588a86f332; exact PR head is bbf34d7960901ca6c5506efec32d552c4b5f4d5d.
  • Turbo test and typecheck: client core 21 files / 249 tests; app 441 files / 3,440 passing tests with 3 skipped; all 7 tasks passed.
  • Turbo lint: 0 errors; 173 existing app warnings.
  • git diff --check passed for the exact layer.
  • The exact main and core-layer desktop dev apps used the same fictional project, installed-provider fixture, route, query, and 1280×900 native window bounds. Five repeated query cycles, four viewport captures, and transition widths 389/390/391, 767/768/769, 1023/1024/1025, and 1919/1920/1921 all passed with no horizontal overflow. Full immutable evidence manifest.

Before — fixed source order puts the weaker project match first

Before: Projects / Automations project appears above Installed / Automations

After — generic relevance puts the exact installed identity first

After: Installed / Automations appears above Projects / Automations project

Fixes: no issue; this is the generic mention-relevance foundation for the @Plugin reference layer.

BB-Thread-ID: thr_94xb8a4nk2

AGENT GENERATED: by GPT-5.6

@brsbl
brsbl force-pushed the bb/mention-relevance-core-thr_94xb8a4nk2-v3 branch from 1e6fe7c to f1f39af Compare August 21, 2026 22:37
@brsbl
brsbl force-pushed the bb/mention-relevance-core-thr_94xb8a4nk2-v3 branch from f1f39af to bbf34d7 Compare August 27, 2026 07:51
@brsbl brsbl changed the title Rank exact plugin identities across mention sources Rank mention relevance across resource sources Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant