Skip to content

Support CLAS trust proof signature union and optional metadata.trace in TypeScript SDK#44

Merged
GsCommand merged 1 commit into
mainfrom
codex/update-agent-sdk-for-clas-trust-proof-changes
May 22, 2026
Merged

Support CLAS trust proof signature union and optional metadata.trace in TypeScript SDK#44
GsCommand merged 1 commit into
mainfrom
codex/update-agent-sdk-for-clas-trust-proof-changes

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • CLAS Trust receipt shape now allows metadata.trace and a union for proof.signature (legacy single-signature or multi-signature array), so the SDK must accept and validate both forms while keeping legacy behavior.
  • The TypeScript SDK verifies receipts and the verification logic/tests referenced proof.signature_b64 directly, which breaks new CLAS multi-signature receipts unless guarded.
  • Changes should be minimal and preserve backward compatibility for single-signature receipts.

Description

  • Added typed support for CLAS proof signatures by introducing SingleProofSignature, MultiProofSignature, and ProofSignature to the TypeScript SDK and exposing three helpers: isSingleProofSignature(), isMultiProofSignature(), and getPrimaryProofSignature().
  • Updated verifyReceipt to prefer the new proof.signature primary signature and fall back to the legacy proof.signature_b64 to maintain single-signature compatibility.
  • Extended unit tests to cover optional metadata.trace, multi-signature receipts, primary-signature selection, and malformed multi-signature rejection, and added the new helpers to the test harness.
  • Files changed: typescript-sdk/src/index.ts, typescript-sdk/scripts/unit-tests.mjs, and typescript-sdk/package-lock.json; no vendored schemas.trust-receipt-v1.json was present in this checkout so the schema file was not modified here.

Testing

  • Ran npm install successfully to refresh the lockfile.
  • Ran npm test and unit tests passed with 50 passed, 0 failed and template/CLI-smoke checks also passed.
  • Ran npm run build and generated artifacts and type declarations successfully (DTS build success reported).
  • Ran npm run typecheck (tsc --noEmit) which completed with no errors.

Codex Task

@GsCommand GsCommand merged commit 759f0ab into main May 22, 2026
4 checks passed
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