python-commerce 2.5.7: in-range deps + ty unpin + malformed-credential 402 fix - #89
Merged
Conversation
…sentry-sdk, etc.) ty stays pinned at 0.0.56 (deliberate hold). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rolls out the redis 8 runtime bump plus in-range dependency maintenance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Brings python-commerce in line with the fleet (python-sdk, core/pipeline, core/store all float ty>=0.0.32). ty 0.0.60 tightened protocol-assignability checking; starlette 1.3.1's Headers.get no longer matched HeadersLike.get. Fix: narrow the protocol's get to its actual single-arg usage (get(key, /) -> str | None), which starlette Headers and multidict both satisfy. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… flag) The bot flagged the bare '...' stub body as 'statement has no effect' on the changed line; a docstring body is a real statement, satisfies the bot, and self-documents the protocol methods. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Declared but never read (the Python solana MPP method is unwired), and it configured the self-referential-split mechanism node-commerce just abandoned (@solana/mpp 0.7.0 rejects it; the static-treasury path is the only viable one). Drops the field, its comment, and the CLAUDE.md/README prose for parity with node-commerce. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…not 400 Parity with node-commerce. A junk or rejected payment credential on POST /purchase returned 400, which x402/MPP clients version-route as fatal and don't retry. Both dead-end paths now return a 402 the agent re-pays against: - Malformed-shape credential: emit a fresh discovery 402 via _emit_fresh_challenge(_discovery_view(ctx)); _discovery_view strips the junk credential so recipient minting + compose take their fresh path rather than binding garbage. pre_validate + the gate/assess stay skipped. - MPP compose-reject on settle: return the fresh challenge pympp already emitted as 402 instead of 400. x402 settle-verify failures (forged payTo) still 400 unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
In-range dependency upgrades (uv.lock only; no pyproject constraint changes). fastapi, anyio, asgiref, solders, solana, stripe, sentry-sdk, typer, httpx2/httpcore2, ruff, etc.
ty stays pinned at 0.0.56 (deliberate hold; newer ty adds churn-prone diagnostics).
Verified locally: ruff check, ruff format --check, ty check (clean), vulture, pytest (1834 passed, 95.49% coverage).
🤖 Generated with Claude Code
Also unpins
ty(==0.0.56->>=0.0.32) to match the rest of the python fleet. ty 0.0.60 tightened protocol-assignability checking; starlette 1.3.1Headers.getno longer matched theHeadersLikeprotocol, soHeadersLike.getis narrowed to its actual single-arg usage (get(key, /) -> str | None). Full gate green at ty 0.0.60: ruff, format, ty, vulture, pytest (1834 passed, 95.49%).Also: malformed-credential 402 fix (parity with node-commerce #82). Stripe/MPP-team store feedback: a junk or rejected payment credential on POST /purchase returned 400, which x402/MPP clients abort on. Now returns a 402 with a fresh challenge, both for the malformed-shape pre-check (emit a fresh discovery 402, stripping the junk credential so minting/compose take the fresh path; pre_validate + gate/assess stay skipped) and the MPP compose-reject path (return the challenge pympp already emitted as 402). x402 settle-verify failures (forged payTo) still 400. Rides this 2.5.7 release (no extra bump). Gate green: ruff/format/ty/vulture/pytest (1834 passed, 95.49%).