fix: Python docstring detection and snapshot JSON injection (#179)#258
Merged
justrach merged 1 commit intorelease/v0.2.57from Apr 13, 2026
Merged
fix: Python docstring detection and snapshot JSON injection (#179)#258justrach merged 1 commit intorelease/v0.2.57from
justrach merged 1 commit intorelease/v0.2.57from
Conversation
- Python docstring: replace naive triple-quote count with position-aware
detection — properly handles inline docstrings ("""text"""), opening
docstrings with text ("""starts here), and multi-line docstrings
containing def/class lines
- Snapshot JSON: use writeJsonEscaped for path interpolation in snapshot
writer — prevents cache corruption for files with ", \, or control
characters in paths
Note: 4 of 8 bugs from #179 were already fixed in prior commits
(C/C++ block comments, u16 truncation, ANSI strip, telemetry race)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Closed
Benchmark Regression ReportThreshold: 10.00%
|
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
From the 8 bugs in #179, 4 were already fixed in prior commits. This PR fixes the remaining 2 actionable ones:
std.mem.counttriple-quote check with position-awarestd.mem.indexOflogic. Now correctly handles: inline docstrings ("""text"""), opening docstrings with text after ("""starts here), and multi-line docstrings containingdef/classlines that shouldn't be indexed as symbols{s}path interpolation insnapshot.zigwithwriteJsonEscaped(). Files with",\, or control characters in paths no longer corrupt the snapshot cacheAlready fixed (no changes needed):
.c/.cppalready in the language checku32call_countalreadystd.atomic.Value(u32)withfetchAddNot addressed (larger scope):
active_pair_freq— needs architectural changeTest plan
"""text"""does not leak fake symbolsdefdoes not produce phantom symbols🤖 Generated with Claude Code