fix: resolve 5 remaining P2 issues (#210, #224, #228, #250, #253)#256
fix: resolve 5 remaining P2 issues (#210, #224, #228, #250, #253)#256justrach merged 1 commit intorelease/v0.2.57from
Conversation
…searchContent word_index fallback, Symbol.line_end population - #210: release raw file contents after ProjectCache snapshot load (4.5GB→~200MB) - #228: check mtime/size before re-indexing in drainNotifyFile, skip unchanged files - #253: loadSnapshotValidated opens snapshot file once instead of 5 times - #250: searchContent uses word_index to narrow fallback from O(files) to O(word hits) - #224: computeSymbolEnds post-processing populates Symbol.line_end for brace/indent/Ruby languages; codedb_symbol body=true now returns full function body Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Benchmark Regression ReportThreshold: 10.00%
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3cd973d5a6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const word_hits = self.word_index.search(query); | ||
| if (word_hits.len > 0) { | ||
| var word_paths = std.StringHashMap(void).init(allocator); |
There was a problem hiding this comment.
Preserve full-scan fallback when word index yields partial candidates
When trigram/sparse candidates are empty, this path searches only word_index.search(query) hits if any exist. That lookup is exact-token based (WordIndex.search), but searchInContent matches case-insensitive substrings, so files containing valid substring matches (for example foo inside foobar, especially for short queries where trigram is disabled) are skipped whenever at least one exact-token hit exists. This changes searchContent from exhaustive to lossy and can silently miss real results.
Useful? React with 👍 / 👎.
| if (std.mem.indexOf(u8, sig_line, ":") == null) { | ||
| // Multi-line signature — skip ahead to find the colon |
There was a problem hiding this comment.
Ignore annotation colons when detecting Python signature end
This colon check treats any : on the def line as the signature terminator, but typed multiline signatures often include parameter annotations before the actual closing ):. In cases like def f(a: int, ... ) -> None:, body_start is left too early, and the later dedent check can stop before the real function body, producing incorrect line_end and truncated codedb_symbol body=true output.
Useful? React with 👍 / 👎.
Summary
ProjectCache.get()now callsreleaseContents()after snapshot load, fixing 4.5GB RSS on large cached reposdrainNotifyFilechecks mtime/size against known-file state before re-indexing, skipping unchanged filesloadSnapshotValidatedopens the snapshot file once instead of 5 times (meta, sections, content, freq_table all reuse one handle)searchContentfallback usesword_indexto narrow candidates from O(all files) to O(word matches) when no trigram/sparse results existcomputeSymbolEndspost-processing pass populatesSymbol.line_endfor brace languages (Zig, TS, Rust, Go, PHP, C/C++), Python (indent-based), and Ruby (endkeyword).codedb_symbol body=truenow returns the full function bodyTest plan
zig build test— exit 0)issue-224Zig fn line_end reaches closing braceissue-224Python def line_end covers full bodycodedb_symbol name=<multi-line-fn> body=truereturns full body🤖 Generated with Claude Code