Skip to content

Add source string index for code-like literals#923

Draft
Lee-take wants to merge 1 commit into
colbymchenry:mainfrom
Lee-take:codex/source-strings-index
Draft

Add source string index for code-like literals#923
Lee-take wants to merge 1 commit into
colbymchenry:mainfrom
Lee-take:codex/source-strings-index

Conversation

@Lee-take

Copy link
Copy Markdown

Summary

  • add a source_strings side-table plus FTS5 index for compact code-like string literals such as route keys, collection names, event names, and config keys
  • index exact literal sites during extraction, attaching each hit to its smallest enclosing symbol and file:line location
  • expose searchSourceStrings() for direct literal lookups, and use source-string hits as entry points for query, explore, CLI, and MCP search/context paths
  • preserve exact literal semantics for single code-like strings while allowing multi-term FTS lookup, and keep natural-language context ranking stable by only seeding source-string results for code-like queries
  • replace rows on sync/delete/clear so the side-table stays aligned with the graph

This is the larger follow-up to the source-string use case discussed on #451: route paths, Directus collection names, RN/Unity bridge event names, and similar cross-repo string contracts are not symbols, but they still need a queryable source surface.

Validation

  • npx vitest run __tests__/source-strings.test.ts __tests__/context.test.ts __tests__/context-ranking.test.ts __tests__/mcp-tool-allowlist.test.ts __tests__/security.test.ts — 87 passed, 2 skipped
  • npm run build
  • CLI smoke test against a temp TypeScript project: init, query '/live-scoring/append-event', and explore 'unity.score.updated'

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