You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hardening(identity): typed-empty wins over raw + preserve empty payment_handler config
Three cross-language parity fixes for build_ucp_profile / UCPPaymentHandler:
1. `data.account_verification == {}` (and `data.operator_verification == {}`)
means "API returned the block with no populated values" and now wins over
the `data.raw` fallback. The previous `if not account_verification:` check
treated empty-dict as falsy and bled raw values through. Mirrors the Node
sibling, which reads the typed field directly without consulting raw.
2. `UCPPaymentHandler.to_dict()` always emits `config` (even when empty).
TypeScript serializes `{name: 'tempo', config: {}}` with `config`
preserved; the dataclass default is `field(default_factory=dict)` so the
field is always a dict. The previous `if self.config:` truthy gate
produced byte divergence on explicit `config={}` callers.
3. New `typed-claims` cross-lang fixture exercises the typed-field-only read
path (`AssessResult(account_verification={...}, raw=None)`) that the
existing `data-driven-claims` fixture didn't cover (it uses `raw=`).
Both languages must produce byte-identical canonical bytes for the typed
path or cross-lang verify silently drifts in production.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments