Skip to content

Align Python receipt verifier with TypeScript parity for receipt_id semantics#32

Closed
GsCommand wants to merge 1 commit intomainfrom
codex/fix-python-sdk-parity-check-failure
Closed

Align Python receipt verifier with TypeScript parity for receipt_id semantics#32
GsCommand wants to merge 1 commit intomainfrom
codex/fix-python-sdk-parity-check-failure

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • Parity-check reported ts_ok=true but py_ok=false because the Python verifier treated receipt_id_matches=false as fatal, diverging from TypeScript semantics.
  • The intent is to align Python verifier behavior with TypeScript so receipt_id_matches=false is reported but does not make ok=false, while still enforcing required signature/hash/alg/canonical checks.

Description

  • In python-sdk/commandlayer/verify.py removed receipt_id_matches from the ok calculation and added receipt_id_present to the reported checks in both normal and exception paths.
  • In python-sdk/commandlayer/types.py added receipt_id_present: bool to VerifyChecks so the typed result includes the new field.
  • Fixed/adjusted TypeScript SDK surface required to run validation: added ReceiptProtocolMetadata type, corrected CommandResponse/LegacyBlendedReceipt generics and field wiring (signer_id/signerId), updated extractReceiptVerb to use getReceiptVerb, and updated the unit-test fixture to include a canonical verb to satisfy an existing assertion; changes are in typescript-sdk/src/index.ts and typescript-sdk/scripts/unit-tests.mjs.

Testing

  • Ran TypeScript checks and unit tests with cd typescript-sdk && npm run typecheck && npm run build && npm run test:unit, which completed successfully (44 passed, 0 failed).
  • Ran the cross-SDK parity script with node scripts/parity-check.mjs, which reports TypeScript/Python agreement and all parity fixtures passing.
  • All automated test commands listed above succeeded locally.

Codex Task

@GsCommand GsCommand closed this Apr 24, 2026
@GsCommand GsCommand deleted the codex/fix-python-sdk-parity-check-failure branch April 24, 2026 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant