Skip to content

feat: bump x402 profile to 0.2 and sync conformance assets#512

Merged
jithinraj merged 3 commits intomainfrom
feat/x402-conformance-upstream-sync
Mar 13, 2026
Merged

feat: bump x402 profile to 0.2 and sync conformance assets#512
jithinraj merged 3 commits intomainfrom
feat/x402-conformance-upstream-sync

Conversation

@jithinraj
Copy link
Member

@jithinraj jithinraj commented Mar 13, 2026

Summary

Brings x402 conformance assets and adapter-facing docs in line with the current offer-receipt shapes already implemented in @peac/adapter-x402.

Scope

Conformance fixtures, test harness, and x402-facing docs. Includes one exported profile identifier update to keep code and documentation consistent.

Changes

  • Bumps peac-x402-offer-receipt profile identifier to 0.2
  • Rewrites existing x402 conformance fixtures to current shapes
  • Adds receipt, consistency, JWS-hardening, and placeholder-normalization vectors
  • Adds explicit fixture kind routing and metadata validation
  • Syncs x402 profile, adapter docs, and example READMEs with current fields and outputs
  • Mapping and proof-preservation coverage uses direct tests in the harness, not fixture-driven vectors

Notes

Wire compatibility follows current x402 shapes; PEAC-specific normalization and verification policy remain explicit adapter behavior rather than wire redefinition.

Validation

  • build: clean
  • lint: clean
  • typecheck: clean
  • tests: clean
  • guard: clean

Follow-ups

  • Pinned compatibility CI against the target upstream commit
  • Scheduled drift detection
  • Any remaining non-blocking repo-wide x402 doc cleanup

The adapter now uses `peac-x402-offer-receipt/0.2` to reflect the
upstream wire-shape changes (DD-169 through DD-172).
Rewrites all 19 existing fixtures and adds 16 new vectors for the
upstream wire-sync (DD-169 through DD-172):

- offer fixtures: version number, resourceUrl, required scheme,
  per-offer acceptIndex, discriminated JWS/EIP-712 unions
- receipt fixtures: receipt_verification kind with
  resourceUrl/payer/issuedAt/transaction model (5 vectors)
- consistency fixtures: offer-receipt consistency_verification kind
  with resourceUrl and network matching (3 vectors)
- JWS hardening: wrong segment count, padded base64url, non-object
  payload, oversize compact JWS (4 vectors)
- EIP-712 placeholder normalization: validUntil 0, transaction ""
  (2 vectors)
- manifest v0.3.0 with fixture_kinds enum, jws_hardening_rules,
  consistency_rules, placeholder_normalization sections
- explicit kind field on all 35 fixtures with metadata validation
- mapping and proof-preservation coverage uses direct tests (not
  fixture-driven) in the test harness

35 fixtures total (was 19). 68 tests in x402.spec.ts.
Updates X402-PROFILE.md, adapter docs, and example READMEs to reflect
the current offer-receipt wire shapes:

- profile version 0.2 references throughout
- mapping table: resourceUrl, payer, issuedAt, transaction (optional),
  per-offer acceptIndex, proof preservation notes
- error codes table expanded to 25 codes (JWS hardening, receipt
  verification, consistency, EIP-712 placeholder policy)
- conformance fixture inventory updated to 35 vectors
- replay protection updated from txHash-based to
  resourceUrl/payer/issuedAt model
- CryptoVerifier and SignerAuthorizer interface documentation
- example output updated (removed txHash, added new fields)
@jithinraj jithinraj changed the title test(x402): conformance vectors and docs for current offer-receipt shapes feat(x402): bump profile to 0.2 and sync conformance assets Mar 13, 2026
@jithinraj jithinraj changed the title feat(x402): bump profile to 0.2 and sync conformance assets feat: bump x402 profile to 0.2 and sync conformance assets Mar 13, 2026
@jithinraj jithinraj merged commit e17fcef into main Mar 13, 2026
14 checks passed
@jithinraj jithinraj mentioned this pull request Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant