Skip to content

Accept Avenia liveness targets without a validation token and tolerate low liquidity in the quote smoke test - #1476

Merged
ebma merged 5 commits into
stagingfrom
fix/avenia-liveness-token
Nov 23, 2026
Merged

ebma merged 5 commits into
stagingfrom
fix/avenia-liveness-token

Conversation

@ebma

@ebma ebma commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Why

Both nightly workflows have been red for more than a week.

external-api-contracts: Avenia no longer returns validateLivenessToken when it creates a SELFIE-FROM-LIVENESS document target. Our response schema required the field. As a result, POST /v1/brla/getUploadUrls and GET /v1/brla/getSelfieLivenessUrl answer 502, as does POST /v1/brl/kyb/documents for a liveness document, and BRL individual KYC can't get past the document step. Nothing reads the token: the frontend, the dashboard and packages/kyc use only livenessUrl. So the field becomes optional and is passed through when Avenia sends it.

e2e: the live quote smoke test fails. On 19, 20 and 23 November only the USDT → BRL SELL quote failed, with "low liquidity" on staging and production. That reflects pool state, not a deployment regression. While it lasts, every nightly is red, and any new failure is hidden behind the known one. The smoke test now treats that exact SELL answer as inconclusive and shows it as a warning annotation on the run. Every other failure, including low liquidity on BUY, still fails the test.

On 21 and 22 November all four quotes, BUY included, answered a generic 500. In the same nights' contract runs a price-feed read reverted. That is a separate issue, this PR does not address it, and such nights stay red.

Changes

  • shared: validateLivenessToken is now optional in the Avenia response schema, in LivenessDocumentResponse, and in the BrGetSelfieLivenessUrlResponse and BrKYCDataUpload wire types. Adds a regression unit test that fails without the fix.
  • api: the live Avenia contract test no longer asserts the token. deployed-quotes.e2e.test.ts turns a low-liquidity SELL (HTTP 500 and the exact message) into a warning annotation instead of a failure. New controller tests cover responses without the token on getSelfieLivenessUrl, getUploadUrls and kyb/documents.
  • docs: updates security spec 05-integrations/brla.md item 27, the smoke-test paragraph in operations-testing.md, vortex.openapi.json with its generated types, and the wire-contract snapshot. In the OpenAPI file the field is now optional, with a provider-neutral description in both schemas. docs:api:check passes, including its secret scan. That file is ready to import into Apidog, which still lists the field as required.

Compatibility

The validateLivenessToken response field of getUploadUrls, getSelfieLivenessUrl and kyb/documents is now omitted when Avenia omits it. Today those routes return 502 in that case, so no working integration loses anything. The SDK surface is unchanged.

Tests

  • After the last two commits, which change only tests and docs: the two changed API test files (80 pass, live cases skipped), bun typecheck, bun verify, docs:api:check and wire-contract:check all pass. The full API suite below was run before them.
  • apps/api full suite (bun run test:coverage): 3,292 pass and the coverage gate passes (lines 84.24%, functions 85.39%). Another worktree's run shared vortex_test at the same time and caused duplicate-key and deadlock failures. Each affected file passed when rerun alone (8 files, 240 tests).
  • packages/shared 333 pass, packages/kyc 86, test:sdk 190, test:consumer-kit 127, test:frontend 236, test:stocks 446, test:gold 71
  • Ran the smoke test live against staging and production (RUN_LIVE_TESTS=1): 6 pass, with both SELL quotes reported as inconclusive
  • Ran contracts.yml on 0d1bfc5c2 (run): 47 pass, 0 fail, 28 skip. The Avenia document test passes live, including the read-back and listing checks
  • bun typecheck, bun verify, docs:api:check and wire-contract:check all pass

ebma added 2 commits November 23, 2026 09:27
Avenia stopped sending validateLivenessToken when it creates a
SELFIE-FROM-LIVENESS document target. The response schema still required it,
so getUploadUrls and getSelfieLivenessUrl answered 502 and the BRL KYC
document step could not start. No client reads the token, so it becomes
optional and is passed through when Avenia sends it.
A drained pool is an operational state, not a deployment regression. While it
lasts, the nightly quote smoke test failed on every run and hid any new
failure behind a known one. Only the exact low-liquidity answer is tolerated
and logged; every other non-201 still fails.
@netlify

netlify Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vortexfi canceled.

Name Link
🔨 Latest commit 0d1bfc5
🔍 Latest deploy log https://app.netlify.com/projects/vortexfi/deploys/6b0486c0258cad27aef0bfab

@netlify

netlify Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vrtx-dashboard canceled.

Name Link
🔨 Latest commit 0d1bfc5
🔍 Latest deploy log https://app.netlify.com/projects/vrtx-dashboard/deploys/6b0486c0af9c5101171e6e36

@netlify

netlify Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vortex-sandbox ready!

Name Link
🔨 Latest commit 0d1bfc5
🔍 Latest deploy log https://app.netlify.com/projects/vortex-sandbox/deploys/6b0486c0fd97f1297705dad5
😎 Deploy Preview https://deploy-preview-1476--vortex-sandbox.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

ebma added 2 commits November 23, 2026 19:32
The exception also covered BUY and matched the message anywhere in any
non-201 body. It now needs a SELL quote, HTTP 500 and the exact message, and
shows as a warning annotation on the run.
Covers getSelfieLivenessUrl, getUploadUrls and kyb/documents, and names
kyb/documents in the spec item, since it parses the same provider response.
@ebma
ebma merged commit 613a04a into staging Nov 23, 2026
7 checks passed
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