Fix Python receipt and verb extraction regressions (PR #36)#37
Closed
Fix Python receipt and verb extraction regressions (PR #36)#37
Conversation
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.
Motivation
x402metadata while commercial/payment envelopes do.verify_receiptreturnsok=Truefor the provided canonical fixturereceipt_valid.jsonby not forcingmetadata.receipt_idto equal the proof hash.extract_receipt_verbreturns the canonical verb when present and falls back to legacy heuristics fromresultshapes for older fixtures.Description
x402emission frombuild_commons_requestand addedx402intobuild_commercial_requestso metadata is present only for commercial flows (python-sdk/commandlayer/client.py).extract_receipt_verbto preferreceipt.verb, thenx402.verb, then legacyresult-based heuristics (e.g.result.summary -> "summarize") to recover expected verb extraction for legacy fixtures (python-sdk/commandlayer/verify.py).receipt_id_matchestreatsmetadata.receipt_idas opaque (no equality requirement withproof.hash_sha256) while preserving hash/signature/canonical checks, restoring successful verification forreceipt_valid.json(python-sdk/commandlayer/verify.py).normalize_command_response(python-sdk/commandlayer/client.py,python-sdk/commandlayer/verify.py).python-sdk/tests/test_public_api.py) and kept other existing tests intact.Testing
cd python-sdk && python -m ruff check .— passed.cd python-sdk && python -m mypy commandlayer— passed.cd python-sdk && python -m pytest tests/ -v— all tests passed (25 passed, 1 warning).node scripts/parity-check.mjs— failed due to TypeScript-side parity/build issues (DTS/type errors and an unrelatedreceiptIdPresent/naming mismatch in the TypeScript build), which are independent of the Python fixes.Codex Task