feat(skills): add vector-ranking skill - #3
Merged
Merged
Conversation
Discovery vector ranking spans two APIs — vocabularies and item taste are authored on Core, ranking happens on Discovery — so it gets its own skill rather than being split across query and mutation. New skill `vector-ranking` with three references: - vocabulary-authoring: vocabulary design, positional weights, upsertVocabulary, setItemTaste, key validation, publish, ignite, verify - ranking-signals: the five rankBy signals, the per-tenant field enums, normalization defaults, multi-value collapse, rankScore/rankExplain, rerank window - personalization: context.userTaste, magnitude, sourcing the shopper vector, blending with rankBy, nearestTo Verified against the live Core API and a ranking-enabled Discovery tenant by introspection rather than from the docs alone. That surfaced several things the docs omit or state loosely: - RankExplainEntry carries `index`, needed to tell two fieldBoost terms apart - fieldBoost.field is the TenantRankByField enum (NUMBER/DATE filterable attributes, facet fields excluded), not any numeric field - igniteDiscoApi takes `stacks`; vectors are only built with `stacks: opensearch`, and omitting it fails silently - IgnitionBulkTaskResult and SetItemTasteResult both include ExperimentalFeaturesNotAvailableError - under rerank, cursor pagination falls back to offset and skip past the window returns nothing The skill leads with capability detection: rankBy, context and nearestTo are absent from a tenant's schema until ranking is enabled, so referencing them is a validation error rather than an unranked result. Also refreshes query/references/discovery-api.md, which had drifted from the served schema — adds autocomplete, options.fuzzy, sorting, filter operators, profiling, pathResolutionMethod, priceRange, and a note that the schema is generated per tenant. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ples Review feedback on #3: Core Next error members all implement the BasicError interface, so one fragment covers every failure and errorName identifies which one — spelling out each error type is noise. This was already the convention elsewhere in mutation/references/core-api.md; the vector ranking examples simply did not follow it. setItemTaste and igniteDiscoApi now select `... on BasicError { errorName message }`. The schema listings still name the individual union members, since that is reference material rather than a query to copy. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Adds a
vector-rankingskill covering Discovery vector ranking, and refreshes the Discovery query reference, which had drifted from the served schema.Why its own skill
Vector ranking spans two APIs — vocabularies and item taste are authored on Core, ranking happens on Discovery — so splitting it across
queryandmutationwould have left the flow without a single narrative. It also has a modelling dimension (designing a vocabulary) closer totaxonomythan to either, and its trigger vocabulary ("personalization", "more like this", "boost by margin", "recommendations") would never have matchedquery.What's in it
SKILL.mdreferences/vocabulary-authoring.mdupsertVocabulary,setItemTaste, key validation, publish, ignite, verificationreferences/ranking-signals.mdrankBysignals, per-tenant field enums, normalization, multi-value collapse,rankScore/rankExplain, rerank windowreferences/personalization.mdcontext.userTaste, magnitude, sourcing the shopper vector, blending,nearestToqueryandmutationget## Related skillspointers, andmutation/references/core-api.mdgains a Vector Ranking Mutations section so the Core calls are findable from where they live.Verified against the API, not just the docs
Everything was checked by introspecting the live Core API and a ranking-enabled Discovery tenant. That surfaced several things the documentation omits or states loosely:
RankExplainEntrycarriesindex— without it you cannot tell twofieldBoostterms apart.fieldBoost.fieldis theTenantRankByFieldenum (NUMBER/DATE filterable attributes, facet fields excluded), not "any numeric field". Guessing a field name fails validation.igniteDiscoApitakesstacks, and vectors are only built withstacks: opensearch. Omitting it rebuilds the index without vectors and raises no error, so it is documented as a required step and as its own row in the failure-mode table.IgnitionBulkTaskResultandSetItemTasteResultboth includeExperimentalFeaturesNotAvailableError, which appears in neither doc version.skippast the rerank window returns nothing.The skill leads with capability detection:
rankBy,contextandnearestToare absent from a tenant's Discovery schema until ranking is enabled, so referencing them is a GraphQL validation error rather than an unranked result. That is the failure an agent is most likely to hit, so it is the first section rather than a footnote.Where the two public doc pages contradict each other on how
sortingcomposes with ranking, the skill says so and declines to assert either reading.Discovery reference refresh
query/references/discovery-api.mdwas missingautocomplete,options.fuzzy,sorting, filter operators,profiling,pathResolutionMethodandpriceRange, and did not mention that the schema is generated per tenant. All added.Notes for the reviewer
virtual:skills) and the docs site discover skills from the filesystem. Plugin version bumped 3.5.0 → 3.6.0 and the README list updated.query/andmutation/are back to formatted-clean as they were onmain.make codeclean's type-check/lint andmake testswere not run locally —bunwas unavailable in the authoring environment. No TypeScript is touched, so CI should be green, but that is unverified from my side.mass-operations/*andpermissions/SKILL.mdare not oxfmt-clean onmain, and three relative links are broken (js-api-client×2,query/references/core-api.md×1). Happy to fix either in a separate PR.🤖 Generated with Claude Code