Skip to content

search: clip long match lines at rg's column; no client re-matches (D3) - #598

Closed
jaredLunde wants to merge 43 commits into
mainfrom
jared/fix-d3-clip-rg-column
Closed

jaredLunde wants to merge 43 commits into
mainfrom
jared/fix-d3-clip-rg-column

Conversation

@jaredLunde

Copy link
Copy Markdown
Contributor

Fixes D3. The TypeScript client re-matched long lines with a JavaScript RegExp, so Rust-syntax patterns ((?i), (?P<x>..)) failed. No client re-matches now: rg --column reports the byte column of the first match, and every client turns it into a character offset the same way (UTF-8 encoding of the decoded line, CRs not counted; a column inside a character means no column).

Spec decisions (Clipping, Parsing, Engines differ):

  • rg has no flag that reports the match end alongside the line, so the window is placed by the match start only: start = max(0, cs - 250); start 0 is the head clip; a window past the end moves back to the last 500 characters. Previously it used the match width.
  • GNU grep and busybox report no column, so those rungs clip every long line at its head (they used to re-match client-side).
  • Scenarios: files.search.long-lines-are-clipped now requires rg with the new window numbers; a grep-rung twin pins the head clip. The differential oracle and the ShellFs property oracle follow.

Removes the D3 xfails and tolerance. Matrix: all search scenarios pass on local/alpine/debian-runas/readonly/tinydisk for rust, ts, python, python-async. The sandbox-mcp driver fails only the D5 scenario (next fix). Differential: 6/6 with the four client drivers (the mcp driver diverges on a plain mkdir in the differential, unrelated to this change).

Stacked on #594 (D2) and carries #590; retarget once they land.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HJRTKuPpNNqCLEdyUwZj64

jaredLunde and others added 30 commits October 27, 2026 09:20
Hegel generates operation sequences (files, search, exec, and changes made behind
the client's back); each runs in lockstep through every registered driver on its own
root, and the answers are compared with each other and, on local backends, with std::fs.
Findings D1..D5 are scenarios in differential-found.json, xfail for the clients that fail them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJRTKuPpNNqCLEdyUwZj64
…lit at CR, VT, FF, U+2028)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJRTKuPpNNqCLEdyUwZj64
… even on SIGKILL; differential tests run only in the clients job

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJRTKuPpNNqCLEdyUwZj64
…, not a rejected pattern

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJRTKuPpNNqCLEdyUwZj64
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJRTKuPpNNqCLEdyUwZj64
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJRTKuPpNNqCLEdyUwZj64
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJRTKuPpNNqCLEdyUwZj64
…o jared/fix-d2-search-bad-git

# Conflicts:
#	sdk/conformance/FILES-OVER-EXEC.md
…rches the line again

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJRTKuPpNNqCLEdyUwZj64
…ferential tolerance

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJRTKuPpNNqCLEdyUwZj64
…gs clip at the head

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJRTKuPpNNqCLEdyUwZj64
… jared/fix-d2-search-bad-git

# Conflicts:
#	crates/sandbox-conformance/ARCHITECTURE.md
jaredLunde and others added 11 commits October 27, 2026 12:05
…rches the line again (docs, merge)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJRTKuPpNNqCLEdyUwZj64
… built on the Rust client)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJRTKuPpNNqCLEdyUwZj64
…rop exec.exact from the comparison

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJRTKuPpNNqCLEdyUwZj64
…er lead out of the root

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJRTKuPpNNqCLEdyUwZj64
…ad-git

# Conflicts:
#	sdk/conformance/FILES-OVER-EXEC.md
… jared/fix-d2-search-bad-git

# Conflicts:
#	crates/sandbox-conformance/ARCHITECTURE.md
#	sdk/conformance/scenarios/differential-found.json
…o jared/fix-d3-clip-rg-column

# Conflicts:
#	crates/sandbox-conformance/ARCHITECTURE.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJRTKuPpNNqCLEdyUwZj64
…ad-git

# Conflicts:
#	crates/sandbox-conformance/ARCHITECTURE.md
#	crates/sandbox-conformance/tests/differential/oracle.rs
#	sdk/conformance/scenarios/differential-found.json
@jaredLunde
jaredLunde enabled auto-merge October 27, 2026 20:47
@jaredLunde
jaredLunde added this pull request to the merge queue Oct 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 27, 2026
@jaredLunde jaredLunde closed this Oct 27, 2026
@jaredLunde

Copy link
Copy Markdown
Contributor Author

Landed on main as part of #600: the three D fixes were stacked, and #600's squash carried this PR's commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant