Skip to content

feat(TASK-25073): Avenia terms step at Pix setup - #4143

Draft
abalinda wants to merge 8 commits into
devfrom
feat/TASK-25073-avenia-terms-step
Draft

abalinda wants to merge 8 commits into
devfrom
feat/TASK-25073-avenia-terms-step

Conversation

@abalinda

@abalinda abalinda commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Parked on 17 Nov 2026: the owner ruled acceptance by use for now. Kept as a draft in case the in-app acceptance step returns.

Summary

Peanut's Terms of Service will say that a user accepts Avenia's terms in the app when they set up Pix. On 17 Nov the owners reversed the 14 Nov ruling: users accept Avenia's terms once, at Pix setup. Users who already have an Avenia account accept them at their next Pix use.

This PR puts back the terms step that fd50ab1a4 ("Avenia's Pix opens on first use with no tap and no terms") removed. It restores only the terms acceptance. Avenia's hosted identity check stays removed, because Avenia still relies on Peanut's identity check.

Restored unchanged from fd50ab1a4^:

  • useRouteTermsAcceptance and its test (accept, 409 ROUTE_NOT_AVAILABLE, 500 termsNotSaved, other failures to Sentry). One guard was added (Chip): after a 409, if the capabilities read still names the same terms key, the user sees "unavailable" and Sentry gets one event, so a tap never loops silently. When the route has moved on, nothing shows, as before.
  • consentApi.acceptRouteTerms (POST /users/kyc/accept-terms).
  • The terms state of PixSetup: Pix mark, title, body, "Account provider · Avenia", and the error callout. A provider this build has no record of still goes to support.
  • Copy keys pix.setup.body and termsNotSaved in en, es-419 and pt-BR, and termsNotSaved in es-AR, as they were. es-AR had no body before either. title was never removed.
  • The demo-api POST /users/kyc/accept-terms route, and the p80-pix-terms-not-saved Screen Library state.

Changed, because today's code forces it:

  • Two signals, one step. pixRouteTerms reads either the route's new terms: { key, url } (soft signal, on any state, ready included) or an action_required route whose action is an accept-tos next action (the shape used until 14 Nov). pixSetupState returns accept-terms for both, so the API can switch between them without an app release.
  • Order in pixSetupState: verify, then terms, then activate, pending, ready. A ready route that still carries terms gives the terms step.
  • No bodyBeforeVerification. The identity check now always comes first, so the user on the terms screen is already verified.
  • After acceptance the hook reads the capabilities again. A user with no Avenia account then goes straight to the account opening that runs with no tap (pixOpensWithoutTap), with no extra tap.
  • Consent screen order and button (design.md consent screens, rules 2 and 4; Chip). The linked terms sentence now sits above the button, under the title block. The button says "Agree and continue" (new key pix.setup.acceptCta; es-AR falls back to es-419), because it records the consent.
  • Terms sentence (pix.setup.terms), now localized around the provider's brand. The old sentence used the English-only termsName, so pt-BR read "Ao continuar, você aceita os Avenia terms and conditions.":
    • en: "To use Pix, agree to the Avenia terms and conditions."
    • es-419: "Para usar Pix, acepta los términos y condiciones de Avenia."
    • es-AR: "Para usar Pix, aceptá los términos y condiciones de Avenia."
    • pt-BR: "Para usar o Pix, aceite os termos e condições da Avenia."
  • The link uses the URL the route gives (terms.url or nextActions[].tosUrl), with the provider record's termsUrl as the fallback, as before.
  • CapabilityRoute gets an optional terms field next to the generated contract type, until the API's OpenAPI carries it.
  • New fixtures: pix-setup-terms (new user; the not-saved capture taps "Agree and continue" on it) and pix-withdraw-terms (existing account, ready route plus terms). The old terms fixture name pix-first-use now shows the account opening, so it stays as it is.

Per-attempt gate (usePixFlowSetupState(route, paymentOpened)). Add money (PixDepositFlow), withdraw and send to a Pix key (PixWithdrawFlow), and a Pix QR payment (useQrPayRoute / QrPayPage) all read their readiness from this hook. The hook replaces their old route.state === 'ready' check. The rule: terms never replace the screens of a payment that is already opened, and every new attempt asks for them.

  • An opened payment: a deposit code (intentId), an opened withdrawal or its outcome. Its screens are never replaced, whatever a later read brings.
  • A form that started with the route ready (amount, key, review) is not replaced either. Its attempt simply had no terms when it started.
  • A new attempt starts when the opened payment closes, for example with "Start new deposit" or "Try again". It asks for the terms first. A Pix QR payment is one attempt per scan, because the page mounts again for each scan.
  • Every other step (verify, activate, pending) still takes over a running flow, as before. Nothing outside these Pix flows reads terms.

Task

TASK-25073

Risks / breaking changes

  • ⚠️ The API side is not on dev yet. No route carries terms today, and no route sends the accept-tos action. Until the API ships, this PR changes nothing for users. Fixtures and unit tests cover the behaviour. POST /users/kyc/accept-terms already exists on API dev.
  • What a user with a running flow sees: a user on a form that started without terms, or on an opened payment, keeps that screen. Their next attempt, in the same mount or a new one, shows the terms first, and then the flow they opened continues.
  • Limit of the gate: a form that started before the terms appeared can still open one payment without them, and the soft signal does not refuse it. Under the hard signal, the API's refusal shows at submit as the flow's normal error, and the next attempt asks for the terms.
  • Any capabilities shape works with both signals, so the API can move from the soft signal to the hard one with no app release.
  • Wordiness baseline raised on purpose. add-money/pix goes from 124 to 146 and withdraw/pix from 159 to 181, which is the restored and reworded consent copy. Before fd50ab1a4 the baselines were 161 and 246.
  • ReConsentModal is untouched. NEXT_PUBLIC_API_VERSION is unchanged.

QA

  • Unit tests:
    • pixFlow.utils.test.ts: pixSetupState and pixRouteTerms with both signals, ready plus terms, and set-aside.
    • useRouteTermsAcceptance.test.ts: accept, 409 with the route moved on, 409 with the terms still named, 500, and other failures.
    • PixSetup.test.tsx: link and name before the button; "Agree and continue" sends the POST, the capabilities are read again, and the account opens with no tap; a failed save shows termsNotSaved; the hard signal; an unknown provider.
    • usePixFlowSetupState.test.ts: an existing user gets the terms at entry and then the flow; a running flow is not replaced in either shape; an opened payment keeps its screen and the next attempt asks; other steps still apply.
    • PixDepositFlow.terms.test.tsx: terms arrive while a deposit code is on screen; the code stays, and "Start new deposit" opens the terms step, not the amount form.
    • useQrPayRoute.test.tsx: a ready route with terms gets setup; terms after entry keep the flow.
  • e2e e2e/flows/pix.spec.ts: the terms step names and links Avenia's terms (pix-setup-terms); an existing account meets the terms before the withdrawal key step (pix-withdraw-terms).
  • Screenshots: ⚠️ none posted. The dispatched ds-shots run (44141166736) captured pix-setup-terms, pix-withdraw-terms and p80-pix-terms-not-saved at 320 and 430 px with no errors. The run still failed on 9 states that fail on the base (dev) commit too, such as pix-withdraw-key and p81-pix-deposit-limit. Because of that, no diff comment was published, and the regression e2e step (which includes pix.spec.ts) did not run.
  • Manual check once the API ships (sandbox only): open add money by Pix with a new BR user, accept the terms, and watch the account open with no tap. Then open withdraw with an existing Avenia user and confirm that the terms come first and the key step follows.

🤖 Generated with Claude Code

…call

The owners reversed the 14 Nov ruling on 17 Nov: users accept Avenia's
terms once, at Pix setup. This puts back useRouteTermsAcceptance and
consentApi.acceptRouteTerms as fd50ab1 removed them, and types the
route's new optional terms { key, url } until the generated contract
carries it.
…I signal

The Pix setup shows Avenia's terms again, after the identity check and
before the account opening, with the restored copy in four locales.
pixSetupState reads the route's terms (on any state, ready too) and the
older accept-tos next action as one step, so the API can move between
them without an app release. After acceptance the capabilities are read
again and a new user goes on to the no-tap account opening.
…Pix use

Add money, withdraw, a Pix-key send and a Pix QR payment read their
readiness from usePixFlowSetupState. Terms gate a flow only at its entry:
once the route read ready, terms a later capabilities read brings are set
aside, so a running flow is never torn down mid-form; the next entry asks.
The withdraw reload test now keeps its key lookup in flight, since the
extra render let an unmocked lookup resolve.
pix-setup-terms (new user) and pix-withdraw-terms (existing account) let
ds-shots capture the terms screen; p80 captures the acceptance not
saved again. The demo-api answers POST /users/kyc/accept-terms so the
strict Screen Library capture does not fail.
@notion-workspace

Copy link
Copy Markdown

@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
peanut-wallet Ready Ready Preview Nov 17, 2026 7:49pm UTC

Request Review

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 11390.67 → 11399.52 (+8.85)
Findings: +7 net (+67 new, -60 resolved)

🆕 New findings (67)

  • critical complexity — src/utils/demo-api.ts — CC 222, MI 57.1, SLOC 1642
  • critical complexity — src/features/pix/components/PixWithdrawFlow.tsx — CC 132, MI 53.7, SLOC 310
  • critical complexity — src/dev/fixtures/registry.ts — CC 100, MI 31.93, SLOC 6005
  • critical method-complexity — src/features/pix/components/PixWithdrawFlow.tsx:58 — PixWithdrawFlow CC 86 SLOC 215
  • critical complexity — src/dev/screens/pages.ts — CC 1, MI 22.23, SLOC 332
  • high hotspot — src/dev/fixtures/registry.ts — 244 commits, +8550/-2101 lines since 6 months ago
  • high hotspot — src/utils/demo-api.ts — 97 commits, +1925/-483 lines since 6 months ago
  • high complexity — src/features/pix/components/PixDepositFlow.tsx — CC 36, MI 55.47, SLOC 152
  • high method-complexity — src/utils/demo-api.ts:1266 — demoRespond CC 34 SLOC 132
  • medium high-mdd — src/features/pix/components/PixWithdrawFlow.tsx:58 — PixWithdrawFlow: MDD 114.9 (uses across many lines from declarations)
  • medium high-dlt — src/features/pix/components/PixWithdrawFlow.tsx:58 — PixWithdrawFlow: DLT 61 (calls 61 distinct functions — high context load)
  • medium high-mdd — src/features/pix/components/PixDepositFlow.tsx:49 — PixDepositFlow: MDD 59.0 (uses across many lines from declarations)
  • medium high-mdd — src/utils/demo-api.ts:1266 — demoRespond: MDD 37.4 (uses across many lines from declarations)
  • medium high-dlt — src/features/pix/components/PixDepositFlow.tsx:49 — PixDepositFlow: DLT 36 (calls 36 distinct functions — high context load)
  • medium high-mdd — src/features/pix/components/PixSetup.tsx:32 — PixSetup: MDD 36.2 (uses across many lines from declarations)
  • medium high-mdd — src/dev/fixtures/registry.ts:380 — mantecaPixResponses: MDD 35.0 (uses across many lines from declarations)
  • medium structural-dup — dev/fixtures/registry.ts:5699 — 26 duplicate lines / 97 tokens with dev/fixtures/registry.ts:5731
  • medium high-mdd — src/dev/fixtures/registry.ts:665 — aveniaNonResidentResponses: MDD 25.7 (uses across many lines from declarations)
  • medium high-mdd — src/dev/fixtures/registry.ts:1853 — addressStepResponse: MDD 23.2 (uses across many lines from declarations)
  • medium structural-dup — dev/fixtures/registry.ts:2535 — 22 duplicate lines / 72 tokens with dev/fixtures/registry.ts:4893

…and 47 more.

✅ Resolved (60)

  • src/utils/demo-api.ts — CC 221, MI 57.07, SLOC 1636
  • src/features/pix/components/PixWithdrawFlow.tsx — CC 131, MI 53.78, SLOC 308
  • src/dev/fixtures/registry.ts — CC 98, MI 31.59, SLOC 5978
  • src/features/pix/components/PixWithdrawFlow.tsx:57 — PixWithdrawFlow CC 85 SLOC 213
  • src/dev/screens/pages.ts — CC 1, MI 22.44, SLOC 326
  • src/dev/fixtures/registry.ts — 243 commits, +8520/-2101 lines since 6 months ago
  • src/utils/demo-api.ts — 96 commits, +1923/-483 lines since 6 months ago
  • src/features/pix/components/PixDepositFlow.tsx — CC 36, MI 55.55, SLOC 151
  • src/utils/demo-api.ts:1264 — demoRespond CC 34 SLOC 132
  • src/features/pix/components/PixWithdrawFlow.tsx:57 — PixWithdrawFlow: MDD 115.3 (uses across many lines from declarations)
  • src/features/pix/components/PixWithdrawFlow.tsx:57 — PixWithdrawFlow: DLT 60 (calls 60 distinct functions — high context load)
  • src/features/pix/components/PixDepositFlow.tsx:48 — PixDepositFlow: MDD 59.0 (uses across many lines from declarations)
  • src/utils/demo-api.ts:1264 — demoRespond: MDD 37.4 (uses across many lines from declarations)
  • src/dev/fixtures/registry.ts:362 — mantecaPixResponses: MDD 35.0 (uses across many lines from declarations)
  • src/features/pix/components/PixDepositFlow.tsx:48 — PixDepositFlow: DLT 35 (calls 35 distinct functions — high context load)
  • dev/fixtures/registry.ts:5669 — 26 duplicate lines / 97 tokens with dev/fixtures/registry.ts:5701
  • src/dev/fixtures/registry.ts:647 — aveniaNonResidentResponses: MDD 25.7 (uses across many lines from declarations)
  • src/dev/fixtures/registry.ts:1835 — addressStepResponse: MDD 23.2 (uses across many lines from declarations)
  • dev/fixtures/registry.ts:2517 — 22 duplicate lines / 72 tokens with dev/fixtures/registry.ts:4863
  • dev/fixtures/registry.ts:3199 — 21 duplicate lines / 65 tokens with dev/fixtures/registry.ts:3237

…and 40 more.

📈 Painscore deltas (top movers)

File Before After Δ
src/hooks/useRouteTermsAcceptance.ts 0.0 6.2 +6.2
src/features/pix/usePixFlowSetupState.ts 0.0 4.4 +4.4
src/features/pix/pixRouteStep.ts 3.0 4.2 +1.2

…stored terms copy

The terms step's title, body, terms line and not-saved error add 16-17
words to the Pix add-money and withdraw pages. The growth is deliberate:
it is the consent copy fd50ab1 removed, and design.md requires the
terms to be named and linked before the tap.
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • ✅ unit: 22468 ran, 0 failed, 0 skipped, 9.9m

📊 Coverage (unit)

metric %
statements 88.8%
branches 82.1%
functions 83.1%
lines 90.3%
⏱ 10 slowest test cases
time test
🐢 25.7s scripts/__tests__/screens-adapter.test.js › runs the existing synthetic screen adapter Node acceptance suite
🐢 13.6s src/features/deposit-accounts/__tests__/AddMoneyArgentinaCountry.acceptance.test.tsx › keeps unavailable Argentina searchable and opens its residence explanation with pointer
🐢 12.8s src/features/deposit-accounts/__tests__/AddMoneyArgentinaCountry.acceptance.test.tsx › keeps unavailable Argentina searchable and opens its residence explanation with Space
🐢 12.4s src/features/deposit-accounts/__tests__/AddMoneyArgentinaCountry.acceptance.test.tsx › keeps unavailable Argentina searchable and opens its residence explanation with Enter
🐢 9.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › Network failure keeps loading while retries remain, then shows the generic error
🐢 6.8s src/features/deposit-accounts/__tests__/AddMoneyArgentinaCountry.acceptance.test.tsx › preserves ordinary Argentina selection for residence null
🐢 5.8s scripts/__tests__/indexable-urls.test.ts › excludes missing locale files, drafts, redirects, and retired pages from crawl and submission lists
🐢 5.5s scripts/__tests__/signup-attribution-paths.test.ts › includes newly published articles and locale fallbacks without editing the manifest
🐢 5.1s src/features/deposit-accounts/__tests__/AddMoneyArgentinaCountry.acceptance.test.tsx › preserves ordinary Argentina selection for residence AR
4.0s src/features/payments/flows/qr-pay/__tests__/usePixPayment.test.tsx › a payment still waiting for its signature, with no device mark, reads as processing until the API ends it
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

@abalinda

