Skip to content

fix(lsp): collect* missing/malformed first args are InvalidParams - #4867

Merged
EffortlessSteven merged 2 commits into
mainfrom
cursor/collect-context-invalid-params-bb3c
Sep 29, 2026
Merged

EffortlessSteven merged 2 commits into
mainfrom
cursor/collect-context-invalid-params-bb3c

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Summary

workspace/executeCommand for ripr.collectContext and ripr.collectEvidenceContext with a missing or non-object first argument must return JSON-RPC InvalidParams (-32602) naming the accepted object shape — never silent result: null.

Handler dispatch already converted that parse miss through context_command_target (landed in #4418). This PR closes the remaining #4358 acceptance: wire-level JSON-RPC envelope proof, and the context_arguments_returns_none_* pins now state that helper None is a bad request, not “no evidence”.

Closes #4358

Swarm / Source Boundary

This PR targets EffortlessMetrics/ripr-swarm, the normal development trunk for trusted same-repo ripr work.

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-of-truth Links

Proposal: n/a (issue-owned LSP executeCommand fail-closed disclosure)
Spec: RIPR-SPEC-0129 (editor integration / stable InvalidParams)
ADR: n/a
Plan item: n/a
Governing issue or accepted claim: #4358
Acceptance delta (one sentence): missing or malformed first arguments for collectContext / collectEvidenceContext are typed -32602 on the JSON-RPC wire, and the helper None pins no longer look like intended silent-null protocol results.

Candidate Relationships

Candidate branch (GitHub PR head is authoritative after publication): cursor/collect-context-invalid-params-bb3c
Stack parent or prerequisite PR (if any): none
Proposed replacement of PR (if any; not yet accepted): none
Acceptance retained from a replaced candidate (if any): none
Accepted winner and losing candidate disposition (when decided): n/a

#4418 already shipped the dispatch conversion as part of a broader 0.11 agent-walk bundle and did not close #4358. This is not a rival implementation of that handler; it binds the remaining discriminator and pin revisit.

Scope

Typed missing/malformed first-argument rejection for the two collect context commands, plus wire tests and pin revisit.

Scope Classification

This PR is scoped by:

  • One production behavior

Production delta:

  • Document that context_arguments None is a parse miss / bad request. Dispatch already returns LspError::invalid_params via context_command_target; no unknown-id, disposition, or malformed-artifact change.

Evidence/support delta:

  • Revisit context_arguments_returns_none_for_empty_argument_list and context_arguments_returns_none_when_first_argument_is_not_an_object so they also require context_command_target → InvalidParams for both commands (including a null first element).
  • In-process: execute_command_context_commands_reject_unreadable_arguments_with_shapes now includes collectEvidenceContext with a non-object first argument and collectContext with null.
  • Wire: collect_context_commands_reject_missing_or_malformed_first_argument_on_the_wire speaks JSON-RPC over the real ripr lsp --stdio binary for omitted/[]/string/null first arguments, asserts -32602 with no result key, and checks the session still answers ripr.collectWorkspaceStatus.
  • Traceability: map those tests under RIPR-SPEC-0129.

Single acceptance criterion:

  • Missing or malformed first argument for ripr.collectContext / ripr.collectEvidenceContext yields JSON-RPC error -32602 naming the problem, not result: null.

Non-goals:

Support-tier Impact

  • none

Claim/proof notes:

Policy Impact

  • none

Ledger or exception notes:

  • none

Proof

cargo xtask worktree doctor          # pass; current with origin/main before edits
cargo xtask check-fast               # pass on base f966e8c8a (0 files changed)
cargo check -p ripr --all-targets    # pass on exact base
cargo test -p ripr --lib -- context_arguments_returns_none execute_command_context_commands_reject_unreadable
# 3 passed
cargo test -p ripr --test lsp_lifecycle collect_context_commands_reject_missing_or_malformed_first_argument_on_the_wire
# (running on published head 2120daaee)

Result, failures, or skipped proof:

  • Inherited baseline: doctor pass, check-fast 6 gates / 0 files, cargo check -p ripr --all-targets pass at f966e8c8abd295299d365ac98c0cefc1c6059c27.
  • In-process tests: 3 passed at the first published head; borrow fix is 2120daaee.
  • Compatibility grep: VS Code copyContext always sends one object; MCP/agent do not call these commands argument-less.
  • Hosted required CI is the merge-gate matrix.

Claim Boundary

May claim: these two commands reject missing/malformed first arguments with typed InvalidParams on the JSON-RPC wire, and the helper None pins are explicit about parse-miss vs protocol error.

Must not claim: unknown-id semantics as new work; generic off-the-shelf client proof beyond the in-repo stdio harness; runtime mutation outcomes; #1901 disposition.

Rollback

Revert the squash commit. Tests and comments only plus the existing dispatch path; no schema or golden re-bless.

Spec-Test-Code Traceability

  • Spec: RIPR-SPEC-0129
  • Tests: gap_record_context_tests::context_arguments_returns_none_*, execute_command_context_commands_reject_unreadable_arguments_with_shapes, lsp_lifecycle::collect_context_commands_reject_missing_or_malformed_first_argument_on_the_wire
  • Code: crates/ripr/src/lsp/backend.rs (context_arguments, context_command_target, execute_command_inner)
  • Golden outputs: none
  • Metrics: n/a
  • ADR/learning: n/a

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.
  • Unknowns include stop reasons where applicable.

CI Economics

n/a — ordinary LSP test/comment change; no workflow or lane change.

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code.
  • No new panic, unwrap, expect, todo, or unimplemented in tests.
  • New non-Rust programming files are allowlisted with owner, surface, and reason.
  • Errors are reported with actionable context.
  • Public JSON/schema changes are documented.

Gates

Focused local proof on the published head follows; hosted required checks own merge.

Exact candidate SHA at publication: 2120daaee27cb0f4677ffd004ad9ca4059f8bc06
Recorded integration base: f966e8c8abd295299d365ac98c0cefc1c6059c27

Disposition before hosted evidence: REVIEW_INCOMPLETE. Self-review / REVIEW_CURRENT of source and oracle on this head will be posted as a COMMENT review; merge convergence waits for green required CI and published-head REVIEW_READY.

Open in Web Open in Cursor 

Devin Review

Pin workspace/executeCommand ripr.collectContext and
ripr.collectEvidenceContext so a missing or non-object first argument
returns JSON-RPC -32602 naming the accepted object shape, never silent
result:null. Revisit the context_arguments None pins as parse-miss vs
protocol error, and add a real-stdio wire test.

Closes #4358

Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
@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!

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 49f7be19-4448-4ec1-9cd0-739e8ed39f6f


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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T06:43:21.644847Z 9f493e3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devin-ai-integration devin-ai-integration 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

review-pr (published-head, author COMMENT)

GitHub cannot REQUEST_CHANGES from the author. This is not approval.

reviewed_head_sha: 2120daaee27cb0f4677ffd004ad9ca4059f8bc06
integration_basis: origin/main 3911480a34c6ce2224932f8494576636c73e1732 (behind-only vs recorded f966e8c8a; no restack)
claim_boundary: collectContext / collectEvidenceContext missing or malformed first argument → JSON-RPC InvalidParams (-32602) naming the accepted object shape, not silent result:null. Closes #4358 only.
changed_surfaces_and_semantic_owners_inspected: lsp/backend.rs context_arguments + context_command_target + execute_command_inner; lsp/tests.rs; lsp_lifecycle.rs wire envelope; RIPR-SPEC-0129 traceability
blocking_findings: none
non_blocking_suggestions: collectEvidenceContext null first-arg is wire-covered, not in the helper pin
refuted_or_stale_findings: Gemini quota (missing review, not clean and not a stop); CodeRabbit skipped (OSS stars); Devin/Codex on 9f493e3 with no findings, head later only owned the command-name borrow for the wire test
proof_and_ci_observed:
  - mergeStateStatus CLEAN, mergeable MERGEABLE, zero review threads
  - Ripr Rust Small Result success; Ripr Rust Small on GitHub Hosted / Rust gates success
  - Rust-only feature lane, source-of-truth, spec-maintenance-digest, cargo-deny, dependency-review success
  - skipped-by-policy: rust-tests-junit, vscode, rust-coverage, windows-advisory, msrv, perl/release, future-clippy, droid, docs gate, CX/CPX runners (not claimed as passed)
  - local: precommit pass; 3 in-process + 1 CARGO_BIN_EXE_ripr wire test passed
proof_or_review_missing: pr-review waves OFF by instruction; Gemini/CodeRabbit unavailable
affected_currentness_dimensions: none since 2120daaee; unrelated main movement does not invalidate
residual_assumptions_and_non_claims: #1901/#4075/#1628/#2292 not absorbed; unknown-id already typed by #4418; no client.py harness; no mutation claim
disposition: REVIEW_READY

Oracle: wrapping the parse miss as Ok(None) would fail the wire test (error -32602, command + expects one object, no result key).

@EffortlessSteven
EffortlessSteven merged commit 68d6b7d into main Sep 29, 2026
26 checks passed
@EffortlessSteven
EffortlessSteven deleted the cursor/collect-context-invalid-params-bb3c branch September 29, 2026 07:23
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.

fix(lsp): collect* commands with missing arguments return silent null instead of a typed error

2 participants