From 3939c748191d55f7ff8b5585360f90929decd62f Mon Sep 17 00:00:00 2001 From: vvillait88 Date: Thu, 14 May 2026 11:31:01 -0700 Subject: [PATCH] chore: remove dead _RequestLike Protocol in discovery/probe.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- agentscore_commerce/discovery/probe.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/agentscore_commerce/discovery/probe.py b/agentscore_commerce/discovery/probe.py index aa12176..d5f925c 100644 --- a/agentscore_commerce/discovery/probe.py +++ b/agentscore_commerce/discovery/probe.py @@ -4,7 +4,7 @@ import json from dataclasses import dataclass, field from datetime import UTC, datetime, timedelta -from typing import Any, Literal, Protocol +from typing import Any, Literal from agentscore_commerce.payment.directive import ( build_payment_request_blob, @@ -171,14 +171,6 @@ def build_discovery_probe_response(opts: DiscoveryProbeOptions) -> DiscoveryProb ) -class _RequestLike(Protocol): - method: str - - def headers_get(self, name: str) -> str | None: ... - - async def body_text(self) -> str: ... - - async def is_discovery_probe_request(method: str, authorization: str | None, body_text: str) -> bool: """Return True for an empty-body POST without a Payment Authorization header — the MPP crawler probe pattern.