Copy link
Copy Markdown
Contributor Author

/chip review

@chip-peanut-bot chip-peanut-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chip review — no blocking findings — this is not an approval

Two major findings: a new deposit attempt can bypass newly arrived terms, and the consent-recording control reads as navigation.

Findings

  • MAJOR · src/features/pix/usePixFlowSetupState.ts:22 · Ask for newly required terms before another deposit attempt
    If a ready route gains the soft terms signal while an existing Pix QR code is open, started remains true. After that code expires or is returned, “Start new deposit” only changes URL state; PixDepositFlow stays mounted, so this hook still sets the terms aside and exposes the amount form for a new deposit. The planned soft API signal does not refuse that create, so a second deposit can begin without the required acceptance. Reset the set-aside state when a new attempt starts, while preserving the already-open intent screen.

  • MAJOR · src/features/pix/components/PixSetup.tsx:90 · Label the Pix consent action as acceptance
    On this screen, the only consent control is labeled “Continue”, but its tap directly calls terms.accept() and records legal acceptance; unlike the card flow, there is no separate agreement checkbox. A user expecting navigation can therefore record consent with that tap. design.md → consent screens #4 reserves “Continue” for a button that only opens the next screen and calls for the consent-recording control to say “accept” or “agree”. Use a localized acceptance label and put the named document link before the action.

  • MAJOR · src/features/pix/pixRouteStep.ts:49 · Copy now wrong: Brazil Pix requirements omit the new Avenia terms acceptance
    After this change: A Brazil resident who uses Pix must accept Avenia's provider terms once, at Pix setup (or at their next Pix use if already set up), before the Avenia account opens.

These places still say otherwise:

  • mono:content/help/verification/en.md:50 — "If you live in Brazil, Pix also asks for your CPF and home address." → If you live in Brazil, Pix also asks for your CPF and home address, and you accept Avenia's terms once before your first Pix use.
  • mono:content/help/verification/en.md:56 — "Pix payments do too; residents of Brazil also add their CPF and home address." → Pix payments do too; residents of Brazil also add their CPF and home address, and accept Avenia's terms once.
  • mono:content/help/verification/es-419.md:52 — "Si vives en Brasil, Pix también te pide tu CPF y tu domicilio." → Si vives en Brasil, Pix también te pide tu CPF y tu domicilio, y aceptas una vez los términos de Avenia.
  • mono:content/help/verification/es-419.md:58 — "quienes viven en Brasil agregan además su CPF y su domicilio." → quienes viven en Brasil agregan además su CPF y su domicilio, y aceptan una vez los términos de Avenia.
  • mono:content/help/verification/pt-br.md:52 — "Se você mora no Brasil, o Pix também pede seu CPF e seu endereço." → Se você mora no Brasil, o Pix também pede seu CPF e seu endereço, e você aceita uma vez os termos da Avenia.
  • mono:content/help/verification/pt-br.md:58 — "quem mora no Brasil informa ainda o CPF e o endereço." → quem mora no Brasil informa ainda o CPF e o endereço, e aceita uma vez os termos da Avenia.
  • mono:product/kyc.md:172 — "A resident of Brazil pays Pix through an Avenia account, which also needs a CPF and a home address." → A resident of Brazil pays Pix through an Avenia account, which also needs a CPF, a home address and one acceptance of Avenia's terms.
  • mono:product/kyc.md:204 — "relies on Peanut's verification, needs a CPF and a home address" → relies on Peanut's verification, needs a CPF, a home address and one acceptance of Avenia's terms
  • mono:product/support-answers/deposits-brazil-pix.md:58 — "Brazil the Avenia account now opens at the first Pix use, with the prompts above." → Brazil the Avenia account now opens at the first Pix use, after the Avenia terms step, with the prompts above.

Fix them in this pull request, or say where the fix goes. mono: copy ships to mono main as its own content change, never inside a code PR.

  • MAJOR · src/hooks/useRouteTermsAcceptance.ts:45 · [claude-opus] Existing users with a ready route get a silent 409 loop at the terms step unless the unseen API PR relaxes the accept-terms check
    The PR shows the terms to an existing Avenia user whose route is ready but carries the new optional terms field (pixRouteStep.ts pixRouteTerms/pixSetupState; usePixFlowSetupState). It then POSTs { key: terms.key } to /users/kyc/accept-terms. On peanut-api-ts's policy branch, src/routes/user/accept-terms.ts:49-55 calls routeFor() and returns 409 ROUTE_NOT_AVAILABLE unless candidate.action === request.body.key. A ready candidate has no action (src/routing/rank.ts:168-169 returns { state: 'ready' }), so the API refuses every acceptance from an existing user. useRouteTermsAcceptance.ts treats that 409 as 'the route moved on': it calls fetchUser() and returns with no error. Capabilities still contain terms, so the terms screen comes back and the user taps again, gets another 409, and is stuck with no message and no Sentry event. On the policy branch Avenia is also enrolment: 'on-approval' with no terms (src/avenia/provider.ts:55), so its key would get a 404 'No such terms'. Routes also carry no terms field there, which is why the UI types it by hand in src/types/capabilities.ts. The API half is presumably an open peanut-api-ts PR this checkout cannot show. Fix: that PR must (a) give Avenia terms and emit routes[].terms, and (b) let accept-terms accept the key when the route is ready but the terms are not yet recorded. Confirm that before merging this PR. As a guard, have the UI raise an error or send a Sentry event when a 409 is followed by a capabilities read that still names the same terms key, instead of returning silently.

