Skip to content

Add search/query support for file-meta entries#3912

Merged
lukemelia merged 8 commits intomainfrom
cs-10110-add-search-query-support-for-file-meta-entries-plan
Feb 3, 2026
Merged

Add search/query support for file-meta entries#3912
lukemelia merged 8 commits intomainfrom
cs-10110-add-search-query-support-for-file-meta-entries-plan

Conversation

@lukemelia
Copy link
Contributor

No description provided.

@lukemelia lukemelia changed the base branch from main to cs-10100-add-explicit-store-read-type-for-file-meta-filedef January 27, 2026 23:47
@lukemelia lukemelia force-pushed the cs-10110-add-search-query-support-for-file-meta-entries-plan branch from 9dac7ed to a781e85 Compare January 27, 2026 23:49
@github-actions
Copy link

Preview deployments

@lukemelia lukemelia force-pushed the cs-10110-add-search-query-support-for-file-meta-entries-plan branch from a781e85 to a547883 Compare January 27, 2026 23:55
@github-actions
Copy link

github-actions bot commented Jan 28, 2026

Host Test Results

    1 files      1 suites   1h 42m 50s ⏱️
1 937 tests 1 920 ✅ 17 💤 0 ❌
1 952 runs  1 935 ✅ 17 💤 0 ❌

Results for commit eebfdd9.

♻️ This comment has been updated with latest results.

@lukemelia lukemelia force-pushed the cs-10110-add-search-query-support-for-file-meta-entries-plan branch from e4b3f93 to e2ee565 Compare January 28, 2026 16:26
@lukemelia lukemelia changed the base branch from cs-10100-add-explicit-store-read-type-for-file-meta-filedef to main January 28, 2026 16:27
lukemelia and others added 5 commits January 28, 2026 17:08
The client-side search pipeline (SearchResource) was built exclusively
for card resources, causing "not a card collection document" errors when
queries returned file-meta results. This broadens the pipeline to accept
and correctly process file-meta resources alongside cards.

- Broaden generic type constraints from `<T extends CardDef>` to
  `<T extends CardDef | FileDef>` across SearchResource, StoreSearchResource,
  GetSearchResourceFunc, and getSearchResource
- Replace isCardCollectionDocument with isLinkableCollectionDocument
  to accept file-meta collection responses
- Route file-meta resources through store.get(id, { type: 'file-meta' })
  instead of store.add({ data }) which only handles cards
- Use type-aware store.peek with { type: 'file-meta' } for retrieval
- Fix wireUpNewReference to check file-meta map before falling back to
  getCardInstance, eliminating spurious 415 errors for non-card URLs
- Downgrade noisy query-field-support cache-hit log from info to debug
- Add client-side SearchResource tests for file-meta search and live
  file-meta search

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@lukemelia lukemelia force-pushed the cs-10110-add-search-query-support-for-file-meta-entries-plan branch from fa79768 to 4c7ee31 Compare January 28, 2026 22:10
@lukemelia lukemelia requested review from a team and ef4 January 28, 2026 23:28
@lukemelia lukemelia requested a review from Copilot February 2, 2026 19:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds search and query support for file-meta entries, enabling FileDef instances to be queried and returned alongside card instances in search operations.

Changes:

  • Renamed CardCollectionDocument to LinkableCollectionDocument to support both card and file-meta resources
  • Added searchCards method to replace generic search method for clarity
  • Implemented file-meta type detection in query processing to route queries appropriately
  • Updated search resources and store to handle file-meta instances

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/runtime-common/search-utils.ts Updated type references to support linkable collections
packages/runtime-common/realm.ts Renamed search method and updated query handling
packages/runtime-common/realm-index-query-engine.ts Added file-meta query detection and routing logic
packages/runtime-common/query-field-utils.ts Enhanced filter normalization for file-meta queries
packages/runtime-common/index.ts Exported new file-meta collection types
packages/runtime-common/index-query-engine.ts Added searchFiles method and file-meta type checking
packages/runtime-common/document-types.ts Defined LinkableCollectionDocument and validation functions
packages/realm-server/tests/realm-endpoints/search-test.ts Added tests for file-meta search functionality
packages/realm-server/tests/realm-endpoints-test.ts Updated test expectations with sample.md file
packages/realm-server/tests/indexing-test.ts Updated search method calls to searchCards
packages/realm-server/tests/cards/sample.md Added markdown test file
packages/host/tests/unit/index-query-engine-test.ts Updated all search calls to searchCards
packages/host/tests/integration/resources/search-test.ts Added file-meta search integration tests
packages/host/tests/integration/realm-test.gts Updated search method calls
packages/host/tests/integration/realm-querying-test.gts Added file-meta query tests and updated method calls
packages/host/tests/integration/realm-indexing-test.gts Updated search method call
packages/host/tests/helpers/realm-server-mock/routes.ts Updated type references for linkable collections
packages/host/tests/cards/file-query-card.gts Added test card for file-meta queries
packages/host/tests/acceptance/code-submode/field-playground-test.gts Updated search method calls
packages/host/tests/acceptance/code-submode/card-playground-test.gts Updated search method calls
packages/host/app/services/store.ts Added file-meta instance handling in store
packages/host/app/resources/search.ts Enhanced search resource to support file-meta results
packages/host/app/lib/gc-card-store.ts Updated type signatures for file-meta support
packages/experiments-realm/file-search-playground.gts Added demonstration card for file-meta search
packages/experiments-realm/FileSearchPlayground/playground.json Added example instance of file search playground
packages/base/query-field-support.ts Changed log level from info to debug
packages/base/card-api.gts Updated type signatures to support FileDef in search

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lukemelia lukemelia merged commit d864d57 into main Feb 3, 2026
130 of 140 checks passed
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.

2 participants