iachat/app/javascript/dashboard/api/captain
Rodribm10 cfffea9c16 feat(captain): semantic memory fixes + roleta + reclamações + analytics
Consolida o trabalho desta branch de abril/2026 em um bloco pronto pra
testar em staging antes do merge pra main.

## Correções de memória semântica
- ExtractionService: Princípio Zero + Regra de Ouro (ação consumada vs intenção).
- Cenário Daniela_Reservas: Passo 0 de classificação (consulta/intenção/fora).

## Roleta da Sorte (end-to-end)
- Schema Supabase + 7 RPCs atômicas (server-side, idempotentes).
- Services: Offer, Redeem, WeeklyReport.
- Jobs: OfferRouletteJob (hook em ConfirmationService após Pix pago),
  NotifyRevealed + Scheduler de fallback.
- Tool manual GenerateRoletaLinkTool + endpoint público /roleta/notify.
- Dashboard /captain/roleta com Resgate + Relatório + anomaly detection.

## Cenário Reclamacoes_Ouvidoria
- Triagem P1-P4, framework LAST, Three-level listening, Self-check.
- Sem compensação material, detecção de cliente frustrado eleva prioridade.

## Analytics
- Funil de conversão /captain/funnel: 5 etapas via regex, zero LLM.
- Detector de churn via ChurnOutreach* (cron dias úteis 10h-17h BRT).

## Trabalho pré-existente incluído
- Captain Executive Reports (ceo_digest, mattermost_delivery).
- get_reserva_preco_tool, Lifecycle ajustes, Reservations UI polimentos.

## Outros
- .gitignore: patterns pra credenciais.
- Migrations de scenarios idempotentes.
- i18n completa pt_BR+en pra roleta/funnel.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 15:36:25 -03:00
..
assistant.js feat: Allow customizing the responses, flows in Captain (#11385) 2025-04-29 15:42:15 -07:00
bulkActions.js feat: Add support for bulk action for Captain FAQs (#10905) 2025-02-27 17:05:33 -08:00
contactMemories.js feat(captain-memory): add Contact Memory UI component + API client + i18n 2026-04-19 01:47:56 -03:00
copilotMessages.js feat: Add stores for copilotMessages and copilotThreads (#11603) 2025-05-27 18:36:32 -06:00
copilotThreads.js feat: Add stores for copilotMessages and copilotThreads (#11603) 2025-05-27 18:36:32 -06:00
customTools.js feat: Add UI for custom tools (#12585) 2025-10-06 09:05:54 -07:00
document.js feat: Add assistant filter support to documents page (#10697) 2025-01-15 21:41:07 -08:00
funnel.js feat(captain): semantic memory fixes + roleta + reclamações + analytics 2026-04-21 15:36:25 -03:00
galleryItems.js chore(style): fix rubocop offenses and update typing indicators 2026-02-25 15:06:58 -03:00
inboxes.js feat(ee): Add Captain features (#10665) 2025-01-14 16:15:47 -08:00
lifecycleConfig.js feat(lifecycle): API clients for rules/config/deliveries + concierge update 2026-04-15 10:42:51 -03:00
lifecycleDeliveries.js feat(lifecycle): API clients for rules/config/deliveries + concierge update 2026-04-15 10:42:51 -03:00
lifecycleRules.js feat(lifecycle): API clients for rules/config/deliveries + concierge update 2026-04-15 10:42:51 -03:00
notificationTemplates.js refactor: move notification templates de units para inboxes 2026-03-01 22:17:27 -03:00
preferences.js feat: add global config for captain settings (#13141) 2026-01-12 19:54:19 +05:30
reports.js feat(captain): semantic memory fixes + roleta + reclamações + analytics 2026-04-21 15:36:25 -03:00
reservations.js feat(captain): semantic memory fixes + roleta + reclamações + analytics 2026-04-21 15:36:25 -03:00
response.js feat: allow searching captain responses [CW-5631] (#12463) 2025-09-18 14:44:56 +05:30
roleta.js feat(captain): semantic memory fixes + roleta + reclamações + analytics 2026-04-21 15:36:25 -03:00
scenarios.js feat: New Scenarios page (#11975) 2025-07-30 19:34:27 +05:30
tasks.js feat: new Captain Editor (#13235) 2026-01-21 13:39:07 +05:30
tools.js feat: New Scenarios page (#11975) 2025-07-30 19:34:27 +05:30
units.js feat(lifecycle): API clients for rules/config/deliveries + concierge update 2026-04-15 10:42:51 -03:00