Skip to content

test(lsp): bind /workspace expectations like the producer binds its root (#3922) - #4355

Closed
EffortlessSteven wants to merge 2 commits into
mainfrom
claude/project-thread-ks2kmh
Closed

EffortlessSteven wants to merge 2 commits into
mainfrom
claude/project-thread-ks2kmh

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

https://claude.ai/code/session_014vWbhn6X7qSCyTeo6L1aF8

Before: on native Windows, three LSP code-action tests failed in both advisory runs (job 108767554694):

  • execute_command_collect_evidence_context_returns_editor_packet_for_known_seam
  • repair_start_is_offered_only_for_a_seam_past_the_repair_packet_flip
  • seam_code_actions_surface_packet_assertion_related_test_and_refresh

They pass on Linux. Each was an assert_eq on a generated --root.

After: the expectations bind the fixture root the way the producer does, so the tests hold on both hosts.

This changes test expectations only. #4287 binds every generated --root to the absolute selected root through agent::loop_commands::bound_root. The fixture root /workspace is absolute on Unix but drive-relative on Windows, so the producer renders it joined to the current drive (D:/workspace), while these tests hard-coded /workspace or passed it through root_display. The fix wraps the expected root in bound_root("/workspace"). The brief-command assertion in the same test already does this (workspace_root at lsp/tests.rs:12673). On Unix the value is byte-identical, so nothing changes there. Real LSP roots come from file:// URIs, which are drive-absolute on Windows, so this is not a product defect.

How: four expectation sites in crates/ripr/src/lsp/tests.rs.

Checks:

  • The three tests pass on Linux.
  • cargo check --tests --target x86_64-pc-windows-gnu is clean.
  • cargo xtask precommit exit 0.
  • Native Windows proof comes from the windows-ci label.

Not in this PR: cargo clippy --target x86_64-pc-windows-gnu -D warnings already fails on main at output/markdown.rs:838, where a Windows-only test uses map_err(|_| ...). It predates this change, and no required lane runs Windows clippy.

Review providers: CodeRabbit (rate-limited) and Devin (credits) are unavailable, so their review is missing, not clean.


Generated by Claude Code

…s its root

#4287 binds every generated --root to the absolute selected root. The
fixture root /workspace is drive-relative on Windows, so the producer
renders D:/workspace while three code-action tests hard-coded
/workspace and failed in both Windows advisory runs (#3922). Bind the
expectations with the same bound_root, as the brief-command assertion
in this file already does. Unchanged on Unix.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014vWbhn6X7qSCyTeo6L1aF8
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven EffortlessSteven added the windows-ci Run the advisory Windows lane on a pull request without opting into every full-ci lane. label Sep 28, 2026 — with Claude
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 713f789c-7f43-49cd-8c47-f928c835e0a2

📥 Commits

Reviewing files that changed from the base of the PR and between 26a9740 and f38dd8d.

📒 Files selected for processing (1)
  • crates/ripr/src/lsp/tests.rs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • Pre-existing Windows clippy failure at output/markdown.rs:838 (map_err(|_| ...)) is explicitly out of scope per PR body and predates this change; not introduced here. Worth noting so a future lane does not re-raise it as a regression.

Verification questions

  • Confirm bounded scan did not exhaustively grep for other literal "/workspace" expectations across lsp/tests.rs; broader sibling coverage not proven.
  • Confirm native Windows correctness is claimed but not proven in this lane's evidence. Author defers to windows-ci label; cargo-check --target x86_64-pc-windows-gnu is clean but compile-clean is not assertion-clean.

Refuted

  • Test could be made platform-conditional instead of binding to producer output, leaving the underlying host assumption undertested.; refuted because: Out of scope for this PR (tests-only fix). Binding to producer output is the right minimal change to keep the existing assertions meaningful without restructuring fixtures or introducing cfg windows gates.
  • The producer itself is wrong on Windows and this PR papering over a product bug.; refuted because: PR body and #4287 history establish real LSP roots come from file:// URIs (drive-absolute on Windows); only fixture /workspace is drive-relative, so binding it in expectations is test-only and correct.
  • The fixture-root-binding change leaks into production code or expands a public API surface.; refuted because: crates/ripr/src/lsp/tests.rs is a test file; the diff is confined to four assert_eq expectations. bound_root/shell_arg are already public test-accessible items used at lsp/tests.rs:12673, so no new surface is added.
  • A more robust fix would refactor the producer to also drive-bind via file:// URI parsing rather than special-casing /workspace in tests; refuted because: Out of scope for a test-only portability fix; the producer already binds via bound_root per #4287. Changing the producer would be a separate concern and is explicitly not what this PR does. Test fix is the smallest-complete-fix for the stated failure.

Parked follow-ups

  • Two of the four sites duplicate the bound_root+shell_arg+format! pattern inline; a thin expected_repair_root test helper would reduce repetition.

Evidence gaps

  • Native Windows proof is remote via windows-ci label; no in-PR Linux/Unix run exercises the new drive-bound path.
  • Model proof intent was rejected by deterministic validation.

Copy link
Copy Markdown
Member Author

This answers the ub-review verification questions.

Other /workspace literals. I grepped lsp/tests.rs for /workspace expectations that are not bound. Seven remain, at lines 2747, 3032, 7321, 7454, 7510, 10826 and 13753. Each one compares a parsed input or path (latest.root, input.root, opened.path, effective_root) against the fixture value. None of them compares a --root that the producer rendered through bound_root. None of them failed in either Windows run of job 108767554694, which failed only the three tests named in the PR body. They stay as they are.

Native Windows. Agreed that a clean compile is not the same as clean assertions. The windows-advisory run on this head (job 108776748502) is the proof. The PR stays in draft until it passes.

Parked helper. It stays as is. Two sites repeating one format! is not worth a new helper in a portability fix.


Generated by Claude Code

… expectations

The first Windows run on this PR fixed two of the three tests. The
third still failed at lsp/tests.rs:4137. Its packet, brief,
after-snapshot and verify expectations passed the unbound fixture root
into the builders, but the producer passes bound_root(root). Bind the
root once where the test defines it. Unchanged on Unix.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014vWbhn6X7qSCyTeo6L1aF8

Copy link
Copy Markdown
Member Author

Closing as superseded by #4351, which merged at 04:11Z with the same fix. It binds all three tests' expected roots through bound_root, including the packet, brief, after-snapshot and verify expectations in seam_code_actions_surface_packet_assertion_related_test_and_refresh, which this PR's first commit missed. #4351's exact-head Windows Advisory run 36373553237 passed all three tests in both repetitions, 8,692 passed and 0 failed each. This branch now conflicts with main on those lines and adds nothing.


Generated by Claude Code

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

Labels

windows-ci Run the advisory Windows lane on a pull request without opting into every full-ci lane.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants