Skip to content

chore: remove dead _RequestLike Protocol in discovery/probe.py - #35

Merged
vvillait88 merged 1 commit into
mainfrom
chore/vulture-sweep-dead-code
May 14, 2026
Merged

chore: remove dead _RequestLike Protocol in discovery/probe.py#35
vvillait88 merged 1 commit into
mainfrom
chore/vulture-sweep-dead-code

Conversation

@vvillait88

Copy link
Copy Markdown
Contributor

Summary

Vulture sweep follow-up to the TEC-303 flatten train. Removes the only genuine dead-code finding: _RequestLike Protocol + Protocol import in discovery/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:48 DecisionPolicy / Signer (90% confidence flag): used at lines 288/289/351/352 via string-form cast("DecisionPolicy | None", ...). Vulture can't see string-typed casts.
  • stripe_multichain/pi_cache.py:45 ex (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% coverage
  • uv run ruff check . — clean
  • uv run vulture agentscore_commerce/ --min-confidence 80 — only the two false positives above remain

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>
@vvillait88
vvillait88 merged commit 7f6b017 into main May 14, 2026
7 checks passed
@vvillait88
vvillait88 deleted the chore/vulture-sweep-dead-code branch May 14, 2026 18:33
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