Skip to content

Commit 91a7bfb

Browse files
vvillait88claude
andcommitted
chore(types): drop reputation-API types — they belong to agentscore-py
Activity, Classification, Identity, Reputation, ScoreDetail, Grade, ScoreStatus are reputation-API shapes that live in agentscore-py. python-commerce was duplicating them locally as @DataClass copies; agentscore-py has them as TypedDict. Vendors who need these should import from agentscore-py directly. Removes the duplicates from agentscore_commerce/identity/types.py and from the public __all__. Mirrors node-commerce's tighter module boundary (@agent-score/commerce doesn't re-export reputation types either). OperatorVerification, PolicyCheck, PolicyResult kept — those are gate-relevant (consumed by AssessResult and the policy module) and not reputation types. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent fd2e58a commit 91a7bfb

3 files changed

Lines changed: 4 additions & 86 deletions

File tree

agentscore_commerce/identity/__init__.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,12 @@
3636
)
3737
from agentscore_commerce.identity.signer import extract_x402_signer
3838
from agentscore_commerce.identity.types import (
39-
Activity,
4039
AgentIdentity,
4140
AgentMemoryHint,
4241
AssessResult,
43-
Classification,
4442
DenialCode,
4543
DenialReason,
46-
Grade,
47-
Identity,
4844
OperatorVerification,
49-
ScoreDetail,
5045
VerifyWalletSignerMatchOptions,
5146
VerifyWalletSignerResult,
5247
build_agent_memory_hint,
@@ -103,26 +98,21 @@ def _load_asgi_middleware() -> tuple[Any, Any]:
10398
"A2AAgentInterface",
10499
"A2AAgentProvider",
105100
"A2AAgentSkill",
106-
"Activity",
107101
"AgentIdentity",
108102
"AgentMemoryHint",
109103
"AgentScoreGate",
110104
"AgentScoreGatePolicy",
111105
"AssessResult",
112-
"Classification",
113106
"CreateSessionOnMissing",
114107
"DenialCode",
115108
"DenialReason",
116109
"EnforcementMode",
117110
"GateClient",
118111
"GateResult",
119112
"GeneratedUCPKey",
120-
"Grade",
121-
"Identity",
122113
"IdentityStatus",
123114
"OperatorVerification",
124115
"PolicyBlock",
125-
"ScoreDetail",
126116
"UCPCapabilityBinding",
127117
"UCPPaymentHandlerBinding",
128118
"UCPProfile",

agentscore_commerce/identity/types.py

Lines changed: 4 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55

66
from agentscore import Network as Network # noqa: TC002 — runtime re-export for vendors
77

8-
Grade = Literal["A", "B", "C", "D", "F"]
9-
10-
ScoreStatus = Literal["scored", "stale", "known_unscored"]
8+
# Reputation-API types (Activity, Classification, Identity, Reputation, ScoreDetail,
9+
# Grade, ScoreStatus) live in agentscore-py — not re-exported here. Commerce SDK is
10+
# scoped to gate + payment + 402 + discovery; reputation lookups belong to the
11+
# AgentScore SDK. Import via `from agentscore import Activity, Classification, ...`.
1112

1213
DenialCode = Literal[
1314
"wallet_not_trusted",
@@ -175,72 +176,6 @@ def build_agent_memory_hint() -> AgentMemoryHint:
175176
)
176177

177178

178-
@dataclass
179-
class ScoreDetail:
180-
"""Typed score breakdown from the assess response."""
181-
182-
value: float | None
183-
grade: Grade
184-
status: ScoreStatus
185-
confidence: float | None = None
186-
scored_at: str | None = None
187-
version: str | None = None
188-
dimensions: dict[str, Any] | None = None
189-
190-
191-
@dataclass
192-
class Activity:
193-
"""On-chain activity summary from the assess response."""
194-
195-
total_verified_transactions: int = 0
196-
total_candidate_transactions: int = 0
197-
counterparties_count: int = 0
198-
active_days: int = 0
199-
active_months: int = 0
200-
as_verified_payer: int = 0
201-
as_verified_payee: int = 0
202-
as_candidate_payer: int = 0
203-
as_candidate_payee: int = 0
204-
first_verified_tx_at: str | None = None
205-
last_verified_tx_at: str | None = None
206-
first_candidate_tx_at: str | None = None
207-
last_candidate_tx_at: str | None = None
208-
209-
210-
@dataclass
211-
class Classification:
212-
"""Entity classification from the assess response."""
213-
214-
entity_type: str | None = None
215-
confidence: float = 0.0
216-
is_known: bool = False
217-
is_known_erc8004_agent: bool = False
218-
has_verified_payment_activity: bool = False
219-
has_candidate_payment_activity: bool = False
220-
reasons: list[str] = field(default_factory=list)
221-
222-
223-
@dataclass
224-
class Identity:
225-
"""Known identity links from the assess response."""
226-
227-
ens_name: str | None = None
228-
github_url: str | None = None
229-
website_url: str | None = None
230-
231-
232-
@dataclass
233-
class Reputation:
234-
"""On-chain reputation feedback summary."""
235-
236-
feedback_count: int = 0
237-
client_count: int = 0
238-
trust_avg: float | None = None
239-
uptime_avg: float | None = None
240-
activity_avg: float | None = None
241-
last_feedback_at: str | None = None
242-
243-
244179
@dataclass
245180
class OperatorVerification:
246181
"""Operator verification details from the assess response."""

vulture_whitelist.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,9 @@
99
ex # noqa: F821
1010

1111
# Public API exports
12-
Activity # noqa: F821
1312
AgentScoreGate # noqa: F821
1413
AssessResult # noqa: F821
15-
Classification # noqa: F821
1614
DenialReason # noqa: F821
17-
Grade # noqa: F821
18-
Identity # noqa: F821
19-
Reputation # noqa: F821
20-
ScoreDetail # noqa: F821
21-
ScoreStatus # noqa: F821
2215
OperatorVerification # noqa: F821
2316

2417
# TYPE_CHECKING imports referenced inside string-literal cast() calls

0 commit comments

Comments
 (0)