Commit fad1a1b
committed
feat: collapsed signer_match + per-adapter quota/fail-open helpers
Consume @agent-score/sdk's new typed-error and signer-match surface in
agentscore-py 2.1.0. Brings the python merchant SDK to parity with
node-commerce's TEC-275 + TEC-265 work.
Identity / signer matching:
- verify_wallet_signer_match / averify_wallet_signer_match collapse the
prior 3-call gate fan-out into a single /v1/assess call carrying
resolve_signer; the API resolves both wallets server-side and emits a
signer_match verdict in the same response
- Per-(claimed, signer) cache on commerce so repeat lookups skip the API
- Fallback to the legacy 2-resolve path when the API response omits
signer_match (canary rollout safety)
Fail-open + quota helpers across the 6 framework adapters (fastapi,
flask, django, aiohttp, sanic, middleware/ASGI):
- fail_open=True flag on AgentScoreGate / agentscore_gate(); 429 / 5xx /
network-timeout pass through to the handler with degraded=True +
infra_reason on gate state. Compliance denials still deny.
- get_gate_degraded_state(request) reads {degraded, infra_reason?} from
framework-specific state container (g, scope, ctx, request.state, etc.)
- get_gate_quota_info(request) returns the assess quota envelope captured
during evaluate. Read-path-only contract.
Tests:
- tests/test_gate_quota_info.py — cross-adapter quota helper parity
- tests/test_signer_match.py — collapsed surface coverage
- 6 adapter test files updated for fail-open + quota plumbing
Deps:
- agentscore-py 2.0.2 → 2.1.0 (signer_match types, typed errors)
- uv sync --upgrade pulled the rest of the pinned-floor packages
Version: 1.0.3 → 1.1.0 (additive minor, parity with node-commerce).1 parent 0af28a3 commit fad1a1b
22 files changed
Lines changed: 1535 additions & 218 deletions
File tree
- agentscore_commerce/identity
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
103 | 118 | | |
104 | 119 | | |
105 | 120 | | |
| |||
241 | 256 | | |
242 | 257 | | |
243 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
244 | 263 | | |
245 | 264 | | |
246 | 265 | | |
| |||
0 commit comments