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
Commit 32cfa33
Browse filesBrowse the repository at this point in the historyBrowse files
fix(core): reject unaddressable submatch offsets instead of clamping
Second bot-review round (cubic, kilo).
- `Buffer.subarray` clamps an out-of-range end and truncates a fractional one
rather than throwing, so rebasing an offset without a range check quietly
repaired a corrupt offset into a plausible-looking one. Neither schema catches
it: core `NonNegativeInt` and legacy `z.number()` both accept a number well
past the end of the line. An unaddressable offset now marks the record corrupt
so it is skipped and counted, in both parsers.
- Correct an overstated comment: the win32 skip claimed Windows ripgrep
behaviour was covered by script/windows-ripgrep-e2e.ts, but that script covers
only binary resolution, extraction and one real search — none of the
record-parsing behaviour these stub cases pin. The comment now states the gap.
Not changed, with reasons:
- Submatch offsets still index the full line after the 2000-char cap. That is
the tracked windowing follow-up, and the observable output is unchanged by
this branch — the cap moved earlier, it did not become lossier.
- The legacy parser still decodes every submatch rather than slicing to
MAX_SUBMATCHES first. Its response shape is published by `/find`, so slicing
would change that contract; the cost is already bounded by the record ceiling.
- The second capLineText call in the result mapping is a deliberate guard on the
public output, not dead code, and is documented as such.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
0 commit comments