signer field + signer_sanctions verdict + 2.2.0 - #24
Merged
Conversation
Python-side mirror of agentscore/node-sdk#TBD and the api change in agentscore/core#TBD. Breaking field rename plus a new response type: * assess(resolve_signer=...) -> assess(signer=...) on both sync + async * request body field resolve_signer -> signer (snake_case wire) * ResolveSigner type -> Signer * New SignerSanctions discriminated union: SignerSanctionsClear | SignerSanctionsHit | SignerSanctionsUnavailable * New AssessResponse.signer_sanctions optional field * __init__.py exports updated; ResolveSigner removed from public API No back-compat alias. Callers passing `resolve_signer=...` get a TypeError at call time. The api silently ignores `resolve_signer` request fields if any straggler send them; this SDK won't. Version 2.1.2 -> 2.2.0. Minor bump rather than major because internal consumers (agentscore-commerce + pay) are the primary users and the TypedDict surface catches the rename at type-check time. CLAUDE.md + README + tests updated. 152/152 tests pass; ruff + ty + uv.lock clean. uv.lock refreshed via uv sync --upgrade. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds 6 pytest tests covering the new signer surface end-to-end: - assess(signer=...) forwards the signer in request body - assess() without signer omits it - response carries signer_match + signer_sanctions blocks together - signer_sanctions clear variant - signer_sanctions unavailable variant - aassess(signer=...) async mirror README + CLAUDE.md document the new signer request param and the signer_sanctions discriminated-union response shape, including the fail-closed policy.require_sanctions_clear semantics. SignerSanctionsHit docstring now mentions both sanctions_flagged AND sanctions_check_unavailable for parity with the node-sdk docstring.
… Literal[True]
Brings SignerMatch in line with node-sdk: `kind` is always emitted (it's the
discriminator) so it should be required; the other fields stay NotRequired
since they depend on which kind was emitted. Tightens AssociateWalletResponse
to match wire reality (API only emits true on 2xx; failures raise instead).
Adds 3 new tests:
- assess(signer={address: solana_base58}) preserves base58 case (no lowercasing)
- assess(signer={address: None}) for rails with no wallet signer
- TokenExpiredError raised on 401 even when signer was sent (signer still wired)
agentscore-py 2.2.1 was published in error and yanked on PyPI ("Incorrectly
Published"). 2.2.0 < 2.2.1 means downstream pip resolution would still see
the yank gap; jump straight to 2.3.0 to leapfrog the yanked number AND match
@agent-score/sdk's 2.3.0 cadence (same TEC-295 surface lands on both).
3 tasks
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
Python-side mirror of agentscore/node-sdk#30. Same breaking rename + new types.
assess(resolve_signer=...)→assess(signer=...)on both sync + asyncresolve_signer→signerResolveSignerTypedDict →SignerSignerSanctionsdiscriminated union:SignerSanctionsClear | SignerSanctionsHit | SignerSanctionsUnavailableAssessResponse.signer_sanctionsoptional field__init__.pyexportsResolveSignerremoved;Signer+SignerSanctionsaddedVersion 2.1.2 → 2.2.0 minor bump.
Test plan
uv run pytest tests/— 152/152 passuv run ruff check .cleanuv run ty check agentscore/clean🤖 Generated with Claude Code