chore: remove dead _RequestLike Protocol in discovery/probe.py - #35
Merged
Conversation
Caught during vulture sweep after the TEC-303 flatten train. `is_discovery_probe_request`
takes flat args (method, authorization, body_text) — the surrounding `_RequestLike`
Protocol describing a request-object shape with `method` / `headers_get` / `body_text`
methods is never referenced anywhere in the SDK or tests. Pre-existing dead code,
not introduced by the flatten work.
Also drops the now-unused `Protocol` import.
The other two high-confidence vulture flags from the same sweep are false positives:
- `identity/client.py:48` `DecisionPolicy` / `Signer` — used at lines 288/289/351/352
via string-form `cast("DecisionPolicy | None", ...)` which vulture can't see.
- `stripe_multichain/pi_cache.py:45` `ex` — Protocol method parameter (signature),
not an unused variable.
Both stay.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Vulture sweep follow-up to the TEC-303 flatten train. Removes the only genuine dead-code finding:
_RequestLikeProtocol +Protocolimport indiscovery/probe.py.The public
is_discovery_probe_request(method, authorization, body_text)takes flat args — the surrounding Protocol describing a request-object shape (method/headers_get/body_text) was never referenced anywhere. Pre-existing dead code, not introduced by the flatten work.Two other vulture flags — false positives, kept
identity/client.py:48DecisionPolicy/Signer(90% confidence flag): used at lines 288/289/351/352 via string-formcast("DecisionPolicy | None", ...). Vulture can't see string-typed casts.stripe_multichain/pi_cache.py:45ex(100% confidence flag): Protocol method parameter (async def set(self, key: str, value: str, *, ex: int)). Vulture treats it as an unused local variable; it's actually part of the Protocol signature describing what callers pass.Test plan
uv run pytest tests/— 1031 passed / 3 skipped, 95.05% coverageuv run ruff check .— cleanuv run vulture agentscore_commerce/ --min-confidence 80— only the two false positives above remain