Skip to content

Validate request_reverification inputs before sending MCP calls - #139

Open
Yousef-Elbeyaly wants to merge 3 commits into
prooflinedev:mainfrom
Yousef-Elbeyaly:feat/validate-request-reverification
Open

Yousef-Elbeyaly wants to merge 3 commits into
prooflinedev:mainfrom
Yousef-Elbeyaly:feat/validate-request-reverification

Conversation

@Yousef-Elbeyaly

Copy link
Copy Markdown

Summary

  • Validate commit_sha, finding_ids, and note client-side in FixesClient.request_reverification and AsyncFixesClient.request_reverification before initiating stateless MCP HTTP requests (initialize, notifications/initialized, tools/call).
  • Enforce the documented constraints (commit_sha as a 40- or 64-character hex string, finding_ids as 1 to 20 distinct non-empty strings, and optional note of 1 to 2,000 characters) by raising ValueError with zero network calls.
  • Add sync and async unit tests in tests/test_http.py verifying that invalid inputs raise ValueError with zero HTTP requests sent and valid boundary inputs succeed.

Verification

  • pytest (222 passed)
  • python3 scripts/check.py

@Yousef-Elbeyaly

Yousef-Elbeyaly commented Nov 30, 2026 •

Copy link
Copy Markdown
Author

Proofline Review Feedback

I installed Proofline on a sandbox organization (yousef-sandbox/sdk-python) and ran iterative reviews on this branch. Proofline caught two real coverage gaps in tests/test_http.py:

  1. Missing invalid finding_ids edge cases: test_request_reverification_rejects_invalid_inputs originally only tested empty lists and duplicates, leaving the bare-string, bytes, >20 items, and blank-ID guards unverified against regressions.
  2. Unverified tuple coercion and note omission: test_request_reverification_accepts_valid_inputs only passed list inputs and did not assert the serialized JSON payload, meaning tuple inputs or an omitted note serializing as null would go undetected.

Based on these findings, I added all four invalid finding_ids cases (with valid SHA and note values) and updated the valid-input test to pass a tuple and assert the exact transmitted arguments dictionary (verifying note is omitted when None).

This branch has not been deployed

No deployments
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