feat(search): signature search + callers-of / callees-of graph qualifiers#135
Closed
andreinknv wants to merge 2 commits into
Closed
feat(search): signature search + callers-of / callees-of graph qualifiers#135andreinknv wants to merge 2 commits into
andreinknv wants to merge 2 commits into
Conversation
… callees-of) Three additional query-parser fields on top of PR colbymchenry#131's field-qualified-query foundation: - sig:/signature: SUBSTR — case-insensitive substring of node.signature. Lets users find functions by what they return / accept (e.g. `sig:Promise<User>`, `sig:context.Context`). Pushed into SQL via a new `signatureLike` parameter on searchAllByFilters when sig: is the only criterion, so the filter-only path doesn't waste candidate slots on signatureless rows. - callers-of:NAME — restricts results to nodes that have at least one outgoing `calls` edge to a node named NAME. Backed by a new nodesCallingAny() SQL helper. When this is the only criterion (no text), the candidate set is seeded FROM the graph (via nodesByIds) rather than scanning a name-ordered slice of arbitrary nodes — that way a 3-caller function correctly returns 3 candidates instead of zero. - callees-of:NAME — symmetric: nodes that are called BY a node named NAME. Backed by nodesCalledByAny() and the same graph-seeded path. Verified live against ollama/ollama@v0.22.0: query "sig:context.Context kind:function" → BuildLauncherState, Chat,... query "callers-of:Forward kind:function" → audioFeedForward, forwardConvBlock,... query "auth sig:error" → getAuthorizationToken (filters compose with text) Two new parser tests (sig: + alias, callers-of/callees-of). Full suite: 405 passed.
…ndant graph helpers, IN-clause cap, integration tests Five reviewer fixes: - searchAllByFilters: signatureLike is now a string[] (OR'd in SQL), not a single string. The previous version pre-filtered SQL on signatureFilters[0] only while the JS post-filter used `some()` (OR) on all filters — the intersection silently dropped every sig: token after the first. Multi-sig now works as proper OR (matching path:/name: filter semantics). - callersSet() / calleesSet() are computed once via a memoised closure and reused by both the graph-seeded candidate path and the post-filter pass. Previously each was queried twice per filter-only callers-of:/callees-of: query. - New chunkIds() helper splits IN-clause inputs into batches of 900 (under SQLite's default SQLITE_LIMIT_VARIABLE_NUMBER of 999) so pathological inputs (large name lists or seeded id sets) can't trigger 'too many SQL variables'. Applied to nodesByIds, nodesCallingAny, nodesCalledByAny. - Graph-seeded path now applies kinds/languages filters to the result. Previously `callers-of:foo kind:method` returned every caller regardless of kind because the post-filter pass only intersected the graph-derived set without re-filtering. - 5 new integration tests in __tests__/search-qualifiers.test.ts: sig: filter, multi-sig OR, callers-of:, callees-of:, callers-of: + kind: composition. Catches the bugs above. Note: an idx_nodes_signature SQL index was considered but skipped — LIKE '%substr%' matches don't use a btree index, so adding one would just bloat the DB without helping. Substring sig: queries are intentionally full-table scans; FTS already covers signature for text queries. Full suite: 410 passed (was 405, +5).
andreinknv
added a commit
to andreinknv/codegraph
that referenced
this pull request
Apr 28, 2026
… qualifiers # Conflicts: # __tests__/search-query-parser.test.ts # src/db/queries.ts # src/search/query-parser.ts
andreinknv
added a commit
to andreinknv/codegraph
that referenced
this pull request
Apr 29, 2026
Adds Steps K-O to walk the new PRs in dependency order: K: bug-fix wave (clean): colbymchenry#128, colbymchenry#129 L: resolution + search: colbymchenry#130 (resolve), colbymchenry#131 (resolve) M: extraction edges: colbymchenry#134 (resolve) N: biomarker stack: colbymchenry#132, colbymchenry#133 (both resolve, on top of colbymchenry#125) O: search advanced: colbymchenry#135 (resolve, on top of colbymchenry#131) Also flips colbymchenry#125 from merge_clean to merge_resolve - it now hits a queries.ts conflict after the Phase-4 stack lands (colbymchenry#111/colbymchenry#112/colbymchenry#123/colbymchenry#124 all extend the same QueryBuilder surface, so colbymchenry#125's biomarker columns no longer apply cleanly without a resolution). Validated end-to-end against colbymchenry/main HEAD: script ran clean through all 43 PRs, npm run build succeeded, full test suite reports 877/877 passing (was 829 before this wave: +48 from new tests added by the new PRs plus the reviewer-driven follow-ups).
Owner
|
Thanks for the contribution! Closing this one — the direction overlaps too much with what's already shipped rather than for any code-quality reason.
Also noting that this PR is stacked on #131, which isn't merged yet — so it can't land in its current form regardless. |
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.
Summary
Three new search query qualifiers extending PR #131's field-qualified parser. All compose with the existing
kind:/lang:/path:/name:filters.sig:/signature:— substring of node.signatureFind functions by what they accept or return:
callers-of:NAME— nodes that call NAMEcallees-of:NAME— nodes called BY NAMEImplementation notes
nodesCallingAny(names)andnodesCalledByAny(names)SQL helpers;nodesByIds(ids)for bulk node fetching when seeded from the graph.searchAllByFiltersacceptssignatureLike: string[]and OR's all entries in SQL — matches the OR semantics ofpath:/name:post-filters.SQLITE_ERROR: too many SQL variables.kinds/languagespost-filter to the seed set socallers-of:foo kind:methodcorrectly narrows.callersSet()/calleesSet()closures so the seed and the filter pass don't re-query the same names.Test plan
Verified live on ollama/ollama@v0.22.0:
sig:context.Context kind:functionBuildLauncherState,Chat, ...callers-of:Forward kind:functionaudioFeedForward,forwardConvBlock, ...auth sig:errorgetAuthorizationToken(text + sig: composes)__tests__/search-qualifiers.test.tscoveringsig:, multi-sig:OR,callers-of:,callees-of:, andcallers-of: + kind:compositionsig:andcallers-of:/callees-of:parsingnpx vitest run— 410 passed (was 405)npx tsc --noEmitcleannpm run buildsucceedsDepends on
feat/search-fields-and-fuzzy) — parser foundation + chunking infrastructure🤖 Generated with Claude Code