Checked clean

  • Exact head and base matched; core CI checks passed.
  • Screenshot capture failed on both base and head; the three new terms states passed at both captured widths. The two new Pix flow e2e cases were not run in that job.
  • Read the linked task and the API policy-branch consent endpoint; the API terms signal is a separate in-progress change.
  • Compared changed translations with English, locale fallback, and locale glossaries; no meaning drift found.
  • Reviewed design.md consent-screen rules and the changed terms screen.

Security review by moonshotai/kimi-k3: 0 finding(s), marked with the model name. It reads the diff only and answers only security, privacy and money, so treat its findings as advice.

Third opinion by claude-opus: 1 finding(s), marked with the model name. It answers only product truth, missing tests and the cross-repo contract, so treat its findings as advice.

Copy check by claude-haiku-5-5: 1 finding(s), titled "Copy now wrong". Every quoted passage was checked against the file.

Exact head: 8a82b4711793 · Context: repo, api, design, notion, lexicon · Took 5m

useEffect(() => {
if (state === 'ready') setStarted(true)
}, [state])
return started ? pixSetupState(route, nextActions, { setAsideTerms: true }) : state

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR: Ask for newly required terms before another deposit attempt

If a ready route gains the soft terms signal while an existing Pix QR code is open, started remains true. After that code expires or is returned, “Start new deposit” only changes URL state; PixDepositFlow stays mounted, so this hook still sets the terms aside and exposes the amount form for a new deposit. The planned soft API signal does not refuse that create, so a second deposit can begin without the required acceptance. Reset the set-aside state when a new attempt starts, while preserving the already-open intent screen.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5c901be: the gate's latch now ends when the opened payment closes, so Start new deposit (and every other new attempt) asks for the terms, while an opened payment keeps its screens.

disabled={terms.isAccepting}
onClick={() => void terms.accept()}
>
{tCommon('continue')}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR: Label the Pix consent action as acceptance

On this screen, the only consent control is labeled “Continue”, but its tap directly calls terms.accept() and records legal acceptance; unlike the card flow, there is no separate agreement checkbox. A user expecting navigation can therefore record consent with that tap. design.md → consent screens #4 reserves “Continue” for a button that only opens the next screen and calls for the consent-recording control to say “accept” or “agree”. Use a localized acceptance label and put the named document link before the action.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 25a4b30: the linked terms sentence now sits above the button, which says "Agree and continue", and the sentence is localized around the provider's brand.

Comment thread src/features/pix/pixRouteStep.ts Resolved
…e and continue button

design.md consent screens: the document comes before the action, and only
the control that records consent says agree (Chip). The linked sentence
moves above the button and is localized around the provider's brand; the
English-only termsName made pt-BR read 'você aceita os Avenia terms and
conditions'. The wordiness baseline takes the 5-6 words this adds.
…pened payment

The entry latch lasted the whole mount, so Start new deposit opened the
amount form without the terms that arrived meanwhile (Chip). The latch now
ends when the opened payment closes: an opened deposit code, withdrawal
or its outcome keeps its screens, and the next attempt asks first.
…says so

A 409 whose capabilities read still names the same terms key would make
every tap loop silently (Chip). The user now sees the unavailable line
and Sentry gets one event; a route that moved on stays silent as before.
@abalinda

Copy link
Copy Markdown
Contributor Author

/chip review

@chip-peanut-bot chip-peanut-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chip review — no blocking findings — this is not an approval

The two earlier UI findings are fixed. The documentation follow-up was explicitly deferred; no new blocking defect was confirmed.

Findings

  • MAJOR · src/features/pix/pixRouteStep.ts:49 · Copy now wrong: Pix setup and CPF/address requirement lists omit the Avenia terms step
    After this change: A Brazil resident's Pix (deposit, withdrawal, send or QR payment) now needs a one-time acceptance of Avenia's terms on the Pix setup screen, after identity and before the Avenia account opens, and any Pix attempt while the route still names the terms gets that screen.

These places still say otherwise:

  • mono:product/kyc.md:172 — "A resident of Brazil pays Pix through an Avenia account, which also needs a CPF and a home address." → A resident of Brazil pays Pix through an Avenia account, which also needs a CPF and a home address, and the user accepts the Avenia terms once before the first Pix.
  • mono:product/kyc.md:195 — "else at the first Pix use (about 6 seconds)." → else at the first Pix use, after the user accepts the Avenia terms once on the Pix setup screen (about 6 seconds).
  • mono:product/kyc.md:204 — "relies on Peanut's verification, needs a CPF and a home address" → relies on Peanut's verification, needs a CPF and a home address, and the user accepts the Avenia terms once
  • mono:product/support-answers/deposits-brazil-pix.md:34 — "on file gets the CPF step; one with no home address gets the address step." → on file gets the CPF step; one with no home address gets the address step; then, once, the user accepts the Avenia terms on the Pix setup screen before the account opens.
  • mono:product/support-answers/send-to-pix-key-brazil.md:59 — "account (CPF and home address) and its monthly limit applies." → account (CPF and home address, and acceptance of the Avenia terms once) and its monthly limit applies.
  • mono:product/support-answers/residence-country-and-tax-id.md:28 — "If you live in Brazil, Pix also needs your CPF and home address." → If you live in Brazil, Pix also needs your CPF and home address, and you accept the Avenia terms once.
  • mono:product/support-answers/residence-country-and-tax-id.md:57 — "account, which needs a CPF and a home address" → account, which needs a CPF, a home address and one acceptance of the Avenia terms
  • mono:content/pay-with/pix/en.md:82 — "If you live in Brazil, the app asks for your CPF and home address before your first Pix." → If you live in Brazil, the app asks for your CPF and home address, then has you accept the Avenia terms once, before your first Pix.
  • mono:content/pay-with/pix/pt-br.md:83 — "Se você mora no Brasil, o app pede seu CPF e seu endereço antes do primeiro Pix." → Se você mora no Brasil, o app pede seu CPF e seu endereço e depois o aceite dos termos da Avenia, antes do primeiro Pix.
  • mono:content/pay-with/pix/es-419.md:83 — "Si vives en Brasil, la app te pide tu CPF y tu domicilio antes del primer Pix." → Si vives en Brasil, la app te pide tu CPF y tu domicilio, y luego que aceptes los términos de Avenia, antes del primer Pix.
  • mono:content/pay-with/pix/es-ar.md:84 — "Si vivís en Brasil, la app te pide tu CPF y tu domicilio antes del primer Pix." → Si vivís en Brasil, la app te pide tu CPF y tu domicilio, y luego que aceptes los términos de Avenia, antes del primer Pix.
  • mono:content/pay-with/pix/es-es.md:79 — "Si vives en Brasil, la app te pide tu CPF y tu domicilio antes del primer Pix." → Si vives en Brasil, la app te pide tu CPF y tu domicilio, y luego que aceptes los términos de Avenia, antes del primer Pix.
  • mono:content/pay-with/pix/en.md:65 — "If you live in Brazil, Pix also needs your CPF and home address." → If you live in Brazil, Pix also needs your CPF and home address, and your acceptance of the Avenia terms once.
  • mono:content/pay-with/pix/pt-br.md:66 — "Se você mora no Brasil, o Pix também pede CPF e endereço." → Se você mora no Brasil, o Pix também pede CPF e endereço, e o aceite único dos termos da Avenia.
  • mono:content/pay-with/pix/es-419.md:66 — "Si vives en Brasil, Pix también te pide CPF y domicilio." → Si vives en Brasil, Pix también te pide CPF y domicilio, y aceptar una vez los términos de Avenia.
  • mono:content/pay-with/pix/es-ar.md:67 — "Si vivís en Brasil, Pix también te pide CPF y domicilio." → Si vivís en Brasil, Pix también te pide CPF y domicilio, y aceptar una vez los términos de Avenia.
  • mono:content/pay-with/pix/es-es.md:62 — "Si vives en Brasil, Pix también te pide CPF y domicilio." → Si vives en Brasil, Pix también te pide CPF y domicilio, y aceptar una vez los términos de Avenia.
  • mono:content/pay-with/pix/en.md:59 — "That withdrawal needs verified Brazilian residence and a CPF." → That withdrawal needs verified Brazilian residence, a CPF and the one-time acceptance of the Avenia terms.
  • mono:content/pay-with/pix/pt-br.md:60 — "Esse saque exige residência brasileira verificada e CPF." → Esse saque exige residência brasileira verificada, CPF e o aceite único dos termos da Avenia.
  • mono:content/pay-with/pix/es-419.md:60 — "Ese retiro requiere residencia brasileña verificada y CPF." → Ese retiro requiere residencia brasileña verificada, CPF y aceptar una vez los términos de Avenia.
  • mono:content/pay-with/pix/es-ar.md:61 — "Ese retiro requiere residencia brasileña verificada y CPF." → Ese retiro requiere residencia brasileña verificada, CPF y aceptar una vez los términos de Avenia.
  • mono:content/pay-with/pix/es-es.md:56 — "Ese retiro requiere residencia brasileña verificada y CPF." → Ese retiro requiere residencia brasileña verificada, CPF y aceptar una vez los términos de Avenia.
  • mono:content/countries/brazil/en.md:61 — "If you live in Brazil, Pix also needs your CPF and home address" → If you live in Brazil, Pix also needs your CPF, your home address and your acceptance of the Avenia terms, and you can add and withdraw BRL by Pix.
  • mono:content/countries/brazil/en.md:65 — "That withdrawal needs verified Brazilian residence and a CPF." → That withdrawal needs verified Brazilian residence, a CPF and the one-time acceptance of the Avenia terms.
  • mono:content/countries/brazil/en.md:80 — "If you live in Brazil, the app also asks for your CPF." → If you live in Brazil, the app also asks for your CPF and has you accept the Avenia terms once.
  • mono:content/countries/brazil/pt-br.md:91 — "Se você mora no Brasil, o Pix também pede CPF e endereço" → Se você mora no Brasil, o Pix também pede CPF, endereço e o aceite dos termos da Avenia
  • mono:content/countries/brazil/pt-br.md:75 — "Depósitos e saques em reais são para usuários com residência brasileira verificada e CPF." → Depósitos e saques em reais são para usuários com residência brasileira verificada, CPF e aceite dos termos da Avenia.
  • mono:content/countries/brazil/pt-br.md:87 — "O app pede seu CPF e seu endereço." → O app pede seu CPF, seu endereço e o aceite dos termos da Avenia.
  • mono:content/countries/brazil/pt-br.md:95 — "Quem mora no Brasil precisa de CPF para usar o Pix no Peanut" → Quem mora no Brasil precisa de CPF para usar o Pix no Peanut, e aceitar os termos da Avenia uma vez
  • mono:content/countries/brazil/es-419.md:62 — "Si vives en Brasil, Pix también te pide CPF y domicilio" → Si vives en Brasil, Pix también te pide CPF, domicilio y aceptar los términos de Avenia
  • mono:content/countries/brazil/es-419.md:66 — "Ese retiro requiere residencia brasileña verificada y CPF." → Ese retiro requiere residencia brasileña verificada, CPF y aceptar una vez los términos de Avenia.
  • mono:content/countries/brazil/es-419.md:81 — "Si vives en Brasil, la app también te pide tu CPF." → Si vives en Brasil, la app también te pide tu CPF y que aceptes los términos de Avenia una vez.
  • mono:content/countries/brazil/es-ar.md:63 — "Si vivís en Brasil, Pix también te pide CPF y domicilio" → Si vivís en Brasil, Pix también te pide CPF, domicilio y aceptar los términos de Avenia
  • mono:content/countries/brazil/es-ar.md:67 — "Ese retiro requiere residencia brasileña verificada y CPF." → Ese retiro requiere residencia brasileña verificada, CPF y aceptar una vez los términos de Avenia.
  • mono:content/countries/brazil/es-ar.md:82 — "Si vivís en Brasil, la app también te pide tu CPF." → Si vivís en Brasil, la app tam

Answered by a human, not raised again

These are still present as far as this review can tell. You resolved the thread or deferred the fix, so Chip does not repeat them. If one needs a follow-up, file the task yourself.

  • MAJOR · src/features/pix/pixRouteStep.ts:49 · Update Brazil Pix requirements after terms go live

Checked clean

  • P1 fixed: the terms latch resets when an opened deposit closes; the new deposit-flow test covers Start new deposit without replacing the existing code.
  • P2 fixed: the linked document precedes the localized Agree and continue consent action; the es-AR catalog inherits the CTA from es-419.
  • P3 remains in the current product/help copy and is explicitly tracked for after the API terms step goes live.
  • P4 silent-loop behavior fixed: a 409 with terms still named produces an error after the capability read. The paired API soft-signal contract is not on the policy branch and cannot be judged from this UI head.
  • Changed locale strings match the English acceptance meaning and the locale glossaries; the consent screen follows design.md consent-screen rules.
  • At final CI read, typecheck, eslint, format, design lint, screen-tests, and seo-contract passed; unit, i18n-overflow, and press-contract were still running. The earlier screenshot capture failures occurred on both base and prior head; the new Pix flow e2e cases were not run there.

Security review by moonshotai/kimi-k3: 0 finding(s), marked with the model name. It reads the diff only and answers only security, privacy and money, so treat its findings as advice.

Third opinion: did not run — it reads only the first review of a pull request; the first reviewer checks later rounds. This review is one reviewer short.

Copy check by claude-haiku-5-5: 1 finding(s), titled "Copy now wrong". Every quoted passage was checked against the file.

Exact head: e27412930391 · Context: repo, api, design, product, notion · Took 8m

): PixSetupState {
if (route?.state === 'action_required' && route.action === VERIFY_ACTION) return 'verify'
const terms = pixRouteTerms(route, nextActions)
if (terms && !setAsideTerms) return 'accept-terms'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR: Copy now wrong: Pix setup and CPF/address requirement lists omit the Avenia terms step

After this change: A Brazil resident's Pix (deposit, withdrawal, send or QR payment) now needs a one-time acceptance of Avenia's terms on the Pix setup screen, after identity and before the Avenia account opens, and any Pix attempt while the route still names the terms gets that screen.

These places still say otherwise:

  • mono:product/kyc.md:172 — "A resident of Brazil pays Pix through an Avenia account, which also needs a CPF and a home address." → A resident of Brazil pays Pix through an Avenia account, which also needs a CPF and a home address, and the user accepts the Avenia terms once before the first Pix.
  • mono:product/kyc.md:195 — "else at the first Pix use (about 6 seconds)." → else at the first Pix use, after the user accepts the Avenia terms once on the Pix setup screen (about 6 seconds).
  • mono:product/kyc.md:204 — "relies on Peanut's verification, needs a CPF and a home address" → relies on Peanut's verification, needs a CPF and a home address, and the user accepts the Avenia terms once
  • mono:product/support-answers/deposits-brazil-pix.md:34 — "on file gets the CPF step; one with no home address gets the address step." → on file gets the CPF step; one with no home address gets the address step; then, once, the user accepts the Avenia terms on the Pix setup screen before the account opens.
  • mono:product/support-answers/send-to-pix-key-brazil.md:59 — "account (CPF and home address) and its monthly limit applies." → account (CPF and home address, and acceptance of the Avenia terms once) and its monthly limit applies.
  • mono:product/support-answers/residence-country-and-tax-id.md:28 — "If you live in Brazil, Pix also needs your CPF and home address." → If you live in Brazil, Pix also needs your CPF and home address, and you accept the Avenia terms once.
  • mono:product/support-answers/residence-country-and-tax-id.md:57 — "account, which needs a CPF and a home address" → account, which needs a CPF, a home address and one acceptance of the Avenia terms
  • mono:content/pay-with/pix/en.md:82 — "If you live in Brazil, the app asks for your CPF and home address before your first Pix." → If you live in Brazil, the app asks for your CPF and home address, then has you accept the Avenia terms once, before your first Pix.
  • mono:content/pay-with/pix/pt-br.md:83 — "Se você mora no Brasil, o app pede seu CPF e seu endereço antes do primeiro Pix." → Se você mora no Brasil, o app pede seu CPF e seu endereço e depois o aceite dos termos da Avenia, antes do primeiro Pix.
  • mono:content/pay-with/pix/es-419.md:83 — "Si vives en Brasil, la app te pide tu CPF y tu domicilio antes del primer Pix." → Si vives en Brasil, la app te pide tu CPF y tu domicilio, y luego que aceptes los términos de Avenia, antes del primer Pix.
  • mono:content/pay-with/pix/es-ar.md:84 — "Si vivís en Brasil, la app te pide tu CPF y tu domicilio antes del primer Pix." → Si vivís en Brasil, la app te pide tu CPF y tu domicilio, y luego que aceptes los términos de Avenia, antes del primer Pix.
  • mono:content/pay-with/pix/es-es.md:79 — "Si vives en Brasil, la app te pide tu CPF y tu domicilio antes del primer Pix." → Si vives en Brasil, la app te pide tu CPF y tu domicilio, y luego que aceptes los términos de Avenia, antes del primer Pix.
  • mono:content/pay-with/pix/en.md:65 — "If you live in Brazil, Pix also needs your CPF and home address." → If you live in Brazil, Pix also needs your CPF and home address, and your acceptance of the Avenia terms once.
  • mono:content/pay-with/pix/pt-br.md:66 — "Se você mora no Brasil, o Pix também pede CPF e endereço." → Se você mora no Brasil, o Pix também pede CPF e endereço, e o aceite único dos termos da Avenia.
  • mono:content/pay-with/pix/es-419.md:66 — "Si vives en Brasil, Pix también te pide CPF y domicilio." → Si vives en Brasil, Pix también te pide CPF y domicilio, y aceptar una vez los términos de Avenia.
  • mono:content/pay-with/pix/es-ar.md:67 — "Si vivís en Brasil, Pix también te pide CPF y domicilio." → Si vivís en Brasil, Pix también te pide CPF y domicilio, y aceptar una vez los términos de Avenia.
  • mono:content/pay-with/pix/es-es.md:62 — "Si vives en Brasil, Pix también te pide CPF y domicilio." → Si vives en Brasil, Pix también te pide CPF y domicilio, y aceptar una vez los términos de Avenia.
  • mono:content/pay-with/pix/en.md:59 — "That withdrawal needs verified Brazilian residence and a CPF." → That withdrawal needs verified Brazilian residence, a CPF and the one-time acceptance of the Avenia terms.
  • mono:content/pay-with/pix/pt-br.md:60 — "Esse saque exige residência brasileira verificada e CPF." → Esse saque exige residência brasileira verificada, CPF e o aceite único dos termos da Avenia.
  • mono:content/pay-with/pix/es-419.md:60 — "Ese retiro requiere residencia brasileña verificada y CPF." → Ese retiro requiere residencia brasileña verificada, CPF y aceptar una vez los términos de Avenia.
  • mono:content/pay-with/pix/es-ar.md:61 — "Ese retiro requiere residencia brasileña verificada y CPF." → Ese retiro requiere residencia brasileña verificada, CPF y aceptar una vez los términos de Avenia.
  • mono:content/pay-with/pix/es-es.md:56 — "Ese retiro requiere residencia brasileña verificada y CPF." → Ese retiro requiere residencia brasileña verificada, CPF y aceptar una vez los términos de Avenia.
  • mono:content/countries/brazil/en.md:61 — "If you live in Brazil, Pix also needs your CPF and home address" → If you live in Brazil, Pix also needs your CPF, your home address and your acceptance of the Avenia terms, and you can add and withdraw BRL by Pix.
  • mono:content/countries/brazil/en.md:65 — "That withdrawal needs verified Brazilian residence and a CPF." → That withdrawal needs verified Brazilian residence, a CPF and the one-time acceptance of the Avenia terms.
  • mono:content/countries/brazil/en.md:80 — "If you live in Brazil, the app also asks for your CPF." → If you live in Brazil, the app also asks for your CPF and has you accept the Avenia terms once.
  • mono:content/countries/brazil/pt-br.md:91 — "Se você mora no Brasil, o Pix também pede CPF e endereço" → Se você mora no Brasil, o Pix também pede CPF, endereço e o aceite dos termos da Avenia
  • mono:content/countries/brazil/pt-br.md:75 — "Depósitos e saques em reais são para usuários com residência brasileira verificada e CPF." → Depósitos e saques em reais são para usuários com residência brasileira verificada, CPF e aceite dos termos da Avenia.
  • mono:content/countries/brazil/pt-br.md:87 — "O app pede seu CPF e seu endereço." → O app pede seu CPF, seu endereço e o aceite dos termos da Avenia.
  • mono:content/countries/brazil/pt-br.md:95 — "Quem mora no Brasil precisa de CPF para usar o Pix no Peanut" → Quem mora no Brasil precisa de CPF para usar o Pix no Peanut, e aceitar os termos da Avenia uma vez
  • mono:content/countries/brazil/es-419.md:62 — "Si vives en Brasil, Pix también te pide CPF y domicilio" → Si vives en Brasil, Pix también te pide CPF, domicilio y aceptar los términos de Avenia
  • mono:content/countries/brazil/es-419.md:66 — "Ese retiro requiere residencia brasileña verificada y CPF." → Ese retiro requiere residencia brasileña verificada, CPF y aceptar una vez los términos de Avenia.
  • mono:content/countries/brazil/es-419.md:81 — "Si vives en Brasil, la app también te pide tu CPF." → Si vives en Brasil, la app también te pide tu CPF y que aceptes los términos de Avenia una vez.
  • mono:content/countries/brazil/es-ar.md:63 — "Si vivís en Brasil, Pix también te pide CPF y domicilio" → Si vivís en Brasil, Pix también te pide CPF, domicilio y aceptar los términos de Avenia
  • mono:content/countries/brazil/es-ar.md:67 — "Ese retiro requiere residencia brasileña verificada y CPF." → Ese retiro requiere residencia brasileña verificada, CPF y aceptar una vez los términos de Avenia.
  • mono:content/countries/brazil/es-ar.md:82 — "Si vivís en Brasil, la app también te pide tu CPF." → Si vivís en Brasil, la app tam

This branch was successfully deployed

1 active deployment
Preview — e2741293 Deployed Nov 17, 2026 by vercel[bot]
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