fix(ai): 'wallet app' triggers fintech unless Apple-Wallet pass context

The previous fix removed 'wallet app' from the fintech phrase list to
stop Apple-Wallet-pass briefs from being routed to a fintech style guide.
But that swung too far: bare 'design a wallet app' or 'wallet app to
send money' are common fintech briefs that don't carry a 'crypto'/
'digital'/'payment' modifier and now fell back to generic neutrals.

Hybrid rule: 'wallet app' triggers fintech UNLESS the brief also mentions
an Apple-Wallet-style context word (pass / passes / boarding / ticket /
tickets / ticketing / gift card / coupon / loyalty). Real fintech briefs
that center on a wallet app rarely use any of those words; Apple Wallet
briefs almost always do.

Verified:
- 'design a wallet app' / 'wallet app to send money' / 'wallet app with
  QR code support' → fintech ✓
- 'Apple Wallet app for boarding passes' / 'wallet app pass viewer' /
  'wallet app to store concert tickets' / 'wallet app for loyalty
  cards' → neutral fallback ✓
- crypto/digital/payment wallet, wallet payment(s), wallet connect,
  budget tracker — unchanged ✓
This commit is contained in:
Fini 2026-04-29 09:50:52 +08:00
parent 291e39e653
commit 7757dfe47e

View file

@ -456,14 +456,8 @@ function inferTagsFromPrompt(prompt: string): string[] {
// "budget tracker", "expense tracker") still match without forcing
// fintech onto every UI that mentions a budget.
// Wallet phrase triggers: every left-side modifier is unambiguously
// financial. Right-side patterns are intentionally restricted to
// `wallet payment(s)` and `wallet connect`, which are unambiguous
// fintech contexts. We deliberately exclude `wallet app` and
// `wallet pass`: both occur in Apple Wallet briefs that are about
// boarding passes, event tickets, gift cards, vaccination cards, or
// generic-iOS pass viewers — those are not fintech UI and shouldn't
// route to a fintech style guide. Real fintech briefs almost always
// qualify the wallet ("crypto wallet app", "payment wallet flow").
// financial; right-side patterns 'wallet payment(s)' / 'wallet connect'
// are also unambiguous fintech.
if (
/\b(crypto|digital|payment|hot|cold|hardware|web3)\s+wallet\b|\bwallet\s+(payments?|connect)\b/.test(
lower,
@ -471,6 +465,18 @@ function inferTagsFromPrompt(prompt: string): string[] {
) {
tags.push('fintech');
}
// 'wallet app' on its own usually means a fintech wallet ("design a
// wallet app to send money"), but in Apple-Wallet contexts it's the
// generic iOS feature for boarding passes, event tickets, gift cards,
// vaccination cards, and loyalty cards — none of which are fintech UI.
// Trigger fintech for 'wallet app' UNLESS the prompt also mentions an
// Apple-Wallet-style pass/ticket/coupon/loyalty context.
if (
/\bwallet\s+app\b/.test(lower) &&
!/\b(pass|passes|boarding|ticket|tickets|ticketing|gift\s+card|coupon|loyalty)\b/.test(lower)
) {
tags.push('fintech');
}
if (/\b(budget|expense)\s+(tracker|app|report|management|manager|tracking)\b/.test(lower)) {
tags.push('fintech');
}