You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Avoid repeated prefix copies when checking quote escapes - #24
fix_fast copies the entire preceding input whenever it checks whether a quote is escaped. Arrays containing many short strings therefore accumulate quadratic slice volume, including incomplete arrays received while streaming.
Count only the adjacent backslashes before the quote instead. This preserves odd/even escape parity and avoids those repeated prefix copies.
Tests cover a deterministic slice-volume budget through loads, complete and partial arrays, and every prefix of escaped string/key examples across all allowance flags. The new cases fail 6 tests on the original code (18 correctness controls pass).
Validation: all 38 tests pass locally on Python 3.10 and 3.13. Tests use synthetic inputs with network access disabled. No claim is made about the complexity of the entire parser.
Developed with AI assistance and reviewed independently by a separate AI agent before submission.
No actionable comments were generated in the recent review.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: b75b28e2-9b4e-4719-9b18-3d4c182069be
Commits
Reviewing files that changed from the base of the PR and between e0aa5e2 and ce16af4.
Files selected for processing: 2
src/partial_json_parser/core/myelin.py
tests/test_examples.py
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
📝 Summary
fix_fast now counts consecutive backslashes before a quote to determine escape parity, instead of copying the preceding input.
New tests measure slice work when loading complete and partial arrays. They also compare fix_fast with fix for every prefix of escaped list and dictionary inputs across all allowance flags.
Test results are not independently verified.
is_escaped now counts consecutive backslashes by scanning backward from the quote index. Tests measure slice-result lengths when loading complete and partial arrays. Additional tests compare fix_fast with fix across input prefixes containing varying backslash runs.
The optimization preserves parser behavior and is ready to merge.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title "Avoid repeated prefix copies when checking quote escapes" matches the main change: fix_fast now counts adjacent backslashes backward from the quote instead of copying the preceding input. I…
Description check
The description explains that fix_fast copies the preceding input on each quote-escape check, and that the fix counts only adjacent backslashes. It also describes the added tests (slice-volume budget,…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "Avoid repeated prefix copies when checking quote escapes" matches the main change: fix_fast now counts adjacent backslashes backward from the quote instead of copying the preceding input. It is specific and concise, and a teammate scanning history would understand the primary change.
Full details: Description check
Explanation
The description explains that fix_fast copies the preceding input on each quote-escape check, and that the fix counts only adjacent backslashes. It also describes the added tests (slice-volume budget, complete and partial arrays, escaped string/key prefixes) and the validation run. This is directly related to the changeset.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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.
fix_fastcopies the entire preceding input whenever it checks whether a quote is escaped. Arrays containing many short strings therefore accumulate quadratic slice volume, including incomplete arrays received while streaming.Count only the adjacent backslashes before the quote instead. This preserves odd/even escape parity and avoids those repeated prefix copies.
Tests cover a deterministic slice-volume budget through
loads, complete and partial arrays, and every prefix of escaped string/key examples across all allowance flags. The new cases fail 6 tests on the original code (18 correctness controls pass).Validation: all 38 tests pass locally on Python 3.10 and 3.13. Tests use synthetic inputs with network access disabled. No claim is made about the complexity of the entire parser.
Developed with AI assistance and reviewed independently by a separate AI agent before submission.