Skip to content

feat(lookup): add Catalog::lookup_entries for listing a kind's vocabulary - #509

Merged
e54-bot merged 1 commit into
mainfrom
feat/catalog-lookup-list-entries
Oct 19, 2026
Merged

e54-bot merged 1 commit into
mainfrom
feat/catalog-lookup-list-entries

Conversation

@e54-bot

@e54-bot e54-bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Catalog::lookup_entries(locale, kind) — a public call that returns one LookupMatch per catalog entry of a listable kind in catalog order, with no query, matching, or ranking. This supplies the owner side of Wright's listEntries operation (ADR-0031, wrightkit/wright#799): Wright pages over the result and assembles no signatures.

  • Kind::Action, Kind::Value, Kind::Event → LookupMatch::Builtin, signature included.
  • Kind::Enum → LookupMatch::EnumDomain per declared domain; enum members remain covered by lookup_within with no query.
  • Undeclared locale → WorkshopError::Unsupported, as in lookup; non-listable kinds (Structural, Operator, Setting) → WorkshopError::Unsupported.
  • The per-entry match construction is factored out of lookup's loops (builtin_match, enum_domain_match, shared check_locale), so listing and ranked lookup cannot diverge.
  • Additive public API; no LookupMatch variants added or reordered; no catalog-generated items (ADR-0016).
  • docs/lookup.md: new "Listing entries" section next to "Scoped lookup".

Fixes #506

Test plan

  • listing_entries_keeps_catalog_order_for_each_builtin_kind: for Action, Value, and Event the listed ids equal entries_of(kind) ids in the same order, no duplicates.
  • listing_entries_keeps_catalog_order_for_enum_domains: listed domains equal enum_domains() in the same order.
  • listed_entries_are_the_matches_lookup_returns: every listed entry of each listable kind equals the lookup match of the same kind and id for a query of that id — in en-US (primary) and zh-CN. The comparison matches on kind and id because modifyGlobalVariable is declared under both Structural and Action, so a bare-id query can rank a different kind's Builtin first.
  • listing_entries_rejects_undeclared_locales_and_unlistable_kinds: undeclared locale and non-listable kinds return WorkshopError::Unsupported.
  • Gates: cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace --all-targets, cargo run -p workshop-rs --bin workshop-catalog-gen -- check, cargo +1.85.0 clippy --workspace --all-targets -- -D warnings, cargo +1.85.0 test --workspace --all-targets, git diff --check — all pass locally.

…lary

lookup_entries returns one LookupMatch per entry of a listable kind in catalog order, with no matching or ranking: Builtin matches for Action, Value, and Event, EnumDomain matches for Enum. Both are built by the same per-entry constructors lookup uses, so the two cannot diverge. Undeclared locales and non-listable kinds return WorkshopError::Unsupported. Wright's listEntries operation (ADR-0031, wrightkit/wright#799) pages over the result; enum members remain covered by lookup_within.

Fixes #506

@Teakowa Teakowa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@e54-bot
e54-bot merged commit 0bc8f08 into main Oct 19, 2026
5 checks passed
@e54-bot
e54-bot deleted the feat/catalog-lookup-list-entries branch October 19, 2026 16:46
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.

List lookup facts for every entry of a kind in catalog order

2 participants