Skip to content

chore: v2.0.1 — invalid_credential DenialCode + test fixture cleanups#19

Merged
vvillait88 merged 5 commits intomainfrom
fix-fake-reason-codes-tests
Apr 30, 2026
Merged

chore: v2.0.1 — invalid_credential DenialCode + test fixture cleanups#19
vvillait88 merged 5 commits intomainfrom
fix-fake-reason-codes-tests

Conversation

@vvillait88
Copy link
Copy Markdown
Contributor

Summary

`sanctions_check_pending` isn't a real API code. The real codes the API emits are `kyc_required`, `kyc_pending`, `kyc_failed`, `sanctions_flagged`, `age_insufficient`, `jurisdiction_restricted` (see `core/api/src/routes/v1/assess.ts`). Test passes either way since the SDK passes reasons through verbatim, but the fake string propagates misinformation about API surface.

Test plan

  • `uv run pytest tests/` — 135 passed, 98.16% coverage

🤖 Generated with Claude Code

vvillait88 and others added 3 commits April 29, 2026 19:49
\`sanctions_check_pending\` isn't a real API code. The real codes are
kyc_required, kyc_pending, kyc_failed, sanctions_flagged, age_insufficient,
jurisdiction_restricted. Test passes either way (the SDK passes reasons
through verbatim), but the fake string propagates misinformation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The commerce gate emits `invalid_credential` on 401 (separate from token_expired —
permanent state, no auto-session). Tests already exercise this code path but the
DenialCode literal was missing it; type checkers would flag any branch on this
value as unreachable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Patch release for additive DenialCode union member (\`invalid_credential\`)
and the \`opc_test_*\` test fixture cleanup. No breaking changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vvillait88 vvillait88 changed the title chore: replace fake reason code in tests with real API code chore: v2.0.1 — invalid_credential DenialCode + test fixture cleanups Apr 30, 2026
vvillait88 and others added 2 commits April 29, 2026 20:39
The SDK now wraps multiple AgentScore APIs (assess + sessions + credentials +
captureWallet, etc.), not just the legacy trust+reputation endpoint. Update
the package description, README tagline, CLAUDE.md, and class docstring.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… node-sdk)

Python's assess() / aassess() previously dropped \`refresh: False\` entirely
(only sent when truthy). Node SDK includes whatever the consumer explicitly
passed. This is a wire-format divergence: agents passing \`refresh=False\`
expecting the field to be present (e.g., to signal "no refresh needed")
got different payloads from the two SDKs.

Change the signature to \`refresh: bool | None = None\` and include in body
when not-None. Default (no kwarg) omits the field as before; explicit
\`refresh=False\` now sends false. Matches node-sdk semantics exactly.

Tests:
- old: refresh=False expected to omit field
- new: refresh=False sends false; default omits field

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vvillait88 vvillait88 merged commit 8ca4a15 into main Apr 30, 2026
7 checks passed
@vvillait88 vvillait88 deleted the fix-fake-reason-codes-tests branch April 30, 2026 03:57
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