Skip to content

Commit 3198c84

Browse files
vvillait88claude
andcommitted
docs(ucp): clarify raw fallback as Python-only legacy escape hatch
The previous comment claimed parity with node-commerce read order, but Node has no raw fallback at all. Rewrite to accurately describe the behavior: typed fields are canonical; raw fallback is a Python-only hatch for hand-constructed AssessResult instances and may not verify cross-language. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 63a7ee2 commit 3198c84

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

  • agentscore_commerce/identity

agentscore_commerce/identity/ucp.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -274,15 +274,12 @@ async def ucp_profile():
274274
base_capabilities = list(capabilities or [])
275275

276276
if data is not None and data.resolved_operator:
277-
# Match node-commerce read order: prefer the typed AssessResult fields,
278-
# fall back to ``data.raw`` only when the typed field is ``None`` (absent).
279-
# An explicitly-empty typed dict means "API returned the block with no
280-
# populated values" and wins over raw — same as the Node sibling, which
281-
# reads ``input.data.operator_verification`` / ``input.data.account_verification``
282-
# directly without consulting ``raw``. ``is None`` (not truthy) is the
283-
# correct distinction so a caller hand-constructing
284-
# ``AssessResult(account_verification={}, raw={"account_verification": {...}})``
285-
# gets the same empty-block behavior in both languages.
277+
# Read typed AssessResult fields first (the canonical path). Fall back to
278+
# ``data.raw["operator_verification"]`` / ``data.raw["account_verification"]``
279+
# only when the typed field is ``None``; this is a Python-only legacy
280+
# escape hatch for callers who hand-construct ``AssessResult(raw=..., typed=None)``.
281+
# Node has no equivalent fallback, so profiles built via the raw-only path
282+
# may not verify cross-language. Production callers should populate typed fields.
286283
typed_op = data.operator_verification
287284
operator_verification: dict[str, Any]
288285
if typed_op is None:

0 commit comments

Comments
 (0)